3910 lines
4.7 MiB
3910 lines
4.7 MiB
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;l<this.chain.length;l++)n(this,this.state===1?this.chain[l].success:this.chain[l].failure,this.chain[l]);this.chain.length=0}function n(l,_,w){var S,E;try{_===!1?w.reject(l.msg):(_===!0?S=l.msg:S=_.call(void 0,l.msg),S===w.promise?w.reject(TypeError("Promise-chain cycle")):(E=i(S))?E.call(S,w.resolve,w.reject):w.resolve(S))}catch(g){w.reject(g)}}function o(l){var _,w=this;if(!w.triggered){w.triggered=!0,w.def&&(w=w.def);try{(_=i(l))?r(function(){var S=new h(w);try{_.call(l,function(){o.apply(S,arguments)},function(){s.apply(S,arguments)})}catch(E){s.call(S,E)}}):(w.msg=l,w.state=1,w.chain.length>0&&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 de<De?-1:de>De?1:de>=De?0:NaN}v.descending=function(de,De){return De<de?-1:De>de?1:De>=de?0:NaN},v.min=function(de,De){var et=-1,vt=de.length,_t,St;if(arguments.length===1){for(;++et<vt;)if((St=de[et])!=null&&St>=St){_t=St;break}for(;++et<vt;)(St=de[et])!=null&&_t>St&&(_t=St)}else{for(;++et<vt;)if((St=De.call(de,de[et],et))!=null&&St>=St){_t=St;break}for(;++et<vt;)(St=De.call(de,de[et],et))!=null&&_t>St&&(_t=St)}return _t},v.max=function(de,De){var et=-1,vt=de.length,_t,St;if(arguments.length===1){for(;++et<vt;)if((St=de[et])!=null&&St>=St){_t=St;break}for(;++et<vt;)(St=de[et])!=null&&St>_t&&(_t=St)}else{for(;++et<vt;)if((St=De.call(de,de[et],et))!=null&&St>=St){_t=St;break}for(;++et<vt;)(St=De.call(de,de[et],et))!=null&&St>_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<vt;)if((St=de[et])!=null&&St>=St){_t=ar=St;break}for(;++et<vt;)(St=de[et])!=null&&(_t>St&&(_t=St),ar<St&&(ar=St))}else{for(;++et<vt;)if((St=De.call(de,de[et],et))!=null&&St>=St){_t=ar=St;break}for(;++et<vt;)(St=De.call(de,de[et],et))!=null&&(_t>St&&(_t=St),ar<St&&(ar=St))}return[_t,ar]};function c(de){return de===null?NaN:+de}function h(de){return!isNaN(de)}v.sum=function(de,De){var et=0,vt=de.length,_t,St=-1;if(arguments.length===1)for(;++St<vt;)h(_t=+de[St])&&(et+=_t);else for(;++St<vt;)h(_t=+De.call(de,de[St],St))&&(et+=_t);return et},v.mean=function(de,De){var et=0,vt=de.length,_t,St=-1,ar=vt;if(arguments.length===1)for(;++St<vt;)h(_t=c(de[St]))?et+=_t:--ar;else for(;++St<vt;)h(_t=c(De.call(de,de[St],St)))?et+=_t:--ar;if(ar)return et/ar},v.quantile=function(de,De){var et=(de.length-1)*De+1,vt=Math.floor(et),_t=+de[vt-1],St=et-vt;return St?_t+St*(de[vt]-_t):_t},v.median=function(de,De){var et=[],vt=de.length,_t,St=-1;if(arguments.length===1)for(;++St<vt;)h(_t=c(de[St]))&&et.push(_t);else for(;++St<vt;)h(_t=c(De.call(de,de[St],St)))&&et.push(_t);if(et.length)return v.quantile(et.sort(s),.5)},v.variance=function(de,De){var et=de.length,vt=0,_t,St,ar=0,zt=-1,gr=0;if(arguments.length===1)for(;++zt<et;)h(_t=c(de[zt]))&&(St=_t-vt,vt+=St/++gr,ar+=St*(_t-vt));else for(;++zt<et;)h(_t=c(De.call(de,de[zt],zt)))&&(St=_t-vt,vt+=St/++gr,ar+=St*(_t-vt));if(gr>1)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<et;)St[De]=[vt=_t,_t=de[++De]];return St},v.transpose=function(de){if(!(St=de.length))return[];for(var De=-1,et=v.min(de,T),vt=new Array(et);++De<et;)for(var _t=-1,St,ar=vt[De]=new Array(St);++_t<St;)ar[_t]=de[_t][De];return vt};function T(de){return de.length}v.zip=function(){return v.transpose(arguments)},v.keys=function(de){var De=[];for(var et in de)De.push(et);return De},v.values=function(de){var De=[];for(var et in de)De.push(de[et]);return De},v.entries=function(de){var De=[];for(var et in de)De.push({key:et,value:de[et]});return De},v.merge=function(de){for(var De=de.length,et,vt=-1,_t=0,St,ar;++vt<De;)_t+=de[vt].length;for(St=new Array(_t);--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;)vt.push(ar/_t);return vt};function _(de){for(var De=1;de*De%1;)De*=10;return De}function w(de,De){for(var et in De)Object.defineProperty(de.prototype,et,{value:De[et],enumerable:!1})}v.map=function(de,De){var et=new S;if(de instanceof S)de.forEach(function(zt,gr){et.set(zt,gr)});else if(Array.isArray(de)){var vt=-1,_t=de.length,St;if(arguments.length===1)for(;++vt<_t;)et.set(vt,de[vt]);else for(;++vt<_t;)et.set(De.call(de,St=de[vt],vt),St)}else for(var ar in de)et.set(ar,de[ar]);return et};function S(){this._=Object.create(null)}var E="__proto__",g="\0";w(S,{has:u,get:function(de){return this._[b(de)]},set:function(de,De){return this._[b(de)]=De},remove:y,keys:f,values:function(){var de=[];for(var De in this._)de.push(this._[De]);return de},entries:function(){var de=[];for(var De in this._)de.push({key:p(De),value:this._[De]});return de},size:P,empty:L,forEach:function(de){for(var De in this._)de.call(this,p(De),this._[De])}});function b(de){return(de+="")===E||de[0]===g?g+de:de}function p(de){return(de+="")[0]===g?de.slice(1):de}function u(de){return b(de)in this._}function y(de){return(de=b(de))in this._&&delete this._[de]}function f(){var de=[];for(var De in this._)de.push(p(De));return de}function P(){var de=0;for(var De in this._)++de;return de}function L(){for(var de in this._)return!1;return!0}v.nest=function(){var de={},De=[],et=[],vt,_t;function St(zt,gr,qr){if(qr>=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<Ta;)(Ka=Na.get(tn=ya(on=gr[Wr])))?Ka.push(on):Na.set(tn,[on]);return zt?(on=zt(),Ma=function(mn,cn){on.set(mn,St(zt,cn,qr))}):(on={},Ma=function(mn,cn){on[mn]=St(zt,cn,qr)}),Na.forEach(Ma),on}function ar(zt,gr){if(gr>=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<vt;++et)De.add(de[et]);return De};function z(){this._=Object.create(null)}w(z,{has:u,add:function(de){return this._[b(de+="")]=!0,de},remove:y,values:f,size:P,empty:L,forEach:function(de){for(var De in this._)de.call(this,p(De))}}),v.behavior={};function F(de){return de}v.rebind=function(de,De){for(var et=1,vt=arguments.length,_t;++et<vt;)de[_t=arguments[et]]=B(de,De,De[_t]);return de};function B(de,De,et){return function(){var vt=et.apply(De,arguments);return vt===De?de:vt}}function O(de,De){if(De in de)return De;De=De.charAt(0).toUpperCase()+De.slice(1);for(var et=0,vt=I.length;et<vt;++et){var _t=I[et]+De;if(_t in de)return _t}}var I=["webkit","ms","moz","Moz","o","O"];function N(){}v.dispatch=function(){for(var de=new U,De=-1,et=arguments.length;++De<et;)de[arguments[De]]=W(de);return de};function U(){}U.prototype.on=function(de,De){var et=de.indexOf("."),vt="";if(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<ar;)(zt=_t[St].on)&&zt.apply(this,arguments);return de}return vt.on=function(_t,St){var ar=et.get(_t),zt;return arguments.length<2?ar&&ar.on:(ar&&(ar.on=null,De=De.slice(0,zt=De.indexOf(ar)).concat(De.slice(zt+1)),et.remove(_t)),St&&De.push(et.set(_t,{on:St})),de)},vt}v.event=null;function Q(){v.event.preventDefault()}function ue(){for(var de=v.event,De;De=de.sourceEvent;)de=De;return de}function se(de){for(var De=new U,et=0,vt=arguments.length;++et<vt;)De[arguments[et]]=W(De);return De.of=function(_t,St){return function(ar){try{var zt=ar.sourceEvent=v.event;ar.target=de,v.event=ar,De[ar.type].apply(_t,St)}finally{v.event=zt}}},De}v.requote=function(de){return de.replace(he,"\\$&")};var he=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(de,De){de.__proto__=De}:function(de,De){for(var et in De)de[et]=De[et]};function $(de){return H(de,ne),de}var J=function(de,De){return De.querySelector(de)},X=function(de,De){return De.querySelectorAll(de)},oe=function(de,De){var et=de.matches||de[O(de,"matchesSelector")];return oe=function(vt,_t){return et.call(vt,_t)},oe(de,De)};typeof Sizzle=="function"&&(J=function(de,De){return Sizzle(de,De)[0]||null},X=Sizzle,oe=Sizzle.matchesSelector),v.selection=function(){return v.select(M.documentElement)};var ne=v.selection.prototype=[];ne.select=function(de){var De=[],et,vt,_t,St;de=j(de);for(var ar=-1,zt=this.length;++ar<zt;){De.push(et=[]),et.parentNode=(_t=this[ar]).parentNode;for(var gr=-1,qr=_t.length;++gr<qr;)(St=_t[gr])?(et.push(vt=de.call(St,St.__data__,gr,ar)),vt&&"__data__"in St&&(vt.__data__=St.__data__)):et.push(null)}return $(De)};function j(de){return typeof de=="function"?de:function(){return J(de,this)}}ne.selectAll=function(de){var De=[],et,vt;de=ee(de);for(var _t=-1,St=this.length;++_t<St;)for(var ar=this[_t],zt=-1,gr=ar.length;++zt<gr;)(vt=ar[zt])&&(De.push(et=A(de.call(vt,vt.__data__,zt,_t))),et.parentNode=vt);return $(De)};function ee(de){return typeof de=="function"?de:function(){return X(de,this)}}var re="http://www.w3.org/1999/xhtml",ce={svg:"http://www.w3.org/2000/svg",xhtml:re,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};v.ns={prefix:ce,qualify:function(de){var De=de.indexOf(":"),et=de;return De>=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<vt;)if(!De.contains(de[_t]))return!1}else for(De=et.getAttribute("class");++_t<vt;)if(!ze(de[_t]).test(De))return!1;return!0}for(De in de)this.each(We(De,de[De]));return this}return this.each(We(de,De))};function ze(de){return new RegExp("(?:^|\\s+)"+v.requote(de)+"(?:\\s+|$)","g")}function Re(de){return(de+"").trim().split(/^|\s+/)}function We(de,De){de=Re(de).map(it);var et=de.length;function vt(){for(var St=-1;++St<et;)de[St](this,De)}function _t(){for(var St=-1,ar=De.apply(this,arguments);++St<et;)de[St](this,ar)}return typeof De=="function"?_t:vt}function it(de){var De=ze(de);return function(et,vt){if(_t=et.classList)return vt?_t.add(de):_t.remove(de);var _t=et.getAttribute("class")||"";vt?(De.lastIndex=0,De.test(_t)||et.setAttribute("class",Ae(_t+" "+de))):et.setAttribute("class",Ae(_t.replace(De," ")))}}ne.style=function(de,De,et){var vt=arguments.length;if(vt<3){if(typeof de!="string"){vt<2&&(De="");for(et in de)this.each(ot(et,de[et],De));return this}if(vt<2){var _t=this.node();return t(_t).getComputedStyle(_t,null).getPropertyValue(de)}et=""}return this.each(ot(de,De,et))};function ot(de,De,et){function vt(){this.style.removeProperty(de)}function _t(){this.style.setProperty(de,De,et)}function St(){var ar=De.apply(this,arguments);ar==null?this.style.removeProperty(de):this.style.setProperty(de,ar,et)}return De==null?vt:typeof De=="function"?St:_t}ne.property=function(de,De){if(arguments.length<2){if(typeof de=="string")return this.node()[de];for(De in de)this.each(tt(De,de[De]));return this}return this.each(tt(de,De))};function tt(de,De){function et(){delete this[de]}function vt(){this[de]=De}function _t(){var St=De.apply(this,arguments);St==null?delete this[de]:this[de]=St}return De==null?et:typeof De=="function"?_t:vt}ne.text=function(de){return arguments.length?this.each(typeof de=="function"?function(){var De=de.apply(this,arguments);this.textContent=De??""}:de==null?function(){this.textContent=""}:function(){this.textContent=de}):this.node().textContent},ne.html=function(de){return arguments.length?this.each(typeof de=="function"?function(){var De=de.apply(this,arguments);this.innerHTML=De??""}:de==null?function(){this.innerHTML=""}:function(){this.innerHTML=de}):this.node().innerHTML},ne.append=function(de){return de=ut(de),this.select(function(){return this.appendChild(de.apply(this,arguments))})};function ut(de){function De(){var vt=this.ownerDocument,_t=this.namespaceURI;return _t===re&&vt.documentElement.namespaceURI===re?vt.createElement(de):vt.createElementNS(_t,de)}function et(){return this.ownerDocument.createElementNS(de.space,de.local)}return typeof de=="function"?de:(de=v.ns.qualify(de)).local?et:De}ne.insert=function(de,De){return de=ut(de),De=j(De),this.select(function(){return this.insertBefore(de.apply(this,arguments),De.apply(this,arguments)||null)})},ne.remove=function(){return this.each(Me)};function Me(){var de=this.parentNode;de&&de.removeChild(this)}ne.data=function(de,De){var et=-1,vt=this.length,_t,St;if(!arguments.length){for(de=new Array(vt=(_t=this[0]).length);++et<vt;)(St=_t[et])&&(de[et]=St.__data__);return de}function ar(Wr,Ta){var ya,tn=Wr.length,on=Ta.length,Ma=Math.min(tn,on),Na=new Array(on),Ka=new Array(on),mn=new Array(tn),cn,Pa;if(De){var si=new S,ni=new Array(tn),vi;for(ya=-1;++ya<tn;)(cn=Wr[ya])&&(si.has(vi=De.call(cn,cn.__data__,ya))?mn[ya]=cn:si.set(vi,cn),ni[ya]=vi);for(ya=-1;++ya<on;)(cn=si.get(vi=De.call(Ta,Pa=Ta[ya],ya)))?cn!==!0&&(Na[ya]=cn,cn.__data__=Pa):Ka[ya]=_e(Pa),si.set(vi,!0);for(ya=-1;++ya<tn;)ya in ni&&si.get(ni[ya])!==!0&&(mn[ya]=Wr[ya])}else{for(ya=-1;++ya<Ma;)cn=Wr[ya],Pa=Ta[ya],cn?(cn.__data__=Pa,Na[ya]=cn):Ka[ya]=_e(Pa);for(;ya<on;++ya)Ka[ya]=_e(Ta[ya]);for(;ya<tn;++ya)mn[ya]=Wr[ya]}Ka.update=Na,Ka.parentNode=Na.parentNode=mn.parentNode=Wr.parentNode,zt.push(Ka),gr.push(Na),qr.push(mn)}var zt=st([]),gr=$([]),qr=$([]);if(typeof de=="function")for(;++et<vt;)ar(_t=this[et],de.call(_t,_t.parentNode.__data__,et));else for(;++et<vt;)ar(_t=this[et],de);return gr.enter=function(){return zt},gr.exit=function(){return qr},gr};function _e(de){return{__data__:de}}ne.datum=function(de){return arguments.length?this.property("__data__",de):this.property("__data__")},ne.filter=function(de){var De=[],et,vt,_t;typeof de!="function"&&(de=fe(de));for(var St=0,ar=this.length;St<ar;St++){De.push(et=[]),et.parentNode=(vt=this[St]).parentNode;for(var zt=0,gr=vt.length;zt<gr;zt++)(_t=vt[zt])&&de.call(_t,_t.__data__,zt,St)&&et.push(_t)}return $(De)};function fe(de){return function(){return oe(this,de)}}ne.order=function(){for(var de=-1,De=this.length;++de<De;)for(var et=this[de],vt=et.length-1,_t=et[vt],St;--vt>=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<et;)this[De].sort(de);return this.order()};function Fe(de){return arguments.length||(de=s),function(De,et){return De&&et?de(De.__data__,et.__data__):!De-!et}}ne.each=function(de){return rt(this,function(De,et,vt){de.call(De,De.__data__,et,vt)})};function rt(de,De){for(var et=0,vt=de.length;et<vt;et++)for(var _t=de[et],St=0,ar=_t.length,zt;St<ar;St++)(zt=_t[St])&&De(zt,St,et);return de}ne.call=function(de){var De=A(arguments);return de.apply(De[0]=this,De),this},ne.empty=function(){return!this.node()},ne.node=function(){for(var de=0,De=this.length;de<De;de++)for(var et=this[de],vt=0,_t=et.length;vt<_t;vt++){var St=et[vt];if(St)return St}return null},ne.size=function(){var de=0;return rt(this,function(){++de}),de};function st(de){return H(de,Qe),de}var Qe=[];v.selection.enter=st,v.selection.enter.prototype=Qe,Qe.append=ne.append,Qe.empty=ne.empty,Qe.node=ne.node,Qe.call=ne.call,Qe.size=ne.size,Qe.select=function(de){for(var De=[],et,vt,_t,St,ar,zt=-1,gr=this.length;++zt<gr;){_t=(St=this[zt]).update,De.push(et=[]),et.parentNode=St.parentNode;for(var qr=-1,Wr=St.length;++qr<Wr;)(ar=St[qr])?(et.push(_t[qr]=vt=de.call(St.parentNode,ar.__data__,qr,zt)),vt.__data__=ar.__data__):et.push(null)}return $(De)},Qe.insert=function(de,De){return arguments.length<2&&(De=Lt(this)),ne.insert.call(this,de,De)};function Lt(de){var De,et;return function(vt,_t,St){var ar=de[St].update,zt=ar.length,gr;for(St!=et&&(et=St,De=0),_t>=De&&(De=_t+1);!(gr=ar[De])&&++De<zt;);return gr}}v.select=function(de){var De;return typeof de=="string"?(De=[J(de,M)],De.parentNode=M.documentElement):(De=[de],De.parentNode=e(de)),$([De])},v.selectAll=function(de){var De;return typeof de=="string"?(De=A(X(de,M)),De.parentNode=M.documentElement):(De=A(de),De.parentNode=null),$([De])},ne.on=function(de,De,et){var vt=arguments.length;if(vt<3){if(typeof de!="string"){vt<2&&(De=!1);for(et in de)this.each(kt(et,de[et],De));return this}if(vt<2)return(vt=this.node()["__on"+de])&&vt._;et=!1}return this.each(kt(de,De,et))};function kt(de,De,et){var vt="__on"+de,_t=de.indexOf("."),St=Zt;_t>0&&(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(Wr<Ue)ya=Math.log(zt/_t)/Ua,Ta=function(mn){return[et+mn*gr,vt+mn*qr,_t*Math.exp(Ua*mn*ya)]};else{var tn=Math.sqrt(Wr),on=(zt*zt-_t*_t+Ra*Wr)/(2*_t*Ba*tn),Ma=(zt*zt-_t*_t-Ra*Wr)/(2*zt*Ba*tn),Na=Math.log(Math.sqrt(on*on+1)-on),Ka=Math.log(Math.sqrt(Ma*Ma+1)-Ma);ya=(Ka-Na)/Ua,Ta=function(mn){var cn=mn*ya,Pa=Qt(Na),si=_t/(Ba*tn)*(Pa*Tr(Ua*cn+Na)-rr(Na));return[et+si*gr,vt+si*qr,_t*Pa/Qt(Ua*cn+Na)]}}return Ta.duration=ya*1e3,Ta},v.behavior.zoom=function(){var de={x:0,y:0,k:1},De,et,vt,_t=[960,500],St=Qa,ar=250,zt=0,gr="mousedown.zoom",qr="mousemove.zoom",Wr="mouseup.zoom",Ta,ya="touchstart.zoom",tn,on=se(cn,"zoomstart","zoom","zoomend"),Ma,Na,Ka,mn;en||(en="onwheel"in M?(za=function(){return-v.event.deltaY*(v.event.deltaMode?120:1)},"wheel"):"onmousewheel"in M?(za=function(){return v.event.wheelDelta},"mousewheel"):(za=function(){return-v.event.detail},"MozMousePixelScroll"));function cn(gi){gi.on(gr,Zo).on(en+".zoom",el).on("dblclick.zoom",_l).on(ya,ul)}cn.event=function(gi){gi.each(function(){var vo=on.of(this,arguments),cs=de;hs?v.select(this).transition().each("start.zoom",function(){de=this.__chart__||{x:0,y:0,k:1},eo(vo)}).tween("zoom:zoom",function(){var ps=_t[0],Tl=_t[1],Gl=et?et[0]:ps/2,Tu=et?et[1]:Tl/2,Il=v.interpolateZoom([(Gl-de.x)/de.k,(Tu-de.y)/de.k,ps/de.k],[(Gl-cs.x)/cs.k,(Tu-cs.y)/cs.k,ps/cs.k]);return function(yc){var nt=Il(yc),Yt=ps/nt[2];this.__chart__=de={x:Gl-nt[0]*Yt,y:Tu-nt[1]*Yt,k:Yt},$o(vo)}}).each("interrupt.zoom",function(){no(vo)}).each("end.zoom",function(){no(vo)}):(this.__chart__=de,eo(vo),$o(vo),no(vo))})},cn.translate=function(gi){return arguments.length?(de={x:+gi[0],y:+gi[1],k:de.k},Zi(),cn):[de.x,de.y]},cn.scale=function(gi){return arguments.length?(de={x:de.x,y:de.y,k:null},ni(+gi),Zi(),cn):de.k},cn.scaleExtent=function(gi){return arguments.length?(St=gi==null?Qa:[+gi[0],+gi[1]],cn):St},cn.center=function(gi){return arguments.length?(vt=gi&&[+gi[0],+gi[1]],cn):vt},cn.size=function(gi){return arguments.length?(_t=gi&&[+gi[0],+gi[1]],cn):_t},cn.duration=function(gi){return arguments.length?(ar=+gi,cn):ar},cn.x=function(gi){return arguments.length?(Na=gi,Ma=gi.copy(),de={x:0,y:0,k:1},cn):Na},cn.y=function(gi){return arguments.length?(mn=gi,Ka=gi.copy(),de={x:0,y:0,k:1},cn):mn};function Pa(gi){return[(gi[0]-de.x)/de.k,(gi[1]-de.y)/de.k]}function si(gi){return[gi[0]*de.k+de.x,gi[1]*de.k+de.y]}function ni(gi){de.k=Math.max(St[0],Math.min(St[1],gi))}function vi(gi,vo){vo=si(vo),de.x+=gi[0]-vo[0],de.y+=gi[1]-vo[1]}function Pi(gi,vo,cs,ps){gi.__chart__={x:de.x,y:de.y,k:de.k},ni(Math.pow(2,ps)),vi(et=vo,cs),gi=v.select(gi),ar>0&&(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;Sn<wn;++Sn)cs[Ja[Sn].identifier]=null;var hn=cr(),yi=Date.now();if(hn.length===1){if(yi-tn<500){var Bn=hn[0];Pi(gi,Bn,cs[Bn.identifier],Math.floor(Math.log(de.k)/Math.LN2)+1),Q()}tn=yi}else if(hn.length>1){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;yi<Bn;++yi,hn=null)if(wn=wa[yi],hn=cs[wn.identifier]){if(Sn)break;Ja=wn,Sn=hn}if(hn){var Ln=(Ln=wn[0]-Ja[0])*Ln+(Ln=wn[1]-Ja[1])*Ln,Va=ps&&Math.sqrt(Ln/ps);Ja=[(Ja[0]+wn[0])/2,(Ja[1]+wn[1])/2],Sn=[(Sn[0]+hn[0])/2,(Sn[1]+hn[1])/2],ni(Va*Tl)}tn=null,vi(Ja,Sn),$o(vo)}function xa(){if(v.event.touches.length){for(var wa=v.event.changedTouches,Ja=0,Sn=wa.length;Ja<Sn;++Ja)delete cs[wa[Ja].identifier];for(var wn in cs)return void cr()}v.selectAll(yc).on(Gl,null),nt.on(gr,Zo).on(ya,ul),Yt(),no(vo)}}function el(){var gi=on.of(this,arguments);Ta?clearTimeout(Ta):(Bi.call(this),De=Pa(et=vt||v.mouse(this)),eo(gi)),Ta=setTimeout(function(){Ta=null,no(gi)},50),Q(),ni(Math.pow(2,za()*.002)*de.k),vi(et,De),$o(gi)}function _l(){var gi=v.mouse(this),vo=Math.log(de.k)/Math.LN2;Pi(this,gi,Pa(gi),v.event.shiftKey?Math.ceil(vo)-1:Math.floor(vo)+1)}return v.rebind(cn,on,"on")};var Qa=[0,1/0],za,en;v.color=kn;function kn(){}kn.prototype.toString=function(){return this.rgb()+""},v.hsl=Jt;function Jt(de,De,et){return this instanceof Jt?(this.h=+de,this.s=+De,void(this.l=+et)):arguments.length<2?de instanceof Jt?new Jt(de.h,de.s,de.l):aa(""+de,da,Jt):new Jt(de,De,et)}var Nt=Jt.prototype=new kn;Nt.brighter=function(de){return de=Math.pow(.7,arguments.length?de:1),new Jt(this.h,this.s,this.l/de)},Nt.darker=function(de){return de=Math.pow(.7,arguments.length?de:1),new Jt(this.h,this.s,de*this.l)},Nt.rgb=function(){return Kt(this.h,this.s,this.l)};function Kt(de,De,et){var vt,_t;de=isNaN(de)?0:(de%=360)<0?de+360:de,De=isNaN(De)||De<0?0:De>1?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+(De<et?6:0):De==_t?ar=(et-de)/St+2:ar=(de-De)/St+4,ar*=60):(ar=NaN,zt=gr>0&&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<Ka;++mn)Na[ya[mn]]=Ma[mn];return Na};Ta=Wr?function(Ma,Na){return Wr(on(Ma),Na)}:on})},_t.parseRows=function(qr,Wr){var Ta={},ya={},tn=[],on=qr.length,Ma=0,Na=0,Ka,mn;function cn(){if(Ma>=on)return ya;if(mn)return mn=!1,Ta;var si=Ma;if(qr.charCodeAt(si)===34){for(var ni=si;ni++<on;)if(qr.charCodeAt(ni)===34){if(qr.charCodeAt(ni+1)!==34)break;++ni}Ma=ni+2;var vi=qr.charCodeAt(ni+1);return vi===13?(mn=!0,qr.charCodeAt(ni+2)===10&&++Ma):vi===10&&(mn=!0),qr.slice(si+1,ni).replace(/""/g,'"')}for(;Ma<on;){var vi=qr.charCodeAt(Ma++),Pi=1;if(vi===10)mn=!0;else if(vi===13)mn=!0,qr.charCodeAt(Ma)===10&&(++Ma,++Pi);else if(vi!==vt)continue;return qr.slice(si,Ma-Pi)}return qr.slice(si)}for(;(Ka=cn())!==ya;){for(var Pa=[];Ka!==Ta&&Ka!==ya;)Pa.push(Ka),Ka=cn();Wr&&(Pa=Wr(Pa,Na++))==null||tn.push(Pa)}return tn},_t.format=function(qr){if(Array.isArray(qr[0]))return _t.formatRows(qr);var Wr=new z,Ta=[];return qr.forEach(function(ya){for(var tn in ya)Wr.has(tn)||Ta.push(Wr.add(tn))}),[Ta.map(gr).join(de)].concat(qr.map(function(ya){return Ta.map(function(tn){return gr(ya[tn])}).join(de)})).join(`
|
||
`)},_t.formatRows=function(qr){return qr.map(zt).join(`
|
||
`)};function zt(qr){return qr.map(gr).join(de)}function gr(qr){return et.test(qr)?'"'+qr.replace(/\"/g,'""')+'"':qr}return _t},v.csv=v.dsv(",","text/csv"),v.tsv=v.dsv(" ","text/tab-separated-values");var Da,Zn,Pn,fi,Ai=this[O(this,"requestAnimationFrame")]||function(de){setTimeout(de,17)};v.timer=function(){ki.apply(this,arguments)};function ki(de,De,et){var vt=arguments.length;vt<2&&(De=0),vt<3&&(et=Date.now());var _t=et+De,St={c:de,t:_t,n:null};return Zn?Zn.n=St:Da=St,Zn=St,Pn||(fi=clearTimeout(fi),Pn=1,Ai(zi)),St}function zi(){var de=Xi(),De=to()-de;De>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<et&&(et=De.t),De=(de=De).n):De=de?de.n=De.n:Da=De.n;return Zn=de,et}v.round=function(de,De){return De?Math.round(de*(De=Math.pow(10,De)))/De:Math.round(de)},v.geom={};function go(de){return de[0]}function pi(de){return de[1]}v.geom.hull=function(de){var De=go,et=pi;if(arguments.length)return vt(de);function vt(_t){if(_t.length<3)return[];var St=na(De),ar=na(et),zt,gr=_t.length,qr=[],Wr=[];for(zt=0;zt<gr;zt++)qr.push([+St.call(this,_t[zt],zt),+ar.call(this,_t[zt],zt),zt]);for(qr.sort(Xo),zt=0;zt<gr;zt++)Wr.push([qr[zt][0],-qr[zt][1]]);var Ta=Jo(qr),ya=Jo(Wr),tn=ya[0]===Ta[0],on=ya[ya.length-1]===Ta[Ta.length-1],Ma=[];for(zt=Ta.length-1;zt>=0;--zt)Ma.push(_t[qr[Ta[zt]][2]]);for(zt=+tn;zt<ya.length-on;++zt)Ma.push(_t[qr[ya[zt]][2]]);return Ma}return vt.x=function(_t){return arguments.length?(De=_t,vt):De},vt.y=function(_t){return arguments.length?(et=_t,vt):et},vt};function Jo(de){for(var De=de.length,et=[0,1],vt=2,_t=2;_t<De;_t++){for(;vt>1&&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;++de<De;)et=vt,vt=this[de],_t+=et[1]*vt[0]-et[0]*vt[1];return _t*.5},Ts.centroid=function(de){var De=-1,et=this.length,vt=0,_t=0,St,ar=this[et-1],zt;for(arguments.length||(de=-1/(6*this.area()));++De<et;)St=ar,ar=this[De],zt=St[0]*ar[1]-ar[0]*St[1],vt+=(St[0]+ar[0])*zt,_t+=(St[1]+ar[1])*zt;return[vt*de,_t*de]},Ts.clip=function(de){for(var De,et=qi(de),vt=-1,_t=this.length-qi(this),St,ar,zt=this[_t-1],gr,qr,Wr;++vt<_t;){for(De=de.slice(),de.length=0,gr=this[vt],qr=De[(ar=De.length-et)-1],St=-1;++St<ar;)Wr=De[St],Po(Wr,zt,gr)?(Po(qr,zt,gr)||de.push(so(qr,Wr,zt,gr)),de.push(Wr)):Po(qr,zt,gr)&&de.push(so(qr,Wr,zt,gr)),qr=Wr;et&&de.push(de[0]),zt=gr}return de};function Po(de,De,et){return(et[0]-De[0])*(de[1]-De[1])<(et[1]-De[1])*(de[0]-De[0])}function so(de,De,et,vt){var _t=de[0],St=et[0],ar=De[0]-_t,zt=vt[0]-St,gr=de[1],qr=et[1],Wr=De[1]-gr,Ta=vt[1]-qr,ya=(zt*(gr-qr)-Ta*(_t-St))/(Ta*ar-zt*Wr);return[_t+ya*ar,gr+ya*Wr]}function qi(de){var De=de[0],et=de[de.length-1];return!(De[0]-et[0]||De[1]-et[1])}var To,Vo,Oo,lo=[],Co,os,Ys=[];function Os(){Ns(this),this.edge=this.site=this.circle=null}function Yo(de){var De=lo.pop()||new Os;return De.site=de,De}function jn(de){po(de),Oo.remove(de),lo.push(de),Ns(de)}function Ci(de){var De=de.circle,et=De.x,vt=De.cy,_t={x:et,y:vt},St=de.P,ar=de.N,zt=[de];jn(de);for(var gr=St;gr.circle&&l(et-gr.circle.x)<Ke&&l(vt-gr.circle.cy)<Ke;)St=gr.P,zt.unshift(gr),jn(gr),gr=St;zt.unshift(gr),po(gr);for(var qr=ar;qr.circle&&l(et-qr.circle.x)<Ke&&l(vt-qr.circle.cy)<Ke;)ar=qr.N,zt.push(qr),jn(qr),qr=ar;zt.push(qr),po(qr);var Wr=zt.length,Ta;for(Ta=1;Ta<Wr;++Ta)qr=zt[Ta],gr=zt[Ta-1],fl(qr.edge,gr.site,qr.site,_t);gr=zt[0],qr=zt[Wr-1],qr.edge=zs(gr.site,qr.site,null,_t),Si(gr),Si(qr)}function tl(de){for(var De=de.x,et=de.y,vt,_t,St,ar,zt=Oo._;zt;)if(St=Bs(zt,et)-De,St>Ke)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;ya<on;)Na=tn[ya].end(),zt=Na.x,gr=Na.y,Ma=tn[++ya%on].start(),St=Ma.x,ar=Ma.y,(l(zt-St)>Ke||l(gr-ar)>Ke)&&(tn.splice(ya,0,new xu(au(Ta.site,Na,l(zt-De)<Ke&&_t-gr>Ke?{x:De,y:l(St-De)<Ke?ar:_t}:l(gr-_t)<Ke&&et-zt>Ke?{x:l(ar-_t)<Ke?St:et,y:_t}:l(zt-et)<Ke&&gr-vt>Ke?{x:et,y:l(St-et)<Ke?ar:vt}:l(gr-vt)<Ke&&zt-De>Ke?{x:l(ar-vt)<Ke?St:De,y:vt}:null),Ta.site,null)),++on)}function Is(de,De){return De.angle-de.angle}function rl(){Ns(this),this.x=this.y=this.arc=this.site=this.cy=null}function Si(de){var De=de.P,et=de.N;if(!(!De||!et)){var vt=De.site,_t=de.site,St=et.site;if(vt!==St){var ar=_t.x,zt=_t.y,gr=vt.x-ar,qr=vt.y-zt,Wr=St.x-ar,Na=St.y-zt,Ta=2*(gr*Na-qr*Wr);if(!(Ta>=-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.y<cn.y||Ka.y===cn.y&&Ka.x<=cn.x)if(cn.L)cn=cn.L;else{mn=cn.P;break}else if(cn.R)cn=cn.R;else{mn=cn;break}os.insert(mn,Ka),mn||(Co=Ka)}}}}function po(de){var De=de.circle;De&&(De.P||(Co=De.N),os.remove(De),Ys.push(De),Ns(De),de.circle=null)}function ro(de,De,et,vt){return function(_t){var St=_t.a,ar=_t.b,zt=St.x,gr=St.y,qr=ar.x,Wr=ar.y,Ta=0,ya=1,tn=qr-zt,on=Wr-gr,Ma;if(Ma=de-zt,!(!tn&&Ma>0)){if(Ma/=tn,tn<0){if(Ma<Ta)return;Ma<ya&&(ya=Ma)}else if(tn>0){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(Ma<Ta)return;Ma<ya&&(ya=Ma)}if(Ma=De-gr,!(!on&&Ma>0)){if(Ma/=on,on<0){if(Ma<Ta)return;Ma<ya&&(ya=Ma)}else if(on>0){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(Ma<Ta)return;Ma<ya&&(ya=Ma)}return Ta>0&&(_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)<Ke&&l(_t.a.y-_t.b.y)<Ke)&&(_t.a=_t.b=null,De.splice(vt,1))}function al(de,De){var et=de.b;if(et)return!0;var vt=de.a,_t=De[0][0],St=De[1][0],ar=De[0][1],zt=De[1][1],gr=de.l,qr=de.r,Wr=gr.x,Ta=gr.y,ya=qr.x,tn=qr.y,on=(Wr+ya)/2,Ma=(Ta+tn)/2,Na,Ka;if(tn===Ta){if(on<_t||on>=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.y<ar)return;et={x:on,y:ar}}}else if(Na=(Wr-ya)/(tn-Ta),Ka=Ma-Na*on,Na<-1||Na>1)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<ar)return;et={x:(ar-Ka)/Na,y:ar}}else if(Ta<tn){if(!vt)vt={x:_t,y:Na*_t+Ka};else if(vt.x>=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<St.y||et.y===St.y&&et.x<St.x))(et.x!==vt||et.y!==_t)&&(Vo[et.i]=new $s(et),tl(et),vt=et.x,_t=et.y),et=de.pop();else if(St)Ci(St.arc);else break;De&&(As(De),ms(De));var ar={cells:Vo,edges:To};return Oo=os=To=Vo=null,ar}function Af(de,De){return De.y-de.y||De.x-de.x}v.geom.voronoi=function(de){var De=go,et=pi,vt=De,_t=et,St=pf;if(de)return ar(de);function ar(gr){var qr=new Array(gr.length),Wr=St[0][0],Ta=St[0][1],ya=St[1][0],tn=St[1][1];return Cu(zt(gr),St).cells.forEach(function(on,Ma){var Na=on.edges,Ka=on.site,mn=qr[Ma]=Na.length?Na.map(function(cn){var Pa=cn.start();return[Pa.x,Pa.y]}):Ka.x>=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;++on<Ma;)Na=mn,Ka=cn,mn=tn[on].edge,cn=mn.l===ya?mn.r:mn.l,Ta<Ka.i&&Ta<cn.i&&Us(ya,Ka,cn)<0&&qr.push([gr[Ta],gr[Ka.i],gr[cn.i]])}),qr},ar.x=function(gr){return arguments.length?(vt=na(De=gr),ar):De},ar.y=function(gr){return arguments.length?(_t=na(et=gr),ar):et},ar.clipExtent=function(gr){return arguments.length?(St=gr??pf,ar):St===pf?null:St},ar.size=function(gr){return arguments.length?ar.clipExtent(gr&&[[0,0],gr]):St===pf?null:St&&St[1]},ar};var pf=[[-1e6,-1e6],[1e6,1e6]];function Us(de,De,et){return(de.x-et.x)*(De.y-de.y)-(de.x-De.x)*(et.y-de.y)}v.geom.delaunay=function(de){return v.geom.voronoi().triangles(de)},v.geom.quadtree=function(de,De,et,vt,_t){var St=go,ar=pi,zt;if(zt=arguments.length)return St=qc,ar=Sf,zt===3&&(_t=et,vt=De,et=De=0),gr(de);function gr(qr){var Wr,Ta=na(St),ya=na(ar),tn,on,Ma,Na,Ka,mn,cn,Pa;if(De!=null)Ka=De,mn=et,cn=vt,Pa=_t;else if(cn=Pa=-(Ka=mn=1/0),tn=[],on=[],Na=qr.length,zt)for(Ma=0;Ma<Na;++Ma)Wr=qr[Ma],Wr.x<Ka&&(Ka=Wr.x),Wr.y<mn&&(mn=Wr.y),Wr.x>cn&&(cn=Wr.x),Wr.y>Pa&&(Pa=Wr.y),tn.push(Wr.x),on.push(Wr.y);else for(Ma=0;Ma<Na;++Ma){var si=+Ta(Wr=qr[Ma],Ma),ni=+ya(Wr,Ma);si<Ka&&(Ka=si),ni<mn&&(mn=ni),si>cn&&(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(;++Ma<Na;)Zi($o,qr[Ma],tn[Ma],on[Ma],Ka,mn,cn,Pa);--Ma}else qr.forEach($o.add);return tn=on=qr=Wr=null,$o}return gr.x=function(qr){return arguments.length?(St=qr,gr):St},gr.y=function(qr){return arguments.length?(ar=qr,gr):ar},gr.extent=function(qr){return arguments.length?(qr==null?De=et=vt=_t=null:(De=+qr[0][0],et=+qr[0][1],vt=+qr[1][0],_t=+qr[1][1]),gr):De==null?null:[[De,et],[vt,_t]]},gr.size=function(qr){return arguments.length?(qr==null?De=et=vt=_t=null:(De=et=0,vt=+qr[0],_t=+qr[1]),gr):De==null?null:[vt-De,_t-et]},gr};function qc(de){return de.x}function Sf(de){return de.y}function iu(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Ll(de,De,et,vt,_t,St){if(!de(De,et,vt,_t,St)){var ar=(et+_t)*.5,zt=(vt+St)*.5,gr=De.nodes;gr[0]&&Ll(de,gr[0],et,vt,ar,zt),gr[1]&&Ll(de,gr[1],ar,vt,_t,zt),gr[2]&&Ll(de,gr[2],et,zt,ar,St),gr[3]&&Ll(de,gr[3],ar,zt,_t,St)}}function nc(de,De,et,vt,_t,St,ar){var zt=1/0,gr;return function qr(Wr,Ta,ya,tn,on){if(!(Ta>St||ya>ar||tn<vt||on<_t)){if(Ma=Wr.point){var Ma,Na=De-Wr.x,Ka=et-Wr.y,mn=Na*Na+Ka*Ka;if(mn<zt){var cn=Math.sqrt(zt=mn);vt=De-cn,_t=et-cn,St=De+cn,ar=et+cn,gr=Ma}}for(var Pa=Wr.nodes,si=(Ta+tn)*.5,ni=(ya+on)*.5,vi=De>=si,Pi=et>=ni,Zi=Pi<<1|vi,eo=Zi+4;Zi<eo;++Zi)if(Wr=Pa[Zi&3])switch(Zi&3){case 0:qr(Wr,Ta,ya,si,ni);break;case 1:qr(Wr,si,ya,tn,ni);break;case 2:qr(Wr,Ta,ni,si,on);break;case 3:qr(Wr,si,ni,tn,on);break}}}(de,vt,_t,St,ar),gr}v.interpolateRgb=Ou;function Ou(de,De){de=v.rgb(de),De=v.rgb(De);var et=de.r,vt=de.g,_t=de.b,St=De.r-et,ar=De.g-vt,zt=De.b-_t;return function(gr){return"#"+Ur(Math.round(et+St*gr))+Ur(Math.round(vt+ar*gr))+Ur(Math.round(_t+zt*gr))}}v.interpolateObject=nl;function nl(de,De){var et={},vt={},_t;for(_t in de)_t in De?et[_t]=Nl(de[_t],De[_t]):vt[_t]=de[_t];for(_t in De)_t in de||(vt[_t]=De[_t]);return function(St){for(_t in et)vt[_t]=et[_t](St);return vt}}v.interpolateNumber=vl;function vl(de,De){return de=+de,De=+De,function(et){return de*(1-et)+De*et}}v.interpolateString=gs;function gs(de,De){var et=qs.lastIndex=ic.lastIndex=0,vt,_t,St,ar=-1,zt=[],gr=[];for(de=de+"",De=De+"";(vt=qs.exec(de))&&(_t=ic.exec(De));)(St=_t.index)>et&&(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<De.length&&(St=De.slice(et),zt[ar]?zt[ar]+=St:zt[++ar]=St),zt.length<2?gr[0]?(De=gr[0].x,function(qr){return De(qr)+""}):function(){return De}:(De=gr.length,function(qr){for(var Wr=0,Ta;Wr<De;++Wr)zt[(Ta=gr[Wr]).i]=Ta.x(qr);return zt.join("")})}var qs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ic=new RegExp(qs.source,"g");v.interpolate=Nl;function Nl(de,De){for(var et=v.interpolators.length,vt;--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<ar;++zt)et.push(Nl(de[zt],De[zt]));for(;zt<_t;++zt)vt[zt]=de[zt];for(;zt<St;++zt)vt[zt]=De[zt];return function(gr){for(zt=0;zt<ar;++zt)vt[zt]=et[zt](gr);return vt}}var cl=function(){return F},yh=v.map({linear:cl,poly:Mf,quad:function(){return Gc},cubic:function(){return qu},sin:function(){return wc},exp:function(){return rf},circle:function(){return Kl},elastic:Yf,back:zf,bounce:function(){return af}}),ls=v.map({in:F,out:Ss,"in-out":Qi,"out-in":function(de){return Qi(Ss(de))}});v.ease=function(de){var De=de.indexOf("-"),et=De>=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]<et[0]*De[1]&&(De[0]*=-1,De[1]*=-1,vt*=-1,_t*=-1),this.rotate=(vt?Math.atan2(De[1],De[0]):Math.atan2(-et[0],et[1]))*at,this.translate=[de.e,de.f],this.scale=[vt,St],this.skew=St?Math.atan2(_t,St)*at:0}Ef.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function oc(de,De){return de[0]*De[0]+de[1]*De[1]}function Hc(de){var De=Math.sqrt(oc(de,de));return De&&(de[0]/=De,de[1]/=De),De}function Jl(de,De,et){return de[0]+=et*De[0],de[1]+=et*De[1],de}var Uc={a:1,b:0,c:0,d:1,e:0,f:0};v.interpolateTransform=Wc;function Tc(de){return de.length?de.pop()+",":""}function Gs(de,De,et,vt){if(de[0]!==De[0]||de[1]!==De[1]){var _t=et.push("translate(",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]||De[1])&&et.push("translate("+De+")")}function Cf(de,De,et,vt){de!==De?(de-De>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;++St<ar;)et[(zt=vt[St]).i]=zt.x(_t);return et.join("")}}function Kf(de,De){return De=(De-=de=+de)||1/De,function(et){return(et-de)/De}}function ku(de,De){return De=(De-=de=+de)||1/De,function(et){return Math.max(0,Math.min(1,(et-de)/De))}}v.layout={},v.layout.bundle=function(){return function(de){for(var De=[],et=-1,vt=de.length;++et<vt;)De.push(Nf(de[et]));return De}};function Nf(de){for(var De=de.source,et=de.target,vt=Lu(De,et),_t=[De];De!==vt;)De=De.parent,_t.push(De);for(var St=_t.length;et!==vt;)_t.splice(St,0,et),et=et.parent;return _t}function ml(de){for(var De=[],et=de.parent;et!=null;)De.push(de),de=et,et=et.parent;return De.push(de),De}function Lu(de,De){if(de===De)return de;for(var et=ml(de),vt=ml(De),_t=et.pop(),St=vt.pop(),ar=null;_t===St;)ar=_t,_t=et.pop(),St=vt.pop();return ar}v.layout.chord=function(){var de={},De,et,vt,_t,St=0,ar,zt,gr;function qr(){var Ta={},ya=[],tn=v.range(_t),on=[],Ma,Na,Ka,mn,cn;for(De=[],et=[],Ma=0,mn=-1;++mn<_t;){for(Na=0,cn=-1;++cn<_t;)Na+=vt[mn][cn];ya.push(Na),on.push(v.range(_t)),Ma+=Na}for(ar&&tn.sort(function($o,no){return ar(ya[$o],ya[no])}),zt&&on.forEach(function($o,no){$o.sort(function(Zo,ul){return zt(vt[no][Zo],vt[no][ul])})}),Ma=(Ve-St*_t)/Ma,Na=0,mn=-1;++mn<_t;){for(Ka=Na,cn=-1;++cn<_t;){var Pa=tn[mn],si=on[Pa][cn],ni=vt[Pa][si],vi=Na,Pi=Na+=ni*Ma;Ta[Pa+"-"+si]={index:Pa,subindex:si,startAngle:vi,endAngle:Pi,value:ni}}et[Pa]={index:Pa,startAngle:Ka,endAngle:Na,value:ya[Pa]},Na+=St}for(mn=-1;++mn<_t;)for(cn=mn-1;++cn<_t;){var Zi=Ta[mn+"-"+cn],eo=Ta[cn+"-"+mn];(Zi.value||eo.value)&&De.push(Zi.value<eo.value?{source:eo,target:Zi}:{source:Zi,target:eo})}gr&&Wr()}function Wr(){De.sort(function(Ta,ya){return gr((Ta.source.value+Ta.target.value)/2,(ya.source.value+ya.target.value)/2)})}return de.matrix=function(Ta){return arguments.length?(_t=(vt=Ta)&&vt.length,De=et=null,de):vt},de.padding=function(Ta){return arguments.length?(St=Ta,De=et=null,de):St},de.sortGroups=function(Ta){return arguments.length?(ar=Ta,De=et=null,de):ar},de.sortSubgroups=function(Ta){return arguments.length?(zt=Ta,De=null,de):zt},de.sortChords=function(Ta){return arguments.length?(gr=Ta,De&&Wr(),de):gr},de.chords=function(){return De||qr(),De},de.groups=function(){return et||qr(),et},de},v.layout.force=function(){var de={},De=v.dispatch("start","tick","end"),et,vt=[1,1],_t,St,ar=.9,zt=Ml,gr=Uf,qr=-30,Wr=Jf,Ta=.1,ya=.64,tn=[],on=[],Ma,Na,Ka;function mn(Pa){return function(si,ni,vi,Pi){if(si.point!==Pa){var Zi=si.cx-Pa.x,eo=si.cy-Pa.y,$o=Pi-ni,no=Zi*Zi+eo*eo;if($o*$o/ya<no){if(no<Wr){var Zo=si.charge/no;Pa.px-=Zi*Zo,Pa.py-=eo*Zo}return!0}if(si.point&&no&&no<Wr){var Zo=si.pointCharge/no;Pa.px-=Zi*Zo,Pa.py-=eo*Zo}}return!si.charge}}de.tick=function(){if((St*=.99)<.005)return et=null,De.end({type:"end",alpha:St=0}),!0;var Pa=tn.length,si=on.length,ni,vi,Pi,Zi,eo,$o,no,Zo,ul;for(vi=0;vi<si;++vi)Pi=on[vi],Zi=Pi.source,eo=Pi.target,Zo=eo.x-Zi.x,ul=eo.y-Zi.y,($o=Zo*Zo+ul*ul)&&($o=St*Na[vi]*(($o=Math.sqrt($o))-Ma[vi])/$o,Zo*=$o,ul*=$o,eo.x-=Zo*(no=Zi.weight+eo.weight?Zi.weight/(Zi.weight+eo.weight):.5),eo.y-=ul*no,Zi.x+=Zo*(no=1-no),Zi.y+=ul*no);if((no=St*Ta)&&(Zo=vt[0]/2,ul=vt[1]/2,vi=-1,no))for(;++vi<Pa;)Pi=tn[vi],Pi.x+=(Zo-Pi.x)*no,Pi.y+=(ul-Pi.y)*no;if(qr)for(bu(ni=v.geom.quadtree(tn),St,Ka),vi=-1;++vi<Pa;)(Pi=tn[vi]).fixed||ni.visit(mn(Pi));for(vi=-1;++vi<Pa;)Pi=tn[vi],Pi.fixed?(Pi.x=Pi.px,Pi.y=Pi.py):(Pi.x-=(Pi.px-(Pi.px=Pi.x))*ar,Pi.y-=(Pi.py-(Pi.py=Pi.y))*ar);De.tick({type:"tick",alpha:St})},de.nodes=function(Pa){return arguments.length?(tn=Pa,de):tn},de.links=function(Pa){return arguments.length?(on=Pa,de):on},de.size=function(Pa){return arguments.length?(vt=Pa,de):vt},de.linkDistance=function(Pa){return arguments.length?(zt=typeof Pa=="function"?Pa:+Pa,de):zt},de.distance=de.linkDistance,de.linkStrength=function(Pa){return arguments.length?(gr=typeof Pa=="function"?Pa:+Pa,de):gr},de.friction=function(Pa){return arguments.length?(ar=+Pa,de):ar},de.charge=function(Pa){return arguments.length?(qr=typeof Pa=="function"?Pa:+Pa,de):qr},de.chargeDistance=function(Pa){return arguments.length?(Wr=Pa*Pa,de):Math.sqrt(Wr)},de.gravity=function(Pa){return arguments.length?(Ta=+Pa,de):Ta},de.theta=function(Pa){return arguments.length?(ya=Pa*Pa,de):Math.sqrt(ya)},de.alpha=function(Pa){return arguments.length?(Pa=+Pa,St?Pa>0?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<si;++Pa)(eo=tn[Pa]).index=Pa,eo.weight=0;for(Pa=0;Pa<ni;++Pa)eo=on[Pa],typeof eo.source=="number"&&(eo.source=tn[eo.source]),typeof eo.target=="number"&&(eo.target=tn[eo.target]),++eo.source.weight,++eo.target.weight;for(Pa=0;Pa<si;++Pa)eo=tn[Pa],isNaN(eo.x)&&(eo.x=$o("x",vi)),isNaN(eo.y)&&(eo.y=$o("y",Pi)),isNaN(eo.px)&&(eo.px=eo.x),isNaN(eo.py)&&(eo.py=eo.y);if(Ma=[],typeof zt=="function")for(Pa=0;Pa<ni;++Pa)Ma[Pa]=+zt.call(this,on[Pa],Pa);else for(Pa=0;Pa<ni;++Pa)Ma[Pa]=zt;if(Na=[],typeof gr=="function")for(Pa=0;Pa<ni;++Pa)Na[Pa]=+gr.call(this,on[Pa],Pa);else for(Pa=0;Pa<ni;++Pa)Na[Pa]=gr;if(Ka=[],typeof qr=="function")for(Pa=0;Pa<si;++Pa)Ka[Pa]=+qr.call(this,tn[Pa],Pa);else for(Pa=0;Pa<si;++Pa)Ka[Pa]=qr;function $o(no,Zo){if(!Zi){for(Zi=new Array(si),_l=0;_l<si;++_l)Zi[_l]=[];for(_l=0;_l<ni;++_l){var ul=on[_l];Zi[ul.source.index].push(ul.target),Zi[ul.target.index].push(ul.source)}}for(var el=Zi[Pa],_l=-1,gi=el.length,vo;++_l<gi;)if(!isNaN(vo=el[_l][no]))return vo;return Math.random()*Zo}return de.resume()},de.resume=function(){return de.alpha(.1)},de.stop=function(){return de.alpha(0)},de.drag=function(){if(_t||(_t=v.behavior.drag().origin(F).on("dragstart.force",Ac).on("drag.force",cn).on("dragend.force",il)),!arguments.length)return _t;this.on("mouseover.force",dc).on("mouseout.force",vu).call(_t)};function cn(Pa){Pa.px=v.event.x,Pa.py=v.event.y,de.resume()}return v.rebind(de,De,"on")};function Ac(de){de.fixed|=2}function il(de){de.fixed&=-7}function dc(de){de.fixed|=4,de.px=de.x,de.py=de.y}function vu(de){de.fixed&=-5}function bu(de,De,et){var vt=0,_t=0;if(de.charge=0,!de.leaf)for(var St=de.nodes,ar=St.length,zt=-1,gr;++zt<ar;)gr=St[zt],gr!=null&&(bu(gr,De,et),de.charge+=gr.charge,vt+=gr.charge*gr.cx,_t+=gr.charge*gr.cy);if(de.point){de.leaf||(de.point.x+=Math.random()-.5,de.point.y+=Math.random()-.5);var qr=De*et[de.point.index];de.charge+=de.pointCharge=qr,vt+=qr*de.point.x,_t+=qr*de.point.y}de.cx=vt/de.charge,de.cy=_t/de.charge}var Ml=20,Uf=1,Jf=1/0;v.layout.hierarchy=function(){var de=df,De=Lh,et=nf;function vt(_t){var St=[_t],ar=[],zt;for(_t.depth=0;(zt=St.pop())!=null;)if(ar.push(zt),(qr=De.call(vt,zt,zt.depth))&&(gr=qr.length)){for(var gr,qr,Wr;--gr>=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<St;)et.push(ar[_t]);for(;(de=vt.pop())!=null;)De(de)}function Lh(de){return de.children}function nf(de){return de.value}function df(de,De){return De.value-de.value}function Nu(de){return v.merge(de.map(function(De){return(De.children||[]).map(function(et){return{source:De,target:et}})}))}v.layout.partition=function(){var de=v.layout.hierarchy(),De=[1,1];function et(St,ar,zt,gr){var qr=St.children;if(St.x=ar,St.y=St.depth*gr,St.dx=zt,St.dy=gr,qr&&(Ta=qr.length)){var Wr=-1,Ta,ya,tn;for(zt=St.value?zt/St.value:0;++Wr<Ta;)et(ya=qr[Wr],ar,tn=ya.value*zt,gr),ar+=tn}}function vt(St){var ar=St.children,zt=0;if(ar&&(qr=ar.length))for(var gr=-1,qr;++gr<qr;)zt=Math.max(zt,vt(ar[gr]));return 1+zt}function _t(St,ar){var zt=de.call(this,St,ar);return et(zt[0],0,De[0],De[1]/vt(zt[0])),zt}return _t.size=function(St){return arguments.length?(De=St,_t):De},Bu(_t,de)},v.layout.pie=function(){var de=Number,De=of,et=0,vt=Ve,_t=0;function St(ar){var zt=ar.length,gr=ar.map(function(mn,cn){return+de.call(St,mn,cn)}),qr=+(typeof et=="function"?et.apply(this,arguments):et),Wr=(typeof vt=="function"?vt.apply(this,arguments):vt)-qr,Ta=Math.min(Math.abs(Wr)/zt,+(typeof _t=="function"?_t.apply(this,arguments):_t)),ya=Ta*(Wr<0?-1:1),tn=v.sum(gr),on=tn?(Wr-zt*ya)/tn:0,Ma=v.range(zt),Na=[],Ka;return De!=null&&Ma.sort(De===of?function(mn,cn){return gr[cn]-gr[mn]}:function(mn,cn){return De(ar[mn],ar[cn])}),Ma.forEach(function(mn){Na[mn]={data:ar[mn],value:Ka=gr[mn],startAngle:qr,endAngle:qr+=Ka*on+ya,padAngle:Ta}}),Na}return St.value=function(ar){return arguments.length?(de=ar,St):de},St.sort=function(ar){return arguments.length?(De=ar,St):De},St.startAngle=function(ar){return arguments.length?(et=ar,St):et},St.endAngle=function(ar){return arguments.length?(vt=ar,St):vt},St.padAngle=function(ar){return arguments.length?(_t=ar,St):_t},St};var of={};v.layout.stack=function(){var de=F,De=mu,et=Pu,vt=uh,_t=tu,St=Xc;function ar(zt,gr){if(!(on=zt.length))return zt;var qr=zt.map(function(mn,cn){return de.call(ar,mn,cn)}),Wr=qr.map(function(mn){return mn.map(function(cn,Pa){return[_t.call(ar,cn,Pa),St.call(ar,cn,Pa)]})}),Ta=De.call(ar,Wr,gr);qr=v.permute(qr,Ta),Wr=v.permute(Wr,Ta);var ya=et.call(ar,Wr,gr),tn=qr[0].length,on,Ma,Na,Ka;for(Na=0;Na<tn;++Na)for(vt.call(ar,qr[0][Na],Ka=ya[Na],Wr[0][Na][1]),Ma=1;Ma<on;++Ma)vt.call(ar,qr[Ma][Na],Ka+=Wr[Ma-1][Na][1],Wr[Ma][Na][1]);return zt}return ar.values=function(zt){return arguments.length?(de=zt,ar):de},ar.order=function(zt){return arguments.length?(De=typeof zt=="function"?zt:vf.get(zt)||mu,ar):De},ar.offset=function(zt){return arguments.length?(et=typeof zt=="function"?zt:ol.get(zt)||Pu,ar):et},ar.x=function(zt){return arguments.length?(_t=zt,ar):_t},ar.y=function(zt){return arguments.length?(St=zt,ar):St},ar.out=function(zt){return arguments.length?(vt=zt,ar):vt},ar};function tu(de){return de.x}function Xc(de){return de.y}function uh(de,De,et){de.y0=De,de.y=et}var vf=v.map({"inside-out":function(de){var De=de.length,et,vt,_t=de.map(kf),St=de.map(hl),ar=v.range(De).sort(function(Ta,ya){return _t[Ta]-_t[ya]}),zt=0,gr=0,qr=[],Wr=[];for(et=0;et<De;++et)vt=ar[et],zt<gr?(zt+=St[vt],qr.push(vt)):(gr+=St[vt],Wr.push(vt));return Wr.reverse().concat(qr)},reverse:function(de){return v.range(de.length).reverse()},default:mu}),ol=v.map({silhouette:function(de){var De=de.length,et=de[0].length,vt=[],_t=0,St,ar,zt,gr=[];for(ar=0;ar<et;++ar){for(St=0,zt=0;St<De;St++)zt+=de[St][ar][1];zt>_t&&(_t=zt),vt.push(zt)}for(ar=0;ar<et;++ar)gr[ar]=(_t-vt[ar])/2;return gr},wiggle:function(de){var De=de.length,et=de[0],vt=et.length,_t,St,ar,zt,gr,qr,Wr,Ta,ya,tn=[];for(tn[0]=Ta=ya=0,St=1;St<vt;++St){for(_t=0,zt=0;_t<De;++_t)zt+=de[_t][St][1];for(_t=0,gr=0,Wr=et[St][0]-et[St-1][0];_t<De;++_t){for(ar=0,qr=(de[_t][St][1]-de[_t][St-1][1])/(2*Wr);ar<_t;++ar)qr+=(de[ar][St][1]-de[ar][St-1][1])/Wr;gr+=qr*de[_t][St][1]}tn[St]=Ta-=zt?gr/zt*Wr:0,Ta<ya&&(ya=Ta)}for(St=0;St<vt;++St)tn[St]-=ya;return tn},expand:function(de){var De=de.length,et=de[0].length,vt=1/De,_t,St,ar,zt=[];for(St=0;St<et;++St){for(_t=0,ar=0;_t<De;_t++)ar+=de[_t][St][1];if(ar)for(_t=0;_t<De;_t++)de[_t][St][1]/=ar;else for(_t=0;_t<De;_t++)de[_t][St][1]=vt}for(St=0;St<et;++St)zt[St]=0;return zt},zero:Pu});function mu(de){return v.range(de.length)}function Pu(de){for(var De=-1,et=de[0].length,vt=[];++De<et;)vt[De]=0;return vt}function kf(de){for(var De=1,et=0,vt=de[0][1],_t,St=de.length;De<St;++De)(_t=de[De][1])>vt&&(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;++ya<on;)Ta=zt[ya]=[],Ta.dx=Wr[ya+1]-(Ta.x=Wr[ya]),Ta.y=0;if(on>0)for(ya=-1;++ya<tn;)Na=gr[ya],Na>=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;qr<ya;qr++){jl(ar,zt,gr=De[qr]);var on=0,Ma=1,Na=1;for(Wr=zt._pack_next;Wr!==zt;Wr=Wr._pack_next,Ma++)if(ru(Wr,gr)){on=1;break}if(on==1)for(Ta=ar._pack_prev;Ta!==Wr._pack_prev&&!ru(Ta,gr);Ta=Ta._pack_prev,Na++);on?(Ma<Na||Ma==Na&&zt.r<ar.r?Lf(ar,zt=Wr):Lf(ar=Ta,zt),qr--):(Zc(ar,gr),zt=gr,tn(gr))}var Ka=(et+vt)/2,mn=(_t+St)/2,cn=0;for(qr=0;qr<ya;qr++)gr=De[qr],gr.x-=Ka,gr.y-=mn,cn=Math.max(cn,gr.r+Math.sqrt(gr.x*gr.x+gr.y*gr.y));de.r=cn,De.forEach(Ec)}function Xu(de){de._pack_next=de._pack_prev=de}function Ec(de){delete de._pack_next,delete de._pack_prev}function mc(de,De,et,vt){var _t=de.children;if(de.x=De+=vt*de.x,de.y=et+=vt*de.y,de.r*=vt,_t)for(var St=-1,ar=_t.length;++St<ar;)mc(_t[St],De,et,vt)}function jl(de,De,et){var vt=de.r+et.r,_t=De.x-de.x,St=De.y-de.y;if(vt&&(_t||St)){var ar=De.r+et.r,zt=_t*_t+St*St;ar*=ar,vt*=vt;var gr=.5+(vt-ar)/(2*zt),qr=Math.sqrt(Math.max(0,2*ar*(vt+zt)-(vt-=zt)*vt-ar*ar))/(2*zt);et.x=de.x+gr*_t+qr*St,et.y=de.y+gr*St-qr*_t}else et.x=de.x+vt,et.y=de.y}v.layout.tree=function(){var de=v.layout.hierarchy().sort(null).value(null),De=gu,et=[1,1],vt=null;function _t(Wr,Ta){var ya=de.call(this,Wr,Ta),tn=ya[0],on=St(tn);if(vc(on,ar),on.parent.m=-on.z,Sc(on,zt),vt)Sc(tn,qr);else{var Ma=tn,Na=tn,Ka=tn;Sc(tn,function(si){si.x<Ma.x&&(Ma=si),si.x>Na.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;Na<Ka;++Na)ya.push((on[Na]=Ma={_:on[Na],parent:tn,children:(Ma=on[Na].children)&&Ma.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Na}).a=Ma);return Ta.children[0]}function ar(Wr){var Ta=Wr.children,ya=Wr.parent.children,tn=Wr.i?ya[Wr.i-1]:null;if(Ta.length){kc(Wr);var on=(Ta[0].z+Ta[Ta.length-1].z)/2;tn?(Wr.z=tn.z+De(Wr._,tn._),Wr.m=Wr.z-on):Wr.z=on}else tn&&(Wr.z=tn.z+De(Wr._,tn._));Wr.parent.A=gr(Wr,tn,Wr.parent.A||ya[0])}function zt(Wr){Wr._.x=Wr.z+Wr.parent.m,Wr.m+=Wr.parent.m}function gr(Wr,Ta,ya){if(Ta){for(var tn=Wr,on=Wr,Ma=Ta,Na=tn.parent.children[0],Ka=tn.m,mn=on.m,cn=Ma.m,Pa=Na.m,si;Ma=Yc(Ma),tn=Cc(tn),Ma&&tn;)Na=Cc(Na),on=Yc(on),on.a=Wr,si=Ma.z+cn-tn.z-Ka+De(Ma._,tn._),si>0&&(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;++Ka<mn;)Pa=(cn=Ma[Ka]).value*(Na<0?0:Na),cn.area=isNaN(Pa)||Pa<=0?0:Pa}function Wr(Ma){var Na=Ma.children;if(Na&&Na.length){var Ka=_t(Ma),mn=[],cn=Na.slice(),Pa,si=1/0,ni,vi=zt==="slice"?Ka.dx:zt==="dice"?Ka.dy:zt==="slice-dice"?Ma.depth&1?Ka.dy:Ka.dx:Math.min(Ka.dx,Ka.dy),Pi;for(qr(cn,Ka.dx*Ka.dy/Ma.value),mn.area=0;(Pi=cn.length)>0;)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;++si<ni;)(mn=Ma[si].area)&&(mn<Pa&&(Pa=mn),mn>cn&&(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);++cn<Pa;)Pi=Ma[cn],Pi.x=si,Pi.y=ni,Pi.dy=vi,si+=Pi.dx=Math.min(Ka.x+Ka.dx-si,vi?De(Pi.area/vi):0);Pi.z=!0,Pi.dx+=Ka.x+Ka.dx-si,Ka.y+=vi,Ka.dy-=vi}else{for((mn||vi>Ka.dx)&&(vi=Ka.dx);++cn<Pa;)Pi=Ma[cn],Pi.x=si,Pi.y=ni,Pi.dx=vi,ni+=Pi.dy=Math.min(Ka.y+Ka.dy-ni,vi?De(Pi.area/vi):0);Pi.z=!1,Pi.dy+=Ka.y+Ka.dy-ni,Ka.x+=vi,Ka.dx-=vi}}function on(Ma){var Na=ar||de(Ma),Ka=Na[0];return Ka.x=Ka.y=0,Ka.value?(Ka.dx=et[0],Ka.dy=et[1]):Ka.dx=Ka.dy=0,ar&&de.revalue(Ka),qr([Ka],Ka.dx*Ka.dy/Ka.value),(ar?Ta:Wr)(Ka),St&&(ar=Na),Na}return on.size=function(Ma){return arguments.length?(et=Ma,on):et},on.padding=function(Ma){if(!arguments.length)return vt;function Na(cn){var Pa=Ma.call(on,cn,cn.depth);return Pa==null?pn(cn):In(cn,typeof Pa=="number"?[Pa,Pa,Pa,Pa]:Pa)}function Ka(cn){return In(cn,Ma)}var mn;return _t=(vt=Ma)==null?pn:(mn=typeof Ma)=="function"?Na:(mn==="number"&&(Ma=[Ma,Ma,Ma,Ma]),Ka),on},on.round=function(Ma){return arguments.length?(De=Ma?Math.round:Number,on):De!=Number},on.sticky=function(Ma){return arguments.length?(St=Ma,ar=null,on):St},on.ratio=function(Ma){return arguments.length?(gr=Ma,on):gr},on.mode=function(Ma){return arguments.length?(zt=Ma+"",on):zt},Bu(on,de)};function pn(de){return{x:de.x,y:de.y,dx:de.dx,dy:de.dy}}function In(de,De){var et=de.x+De[3],vt=de.y+De[0],_t=de.dx-De[1]-De[3],St=de.dy-De[0]-De[2];return _t<0&&(et+=_t/2,_t=0),St<0&&(vt+=St/2,St=0),{x:et,y:vt,dx:_t,dy:St}}v.random={normal:function(de,De){var et=arguments.length;return et<2&&(De=1),et<1&&(de=0),function(){var vt,_t,St;do vt=Math.random()*2-1,_t=Math.random()*2-1,St=vt*vt+_t*_t;while(!St||St>1);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;et<de;et++)De+=Math.random();return De}}},v.scale={};function Yn(de){var De=de[0],et=de[de.length-1];return De<et?[De,et]:[et,De]}function ri(de){return de.rangeExtent?de.rangeExtent():Yn(de.range())}function di(de,De,et,vt){var _t=et(de[0],de[1]),St=vt(De[0],De[1]);return function(ar){return St(_t(ar))}}function Dn(de,De){var et=0,vt=de.length-1,_t=de[et],St=de[vt],ar;return St<_t&&(ar=et,et=vt,vt=ar,ar=_t,_t=St,St=ar),de[et]=De.floor(_t),de[vt]=De.ceil(St),de}function On(de){return de?{floor:function(De){return Math.floor(De/de)*de},ceil:function(De){return Math.ceil(De/de)*de}}:qn}var qn={floor:F,ceil:F};function xn(de,De,et,vt){var _t=[],St=[],ar=0,zt=Math.min(de.length,De.length)-1;for(de[zt]<de[0]&&(de=de.slice().reverse(),De=De.slice().reverse());++ar<=zt;)_t.push(et(de[ar-1],de[ar])),St.push(vt(De[ar-1],De[ar]));return function(gr){var qr=v.bisect(de,gr,1,zt)-1;return St[qr](_t[qr](gr))}}v.scale.linear=function(){return Mi([0,1],[0,1],Nl,!1)};function Mi(de,De,et,vt){var _t,St;function ar(){var gr=Math.min(de.length,De.length)>2?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(;Ta<ya;Ta++)for(var on=1;on<tn;on++)gr.push(St(Ta)*on);gr.push(St(Ta))}else for(gr.push(St(Ta));Ta++<ya;)for(var on=tn-1;on>0;on--)gr.push(St(Ta)*on);for(Ta=0;gr[Ta]<qr;Ta++);for(ya=gr.length;gr[ya-1]>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;++gr<qr;)et.has(Wr=zt[gr])||et.set(Wr,de.push(Wr));return St[De.t].apply(St,De.a)},St.range=function(zt){return arguments.length?(vt=zt,_t=0,De={t:"range",a:arguments},St):vt},St.rangePoints=function(zt,gr){arguments.length<2&&(gr=0);var qr=zt[0],Wr=zt[1],Ta=de.length<2?(qr=(qr+Wr)/2,0):(Wr-qr)/(de.length-1+gr);return vt=ar(qr+Ta*gr/2,Ta),_t=0,De={t:"rangePoints",a:arguments},St},St.rangeRoundPoints=function(zt,gr){arguments.length<2&&(gr=0);var qr=zt[0],Wr=zt[1],Ta=de.length<2?(qr=Wr=Math.round((qr+Wr)/2),0):(Wr-qr)/(de.length-1+gr)|0;return vt=ar(qr+Math.round(Ta*gr/2+(Wr-qr-(de.length-1+gr)*Ta)/2),Ta),_t=0,De={t:"rangeRoundPoints",a:arguments},St},St.rangeBands=function(zt,gr,qr){arguments.length<2&&(gr=0),arguments.length<3&&(qr=gr);var Wr=zt[1]<zt[0],Ta=zt[Wr-0],ya=zt[1-Wr],tn=(ya-Ta)/(de.length-gr+2*qr);return vt=ar(Ta+tn*qr,tn),Wr&&vt.reverse(),_t=tn*(1-gr),De={t:"rangeBands",a:arguments},St},St.rangeRoundBands=function(zt,gr,qr){arguments.length<2&&(gr=0),arguments.length<3&&(qr=gr);var Wr=zt[1]<zt[0],Ta=zt[Wr-0],ya=zt[1-Wr],tn=Math.floor((ya-Ta)/(de.length-gr+2*qr));return vt=ar(Ta+Math.round((ya-Ta-(de.length-gr)*tn)/2),tn),Wr&&vt.reverse(),_t=Math.round(tn*(1-gr)),De={t:"rangeRoundBands",a:arguments},St},St.rangeBand=function(){return _t},St.rangeExtent=function(){return Yn(De.a[0])},St.copy=function(){return Ks(de,De)},St.domain(de)}v.scale.category10=function(){return v.scale.ordinal().range(ys)},v.scale.category20=function(){return v.scale.ordinal().range(Fl)},v.scale.category20b=function(){return v.scale.ordinal().range(yl)},v.scale.category20c=function(){return v.scale.ordinal().range(sl)};var ys=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Gr),Fl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Gr),yl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Gr),sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Gr);v.scale.quantile=function(){return Ui([],[])};function Ui(de,De){var et;function vt(){var St=0,ar=De.length;for(et=[];++St<ar;)et[St-1]=v.quantile(de,St/ar);return _t}function _t(St){if(!isNaN(St=+St))return De[v.bisect(et,St)]}return _t.domain=function(St){return arguments.length?(de=St.map(c).filter(h).sort(s),vt()):de},_t.range=function(St){return arguments.length?(De=St,vt()):De},_t.quantiles=function(){return et},_t.invertExtent=function(St){return St=De.indexOf(St),St<0?[NaN,NaN]:[St>0?et[St-1]:de[0],St<et.length?et[St]:de[de.length-1]]},_t.copy=function(){return Ui(de,De)},vt()}v.scale.quantize=function(){return Io(0,1,[0,1])};function Io(de,De,et){var vt,_t;function St(zt){return et[Math.max(0,Math.min(_t,Math.floor(vt*(zt-de))))]}function ar(){return vt=et.length/(De-de),_t=et.length-1,St}return St.domain=function(zt){return arguments.length?(de=+zt[0],De=+zt[zt.length-1],ar()):[de,De]},St.range=function(zt){return arguments.length?(et=zt,ar()):et},St.invertExtent=function(zt){return zt=et.indexOf(zt),zt=zt<0?NaN:zt/vt+de,[zt,zt+1/vt]},St.copy=function(){return Io(de,De,et)},ar()}v.scale.threshold=function(){return Xs([.5],[0,1])};function Xs(de,De){function et(vt){if(vt<=vt)return De[v.bisect(de,vt)]}return et.domain=function(vt){return arguments.length?(de=vt,et):de},et.range=function(vt){return arguments.length?(De=vt,et):De},et.invertExtent=function(vt){return vt=De.indexOf(vt),[de[vt-1],de[vt]]},et.copy=function(){return Xs(de,De)},et}v.scale.identity=function(){return Ls([0,1])};function Ls(de){function De(et){return+et}return De.invert=De,De.domain=De.range=function(et){return arguments.length?(de=et.map(De),De):de},De.ticks=function(et){return co(de,et)},De.tickFormat=function(et,vt){return d3_scale_linearTickFormat(de,et,vt)},De.copy=function(){return Ls(de)},De}v.svg={};function ou(){return 0}v.svg.arc=function(){var de=Zu,De=Lc,et=ou,vt=Iu,_t=yu,St=Pc,ar=wu;function zt(){var qr=Math.max(0,+de.apply(this,arguments)),Wr=Math.max(0,+De.apply(this,arguments)),Ta=_t.apply(this,arguments)-Te,ya=St.apply(this,arguments)-Te,tn=Math.abs(ya-Ta),on=Ta>ya?0:1;if(Wr<qr&&(Ma=Wr,Wr=qr,qr=Ma),tn>=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=qr<Wr^on?0:1;var vo=Ma,cs=Ma;if(tn<Ee){var ps=$o==null?[Zi,eo]:vi==null?[si,ni]:so([si,ni],[$o,no],[vi,Pi],[Zi,eo]),Tl=si-ps[0],Gl=ni-ps[1],Tu=vi-ps[0],Il=Pi-ps[1],yc=1/Math.sin(Math.acos((Tl*Tu+Gl*Il)/(Math.sqrt(Tl*Tl+Gl*Gl)*Math.sqrt(Tu*Tu+Il*Il)))/2),nt=Math.sqrt(ps[0]*ps[0]+ps[1]*ps[1]);cs=Math.min(Ma,(qr-nt)/(yc-1)),vo=Math.min(Ma,(Wr-nt)/(yc+1))}if(vi!=null){var Yt=fo($o==null?[Zi,eo]:[$o,no],[si,ni],Wr,vo,on),cr=fo([vi,Pi],[Zi,eo],Wr,vo,on);Ma===vo?Zo.push("M",Yt[0],"A",vo,",",vo," 0 0,",Na," ",Yt[1],"A",Wr,",",Wr," 0 ",1-on^gc(Yt[1][0],Yt[1][1],cr[1][0],cr[1][1]),",",on," ",cr[1],"A",vo,",",vo," 0 0,",Na," ",cr[0]):Zo.push("M",Yt[0],"A",vo,",",vo," 0 1,",Na," ",cr[0])}else Zo.push("M",si,",",ni);if($o!=null){var ua=fo([si,ni],[$o,no],qr,-cs,on),Aa=fo([Zi,eo],vi==null?[si,ni]:[vi,Pi],qr,-cs,on);Ma===cs?Zo.push("L",Aa[0],"A",cs,",",cs," 0 0,",Na," ",Aa[1],"A",qr,",",qr," 0 ",on^gc(Aa[1][0],Aa[1][1],ua[1][0],ua[1][1]),",",1-on," ",ua[1],"A",cs,",",cs," 0 0,",Na," ",ua[0]):Zo.push("L",Aa[0],"A",cs,",",cs," 0 0,",Na," ",ua[0])}else Zo.push("L",Zi,",",eo)}else Zo.push("M",si,",",ni),vi!=null&&Zo.push("A",Wr,",",Wr," 0 ",ul,",",on," ",vi,",",Pi),Zo.push("L",Zi,",",eo),$o!=null&&Zo.push("A",qr,",",qr," 0 ",_l,",",1-on," ",$o,",",no);return Zo.push("Z"),Zo.join("")}function gr(qr,Wr){return"M0,"+qr+"A"+qr+","+qr+" 0 1,"+Wr+" 0,"+-qr+"A"+qr+","+qr+" 0 1,"+Wr+" 0,"+qr}return zt.innerRadius=function(qr){return arguments.length?(de=na(qr),zt):de},zt.outerRadius=function(qr){return arguments.length?(De=na(qr),zt):De},zt.cornerRadius=function(qr){return arguments.length?(et=na(qr),zt):et},zt.padRadius=function(qr){return arguments.length?(vt=qr==Iu?Iu:na(qr),zt):vt},zt.startAngle=function(qr){return arguments.length?(_t=na(qr),zt):_t},zt.endAngle=function(qr){return arguments.length?(St=na(qr),zt):St},zt.padAngle=function(qr){return arguments.length?(ar=na(qr),zt):ar},zt.centroid=function(){var qr=(+de.apply(this,arguments)+ +De.apply(this,arguments))/2,Wr=(+_t.apply(this,arguments)+ +St.apply(this,arguments))/2-Te;return[Math.cos(Wr)*qr,Math.sin(Wr)*qr]},zt};var Iu="auto";function Zu(de){return de.innerRadius}function Lc(de){return de.outerRadius}function yu(de){return de.startAngle}function Pc(de){return de.endAngle}function wu(de){return de&&de.padAngle}function gc(de,De,et,vt){return(de-et)*De-(De-vt)*de>0?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(;++Ta<ya;)vt.call(this,tn=gr[Ta],Ta)?Wr.push([+on.call(this,tn,Ta),+Ma.call(this,tn,Ta)]):Wr.length&&(Na(),Wr=[]);return Wr.length&&Na(),qr.length?qr.join(""):null}return zt.x=function(gr){return arguments.length?(De=gr,zt):De},zt.y=function(gr){return arguments.length?(et=gr,zt):et},zt.defined=function(gr){return arguments.length?(vt=gr,zt):vt},zt.interpolate=function(gr){return arguments.length?(typeof gr=="function"?St=_t=gr:St=(_t=lc.get(gr)||Yu).key,zt):St},zt.tension=function(gr){return arguments.length?(ar=gr,zt):ar},zt}v.svg.line=function(){return Ic(F)};var lc=v.map({linear:Yu,"linear-closed":Ne,step:R,"step-before":ae,"step-after":we,basis:$t,"basis-open":br,"basis-closed":Ar,bundle:Yr,cardinal:pt,"cardinal-open":Se,"cardinal-closed":Oe,monotone:ur});lc.forEach(function(de,De){De.key=de,De.closed=/-closed$/.test(de)});function Yu(de){return de.length>1?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]];++De<et;)_t.push("H",(vt[0]+(vt=de[De])[0])/2,"V",vt[1]);return et>1&&_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]];++De<et;)_t.push("V",(vt=de[De])[1],"H",vt[0]);return _t.join("")}function we(de){for(var De=0,et=de.length,vt=de[0],_t=[vt[0],",",vt[1]];++De<et;)_t.push("H",(vt=de[De])[0],"V",vt[1]);return _t.join("")}function Se(de,De){return de.length<4?Yu(de):de[1]+At(de.slice(1,-1),Bt(de,De))}function Oe(de,De){return de.length<3?Ne(de):de[0]+At((de.push(de[0]),de),Bt([de[de.length-2]].concat(de,[de[1]]),De))}function pt(de,De){return de.length<3?Yu(de):de[0]+At(de,Bt(de,De))}function At(de,De){if(De.length<1||de.length!=De.length&&de.length!=De.length+2)return Yu(de);var et=de.length!=De.length,vt="",_t=de[0],St=de[1],ar=De[0],zt=ar,gr=1;if(et&&(vt+="Q"+(St[0]-ar[0]*2/3)+","+(St[1]-ar[1]*2/3)+","+St[0]+","+St[1],_t=de[1],gr=2),De.length>1){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;qr<De.length;qr++,gr++)St=de[gr],zt=De[qr],vt+="S"+(St[0]-zt[0])+","+(St[1]-zt[1])+","+St[0]+","+St[1]}if(et){var Wr=de[gr];vt+="Q"+(St[0]+zt[0]*2/3)+","+(St[1]+zt[1]*2/3)+","+Wr[0]+","+Wr[1]}return vt}function Bt(de,De){for(var et=[],vt=(1-De)/2,_t,St=de[0],ar=de[1],zt=1,gr=de.length;++zt<gr;)_t=St,St=ar,ar=de[zt],et.push([vt*(ar[0]-_t[0]),vt*(ar[1]-_t[1])]);return et}function $t(de){if(de.length<3)return Yu(de);var De=1,et=de.length,vt=de[0],_t=vt[0],St=vt[1],ar=[_t,_t,_t,(vt=de[1])[0]],zt=[St,St,St,vt[1]],gr=[_t,",",St,"L",sa(lt,ar),",",sa(lt,zt)];for(de.push(de[et-1]);++De<=et;)vt=de[De],ar.shift(),ar.push(vt[0]),zt.shift(),zt.push(vt[1]),dt(gr,ar,zt);return de.pop(),gr.push("L",vt),gr.join("")}function br(de){if(de.length<4)return Yu(de);for(var De=[],et=-1,vt=de.length,_t,St=[0],ar=[0];++et<3;)_t=de[et],St.push(_t[0]),ar.push(_t[1]);for(De.push(sa(lt,St)+","+sa(lt,ar)),--et;++et<vt;)_t=de[et],St.shift(),St.push(_t[0]),ar.shift(),ar.push(_t[1]),dt(De,St,ar);return De.join("")}function Ar(de){for(var De,et=-1,vt=de.length,_t=vt+4,St,ar=[],zt=[];++et<4;)St=de[et%vt],ar.push(St[0]),zt.push(St[1]);for(De=[sa(lt,ar),",",sa(lt,zt)],--et;++et<_t;)St=de[et%vt],ar.shift(),ar.push(St[0]),zt.shift(),zt.push(St[1]),dt(De,ar,zt);return De.join("")}function Yr(de,De){var et=de.length-1;if(et)for(var vt=de[0][0],_t=de[0][1],St=de[et][0]-vt,ar=de[et][1]-_t,zt=-1,gr,qr;++zt<=et;)gr=de[zt],qr=zt/et,gr[0]=De*gr[0]+(1-De)*(vt+qr*St),gr[1]=De*gr[1]+(1-De)*(_t+qr*ar);return $t(de)}function sa(de,De){return de[0]*De[0]+de[1]*De[1]+de[2]*De[2]+de[3]*De[3]}var He=[0,2/3,1/3,0],Je=[0,1/3,2/3,0],lt=[0,1/6,2/3,1/6];function dt(de,De,et){de.push("C",sa(He,De),",",sa(He,et),",",sa(Je,De),",",sa(Je,et),",",sa(lt,De),",",sa(lt,et))}function Ct(de,De){return(De[1]-de[1])/(De[0]-de[0])}function wt(de){for(var De=0,et=de.length-1,vt=[],_t=de[0],St=de[1],ar=vt[0]=Ct(_t,St);++De<et;)vt[De]=(ar+(ar=Ct(_t=St,St=de[De+1])))/2;return vt[De]=ar,vt}function Dt(de){for(var De=[],et,vt,_t,St,ar=wt(de),zt=-1,gr=de.length-1;++zt<gr;)et=Ct(de[zt],de[zt+1]),l(et)<Ke?ar[zt]=ar[zt+1]=0:(vt=ar[zt]/et,_t=ar[zt+1]/et,St=vt*vt+_t*_t,St>9&&(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;++et<vt;)De=de[et],_t=De[0],St=De[1]-Te,De[0]=_t*Math.cos(St),De[1]=_t*Math.sin(St);return de}function Er(de){var De=go,et=go,vt=0,_t=pi,St=zo,ar=Yu,zt=ar.key,gr=ar,qr="L",Wr=.7;function Ta(ya){var tn=[],on=[],Ma=[],Na=-1,Ka=ya.length,mn,cn=na(De),Pa=na(vt),si=De===et?function(){return vi}:na(et),ni=vt===_t?function(){return Pi}:na(_t),vi,Pi;function Zi(){tn.push("M",ar(de(Ma),Wr),qr,gr(de(on.reverse()),Wr),"Z")}for(;++Na<Ka;)St.call(this,mn=ya[Na],Na)?(on.push([vi=+cn.call(this,mn,Na),Pi=+Pa.call(this,mn,Na)]),Ma.push([+si.call(this,mn,Na),+ni.call(this,mn,Na)])):on.length&&(Zi(),on=[],Ma=[]);return on.length&&Zi(),tn.length?tn.join(""):null}return Ta.x=function(ya){return arguments.length?(De=et=ya,Ta):et},Ta.x0=function(ya){return arguments.length?(De=ya,Ta):De},Ta.x1=function(ya){return arguments.length?(et=ya,Ta):et},Ta.y=function(ya){return arguments.length?(vt=_t=ya,Ta):_t},Ta.y0=function(ya){return arguments.length?(vt=ya,Ta):vt},Ta.y1=function(ya){return arguments.length?(_t=ya,Ta):_t},Ta.defined=function(ya){return arguments.length?(St=ya,Ta):St},Ta.interpolate=function(ya){return arguments.length?(typeof ya=="function"?zt=ar=ya:zt=(ar=lc.get(ya)||Yu).key,gr=ar.reverse||ar,qr=ar.closed?"M":"L",Ta):zt},Ta.tension=function(ya){return arguments.length?(Wr=ya,Ta):Wr},Ta}ae.reverse=we,we.reverse=ae,v.svg.area=function(){return Er(F)},v.svg.area.radial=function(){var de=Er(mr);return de.radius=de.x,delete de.x,de.innerRadius=de.x0,delete de.x0,de.outerRadius=de.x1,delete de.x1,de.angle=de.y,delete de.y,de.startAngle=de.y0,delete de.y0,de.endAngle=de.y1,delete de.y1,de};function Br(de){return de.source}function Qr(de){return de.target}v.svg.chord=function(){var de=Br,De=Qr,et=ga,vt=yu,_t=Pc;function St(Wr,Ta){var ya=ar(this,de,Wr,Ta),tn=ar(this,De,Wr,Ta);return"M"+ya.p0+gr(ya.r,ya.p1,ya.a1-ya.a0)+(zt(ya,tn)?qr(ya.r,ya.p1,ya.r,ya.p0):qr(ya.r,ya.p1,tn.r,tn.p0)+gr(tn.r,tn.p1,tn.a1-tn.a0)+qr(tn.r,tn.p1,ya.r,ya.p0))+"Z"}function ar(Wr,Ta,ya,tn){var on=Ta.call(Wr,ya,tn),Ma=et.call(Wr,on,tn),Na=vt.call(Wr,on,tn)-Te,Ka=_t.call(Wr,on,tn)-Te;return{r:Ma,a0:Na,a1:Ka,p0:[Ma*Math.cos(Na),Ma*Math.sin(Na)],p1:[Ma*Math.cos(Ka),Ma*Math.sin(Ka)]}}function zt(Wr,Ta){return Wr.a0==Ta.a0&&Wr.a1==Ta.a1}function gr(Wr,Ta,ya){return"A"+Wr+","+Wr+" 0 "+ +(ya>Ee)+",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;++zt<gr;){vt.push(_t=[]);for(var qr=this[zt],Wr=-1,Ta=qr.length;++Wr<Ta;)(St=qr[Wr])&&Pl(St,Wr,et,De,ar),_t.push(St)}return ss(vt,et,De)},ne.interrupt=function(de){return this.each(de==null?Bi:Ao(ts(de)))};var Bi=Ao(ts());function Ao(de){return function(){var De,et,vt;(De=this[de])&&(vt=De[et=De.active])&&(vt.timer.c=null,vt.timer.t=NaN,--De.count?delete De[et]:delete this[de],De.active+=.5,vt.event&&vt.event.interrupt.call(this,this.__data__,vt.index))}}function ss(de,De,et){return H(de,So),de.namespace=De,de.id=et,de}var So=[],Ko=0,hs,ll;So.call=ne.call,So.empty=ne.empty,So.node=ne.node,So.size=ne.size,v.transition=function(de,De){return de&&de.transition?hs?de.transition(De):de:v.selection().transition(de)},v.transition.prototype=So,So.select=function(de){var De=this.id,et=this.namespace,vt=[],_t,St,ar;de=j(de);for(var zt=-1,gr=this.length;++zt<gr;){vt.push(_t=[]);for(var qr=this[zt],Wr=-1,Ta=qr.length;++Wr<Ta;)(ar=qr[Wr])&&(St=de.call(ar,ar.__data__,Wr,zt))?("__data__"in ar&&(St.__data__=ar.__data__),Pl(St,Wr,et,De,ar[et][De]),_t.push(St)):_t.push(null)}return ss(vt,et,De)},So.selectAll=function(de){var De=this.id,et=this.namespace,vt=[],_t,St,ar,zt,gr;de=ee(de);for(var qr=-1,Wr=this.length;++qr<Wr;)for(var Ta=this[qr],ya=-1,tn=Ta.length;++ya<tn;)if(ar=Ta[ya]){gr=ar[et][De],St=de.call(ar,ar.__data__,ya,qr),vt.push(_t=[]);for(var on=-1,Ma=St.length;++on<Ma;)(zt=St[on])&&Pl(zt,on,et,De,gr),_t.push(zt)}return ss(vt,et,De)},So.filter=function(de){var De=[],et,vt,_t;typeof de!="function"&&(de=fe(de));for(var St=0,ar=this.length;St<ar;St++){De.push(et=[]);for(var vt=this[St],zt=0,gr=vt.length;zt<gr;zt++)(_t=vt[zt])&&de.call(_t,_t.__data__,zt,St)&&et.push(_t)}return ss(De,this.namespace,this.id)},So.tween=function(de,De){var et=this.id,vt=this.namespace;return arguments.length<2?this.node()[vt][et].tween.get(de):rt(this,De==null?function(_t){_t[vt][et].tween.remove(de)}:function(_t){_t[vt][et].tween.set(de,De)})};function Js(de,De,et,vt){var _t=de.id,St=de.namespace;return rt(de,typeof et=="function"?function(ar,zt,gr){ar[St][_t].tween.set(De,vt(et.call(ar,ar.__data__,zt,gr)))}:(et=vt(et),function(ar){ar[St][_t].tween.set(De,et)}))}So.attr=function(de,De){if(arguments.length<2){for(De in de)this.attr(De,de[De]);return this}var et=de=="transform"?Wc:Nl,vt=v.ns.qualify(de);function _t(){this.removeAttribute(vt)}function St(){this.removeAttributeNS(vt.space,vt.local)}function ar(gr){return gr==null?_t:(gr+="",function(){var qr=this.getAttribute(vt),Wr;return qr!==gr&&(Wr=et(qr,gr),function(Ta){this.setAttribute(vt,Wr(Ta))})})}function zt(gr){return gr==null?St:(gr+="",function(){var qr=this.getAttributeNS(vt.space,vt.local),Wr;return qr!==gr&&(Wr=et(qr,gr),function(Ta){this.setAttributeNS(vt.space,vt.local,Wr(Ta))})})}return Js(this,"attr."+de,De,vt.local?zt:ar)},So.attrTween=function(de,De){var et=v.ns.qualify(de);function vt(St,ar){var zt=De.call(this,St,ar,this.getAttribute(et));return zt&&function(gr){this.setAttribute(et,zt(gr))}}function _t(St,ar){var zt=De.call(this,St,ar,this.getAttributeNS(et.space,et.local));return zt&&function(gr){this.setAttributeNS(et.space,et.local,zt(gr))}}return this.tween("attr."+de,et.local?_t:vt)},So.style=function(de,De,et){var vt=arguments.length;if(vt<3){if(typeof de!="string"){vt<2&&(De="");for(et in de)this.style(et,de[et],De);return this}et=""}function _t(){this.style.removeProperty(de)}function St(ar){return ar==null?_t:(ar+="",function(){var zt=t(this).getComputedStyle(this,null).getPropertyValue(de),gr;return zt!==ar&&(gr=Nl(zt,ar),function(qr){this.style.setProperty(de,gr(qr),et)})})}return Js(this,"style."+de,De,St)},So.styleTween=function(de,De,et){arguments.length<3&&(et="");function vt(_t,St){var ar=De.call(this,_t,St,t(this).getComputedStyle(this,null).getPropertyValue(de));return ar&&function(zt){this.style.setProperty(de,ar(zt),et)}}return this.tween("style."+de,vt)},So.text=function(de){return Js(this,"text",de,es)};function es(de){return de==null&&(de=""),function(){this.textContent=de}}So.remove=function(){var de=this.namespace;return this.each("end.transition",function(){var De;this[de].count<2&&(De=this.parentNode)&&De.removeChild(this)})},So.ease=function(de){var De=this.id,et=this.namespace;return arguments.length<1?this.node()[et][De].ease:(typeof de!="function"&&(de=v.ease.apply(v,arguments)),rt(this,function(vt){vt[et][De].ease=de}))},So.delay=function(de){var De=this.id,et=this.namespace;return arguments.length<1?this.node()[et][De].delay:rt(this,typeof de=="function"?function(vt,_t,St){vt[et][De].delay=+de.call(vt,vt.__data__,_t,St)}:(de=+de,function(vt){vt[et][De].delay=de}))},So.duration=function(de){var De=this.id,et=this.namespace;return arguments.length<1?this.node()[et][De].duration:rt(this,typeof de=="function"?function(vt,_t,St){vt[et][De].duration=Math.max(1,de.call(vt,vt.__data__,_t,St))}:(de=Math.max(1,de),function(vt){vt[et][De].duration=de}))},So.each=function(de,De){var et=this.id,vt=this.namespace;if(arguments.length<2){var _t=ll,St=hs;try{hs=et,rt(this,function(ar,zt,gr){ll=ar[vt][et],de.call(ar,ar.__data__,zt,gr)})}finally{ll=_t,hs=St}}else rt(this,function(ar){var zt=ar[vt][et];(zt.event||(zt.event=v.dispatch("start","end","interrupt"))).on(de,De)});return this},So.transition=function(){for(var de=this.id,De=++Ko,et=this.namespace,vt=[],_t,St,ar,zt,gr=0,qr=this.length;gr<qr;gr++){vt.push(_t=[]);for(var St=this[gr],Wr=0,Ta=St.length;Wr<Ta;Wr++)(ar=St[Wr])&&(zt=ar[et][de],Pl(ar,Wr,et,De,{time:zt.time,ease:zt.ease,delay:zt.delay+zt.duration,duration:zt.duration})),_t.push(ar)}return ss(vt,et,De)};function ts(de){return de==null?"__transition__":"__transition_"+de+"__"}function Pl(de,De,et,vt,_t){var St=de[et]||(de[et]={active:0,count:0}),ar=St[vt],zt,gr,qr,Wr,Ta;function ya(Ma){var Na=ar.delay;if(gr.t=Na+zt,Na<=Ma)return tn(Ma-Na);gr.c=tn}function tn(Ma){var Na=St.active,Ka=St[Na];Ka&&(Ka.timer.c=null,Ka.timer.t=NaN,--St.count,delete St[Na],Ka.event&&Ka.event.interrupt.call(de,de.__data__,Ka.index));for(var mn in St)if(+mn<vt){var cn=St[mn];cn.timer.c=null,cn.timer.t=NaN,--St.count,delete St[mn]}gr.c=on,ki(function(){return gr.c&&on(Ma||1)&&(gr.c=null,gr.t=NaN),1},0,zt),St.active=vt,ar.event&&ar.event.start.call(de,de.__data__,De),Ta=[],ar.tween.forEach(function(Pa,si){(si=si.call(de,de.__data__,De))&&Ta.push(si)}),Wr=ar.ease,qr=ar.duration}function on(Ma){for(var Na=Ma/qr,Ka=Wr(Na),mn=Ta.length;mn>0;)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]<Pi[0])],Zi[1]=_t[+(cs[1]<Pi[1])]):Pi=null),Pa&&gi(cs,De,0)&&(ya(mn),ps=!0),si&&gi(cs,et,1)&&(tn(mn),ps=!0),ps&&(Ta(mn),Ka({type:"brush",mode:ni?"move":"resize"}))}function gi(cs,ps,Tl){var Gl=ri(ps),Tu=Gl[0],Il=Gl[1],yc=Zi[Tl],nt=Tl?_t:vt,Yt=nt[1]-nt[0],cr,ua;if(ni&&(Tu-=yc,Il-=Yt+yc),cr=(Tl?gr:zt)?Math.max(Tu,Math.min(Il,cs[Tl])):cs[Tl],ni?ua=(cr+=yc)+Yt:(Pi&&(yc=Math.max(Tu,Math.min(Il,2*Pi[Tl]-cr))),yc<cr?(ua=cr,cr=yc):ua=yc),nt[0]!=cr||nt[1]!=ua)return Tl?ar=null:St=null,nt[0]=cr,nt[1]=ua,!0}function vo(){_l(),mn.style("pointer-events","all").selectAll(".resize").style("display",Wr.empty()?"none":null),v.select("body").style("cursor",null),$o.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),vi(),Ka({type:"brushend"})}}return Wr.x=function(Ma){return arguments.length?(De=Ma,qr=uc[!De<<1|!et],Wr):De},Wr.y=function(Ma){return arguments.length?(et=Ma,qr=uc[!De<<1|!et],Wr):et},Wr.clamp=function(Ma){return arguments.length?(De&&et?(zt=!!Ma[0],gr=!!Ma[1]):De?zt=!!Ma:et&&(gr=!!Ma),Wr):De&&et?[zt,gr]:De?zt:et?gr:null},Wr.extent=function(Ma){var Na,Ka,mn,cn,Pa;return arguments.length?(De&&(Na=Ma[0],Ka=Ma[1],et&&(Na=Na[0],Ka=Ka[0]),St=[Na,Ka],De.invert&&(Na=De(Na),Ka=De(Ka)),Ka<Na&&(Pa=Na,Na=Ka,Ka=Pa),(Na!=vt[0]||Ka!=vt[1])&&(vt=[Na,Ka])),et&&(mn=Ma[0],cn=Ma[1],De&&(mn=mn[1],cn=cn[1]),ar=[mn,cn],et.invert&&(mn=et(mn),cn=et(cn)),cn<mn&&(Pa=mn,mn=cn,cn=Pa),(mn!=_t[0]||cn!=_t[1])&&(_t=[mn,cn])),Wr):(De&&(St?(Na=St[0],Ka=St[1]):(Na=vt[0],Ka=vt[1],De.invert&&(Na=De.invert(Na),Ka=De.invert(Ka)),Ka<Na&&(Pa=Na,Na=Ka,Ka=Pa))),et&&(ar?(mn=ar[0],cn=ar[1]):(mn=_t[0],cn=_t[1],et.invert&&(mn=et.invert(mn),cn=et.invert(cn)),cn<mn&&(Pa=mn,mn=cn,cn=Pa))),De&&et?[[Na,mn],[Ka,cn]]:De?[Na,Ka]:et&&[mn,cn])},Wr.clear=function(){return Wr.empty()||(vt=[0,0],_t=[0,0],St=ar=null),Wr},Wr.empty=function(){return!!De&&vt[0]==vt[1]||!!et&&_t[0]==_t[1]},v.rebind(Wr,de,"on")};var su={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},uc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];v.text=Ca(function(de){return de.responseText}),v.json=function(de,De){return Fa(de,"application/json",Vl,De)};function Vl(de){return JSON.parse(de.responseText)}v.html=function(de,De){return Fa(de,"text/html",ql,De)};function ql(de){var De=M.createRange();return De.selectNode(M.body),De.createContextualFragment(de.responseText)}v.xml=Ca(function(de){return de.responseXML}),typeof q=="object"&&q.exports?q.exports=v:this.d3=v}).apply(self)}}),$p=Ze({"node_modules/d3-time/dist/d3-time.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";var x=new Date,A=new Date;function M(fe,Fe,rt,st){function Qe(Lt){return fe(Lt=arguments.length===0?new Date:new Date(+Lt)),Lt}return Qe.floor=function(Lt){return fe(Lt=new Date(+Lt)),Lt},Qe.ceil=function(Lt){return fe(Lt=new Date(Lt-1)),Fe(Lt,1),fe(Lt),Lt},Qe.round=function(Lt){var kt=Qe(Lt),qt=Qe.ceil(Lt);return Lt-kt<qt-Lt?kt:qt},Qe.offset=function(Lt,kt){return Fe(Lt=new Date(+Lt),kt==null?1:Math.floor(kt)),Lt},Qe.range=function(Lt,kt,qt){var Zt=[],Sr;if(Lt=Qe.ceil(Lt),qt=qt==null?1:Math.floor(qt),!(Lt<kt)||!(qt>0))return Zt;do Zt.push(Sr=new Date(+Lt)),Fe(Lt,qt),fe(Lt);while(Sr<Lt&&Lt<kt);return Zt},Qe.filter=function(Lt){return M(function(kt){if(kt>=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));++It<kr;)Ur.charCodeAt(It)===37&&(fa.push(Ur.slice(dr,It)),(Ca=r[na=Ur.charAt(++It)])!=null?na=Ur.charAt(++It):Ca=na==="e"?" ":"0",(Fa=aa[na])&&(na=Fa(da,Ca)),fa.push(na),dr=It+1);return fa.push(Ur.slice(dr,It)),fa.join("")}}function kn(Ur,aa){return function(da){var fa=e(1900,void 0,1),It=Jt(fa,Ur,da+="",0),dr,kr;if(It!=da.length)return null;if("Q"in fa)return new Date(fa.Q);if("s"in fa)return new Date(fa.s*1e3+("L"in fa?fa.L:0));if(aa&&!("Z"in fa)&&(fa.Z=0),"p"in fa&&(fa.H=fa.H%12+fa.p*12),fa.m===void 0&&(fa.m="q"in fa?fa.q:0),"V"in fa){if(fa.V<1||fa.V>53)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<dr;){if(fa>=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+(Ce<Ue?new Array(Ue-Ce+1).join(Ke)+Ve:Ve)}function s(Be){return Be.replace(n,"\\$&")}function c(Be){return new RegExp("^(?:"+Be.map(s).join("|")+")","i")}function h(Be){for(var Ke={},Ue=-1,Ee=Be.length;++Ue<Ee;)Ke[Be[Ue].toLowerCase()]=Ue;return Ke}function m(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+1));return Ee?(Be.w=+Ee[0],Ue+Ee[0].length):-1}function d(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+1));return Ee?(Be.u=+Ee[0],Ue+Ee[0].length):-1}function T(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.U=+Ee[0],Ue+Ee[0].length):-1}function l(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.V=+Ee[0],Ue+Ee[0].length):-1}function _(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.W=+Ee[0],Ue+Ee[0].length):-1}function w(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+4));return Ee?(Be.y=+Ee[0],Ue+Ee[0].length):-1}function S(Be,Ke,Ue){var Ee=i.exec(Ke.slice(Ue,Ue+2));return Ee?(Be.y=+Ee[0]+(+Ee[0]>68?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;u<p;++u)switch(b[u]){case".":y=f=u;break;case"0":y===0&&(y=u),f=u;break;default:if(!+b[u])break e;y>0&&(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;++Ae<ze;)if(Re=re.charCodeAt(Ae),48>Re||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<se?new Array(se-it+1).join(N):"";switch(he&&ue&&(re=p(ot+re,ot.length?se-be.length:1/0),ot=""),U){case"<":re=ce+re+be+ot;break;case"=":re=ce+ot+re+be;break;case"^":re=ot.slice(0,it=ot.length>>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;M<x;M++)if(A=v.charCodeAt(M),(A<9||A>13)&&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<x.length;M++)A[x.charCodeAt(M)]=M;var e=function(r){var i=new Uint8Array(r),a,n=i.length,o="";for(a=0;a<n;a+=3)o+=x[i[a]>>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<a;n+=4)s=A[r.charCodeAt(n)],c=A[r.charCodeAt(n+1)],h=A[r.charCodeAt(n+2)],m=A[r.charCodeAt(n+3)],T[o++]=s<<2|c>>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;E<S;E++)c[E]=new d(l,p,g),p+=b;else if(w===3){S=+_[1];for(var u=+_[2],y=0;y<u;y++)for(c[y]=[],E=0;E<S;E++)c[y][E]=new d(l,p,g),p+=b}else throw new Error("ndim: "+w+'is not supported with the shape:"'+h.shape+'"');return c.bdata=h.bdata,c.dtype=h.dtype,c.shape=_.reverse().join(","),s._inputArray=c,c},Z.isTypedArraySpec=function(s){return v(s)&&s.hasOwnProperty("dtype")&&typeof s.dtype=="string"&&s.hasOwnProperty("bdata")&&(typeof s.bdata=="string"||a(s.bdata))&&(s.shape===void 0||s.hasOwnProperty("shape")&&(typeof s.shape=="string"||typeof s.shape=="number"))};function n(s){return{bdata:s.bdata,dtype:s.dtype,shape:s.shape}}Z.concat=function(){var s=[],c=!0,h=0,m,d,T,l,_,w,S,E;for(T=0;T<arguments.length;T++)l=arguments[T],w=l.length,w&&(d?s.push(l):(d=l,_=w),x(l)?m=!1:(c=!1,h?m!==l.constructor&&(m=!1):m=l.constructor),h+=w);if(!h)return[];if(!s.length)return d;if(c)return d.concat.apply(d,s);if(m){for(S=new m(h),S.set(d),T=0;T<s.length;T++)l=s[T],S.set(l,_),_+=l.length;return S}for(S=new Array(h),E=0;E<d.length;E++)S[E]=d[E];for(T=0;T<s.length;T++){for(l=s[T],E=0;E<l.length;E++)S[_+E]=l[E];_+=E}return S},Z.maxRowLength=function(s){return o(s,Math.max,0)},Z.minRowLength=function(s){return o(s,Math.min,1/0)};function o(s,c,h){if(t(s))if(t(s[0])){for(var m=h,d=0;d<s.length;d++)m=c(m,s[d].length);return m}else return s.length;return 0}}}),b_=Ze({"src/lib/nested_property.js"(Z,q){"use strict";var v=is(),x=xp().isArrayOrTypedArray;q.exports=function(s,c){if(v(c))c=String(c);else if(typeof c!="string"||c.substr(c.length-4)==="[-1]")throw"bad property string";var h=c.split("."),m,d,T,l;for(l=0;l<h.length;l++)if(String(h[l]).slice(0,2)==="__")throw"bad property string";for(l=0;l<h.length;){if(m=String(h[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/),m){if(m[1])h[l]=m[1];else if(l===0)h.splice(0,1);else throw"bad property string";for(d=m[2].substr(1,m[2].length-2).split("]["),T=0;T<d.length;T++)l++,h.splice(l,0,Number(d[T]))}l++}return typeof s!="object"?n(s,c,h):{set:t(s,h,c),get:A(s,h),astr:c,parts:h,obj:s}};function A(o,s){return function(c){var h=o,m,d,T,l,_;for(l=0;l<s.length-1;l++){if(m=s[l],m===-1){for(d=!0,T=[],_=0;_<h.length;_++)T[_]=A(h[_],s.slice(l+1))(c),T[_]!==T[0]&&(d=!1);return d?T[0]:T}if(typeof m=="number"&&!x(h)||(h=h[m],typeof h!="object"||h===null))return}if(!(typeof h!="object"||h===null)&&(T=h[s[l]],!(!c&&T===null)))return T}}var M=/(^|\.)args\[/;function e(o,s){return o===void 0||o===null&&!s.match(M)}function t(o,s,c){return function(h){var m=o,d="",T=[[o,d]],l=e(h,c),_,w;for(w=0;w<s.length-1;w++){if(_=s[w],typeof _=="number"&&!x(m))throw"array index but container is not an array";if(_===-1){if(l=!i(m,s.slice(w+1),h,c),l)break;return}if(!a(m,_,s[w+1],l))break;if(m=m[_],typeof m!="object"||m===null)throw"container is not an object";d=r(d,_),T.push([m,d])}if(l){if(w===s.length-1&&(delete m[s[w]],Array.isArray(m)&&+s[w]===m.length-1))for(;m.length&&m[m.length-1]===void 0;)m.pop()}else m[s[w]]=h}}function r(o,s){var c=s;return v(s)?c="["+s+"]":o&&(c="."+s),o+c}function i(o,s,c,h){var m=x(c),d=!0,T=c,l=h.replace("-1",0),_=m?!1:e(c,l),w=s[0],S;for(S=0;S<o.length;S++)l=h.replace("-1",S),m&&(T=c[S%c.length],_=e(T,l)),_&&(d=!1),a(o,S,w,_)&&t(o[S],s,h.replace("-1",S))(T);return d}function a(o,s,c,h){if(o[s]===void 0){if(h)return!1;typeof c=="number"?o[s]=[]:o[s]={}}return!0}function n(o,s,c){return{set:function(){throw"bad container"},get:function(){},astr:s,parts:c,obj:o}}}}),lF=Ze({"src/lib/keyed_container.js"(Z,q){"use strict";var v=b_(),x=/^\w*$/,A=0,M=1,e=2,t=3,r=4;q.exports=function(a,n,o,s){o=o||"name",s=s||"value";var c,h,m,d={};n&&n.length?(m=v(a,n),h=m.get()):h=a,n=n||"";var T={};if(h)for(c=0;c<h.length;c++)T[h[c][o]]=c;var l=x.test(s),_={set:function(w,S){var E=S===null?r:A;if(!h){if(!m||E===r)return;h=[],m.set(h)}var g=T[w];if(g===void 0){if(E===r)return;E=E|t,g=h.length,T[w]=g}else S!==(l?h[g][s]:v(h[g],s).get())&&(E=E|e);var b=h[g]=h[g]||{};return b[o]=w,l?b[s]=S:v(b,s).set(S),S!==null&&(E=E&~r),d[g]=d[g]|E,_},get:function(w){if(h){var S=T[w];if(S!==void 0)return l?h[S][s]:v(h[S],s).get()}},rename:function(w,S){var E=T[w];return E===void 0||(d[E]=d[E]|M,T[S]=E,delete T[w],h[E][o]=S),_},remove:function(w){var S=T[w];if(S===void 0)return _;var E=h[S];if(Object.keys(E).length>2)return d[S]=d[S]|e,_.set(w,null);if(l){for(c=S;c<h.length;c++)d[c]=d[c]|t;for(c=S;c<h.length;c++)T[h[c][o]]--;h.splice(S,1),delete T[w]}else v(E,s).set(null),d[S]=d[S]|e|r;return _},constructUpdate:function(){for(var w,S,E={},g=Object.keys(d),b=0;b<g.length;b++)S=g[b],w=n+"["+S+"]",h[S]?(d[S]&M&&(E[w+"."+o]=h[S][o]),d[S]&e&&(l?E[w+"."+s]=d[S]&r?null:h[S][s]:E[w+"."+s]=d[S]&r?null:v(h[S],s).get())):E[w]=null;return E}};return _}}}),uF=Ze({"src/lib/relative_attr.js"(Z,q){"use strict";var v=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,x=/^[^\.\[\]]+$/;q.exports=function(A,M){for(;M;){var e=A.match(v);if(e)A=e[1];else if(A.match(x))A="";else throw new Error("bad relativeAttr call:"+[A,M]);if(M.charAt(0)==="^")M=M.slice(1);else break}return A&&M.charAt(0)!=="["?A+"."+M:A+M}}}),f2=Ze({"src/lib/to_log_range.js"(Z,q){"use strict";var v=is();q.exports=function(A,M){if(A>0)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;n<a;n++)i[n]!==r[n]&&x(r[n])&&x(i[n])&&A(i[n],r[n])}else x(r)&&x(i)&&(A(i,r),Object.keys(i).length||delete M[t])}}}}),Yy=Ze({"src/lib/mod.js"(Z,q){"use strict";function v(A,M){var e=A%M;return e<0?e+M:e}function x(A,M){return Math.abs(A)>M/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+(ee<re?6:0);break;case ee:Ae=(re-j)/We+2;break;case re:Ae=(j-ee)/We+4;break}Ae/=6}return{h:Ae,s:ze,l:Re}}function c(j,ee,re){var ce,be,Ae;j=N(j,360),ee=N(ee,100),re=N(re,100);function ze(it,ot,tt){return tt<0&&(tt+=1),tt>1&&(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<re?6:0);break;case ee:Ae=(re-j)/We+2;break;case re:Ae=(j-ee)/We+4;break}Ae/=6}return{h:Ae,s:ze,v:Re}}function m(j,ee,re){j=N(j,360)*6,ee=N(ee,100),re=N(re,100);var ce=v.floor(j),be=j-ce,Ae=re*(1-ee),ze=re*(1-be*ee),Re=re*(1-(1-be)*ee),We=ce%6,it=[re,ze,Ae,Ae,Re,re][We],ot=[Re,re,re,ze,Ae,Ae][We],tt=[Ae,Ae,Re,re,re,ze][We];return{r:it*255,g:ot*255,b:tt*255}}function d(j,ee,re,ce){var be=[se(e(j).toString(16)),se(e(ee).toString(16)),se(e(re).toString(16))];return ce&&be[0].charAt(0)==be[0].charAt(1)&&be[1].charAt(0)==be[1].charAt(1)&&be[2].charAt(0)==be[2].charAt(1)?be[0].charAt(0)+be[1].charAt(0)+be[2].charAt(0):be.join("")}function T(j,ee,re,ce,be){var Ae=[se(e(j).toString(16)),se(e(ee).toString(16)),se(e(re).toString(16)),se(H(ce))];return be&&Ae[0].charAt(0)==Ae[0].charAt(1)&&Ae[1].charAt(0)==Ae[1].charAt(1)&&Ae[2].charAt(0)==Ae[2].charAt(1)&&Ae[3].charAt(0)==Ae[3].charAt(1)?Ae[0].charAt(0)+Ae[1].charAt(0)+Ae[2].charAt(0)+Ae[3].charAt(0):Ae.join("")}function l(j,ee,re,ce){var be=[se(H(ce)),se(e(j).toString(16)),se(e(ee).toString(16)),se(e(re).toString(16))];return be.join("")}a.equals=function(j,ee){return!j||!ee?!1:a(j).toRgbString()==a(ee).toRgbString()},a.random=function(){return a.fromRatio({r:i(),g:i(),b:i()})};function _(j,ee){ee=ee===0?0:ee||10;var re=a(j).toHsl();return re.s-=ee/100,re.s=U(re.s),a(re)}function w(j,ee){ee=ee===0?0:ee||10;var re=a(j).toHsl();return re.s+=ee/100,re.s=U(re.s),a(re)}function S(j){return a(j).desaturate(100)}function E(j,ee){ee=ee===0?0:ee||10;var re=a(j).toHsl();return re.l+=ee/100,re.l=U(re.l),a(re)}function g(j,ee){ee=ee===0?0:ee||10;var re=a(j).toRgb();return re.r=r(0,t(255,re.r-e(255*-(ee/100)))),re.g=r(0,t(255,re.g-e(255*-(ee/100)))),re.b=r(0,t(255,re.b-e(255*-(ee/100)))),a(re)}function b(j,ee){ee=ee===0?0:ee||10;var re=a(j).toHsl();return re.l-=ee/100,re.l=U(re.l),a(re)}function p(j,ee){var re=a(j).toHsl(),ce=(re.h+ee)%360;return re.h=ce<0?360+ce:ce,a(re)}function u(j){var ee=a(j).toHsl();return ee.h=(ee.h+180)%360,a(ee)}function y(j){var ee=a(j).toHsl(),re=ee.h;return[a(j),a({h:(re+120)%360,s:ee.s,l:ee.l}),a({h:(re+240)%360,s:ee.s,l:ee.l})]}function f(j){var ee=a(j).toHsl(),re=ee.h;return[a(j),a({h:(re+90)%360,s:ee.s,l:ee.l}),a({h:(re+180)%360,s:ee.s,l:ee.l}),a({h:(re+270)%360,s:ee.s,l:ee.l})]}function P(j){var ee=a(j).toHsl(),re=ee.h;return[a(j),a({h:(re+72)%360,s:ee.s,l:ee.l}),a({h:(re+216)%360,s:ee.s,l:ee.l})]}function L(j,ee,re){ee=ee||6,re=re||30;var ce=a(j).toHsl(),be=360/re,Ae=[a(j)];for(ce.h=(ce.h-(be*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;it<ee.length;it++)Ae=a.readability(j,ee[it]),Ae>be&&(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<M.length;t++){if(r=M[t],r!==null&&typeof r=="object")return!1;r!==void 0&&(e[t]=r)}return!0}Z.extendFlat=function(){return A(arguments,!1,!1,!1)},Z.extendDeep=function(){return A(arguments,!0,!1,!1)},Z.extendDeepAll=function(){return A(arguments,!0,!0,!1)},Z.extendDeepNoArrays=function(){return A(arguments,!0,!1,!0)};function A(M,e,t,r){var i=M[0],a=M.length,n,o,s,c,h,m,d;if(a===2&&v(i)&&v(M[1])&&i.length===0){if(d=x(M[1],i),d)return i;i.splice(0,i.length)}for(var T=1;T<a;T++){n=M[T];for(o in n)s=i[o],c=n[o],r&&v(c)?i[o]=c:e&&c&&(q(c)||(h=v(c)))?(h?(h=!1,m=s&&v(s)?s:[]):m=s&&q(s)?s:{},i[o]=A([m,c],e,t,r)):(typeof c<"u"||t)&&(i[o]=c)}return i}}}),tc=Ze({"src/plots/font_attributes.js"(Z,q){"use strict";q.exports=function(v){var x=v.variantValues,A=v.editType,M=v.colorEditType;M===void 0&&(M=A);var e={editType:A,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};v.noNumericWeightValues&&(e.valType="enumerated",e.values=e.extras,e.extras=void 0,e.min=void 0,e.max=void 0);var t={family:{valType:"string",noBlank:!0,strict:!0,editType:A},size:{valType:"number",min:1,editType:A},color:{valType:"color",editType:M},weight:e,style:{editType:A,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:v.noFontVariant?void 0:{editType:A,valType:"enumerated",values:x||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:v.noFontTextcase?void 0:{editType:A,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:v.noFontLineposition?void 0:{editType:A,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:v.noFontShadow?void 0:{editType:A,valType:"string",dflt:v.autoShadowDflt?"auto":"none"},editType:A};return v.autoSize&&(t.size.dflt="auto"),v.autoColor&&(t.color.dflt="auto"),v.arrayOk&&(t.family.arrayOk=!0,t.weight.arrayOk=!0,t.style.arrayOk=!0,v.noFontVariant||(t.variant.arrayOk=!0),v.noFontTextcase||(t.textcase.arrayOk=!0),v.noFontLineposition||(t.lineposition.arrayOk=!0),v.noFontShadow||(t.shadow.arrayOk=!0),t.size.arrayOk=!0,t.color.arrayOk=!0),t}}}),w_=Ze({"src/components/fx/constants.js"(Z,q){"use strict";q.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),Xm=Ze({"src/components/fx/layout_attributes.js"(Z,q){"use strict";var v=w_(),x=tc(),A=x({editType:"none"});A.family.dflt=v.HOVERFONT,A.size.dflt=v.HOVERFONTSIZE,q.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:A,grouptitlefont:x({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}}),Ky=Ze({"src/components/fx/attributes.js"(Z,q){"use strict";var v=tc(),x=Xm().hoverlabel,A=rs().extendFlat;q.exports={hoverlabel:{bgcolor:A({},x.bgcolor,{arrayOk:!0}),bordercolor:A({},x.bordercolor,{arrayOk:!0}),font:v({arrayOk:!0,editType:"none"}),align:A({},x.align,{arrayOk:!0}),namelength:A({},x.namelength,{arrayOk:!0}),showarrow:A({},x.showarrow),editType:"none"}}}}),eu=Ze({"src/plots/attributes.js"(Z,q){"use strict";var v=tc(),x=Ky();q.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:v({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:x.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}}),Gg=Ze({"src/components/colorscale/scales.js"(Z,q){"use strict";var v=Ch(),x={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},A=x.RdBu;function M(r,i){if(i||(i=A),!r)return i;function a(){try{r=x[r]||JSON.parse(r)}catch{r=i}}return typeof r=="string"&&(a(),typeof r=="string"&&a()),e(r)?r:i}function e(r){var i=0;if(!Array.isArray(r)||r.length<2||!r[0]||!r[r.length-1]||+r[0][0]!=0||+r[r.length-1][0]!=1)return!1;for(var a=0;a<r.length;a++){var n=r[a];if(n.length!==2||+n[0]<i||!v(n[1]).isValid())return!1;i=+n[0]}return!0}function t(r){return x[r]!==void 0?!0:e(r)}q.exports={scales:x,defaultScale:A,get:M,isValid:t}}}),oh=Ze({"src/components/color/attributes.js"(Z){"use strict";Z.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Z.defaultLine="#444",Z.lightLine="#eee",Z.background="#fff",Z.borderLine="#BEC8D9",Z.lightFraction=100*10/11}}),Yi=Ze({"src/components/color/index.js"(Z,q){"use strict";var v=Ch(),x=is(),A=xp().isTypedArray,M=q.exports={},e=oh();M.defaults=e.defaults;var t=M.defaultLine=e.defaultLine;M.lightLine=e.lightLine;var r=M.background=e.background;M.tinyRGB=function(a){var n=a.toRgb();return"rgb("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+")"},M.rgb=function(a){return M.tinyRGB(v(a))},M.opacity=function(a){return a?v(a).getAlpha():0},M.addOpacity=function(a,n){var o=v(a).toRgb();return"rgba("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+", "+n+")"},M.combine=function(a,n){var o=v(a).toRgb();if(o.a===1)return v(a).toRgbString();var s=v(n||r).toRgb(),c=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},h={r:c.r*(1-o.a)+o.r*o.a,g:c.g*(1-o.a)+o.g*o.a,b:c.b*(1-o.a)+o.b*o.a};return v(h).toRgbString()},M.interpolate=function(a,n,o){var s=v(a).toRgb(),c=v(n).toRgb(),h={r:o*s.r+(1-o)*c.r,g:o*s.g+(1-o)*c.g,b:o*s.b+(1-o)*c.b};return v(h).toRgbString()},M.contrast=function(a,n,o){var s=v(a);s.getAlpha()!==1&&(s=v(M.combine(a,r)));var c=s.isDark()?n?s.lighten(n):r:o?s.darken(o):t;return c.toString()},M.stroke=function(a,n){var o=v(n);a.style({stroke:M.tinyRGB(o),"stroke-opacity":o.getAlpha()})},M.fill=function(a,n){var o=v(n);a.style({fill:M.tinyRGB(o),"fill-opacity":o.getAlpha()})},M.clean=function(a){if(!(!a||typeof a!="object")){var n=Object.keys(a),o,s,c,h;for(o=0;o<n.length;o++)if(c=n[o],h=a[c],c.substr(c.length-5)==="color")if(Array.isArray(h))for(s=0;s<h.length;s++)h[s]=i(h[s]);else a[c]=i(h);else if(c.substr(c.length-10)==="colorscale"&&Array.isArray(h))for(s=0;s<h.length;s++)Array.isArray(h[s])&&(h[s][1]=i(h[s][1]));else if(Array.isArray(h)){var m=h[0];if(!Array.isArray(m)&&m&&typeof m=="object")for(s=0;s<h.length;s++)M.clean(h[s])}else h&&typeof h=="object"&&!A(h)&&M.clean(h)}};function i(a){if(x(a)||typeof a!="string")return a;var n=a.trim();if(n.substr(0,3)!=="rgb")return a;var o=n.match(/^rgba?\s*\(([^()]*)\)$/);if(!o)return a;var s=o[1].trim().split(/\s*[\s,]\s*/),c=n.charAt(3)==="a"&&s.length===4;if(!c&&s.length!==3)return a;for(var h=0;h<s.length;h++){if(!s[h].length||(s[h]=Number(s[h]),!(s[h]>=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;T<d.length;T++){var l=String(d[T]);if(l.charAt(0)==="/"&&l.charAt(l.length-1)==="/"){var _=new RegExp(l.substr(1,l.length-2));if(_.test(h))return!0}else if(h===d[T])return!0}return!1}},boolean:{coerceFunction:function(h,m,d){h===!0||h===!1?m.set(h):m.set(d)}},number:{coerceFunction:function(h,m,d,T){o(h)&&(h=s(h)),!q(h)||T.min!==void 0&&h<T.min||T.max!==void 0&&h>T.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&&h<T.min||T.max!==void 0&&h>T.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;_<l.length;){var w=l[_];T.flags.indexOf(w)===-1||l.indexOf(w)<_?l.splice(_,1):_++}l.length?m.set(l.join("+")):m.set(d)}},any:{coerceFunction:function(h,m,d){h===void 0?m.set(d):m.set(o(h)?s(h):h)}},info_array:{coerceFunction:function(h,m,d,T){function l(F,B,O){var I,N={set:function(U){I=U}};return O===void 0&&(O=B.dflt),Z.valObjectMeta[B.valType].coerceFunction(F,N,O,B),I}if(o(h)&&(h=s(h)),!n(h)){m.set(d);return}var _=T.dimensions===2||T.dimensions==="1-2"&&Array.isArray(h)&&n(h[0]),w=T.items,S=[],E=Array.isArray(w),g=E&&_&&n(w[0]),b=_&&E&&!g,p=E&&!b?w.length:h.length,u,y,f,P,L,z;if(d=Array.isArray(d)?d:[],_)for(u=0;u<p;u++)for(S[u]=[],f=n(h[u])?h[u]:[],b?L=w.length:E?L=w[u].length:L=f.length,y=0;y<L;y++)b?P=w[y]:E?P=w[u][y]:P=w,z=l(f[y],P,(d[u]||[])[y]),z!==void 0&&(S[u][y]=z);else for(u=0;u<p;u++)z=l(h[u],E?w[u]:w,d[u]),z!==void 0&&(S[u]=z);m.set(S)},validateFunction:function(h,m){if(!n(h))return!1;var d=m.items,T=Array.isArray(d),l=m.dimensions===2;if(!m.freeLength&&h.length!==d.length)return!1;for(var _=0;_<h.length;_++)if(l){if(!n(h[_])||!m.freeLength&&h[_].length!==d[_].length)return!1;for(var w=0;w<h[_].length;w++)if(!c(h[_][w],T?d[_][w]:d))return!1}else if(!c(h[_],T?d[_]:d))return!1;return!0}}},Z.coerce=function(h,m,d,T,l){var _=r(d,T).get(),w=r(h,T),S=r(m,T),E=w.get(),g=m._template;if(E===void 0&&g&&(E=r(g,T).get(),g=0),l===void 0&&(l=_.dflt),_.arrayOk){if(n(E))return S.set(E),E;if(o(E))return E=s(E),S.set(E),E}var b=Z.valObjectMeta[_.valType].coerceFunction;b(E,S,l,_);var p=S.get();return g&&p===l&&!c(E,_)&&(E=r(g,T).get(),b(E,S,l,_),p=S.get()),p},Z.coerce2=function(h,m,d,T,l){var _=r(h,T),w=Z.coerce(h,m,d,T,l),S=_.get();return S!=null?w:!1},Z.coerceFont=function(h,m,d,T){T||(T={}),d=x({},d),d=x(d,T.overrideDflt||{});var l={family:h(m+".family",d.family),size:h(m+".size",d.size),color:h(m+".color",d.color),weight:h(m+".weight",d.weight),style:h(m+".style",d.style)};if(T.noFontVariant||(l.variant=h(m+".variant",d.variant)),T.noFontLineposition||(l.lineposition=h(m+".lineposition",d.lineposition)),T.noFontTextcase||(l.textcase=h(m+".textcase",d.textcase)),!T.noFontShadow){var _=d.shadow;_==="none"&&T.autoShadowDflt&&(_="auto"),l.shadow=h(m+".shadow",_)}return l},Z.coercePattern=function(h,m,d,T){var l=h(m+".shape"),_;if(l||(_=h(m+".path")),l||_){l&&h(m+".solidity"),h(m+".size");var w=h(m+".fillmode"),S=w==="overlay";if(!T){var E=h(m+".bgcolor",S?d:void 0);h(m+".fgcolor",S?e.contrast(E):d)}h(m+".fgopacity",S?.5:1)}},Z.coerceHoverinfo=function(h,m,d){var T=m._module.attributes,l=T.hoverinfo?T:A,_=l.hoverinfo,w;if(d._dataLength===1){var S=_.dflt==="all"?_.flags.slice():_.dflt.split("+");S.splice(S.indexOf("name"),1),w=S.join("+")}return Z.coerce(h,m,l,"hoverinfo",w)},Z.coerceSelectionMarkerOpacity=function(h,m){if(h.marker){var d=h.marker.opacity;if(d!==void 0){var T,l;!n(d)&&!h.selected&&!h.unselected&&(T=d,l=t*d),m("selected.marker.opacity",T),m("unselected.marker.opacity",l)}}};function c(h,m){var d=Z.valObjectMeta[m.valType];if(m.arrayOk&&n(h))return!0;if(d.validateFunction)return d.validateFunction(h,m);var T={},l=T,_={set:function(w){l=w}};return d.coerceFunction(h,_,T,m),l!==T}Z.validate=c}}),Hg=Ze({"src/plot_api/plot_config.js"(Z,q){"use strict";var v={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},x={};function A(M,e){for(var t in M){var r=M[t];r.valType?e[t]=r.dflt:(e[t]||(e[t]={}),A(r,e[t]))}}A(v,x),q.exports={configAttributes:v,dfltConfig:x}}}),KA=Ze({"src/lib/notifier.js"(Z,q){"use strict";var v=Oi(),x=is(),A=[];q.exports=function(M,e){if(A.indexOf(M)!==-1)return;A.push(M);var t=1e3;x(e)?t=e:e==="long"&&(t=3e3);var r=v.select("body").selectAll(".plotly-notifier").data([0]);r.enter().append("div").classed("plotly-notifier",!0);var i=r.selectAll(".notifier-note").data(A);function a(n){n.duration(700).style("opacity",0).each("end",function(o){var s=A.indexOf(o);s!==-1&&A.splice(s,1),v.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(n){var o=v.select(this);o.append("button").classed("notifier-close",!0).html("×").on("click",function(){o.transition().call(a)});for(var s=o.append("p"),c=n.split(/<br\s*\/?>/g),h=0;h<c.length;h++)h&&s.append("br"),s.append("span").text(c[h]);e==="stick"?o.transition().duration(350).style("opacity",1):o.transition().duration(700).style("opacity",1).transition().delay(t).call(a)})}}}),Ym=Ze({"src/lib/loggers.js"(Z,q){"use strict";var v=Hg().dfltConfig,x=KA(),A=q.exports={};A.log=function(){var M;if(v.logging>1){var e=["LOG:"];for(M=0;M<arguments.length;M++)e.push(arguments[M]);console.trace.apply(console,e)}if(v.notifyOnLogging>1){var t=[];for(M=0;M<arguments.length;M++)t.push(arguments[M]);x(t.join("<br>"),"long")}},A.warn=function(){var M;if(v.logging>0){var e=["WARN:"];for(M=0;M<arguments.length;M++)e.push(arguments[M]);console.trace.apply(console,e)}if(v.notifyOnLogging>0){var t=[];for(M=0;M<arguments.length;M++)t.push(arguments[M]);x(t.join("<br>"),"stick")}},A.error=function(){var M;if(v.logging>0){var e=["ERROR:"];for(M=0;M<arguments.length;M++)e.push(arguments[M]);console.error.apply(console,e)}if(v.notifyOnLogging>0){var t=[];for(M=0;M<arguments.length;M++)t.push(arguments[M]);x(t.join("<br>"),"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;e<x.length;e++)if(x[e]instanceof RegExp&&x[e].toString()===M)return x;x.push(A)}else(A||A===0)&&x.indexOf(A)===-1&&x.push(A);return x}}}),hF=Ze({"node_modules/gl-mat4/create.js"(Z,q){q.exports=v;function v(){var x=new Float32Array(16);return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),pF=Ze({"node_modules/gl-mat4/clone.js"(Z,q){q.exports=v;function v(x){var A=new Float32Array(16);return A[0]=x[0],A[1]=x[1],A[2]=x[2],A[3]=x[3],A[4]=x[4],A[5]=x[5],A[6]=x[6],A[7]=x[7],A[8]=x[8],A[9]=x[9],A[10]=x[10],A[11]=x[11],A[12]=x[12],A[13]=x[13],A[14]=x[14],A[15]=x[15],A}}}),dF=Ze({"node_modules/gl-mat4/copy.js"(Z,q){q.exports=v;function v(x,A){return x[0]=A[0],x[1]=A[1],x[2]=A[2],x[3]=A[3],x[4]=A[4],x[5]=A[5],x[6]=A[6],x[7]=A[7],x[8]=A[8],x[9]=A[9],x[10]=A[10],x[11]=A[11],x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15],x}}}),$A=Ze({"node_modules/gl-mat4/identity.js"(Z,q){q.exports=v;function v(x){return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),vF=Ze({"node_modules/gl-mat4/transpose.js"(Z,q){q.exports=v;function v(x,A){if(x===A){var M=A[1],e=A[2],t=A[3],r=A[6],i=A[7],a=A[11];x[1]=A[4],x[2]=A[8],x[3]=A[12],x[4]=M,x[6]=A[9],x[7]=A[13],x[8]=e,x[9]=r,x[11]=A[14],x[12]=t,x[13]=i,x[14]=a}else x[0]=A[0],x[1]=A[4],x[2]=A[8],x[3]=A[12],x[4]=A[1],x[5]=A[5],x[6]=A[9],x[7]=A[13],x[8]=A[2],x[9]=A[6],x[10]=A[10],x[11]=A[14],x[12]=A[3],x[13]=A[7],x[14]=A[11],x[15]=A[15];return x}}}),mF=Ze({"node_modules/gl-mat4/invert.js"(Z,q){q.exports=v;function v(x,A){var M=A[0],e=A[1],t=A[2],r=A[3],i=A[4],a=A[5],n=A[6],o=A[7],s=A[8],c=A[9],h=A[10],m=A[11],d=A[12],T=A[13],l=A[14],_=A[15],w=M*a-e*i,S=M*n-t*i,E=M*o-r*i,g=e*n-t*a,b=e*o-r*a,p=t*o-r*n,u=s*T-c*d,y=s*l-h*d,f=s*_-m*d,P=c*l-h*T,L=c*_-m*T,z=h*_-m*l,F=w*z-S*L+E*P+g*f-b*y+p*u;return F?(F=1/F,x[0]=(a*z-n*L+o*P)*F,x[1]=(t*L-e*z-r*P)*F,x[2]=(T*p-l*b+_*g)*F,x[3]=(h*b-c*p-m*g)*F,x[4]=(n*f-i*z-o*y)*F,x[5]=(M*z-t*f+r*y)*F,x[6]=(l*E-d*p-_*S)*F,x[7]=(s*p-h*E+m*S)*F,x[8]=(i*L-a*f+o*u)*F,x[9]=(e*f-M*L-r*u)*F,x[10]=(d*b-T*E+_*w)*F,x[11]=(c*E-s*b-m*w)*F,x[12]=(a*y-i*P-n*u)*F,x[13]=(M*P-e*y+t*u)*F,x[14]=(T*S-d*g-l*w)*F,x[15]=(s*g-c*S+h*w)*F,x):null}}}),gF=Ze({"node_modules/gl-mat4/adjoint.js"(Z,q){q.exports=v;function v(x,A){var M=A[0],e=A[1],t=A[2],r=A[3],i=A[4],a=A[5],n=A[6],o=A[7],s=A[8],c=A[9],h=A[10],m=A[11],d=A[12],T=A[13],l=A[14],_=A[15];return x[0]=a*(h*_-m*l)-c*(n*_-o*l)+T*(n*m-o*h),x[1]=-(e*(h*_-m*l)-c*(t*_-r*l)+T*(t*m-r*h)),x[2]=e*(n*_-o*l)-a*(t*_-r*l)+T*(t*o-r*n),x[3]=-(e*(n*m-o*h)-a*(t*m-r*h)+c*(t*o-r*n)),x[4]=-(i*(h*_-m*l)-s*(n*_-o*l)+d*(n*m-o*h)),x[5]=M*(h*_-m*l)-s*(t*_-r*l)+d*(t*m-r*h),x[6]=-(M*(n*_-o*l)-i*(t*_-r*l)+d*(t*o-r*n)),x[7]=M*(n*m-o*h)-i*(t*m-r*h)+s*(t*o-r*n),x[8]=i*(c*_-m*T)-s*(a*_-o*T)+d*(a*m-o*c),x[9]=-(M*(c*_-m*T)-s*(e*_-r*T)+d*(e*m-r*c)),x[10]=M*(a*_-o*T)-i*(e*_-r*T)+d*(e*o-r*a),x[11]=-(M*(a*m-o*c)-i*(e*m-r*c)+s*(e*o-r*a)),x[12]=-(i*(c*l-h*T)-s*(a*l-n*T)+d*(a*h-n*c)),x[13]=M*(c*l-h*T)-s*(e*l-t*T)+d*(e*h-t*c),x[14]=-(M*(a*l-n*T)-i*(e*l-t*T)+d*(e*n-t*a)),x[15]=M*(a*h-n*c)-i*(e*h-t*c)+s*(e*n-t*a),x}}}),yF=Ze({"node_modules/gl-mat4/determinant.js"(Z,q){q.exports=v;function v(x){var A=x[0],M=x[1],e=x[2],t=x[3],r=x[4],i=x[5],a=x[6],n=x[7],o=x[8],s=x[9],c=x[10],h=x[11],m=x[12],d=x[13],T=x[14],l=x[15],_=A*i-M*r,w=A*a-e*r,S=A*n-t*r,E=M*a-e*i,g=M*n-t*i,b=e*n-t*a,p=o*d-s*m,u=o*T-c*m,y=o*l-h*m,f=s*T-c*d,P=s*l-h*d,L=c*l-h*T;return _*L-w*P+S*f+E*y-g*u+b*p}}}),_F=Ze({"node_modules/gl-mat4/multiply.js"(Z,q){q.exports=v;function v(x,A,M){var e=A[0],t=A[1],r=A[2],i=A[3],a=A[4],n=A[5],o=A[6],s=A[7],c=A[8],h=A[9],m=A[10],d=A[11],T=A[12],l=A[13],_=A[14],w=A[15],S=M[0],E=M[1],g=M[2],b=M[3];return x[0]=S*e+E*a+g*c+b*T,x[1]=S*t+E*n+g*h+b*l,x[2]=S*r+E*o+g*m+b*_,x[3]=S*i+E*s+g*d+b*w,S=M[4],E=M[5],g=M[6],b=M[7],x[4]=S*e+E*a+g*c+b*T,x[5]=S*t+E*n+g*h+b*l,x[6]=S*r+E*o+g*m+b*_,x[7]=S*i+E*s+g*d+b*w,S=M[8],E=M[9],g=M[10],b=M[11],x[8]=S*e+E*a+g*c+b*T,x[9]=S*t+E*n+g*h+b*l,x[10]=S*r+E*o+g*m+b*_,x[11]=S*i+E*s+g*d+b*w,S=M[12],E=M[13],g=M[14],b=M[15],x[12]=S*e+E*a+g*c+b*T,x[13]=S*t+E*n+g*h+b*l,x[14]=S*r+E*o+g*m+b*_,x[15]=S*i+E*s+g*d+b*w,x}}}),xF=Ze({"node_modules/gl-mat4/translate.js"(Z,q){q.exports=v;function v(x,A,M){var e=M[0],t=M[1],r=M[2],i,a,n,o,s,c,h,m,d,T,l,_;return A===x?(x[12]=A[0]*e+A[4]*t+A[8]*r+A[12],x[13]=A[1]*e+A[5]*t+A[9]*r+A[13],x[14]=A[2]*e+A[6]*t+A[10]*r+A[14],x[15]=A[3]*e+A[7]*t+A[11]*r+A[15]):(i=A[0],a=A[1],n=A[2],o=A[3],s=A[4],c=A[5],h=A[6],m=A[7],d=A[8],T=A[9],l=A[10],_=A[11],x[0]=i,x[1]=a,x[2]=n,x[3]=o,x[4]=s,x[5]=c,x[6]=h,x[7]=m,x[8]=d,x[9]=T,x[10]=l,x[11]=_,x[12]=i*e+s*t+d*r+A[12],x[13]=a*e+c*t+T*r+A[13],x[14]=n*e+h*t+l*r+A[14],x[15]=o*e+m*t+_*r+A[15]),x}}}),bF=Ze({"node_modules/gl-mat4/scale.js"(Z,q){q.exports=v;function v(x,A,M){var e=M[0],t=M[1],r=M[2];return x[0]=A[0]*e,x[1]=A[1]*e,x[2]=A[2]*e,x[3]=A[3]*e,x[4]=A[4]*t,x[5]=A[5]*t,x[6]=A[6]*t,x[7]=A[7]*t,x[8]=A[8]*r,x[9]=A[9]*r,x[10]=A[10]*r,x[11]=A[11]*r,x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15],x}}}),wF=Ze({"node_modules/gl-mat4/rotate.js"(Z,q){q.exports=v;function v(x,A,M,e){var t=e[0],r=e[1],i=e[2],a=Math.sqrt(t*t+r*r+i*i),n,o,s,c,h,m,d,T,l,_,w,S,E,g,b,p,u,y,f,P,L,z,F,B;return Math.abs(a)<1e-6?null:(a=1/a,t*=a,r*=a,i*=a,n=Math.sin(M),o=Math.cos(M),s=1-o,c=A[0],h=A[1],m=A[2],d=A[3],T=A[4],l=A[5],_=A[6],w=A[7],S=A[8],E=A[9],g=A[10],b=A[11],p=t*t*s+o,u=r*t*s+i*n,y=i*t*s-r*n,f=t*r*s-i*n,P=r*r*s+o,L=i*r*s+t*n,z=t*i*s+r*n,F=r*i*s-t*n,B=i*i*s+o,x[0]=c*p+T*u+S*y,x[1]=h*p+l*u+E*y,x[2]=m*p+_*u+g*y,x[3]=d*p+w*u+b*y,x[4]=c*f+T*P+S*L,x[5]=h*f+l*P+E*L,x[6]=m*f+_*P+g*L,x[7]=d*f+w*P+b*L,x[8]=c*z+T*F+S*B,x[9]=h*z+l*F+E*B,x[10]=m*z+_*F+g*B,x[11]=d*z+w*F+b*B,A!==x&&(x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15]),x)}}}),TF=Ze({"node_modules/gl-mat4/rotateX.js"(Z,q){q.exports=v;function v(x,A,M){var e=Math.sin(M),t=Math.cos(M),r=A[4],i=A[5],a=A[6],n=A[7],o=A[8],s=A[9],c=A[10],h=A[11];return A!==x&&(x[0]=A[0],x[1]=A[1],x[2]=A[2],x[3]=A[3],x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15]),x[4]=r*t+o*e,x[5]=i*t+s*e,x[6]=a*t+c*e,x[7]=n*t+h*e,x[8]=o*t-r*e,x[9]=s*t-i*e,x[10]=c*t-a*e,x[11]=h*t-n*e,x}}}),AF=Ze({"node_modules/gl-mat4/rotateY.js"(Z,q){q.exports=v;function v(x,A,M){var e=Math.sin(M),t=Math.cos(M),r=A[0],i=A[1],a=A[2],n=A[3],o=A[8],s=A[9],c=A[10],h=A[11];return A!==x&&(x[4]=A[4],x[5]=A[5],x[6]=A[6],x[7]=A[7],x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15]),x[0]=r*t-o*e,x[1]=i*t-s*e,x[2]=a*t-c*e,x[3]=n*t-h*e,x[8]=r*e+o*t,x[9]=i*e+s*t,x[10]=a*e+c*t,x[11]=n*e+h*t,x}}}),SF=Ze({"node_modules/gl-mat4/rotateZ.js"(Z,q){q.exports=v;function v(x,A,M){var e=Math.sin(M),t=Math.cos(M),r=A[0],i=A[1],a=A[2],n=A[3],o=A[4],s=A[5],c=A[6],h=A[7];return A!==x&&(x[8]=A[8],x[9]=A[9],x[10]=A[10],x[11]=A[11],x[12]=A[12],x[13]=A[13],x[14]=A[14],x[15]=A[15]),x[0]=r*t+o*e,x[1]=i*t+s*e,x[2]=a*t+c*e,x[3]=n*t+h*e,x[4]=o*t-r*e,x[5]=s*t-i*e,x[6]=c*t-a*e,x[7]=h*t-n*e,x}}}),MF=Ze({"node_modules/gl-mat4/fromRotation.js"(Z,q){q.exports=v;function v(x,A,M){var e,t,r,i=M[0],a=M[1],n=M[2],o=Math.sqrt(i*i+a*a+n*n);return Math.abs(o)<1e-6?null:(o=1/o,i*=o,a*=o,n*=o,e=Math.sin(A),t=Math.cos(A),r=1-t,x[0]=i*i*r+t,x[1]=a*i*r+n*e,x[2]=n*i*r-a*e,x[3]=0,x[4]=i*a*r-n*e,x[5]=a*a*r+t,x[6]=n*a*r+i*e,x[7]=0,x[8]=i*n*r+a*e,x[9]=a*n*r-i*e,x[10]=n*n*r+t,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x)}}}),EF=Ze({"node_modules/gl-mat4/fromRotationTranslation.js"(Z,q){q.exports=v;function v(x,A,M){var e=A[0],t=A[1],r=A[2],i=A[3],a=e+e,n=t+t,o=r+r,s=e*a,c=e*n,h=e*o,m=t*n,d=t*o,T=r*o,l=i*a,_=i*n,w=i*o;return x[0]=1-(m+T),x[1]=c+w,x[2]=h-_,x[3]=0,x[4]=c-w,x[5]=1-(s+T),x[6]=d+l,x[7]=0,x[8]=h+_,x[9]=d-l,x[10]=1-(s+m),x[11]=0,x[12]=M[0],x[13]=M[1],x[14]=M[2],x[15]=1,x}}}),CF=Ze({"node_modules/gl-mat4/fromScaling.js"(Z,q){q.exports=v;function v(x,A){return x[0]=A[0],x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=A[1],x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=A[2],x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),kF=Ze({"node_modules/gl-mat4/fromTranslation.js"(Z,q){q.exports=v;function v(x,A){return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=A[0],x[13]=A[1],x[14]=A[2],x[15]=1,x}}}),LF=Ze({"node_modules/gl-mat4/fromXRotation.js"(Z,q){q.exports=v;function v(x,A){var M=Math.sin(A),e=Math.cos(A);return x[0]=1,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=e,x[6]=M,x[7]=0,x[8]=0,x[9]=-M,x[10]=e,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),PF=Ze({"node_modules/gl-mat4/fromYRotation.js"(Z,q){q.exports=v;function v(x,A){var M=Math.sin(A),e=Math.cos(A);return x[0]=e,x[1]=0,x[2]=-M,x[3]=0,x[4]=0,x[5]=1,x[6]=0,x[7]=0,x[8]=M,x[9]=0,x[10]=e,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),IF=Ze({"node_modules/gl-mat4/fromZRotation.js"(Z,q){q.exports=v;function v(x,A){var M=Math.sin(A),e=Math.cos(A);return x[0]=e,x[1]=M,x[2]=0,x[3]=0,x[4]=-M,x[5]=e,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=1,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),QA=Ze({"node_modules/gl-mat4/fromQuat.js"(Z,q){q.exports=v;function v(x,A){var M=A[0],e=A[1],t=A[2],r=A[3],i=M+M,a=e+e,n=t+t,o=M*i,s=e*i,c=e*a,h=t*i,m=t*a,d=t*n,T=r*i,l=r*a,_=r*n;return x[0]=1-c-d,x[1]=s+_,x[2]=h-l,x[3]=0,x[4]=s-_,x[5]=1-o-d,x[6]=m+T,x[7]=0,x[8]=h+l,x[9]=m-T,x[10]=1-o-c,x[11]=0,x[12]=0,x[13]=0,x[14]=0,x[15]=1,x}}}),RF=Ze({"node_modules/gl-mat4/frustum.js"(Z,q){q.exports=v;function v(x,A,M,e,t,r,i){var a=1/(M-A),n=1/(t-e),o=1/(r-i);return x[0]=r*2*a,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=r*2*n,x[6]=0,x[7]=0,x[8]=(M+A)*a,x[9]=(t+e)*n,x[10]=(i+r)*o,x[11]=-1,x[12]=0,x[13]=0,x[14]=i*r*2*o,x[15]=0,x}}}),DF=Ze({"node_modules/gl-mat4/perspective.js"(Z,q){q.exports=v;function v(x,A,M,e,t){var r=1/Math.tan(A/2),i=1/(e-t);return x[0]=r/M,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=r,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=(t+e)*i,x[11]=-1,x[12]=0,x[13]=0,x[14]=2*t*e*i,x[15]=0,x}}}),zF=Ze({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(Z,q){q.exports=v;function v(x,A,M,e){var t=Math.tan(A.upDegrees*Math.PI/180),r=Math.tan(A.downDegrees*Math.PI/180),i=Math.tan(A.leftDegrees*Math.PI/180),a=Math.tan(A.rightDegrees*Math.PI/180),n=2/(i+a),o=2/(t+r);return x[0]=n,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=o,x[6]=0,x[7]=0,x[8]=-((i-a)*n*.5),x[9]=(t-r)*o*.5,x[10]=e/(M-e),x[11]=-1,x[12]=0,x[13]=0,x[14]=e*M/(M-e),x[15]=0,x}}}),FF=Ze({"node_modules/gl-mat4/ortho.js"(Z,q){q.exports=v;function v(x,A,M,e,t,r,i){var a=1/(A-M),n=1/(e-t),o=1/(r-i);return x[0]=-2*a,x[1]=0,x[2]=0,x[3]=0,x[4]=0,x[5]=-2*n,x[6]=0,x[7]=0,x[8]=0,x[9]=0,x[10]=2*o,x[11]=0,x[12]=(A+M)*a,x[13]=(t+e)*n,x[14]=(i+r)*o,x[15]=1,x}}}),OF=Ze({"node_modules/gl-mat4/lookAt.js"(Z,q){var v=$A();q.exports=x;function x(A,M,e,t){var r,i,a,n,o,s,c,h,m,d,T=M[0],l=M[1],_=M[2],w=t[0],S=t[1],E=t[2],g=e[0],b=e[1],p=e[2];return Math.abs(T-g)<1e-6&&Math.abs(l-b)<1e-6&&Math.abs(_-p)<1e-6?v(A):(c=T-g,h=l-b,m=_-p,d=1/Math.sqrt(c*c+h*h+m*m),c*=d,h*=d,m*=d,r=S*m-E*h,i=E*c-w*m,a=w*h-S*c,d=Math.sqrt(r*r+i*i+a*a),d?(d=1/d,r*=d,i*=d,a*=d):(r=0,i=0,a=0),n=h*a-m*i,o=m*r-c*a,s=c*i-h*r,d=Math.sqrt(n*n+o*o+s*s),d?(d=1/d,n*=d,o*=d,s*=d):(n=0,o=0,s=0),A[0]=r,A[1]=n,A[2]=c,A[3]=0,A[4]=i,A[5]=o,A[6]=h,A[7]=0,A[8]=a,A[9]=s,A[10]=m,A[11]=0,A[12]=-(r*T+i*l+a*_),A[13]=-(n*T+o*l+s*_),A[14]=-(c*T+h*l+m*_),A[15]=1,A)}}}),BF=Ze({"node_modules/gl-mat4/str.js"(Z,q){q.exports=v;function v(x){return"mat4("+x[0]+", "+x[1]+", "+x[2]+", "+x[3]+", "+x[4]+", "+x[5]+", "+x[6]+", "+x[7]+", "+x[8]+", "+x[9]+", "+x[10]+", "+x[11]+", "+x[12]+", "+x[13]+", "+x[14]+", "+x[15]+")"}}}),eS=Ze({"node_modules/gl-mat4/index.js"(Z,q){q.exports={create:hF(),clone:pF(),copy:dF(),identity:$A(),transpose:vF(),invert:mF(),adjoint:gF(),determinant:yF(),multiply:_F(),translate:xF(),scale:bF(),rotate:wF(),rotateX:TF(),rotateY:AF(),rotateZ:SF(),fromRotation:MF(),fromRotationTranslation:EF(),fromScaling:CF(),fromTranslation:kF(),fromXRotation:LF(),fromYRotation:PF(),fromZRotation:IF(),fromQuat:QA(),frustum:RF(),perspective:DF(),perspectiveFromFieldOfView:zF(),ortho:FF(),lookAt:OF(),str:BF()}}}),p2=Ze({"src/lib/matrix.js"(Z){"use strict";var q=eS();Z.init2dArray=function(v,x){for(var A=new Array(v),M=0;M<v;M++)A[M]=new Array(x);return A},Z.transposeRagged=function(v){var x=0,A=v.length,M,e;for(M=0;M<A;M++)x=Math.max(x,v[M].length);var t=new Array(x);for(M=0;M<x;M++)for(t[M]=new Array(A),e=0;e<A;e++)t[M][e]=v[e][M];return t},Z.dot=function(v,x){if(!(v.length&&x.length)||v.length!==x.length)return null;var A=v.length,M,e;if(v[0].length)for(M=new Array(A),e=0;e<A;e++)M[e]=Z.dot(v[e],x);else if(x[0].length){var t=Z.transposeRagged(x);for(M=new Array(t.length),e=0;e<t.length;e++)M[e]=Z.dot(v,t[e])}else for(M=0,e=0;e<A;e++)M+=v[e]*x[e];return M},Z.translationMatrix=function(v,x){return[[1,0,v],[0,1,x],[0,0,1]]},Z.rotationMatrix=function(v){var x=v*Math.PI/180;return[[Math.cos(x),-Math.sin(x),0],[Math.sin(x),Math.cos(x),0],[0,0,1]]},Z.rotationXYMatrix=function(v,x,A){return Z.dot(Z.dot(Z.translationMatrix(x,A),Z.rotationMatrix(v)),Z.translationMatrix(-x,-A))},Z.apply3DTransform=function(v){return function(){var x=arguments,A=arguments.length===1?x[0]:[x[0],x[1],x[2]||0];return Z.dot(v,[A[0],A[1],A[2],1]).slice(0,3)}},Z.apply2DTransform=function(v){return function(){var x=arguments;x.length===3&&(x=x[0]);var A=arguments.length===1?x[0]:[x[0],x[1]];return Z.dot(v,[A[0],A[1],1]).slice(0,2)}},Z.apply2DTransform2=function(v){var x=Z.apply2DTransform(v);return function(A){return x(A.slice(0,2)).concat(x(A.slice(2,4)))}},Z.convertCssMatrix=function(v){if(v){var x=v.length;if(x===16)return v;if(x===6)return[v[0],v[1],0,0,v[2],v[3],0,0,0,0,1,0,v[4],v[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Z.inverseTransformMatrix=function(v){var x=[];return q.invert(x,v),[[x[0],x[1],x[2],x[3]],[x[4],x[5],x[6],x[7]],[x[8],x[9],x[10],x[11]],[x[12],x[13],x[14],x[15]]]}}}),T_=Ze({"src/lib/dom.js"(Z,q){"use strict";var v=Oi(),x=Ym(),A=p2(),M=eS();function e(T){var l;if(typeof T=="string"){if(l=document.getElementById(T),l===null)throw new Error("No DOM element with id '"+T+"' exists on the page.");return l}else if(T==null)throw new Error("DOM element provided is null or undefined");return T}function t(T){var l=v.select(T);return l.node()instanceof HTMLElement&&l.size()&&l.classed("js-plotly-plot")}function r(T){var l=T&&T.parentNode;l&&l.removeChild(T)}function i(T,l){a("global",T,l)}function a(T,l,_){var w="plotly.js-style-"+T,S=document.getElementById(w);if(!(S&&S.matches(".no-inline-styles"))){S||(S=document.createElement("style"),S.setAttribute("id",w),S.appendChild(document.createTextNode("")),document.head.appendChild(S));var E=S.sheet;E?E.insertRule?E.insertRule(l+"{"+_+"}",0):E.addRule?E.addRule(l,_,0):x.warn("addStyleRule failed"):x.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function n(T){var l="plotly.js-style-"+T,_=document.getElementById(l);_&&r(_)}function o(T,l,_,w,S,E){var g=w.split(":"),b=S.split(":"),p="data-btn-style-event-added";E||(E=document),E.querySelectorAll(T).forEach(function(u){u.getAttribute(p)||(u.addEventListener("mouseenter",function(){var y=this.querySelector(_);y&&(y.style[g[0]]=g[1])}),u.addEventListener("mouseleave",function(){var y=this.querySelector(_);y&&(l&&this.matches(l)?y.style[g[0]]=g[1]:y.style[b[0]]=b[1])}),u.setAttribute(p,!0))})}function s(T){var l=h(T),_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return l.forEach(function(w){var S=c(w);if(S){var E=A.convertCssMatrix(S);_=M.multiply(_,_,E)}}),_}function c(T){var l=window.getComputedStyle(T,null),_=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("-moz-transform")||l.getPropertyValue("-ms-transform")||l.getPropertyValue("-o-transform")||l.getPropertyValue("transform");return _==="none"?null:_.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(w){return+w})}function h(T){for(var l=[];m(T);)l.push(T),T=T.parentNode,typeof ShadowRoot=="function"&&T instanceof ShadowRoot&&(T=T.host);return l}function m(T){return T&&(T instanceof Element||T instanceof HTMLElement)}function d(T,l){return T&&l&&T.top===l.top&&T.left===l.left&&T.right===l.right&&T.bottom===l.bottom}q.exports={getGraphDiv:e,isPlotDiv:t,removeElement:r,addStyleRule:i,addRelatedStyleRule:a,deleteRelatedStyleRule:n,setStyleOnHover:o,getFullTransformMatrix:s,getElementTransformMatrix:c,getElementAndAncestors:h,equalDomRects:d}}}),A_=Ze({"src/plots/animation_attributes.js"(Z,q){"use strict";q.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}}),pc=Ze({"src/plot_api/edit_types.js"(Z,q){"use strict";var v=rs().extendFlat,x=Xv(),A={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},M={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},e=A.flags.slice().concat(["fullReplot"]),t=M.flags.slice().concat("layoutReplot");q.exports={traces:A,layout:M,traceFlags:function(){return r(e)},layoutFlags:function(){return r(t)},update:function(n,o){var s=o.editType;if(s&&s!=="none")for(var c=s.split("+"),h=0;h<c.length;h++)n[c[h]]=!0},overrideAll:i};function r(n){for(var o={},s=0;s<n.length;s++)o[n[s]]=!1;return o}function i(n,o,s){var c=v({},n);for(var h in c){var m=c[h];x(m)&&(c[h]=a(m,o,s,h))}return s==="from-root"&&(c.editType=o),c}function a(n,o,s,c){if(n.valType){var h=v({},n);if(h.editType=o,Array.isArray(n.items)){h.items=new Array(n.items.length);for(var m=0;m<n.items.length;m++)h.items[m]=a(n.items[m],o,"from-root")}return h}else return i(n,o,c.charAt(0)==="_"?"nested":"from-root")}}}),Gh=Ze({"src/components/drawing/attributes.js"(Z){"use strict";Z.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},Z.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}}),tS=Ze({"src/constants/docs.js"(Z,q){"use strict";q.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}}),Cs=Ze({"src/plots/template_attributes.js"(Z){"use strict";var q=tS(),v=q.FORMAT_LINK,x=q.DATE_FORMAT_LINK;function A(e){var t=e&&e.supportOther;return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(t?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,v,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,x,"for details on the date formatting syntax."].join(" ")}Z.templateFormatStringDescription=A;function M(e){var t=e.description?" "+e.description:"",r=e.keys||[];if(r.length>0){for(var i=[],a=0;a<r.length;a++)i[a]="`"+r[a]+"`";t=t+"Finally, the template string has access to ",r.length===1?t=t+"variable "+i[0]:t=t+"variables "+i.slice(0,-1).join(", ")+" and "+i.slice(-1)+"."}return t}Z.hovertemplateAttrs=function(e,t){e=e||{},t=t||{};var r=M(t),i={valType:"string",dflt:"",editType:e.editType||"none"};return e.arrayOk!==!1&&(i.arrayOk=!0),i},Z.texttemplateAttrs=function(e,t){e=e||{},t=t||{};var r=M(t),i={valType:"string",dflt:"",editType:e.editType||"calc"};return e.arrayOk!==!1&&(i.arrayOk=!0),i},Z.shapeTexttemplateAttrs=function(e,t){e=e||{},t=t||{};var r=e.newshape?"new ":"",i=M(t),a={valType:"string",dflt:"",editType:e.editType||"arraydraw"};return a}}}),d2=Ze({"src/components/shapes/label_texttemplate.js"(Z,q){"use strict";function v(_,w){return w?w.d2l(_):_}function x(_,w){return w?w.l2d(_):_}function A(_){return _.x0}function M(_){return _.x1}function e(_){return _.y0}function t(_){return _.y1}function r(_){return _.x0shift||0}function i(_){return _.x1shift||0}function a(_){return _.y0shift||0}function n(_){return _.y1shift||0}function o(_,w){return v(_.x1,w)+i(_)-v(_.x0,w)-r(_)}function s(_,w,S){return v(_.y1,S)+n(_)-v(_.y0,S)-a(_)}function c(_,w){return Math.abs(o(_,w))}function h(_,w,S){return Math.abs(s(_,w,S))}function m(_,w,S){return _.type!=="line"?void 0:Math.sqrt(Math.pow(o(_,w),2)+Math.pow(s(_,w,S),2))}function d(_,w){return x((v(_.x1,w)+i(_)+v(_.x0,w)+r(_))/2,w)}function T(_,w,S){return x((v(_.y1,S)+n(_)+v(_.y0,S)+a(_))/2,S)}function l(_,w,S){return _.type!=="line"?void 0:s(_,w,S)/o(_,w)}q.exports={x0:A,x1:M,y0:e,y1:t,slope:l,dx:o,dy:s,width:c,height:h,length:m,xcenter:d,ycenter:T}}}),NF=Ze({"src/components/shapes/draw_newshape/attributes.js"(Z,q){"use strict";var v=pc().overrideAll,x=eu(),A=tc(),M=Gh().dash,e=rs().extendFlat,t=Cs().shapeTexttemplateAttrs,r=d2();q.exports=v({newshape:{visible:e({},x.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},x.legend,{}),legendgroup:e({},x.legendgroup,{}),legendgrouptitle:{text:e({},x.legendgrouptitle.text,{}),font:A({})},legendrank:e({},x.legendrank,{}),legendwidth:e({},x.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},M,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},x.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(r)}),font:A({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)"},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),UF=Ze({"src/components/selections/draw_newselection/attributes.js"(Z,q){"use strict";var v=Gh().dash,x=rs().extendFlat;q.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:x({},v,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),v2=Ze({"src/plots/pad_attributes.js"(Z,q){"use strict";q.exports=function(v){var x=v.editType;return{t:{valType:"number",dflt:0,editType:x},r:{valType:"number",dflt:0,editType:x},b:{valType:"number",dflt:0,editType:x},l:{valType:"number",dflt:0,editType:x},editType:x}}}}),$y=Ze({"src/plots/layout_attributes.js"(Z,q){"use strict";var v=tc(),x=A_(),A=oh(),M=NF(),e=UF(),t=v2(),r=rs().extendFlat,i=v({editType:"calc"});i.family.dflt='"Open Sans", verdana, arial, sans-serif',i.size.dflt=12,i.color.dflt=A.defaultLine,q.exports={font:i,title:{text:{valType:"string",editType:"layoutstyle"},font:v({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:v({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(t({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:A.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:A.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:A.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:M.newshape,activeshape:M.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},x.transition,{editType:"none"})}}}),jF=mo({"temp_stylePlugin:node_modules/maplibre-gl/dist/maplibre-gl.css"(){}}),yhe={},VF=mo({"stylePlugin:/home/cam/Development/plotly/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"(){jF()}}),oo=Ze({"src/registry.js"(Z){"use strict";var q=Ym(),v=h2(),x=JA(),A=Xv(),M=T_().addStyleRule,e=rs(),t=eu(),r=$y(),i=e.extendFlat,a=e.extendDeepAll;Z.modules={},Z.allCategories={},Z.allTypes=[],Z.subplotsRegistry={},Z.componentsRegistry={},Z.layoutArrayContainers=[],Z.layoutArrayRegexes=[],Z.traceLayoutAttributes={},Z.localeRegistry={},Z.apiMethodRegistry={},Z.collectableSubplotTypes=null,Z.register=function(w){if(Z.collectableSubplotTypes=null,w)w&&!Array.isArray(w)&&(w=[w]);else throw new Error("No argument passed to Plotly.register.");for(var S=0;S<w.length;S++){var E=w[S];if(!E)throw new Error("Invalid module was attempted to be registered!");switch(E.moduleType){case"trace":n(E);break;case"transform":c(E);break;case"component":s(E);break;case"locale":h(E);break;case"apiMethod":var g=E.name;Z.apiMethodRegistry[g]=E.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},Z.getModule=function(_){var w=Z.modules[l(_)];return w?w._module:!1},Z.traceIs=function(_,w){if(_=l(_),_==="various")return!1;var S=Z.modules[_];return S||(_&&q.log("Unrecognized trace type "+_+"."),S=Z.modules[t.type.dflt]),!!S.categories[w]},Z.getComponentMethod=function(_,w){var S=Z.componentsRegistry[_];return S&&S[w]||v},Z.call=function(){var _=arguments[0],w=[].slice.call(arguments,1);return Z.apiMethodRegistry[_].apply(null,w)};function n(_){var w=_.name,S=_.categories,E=_.meta;if(Z.modules[w]){q.log("Type "+w+" already registered");return}Z.subplotsRegistry[_.basePlotModule.name]||o(_.basePlotModule);for(var g={},b=0;b<S.length;b++)g[S[b]]=!0,Z.allCategories[S[b]]=!0;Z.modules[w]={_module:_,categories:g},E&&Object.keys(E).length&&(Z.modules[w].meta=E),Z.allTypes.push(w);for(var p in Z.componentsRegistry)d(p,w);_.layoutAttributes&&i(Z.traceLayoutAttributes,_.layoutAttributes);var u=_.basePlotModule,y=u.name;if(y==="mapbox"){var f=u.constants.styleRules;for(var P in f)M(".js-plotly-plot .plotly .mapboxgl-"+P,f[P])}y==="map"&&VF(),(y==="geo"||y==="mapbox"||y==="map")&&window.PlotlyGeoAssets===void 0&&(window.PlotlyGeoAssets={topojson:{}})}function o(_){var w=_.name;if(Z.subplotsRegistry[w]){q.log("Plot type "+w+" already registered.");return}m(_),Z.subplotsRegistry[w]=_;for(var S in Z.componentsRegistry)T(S,_.name)}function s(_){if(typeof _.name!="string")throw new Error("Component module *name* must be a string.");var w=_.name;Z.componentsRegistry[w]=_,_.layoutAttributes&&(_.layoutAttributes._isLinkedToArray&&x(Z.layoutArrayContainers,w),m(_));for(var S in Z.modules)d(w,S);for(var E in Z.subplotsRegistry)T(w,E);_.schema&&_.schema.layout&&a(r,_.schema.layout)}function c(_){if(typeof _.name!="string")throw new Error("Transform module *name* must be a string.");var w="Transform module "+_.name,S=typeof _.transform=="function",E=typeof _.calcTransform=="function";if(!S&&!E)throw new Error(w+" is missing a *transform* or *calcTransform* method.");S&&E&&q.log([w+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),A(_.attributes)||q.log(w+" registered without an *attributes* object."),typeof _.supplyDefaults!="function"&&q.log(w+" registered without a *supplyDefaults* method.")}function h(_){var w=_.name,S=w.split("-")[0],E=_.dictionary,g=_.format,b=E&&Object.keys(E).length,p=g&&Object.keys(g).length,u=Z.localeRegistry,y=u[w];if(y||(u[w]=y={}),S!==w){var f=u[S];f||(u[S]=f={}),b&&f.dictionary===y.dictionary&&(f.dictionary=E),p&&f.format===y.format&&(f.format=g)}b&&(y.dictionary=E),p&&(y.format=g)}function m(_){if(_.layoutAttributes){var w=_.layoutAttributes._arrayAttrRegexps;if(w)for(var S=0;S<w.length;S++)x(Z.layoutArrayRegexes,w[S])}}function d(_,w){var S=Z.componentsRegistry[_].schema;if(!(!S||!S.traces)){var E=S.traces[w];E&&a(Z.modules[w]._module.attributes,E)}}function T(_,w){var S=Z.componentsRegistry[_].schema;if(!(!S||!S.subplots)){var E=Z.subplotsRegistry[w],g=E.layoutAttributes,b=E.attr==="subplot"?E.name:E.attr;Array.isArray(b)&&(b=b[0]);var p=S.subplots[b];g&&p&&a(g,p)}}function l(_){return typeof _=="object"&&(_=_.type),_}}}),qF=Ze({"src/lib/dates.js"(Z){"use strict";var q=Np().timeFormat,v=is(),x=Ym(),A=Yy().mod,M=Vs(),e=M.BADNUM,t=M.ONEDAY,r=M.ONEHOUR,i=M.ONEMIN,a=M.ONESEC,n=M.EPOCHJD,o=oo(),s=Np().utcFormat,c=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,h=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,m=new Date().getFullYear()-70;function d(F){return F&&o.componentsRegistry.calendars&&typeof F=="string"&&F!=="gregorian"}Z.dateTick0=function(F,B){var O=T(F,!!B);if(B<2)return O;var I=Z.dateTime2ms(O,F);return I+=t*(B-1),Z.ms2DateTime(I,0,F)};function T(F,B){return d(F)?B?o.getComponentMethod("calendars","CANONICAL_SUNDAY")[F]:o.getComponentMethod("calendars","CANONICAL_TICK")[F]:B?"2000-01-02":"2000-01-01"}Z.dfltRange=function(F){return d(F)?o.getComponentMethod("calendars","DFLTRANGE")[F]:["2000-01-01","2001-01-01"]},Z.isJSDate=function(F){return typeof F=="object"&&F!==null&&typeof F.getTime=="function"};var l,_;Z.dateTime2ms=function(F,B){if(Z.isJSDate(F)){var O=F.getTimezoneOffset()*i,I=(F.getUTCMinutes()-F.getMinutes())*i+(F.getUTCSeconds()-F.getSeconds())*a+(F.getUTCMilliseconds()-F.getMilliseconds());if(I){var N=3*i;O=O-N/2+A(I-O+N/2,N)}return F=Number(F)-O,F>=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<S?Math.floor($/r):0,Q=B<S?Math.floor($%r/i):0,ue=B<E?Math.floor($%i/a):0,se=B<g?$%a*10+I:0}else he=new Date(N),U=s("%Y-%m-%d")(he),W=B<S?he.getUTCHours():0,Q=B<S?he.getUTCMinutes():0,ue=B<E?he.getUTCSeconds():0,se=B<g?he.getUTCMilliseconds()*10+I:0;return b(U,W,Q,ue,se)},Z.ms2DateTimeLocal=function(F){if(!(F>=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;se<F.length;se++){if(Q=F[se],!v(Q)){U++;continue}if(!(Q%t))if(ue)try{W=ue.fromJD(Q/t+n),W.day()===1?W.month()===1?O++:I++:N++}catch{}else W=new Date(Q),W.getUTCDate()===1?W.getUTCMonth()===0?O++:I++:N++}I+=O,N+=I;var he=F.length-U;return{exactYears:O/he,exactMonths:I/he,exactDays:N/he}}}}),S_=Ze({"src/lib/identity.js"(Z,q){"use strict";q.exports=function(x){return x}}}),m2=Ze({"src/lib/search.js"(Z){"use strict";var q=is(),v=Ym(),x=S_(),A=Vs().BADNUM,M=1e-9;Z.findBin=function(a,n,o){if(q(n.start))return o?Math.ceil((a-n.start)/n.size-M)-1:Math.floor((a-n.start)/n.size+M);var s=0,c=n.length,h=0,m=c>1?(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);s<c&&h++<100;)d=Math.floor((s+c)/2),T(n[d],a)?s=d+1:c=d;return h>90&&v.log("Long binary search..."),s-1};function e(a,n){return a<n}function t(a,n){return a<=n}function r(a,n){return a>n}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;s<c&&m++<100;)h=l((s+c)/2),n[h]<=a?s=h+d:c=h-T;return n[s]},Z.sort=function(a,n){for(var o=0,s=0,c=1;c<a.length;c++){var h=n(a[c],a[c-1]);if(h<0?o=1:h>0&&(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;c<a.length;c++){var h=n(a[c]);h<o&&(o=h,s=c)}return s}}}),Km=Ze({"src/lib/sort_object_keys.js"(Z,q){"use strict";q.exports=function(x){return Object.keys(x).sort()}}}),GF=Ze({"src/lib/stats.js"(Z){"use strict";var q=is(),v=xp().isArrayOrTypedArray;Z.aggNums=function(x,A,M,e){var t,r;if((!e||e>M.length)&&(e=M.length),q(A)||(A=!1),v(M[0])){for(r=new Array(e),t=0;t<e;t++)r[t]=Z.aggNums(x,A,M[t]);M=r}for(t=0;t<e;t++)q(A)?q(M[t])&&(A=x(+A,+M[t])):A=M[t];return A},Z.len=function(x){return Z.aggNums(function(A){return A+1},0,x)},Z.mean=function(x,A){return A||(A=Z.len(x)),Z.aggNums(function(M,e){return M+e},0,x)/A},Z.geometricMean=function(x,A){return A||(A=Z.len(x)),Math.pow(Z.aggNums(function(M,e){return M*e},1,x),1/A)},Z.midRange=function(x){if(!(x===void 0||x.length===0))return(Z.aggNums(Math.max,null,x)+Z.aggNums(Math.min,null,x))/2},Z.variance=function(x,A,M){return A||(A=Z.len(x)),q(M)||(M=Z.mean(x,A)),Z.aggNums(function(e,t){return e+Math.pow(t-M,2)},0,x)/A},Z.stdev=function(x,A,M){return Math.sqrt(Z.variance(x,A,M))},Z.median=function(x){var A=x.slice().sort();return Z.interp(A,.5)},Z.interp=function(x,A){if(!q(A))throw"n should be a finite number";if(A=A*x.length-.5,A<0)return x[0];if(A>x.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]<l[1]?(_=l[0],w=l[1]):(_=l[1],w=l[0]),_=x(_,e),w=x(w,e),_>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):_<w?(p=_,y=w):(p=w,y=_),T<l?(f=T,P=l):(f=l,P=T);function L(O,I){return[O*Math.cos(I)+S,E-O*Math.sin(I)]}var z=Math.abs(y-p)<=M?0:1;function F(O,I,N){return"A"+[O,O]+" "+[0,z,N]+" "+L(O,I)}var B;return b?f===null?B="M"+L(P,p)+F(P,u,0)+F(P,y,0)+"Z":B="M"+L(f,p)+F(f,u,0)+F(f,y,0)+"ZM"+L(P,p)+F(P,u,1)+F(P,y,1)+"Z":f===null?(B="M"+L(P,p)+F(P,y,0),g&&(B+="L0,0Z")):B="M"+L(f,p)+"L"+L(P,p)+F(P,y,0)+"L"+L(f,y)+F(f,p,1)+"Z",B}function h(T,l,_,w,S){return c(null,T,l,_,w,S,0)}function m(T,l,_,w,S){return c(null,T,l,_,w,S,1)}function d(T,l,_,w,S,E){return c(T,l,_,w,S,E,1)}q.exports={deg2rad:t,rad2deg:r,angleDelta:a,angleDist:n,isFullCircle:i,isAngleInsideSector:o,isPtInsideSector:s,pathArc:h,pathSector:m,pathAnnulus:d}}}),WF=Ze({"src/lib/anchor_utils.js"(Z){"use strict";Z.isLeftAnchor=function(v){return v.xanchor==="left"||v.xanchor==="auto"&&v.x<=1/3},Z.isCenterAnchor=function(v){return v.xanchor==="center"||v.xanchor==="auto"&&v.x>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.x<n?n-E.x:E.x>o?E.x-o:0,b=E.y<s?s-E.y:E.y>c?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;m<c;){if(l=(d+T)/2,_=r.getPointAtLength(l),w=_[a]-i,Math.abs(w)<s)return _;h*w>0?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].ts<r-6e4&&delete q[i];t=q[A]={ts:0,timer:null}}v(t);function a(){e(),t.ts=Date.now(),t.onDone&&(t.onDone(),t.onDone=null)}if(r>t.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<i.length;a++){var n=i[a];if(n.indexOf("Safari")!==-1)for(var o=a-1;o>-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;t<x.length;t++){var r=x[t];A[r]!==1&&(A[r]=1,M[e++]=r)}return M}}}),QF=Ze({"src/lib/filter_visible.js"(Z,q){"use strict";q.exports=function(e){for(var t=A(e)?x:v,r=[],i=0;i<e.length;i++){var a=e[i];t(a)&&r.push(a)}return r};function v(M){return M.visible===!0}function x(M){var e=M[0].trace;return e.visible===!0&&e._length!==0}function A(M){return Array.isArray(M)&&Array.isArray(M[0])&&M[0][0]&&M[0][0].trace}}}),eO=Ze({"src/lib/increment.js"(Z,q){"use strict";q.exports=function(x,A){if(!A)return x;var M=1/Math.abs(A),e=M>1?(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<r?i:j):i},a.isIndex=function(ne,j){return j!==void 0&&ne>=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;re<j;re++)ee[re]=ne;return ee},a.swapAttrs=function(ne,j,ee,re){ee||(ee="x"),re||(re="y");for(var ce=0;ce<j.length;ce++){var be=j[ce],Ae=a.nestedProperty(ne,be.replace("?",ee)),ze=a.nestedProperty(ne,be.replace("?",re)),Re=Ae.get();Ae.set(ze.get()),ze.set(Re)}},a.raiseToTop=function(j){j.parentNode.appendChild(j)},a.cancelTransition=function(ne){return ne.transition().duration(0)},a.constrain=function(ne,j,ee){return j>ee?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<be;ze++)Ae[ze]=j(ne[ze],ee,re,ce);return Ae},a.randstr=function ne(j,ee,re,ce){if(re||(re=16),ee===void 0&&(ee=24),ee<=0)return"0";var be=Math.log(Math.pow(2,ee))/Math.log(re),Ae="",ze,Re,We;for(ze=2;be===1/0;ze*=2)be=Math.log(Math.pow(2,ee/ze))/Math.log(re)*ze;var it=be-Math.floor(be);for(ze=0;ze<Math.floor(be);ze++)We=Math.floor(Math.random()*re).toString(re),Ae=We+Ae;it&&(Re=Math.pow(re,it),We=Math.floor(Math.random()*Re).toString(re),Ae=We+Ae);var ot=parseInt(Ae,re);return j&&j[Ae]||ot!==1/0&&ot>=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<ce;ze++)be[ze]=(1-Math.cos(Math.PI*(ze+1)/j))/(2*j);for(ze=0;ze<ee;ze++){for(it=0,Re=0;Re<ce;Re++)We=ze+Re+1-j,We<-ee?We-=re*Math.round(We/re):We>=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;be<ee.length;be++)Ae=ne[ee[be]],Ae!=null?re=!0:ce=!1;if(re&&!ce)for(be=0;be<ee.length;be++)ne[ee[be]]=j[ee[be]]}},a.mergeArray=function(ne,j,ee,re){var ce=typeof re=="function";if(a.isArrayOrTypedArray(ne))for(var be=Math.min(ne.length,j.length),Ae=0;Ae<be;Ae++){var ze=ne[Ae];j[Ae][ee]=ce?re(ze):ze}},a.mergeArrayCastPositive=function(ne,j,ee){return a.mergeArray(ne,j,ee,function(re){var ce=+re;return isFinite(ce)&&ce>0?ce:0})},a.fillArray=function(ne,j,ee,re){if(re=re||a.identity,a.isArrayOrTypedArray(ne))for(var ce=0;ce<j.length;ce++)j[ce][ee]=re(ne[ce])},a.castOption=function(ne,j,ee,re){re=re||a.identity;var ce=a.nestedProperty(ne,ee).get();return a.isArrayOrTypedArray(ce)?Array.isArray(j)&&a.isArrayOrTypedArray(ce[j[0]])?re(ce[j[0]][j[1]]):re(ce[j]):ce},a.extractOption=function(ne,j,ee,re){if(ee in ne)return ne[ee];var ce=a.nestedProperty(j,re).get();if(!Array.isArray(ce))return ce};function u(ne){var j={};for(var ee in ne)for(var re=ne[ee],ce=0;ce<re.length;ce++)j[re[ce]]=+ee;return j}a.tagSelected=function(ne,j,ee){var re=j.selectedpoints,ce=j._indexToPoints,be;ce&&(be=u(ce));function Ae(ot){return ot!==void 0&&ot<ne.length}for(var ze=0;ze<re.length;ze++){var Re=re[ze];if(a.isIndex(Re)||a.isArrayOrTypedArray(Re)&&a.isIndex(Re[0])&&a.isIndex(Re[1])){var We=be?be[Re]:Re,it=ee?ee[We]:We;Ae(it)&&(ne[it].selected=1)}}},a.selIndices2selPoints=function(ne){var j=ne.selectedpoints,ee=ne._indexToPoints;if(ee){for(var re=u(ee),ce=[],be=0;be<j.length;be++){var Ae=j[be];if(a.isIndex(Ae)){var ze=re[Ae];a.isIndex(ze)&&ce.push(ze)}}return ce}else return j},a.getTargetArray=function(ne,j){var ee=j.target;if(typeof ee=="string"&&ee){var re=a.nestedProperty(ne,ee).get();return a.isArrayOrTypedArray(re)?re:!1}else if(a.isArrayOrTypedArray(ee))return ee;return!1};function y(ne,j,ee){var re={};typeof j!="object"&&(j={});var ce=ee==="pieLike"?-1:3,be=Object.keys(ne),Ae,ze,Re;for(Ae=0;Ae<be.length;Ae++)ze=be[Ae],Re=ne[ze],!(ze.charAt(0)==="_"||typeof Re=="function")&&(ze==="module"?re[ze]=Re:Array.isArray(Re)?ze==="colorscale"||ce===-1?re[ze]=Re.slice():re[ze]=Re.slice(0,ce):a.isTypedArray(Re)?ce===-1?re[ze]=Re.subarray():re[ze]=Re.subarray(0,ce):Re&&typeof Re=="object"?re[ze]=y(ne[ze],j[ze],ee):re[ze]=Re);for(be=Object.keys(j),Ae=0;Ae<be.length;Ae++)ze=be[Ae],Re=j[ze],(typeof Re!="object"||!(ze in re)||typeof re[ze]!="object")&&(re[ze]=Re);return re}a.minExtend=y,a.titleCase=function(ne){return ne.charAt(0).toUpperCase()+ne.substr(1)},a.containsAny=function(ne,j){for(var ee=0;ee<j.length;ee++)if(ne.indexOf(j[ee])!==-1)return!0;return!1};var f=/Version\/[\d\.]+.*Safari/;a.isSafari=function(){return f.test(window.navigator.userAgent)};var P=/iPad|iPhone|iPod/;a.isIOS=function(){return P.test(window.navigator.userAgent)};var L=/Macintosh.+AppleWebKit.+Gecko\)$/;a.isMacWKWebView=()=>L.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;be<ee.length;be++){var Ae=ee[be],ze=null,Re=ee[be].match(/(.*)\[([0-9]+)\]/);Re?(Ae=Re[1],ze=Re[2],re=re[Ae]=[],be===ee.length-1?re[ze]=j:re[ze]={},re=re[ze]):(be===ee.length-1?re[Ae]=j:re[Ae]={},re=re[Ae])}return ce};var F=/^([^\[\.]+)\.(.+)?/,B=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function O(ne){return ne.slice(0,2)==="__"}a.expandObjectPaths=function(ne){var j,ee,re,ce,be,Ae,ze;if(typeof ne=="object"&&!Array.isArray(ne)){for(ee in ne)if(ne.hasOwnProperty(ee))if(j=ee.match(F)){if(ce=ne[ee],re=j[1],O(re))continue;delete ne[ee],ne[re]=a.extendDeepNoArrays(ne[re]||{},a.objectFromPath(ee,a.expandObjectPaths(ce))[re])}else if(j=ee.match(B)){if(ce=ne[ee],re=j[1],O(re))continue;if(be=parseInt(j[2]),delete ne[ee],ne[re]=ne[re]||[],j[3]===".")ze=j[4],Ae=ne[re][be]=ne[re][be]||{},a.extendDeepNoArrays(Ae,a.objectFromPath(ze,a.expandObjectPaths(ce)));else{if(O(re))continue;ne[re][be]=a.expandObjectPaths(ce)}}else{if(O(ee))continue;ne[ee]=a.expandObjectPaths(ne[ee])}}return ne},a.numSeparate=function(ne,j,ee){if(ee||(ee=!1),typeof j!="string"||j.length===0)throw new Error("Separator string required for formatting!");typeof ne=="number"&&(ne=String(ne));var re=/(\d+)(\d{3})/,ce=j.charAt(0),be=j.charAt(1),Ae=ne.split("."),ze=Ae[0],Re=Ae.length>1?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<ce.length;st++)if(rt=ce[st],!!rt){if(rt.hasOwnProperty(ut)){Fe=rt[ut];break}if(I.test(ut)||(Fe=a.nestedProperty(rt,ut).get(!0)),Fe!==void 0)break}}if(Fe!==void 0&&(Me==="*"&&(Fe*=_e),Me==="/"&&(Fe/=_e)),Fe===void 0&&re)return re.count<re.max&&(a.warn("Variable '"+ut+"' in "+re.name+" could not be found!"),Fe=be),re.count===re.max&&a.warn("Too many "+re.name+" warnings - additional warnings will be suppressed"),re.count++,be;if(ze){var Qe;if(ze[0]===":"&&(Qe=ee?ee.numberFormat:a.numberFormat,Fe!==""&&(Fe=Qe(ze.replace(se,""))(Fe))),ze[0]==="|"){Qe=ee?ee.timeFormat:x;var Lt=a.dateTime2ms(Fe);Fe=a.formatDate(Lt,ze.replace(se,""),!1,Qe)}}else{var kt=ut+"Label";j.hasOwnProperty(kt)&&(Fe=j[kt])}return tt&&(Fe="("+Fe+")",(We||it)&&(Fe=" "+Fe),(ot||it)&&(Fe=Fe+" ")),Fe})}var H=48,$=57;a.subplotSort=function(ne,j){for(var ee=Math.min(ne.length,j.length)+1,re=0,ce=0,be=0;be<ee;be++){var Ae=ne.charCodeAt(be)||0,ze=j.charCodeAt(be)||0,Re=Ae>=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;re<j;re++)ee.indexOf(".")!==-1&&(ee=ee.replace("0%","%"),ee=ee.replace(".%","%"));return ee},a.isHidden=function(ne){var j=window.getComputedStyle(ne).display;return!j||j==="none"},a.strTranslate=function(ne,j){return ne||j?"translate("+ne+","+j+")":""},a.strRotate=function(ne){return ne?"rotate("+ne+")":""},a.strScale=function(ne){return ne!==1?"scale("+ne+")":""},a.getTextTransform=function(ne){var j=ne.noCenter,ee=ne.textX,re=ne.textY,ce=ne.targetX,be=ne.targetY,Ae=ne.anchorX||0,ze=ne.anchorY||0,Re=ne.rotate,We=ne.scale;return We?We>1&&(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;b<arguments.length;b++)g.push(arguments[b]);var p=E==="error",u=this._events;if(u!==void 0)p=p&&u.error===void 0;else if(!p)return!1;if(p){var y;if(g.length>0&&(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;b<L;++b)x(z[b],this,g);return!0};function n(S,E,g,b){var p,u,y;if(i(g),u=S._events,u===void 0?(u=S._events=Object.create(null),S._eventsCount=0):(u.newListener!==void 0&&(S.emit("newListener",E,g.listener?g.listener:g),u=S._events),y=u[E]),y===void 0)y=u[E]=g,++S._eventsCount;else if(typeof y=="function"?y=u[E]=b?[g,y]:[y,g]:b?y.unshift(g):y.push(g),p=a(S),p>0&&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<u.length;++p)y=u[p],y!=="removeListener"&&this.removeAllListeners(y);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(g=b[E],typeof g=="function")this.removeListener(E,g);else if(g!==void 0)for(p=g.length-1;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<E;++b)g[b]=S[b];return g}function d(S,E){for(;E+1<S.length;E++)S[E]=S[E+1];S.pop()}function T(S){for(var E=new Array(S.length),g=0;g<E.length;++g)E[g]=S[g].listener||S[g];return E}function l(S,E){return new Promise(function(g,b){function p(y){S.removeListener(E,u),b(y)}function u(){typeof S.removeListener=="function"&&S.removeListener("error",p),g([].slice.call(arguments))}w(S,E,u,{once:!0}),E!=="error"&&_(S,p,{once:!0})})}function _(S,E,g){typeof S.on=="function"&&w(S,"error",E,g)}function w(S,E,g,b){if(typeof S.on=="function")b.once?S.once(E,g):S.on(E,g);else if(typeof S.addEventListener=="function")S.addEventListener(E,function p(u){b.once&&S.removeEventListener(E,p),g(u)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}}}),Qy=Ze({"src/lib/events.js"(Z,q){"use strict";var v=Wg().EventEmitter,x={init:function(A){if(A._ev instanceof v)return A;var M=new v,e=new v;return A._ev=M,A._internalEv=e,A.on=M.on.bind(M),A.once=M.once.bind(M),A.removeListener=M.removeListener.bind(M),A.removeAllListeners=M.removeAllListeners.bind(M),A._internalOn=e.on.bind(e),A._internalOnce=e.once.bind(e),A._removeInternalListener=e.removeListener.bind(e),A._removeAllInternalListeners=e.removeAllListeners.bind(e),A.emit=function(t,r){M.emit(t,r),e.emit(t,r)},typeof A.addEventListener=="function"&&A.addEventListener("wheel",()=>{}),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;n<i.length-1;n++)a(i[n]);return t=a(i[n]),t},purge:function(A){return delete A._ev,delete A.on,delete A.once,delete A.removeListener,delete A.removeAllListeners,delete A.emit,delete A._ev,delete A._internalEv,delete A._internalOn,delete A._internalOnce,delete A._removeInternalListener,delete A._removeAllInternalListeners,A}};q.exports=x}}),aO=Ze({"src/lib/queue.js"(Z,q){"use strict";var v=ca(),x=Hg().dfltConfig;function A(e,t){for(var r=[],i,a=0;a<t.length;a++)i=t[a],i===e?r[a]=i:typeof i=="object"?r[a]=Array.isArray(i)?v.extendDeep([],i):v.extendDeepAll({},i):r[a]=i;return r}var M={};M.add=function(e,t,r,i,a){var n,o;if(e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},o=e.undoQueue.index,e.autoplay){e.undoQueue.inSequence||(e.autoplay=!1);return}!e.undoQueue.sequence||e.undoQueue.beginSequence?(n={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(o,e.undoQueue.queue.length-o,n),e.undoQueue.index+=1):n=e.undoQueue.queue[o-1],e.undoQueue.beginSequence=!1,n&&(n.undo.calls.unshift(t),n.undo.args.unshift(r),n.redo.calls.push(i),n.redo.args.push(a)),e.undoQueue.queue.length>x.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<r.undo.calls.length;i++)M.plotDo(t,r.undo.calls[i],r.undo.args[i]);t.undoQueue.inSequence=!1,t.autoplay=!1}},M.redo=function(t){var r,i;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,i=0;i<r.redo.calls.length;i++)M.plotDo(t,r.redo.calls[i],r.redo.args[i]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},M.plotDo=function(e,t,r){e.autoplay=!0,r=A(e,r),t.apply(null,r)},q.exports=M}}),iS=Ze({"src/plots/frame_attributes.js"(Z,q){"use strict";q.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}}),e1=Ze({"src/plot_api/plot_schema.js"(Z){"use strict";var q=oo(),v=ca(),x=eu(),A=$y(),M=iS(),e=A_(),t=Hg().configAttributes,r=pc(),i=v.extendDeepAll,a=v.isPlainObject,n=v.isArrayOrTypedArray,o=v.nestedProperty,s=v.valObjectMeta,c="_isSubplotObj",h="_isLinkedToArray",m="_arrayAttrRegexps",d="_deprecated",T=[c,h,m,d];Z.IS_SUBPLOT_OBJ=c,Z.IS_LINKED_TO_ARRAY=h,Z.DEPRECATED=d,Z.UNDERSCORE_ATTRS=T,Z.get=function(){var L={};return q.allTypes.forEach(function(z){L[z]=S(z)}),{defs:{valObjects:s,metaKeys:T.concat(["description","role","editType","impliedEdits"]),editType:{traces:r.traces,layout:r.layout},impliedEdits:{}},traces:L,layout:E(),frames:g(),animation:b(e),config:b(t)}},Z.crawl=function(L,z,F,B){var O=F||0;B=B||"",Object.keys(L).forEach(function(I){var N=L[I];if(T.indexOf(I)===-1){var U=(B?B+".":"")+I;z(N,I,L,O,U),!Z.isValObject(N)&&a(N)&&I!=="impliedEdits"&&Z.crawl(N,z,O+1,U)}})},Z.isValObject=function(L){return L&&L.valType!==void 0},Z.findArrayAttributes=function(L){var z=[],F=[],B=[],O,I;function N(W,Q,ue,se){F=F.slice(0,se).concat([Q]),B=B.slice(0,se).concat([W&&W._isLinkedToArray]);var he=W&&(W.valType==="data_array"||W.arrayOk===!0)&&!(F[se-1]==="colorbar"&&(Q==="ticktext"||Q==="tickvals"));he&&U(O,0,"")}function U(W,Q,ue){var se=W[F[Q]],he=ue+F[Q];if(Q===F.length-1)n(se)&&z.push(I+he);else if(B[Q]){if(Array.isArray(se))for(var H=0;H<se.length;H++)a(se[H])&&U(se[H],Q+1,he+"["+H+"].")}else a(se)&&U(se,Q+1,he+".")}return O=L,I="",Z.crawl(x,N),L._module&&L._module.attributes&&Z.crawl(L._module.attributes,N),z},Z.getTraceValObject=function(L,z){var F=z[0],B=1,O,I,N=L._module;if(N||(N=(q.modules[L.type||x.type.dflt]||{})._module),!N)return!1;if(O=N.attributes,I=O&&O[F],!I){var U=N.basePlotModule;U&&U.attributes&&(I=U.attributes[F])}return I||(I=x[F]),_(I,z,B)},Z.getLayoutValObject=function(L,z){var F=l(L,z[0]);return _(F,z,1)};function l(L,z){var F,B,O,I,N=L._basePlotModules;if(N){var U;for(F=0;F<N.length;F++){if(O=N[F],O.attrRegex&&O.attrRegex.test(z)){if(O.layoutAttrOverrides)return O.layoutAttrOverrides;!U&&O.layoutAttributes&&(U=O.layoutAttributes)}var W=O.baseLayoutAttrOverrides;if(W&&z in W)return W[z]}if(U)return U}var Q=L._modules;if(Q){for(F=0;F<Q.length;F++)if(I=Q[F].layoutAttributes,I&&z in I)return I[z]}for(B in q.componentsRegistry){if(O=q.componentsRegistry[B],O.name==="colorscale"&&z.indexOf("coloraxis")===0)return O.layoutAttributes[z];if(!O.schema&&z===O.name)return O.layoutAttributes}return z in A?A[z]:!1}function _(L,z,F){if(!L)return!1;if(L._isLinkedToArray){if(w(z[F]))F++;else if(F<z.length)return!1}for(;F<z.length;F++){var B=L[z[F]];if(a(B))L=B;else break;if(F===z.length-1)break;if(L._isLinkedToArray){if(F++,!w(z[F]))return!1}else if(L.valType==="info_array"){F++;var O=z[F];if(!w(O))return!1;var I=L.items;if(Array.isArray(I)){if(O>=I.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var N=z[F];if(!w(N))return!1;L=I[O][N]}else L=I[O]}else L=I}}return L}function w(L){return L===Math.round(L)&&L>=0}function S(L){var z,F;z=q.modules[L]._module,F=z.basePlotModule;var B={};B.type=null;var O=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<F.attr.length;B++)f(L,F,F.attr[B]);else{var O=F.attr==="subplot"?F.name:F.attr;f(L,F,O)}for(z in q.componentsRegistry){F=q.componentsRegistry[z];var I=F.schema;if(I&&(I.subplots||I.layout)){var N=I.subplots;if(N&&N.xaxis&&!N.yaxis)for(var U in N.xaxis)delete L.yaxis[U];delete L.xaxis.shift,delete L.xaxis.autoshift}else F.name==="colorscale"?i(L,F.layoutAttributes):F.layoutAttributes&&P(L,F.layoutAttributes,F.name)}return{layoutAttributes:b(L)}}function g(){var L={frames:i({},M)};return b(L),L.frames}function b(L){return p(L),u(L),y(L),L}function p(L){function z(B){return{valType:"string",editType:"none"}}function F(B,O,I){Z.isValObject(B)?(B.arrayOk===!0||B.valType==="data_array")&&(I[O+"src"]=z(O)):a(B)&&(B.role="object")}Z.crawl(L,F)}function u(L){function z(F,B,O){if(F){var I=F[h];I&&(delete F[h],O[B]={items:{}},O[B].items[I]=F,O[B].role="object")}}Z.crawl(L,z)}function y(L){function z(F){for(var B in F)if(a(F[B]))z(F[B]);else if(Array.isArray(F[B]))for(var O=0;O<F[B].length;O++)z(F[B][O]);else F[B]instanceof RegExp&&(F[B]=F[B].toString())}z(L)}function f(L,z,F){var B=o(L,F),O=i({},z.layoutAttributes);O[c]=!0,B.set(O)}function P(L,z,F){var B=o(L,F);B.set(i(B.get()||{},z))}}}),Dl=Ze({"src/plot_api/plot_template.js"(Z){"use strict";var q=ca(),v=eu(),x="templateitemname",A={name:{valType:"string",editType:"none"}};A[x]={valType:"string",editType:"calc"},Z.templatedArray=function(t,r){return r._isLinkedToArray=t,r.name=A.name,r[x]=A[x],r},Z.traceTemplater=function(t){var r={},i,a;for(i in t)a=t[i],Array.isArray(a)&&a.length&&(r[i]=0);function n(o){i=q.coerce(o,{},v,"type");var s={type:i,_template:null};if(i in r){a=t[i];var c=r[i]%a.length;r[i]++,s._template=a[c]}return s}return{newTrace:n}},Z.newContainer=function(t,r,i){var a=t._template,n=a&&(a[r]||i&&a[i]);q.isPlainObject(n)||(n=null);var o=t[r]={_template:n};return o},Z.arrayTemplater=function(t,r,i){var a=t._template,n=a&&a[e(r)],o=a&&a[r];(!Array.isArray(o)||!o.length)&&(o=[]);var s={};function c(m){var d={name:m.name,_input:m},T=d[x]=m[x];if(!M(T))return d._template=n,d;for(var l=0;l<o.length;l++){var _=o[l];if(_.name===T)return s[T]=1,d._template=_,d}return d[i]=m[i]||!1,d._template=!1,d}function h(){for(var m=[],d=0;d<o.length;d++){var T=o[d],l=T.name;if(M(l)&&!s[l]){var _={_template:T,name:l,_input:{_templateitemname:l}};_[x]=T[x],m.push(_),s[l]=1}}return m}return{newItem:c,defaultItems:h}};function M(t){return t&&typeof t=="string"}function e(t){var r=t.length-1;return t.charAt(r)!=="s"&&q.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}Z.arrayDefaultKey=e,Z.arrayEditor=function(t,r,i){var a=(q.nestedProperty(t,r).get()||[]).length,n=i._index,o=n>=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;a<r.length;a++){var n=r[a];i[a]=t[n.charAt(0)+"axis"+n.substr(1)]}if(!e){var o=t._subplots.gl3d||[];for(a=0;a<o.length;a++){var s=t[o[a]];M?i.push(s[M+"axis"]):i.push(s.xaxis,s.yaxis,s.zaxis)}}return i},Z.listIds=function(A,M){var e=A._fullLayout;if(!e)return[];var t=e._subplots;return M?t[M+"axis"]:t.xaxis.concat(t.yaxis)},Z.getFromId=function(A,M,e){var t=A._fullLayout;return M=M===void 0||typeof M!="string"?M:M.replace(" domain",""),e==="x"?M=M.replace(/y[0-9]*/,""):e==="y"&&(M=M.replace(/x[0-9]*/,"")),t[Z.id2name(M)]},Z.getFromTrace=function(A,M,e){var t=A._fullLayout,r=null;if(q.traceIs(M,"gl3d")){var i=M.scene;i.substr(0,5)==="scene"&&(r=t[i][e+"axis"])}else r=Z.getFromId(A,M[e+"axis"]||e);return r},Z.idSort=function(A,M){var e=A.charAt(0),t=M.charAt(0);return e!==t?e>t?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;e<M.length;e++)if(M[e][A])return!0}return!1}Z.isLinked=function(A,M){return x(M,A._axisMatchGroups)||x(M,A._axisConstraintGroups)}}}),Jm=Ze({"src/components/shapes/handle_outline.js"(Z,q){"use strict";function v(A){var M=A._fullLayout._zoomlayer;M&&M.selectAll(".outline-controllers").remove()}function x(A){var M=A._fullLayout._zoomlayer;M&&M.selectAll(".select-outline").remove(),A._fullLayout._outlining=!1}q.exports={clearOutlineControllers:v,clearOutline:x}}}),y2=Ze({"src/traces/scatter/layout_attributes.js"(Z,q){"use strict";q.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),Hh=Ze({"src/plots/get_data.js"(Z){"use strict";var q=oo(),v=kh().SUBPLOT_PATTERN;Z.getSubplotCalcData=function(x,A,M){var e=q.subplotsRegistry[A];if(!e)return[];for(var t=e.attr,r=[],i=0;i<x.length;i++){var a=x[i],n=a[0].trace;n[t]===M&&r.push(a)}return r},Z.getModuleCalcData=function(x,A,M){var e=[],t=[],r;if(typeof A=="string"?r=q.getModule(A).plot:typeof A=="function"?r=A:r=A.plot,!r)return[e,x];for(var i=M,a=0;a<x.length;a++){var n=x[a],o=n[0].trace,s=o.zorder!==void 0;o.visible!==!0||o._length===0||(o._module&&o._module.plot===r&&(!s||o.zorder===i)?e.push(n):t.push(n))}return[e,t]},Z.getSubplotData=function(A,M,e){if(!q.subplotsRegistry[M])return[];for(var t=q.subplotsRegistry[M].attr,r=[],i,a,n,o=0;o<A.length;o++)i=A[o],i[t]===e&&r.push(i);return r}}}),nO=Ze({"src/plots/command.js"(Z){"use strict";var q=oo(),v=ca();Z.manageCommandObserver=function(r,i,a,n){var o={},s=!0;i&&i._commandObserver&&(o=i._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=Z.hasSimpleAPICommandBindings(r,a,o.lookupTable);if(i&&i._commandObserver){if(c)return o;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,o}if(c){x(r,c,o.cache),o.check=function(){if(s){var T=x(r,c,o.cache);return T.changed&&n&&o.lookupTable[T.value]!==void 0&&(o.disable(),Promise.resolve(n({value:T.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[T.value]})).then(o.enable,o.enable)),T.changed}};for(var h=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],m=0;m<h.length;m++)r._internalOn(h[m],o.check);o.remove=function(){for(var d=0;d<h.length;d++)r._removeInternalListener(h[d],o.check)}}else v.log("Unable to automatically bind plot updates to API command"),o.lookupTable={},o.remove=function(){};return o.disable=function(){s=!1},o.enable=function(){s=!0},i&&(i._commandObserver=o),o},Z.hasSimpleAPICommandBindings=function(r,i,a){var n,o=i.length,s;for(n=0;n<o;n++){var c,h=i[n],m=h.method,d=h.args;if(Array.isArray(d)||(d=[]),!m)return!1;var T=Z.computeAPICommandBindings(r,m,d);if(T.length!==1)return!1;if(!s)s=T[0],Array.isArray(s.traces)&&s.traces.sort();else{if(c=T[0],c.type!==s.type||c.prop!==s.prop)return!1;if(Array.isArray(s.traces))if(Array.isArray(c.traces)){c.traces.sort();for(var l=0;l<s.traces.length;l++)if(s.traces[l]!==c.traces[l])return!1}else return!1;else if(c.prop!==s.prop)return!1}c=T[0];var _=c.value;if(Array.isArray(_))if(_.length===1)_=_[0];else return!1;a&&(a[_]=n)}return s};function x(r,i,a){var n,o,s,c=!1;if(i.type==="data")n=r._fullData[i.traces!==null?i.traces[0]:0];else if(i.type==="layout")n=r._fullLayout;else return!1;return o=v.nestedProperty(n,i.prop).get(),s=a[i.type]=a[i.type]||{},s.hasOwnProperty(i.prop)&&s[i.prop]!==o&&(c=!0),s[i.prop]=o,{changed:c,value:o}}Z.executeAPICommand=function(r,i,a){if(i==="skip")return Promise.resolve();var n=q.apiMethodRegistry[i],o=[r];Array.isArray(a)||(a=[]);for(var s=0;s<a.length;s++)o.push(a[s]);return n.apply(null,o).catch(function(c){return v.warn("API call to Plotly."+i+" rejected.",c),Promise.reject(c)})},Z.computeAPICommandBindings=function(r,i,a){var n;switch(Array.isArray(a)||(a=[]),i){case"restyle":n=e(r,a);break;case"relayout":n=M(r,a);break;case"update":n=e(r,[a[0],a[2]]).concat(M(r,[a[1]]));break;case"animate":n=A(r,a);break;default:n=[]}return n};function A(r,i){return Array.isArray(i[0])&&i[0].length===1&&["string","number"].indexOf(typeof i[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:i[0][0].toString()}]:[]}function M(r,i){var a=[],n=i[0],o={};if(typeof n=="string")o[n]=i[1];else if(v.isPlainObject(n))o=n;else return a;return t(o,function(s,c,h){a.push({type:"layout",prop:s,value:h})},"",0),a}function e(r,i){var a,n,o,s,c=[];if(n=i[0],o=i[1],a=i[2],s={},typeof n=="string")s[n]=o;else if(v.isPlainObject(n))s=n,a===void 0&&(a=o);else return c;return a===void 0&&(a=null),t(s,function(h,m,d){var T,l;if(Array.isArray(d)){l=d.slice();var _=Math.min(l.length,r.data.length);a&&(_=Math.min(_,a.length)),T=[];for(var w=0;w<_;w++)T[w]=a?a[w]:w}else l=d,T=a?a.slice():null;if(T===null)Array.isArray(l)&&(l=l[0]);else if(Array.isArray(T)){if(!Array.isArray(l)){var S=l;l=[];for(var E=0;E<T.length;E++)l[E]=S}l.length=Math.min(T.length,l.length)}c.push({type:"data",prop:h,traces:T,value:l})},"",0),c}function t(r,i,a,n){Object.keys(r).forEach(function(o){var s=r[o];if(o[0]!=="_"){var c=a+(n>0?".":"")+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;Ae<Fe.length;Ae++)a.pushUnique(Me.xaxis,Fe[Ae]);for(Ae=0;Ae<rt.length;Ae++)a.pushUnique(Me.yaxis,rt[Ae]);for(var st in fe)a.pushUnique(Me.cartesian,st)}if(oe._has=w._hasPlotType.bind(oe),j.length===ee.length)for(Ae=0;Ae<ee.length;Ae++)l(ee[Ae],j[Ae]);w.supplyLayoutModuleDefaults(ne,oe,ee,H._transitionData);var Qe=oe._visibleModules,Lt=[];for(Ae=0;Ae<Qe.length;Ae++){var kt=Qe[Ae].crossTraceDefaults;kt&&a.pushUnique(Lt,kt)}for(Ae=0;Ae<Lt.length;Ae++)Lt[Ae](ee,oe);oe._hasOnlyLargeSploms=oe._basePlotModules.length===1&&oe._basePlotModules[0].name==="splom"&&Fe.length>15&&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;Ae<ee.length;Ae++)Ir=ee[Ae]._fullInput.uid,wr[Ir]||(jr[Ir]={}),wr[Ir]="new";for(Ir in wr)wr[Ir]==="old"&&delete jr[Ir];F(oe),t.getComponentMethod("rangeslider","makeData")(oe),!J&&ce.length===ee.length&&w.supplyDefaultsUpdateCalc(ce,ee)},w.supplyDefaultsUpdateCalc=function(H,$){for(var J=0;J<$.length;J++){var X=$[J],oe=(H[J]||[])[0];if(oe&&oe.trace){var ne=oe.trace;if(ne._hasCalcTransform){var j=ne._arrayAttrs,ee,re,ce;for(ee=0;ee<j.length;ee++)re=j[ee],ce=a.nestedProperty(ne,re).get().slice(),a.nestedProperty(X,re).set(ce)}oe.trace=X}}};function p(H,$){var J=$.length,X=[],oe,ne;for(oe=0;oe<H.length;oe++){var j=H[oe]._fullInput;j!==ne&&X.push(j),ne=j}var ee=X.length,re=new Array(J),ce={};function be(Re,We){re[We]=Re,ce[Re]=1}function Ae(Re,We){if(Re&&typeof Re=="string"&&!ce[Re])return be(Re,We),!0}for(oe=0;oe<J;oe++){var ze=$[oe].uid;typeof ze=="number"&&(ze=String(ze)),!Ae(ze,oe)&&(oe<ee&&Ae(X[oe].uid,oe)||be(a.randstr(ce),oe))}return re}function u(){var H=t.collectableSubplotTypes,$={},J,X;if(!H){H=[];var oe=t.subplotsRegistry;for(var ne in oe){var j=oe[ne],ee=j.attr;if(ee&&(H.push(ne),Array.isArray(ee)))for(X=0;X<ee.length;X++)a.pushUnique(H,ee[X])}}for(J=0;J<H.length;J++)$[H[J]]=[];return $}function y(H,$){var J=H._context.locale;J||(J="en-US");var X=!1,oe={};function ne(Ae){for(var ze=!0,Re=0;Re<$.length;Re++){var We=$[Re];oe[We]||(Ae[We]?oe[We]=Ae[We]:ze=!1)}ze&&(X=!0)}for(var j=0;j<2;j++){for(var ee=H._context.locales,re=0;re<2;re++){var ce=(ee[J]||{}).format;if(ce&&(ne(ce),X))break;ee=t.localeRegistry}var be=J.split("-")[0];if(X||be===J)break;J=be}return X||ne(t.localeRegistry.en.format),oe}function f(H,$){return H.decimal=$.charAt(0),H.thousands=$.charAt(1),{numberFormat:function(J){try{J=A(H).format(a.adjustFormat(J))}catch{return a.warnBadFormat(J),a.noFormat}return J},timeFormat:x(H).utcFormat}}function P(H,$){var J,X=[];$.meta&&(J=$._meta={meta:$.meta,layout:{meta:$.meta}});for(var oe=0;oe<H.length;oe++){var ne=H[oe];ne.meta?X[ne.index]=ne._meta={meta:ne.meta}:$.meta&&(ne._meta={meta:$.meta}),$.meta&&(ne._meta.layout={meta:$.meta})}X.length&&(J||(J=$._meta={}),J.data=X)}w.createTransitionData=function(H){H._transitionData||(H._transitionData={}),H._transitionData._frames||(H._transitionData._frames=[]),H._transitionData._frameHash||(H._transitionData._frameHash={}),H._transitionData._counter||(H._transitionData._counter=0),H._transitionData._interruptCallbacks||(H._transitionData._interruptCallbacks=[])},w._hasPlotType=function(H){var $,J=this._basePlotModules||[];for($=0;$<J.length;$++)if(J[$].name===H)return!0;var X=this._modules||[];for($=0;$<X.length;$++){var oe=X[$].name;if(oe===H)return!0;var ne=t.modules[oe];if(ne&&ne.categories[H])return!0}return!1},w.cleanPlot=function(H,$,J,X){var oe,ne,j=X._basePlotModules||[];for(oe=0;oe<j.length;oe++){var ee=j[oe];ee.clean&&ee.clean(H,$,J,X)}var re=X._has&&X._has("gl"),ce=$._has&&$._has("gl");re&&!ce&&X._glcontainer!==void 0&&(X._glcontainer.selectAll(".gl-canvas").remove(),X._glcontainer.selectAll(".no-webgl").remove(),X._glcanvas=null);var be=!!X._infolayer;e:for(oe=0;oe<J.length;oe++){var Ae=J[oe],ze=Ae.uid;for(ne=0;ne<H.length;ne++){var Re=H[ne];if(ze===Re.uid)continue e}be&&X._infolayer.select(".cb"+ze).remove()}},w.linkSubplots=function(H,$,J,X){var oe,ne,j=X._plots||{},ee=$._plots={},re=$._subplots,ce={_fullData:H,_fullLayout:$},be=re.cartesian||[];for(oe=0;oe<be.length;oe++){var Ae=be[oe],ze=j[Ae],Re=s.getFromId(ce,Ae,"x"),We=s.getFromId(ce,Ae,"y"),it;for(ze?it=ee[Ae]=ze:(it=ee[Ae]={},it.id=Ae),Re._counterAxes.push(We._id),We._counterAxes.push(Re._id),Re._subplotsWith.push(Ae),We._subplotsWith.push(Ae),it.xaxis=Re,it.yaxis=We,it._hasClipOnAxisFalse=!1,ne=0;ne<H.length;ne++){var ot=H[ne];if(ot.xaxis===it.xaxis._id&&ot.yaxis===it.yaxis._id&&ot.cliponaxis===!1){it._hasClipOnAxisFalse=!0;break}}}var tt=s.list(ce,null,!0),ut;for(oe=0;oe<tt.length;oe++){ut=tt[oe];var Me=null;ut.overlaying&&(Me=s.getFromId(ce,ut.overlaying),Me&&Me.overlaying&&(ut.overlaying=!1,Me=null)),ut._mainAxis=Me||ut,Me&&(ut.domain=Me.domain.slice()),ut._anchorAxis=ut.anchor==="free"?null:s.getFromId(ce,ut.anchor)}for(oe=0;oe<tt.length;oe++)if(ut=tt[oe],ut._counterAxes.sort(s.idSort),ut._subplotsWith.sort(a.subplotSort),ut._mainSubplot=L(ut,$),ut._counterAxes.length&&(ut.spikemode&&ut.spikemode.indexOf("across")!==-1||ut.automargin&&ut.mirror&&ut.anchor!=="free"||t.getComponentMethod("rangeslider","isVisible")(ut))){var _e=1,fe=0;for(ne=0;ne<ut._counterAxes.length;ne++){var Fe=s.getFromId(ce,ut._counterAxes[ne]);_e=Math.min(_e,Fe.domain[0]),fe=Math.max(fe,Fe.domain[1])}_e<fe&&(ut._counterDomainMin=_e,ut._counterDomainMax=fe)}};function L(H,$){var J={_fullLayout:$},X=H._id.charAt(0)==="x",oe=H._mainAxis._anchorAxis,ne="",j="",ee="";if(oe&&(ee=oe._mainAxis._id,ne=X?H._id+ee:ee+H._id),!ne||!$._plots[ne]){ne="";for(var re=H._counterAxes,ce=0;ce<re.length;ce++){var be=re[ce],Ae=X?H._id+be:be+H._id;j||(j=Ae);var ze=s.getFromId(J,be);if(ee&&ze.overlaying===ee){ne=Ae;break}}}return ne||j}w.clearExpandedTraceDefaultColors=function(H){var $,J,X;function oe(j,ee,re,ce){J[ce]=ee,J.length=ce+1,j.valType==="color"&&j.dflt===void 0&&$.push(J.join("."))}for(J=[],$=H._module._colorAttrs,$||(H._module._colorAttrs=$=[],r.crawl(H._module.attributes,oe)),X=0;X<$.length;X++){var ne=a.nestedProperty(H,"_input."+$[X]);ne.get()||a.nestedProperty(H,$[X]).set(null)}},w.supplyDataDefaults=function(H,$,J,X){var oe=X._modules,ne=X._visibleModules,j=X._basePlotModules,ee=0,re=0,ce,be,Ae;X._transformModules=[];function ze(ut){$.push(ut);var Me=ut._module;Me&&(a.pushUnique(oe,Me),ut.visible===!0&&a.pushUnique(ne,Me),a.pushUnique(j,ut._module.basePlotModule),ee++,ut._input.visible!==!1&&re++)}var Re={},We=[],it=(J.template||{}).data||{},ot=i.traceTemplater(it);for(ce=0;ce<H.length;ce++)Ae=H[ce],be=ot.newTrace(Ae),be.uid=X._traceUids[ce],w.supplyTraceDefaults(Ae,be,re,X,ce),be.index=ce,be._input=Ae,be._fullInput=be,ze(be),t.traceIs(be,"carpetAxis")&&(Re[be.carpet]=be),t.traceIs(be,"carpetDependent")&&We.push(ce);for(ce=0;ce<We.length;ce++)if(be=$[We[ce]],!!be.visible){var tt=Re[be.carpet];if(be._carpet=tt,!tt||!tt.visible){be.visible=!1;continue}be.xaxis=tt.xaxis,be.yaxis=tt.yaxis}},w.supplyAnimationDefaults=function(H){H=H||{};var $,J={};function X(oe,ne){return a.coerce(H||{},J,m,oe,ne)}if(X("mode"),X("direction"),X("fromcurrent"),Array.isArray(H.frame))for(J.frame=[],$=0;$<H.frame.length;$++)J.frame[$]=w.supplyAnimationFrameDefaults(H.frame[$]||{});else J.frame=w.supplyAnimationFrameDefaults(H.frame||{});if(Array.isArray(H.transition))for(J.transition=[],$=0;$<H.transition.length;$++)J.transition[$]=w.supplyAnimationTransitionDefaults(H.transition[$]||{});else J.transition=w.supplyAnimationTransitionDefaults(H.transition||{});return J},w.supplyAnimationFrameDefaults=function(H){var $={};function J(X,oe){return a.coerce(H||{},$,m.frame,X,oe)}return J("duration"),J("redraw"),$},w.supplyAnimationTransitionDefaults=function(H){var $={};function J(X,oe){return a.coerce(H||{},$,m.transition,X,oe)}return J("duration"),J("easing"),$},w.supplyFrameDefaults=function(H){var $={};function J(X,oe){return a.coerce(H,$,d,X,oe)}return J("group"),J("name"),J("traces"),J("baseframe"),J("data"),J("layout"),$},w.supplyTraceDefaults=function(H,$,J,X,oe){var ne=X.colorway||n.defaults,j=ne[J%ne.length],ee;function re(Me,_e){return a.coerce(H,$,w.attributes,Me,_e)}var ce=re("visible");re("type"),re("name",X._traceWord+" "+oe),re("uirevision",X.uirevision);var be=w.getModule($);if($._module=be,be){var Ae=be.basePlotModule,ze=Ae.attr,Re=Ae.attributes;if(ze&&Re){var We=X._subplots,it="";if(Array.isArray(ze))for(ee=0;ee<ze.length;ee++){var ot=ze[ee],tt=a.coerce(H,$,Re,ot);We[ot]&&a.pushUnique(We[ot],tt),it+=tt}else it=a.coerce(H,$,Re,ze);We[Ae.name]&&a.pushUnique(We[Ae.name],it)}}if(ce&&(re("customdata"),re("ids"),re("meta"),t.traceIs($,"showLegend")?(a.coerce(H,$,be.attributes.showlegend?be.attributes:w.attributes,"showlegend"),re("legend"),re("legendwidth"),re("legendgroup"),re("legendgrouptitle.text"),re("legendrank"),$._dfltShowLegend=!0):$._dfltShowLegend=!1,be&&be.supplyDefaults(H,$,j,X),t.traceIs($,"noOpacity")||re("opacity"),t.traceIs($,"notLegendIsolatable")&&($.visible=!!$.visible),t.traceIs($,"noHover")||($.hovertemplate||a.coerceHoverinfo(H,$,X),$.type!=="parcats"&&t.getComponentMethod("fx","supplyDefaults")(H,$,j,X)),be&&be.selectPoints)){var ut=re("selectedpoints");a.isTypedArray(ut)&&($.selectedpoints=Array.from(ut))}return $},w.supplyLayoutGlobalDefaults=function(H,$,J){function X(Ae,ze){return a.coerce(H,$,w.layoutAttributes,Ae,ze)}var oe=H.template;a.isPlainObject(oe)&&($.template=oe,$._template=oe.layout,$._dataTemplate=oe.data),X("autotypenumbers");var ne=a.coerceFont(X,"font"),j=ne.size;a.coerceFont(X,"title.font",ne,{overrideDflt:{size:Math.round(j*1.4)}}),X("title.text",$._dfltTitle.plot),X("title.xref");var ee=X("title.yref");X("title.pad.t"),X("title.pad.r"),X("title.pad.b"),X("title.pad.l");var re=X("title.automargin");X("title.x"),X("title.xanchor"),X("title.y"),X("title.yanchor"),X("title.subtitle.text",$._dfltTitle.subtitle),a.coerceFont(X,"title.subtitle.font",ne,{overrideDflt:{size:Math.round($.title.font.size*.7)}}),re&&(ee==="paper"&&($.title.y!==0&&($.title.y=1),$.title.yanchor==="auto"&&($.title.yanchor=$.title.y===0?"top":"bottom")),ee==="container"&&($.title.y==="auto"&&($.title.y=1),$.title.yanchor==="auto"&&($.title.yanchor=$.title.y<.5?"bottom":"top")));var ce=X("uniformtext.mode");ce&&X("uniformtext.minsize"),X("autosize",!(H.width&&H.height)),X("width"),X("height"),X("minreducedwidth"),X("minreducedheight"),X("margin.l"),X("margin.r"),X("margin.t"),X("margin.b"),X("margin.pad"),X("margin.autoexpand"),H.width&&H.height&&w.sanitizeMargins($),t.getComponentMethod("grid","sizeDefaults")(H,$),X("paper_bgcolor"),X("separators",J.decimal+J.thousands),X("hidesources"),X("colorway"),X("datarevision");var be=X("uirevision");X("editrevision",be),X("selectionrevision",be),t.getComponentMethod("modebar","supplyLayoutDefaults")(H,$),t.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(H,$,X),t.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(H,$,X),X("meta"),a.isPlainObject(H.transition)&&(X("transition.duration"),X("transition.easing"),X("transition.ordering")),t.getComponentMethod("calendars","handleDefaults")(H,$,"calendar"),t.getComponentMethod("fx","supplyLayoutGlobalDefaults")(H,$,X),a.coerce(H,$,h,"scattermode")};function z(H){return typeof H=="string"&&H.substr(H.length-2)==="px"&&parseFloat(H)}w.plotAutoSize=function($,J,X){var oe=$._context||{},ne=oe.frameMargins,j,ee,re=a.isPlotDiv($);if(re&&$.emit("plotly_autosize"),oe.fillFrame)j=window.innerWidth,ee=window.innerHeight,document.body.style.overflow="hidden";else{var ce=re?window.getComputedStyle($):{};if(j=z(ce.width)||z(ce.maxWidth)||X.width,ee=z(ce.height)||z(ce.maxHeight)||X.height,M(ne)&&ne>0){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;j<Ae&&(j=Ae),ee<ze&&(ee=ze);var Re=!J.width&&Math.abs(X.width-j)>1,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;ee<ne.length;ee++)re=ne[ee],re.supplyLayoutDefaults&&re.supplyLayoutDefaults(H,$,J);var Ae=$._modules;for(ee=0;ee<Ae.length;ee++)re=Ae[ee],re.supplyLayoutDefaults&&re.supplyLayoutDefaults(H,$,J);var ze=$._transformModules;for(ee=0;ee<ze.length;ee++)re=ze[ee],re.supplyLayoutDefaults&&re.supplyLayoutDefaults(H,$,J,X);for(j in oe)re=oe[j],re.supplyLayoutDefaults&&re.supplyLayoutDefaults(H,$,J)},w.purge=function(H){var $=H._fullLayout||{};$._glcontainer!==void 0&&($._glcontainer.selectAll(".gl-canvas").remove(),$._glcontainer.remove(),$._glcanvas=null),$._modeBar&&$._modeBar.destroy(),H._transitionData&&(H._transitionData._interruptCallbacks&&(H._transitionData._interruptCallbacks.length=0),H._transitionData._animationRaf&&window.cancelAnimationFrame(H._transitionData._animationRaf)),a.clearThrottle(),a.clearResponsive(H),delete H.data,delete H.layout,delete H._fullData,delete H._fullLayout,delete H.calcdata,delete H.empty,delete H.fid,delete H.undoqueue,delete H.undonum,delete H.autoplay,delete H.changed,delete H._promises,delete H._redrawTimer,delete H._hmlumcount,delete H._hmpixcount,delete H._transitionData,delete H._transitioning,delete H._initialAutoSize,delete H._transitioningWithDuration,delete H._dragging,delete H._dragged,delete H._dragdata,delete H._hoverdata,delete H._snapshotInProgress,delete H._editing,delete H._mouseDownTime,delete H._legendMouseDownTime,H.removeAllListeners&&H.removeAllListeners()},w.style=function(H){var $=H._fullLayout._visibleModules,J=[],X;for(X=0;X<$.length;X++){var oe=$[X];oe.style&&a.pushUnique(J,oe.style)}for(X=0;X<J.length;X++)J[X](H)},w.sanitizeMargins=function(H){if(!(!H||!H.margin)){var $=H.width,J=H.height,X=H.margin,oe=$-(X.l+X.r),ne=J-(X.t+X.b),j;oe<0&&(j=($-1)/(X.l+X.r),X.l=Math.floor(j*X.l),X.r=Math.floor(j*X.r)),ne<0&&(j=(J-1)/(X.t+X.b),X.t=Math.floor(j*X.t),X.b=Math.floor(j*X.b))}},w.clearAutoMarginIds=function(H){H._fullLayout._pushmarginIds={}},w.allowAutoMargin=function(H,$){H._fullLayout._pushmarginIds[$]=1};function F(H){var $=H.margin;if(!H._size){var J=H._size={l:Math.round($.l),r:Math.round($.r),t:Math.round($.t),b:Math.round($.b),p:Math.round($.pad)};J.w=Math.round(H.width)-J.l-J.r,J.h=Math.round(H.height)-J.t-J.b}H._pushmargin||(H._pushmargin={}),H._pushmarginIds||(H._pushmarginIds={}),H._reservedMargin||(H._reservedMargin={})}var B=2,O=2;w.autoMargin=function(H,$,J){var X=H._fullLayout,oe=X.width,ne=X.height,j=X.margin,ee=X.minreducedwidth,re=X.minreducedheight,ce=a.constrain(oe-j.l-j.r,B,ee),be=a.constrain(ne-j.t-j.b,O,re),Ae=Math.max(0,oe-ce),ze=Math.max(0,ne-be),Re=X._pushmargin,We=X._pushmarginIds;if(j.autoexpand!==!1){if(!J)delete Re[$],delete We[$];else{var it=J.pad;if(it===void 0&&(it=Math.min(12,j.l,j.r,j.t,j.b)),Ae){var ot=(J.l+J.r)/Ae;ot>1&&(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($._redrawFromAutoMarginCount<rr)return t.call("_doPlot",H);$._size=ee,a.warn("Too many auto-margin redraws.")}N(H)};function N(H){var $=s.list(H,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach(function(J){for(var X=0;X<$.length;X++){var oe=$[X][J];oe&&oe()}})}var U=["l","r","t","b","p","w","h"];w.didMarginChange=function(H,$){for(var J=0;J<U.length;J++){var X=U[J],oe=H[X],ne=$[X];if(!M(oe)||Math.abs(ne-oe)>1)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;X<ee.data.length;X++)oe[X]=X;for(be.traces||(be.traces=[]),X=0;X<ee.data.length;X++)ne=oe[X],ne!=null&&(j=be.traces.indexOf(ne),j===-1&&(j=be.data.length,be.traces[j]=ne),be.data[j]=w.extendTrace(be.data[j],ee.data[X]))}return be},w.recomputeFrameHash=function(H){for(var $=H._transitionData._frameHash={},J=H._transitionData._frames,X=0;X<J.length;X++){var oe=J[X];oe&&oe.name&&($[oe.name]=oe)}},w.extendObjectWithContainers=function(H,$,J){var X,oe,ne,j,ee,re,ce,be,Ae=a.extendDeepNoArrays({},$||{}),ze=a.expandObjectPaths(Ae),Re={};if(J&&J.length)for(ne=0;ne<J.length;ne++)X=a.nestedProperty(ze,J[ne]),oe=X.get(),oe===void 0?a.nestedProperty(Re,J[ne]).set(null):(X.set(null),a.nestedProperty(Re,J[ne]).set(oe));if(H=a.extendDeepNoArrays(H||{},ze),J&&J.length){for(ne=0;ne<J.length;ne++)if(ee=a.nestedProperty(Re,J[ne]),ce=ee.get(),!!ce){for(re=a.nestedProperty(H,J[ne]),be=re.get(),Array.isArray(be)||(be=[],re.set(be)),j=0;j<ce.length;j++){var We=ce[j];We===null?be[j]=null:be[j]=w.extendObjectWithContainers(be[j],We)}re.set(be)}}return H},w.dataArrayContainers=["transforms","dimensions"],w.layoutArrayContainers=t.layoutArrayContainers,w.extendTrace=function(H,$){return w.extendObjectWithContainers(H,$,w.dataArrayContainers)},w.extendLayout=function(H,$){return w.extendObjectWithContainers(H,$,w.layoutArrayContainers)},w.transition=function(H,$,J,X,oe,ne){var j={redraw:oe.redraw},ee={},re=[];return j.prepareFn=function(){for(var ce=Array.isArray($)?$.length:0,be=X.slice(0,ce),Ae=0;Ae<be.length;Ae++){var ze=be[Ae],Re=H._fullData[ze],We=Re._module;if(We){if(We.animatable){var it=We.basePlotModule.name;ee[it]||(ee[it]=[]),ee[it].push(ze)}H.data[be[Ae]]=w.extendTrace(H.data[be[Ae]],$[Ae])}}var ot=a.expandObjectPaths(a.extendDeepNoArrays({},J)),tt=/^[xy]axis[0-9]*$/;for(var ut in ot)tt.test(ut)&&delete ot[ut].range;w.extendLayout(H.layout,ot),delete H.calcdata,w.supplyDefaults(H),w.doCalcdata(H);var Me=a.expandObjectPaths(J);if(Me){var _e=H._fullLayout._plots;for(var fe in _e){var Fe=_e[fe],rt=Fe.xaxis,st=Fe.yaxis,Qe=rt.range.slice(),Lt=st.range.slice(),kt=null,qt=null,Zt=null,Sr=null;Array.isArray(Me[rt._name+".range"])?kt=Me[rt._name+".range"].slice():Array.isArray((Me[rt._name]||{}).range)&&(kt=Me[rt._name].range.slice()),Array.isArray(Me[st._name+".range"])?qt=Me[st._name+".range"].slice():Array.isArray((Me[st._name]||{}).range)&&(qt=Me[st._name].range.slice()),Qe&&kt&&(rt.r2l(Qe[0])!==rt.r2l(kt[0])||rt.r2l(Qe[1])!==rt.r2l(kt[1]))&&(Zt={xr0:Qe,xr1:kt}),Lt&&qt&&(st.r2l(Lt[0])!==st.r2l(qt[0])||st.r2l(Lt[1])!==st.r2l(qt[1]))&&(Sr={yr0:Lt,yr1:qt}),(Zt||Sr)&&re.push(a.extendFlat({plotinfo:Fe},Zt,Sr))}}return Promise.resolve()},j.runFn=function(ce){var be,Ae=H._fullLayout._basePlotModules,ze=re.length,Re;if(J)for(Re=0;Re<Ae.length;Re++)Ae[Re].transitionAxes&&Ae[Re].transitionAxes(H,re,ne,ce);ze?(be=a.extendFlat({},ne),be.duration=0,delete ee.cartesian):be=ne;for(var We in ee){var it=ee[We],ot=H._fullData[it[0]]._module;ot.basePlotModule.plot(H,it,be,ce)}},W(H,ne,j)},w.transitionFromReact=function(H,$,J,X){var oe=H._fullLayout,ne=oe.transition,j={},ee=[];return j.prepareFn=function(){var re=oe._plots;j.redraw=!1,$.anim==="some"&&(j.redraw=!0),J.anim==="some"&&(j.redraw=!0);for(var ce in re){var be=re[ce],Ae=be.xaxis,ze=be.yaxis,Re=X[Ae._name].range.slice(),We=X[ze._name].range.slice(),it=Ae.range.slice(),ot=ze.range.slice();Ae.setScale(),ze.setScale();var tt=null,ut=null;(Ae.r2l(Re[0])!==Ae.r2l(it[0])||Ae.r2l(Re[1])!==Ae.r2l(it[1]))&&(tt={xr0:Re,xr1:it}),(ze.r2l(We[0])!==ze.r2l(ot[0])||ze.r2l(We[1])!==ze.r2l(ot[1]))&&(ut={yr0:We,yr1:ot}),(tt||ut)&&ee.push(a.extendFlat({plotinfo:be},tt,ut))}return Promise.resolve()},j.runFn=function(re){for(var ce=H._fullData,be=H._fullLayout,Ae=be._basePlotModules,ze,Re,We,it=[],ot=0;ot<ce.length;ot++)it.push(ot);function tt(){if(H._fullLayout)for(var Me=0;Me<Ae.length;Me++)Ae[Me].transitionAxes&&Ae[Me].transitionAxes(H,ee,ze,re)}function ut(){if(H._fullLayout)for(var Me=0;Me<Ae.length;Me++)Ae[Me].plot(H,We,Re,re)}ee.length&&$.anim?ne.ordering==="traces first"?(ze=a.extendFlat({},ne,{duration:0}),We=it,Re=ne,setTimeout(tt,ne.duration),ut()):(ze=ne,We=null,Re=a.extendFlat({},ne,{duration:0}),setTimeout(ut,ze.duration),tt()):ee.length?(ze=ne,tt()):$.anim&&(We=it,Re=ne,ut())},W(H,ne,j)};function W(H,$,J){var X=!1;function oe(Ae){var ze=Promise.resolve();if(!Ae)return ze;for(;Ae.length;)ze=ze.then(Ae.shift());return ze}function ne(Ae){if(Ae)for(;Ae.length;)Ae.shift()}function j(){return H.emit("plotly_transitioning",[]),new Promise(function(Ae){H._transitioning=!0,$.duration>0&&(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<X.length;ee++)if(Array.isArray($)&&$.indexOf(ee)===-1){ce[ee]=be[ee];continue}for(ee=0;ee<X.length;ee++)ne=X[ee],ne._arrayAttrs=r.findArrayAttributes(ne),ne._extremes={};var Ae=oe._subplots.polar||[];for(ee=0;ee<Ae.length;ee++)J.push(oe[Ae[ee]].radialaxis,oe[Ae[ee]].angularaxis);for(var ze in oe._colorAxes){var Re=oe[ze];Re.cauto!==!1&&(delete Re.cmin,delete Re.cmax)}var We=!1;function it(ut){if(ne=X[ut],j=ne._module,ne.visible===!0&&ne.transforms){if(j&&j.calc){var Me=j.calc(H,ne);Me[0]&&Me[0].t&&Me[0].t._scene&&delete Me[0].t._scene.dirty}for(re=0;re<ne.transforms.length;re++){var _e=ne.transforms[re];j=transformsRegistry[_e.type],j&&j.calcTransform&&(ne._hasCalcTransform=!0,We=!0,j.calcTransform(H,ne,_e))}}}function ot(ut,Me){if(ne=X[ut],j=ne._module,!!j.isContainer===Me){var _e=[];if(ne.visible===!0&&ne._length!==0){delete ne._indexToPoints;var fe=ne.transforms||[];for(re=fe.length-1;re>=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;ee<X.length;ee++)ot(ee,!0);for(ee=0;ee<X.length;ee++)it(ee);for(We&&se(J,X,oe),ee=0;ee<X.length;ee++)ot(ee,!0);for(ee=0;ee<X.length;ee++)ot(ee,!1);he(H);var tt=ue(J,H);if(tt.length){for(oe._numBoxes=0,oe._numViolins=0,ee=0;ee<tt.length;ee++)ot(tt[ee],!0);for(ee=0;ee<tt.length;ee++)ot(tt[ee],!1);he(H)}t.getComponentMethod("fx","calc")(H),t.getComponentMethod("errorbars","calc")(H)};var Q=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function ue(H,$){var J=[],X,oe,ne,j,ee;function re(Ir,bt,Be){var Ke=bt._id.charAt(0);if(Ir==="histogram2dcontour"){var Ue=bt._counterAxes[0],Ee=s.getFromId($,Ue),Ve=Ke==="x"||Ue==="x"&&Ee.type==="category",Ce=Ke==="y"||Ue==="y"&&Ee.type==="category";return function(Te,Pe){return Te===0||Pe===0||Ve&&Te===Be[Pe].length-1||Ce&&Pe===Be.length-1?-1:(Ke==="y"?Pe:Te)-1}}else return function(Te,Pe){return Ke==="y"?Pe:Te}}var ce={min:function(Ir){return a.aggNums(Math.min,null,Ir)},max:function(Ir){return a.aggNums(Math.max,null,Ir)},sum:function(Ir){return a.aggNums(function(bt,Be){return bt+Be},null,Ir)},total:function(Ir){return a.aggNums(function(bt,Be){return bt+Be},null,Ir)},mean:function(Ir){return a.mean(Ir)},"geometric mean":function(Ir){return a.geometricMean(Ir)},median:function(Ir){return a.median(Ir)}};function be(Ir,bt){return Ir[1]-bt[1]}function Ae(Ir,bt){return bt[1]-Ir[1]}for(X=0;X<H.length;X++){var ze=H[X];if(ze.type==="category"){var Re=ze.categoryorder.match(Q);if(Re){var We=Re[1],it=Re[2],ot=ze._id.charAt(0),tt=ot==="x",ut=[];for(oe=0;oe<ze._categories.length;oe++)ut.push([ze._categories[oe],[]]);for(oe=0;oe<ze._traceIndices.length;oe++){var Me=ze._traceIndices[oe],_e=$._fullData[Me];if(_e.visible===!0){var fe=_e.type;t.traceIs(_e,"histogram")&&(delete _e._xautoBinFinished,delete _e._yautoBinFinished);var Fe=fe==="splom",rt=fe==="scattergl",st=$.calcdata[Me];for(ne=0;ne<st.length;ne++){var Qe=st[ne],Lt,kt;if(Fe){var qt=_e._axesDim[ze._id];if(!tt){var Zt=_e._diag[qt][0];Zt&&(ze=$._fullLayout[s.id2name(Zt)])}var Sr=Qe.trace.dimensions[qt].values;for(j=0;j<Sr.length;j++)for(Lt=ze._categoriesMap[Sr[j]],ee=0;ee<Qe.trace.dimensions.length;ee++)if(ee!==qt){var xr=Qe.trace.dimensions[ee];ut[Lt][1].push(xr.values[j])}}else if(rt){for(j=0;j<Qe.t.x.length;j++)tt?(Lt=Qe.t.x[j],kt=Qe.t.y[j]):(Lt=Qe.t.y[j],kt=Qe.t.x[j]),ut[Lt][1].push(kt);Qe.t&&Qe.t._scene&&delete Qe.t._scene.dirty}else if(Qe.hasOwnProperty("z")){kt=Qe.z;var jr=re(_e.type,ze,kt);for(j=0;j<kt.length;j++)for(ee=0;ee<kt[j].length;ee++)Lt=jr(ee,j),Lt+1&&ut[Lt][1].push(kt[j][ee])}else for(Lt=Qe.p,Lt===void 0&&(Lt=Qe[ot]),kt=Qe.s,kt===void 0&&(kt=Qe.v),kt===void 0&&(kt=tt?Qe.y:Qe.x),Array.isArray(kt)||(kt===void 0?kt=[]:kt=[kt]),j=0;j<kt.length;j++)ut[Lt][1].push(kt[j])}}}ze._categoriesValue=ut;var wr=[];for(oe=0;oe<ut.length;oe++)wr.push([ut[oe][0],ce[We](ut[oe][1])]);wr.sort(it==="descending"?Ae:be),ze._categoriesAggregatedValue=wr,ze._initialCategories=wr.map(function(Ir){return Ir[0]}),J=J.concat(ze.sortByInitialCategories())}}}return J}function se(H,$,J){var X={};function oe(re){re.clearCalc(),re.type==="multicategory"&&re.setupMultiCategory($),X[re._id]=1}a.simpleMap(H,oe);for(var ne=J._axisMatchGroups||[],j=0;j<ne.length;j++)for(var ee in ne[j])X[ee]||oe(J[s.id2name(ee)])}function he(H){var $=H._fullLayout,J=$._visibleModules,X={},oe,ne,j;for(ne=0;ne<J.length;ne++){var ee=J[ne],re=ee.crossTraceCalc;if(re){var ce=ee.basePlotModule.name;X[ce]?a.pushUnique(X[ce],re):X[ce]=[re]}}for(j in X){var be=X[j],Ae=$._subplots[j];if(Array.isArray(Ae))for(oe=0;oe<Ae.length;oe++){var ze=Ae[oe],Re=j==="cartesian"?$._plots[ze]:$[ze];for(ne=0;ne<be.length;ne++)be[ne](H,Re,ze)}else for(ne=0;ne<be.length;ne++)be[ne](H)}}w.rehover=function(H){H._fullLayout._rehover&&H._fullLayout._rehover()},w.redrag=function(H){H._fullLayout._redrag&&H._fullLayout._redrag()},w.reselect=function(H){var $=H._fullLayout,J=(H.layout||{}).selections,X=$._previousSelections;$._previousSelections=J;var oe=$._reselect||JSON.stringify(J)!==JSON.stringify(X);t.getComponentMethod("selections","reselect")(H,oe)},w.generalUpdatePerTraceModule=function(H,$,J,X){var oe=$.traceHash,ne={},j;for(j=0;j<J.length;j++){var ee=J[j],re=ee[0].trace;re.visible&&(ne[re.type]=ne[re.type]||[],ne[re.type].push(ee))}for(var ce in oe)if(!ne[ce]){var be=oe[ce][0],Ae=be[0].trace;Ae.visible=!1,ne[ce]=[be]}for(var ze in ne){var Re=ne[ze],We=Re[0][0].trace._module;We.plot(H,$,a.filterVisible(Re),X)}$.traceHash=ne},w.plotBasePlot=function(H,$,J,X,oe){var ne=t.getModule(H),j=T($.calcdata,ne)[0];ne.plot($,j,X,oe)},w.cleanBasePlot=function(H,$,J,X,oe){var ne=oe._has&&oe._has(H),j=J._has&&J._has(H);ne&&!j&&oe["_"+H+"layer"].selectAll("g.trace").remove()}}}),vd=Ze({"src/constants/xmlns_namespaces.js"(Z){"use strict";Z.xmlns="http://www.w3.org/2000/xmlns/",Z.svg="http://www.w3.org/2000/svg",Z.xlink="http://www.w3.org/1999/xlink",Z.svgAttrs={xmlns:Z.svg,"xmlns:xlink":Z.xlink}}}),mh=Ze({"src/constants/alignment.js"(Z,q){"use strict";q.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}}),fu=Ze({"src/lib/svg_text_utils.js"(Z){"use strict";var q=Oi(),v=ca(),x=v.strTranslate,A=vd(),M=mh().LINE_SPACING,e=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;Z.convertToTspans=function(O,I,N){var U=O.text(),W=!O.attr("data-notex")&&I&&I._context.typesetMath&&typeof MathJax<"u"&&U.match(e),Q=q.select(O.node().parentNode);if(Q.empty())return;var ue=O.attr("class")?O.attr("class").split(" ")[0]:"text";ue+="-math",Q.selectAll("svg."+ue).remove(),Q.selectAll("g."+ue+"-group").remove(),O.style("display",null).attr({"data-unformatted":U,"data-math":"N"});function se(){Q.empty()||(ue=O.attr("class")+"-math",Q.select("svg."+ue).remove()),O.text("").style("white-space","pre");var he=L(O.node(),U);he&&O.style("pointer-events","all"),Z.positionText(O),N&&N.call(O)}return W?(I&&I._promises||[]).push(new Promise(function(he){O.style("display","none");var H=parseInt(O.node().style.fontSize,10),$={fontSize:H};n(W[2],$,function(J,X,oe){Q.selectAll("svg."+ue).remove(),Q.selectAll("g."+ue+"-group").remove();var ne=J&&J.select("svg");if(!ne||!ne.node()){se(),he();return}var j=Q.append("g").classed(ue+"-group",!0).attr({"pointer-events":"none","data-unformatted":U,"data-math":"Y"});j.node().appendChild(ne.node()),X&&X.node()&&ne.node().insertBefore(X.node().cloneNode(!0),ne.node().firstChild);var ee=oe.width,re=oe.height;ne.attr({class:ue,height:re,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var ce=O.node().style.fill||"black",be=ne.select("g");be.attr({fill:ce,stroke:ce});var Ae=be.node().getBoundingClientRect(),ze=Ae.width,Re=Ae.height;(ze>ee||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,_=/<br(\s+.*)?>/i;Z.BR_TAG_ALL=/<br(\s+.*)?>/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;$<ue.length;$++){var J=ue[$],X=J.match(l),oe=X&&X[2].toLowerCase();if(oe)U.indexOf(oe)!==-1&&(se.push(J),he=oe);else{var ne=J.length;if(H+ne<N)se.push(J),H+=ne;else if(H<N){var j=N-H;he&&(he!=="br"||j<=Q||ne<=Q)&&se.pop(),N>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<We.length;it++)se(We[it])}function se(Re){var We=Re.type,it={},ot;if(We==="a"){ot="a";var tt=Re.target,ut=Re.href,Me=Re.popup;ut&&(it={"xlink:xlink:show":tt==="_blank"||tt.charAt(0)!=="_"?"new":"replace",target:tt,"xlink:xlink:href":ut},Me&&(it.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+Me+'");return false;'))}else ot="tspan";Re.style&&(it.style=Re.style);var _e=document.createElementNS(A.svg,ot);if(We==="sup"||We==="sub"){he(W,h),W.appendChild(_e);var fe=document.createElementNS(A.svg,"tspan");he(fe,h),q.select(fe).attr("dy",c[We]),it.dy=s[We],W.appendChild(_e),W.appendChild(fe)}else W.appendChild(_e);q.select(_e).attr(it),W=Re.node=_e,U.push(Re)}function he(Re,We){Re.appendChild(document.createTextNode(We))}function H(Re){if(U.length===1){v.log("Ignoring unexpected end tag </"+Re+">.",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<J.length;X++){var oe=J[X],ne=oe.match(l),j=ne&&ne[2].toLowerCase(),ee=o[j];if(j==="br")ue();else if(ee===void 0)he(W,f(oe));else if(ne[1])H(j);else{var re=ne[4],ce={type:j},be=b(re,w);if(be?(be=be.replace(p,"$1 fill:"),ee&&(be+=";"+ee)):ee&&(be=ee),be&&(ce.style=be),j==="a"){N=!0;var Ae=b(re,S);if(Ae){var ze=z(Ae);ze&&(ce.href=ze,ce.target=b(re,E)||"_blank",ce.popup=b(re,g))}}se(ce)}}return N}function z(O){var I=encodeURI(decodeURI(O)),N=document.createElement("a"),U=document.createElement("a");N.href=O,U.href=I;var W=N.protocol,Q=U.protocol;return m.indexOf(W)!==-1&&m.indexOf(Q)!==-1?I:""}Z.sanitizeHTML=function(I){I=I.replace(d," ");for(var N=document.createElement("p"),U=N,W=[],Q=I.split(T),ue=0;ue<Q.length;ue++){var se=Q[ue],he=se.match(l),H=he&&he[2].toLowerCase();if(H in o)if(he[1])W.length&&(U=W.pop());else{var $=he[4],J=b($,w),X=J?{style:J}:{};if(H==="a"){var oe=b($,S);if(oe){var ne=z(oe);if(ne){X.href=ne;var j=b($,E);j&&(X.target=j)}}}var ee=document.createElement(H);U.appendChild(ee),q.select(ee).attr(X),U=ee,W.push(ee)}else U.appendChild(document.createTextNode(f(se)))}var re="innerHTML";return N[re]},Z.lineCount=function(I){return I.selectAll("tspan.line").size()||1},Z.positionText=function(I,N,U){return I.each(function(){var W=q.select(this);function Q(he,H){return H===void 0?(H=W.attr(he),H===null&&(W.attr(he,0),H=0)):W.attr(he,H),H}var ue=Q("x",N),se=Q("y",U);this.nodeName==="text"&&W.selectAll("tspan.line").attr({x:ue,y:se})})};function F(O,I,N){var U=N.horizontalAlign,W=N.verticalAlign||"top",Q=O.node().getBoundingClientRect(),ue=I.node().getBoundingClientRect(),se,he,H;return W==="bottom"?he=function(){return Q.bottom-se.height}:W==="middle"?he=function(){return Q.top+(Q.height-se.height)/2}:he=function(){return Q.top},U==="right"?H=function(){return Q.right-se.width}:U==="center"?H=function(){return Q.left+(Q.width-se.width)/2}:H=function(){return Q.left},function(){se=this.node().getBoundingClientRect();var $=H()-ue.left,J=he()-ue.top,X=N.gd||{};if(N.gd){X._fullLayout._calcInverseTransform(X);var oe=v.apply3DTransform(X._fullLayout._invTransform)($,J);$=oe[0],J=oe[1]}return this.style({top:J+"px",left:$+"px","z-index":1e3}),this}}var B="1px ";Z.makeTextShadow=function(O){var I=B,N=B,U=B;return I+N+U+O+", -"+I+"-"+N+U+O+", "+I+"-"+N+U+O+", -"+I+N+U+O},Z.makeEditable=function(O,I){var N=I.gd,U=I.delegate,W=q.dispatch("edit","input","cancel"),Q=U||O;if(O.style({"pointer-events":U?"none":"all"}),O.size()!==1)throw new Error("boo");function ue(){he(),O.style({opacity:0});var H=Q.attr("class"),$;H?$="."+H.split(" ")[0]+"-math-group":$="[class*=-math-group]",$&&q.select(O.node().parentNode).select($).style({opacity:0})}function se(H){var $=H.node(),J=document.createRange();J.selectNodeContents($);var X=window.getSelection();X.removeAllRanges(),X.addRange(J),$.focus()}function he(){var H=q.select(N),$=H.select(".svg-container"),J=$.append("div"),X=O.node().style,oe=parseFloat(X.fontSize||12),ne=I.text;ne===void 0&&(ne=O.attr("data-unformatted")),J.classed("plugin-editable editable",!0).style({position:"absolute","font-family":X.fontFamily||"Arial","font-size":oe,color:I.fill||X.fill||"black",opacity:1,"background-color":I.background||"transparent",outline:"#ffffff33 1px solid",margin:[-oe/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(ne).call(F(O,$,I)).on("blur",function(){N._editing=!1,O.text(this.textContent).style({opacity:1});var j=q.select(this).attr("class"),ee;j?ee="."+j.split(" ")[0]+"-math-group":ee="[class*=-math-group]",ee&&q.select(O.node().parentNode).select(ee).style({opacity:0});var re=this.textContent;q.select(this).transition().duration(0).remove(),q.select(document).on("mouseup",null),W.edit.call(O,re)}).on("focus",function(){var j=this;N._editing=!0,q.select(document).on("mouseup",function(){if(q.event.target===j)return!1;document.activeElement===J.node()&&J.node().blur()})}).on("keyup",function(){q.event.which===27?(N._editing=!1,O.style({opacity:1}),q.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),W.cancel.call(O,this.textContent)):(W.input.call(O,this.textContent),q.select(this).call(F(O,$,I)))}).on("keydown",function(){q.event.which===13&&this.blur()}).call(se)}return I.immediate?ue():Q.on("click",ue),q.rebind(O,W,"on")}}}),Up=Ze({"src/components/colorscale/helpers.js"(Z,q){"use strict";var v=Oi(),x=Ch(),A=is(),M=ca(),e=Yi(),t=Gg().isValid;function r(d,T,l){var _=T?M.nestedProperty(d,T).get()||{}:d,w=_[l||"color"];w&&w._inputArray&&(w=w._inputArray);var S=!1;if(M.isArrayOrTypedArray(w)){for(var E=0;E<w.length;E++)if(A(w[E])){S=!0;break}}return M.isPlainObject(_)&&(S||_.showscale===!0||A(_.cmin)&&A(_.cmax)||t(_.colorscale)||M.isPlainObject(_.colorbar))}var i=["showscale","autocolorscale","colorscale","reversescale","colorbar"],a=["min","max","mid","auto"];function n(d){var T=d._colorAx,l=T||d,_={},w,S,E;for(S=0;S<i.length;S++)E=i[S],_[E]=l[E];if(T)for(w="c",S=0;S<a.length;S++)E=a[S],_[E]=l["c"+E];else{var g;for(S=0;S<a.length;S++){if(E=a[S],g="c"+E,g in l){_[E]=l[g];continue}g="z"+E,g in l&&(_[E]=l[g])}w=g.charAt(0)}return _._sync=function(b,p){var u=a.indexOf(b)!==-1?w+b:b;l[u]=l["_"+u]=p},_}function o(d){for(var T=n(d),l=T.min,_=T.max,w=T.reversescale?s(T.colorscale):T.colorscale,S=w.length,E=new Array(S),g=new Array(S),b=0;b<S;b++){var p=w[b];E[b]=l+p[0]*(_-l),g[b]=p[1]}return{domain:E,range:g}}function s(d){for(var T=d.length,l=new Array(T),_=T-1,w=0;_>=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;E<w;E++){var g=x(_[E]).toRgb();S[E]=[g.r,g.g,g.b,g.a]}var b=v.scale.linear().domain(l).range(S).clamp(!0),p=T.noNumericCheck,u=T.returnArray,y;return p&&u?y=b:p?y=function(f){return m(b(f))}:u?y=function(f){return A(f)?b(f):x(f).isValid()?f:e.defaultLine}:y=function(f){return A(f)?m(b(f)):x(f).isValid()?f:e.defaultLine},y.domain=b.domain,y.range=function(){return _},y}function h(d,T){return c(o(d),T)}function m(d){var T={r:d[0],g:d[1],b:d[2],a:d[3]};return x(T).toRgbString()}q.exports={hasColorscale:r,extractOpts:n,extractScale:o,flipScale:s,makeColorScaleFunc:c,makeColorScaleFuncFromTrace:h}}}),Qc=Ze({"src/plots/cartesian/axis_format_attributes.js"(Z,q){"use strict";var v=tS(),x=v.FORMAT_LINK,A=v.DATE_FORMAT_LINK;function M(r,i){return{valType:"string",dflt:"",editType:"none",description:(i?e:t)("hover text",r)+["By default the values are formatted using "+(i?"generic number format":"`"+r+"axis.hoverformat`")+"."].join(" ")}}function e(r,i){return["Sets the "+r+" formatting rule"+(i?"for `"+i+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+x+"."].join(" ")}function t(r,i){return e(r,i)+[" And for dates see: "+A+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}q.exports={axisHoverFormat:M,descriptionOnlyNumbers:e,descriptionWithDates:t}}}),Wh=Ze({"src/plots/cartesian/layout_attributes.js"(Z,q){"use strict";var v=tc(),x=oh(),A=Gh().dash,M=rs().extendFlat,e=Dl().templatedArray,t=Cs().templateFormatStringDescription,r=Qc().descriptionWithDates,i=Vs().ONEDAY,a=kh(),n=a.HOUR_PATTERN,o=a.WEEKDAY_PATTERN,s={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},c=M({},s,{values:s.values.slice().concat(["sync"])});function h(u){return{valType:"integer",min:0,dflt:u?5:0,editType:"ticks"}}var m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},d={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},T={valType:"data_array",editType:"ticks"},l={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function _(u){var y={valType:"number",min:0,editType:"ticks"};return u||(y.dflt=5),y}function w(u){var y={valType:"number",min:0,editType:"ticks"};return u||(y.dflt=1),y}var S={valType:"color",dflt:x.defaultLine,editType:"ticks"},E={valType:"color",dflt:x.lightLine,editType:"ticks"};function g(u){var y={valType:"number",min:0,editType:"ticks"};return u||(y.dflt=1),y}var b=M({},A,{editType:"ticks"}),p={valType:"boolean",editType:"ticks"};q.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:x.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:v({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[a.idRegex.x.toString(),a.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[a.idRegex.x.toString(),a.idRegex.y.toString()],editType:"calc"},rangebreaks:e("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[o,n,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:i},editType:"calc"}),tickmode:c,nticks:h(),tick0:m,dtick:d,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:T,ticktext:{valType:"data_array",editType:"ticks"},ticks:l,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:_(),tickwidth:w(),tickcolor:S,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:M({},A,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:v({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:r("tick label")},tickformatstops:e("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:r("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:x.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:p,gridcolor:E,gridwidth:g(),griddash:b,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:x.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:x.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",a.idRegex.x.toString(),a.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",a.idRegex.x.toString(),a.idRegex.y.toString()],editType:"plot"},minor:{tickmode:s,nticks:h("minor"),tick0:m,dtick:d,tickvals:T,ticks:l,ticklen:_("minor"),tickwidth:w("minor"),tickcolor:S,gridcolor:E,gridwidth:g("minor"),griddash:b,showgrid:p,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),_2=Ze({"src/components/colorbar/attributes.js"(Z,q){"use strict";var v=Wh(),x=tc(),A=rs().extendFlat,M=pc().overrideAll;q.exports=M({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:v.linecolor,outlinewidth:v.linewidth,bordercolor:v.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:v.minor.tickmode,nticks:v.nticks,tick0:v.tick0,dtick:v.dtick,tickvals:v.tickvals,ticktext:v.ticktext,ticks:A({},v.ticks,{dflt:""}),ticklabeloverflow:A({},v.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:v.ticklen,tickwidth:v.tickwidth,tickcolor:v.tickcolor,ticklabelstep:v.ticklabelstep,showticklabels:v.showticklabels,labelalias:v.labelalias,tickfont:x({}),tickangle:v.tickangle,tickformat:v.tickformat,tickformatstops:v.tickformatstops,tickprefix:v.tickprefix,showtickprefix:v.showtickprefix,ticksuffix:v.ticksuffix,showticksuffix:v.showticksuffix,separatethousands:v.separatethousands,exponentformat:v.exponentformat,minexponent:v.minexponent,showexponent:v.showexponent,title:{text:{valType:"string"},font:x({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}}),Mu=Ze({"src/components/colorscale/attributes.js"(Z,q){"use strict";var v=_2(),x=Jy().counter,A=Km(),M=Gg().scales,e=A(M);function t(r){return"`"+r+"`"}q.exports=function(i,a){i=i||"",a=a||{};var n=a.cLetter||"c",o="onlyIfNumerical"in a?a.onlyIfNumerical:!!i,s="noScale"in a?a.noScale:i==="marker.line",c="showScaleDflt"in a?a.showScaleDflt:n==="z",h=typeof a.colorscaleDflt=="string"?M[a.colorscaleDflt]:null,m=a.editTypeOverride||"",d=i?i+".":"",T,l;"colorAttr"in a?(T=a.colorAttr,l=a.colorAttr):(T={z:"z",c:"color"}[n],l="in "+t(d+T));var _=o?" Has an effect only if "+l+" is set to a numerical array.":"",w=n+"auto",S=n+"min",E=n+"max",g=n+"mid",b=t(d+w),p=t(d+S),u=t(d+E),y=p+" and "+u,f={};f[S]=f[E]=void 0;var P={};P[w]=!1;var L={};return T==="color"&&(L.color={valType:"color",arrayOk:!0,editType:m||"style"},a.anim&&(L.color.anim=!0)),L[w]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:f},L[S]={valType:"number",dflt:null,editType:m||"plot",impliedEdits:P},L[E]={valType:"number",dflt:null,editType:m||"plot",impliedEdits:P},L[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:f},L.colorscale={valType:"colorscale",editType:"calc",dflt:h,impliedEdits:{autocolorscale:!1}},L.autocolorscale={valType:"boolean",dflt:a.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},L.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(L.showscale={valType:"boolean",dflt:c,editType:"calc"},L.colorbar=v),a.noColorAxis||(L.coloraxis={valType:"subplotid",regex:x("coloraxis"),dflt:null,editType:"calc"}),L}}}),oS=Ze({"src/components/colorscale/layout_attributes.js"(Z,q){"use strict";var v=rs().extendFlat,x=Mu(),A=Gg().scales;q.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:A.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:A.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:A.RdBu,editType:"calc"}},coloraxis:v({_isSubplotObj:!0,editType:"calc"},x("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}}),sS=Ze({"src/components/colorbar/has_colorbar.js"(Z,q){"use strict";var v=ca();q.exports=function(A){return v.isPlainObject(A.colorbar)}}}),lS=Ze({"src/plots/cartesian/clean_ticks.js"(Z){"use strict";var q=is(),v=ca(),x=Vs(),A=x.ONEDAY,M=x.ONEWEEK;Z.dtick=function(e,t){var r=t==="log",i=t==="date",a=t==="category",n=i?A:1;if(!e)return n;if(q(e))return e=Number(e),e<=0?n:a?Math.max(1,Math.round(e)):i?Math.max(.1,e):e;if(typeof e!="string"||!(i||r))return n;var o=e.charAt(0),s=e.substr(1);return s=q(s)?Number(s):0,s<=0||!(i&&o==="M"&&s===Math.round(s)||r&&o==="L"||r&&o==="D"&&(s===1||s===2))?n:e},Z.tick0=function(e,t,r,i){if(t==="date")return v.cleanDate(e,v.dateTick0(r,i%M===0?1:0));if(!(i==="D1"||i==="D2"))return q(e)?Number(e):0}}}),Xg=Ze({"src/plots/cartesian/tick_value_defaults.js"(Z,q){"use strict";var v=lS(),x=ca().isArrayOrTypedArray,A=xp().isTypedArraySpec,M=xp().decodeTypedArraySpec;q.exports=function(t,r,i,a,n){n||(n={});var o=n.isMinor,s=o?t.minor||{}:t,c=o?r.minor:r,h=o?"minor.":"";function m(g){var b=s[g];return A(b)&&(b=M(b)),b!==void 0?b:(c._template||{})[g]}var d=m("tick0"),T=m("dtick"),l=m("tickvals"),_=x(l)?"array":T?"linear":"auto",w=i(h+"tickmode",_);if(w==="auto"||w==="sync")i(h+"nticks");else if(w==="linear"){var S=c.dtick=v.dtick(T,a);c.tick0=v.tick0(d,a,r.calendar,S)}else if(a!=="multicategory"){var E=i(h+"tickvals");E===void 0?c.tickmode="auto":o||i("ticktext")}}}}),t1=Ze({"src/plots/cartesian/tick_mark_defaults.js"(Z,q){"use strict";var v=ca(),x=Wh();q.exports=function(M,e,t,r){var i=r.isMinor,a=i?M.minor||{}:M,n=i?e.minor:e,o=i?x.minor:x,s=i?"minor.":"",c=v.coerce2(a,n,o,"ticklen",i?(e.ticklen||5)*.6:void 0),h=v.coerce2(a,n,o,"tickwidth",i?e.tickwidth||1:void 0),m=v.coerce2(a,n,o,"tickcolor",(i?e.tickcolor:void 0)||n.color),d=t(s+"ticks",!i&&r.outerTicks||c||h||m?"outside":"");d||(delete n.ticklen,delete n.tickwidth,delete n.tickcolor)}}}),uS=Ze({"src/plots/cartesian/show_dflt.js"(Z,q){"use strict";q.exports=function(x){var A=["showexponent","showtickprefix","showticksuffix"],M=A.filter(function(t){return x[t]!==void 0}),e=function(t){return x[t]===x[M[0]]};if(M.every(e)||M.length===1)return x[M[0]]}}}),fp=Ze({"src/plots/array_container_defaults.js"(Z,q){"use strict";var v=ca(),x=Dl();q.exports=function(M,e,t){var r=t.name,i=t.inclusionAttr||"visible",a=e[r],n=v.isArrayOrTypedArray(M[r])?M[r]:[],o=e[r]=[],s=x.arrayTemplater(e,r,i),c,h;for(c=0;c<n.length;c++){var m=n[c];v.isPlainObject(m)?h=s.newItem(m):(h=s.newItem({}),h[i]=!1),h._index=c,h[i]!==!1&&t.handleItemDefaults(m,h,e,t),o.push(h)}var d=s.defaultItems();for(c=0;c<d.length;c++)h=d[c],h._index=o.length,t.handleItemDefaults({},h,e,t,{}),o.push(h);if(v.isArrayOrTypedArray(a)){var T=Math.min(a.length,o.length);for(c=0;c<T;c++)v.relinkPrivateKeys(o[c],a[c])}return o}}}),$m=Ze({"src/plots/cartesian/tick_label_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi().contrast,A=Wh(),M=uS(),e=fp();q.exports=function(i,a,n,o,s){s||(s={});var c=n("labelalias");v.isPlainObject(c)||delete a.labelalias;var h=M(i),m=n("showticklabels");if(m){s.noTicklabelshift||n("ticklabelshift"),s.noTicklabelstandoff||n("ticklabelstandoff");var d=s.font||{},T=a.color,l=a.ticklabelposition||"",_=l.indexOf("inside")!==-1?x(s.bgColor):T&&T!==A.color.dflt?T:d.color;if(v.coerceFont(n,"tickfont",d,{overrideDflt:{color:_}}),!s.noTicklabelstep&&o!=="multicategory"&&o!=="log"&&n("ticklabelstep"),!s.noAng){var w=n("tickangle");!s.noAutotickangles&&w==="auto"&&n("autotickangles")}if(o!=="category"){var S=n("tickformat");e(i,a,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:t}),a.tickformatstops.length||delete a.tickformatstops,!s.noExp&&!S&&o!=="date"&&(n("showexponent",h),n("exponentformat"),n("minexponent"),n("separatethousands"))}!s.noMinorloglabels&&o==="log"&&n("minorloglabels")}};function t(r,i){function a(o,s){return v.coerce(r,i,A.tickformatstops,o,s)}var n=a("enabled");n&&(a("dtickrange"),a("value"))}}}),Qm=Ze({"src/plots/cartesian/prefix_suffix_defaults.js"(Z,q){"use strict";var v=uS();q.exports=function(A,M,e,t,r){r||(r={});var i=r.tickSuffixDflt,a=v(A),n=e("tickprefix");n&&e("showtickprefix",a);var o=e("ticksuffix",i);o&&e("showticksuffix",a)}}}),cS=Ze({"src/components/colorbar/defaults.js"(Z,q){"use strict";var v=ca(),x=Dl(),A=Xg(),M=t1(),e=$m(),t=Qm(),r=_2();q.exports=function(a,n,o){var s=x.newContainer(n,"colorbar"),c=a.colorbar||{};function h(I,N){return v.coerce(c,s,r,I,N)}var m=o.margin||{t:0,b:0,l:0,r:0},d=o.width-m.l-m.r,T=o.height-m.t-m.b,l=h("orientation"),_=l==="v",w=h("thicknessmode");h("thickness",w==="fraction"?30/(_?d:T):30);var S=h("lenmode");h("len",S==="fraction"?1:_?T:d);var E=h("yref"),g=h("xref"),b=E==="paper",p=g==="paper",u,y,f,P="left";_?(f="middle",P=p?"left":"right",u=p?1.02:1,y=.5):(f=b?"bottom":"top",P="center",u=.5,y=b?1.02:1),v.coerce(c,s,{x:{valType:"number",min:p?-2:0,max:p?3:1,dflt:u}},"x"),v.coerce(c,s,{y:{valType:"number",min:b?-2:0,max:b?3:1,dflt:y}},"y"),h("xanchor",P),h("xpad"),h("yanchor",f),h("ypad"),v.noneOrAll(c,s,["x","y"]),h("outlinecolor"),h("outlinewidth"),h("bordercolor"),h("borderwidth"),h("bgcolor");var L=v.coerce(c,s,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:_?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");h("ticklabeloverflow",L.indexOf("inside")!==-1?"hide past domain":"hide past div"),A(c,s,h,"linear");var z=o.font,F={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:z};L.indexOf("inside")!==-1&&(F.bgColor="black"),t(c,s,h,"linear",F),e(c,s,h,"linear",F),M(c,s,h,"linear",F),h("title.text",o._dfltTitle.colorbar);var B=s.showticklabels?s.tickfont:z,O=v.extendFlat({},z,{family:B.family,size:v.bigFont(B.size)});v.coerceFont(h,"title.font",O),h("title.side",_?"top":"right")}}}),gh=Ze({"src/components/colorscale/defaults.js"(Z,q){"use strict";var v=is(),x=ca(),A=sS(),M=cS(),e=Gg().isValid,t=oo().traceIs;function r(i,a){var n=a.slice(0,a.length-1);return a?x.nestedProperty(i,n).get()||{}:i}q.exports=function i(a,n,o,s,c){var h=c.prefix,m=c.cLetter,d="_module"in n,T=r(a,h),l=r(n,h),_=r(n._template||{},h)||{},w=function(){return delete a.coloraxis,delete n.coloraxis,i(a,n,o,s,c)};if(d){var S=o._colorAxes||{},E=s(h+"coloraxis");if(E){var g=t(n,"contour")&&x.nestedProperty(n,"contours.coloring").get()||"heatmap",b=S[E];b?(b[2].push(w),b[0]!==g&&(b[0]=!1,x.warn(["Ignoring coloraxis:",E,"setting","as it is linked to incompatible colorscales."].join(" ")))):S[E]=[g,n,[w]];return}}var p=T[m+"min"],u=T[m+"max"],y=v(p)&&v(u)&&p<u,f=s(h+m+"auto",!y);f?s(h+m+"mid"):(s(h+m+"min"),s(h+m+"max"));var P=T.colorscale,L=_.colorscale,z;if(P!==void 0&&(z=!e(P)),L!==void 0&&(z=!e(L)),s(h+"autocolorscale",z),s(h+"colorscale"),s(h+"reversescale"),h!=="marker.line."){var F;h&&d&&(F=A(T));var B=s(h+"showscale",F);B&&(h&&_&&(l._template=_),M(T,l,o))}}}}),iO=Ze({"src/components/colorscale/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=Dl(),A=oS(),M=gh();q.exports=function(t,r){function i(d,T){return v.coerce(t,r,A,d,T)}i("colorscale.sequential"),i("colorscale.sequentialminus"),i("colorscale.diverging");var a=r._colorAxes,n,o;function s(d,T){return v.coerce(n,o,A.coloraxis,d,T)}for(var c in a){var h=a[c];if(h[0])n=t[c]||{},o=x.newContainer(r,c,"coloraxis"),o._name=c,M(n,o,r,s,{prefix:"",cLetter:"c"});else{for(var m=0;m<h[2].length;m++)h[2][m]();delete r._colorAxes[c]}}}}}),oO=Ze({"src/components/colorscale/cross_trace_defaults.js"(Z,q){"use strict";var v=ca(),x=Up().hasColorscale,A=Up().extractOpts;q.exports=function(e,t){function r(h,m){var d=h["_"+m];d!==void 0&&(h[m]=d)}function i(h,m){var d=m.container?v.nestedProperty(h,m.container).get():h;if(d)if(d.coloraxis)d._colorAx=t[d.coloraxis];else{var T=A(d),l=T.auto;(l||T.min===void 0)&&r(d,m.min),(l||T.max===void 0)&&r(d,m.max),T.autocolorscale&&r(d,"colorscale")}}for(var a=0;a<e.length;a++){var n=e[a],o=n._module.colorbar;if(o)if(Array.isArray(o))for(var s=0;s<o.length;s++)i(n,o[s]);else i(n,o);x(n,"marker.line")&&i(n,{container:"marker.line",min:"cmin",max:"cmax"})}for(var c in t._colorAxes)i(t[c],{min:"cmin",max:"cmax"})}}}),jp=Ze({"src/components/colorscale/calc.js"(Z,q){"use strict";var v=is(),x=ca(),A=Up().extractOpts;q.exports=function(e,t,r){var i=e._fullLayout,a=r.vals,n=r.containerStr,o=n?x.nestedProperty(t,n).get():t,s=A(o),c=s.auto!==!1,h=s.min,m=s.max,d=s.mid,T=function(){return x.aggNums(Math.min,null,a)},l=function(){return x.aggNums(Math.max,null,a)};if(h===void 0?h=T():c&&(o._colorAx&&v(h)?h=Math.min(h,T()):h=T()),m===void 0?m=l():c&&(o._colorAx&&v(m)?m=Math.max(m,l()):m=l()),c&&d!==void 0&&(m-d>d-h?h=d-(m-d):m-d<d-h&&(m=d+(d-h))),h===m&&(h-=.5,m+=.5),s._sync("min",h),s._sync("max",m),s.autocolorscale){var _;h*m<0?_=i.colorscale.diverging:h>=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<i.length;n++)for(var o=0;o<a.length;o++)if(r.indexOf(i[n]+a[o])!==-1)return!0;return!1}return r.indexOf(Z.getSubplot(t))!==-1},Z.flat=function(t,r){for(var i=new Array(t.length),a=0;a<t.length;a++)i[a]=r;return i},Z.p2c=function(t,r){for(var i=new Array(t.length),a=0;a<t.length;a++)i[a]=t[a].p2c(r);return i},Z.getDistanceFunction=function(t,r,i,a){return t==="closest"?a||Z.quadrature(r,i):t.charAt(0)==="x"?r:i},Z.getClosest=function(t,r,i){if(i.index!==!1)i.index>=0&&i.index<t.length?i.distance=0:i.index=!1;else for(var a=1/0,n=t.length,o=0;o<n;o++)a=r(t[o]),a<=i.distance&&(i.index=o,i.distance=a);return i},Z.inbox=function(t,r,i){return t*r<0||t===0?i:1/0},Z.quadrature=function(t,r){return function(i){var a=t(i),n=r(i);return Math.sqrt(a*a+n*n)}},Z.makeEventData=function(t,r,i){var a="index"in t?t.index:t.pointNumber,n={data:r._input,fullData:r,curveNumber:r.index,pointNumber:a};if(r._indexToPoints){var o=r._indexToPoints[a];o.length===1?n.pointIndex=o[0]:n.pointIndices=o}else n.pointIndex=a;return r._module.eventData?n=r._module.eventData(n,t,r,i,a):("xVal"in t?n.x=t.xVal:"x"in t&&(n.x=t.x),"yVal"in t?n.y=t.yVal:"y"in t&&(n.y=t.y),t.xa&&(n.xaxis=t.xa),t.ya&&(n.yaxis=t.ya),t.zLabelVal!==void 0&&(n.z=t.zLabelVal)),Z.appendArrayPointValue(n,r,a),n},Z.appendArrayPointValue=function(t,r,i){var a=r._arrayAttrs;if(a)for(var n=0;n<a.length;n++){var o=a[n],s=x(o);if(t[s]===void 0){var c=q.nestedProperty(r,o).get(),h=A(c,i);h!==void 0&&(t[s]=h)}}},Z.appendArrayMultiPointValues=function(t,r,i){var a=r._arrayAttrs;if(a)for(var n=0;n<a.length;n++){var o=a[n],s=x(o);if(t[s]===void 0){for(var c=q.nestedProperty(r,o).get(),h=new Array(i.length),m=0;m<i.length;m++)h[m]=A(c,i[m]);t[s]=h}}};var v={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function x(t){return v[t]||t}function A(t,r){if(Array.isArray(r)){if(Array.isArray(t)&&Array.isArray(t[r[0]]))return t[r[0]][r[1]]}else return t[r]}var M={x:!0,y:!0},e={"x unified":!0,"y unified":!0};Z.isUnifiedHover=function(t){return typeof t!="string"?!1:!!e[t]},Z.isXYhover=function(t){return typeof t!="string"?!1:!!M[t]}}}),M_=Ze({"node_modules/parse-svg-path/index.js"(Z,q){q.exports=A;var v={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},x=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function A(t){var r=[];return t.replace(x,function(i,a,n){var o=a.toLowerCase();for(n=e(n),o=="m"&&n.length>2&&(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.length<v[o])throw new Error("malformed path data");r.push([a].concat(n.splice(0,v[o])))}}),r}var M=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function e(t){var r=t.match(M);return r?r.map(Number):[]}}}),sO=Ze({"src/components/drawing/symbol_defs.js"(Z,q){"use strict";var v=M_(),x=function(m,d){return d?Math.round(m*(d=Math.pow(10,d)))/d:Math.round(m)},A="M0,0Z",M=Math.sqrt(2),e=Math.sqrt(3),t=Math.PI,r=Math.cos,i=Math.sin;q.exports={circle:{n:0,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_="M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z";return T?h(d,T,_):_}},square:{n:1,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")}},diamond:{n:2,f:function(m,d,T){if(a(d))return A;var l=x(m*1.3,2);return h(d,T,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"Z")}},cross:{n:3,f:function(m,d,T){if(a(d))return A;var l=x(m*.4,2),_=x(m*1.2,2);return h(d,T,"M"+_+","+l+"H"+l+"V"+_+"H-"+l+"V"+l+"H-"+_+"V-"+l+"H-"+l+"V-"+_+"H"+l+"V-"+l+"H"+_+"Z")}},x:{n:4,f:function(m,d,T){if(a(d))return A;var l=x(m*.8/M,2),_="l"+l+","+l,w="l"+l+",-"+l,S="l-"+l+",-"+l,E="l-"+l+","+l;return h(d,T,"M0,"+l+_+w+S+w+S+E+S+E+_+E+_+"Z")}},"triangle-up":{n:5,f:function(m,d,T){if(a(d))return A;var l=x(m*2/e,2),_=x(m/2,2),w=x(m,2);return h(d,T,"M-"+l+","+_+"H"+l+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(m,d,T){if(a(d))return A;var l=x(m*2/e,2),_=x(m/2,2),w=x(m,2);return h(d,T,"M-"+l+",-"+_+"H"+l+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(m,d,T){if(a(d))return A;var l=x(m*2/e,2),_=x(m/2,2),w=x(m,2);return h(d,T,"M"+_+",-"+l+"V"+l+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(m,d,T){if(a(d))return A;var l=x(m*2/e,2),_=x(m/2,2),w=x(m,2);return h(d,T,"M-"+_+",-"+l+"V"+l+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(m,d,T){if(a(d))return A;var l=x(m*.6,2),_=x(m*1.2,2);return h(d,T,"M-"+_+",-"+l+"H"+l+"V"+_+"Z")}},"triangle-se":{n:10,f:function(m,d,T){if(a(d))return A;var l=x(m*.6,2),_=x(m*1.2,2);return h(d,T,"M"+l+",-"+_+"V"+l+"H-"+_+"Z")}},"triangle-sw":{n:11,f:function(m,d,T){if(a(d))return A;var l=x(m*.6,2),_=x(m*1.2,2);return h(d,T,"M"+_+","+l+"H-"+l+"V-"+_+"Z")}},"triangle-nw":{n:12,f:function(m,d,T){if(a(d))return A;var l=x(m*.6,2),_=x(m*1.2,2);return h(d,T,"M-"+l+","+_+"V-"+l+"H"+_+"Z")}},pentagon:{n:13,f:function(m,d,T){if(a(d))return A;var l=x(m*.951,2),_=x(m*.588,2),w=x(-m,2),S=x(m*-.309,2),E=x(m*.809,2);return h(d,T,"M"+l+","+S+"L"+_+","+E+"H-"+_+"L-"+l+","+S+"L0,"+w+"Z")}},hexagon:{n:14,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m/2,2),w=x(m*e/2,2);return h(d,T,"M"+w+",-"+_+"V"+_+"L0,"+l+"L-"+w+","+_+"V-"+_+"L0,-"+l+"Z")}},hexagon2:{n:15,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m/2,2),w=x(m*e/2,2);return h(d,T,"M-"+_+","+w+"H"+_+"L"+l+",0L"+_+",-"+w+"H-"+_+"L-"+l+",0Z")}},octagon:{n:16,f:function(m,d,T){if(a(d))return A;var l=x(m*.924,2),_=x(m*.383,2);return h(d,T,"M-"+_+",-"+l+"H"+_+"L"+l+",-"+_+"V"+_+"L"+_+","+l+"H-"+_+"L-"+l+","+_+"V-"+_+"Z")}},star:{n:17,f:function(m,d,T){if(a(d))return A;var l=m*1.4,_=x(l*.225,2),w=x(l*.951,2),S=x(l*.363,2),E=x(l*.588,2),g=x(-l,2),b=x(l*-.309,2),p=x(l*.118,2),u=x(l*.809,2),y=x(l*.382,2);return h(d,T,"M"+_+","+b+"H"+w+"L"+S+","+p+"L"+E+","+u+"L0,"+y+"L-"+E+","+u+"L-"+S+","+p+"L-"+w+","+b+"H-"+_+"L0,"+g+"Z")}},hexagram:{n:18,f:function(m,d,T){if(a(d))return A;var l=x(m*.66,2),_=x(m*.38,2),w=x(m*.76,2);return h(d,T,"M-"+w+",0l-"+_+",-"+l+"h"+w+"l"+_+",-"+l+"l"+_+","+l+"h"+w+"l-"+_+","+l+"l"+_+","+l+"h-"+w+"l-"+_+","+l+"l-"+_+",-"+l+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(m,d,T){if(a(d))return A;var l=x(m*e*.8,2),_=x(m*.8,2),w=x(m*1.6,2),S=x(m*4,2),E="A "+S+","+S+" 0 0 1 ";return h(d,T,"M-"+l+","+_+E+l+","+_+E+"0,-"+w+E+"-"+l+","+_+"Z")}},"star-triangle-down":{n:20,f:function(m,d,T){if(a(d))return A;var l=x(m*e*.8,2),_=x(m*.8,2),w=x(m*1.6,2),S=x(m*4,2),E="A "+S+","+S+" 0 0 1 ";return h(d,T,"M"+l+",-"+_+E+"-"+l+",-"+_+E+"0,"+w+E+l+",-"+_+"Z")}},"star-square":{n:21,f:function(m,d,T){if(a(d))return A;var l=x(m*1.1,2),_=x(m*2,2),w="A "+_+","+_+" 0 0 1 ";return h(d,T,"M-"+l+",-"+l+w+"-"+l+","+l+w+l+","+l+w+l+",-"+l+w+"-"+l+",-"+l+"Z")}},"star-diamond":{n:22,f:function(m,d,T){if(a(d))return A;var l=x(m*1.4,2),_=x(m*1.9,2),w="A "+_+","+_+" 0 0 1 ";return h(d,T,"M-"+l+",0"+w+"0,"+l+w+l+",0"+w+"0,-"+l+w+"-"+l+",0Z")}},"diamond-tall":{n:23,f:function(m,d,T){if(a(d))return A;var l=x(m*.7,2),_=x(m*1.4,2);return h(d,T,"M0,"+_+"L"+l+",0L0,-"+_+"L-"+l+",0Z")}},"diamond-wide":{n:24,f:function(m,d,T){if(a(d))return A;var l=x(m*1.4,2),_=x(m*.7,2);return h(d,T,"M0,"+_+"L"+l+",0L0,-"+_+"L-"+l+",0Z")}},hourglass:{n:25,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"H-"+l+"L"+l+",-"+l+"H-"+l+"Z")},noDot:!0},bowtie:{n:26,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"V-"+l+"L-"+l+","+l+"V-"+l+"Z")},noDot:!0},"circle-cross":{n:27,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m/M,2);return h(d,T,"M"+_+","+_+"L-"+_+",-"+_+"M"+_+",-"+_+"L-"+_+","+_+"M"+l+",0A"+l+","+l+" 0 1,1 0,-"+l+"A"+l+","+l+" 0 0,1 "+l+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l+"M"+l+","+l+"H-"+l+"V-"+l+"H"+l+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(m,d,T){if(a(d))return A;var l=x(m*1.3,2);return h(d,T,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM0,-"+l+"V"+l+"M-"+l+",0H"+l)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(m,d,T){if(a(d))return A;var l=x(m*1.3,2),_=x(m*.65,2);return h(d,T,"M"+l+",0L0,"+l+"L-"+l+",0L0,-"+l+"ZM-"+_+",-"+_+"L"+_+","+_+"M-"+_+","+_+"L"+_+",-"+_)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(m,d,T){if(a(d))return A;var l=x(m*1.4,2);return h(d,T,"M0,"+l+"V-"+l+"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"L-"+l+",-"+l+"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(m,d,T){if(a(d))return A;var l=x(m*1.2,2),_=x(m*.85,2);return h(d,T,"M0,"+l+"V-"+l+"M"+l+",0H-"+l+"M"+_+","+_+"L-"+_+",-"+_+"M"+_+",-"+_+"L-"+_+","+_)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(m,d,T){if(a(d))return A;var l=x(m/2,2),_=x(m,2);return h(d,T,"M"+l+","+_+"V-"+_+"M"+(l-_)+",-"+_+"V"+_+"M"+_+","+l+"H-"+_+"M-"+_+","+(l-_)+"H"+_)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(m,d,T){if(a(d))return A;var l=x(m*1.2,2),_=x(m*1.6,2),w=x(m*.8,2);return h(d,T,"M-"+l+","+w+"L0,0M"+l+","+w+"L0,0M0,-"+_+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(m,d,T){if(a(d))return A;var l=x(m*1.2,2),_=x(m*1.6,2),w=x(m*.8,2);return h(d,T,"M-"+l+",-"+w+"L0,0M"+l+",-"+w+"L0,0M0,"+_+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(m,d,T){if(a(d))return A;var l=x(m*1.2,2),_=x(m*1.6,2),w=x(m*.8,2);return h(d,T,"M"+w+","+l+"L0,0M"+w+",-"+l+"L0,0M-"+_+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(m,d,T){if(a(d))return A;var l=x(m*1.2,2),_=x(m*1.6,2),w=x(m*.8,2);return h(d,T,"M-"+w+","+l+"L0,0M-"+w+",-"+l+"L0,0M"+_+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(m,d,T){if(a(d))return A;var l=x(m*1.4,2);return h(d,T,"M"+l+",0H-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(m,d,T){if(a(d))return A;var l=x(m*1.4,2);return h(d,T,"M0,"+l+"V-"+l)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+",-"+l+"L-"+l+","+l)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(m,d,T){if(a(d))return A;var l=x(m,2);return h(d,T,"M"+l+","+l+"L-"+l+",-"+l)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m*2,2);return h(d,T,"M0,0L-"+l+","+_+"H"+l+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m*2,2);return h(d,T,"M0,0L-"+l+",-"+_+"H"+l+"Z")},noDot:!0},"arrow-left":{n:47,f:function(m,d,T){if(a(d))return A;var l=x(m*2,2),_=x(m,2);return h(d,T,"M0,0L"+l+",-"+_+"V"+_+"Z")},noDot:!0},"arrow-right":{n:48,f:function(m,d,T){if(a(d))return A;var l=x(m*2,2),_=x(m,2);return h(d,T,"M0,0L-"+l+",-"+_+"V"+_+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m*2,2);return h(d,T,"M-"+l+",0H"+l+"M0,0L-"+l+","+_+"H"+l+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(m,d,T){if(a(d))return A;var l=x(m,2),_=x(m*2,2);return h(d,T,"M-"+l+",0H"+l+"M0,0L-"+l+",-"+_+"H"+l+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(m,d,T){if(a(d))return A;var l=x(m*2,2),_=x(m,2);return h(d,T,"M0,-"+_+"V"+_+"M0,0L"+l+",-"+_+"V"+_+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(m,d,T){if(a(d))return A;var l=x(m*2,2),_=x(m,2);return h(d,T,"M0,-"+_+"V"+_+"M0,0L-"+l+",-"+_+"V"+_+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(m,d,T){if(a(d))return A;var l=t/2.5,_=2*m*r(l),w=2*m*i(l);return h(d,T,"M0,0L"+-_+","+w+"L"+_+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(m,d,T){if(a(d))return A;var l=t/4,_=2*m*r(l),w=2*m*i(l);return h(d,T,"M0,0L"+-_+","+w+"A "+2*m+","+2*m+" 0 0 1 "+_+","+w+"Z")},backoff:.4,noDot:!0}};function a(m){return m===null}var n,o,s,c;function h(m,d,T){if((!m||m%360===0)&&!d)return T;if(s===m&&c===d&&n===T)return o;s=m,c=d,n=T;function l(z,F){var B=r(z),O=i(z),I=F[0],N=F[1]+(d||0);return[I*B-N*O,I*O+N*B]}for(var _=m/180*t,w=0,S=0,E=v(T),g="",b=0;b<E.length;b++){var p=E[b],u=p[0],y=w,f=S;if(u==="M"||u==="L")w=+p[1],S=+p[2];else if(u==="m"||u==="l")w+=+p[1],S+=+p[2];else if(u==="H")w=+p[1];else if(u==="h")w+=+p[1];else if(u==="V")S=+p[1];else if(u==="v")S+=+p[1];else if(u==="A"){w=+p[1],S=+p[2];var P=l(_,[+p[6],+p[7]]);p[6]=P[0],p[7]=P[1],p[3]=+p[3]+m}(u==="H"||u==="V")&&(u="L"),(u==="h"||u==="v")&&(u="l"),(u==="m"||u==="l")&&(w-=y,S-=f);var L=l(_,[w,S]);(u==="H"||u==="V")&&(u="L"),(u==="M"||u==="L"||u==="m"||u==="l")&&(p[1]=L[0],p[2]=L[1]),p[0]=u,g+=p[0]+p.slice(1).join(",")}return o=g,g}}}),as=Ze({"src/components/drawing/index.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=x.numberFormat,M=is(),e=Ch(),t=oo(),r=Yi(),i=rc(),a=x.strTranslate,n=fu(),o=vd(),s=mh(),c=s.LINE_SPACING,h=Zm().DESELECTDIM,m=Fu(),d=r1(),T=Qp().appendArrayPointValue,l=q.exports={};l.font=function(Me,_e){var fe=_e.variant,Fe=_e.style,rt=_e.weight,st=_e.color,Qe=_e.size,Lt=_e.family,kt=_e.shadow,qt=_e.lineposition,Zt=_e.textcase;Lt&&Me.style("font-family",Lt),Qe+1&&Me.style("font-size",Qe+"px"),st&&Me.call(r.fill,st),rt&&Me.style("font-weight",rt),Fe&&Me.style("font-style",Fe),fe&&Me.style("font-variant",fe),Zt&&Me.style("text-transform",_(S(Zt))),kt&&Me.style("text-shadow",kt==="auto"?n.makeTextShadow(r.contrast(st)):_(kt)),qt&&Me.style("text-decoration-line",_(E(qt)))};function _(Me){return Me==="none"?void 0:Me}var w={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function S(Me){return w[Me]}function E(Me){return Me.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}l.setPosition=function(Me,_e,fe){Me.attr("x",_e).attr("y",fe)},l.setSize=function(Me,_e,fe){Me.attr("width",_e).attr("height",fe)},l.setRect=function(Me,_e,fe,Fe,rt){Me.call(l.setPosition,_e,fe).call(l.setSize,Fe,rt)},l.translatePoint=function(Me,_e,fe,Fe){var rt=fe.c2p(Me.x),st=Fe.c2p(Me.y);if(M(rt)&&M(st)&&_e.node())_e.node().nodeName==="text"?_e.attr("x",rt).attr("y",st):_e.attr("transform",a(rt,st));else return!1;return!0},l.translatePoints=function(Me,_e,fe){Me.each(function(Fe){var rt=v.select(this);l.translatePoint(Fe,rt,_e,fe)})},l.hideOutsideRangePoint=function(Me,_e,fe,Fe,rt,st){_e.attr("display",fe.isPtWithinRange(Me,rt)&&Fe.isPtWithinRange(Me,st)?null:"none")},l.hideOutsideRangePoints=function(Me,_e){if(_e._hasClipOnAxisFalse){var fe=_e.xaxis,Fe=_e.yaxis;Me.each(function(rt){var st=rt[0].trace,Qe=st.xcalendar,Lt=st.ycalendar,kt=t.traceIs(st,"bar-like")?".bartext":".point,.textpoint";Me.selectAll(kt).each(function(qt){l.hideOutsideRangePoint(qt,v.select(this),fe,Fe,Qe,Lt)})})}},l.crispRound=function(Me,_e,fe){return!_e||!M(_e)?fe||0:Me._context.staticPlot?_e:_e<1?1:Math.round(_e)},l.singleLineStyle=function(Me,_e,fe,Fe,rt){_e.style("fill","none");var st=(((Me||[])[0]||{}).trace||{}).line||{},Qe=fe||st.width||0,Lt=rt||st.dash||"";r.stroke(_e,Fe||st.color),l.dashLine(_e,Lt,Qe)},l.lineGroupStyle=function(Me,_e,fe,Fe){Me.style("fill","none").each(function(rt){var st=(((rt||[])[0]||{}).trace||{}).line||{},Qe=_e||st.width||0,Lt=Fe||st.dash||"";v.select(this).call(r.stroke,fe||st.color).call(l.dashLine,Lt,Qe)})},l.dashLine=function(Me,_e,fe){fe=+fe||0,_e=l.dashStyle(_e,fe),Me.style({"stroke-dasharray":_e,"stroke-width":fe+"px"})},l.dashStyle=function(Me,_e){_e=+_e||1;var fe=Math.max(_e,3);return Me==="solid"?Me="":Me==="dot"?Me=fe+"px,"+fe+"px":Me==="dash"?Me=3*fe+"px,"+3*fe+"px":Me==="longdash"?Me=5*fe+"px,"+5*fe+"px":Me==="dashdot"?Me=3*fe+"px,"+fe+"px,"+fe+"px,"+fe+"px":Me==="longdashdot"&&(Me=5*fe+"px,"+2*fe+"px,"+fe+"px,"+2*fe+"px"),Me};function g(Me,_e,fe,Fe){var rt=_e.fillpattern,st=_e.fillgradient,Qe=l.getPatternAttr,Lt=rt&&(Qe(rt.shape,0,"")||Qe(rt.path,0,""));if(Lt){var kt=Qe(rt.bgcolor,0,null),qt=Qe(rt.fgcolor,0,null),Zt=rt.fgopacity,Sr=Qe(rt.size,0,8),xr=Qe(rt.solidity,0,.3),jr=_e.uid;l.pattern(Me,"point",fe,jr,Lt,Sr,xr,void 0,rt.fillmode,kt,qt,Zt)}else if(st&&st.type!=="none"){var wr=st.type,Ir="scatterfill-"+_e.uid;if(Fe&&(Ir="legendfill-"+_e.uid),!Fe&&(st.start!==void 0||st.stop!==void 0)){var bt,Be;wr==="horizontal"?(bt={x:st.start,y:0},Be={x:st.stop,y:0}):wr==="vertical"&&(bt={x:0,y:st.start},Be={x:0,y:st.stop}),bt.x=_e._xA.c2p(bt.x===void 0?_e._extremes.x.min[0].val:bt.x,!0),bt.y=_e._yA.c2p(bt.y===void 0?_e._extremes.y.min[0].val:bt.y,!0),Be.x=_e._xA.c2p(Be.x===void 0?_e._extremes.x.max[0].val:Be.x,!0),Be.y=_e._yA.c2p(Be.y===void 0?_e._extremes.y.max[0].val:Be.y,!0),Me.call(L,fe,Ir,"linear",st.colorscale,"fill",bt,Be,!0,!1)}else wr==="horizontal"&&(wr=wr+"reversed"),Me.call(l.gradient,fe,Ir,wr,st.colorscale,"fill")}else _e.fillcolor&&Me.call(r.fill,_e.fillcolor)}l.singleFillStyle=function(Me,_e){var fe=v.select(Me.node()),Fe=fe.data(),rt=((Fe[0]||[])[0]||{}).trace||{};g(Me,rt,_e,!1)},l.fillGroupStyle=function(Me,_e,fe){Me.style("stroke-width",0).each(function(Fe){var rt=v.select(this);Fe[0].trace&&g(rt,Fe[0].trace,_e,fe)})};var b=sO();l.symbolNames=[],l.symbolFuncs=[],l.symbolBackOffs=[],l.symbolNeedLines={},l.symbolNoDot={},l.symbolNoFill={},l.symbolList=[],Object.keys(b).forEach(function(Me){var _e=b[Me],fe=_e.n;l.symbolList.push(fe,String(fe),Me,fe+100,String(fe+100),Me+"-open"),l.symbolNames[fe]=Me,l.symbolFuncs[fe]=_e.f,l.symbolBackOffs[fe]=_e.backoff||0,_e.needLine&&(l.symbolNeedLines[fe]=!0),_e.noDot?l.symbolNoDot[fe]=!0:l.symbolList.push(fe+200,String(fe+200),Me+"-dot",fe+300,String(fe+300),Me+"-open-dot"),_e.noFill&&(l.symbolNoFill[fe]=!0)});var p=l.symbolNames.length,u="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";l.symbolNumber=function(Me){if(M(Me))Me=+Me;else if(typeof Me=="string"){var _e=0;Me.indexOf("-open")>0&&(_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<Zt;jr++)Sr.reversed?xr[Zt-1-jr]=[f((1-rt[jr][0])*100),rt[jr][1]]:xr[jr]=[f(rt[jr][0]*100),rt[jr][1]];var wr=_e._fullLayout,Ir="g"+wr._uid+"-"+fe,bt=wr._defs.select(".gradients").selectAll("#"+Ir).data([Fe+xr.join(";")],x.identity);bt.exit().remove(),bt.enter().append(Sr.node).each(function(){var Be=v.select(this);Sr.attrs&&Be.attr(Sr.attrs),Be.attr("id",Ir);var Ke=Be.selectAll("stop").data(xr);Ke.exit().remove(),Ke.enter().append("stop"),Ke.each(function(Ue){var Ee=e(Ue[1]);v.select(this).attr({offset:Ue[0]+"%","stop-color":r.tinyRGB(Ee),"stop-opacity":Ee.getAlpha()})})}),Me.style(st,oe(Ir,_e)).style(st+"-opacity",null),Me.classed("gradient_filled",!0)}l.pattern=function(Me,_e,fe,Fe,rt,st,Qe,Lt,kt,qt,Zt,Sr){var xr=_e==="legend";Lt&&(kt==="overlay"?(qt=Lt,Zt=r.contrast(qt)):(qt=void 0,Zt=Lt));var jr=fe._fullLayout,wr="p"+jr._uid+"-"+Fe,Ir,bt,Be=function(Gt,rr,Qt,Tr,la){return Tr+(la-Tr)*(Gt-rr)/(Qt-rr)},Ke,Ue,Ee,Ve,Ce={},Te=e(Zt),Pe=r.tinyRGB(Te),at=Te.getAlpha(),yt=Sr*at;switch(rt){case"/":Ir=st*Math.sqrt(2),bt=st*Math.sqrt(2),Ke="M-"+Ir/4+","+bt/4+"l"+Ir/2+",-"+bt/2+"M0,"+bt+"L"+Ir+",0M"+Ir/4*3+","+bt/4*5+"l"+Ir/2+",-"+bt/2,Ue=Qe*st,Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case"\\":Ir=st*Math.sqrt(2),bt=st*Math.sqrt(2),Ke="M"+Ir/4*3+",-"+bt/4+"l"+Ir/2+","+bt/2+"M0,0L"+Ir+","+bt+"M-"+Ir/4+","+bt/4*3+"l"+Ir/2+","+bt/2,Ue=Qe*st,Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case"x":Ir=st*Math.sqrt(2),bt=st*Math.sqrt(2),Ke="M-"+Ir/4+","+bt/4+"l"+Ir/2+",-"+bt/2+"M0,"+bt+"L"+Ir+",0M"+Ir/4*3+","+bt/4*5+"l"+Ir/2+",-"+bt/2+"M"+Ir/4*3+",-"+bt/4+"l"+Ir/2+","+bt/2+"M0,0L"+Ir+","+bt+"M-"+Ir/4+","+bt/4*3+"l"+Ir/2+","+bt/2,Ue=st-st*Math.sqrt(1-Qe),Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case"|":Ir=st,bt=st,Ve="path",Ke="M"+Ir/2+",0L"+Ir/2+","+bt,Ue=Qe*st,Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case"-":Ir=st,bt=st,Ve="path",Ke="M0,"+bt/2+"L"+Ir+","+bt/2,Ue=Qe*st,Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case"+":Ir=st,bt=st,Ve="path",Ke="M"+Ir/2+",0L"+Ir/2+","+bt+"M0,"+bt/2+"L"+Ir+","+bt/2,Ue=st-st*Math.sqrt(1-Qe),Ve="path",Ce={d:Ke,opacity:yt,stroke:Pe,"stroke-width":Ue+"px"};break;case".":Ir=st,bt=st,Qe<Math.PI/4?Ee=Math.sqrt(Qe*st*st/Math.PI):Ee=Be(Qe,Math.PI/4,1,st/2,st/Math.sqrt(2)),Ve="circle",Ce={cx:Ir/2,cy:bt/2,r:Ee,opacity:yt,fill:Pe};break;default:Ir=st,bt=st,Ve="path",Ce={d:rt,opacity:yt,fill:Pe};break}var Tt=[rt||"noSh",qt||"noBg",Zt||"noFg",st,Qe].join(";"),Ot=jr._defs.select(".patterns").selectAll("#"+wr).data([Tt],x.identity);Ot.exit().remove(),Ot.enter().append("pattern").each(function(){var Gt=v.select(this);if(Gt.attr({id:wr,width:Ir+"px",height:bt+"px",patternUnits:"userSpaceOnUse",patternTransform:xr?"scale(0.8)":""}),qt){var rr=e(qt),Qt=r.tinyRGB(rr),Tr=rr.getAlpha(),la=Gt.selectAll("rect").data([0]);la.exit().remove(),la.enter().append("rect").attr({width:Ir+"px",height:bt+"px",fill:Qt,"fill-opacity":Tr})}var Ua=Gt.selectAll(Ve).data([0]);Ua.exit().remove(),Ua.enter().append(Ve).attr(Ce)}),Me.style("fill",oe(wr,fe)).style("fill-opacity",null),Me.classed("pattern_filled",!0)},l.initGradients=function(Me){var _e=Me._fullLayout,fe=x.ensureSingle(_e._defs,"g","gradients");fe.selectAll("linearGradient,radialGradient").remove(),v.select(Me).selectAll(".gradient_filled").classed("gradient_filled",!1)},l.initPatterns=function(Me){var _e=Me._fullLayout,fe=x.ensureSingle(_e._defs,"g","patterns");fe.selectAll("pattern").remove(),v.select(Me).selectAll(".pattern_filled").classed("pattern_filled",!1)},l.getPatternAttr=function(Me,_e,fe){return Me&&x.isArrayOrTypedArray(Me)?_e<Me.length?Me[_e]:fe:Me},l.pointStyle=function(Me,_e,fe,Fe){if(Me.size()){var rt=l.makePointStyleFns(_e);Me.each(function(st){l.singlePointStyle(st,v.select(this),_e,rt,fe,Fe)})}},l.singlePointStyle=function(Me,_e,fe,Fe,rt,st){var Qe=fe.marker,Lt=Qe.line;if(st&&st.i>=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;Lt<rt.length;Lt++)rt[Lt](Qe,st)})}},l.tryColorscale=function(Me,_e){var fe=_e?x.nestedProperty(Me,_e).get():Me;if(fe){var Fe=fe.color;if((fe.colorscale||fe._colorAx)&&x.isArrayOrTypedArray(Fe))return i.makeColorScaleFuncFromTrace(fe)}return x.identity};var z={start:1,end:-1,middle:0,bottom:1,top:-1};function F(Me,_e,fe,Fe,rt){var st=v.select(Me.node().parentNode),Qe=_e.indexOf("top")!==-1?"top":_e.indexOf("bottom")!==-1?"bottom":"middle",Lt=_e.indexOf("left")!==-1?"end":_e.indexOf("right")!==-1?"start":"middle",kt=Fe?Fe/.8+1:0,qt=(n.lineCount(Me)-1)*c+1,Zt=z[Lt]*kt,Sr=fe*.75+z[Qe]*kt+(z[Qe]-1)*qt*fe/2;Me.attr("text-anchor",Lt),rt||st.attr("transform",a(Zt,Sr))}function B(Me,_e){var fe=Me.ts||_e.textfont.size;return M(fe)&&fe>0?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<Me.length-1;rt++)Fe.push(ue(Me[rt-1],Me[rt],Me[rt+1],_e));for(fe+="Q"+Fe[0][0]+" "+Me[1],rt=2;rt<Me.length-1;rt++)fe+="C"+Fe[rt-2][1]+" "+Fe[rt-1][0]+" "+Me[rt];return fe+="Q"+Fe[Me.length-3][1]+" "+Me[Me.length-1],fe},l.smoothclosed=function(Me,_e){if(Me.length<3)return"M"+Me.join("L")+"Z";var fe="M"+Me[0],Fe=Me.length-1,rt=[ue(Me[Fe],Me[0],Me[1],_e)],st;for(st=1;st<Fe;st++)rt.push(ue(Me[st-1],Me[st],Me[st+1],_e));for(rt.push(ue(Me[Fe-1],Me[Fe],Me[0],_e)),st=1;st<=Fe;st++)fe+="C"+rt[st-1][1]+" "+rt[st][0]+" "+Me[st];return fe+="C"+rt[Fe][1]+" "+rt[0][0]+" "+Me[0]+"Z",fe};var I,N;function U(Me,_e,fe){return fe&&(Me=H(Me)),_e?Q(Me[1]):W(Me[0])}function W(Me){var _e=v.round(Me,2);return I=_e,_e}function Q(Me){var _e=v.round(Me,2);return N=_e,_e}function ue(Me,_e,fe,Fe){var rt=Me[0]-_e[0],st=Me[1]-_e[1],Qe=fe[0]-_e[0],Lt=fe[1]-_e[1],kt=Math.pow(rt*rt+st*st,O/2),qt=Math.pow(Qe*Qe+Lt*Lt,O/2),Zt=(qt*qt*rt-kt*kt*Qe)*Fe,Sr=(qt*qt*st-kt*kt*Lt)*Fe,xr=3*qt*(kt+qt),jr=3*kt*(kt+qt);return[[W(_e[0]+(xr&&Zt/xr)),Q(_e[1]+(xr&&Sr/xr))],[W(_e[0]-(jr&&Zt/jr)),Q(_e[1]-(jr&&Sr/jr))]]}var se={hv:function(Me,_e,fe){return"H"+W(_e[0])+"V"+U(_e,1,fe)},vh:function(Me,_e,fe){return"V"+Q(_e[1])+"H"+U(_e,0,fe)},hvh:function(Me,_e,fe){return"H"+W((Me[0]+_e[0])/2)+"V"+Q(_e[1])+"H"+U(_e,0,fe)},vhv:function(Me,_e,fe){return"V"+Q((Me[1]+_e[1])/2)+"H"+W(_e[0])+"V"+U(_e,1,fe)}},he=function(Me,_e,fe){return"L"+U(_e,0,fe)+","+U(_e,1,fe)};l.steps=function(Me){var _e=se[Me]||he;return function(fe){for(var Fe="M"+W(fe[0][0])+","+Q(fe[0][1]),rt=fe.length,st=1;st<rt;st++)Fe+=_e(fe[st-1],fe[st],st===rt-1);return Fe}};function H(Me,_e){var fe=Me.backoff,Fe=Me.trace,rt=Me.d,st=Me.i;if(fe&&Fe&&Fe.marker&&Fe.marker.angle%360===0&&Fe.line&&Fe.line.shape!=="spline"){var Qe=x.isArrayOrTypedArray(fe),Lt=Me,kt=_e?_e[0]:I||0,qt=_e?_e[1]:N||0,Zt=Lt[0],Sr=Lt[1],xr=Zt-kt,jr=Sr-qt,wr=Math.atan2(jr,xr),Ir=Qe?fe[st]:fe;if(Ir==="auto"){var bt=Lt.i;Fe.type==="scatter"&&bt--;var Be=Lt.marker,Ke=Be.symbol;x.isArrayOrTypedArray(Ke)&&(Ke=Ke[bt]);var Ue=Be.size;x.isArrayOrTypedArray(Ue)&&(Ue=Ue[bt]),Ir=Be?l.symbolBackOffs[l.symbolNumber(Ke)]*Ue:0,Ir+=l.getMarkerStandoff(rt[bt],Fe)||0}var Ee=Zt-Ir*Math.cos(wr),Ve=Sr-Ir*Math.sin(wr);(Ee<=Zt&&Ee>=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;j<oe;j++){var ee=(X[0]||[])[j],re=(X[1]||[])[j];ne[j]=U([ee,re])}return ne}function U(X){if(y._categoriesMap)return y._categoriesMap[X]}function W(X){var oe=U(X);if(oe!==void 0)return oe;if(e(X))return+X}function Q(X){return e(X)?+X:U(X)}function ue(X,oe,ne){return v.round(ne+oe*X,2)}function se(X,oe,ne){return(X-ne)/oe}var he=function(oe){return e(oe)?ue(oe,y._m,y._b):c},H=function(X){return se(X,y._m,y._b)};if(y.rangebreaks){var $=L==="y";he=function(X){if(!e(X))return c;var oe=y._rangebreaks.length;if(!oe)return ue(X,y._m,y._b);var ne=$;y.range[0]>y.range[1]&&(ne=!ne);for(var j=ne?-1:1,ee=j*X,re=0,ce=0;ce<oe;ce++){var be=j*y._rangebreaks[ce].min,Ae=j*y._rangebreaks[ce].max;if(ee<be)break;if(ee>Ae)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;j<oe&&!(X<y._rangebreaks[j].pmin);j++)X>y._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;ne<oe.length;ne++){var ze=X[oe[ne]];if(L in ze){var Re=ze[L],We=ze._length||A.minRowLength(Re);if(n(Re[0])&&n(Re[1]))for(j=0;j<We;j++){var it=Re[0][j],ot=Re[1][j];p(it)&&p(ot)&&(Ae.push([it,ot]),it in be[0][1]||(be[0][1][it]=be[0][0]++),ot in be[1][1]||(be[1][1][ot]=be[1][0]++))}}}for(Ae.sort(function(tt,ut){var Me=be[0][1],_e=Me[tt[0]]-Me[ut[0]];if(_e)return _e;var fe=be[1][1];return fe[tt[1]]-fe[ut[1]]}),ne=0;ne<Ae.length;ne++)I(Ae[ne])}),y.fraction2r=function(X){var oe=y.r2l(y.range[0]),ne=y.r2l(y.range[1]);return y.l2r(oe+X*(ne-oe))},y.r2fraction=function(X){var oe=y.r2l(y.range[0]),ne=y.r2l(y.range[1]);return(y.r2l(X)-oe)/(ne-oe)},y.limitRange=function(X){var oe=y.minallowed,ne=y.maxallowed;if(!(oe===void 0&&ne===void 0)){X||(X="range");var j=A.nestedProperty(y,X).get(),ee=A.simpleMap(j,y.r2l),re=ee[1]<ee[0];re&&ee.reverse();var ce=A.simpleMap([oe,ne],y.r2l);if(oe!==void 0&&ee[0]<ce[0]&&(j[re?1:0]=oe),ne!==void 0&&ee[1]>ce[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;Ae<y._rangebreaks.length;Ae++)ze=y._rangebreaks[Ae],y._lBreaks+=Math.abs(ze.max-ze.min);var Re=be;re>ce&&(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;Ae<y._rangebreaks.length;Ae++)ze=y._rangebreaks[Ae],y._B.push(y._B[y._B.length-1]-We*y._m2*(ze.max-ze.min));for(Ae=0;Ae<y._rangebreaks.length;Ae++)ze=y._rangebreaks[Ae],ze.pmin=he(ze.min),ze.pmax=he(ze.max)}}if(!isFinite(y._m)||!isFinite(y._b)||y._length<0)throw f._replotting=!1,new Error("Something went wrong with axis scaling")},y.maskBreaks=function(X){var oe=y.rangebreaks||[],ne,j,ee,re,ce;oe._cachedPatterns||(oe._cachedPatterns=oe.map(function(Me){return Me.enabled&&Me.bounds?A.simpleMap(Me.bounds,Me.pattern?t:y.d2c):null})),oe._cachedValues||(oe._cachedValues=oe.map(function(Me){return Me.enabled&&Me.values?A.simpleMap(Me.values,y.d2c).sort(A.sorterAsc):null}));for(var be=0;be<oe.length;be++){var Ae=oe[be];if(Ae.enabled){if(Ae.bounds){var ze=Ae.pattern;switch(ne=oe._cachedPatterns[be],j=ne[0],ee=ne[1],ze){case g:ce=new Date(X),re=ce.getUTCDay(),j>ee&&(ee+=7,re<j&&(re+=7));break;case E:ce=new Date(X);var Re=ce.getUTCHours(),We=ce.getUTCMinutes(),it=ce.getUTCSeconds(),ot=ce.getUTCMilliseconds();re=Re+(We/60+it/3600+ot/36e5),j>ee&&(ee+=24,re<j&&(re+=24));break;case"":re=X;break}if(re>=j&&re<ee)return c}else for(var tt=oe._cachedValues[be],ut=0;ut<tt.length;ut++)if(j=tt[ut],ee=j+Ae.dvalue,X>=j&&X<ee)return c}}return X},y.locateBreaks=function(X,oe){var ne,j,ee,re,ce=[];if(!y.rangebreaks)return ce;var be=y.rangebreaks.slice().sort(function(fe,Fe){return fe.pattern===g&&Fe.pattern===E?-1:Fe.pattern===g&&fe.pattern===E?1:0}),Ae=function(fe,Fe){if(fe=A.constrain(fe,X,oe),Fe=A.constrain(Fe,X,oe),fe!==Fe){for(var rt=!0,st=0;st<ce.length;st++){var Qe=ce[st];fe<Qe.max&&Fe>=Qe.min&&(fe<Qe.min&&(Qe.min=fe),Fe>Qe.max&&(Qe.max=Fe),rt=!1)}rt&&ce.push({min:fe,max:Fe})}};for(ne=0;ne<be.length;ne++){var ze=be[ne];if(ze.enabled)if(ze.bounds){var Re=X,We=oe;ze.pattern&&(Re=Math.floor(Re)),j=A.simpleMap(ze.bounds,ze.pattern?t:y.r2l),ee=j[0],re=j[1];var it=new Date(Re),ot,tt;switch(ze.pattern){case g:tt=m,ot=((re<ee?7:0)+(re-ee))*d,Re+=ee*d-(it.getUTCDay()*d+it.getUTCHours()*T+it.getUTCMinutes()*l+it.getUTCSeconds()*_+it.getUTCMilliseconds());break;case E:tt=d,ot=((re<ee?24:0)+(re-ee))*T,Re+=ee*T-(it.getUTCHours()*T+it.getUTCMinutes()*l+it.getUTCSeconds()*_+it.getUTCMilliseconds());break;default:Re=Math.min(j[0],j[1]),We=Math.max(j[0],j[1]),tt=We-Re,ot=tt}for(var ut=Re;ut<We;ut+=tt)Ae(ut,ut+ot)}else for(var Me=A.simpleMap(ze.values,y.d2c),_e=0;_e<Me.length;_e++)ee=Me[_e],re=ee+ze.dvalue,Ae(ee,re)}return ce.sort(function(fe,Fe){return fe.min-Fe.min}),ce},y.makeCalcdata=function(X,oe,ne){var j,ee,re,ce,be=y.type,Ae=be==="date"&&X[oe+"calendar"];if(oe in X){if(j=X[oe],ce=X._length||A.minRowLength(j),A.isTypedArray(j)&&(be==="linear"||be==="log")){if(ce===j.length)return j;if(j.subarray)return j.subarray(0,ce)}if(be==="multicategory")return N(j,ce);for(ee=new Array(ce),re=0;re<ce;re++)ee[re]=y.d2c(j[re],0,Ae,ne)}else{var ze=oe+"0"in X?y.d2c(X[oe+"0"],0,Ae):0,Re=X["d"+oe]?Number(X["d"+oe]):1;for(j=X[{x:"y",y:"x"}[oe]],ce=X._length||j.length,ee=new Array(ce),re=0;re<ce;re++)ee[re]=ze+re*Re}if(y.rangebreaks)for(re=0;re<ce;re++)ee[re]=y.maskBreaks(ee[re]);return ee},y.isValidRange=function(X,oe){return Array.isArray(X)&&X.length===2&&(oe&&X[0]===null||e(y.r2l(X[0])))&&(oe&&X[1]===null||e(y.r2l(X[1])))},y.getAutorangeDflt=function(X,oe){var ne=!y.isValidRange(X,"nullOk");return ne&&oe&&oe.reverseDflt?ne="reversed":X&&(X[0]===null&&X[1]===null?ne=!0:X[0]===null&&X[1]!==null?ne="min":X[0]!==null&&X[1]===null&&(ne="max")),ne},y.isReversed=function(){var X=y.autorange;return X==="reversed"||X==="min reversed"||X==="max reversed"},y.isPtWithinRange=function(X,oe){var ne=y.c2l(X[L],null,oe),j=y.r2l(y.range[0]),ee=y.r2l(y.range[1]);return j<ee?j<=ne&&ne<=ee:ee<=ne&&ne<=j},y._emptyCategories=function(){y._categories=[],y._categoriesMap={}},y.clearCalc=function(){var X=y._matchGroup;if(X){var oe=null,ne=null;for(var j in X){var ee=f[w.id2name(j)];if(ee._categories){oe=ee._categories,ne=ee._categoriesMap;break}}oe&&ne?(y._categories=oe,y._categoriesMap=ne):y._emptyCategories()}else y._emptyCategories();if(y._initialCategories)for(var re=0;re<y._initialCategories.length;re++)I(y._initialCategories[re])},y.sortByInitialCategories=function(){var X=[];if(y._emptyCategories(),y._initialCategories)for(var oe=0;oe<y._initialCategories.length;oe++)I(y._initialCategories[oe]);X=X.concat(y._traceIndices);var ne=y._matchGroup;for(var j in ne)if(P!==j){var ee=f[w.id2name(j)];ee._categories=y._categories,ee._categoriesMap=y._categoriesMap,X=X.concat(ee._traceIndices)}return X};var J=f._d3locale;y.type==="date"&&(y._dateFormat=J?J.timeFormat:x,y._extraFormat=f._extraFormat),y._separators=f.separators,y._numFormat=J?J.numberFormat:M,delete y._minDtick,delete y._forceTick0}}}),a1=Ze({"src/plots/cartesian/axis_autotype.js"(Z,q){"use strict";var v=is(),x=ca(),A=Vs().BADNUM,M=x.isArrayOrTypedArray,e=x.isDateTime,t=x.cleanNumber,r=Math.round;q.exports=function(m,d,T){var l=m,_=T.noMultiCategory;if(M(l)&&!l.length)return"-";if(!_&&c(l))return"multicategory";if(_&&Array.isArray(l[0])){for(var w=[],S=0;S<l.length;S++)if(M(l[S]))for(var E=0;E<l[S].length;E++)w.push(l[S][E]);l=w}if(n(l,d))return"date";var g=T.autotypenumbers!=="strict";return s(l,g)?"category":a(l,g)?"linear":"-"};function i(h,m){return m?v(h):typeof h=="number"}function a(h,m){for(var d=h.length,T=0;T<d;T++)if(i(h[T],m))return!0;return!1}function n(h,m){for(var d=h.length,T=o(d),l=0,_=0,w={},S=0;S<d;S+=T){var E=r(S),g=h[E],b=String(g);w[b]||(w[b]=1,e(g,m)&&l++,v(g)&&_++)}return l>_*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;S<d;S+=T){var E=r(S),g=h[E],b=String(g);if(!w[b]){w[b]=1;var p=typeof g;p==="boolean"?_++:(m?t(g)!==A:p==="number")?l++:p==="string"&&_++}}return _>l*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;L<U.length&&Q===ue;L++)Q=Math.min(Q,U[L].val);for(L=1;L<W.length&&Q===ue;L++)ue=Math.max(ue,W[L].val);var se=P.autorange,he=se==="reversed"||se==="min reversed"||se==="max reversed";if(!he&&P.range){var H=A.simpleMap(P.range,P.r2l);he=H[1]<H[0]}P.autorange==="reversed"&&(P.autorange=!0);var $=P.rangemode,J=$==="tozero",X=$==="nonnegative",oe=P._length,ne=oe/10,j=0,ee,re,ce,be,Ae,ze;for(L=0;L<U.length;L++)for(ee=U[L],z=0;z<W.length;z++)re=W[z],ze=re.val-ee.val-o(P,ee.val,re.val),ze>0&&(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;B<F.length;B++){var O=F[B];z+=O.max-O.min}return z}function s(f,P,L){var z=.05*P._length,F=P._anchorAxis||{};if((P.ticklabelposition||"").indexOf("inside")!==-1||(F.ticklabelposition||"").indexOf("inside")!==-1){var B=P.isReversed();if(!B){var O=A.simpleMap(P.range,P.r2l);B=O[1]<O[0]}B&&(L=!L)}var I=0;return a(f,P._id)||(I=h(f,P,L)),z=Math.max(I,z),P.constrain==="domain"&&P._inputDomain&&(z*=(P._inputDomain[1]-P._inputDomain[0])/(P.domain[1]-P.domain[0])),function(U){return U.nopad?0:U.pad+(U.extrapad?z:I)}}var c=3;function h(f,P,L){var z=0,F=P._id.charAt(0)==="x";for(var B in f._plots){var O=f._plots[B];if(!(P._id!==O.xaxis._id&&P._id!==O.yaxis._id)){var I=(F?O.yaxis:O.xaxis)||{};if((I.ticklabelposition||"").indexOf("inside")!==-1&&(!L&&(I.side==="left"||I.side==="bottom")||L&&(I.side==="top"||I.side==="right"))){if(I._vals){var N=A.deg2rad(I._tickAngles[I._id+"tick"]||0),U=Math.abs(Math.cos(N)),W=Math.abs(Math.sin(N));if(!I._vals[0].bb){var Q=I._id+"tick",ue=I._selections[Q];ue.each(function(X){var oe=v.select(this),ne=oe.select(".text-math-group");ne.empty()&&(X.bb=t.bBox(oe.node()))})}for(var se=0;se<I._vals.length;se++){var he=I._vals[se],H=he.bb;if(H){var $=2*c+H.width,J=2*c+H.height;z=Math.max(z,F?Math.max($*U,J*W):Math.max(J*U,$*W))}}}I.ticks==="inside"&&I.ticklabelposition==="inside"&&(z+=I.ticklen||0)}}}return z}function m(f,P,L){var z=P._id,F=f._fullData,B=f._fullLayout,O=[],I=[],N,U,W;function Q($,J){for(N=0;N<J.length;N++){var X=$[J[N]],oe=(X._extremes||{})[z];if(X.visible===!0&&oe){for(U=0;U<oe.min.length;U++)W=oe.min[U],l(O,W.val,W.pad,{extrapad:W.extrapad});for(U=0;U<oe.max.length;U++)W=oe.max[U],_(I,W.val,W.pad,{extrapad:W.extrapad})}}}if(Q(F,P._traceIndices),Q(B.annotations||[],P._annIndices||[]),Q(B.shapes||[],P._shapeIndices||[]),P._matchGroup&&!L){for(var ue in P._matchGroup)if(ue!==P._id){var se=i(f,ue),he=m(f,se,!0),H=P._length/se._length;for(U=0;U<he.min.length;U++)W=he.min[U],l(O,W.val,W.pad*H,{extrapad:W.extrapad});for(U=0;U<he.max.length;U++)W=he.max[U],_(I,W.val,W.pad*H,{extrapad:W.extrapad})}}return{min:O,max:I}}function d(f,P,L){if(P.setScale(),P.autorange){P.range=L?L.slice():n(f,P),P._r=P.range.slice(),P._rl=A.simpleMap(P._r,P.r2l);var z=P._input,F={};F[P._attr+".range"]=P.range,F[P._attr+".autorange"]=P.autorange,e.call("_storeDirectGUIEdit",f.layout,f._fullLayout._preGUI,F),z.range=P.range.slice(),z.autorange=P.autorange}var B=P._anchorAxis;if(B&&B.rangeslider){var O=B.rangeslider[P._name];O&&O.rangemode==="auto"&&(O.range=n(f,P)),B._input.rangeslider[P._name]=A.extendFlat({},O)}}function T(f,P,L){L||(L={}),f._m||f.setScale();var z=[],F=[],B=P.length,O=L.padded||!1,I=L.tozero&&(f.type==="linear"||f.type==="-"),N=f.type==="log",U=!1,W=L.vpadLinearized||!1,Q,ue,se,he,H,$,J,X,oe;function ne(Re){if(Array.isArray(Re))return U=!0,function(it){return Math.max(Number(Re[it]||0),0)};var We=Math.max(Number(Re||0),0);return function(){return We}}var j=ne((f._m>0?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;Q<B;Q++)ue=P[Q],ue<X&&ue>0&&(X=ue),ue>oe&&ue<M&&(oe=ue);else for(Q=0;Q<B;Q++)ue=P[Q],ue<X&&ue>-M&&(X=ue),ue>oe&&ue<M&&(oe=ue);P=[X,oe],B=2}var be={tozero:I,extrapad:O};function Ae(Re){se=P[Re],x(se)&&($=j(Re),J=ee(Re),W?(he=f.c2l(se)-ce(Re),H=f.c2l(se)+re(Re)):(X=se-ce(Re),oe=se+re(Re),N&&X<oe/10&&(X=oe/10),he=f.c2l(X),H=f.c2l(oe)),I&&(he=Math.min(0,he),H=Math.max(0,H)),S(he)&&l(z,he,J,be),S(H)&&_(F,H,$,be))}var ze=Math.min(6,B);for(Q=0;Q<ze;Q++)Ae(Q);for(Q=B-1;Q>=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<f.length&&I;N++){var U=f[N];if(F(U.val,P)&&U.pad>=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)<M}function E(f,P){return f<=P}function g(f,P){return 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<L):!0}function y(f,P){if(!P||!P.autorangeoptions)return f;var L=f[0],z=f[1],F=P.autorangeoptions.include;if(F!==void 0){var B=P.d2l(L),O=P.d2l(z);A.isArrayOrTypedArray(F)||(F=[F]);for(var I=0;I<F.length;I++){var N=P.d2l(F[I]);B>=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;da<ct.length;da++)for(var fa=Nr[J.id2name(ct[da])],It=fa[Gr],dr=0;dr<It.length;dr++){var kr=It[dr];if(!aa[kr]&&(Ur(xt,kr),aa[kr]=1,Kr))return}}Or("annotations","drawOne","_annIndices"),Or("shapes","drawOne","_shapeIndices"),Or("images","draw","_imgIndices",!0),Or("selections","drawOne","_selectionIndices")};var be=J.getDataConversions=function(xt,ct,Nr,Or){var Rr,Lr=Nr==="x"||Nr==="y"||Nr==="z"?Nr:Or;if(e.isArrayOrTypedArray(Lr)){if(Rr={type:X(Or,void 0,{autotypenumbers:xt._fullLayout.autotypenumbers}),_categories:[]},J.setConvert(Rr),Rr.type==="category")for(var Gr=0;Gr<Or.length;Gr++)Rr.d2c(Or[Gr])}else Rr=J.getFromTrace(xt,ct,Lr);return Rr?{d2c:Rr.d2c,c2d:Rr.c2d}:Lr==="ids"?{d2c:ze,c2d:ze}:{d2c:Ae,c2d:Ae}};function Ae(xt){return+xt}function ze(xt){return String(xt)}J.getDataToCoordFunc=function(xt,ct,Nr,Or){return be(xt,ct,Nr,Or).d2c},J.counterLetter=function(xt){var ct=xt.charAt(0);if(ct==="x")return"y";if(ct==="y")return"x"},J.minDtick=function(xt,ct,Nr,Or){["log","category","multicategory"].indexOf(xt.type)!==-1||!Or?xt._minDtick=0:xt._minDtick===void 0?(xt._minDtick=ct,xt._forceTick0=Nr):xt._minDtick&&((xt._minDtick/ct+1e-6)%1<2e-6&&((Nr-xt._forceTick0)/ct%1+1.000001)%1<2e-6?(xt._minDtick=ct,xt._forceTick0=Nr):((ct/xt._minDtick+1e-6)%1>2e-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;Rr<Nr.length;Rr++){var Lr=Nr[Rr],Gr=Lr._rangeInitial0===void 0&&Lr._rangeInitial1===void 0,Kr=Gr||Lr.range[0]!==Lr._rangeInitial0||Lr.range[1]!==Lr._rangeInitial1,Ur=Lr.autorange;(Gr&&Ur!==!0||ct&&Kr)&&(Lr._rangeInitial0=Ur==="min"||Ur==="max reversed"?void 0:Lr.range[0],Lr._rangeInitial1=Ur==="max"||Ur==="min reversed"?void 0:Lr.range[1],Lr._autorangeInitial=Ur,Or=!0)}return Or},J.saveShowSpikeInitial=function(xt,ct){for(var Nr=J.list(xt,"",!0),Or=!1,Rr="on",Lr=0;Lr<Nr.length;Lr++){var Gr=Nr[Lr],Kr=Gr._showSpikeInitial===void 0,Ur=Kr||Gr.showspikes!==Gr._showspikes;(Kr||ct&&Ur)&&(Gr._showSpikeInitial=Gr.showspikes,Or=!0),Rr==="on"&&!Gr.showspikes&&(Rr="off")}return xt._fullLayout._cartesianSpikesEnabled=Rr,Or},J.autoBin=function(xt,ct,Nr,Or,Rr,Lr){var Gr=e.aggNums(Math.min,null,xt),Kr=e.aggNums(Math.max,null,xt);if(ct.type==="category"||ct.type==="multicategory")return{start:Gr-.5,end:Kr+.5,size:Math.max(1,Math.round(Lr)||1),_dataSpan:Kr-Gr};Rr||(Rr=ct.calendar);var Ur;if(ct.type==="log"?Ur={type:"linear",range:[Gr,Kr]}:Ur={type:ct.type,range:e.simpleMap([Gr,Kr],ct.c2r,0,Rr),calendar:Rr},J.setConvert(Ur),Lr=Lr&&s.dtick(Lr,Ur.type),Lr)Ur.dtick=Lr,Ur.tick0=s.tick0(void 0,Ur.type,Rr);else{var aa;if(Nr)aa=(Kr-Gr)/Nr;else{var da=e.distinctVals(xt),fa=Math.pow(10,Math.floor(Math.log(da.minDiff)/Math.LN10)),It=fa*e.roundUp(da.minDiff/fa,[.9,1.9,4.9,9.9],!0);aa=Math.max(It,2*e.stdev(xt)/Math.pow(xt.length,Or?.25:.4)),x(aa)||(aa=1)}J.autoTicks(Ur,aa)}var dr=Ur.dtick,kr=J.tickIncrement(J.tickFirst(Ur),dr,"reverse",Rr),na,Ca;if(typeof dr=="number")kr=Re(kr,xt,Ur,Gr,Kr),Ca=1+Math.floor((Kr-kr)/dr),na=kr+Ca*dr;else for(Ur.dtick.charAt(0)==="M"&&(kr=We(kr,xt,dr,Gr,Rr)),na=kr,Ca=0;na<=Kr;)na=J.tickIncrement(na,dr,!1,Rr),Ca++;return{start:ct.c2r(kr,0,Rr),end:ct.c2r(na,0,Rr),size:dr,_dataSpan:Kr-Gr}};function Re(xt,ct,Nr,Or,Rr){var Lr=0,Gr=0,Kr=0,Ur=0;function aa(dr){return(1+(dr-xt)*100/Nr.dtick)%100<2}for(var da=0;da<ct.length;da++)ct[da]%1===0?Kr++:x(ct[da])||Ur++,aa(ct[da])&&Lr++,aa(ct[da]+Nr.dtick/2)&&Gr++;var fa=ct.length-Ur;if(Kr===fa&&Nr.type!=="date")Nr.dtick<1?xt=Or-.5*Nr.dtick:(xt-=.5,xt+Nr.dtick<Or&&(xt+=Nr.dtick));else if(Gr<fa*.1&&(Lr>fa*.3||aa(Or)||aa(Rr))){var It=Nr.dtick/2;xt+=xt+It<Or?It:-It}return xt}function We(xt,ct,Nr,Or,Rr){var Lr=e.findExactDates(ct,Rr),Gr=.8;if(Lr.exactDays>Gr){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.dtick<xt._minDtick*2&&(xt.dtick=xt._minDtick,xt.tick0=xt.l2r(xt._forceTick0))}xt.ticklabelmode==="period"&&ut(xt),xt.tick0||(xt.tick0=xt.type==="date"?"2000-01-01":0),xt.type==="date"&&xt.dtick<.1&&(xt.dtick=.1),xr(xt)};function tt(xt){return+xt.substring(1)}function ut(xt){var ct;function Nr(){return!(x(xt.dtick)||xt.dtick.charAt(0)!=="M")}var Or=Nr(),Rr=J.getTickFormat(xt);if(Rr){var Lr=xt._dtickInit!==xt.dtick;/%[fLQsSMX]/.test(Rr)||(/%[HI]/.test(Rr)?(ct=u,Lr&&!Or&&xt.dtick<u&&(xt.dtick=u)):/%p/.test(Rr)?(ct=p,Lr&&!Or&&xt.dtick<p&&(xt.dtick=p)):/%[Aadejuwx]/.test(Rr)?(ct=b,Lr&&!Or&&xt.dtick<b&&(xt.dtick=b)):/%[UVW]/.test(Rr)?(ct=g,Lr&&!Or&&xt.dtick<g&&(xt.dtick=g)):/%[Bbm]/.test(Rr)?(ct=S,Lr&&(Or?tt(xt.dtick)<1:xt.dtick<E)&&(xt.dtick="M1")):/%[q]/.test(Rr)?(ct=l,Lr&&(Or?tt(xt.dtick)<3:xt.dtick<_)&&(xt.dtick="M3")):/%[Yy]/.test(Rr)&&(ct=m,Lr&&(Or?tt(xt.dtick)<12:xt.dtick<d)&&(xt.dtick="M12")))}Or=Nr(),Or&&xt.tick0===xt._dowTick0&&(xt.tick0=xt._rawTick0),xt._definedDelta=ct}function Me(xt,ct,Nr){for(var Or=0;Or<xt.length;Or++){var Rr=xt[Or].value,Lr=Or,Gr=Or+1;Or<xt.length-1?(Lr=Or,Gr=Or+1):Or>0?(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;Ca<kr;Ca++){var Fa=(Ca+.5)/kr;ct.maskBreaks(Rr*(1-Fa)+Fa*dr)!==F&&na++}fa*=na/kr,fa||(xt[Or].drop=!0),It&&aa>g&&(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]<aa[0],fa=Math.min(aa[0],aa[1]),It=Math.max(aa[0],aa[1]),dr=Math.max(1e3,ct._length||0),kr=[],na=[],Ca=[],Fa=[],Ya=[],ha=ct.minor&&(ct.minor.ticks||ct.minor.showgrid),Da=1;Da>=(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<Ai!==da)break;(Or==="category"||Or==="multicategory")&&(ki=da?Math.max(-.5,ki):Math.min(ct._categories.length-.5,ki))}var go=null,pi=to,Jo;if(Da){var Xo;zi?Xo=ct.dtick:Or==="date"?typeof ct.dtick=="string"&&ct.dtick.charAt(0)==="M"&&(Xo=S*ct.dtick.substring(1)):Xo=ct._roughDTick,Jo=Math.round((ct.r2l(pi)-ct.r2l(ct.tick0))/Xo)-1}var Ts=Pn.dtick;for(Pn.rangebreaks&&Pn._tick0Init!==Pn.tick0&&(pi=ra(pi,ct),da||(pi=J.tickIncrement(pi,Ts,!da,Rr))),Da&&Gr&&(pi=J.tickIncrement(pi,Ts,!da,Rr),Jo--);da?pi>=ki:pi<=ki;pi=J.tickIncrement(pi,Ts,da,Rr)){if(Da&&Jo++,Pn.rangebreaks&&!da){if(pi<Ai)continue;if(Pn.maskBreaks(pi)===F&&ra(pi,Pn)>=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<qi.length&&e.pushUnique(Ya,qi[al])})})}if(ha){var Vo=ct.minor.ticks==="inside"&&ct.ticks==="outside"||ct.minor.ticks==="outside"&&ct.ticks==="inside";if(!Vo){for(var Oo=Ca.map(function(ro){return ro.value}),lo=[],Co=0;Co<Fa.length;Co++){var os=Fa[Co],Ys=os.value;if(Oo.indexOf(Ys)===-1){for(var Os=!1,Yo=0;!Os&&Yo<Ca.length;Yo++)1e7+Ca[Yo].value===1e7+Ys&&(Os=!0);Os||lo.push(os)}}Fa=lo}}Gr&&Me(Ya,ct,ct._definedDelta);var jn;if(ct.rangebreaks){var Ci=ct._id.charAt(0)==="y",tl=1;ct.tickmode==="auto"&&(tl=ct.tickfont?ct.tickfont.size:12);var Bs=NaN;for(jn=Ca.length-1;jn>-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:Bs<uo+tl)?Ca.splice(da?jn+1:jn,1):Bs=uo}}ma(ct)&&Math.abs(aa[1]-aa[0])===360&&Ca.pop(),ct._tmax=(Ca[Ca.length-1]||{}).value,ct._prevDateHead="",ct._inCalcTicks=!0;var $s,ms=function(ro){ro.text="",ct._prevDateHead=$s};Ca=Ca.concat(Fa);function Is(ro,As){var al=J.tickText(ro,As.value,!1,As.simpleLabel),$i=As.periodX;return $i!==void 0&&(al.periodX=$i,($i>It||$i<fa)&&($i>It&&(al.periodX=It),$i<fa&&(al.periodX=fa),ms(al))),al}var rl;for(jn=0;jn<Ca.length;jn++){var Si=Ca[jn].minor,po=Ca[jn].value;Si?(Ur&&Ya.indexOf(Ca[jn])!==-1?rl=Is(ct,Ca[jn]):rl={x:po},rl.minor=!0,na.push(rl)):($s=ct._prevDateHead,rl=Is(ct,Ca[jn]),(Ca[jn].skipLabel||Ur&&Ya.indexOf(Ca[jn])===-1)&&ms(rl),kr.push(rl))}return kr=kr.concat(na),ct._inCalcTicks=!1,Gr&&kr.length&&(kr[0].noTick=!0),kr};function _e(xt,ct){return xt.rangebreaks&&(ct=ct.filter(function(Nr){return xt.maskBreaks(Nr.x)!==F})),ct}function fe(xt){var ct=xt._mainAxis,Nr=[];if(ct._vals){for(var Or=0;Or<ct._vals.length;Or++)if(!ct._vals[Or].noTick){var Rr=ct.l2p(ct._vals[Or].x),Lr=xt.p2l(Rr),Gr=J.tickText(xt,Lr);ct._vals[Or].minor&&(Gr.minor=!0,Gr.text=""),Nr.push(Gr)}}return Nr=_e(xt,Nr),Nr}function Fe(xt,ct){var Nr=e.simpleMap(xt.range,xt.r2l),Or=ce(Nr),Rr=Math.min(Or[0],Or[1]),Lr=Math.max(Or[0],Or[1]),Gr=xt.type==="category"?xt.d2l_noadd:xt.d2l;xt.type==="log"&&String(xt.dtick).charAt(0)!=="L"&&(xt.dtick="L"+Math.pow(10,Math.floor(Math.min(xt.range[0],xt.range[1]))-1));for(var Kr=[],Ur=0;Ur<=1;Ur++)if(!(ct!==void 0&&(ct&&Ur||ct===!1&&!Ur))&&!(Ur&&!xt.minor)){var aa=Ur?xt.minor.tickvals:xt.tickvals,da=Ur?[]:xt.ticktext;if(aa){e.isArrayOrTypedArray(da)||(da=[]);for(var fa=0;fa<aa.length;fa++){var It=Gr(aa[fa]);if(It>Rr&&It<Lr){var dr=J.tickText(xt,It,!1,String(da[fa]));Ur&&(dr.minor=!0,dr.text=""),Kr.push(dr)}}}}return Kr=_e(xt,Kr),Kr}var rt=[2,5,10],st=[1,2,3,6,12],Qe=[1,2,5,10,15,30],Lt=[1,2,3,7,14],kt=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],qt=[-.301,0,.301,.699,1],Zt=[15,30,45,90,180];function Sr(xt,ct,Nr){return ct*e.roundUp(xt/ct,Nr)}J.autoTicks=function(xt,ct,Nr){var Or;function Rr(fa){return Math.pow(fa,Math.floor(Math.log(ct)/Math.LN10))}if(xt.type==="date"){xt.tick0=e.dateTick0(xt.calendar,0);var Lr=2*ct;if(Lr>m)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]<Or[0],Lr=Rr?Math.floor:Math.ceil,Gr=ce(Or)[0],Kr=xt.dtick,Ur=Nr(xt.tick0);if(x(Kr)){var aa=Lr((Gr-Ur)/Kr)*Kr+Ur;return(xt.type==="category"||xt.type==="multicategory")&&(aa=e.constrain(aa,0,xt._categories.length-1)),aa}var da=Kr.charAt(0),fa=Number(Kr.substr(1));if(da==="M"){for(var It=0,dr=Ur,kr,na,Ca;It<10;){if(kr=J.tickIncrement(dr,Kr,Rr,xt.calendar),(kr-Gr)*(dr-Gr)<=0)return Rr?Math.min(dr,kr):Math.max(dr,kr);na=(Gr-(dr+kr)/2)/(kr-dr),Ca=da+(Math.abs(Math.round(na))||1)*fa,dr=J.tickIncrement(dr,Ca,na<0?!Rr:Rr,xt.calendar),It++}return e.error("tickFirst did not converge",xt),dr}else{if(da==="L")return Math.log(Lr((Math.pow(10,Gr)-Ur)/fa)*fa+Ur)/Math.LN10;if(da==="D"){var Fa=Kr==="D2"?qt:kt,Ya=e.roundUp(e.mod(Gr,1),Fa,Rr);return Math.floor(Gr)+Math.log(v.round(Math.pow(10,Ya),1))/Math.LN10}else throw"unrecognized dtick "+String(Kr)}},J.tickText=function(xt,ct,Nr,Or){var Rr=jr(xt,ct),Lr=xt.tickmode==="array",Gr=Nr||Lr,Kr=xt.type,Ur=Kr==="category"?xt.d2l_noadd:xt.d2l,aa,da=function(Ca){var Fa=xt.l2p(Ca);return Fa>=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<xt.ticktext.length&&!(Math.abs(ct-Ur(xt.tickvals[aa]))<It);aa++);if(aa<xt.ticktext.length)return Rr.text=String(xt.ticktext[aa]),Rr.xbnd=[da(Rr.x-.5),da(Rr.x+xt.dtick-.5)],Rr}function dr(Ca){if(Ca===void 0)return!0;if(Nr)return Ca==="none";var Fa={first:xt._tmin,last:xt._tmax}[Ca];return Ca!=="all"&&ct!==Fa}var kr=Nr?"never":xt.exponentformat!=="none"&&dr(xt.showexponent)?"hide":"";if(Kr==="date"?wr(xt,Rr,Nr,Gr):Kr==="log"?Ir(xt,Rr,Nr,Gr,kr):Kr==="category"?bt(xt,Rr):Kr==="multicategory"?Be(xt,Rr,Nr):ma(xt)?Ue(xt,Rr,Nr,Gr,kr):Ke(xt,Rr,Nr,Gr,kr),Or||(xt.tickprefix&&!dr(xt.showtickprefix)&&(Rr.text=xt.tickprefix+Rr.text),xt.ticksuffix&&!dr(xt.showticksuffix)&&(Rr.text+=xt.ticksuffix)),xt.labelalias&&xt.labelalias.hasOwnProperty(Rr.text)){var na=xt.labelalias[Rr.text];typeof na=="string"&&(Rr.text=na)}return(xt.tickson==="boundaries"||xt.showdividers)&&(Rr.xbnd=[da(Rr.x-.5),da(Rr.x+xt.dtick-.5)]),Rr},J.hoverLabelText=function(xt,ct,Nr){Nr&&(xt=e.extendFlat({},xt,{hoverformat:Nr}));var Or=e.isArrayOrTypedArray(ct)?ct[0]:ct,Rr=e.isArrayOrTypedArray(ct)?ct[1]:void 0;if(Rr!==void 0&&Rr!==Or)return J.hoverLabelText(xt,Or,Nr)+" - "+J.hoverLabelText(xt,Rr,Nr);var Lr=xt.type==="log"&&Or<=0,Gr=J.tickText(xt,xt.c2l(Lr?-Or:Or),"hover").text;return Lr?Or===0?"0":z+Gr:Gr};function jr(xt,ct,Nr){var Or=xt.tickfont||{};return{x:ct,dx:0,dy:0,text:Nr||"",fontSize:Or.size,font:Or.family,fontWeight:Or.weight,fontStyle:Or.style,fontVariant:Or.variant,fontTextcase:Or.textcase,fontLineposition:Or.lineposition,fontShadow:Or.shadow,fontColor:Or.color}}function wr(xt,ct,Nr,Or){var Rr=xt._tickround,Lr=Nr&&xt.hoverformat||J.getTickFormat(xt);Or=!Lr&&Or,Or&&(x(Rr)?Rr=4:Rr={y:"m",m:"d",d:"M",M:"S",S:4}[Rr]);var Gr=e.formatDate(ct.x,Lr,Rr,xt._dateFormat,xt.calendar,xt._extraFormat),Kr,Ur=Gr.indexOf(`
|
||
`);if(Ur!==-1&&(Kr=Gr.substr(Ur+1),Gr=Gr.substr(0,Ur)),Or&&(Kr!==void 0&&(Gr==="00:00:00"||Gr==="00:00")?(Gr=Kr,Kr=""):Gr.length===8&&(Gr=Gr.replace(/:00$/,""))),Kr)if(Nr)Rr==="d"?Gr+=", "+Kr:Gr=Kr+(Gr?", "+Gr:"");else if(!xt._inCalcTicks||xt._prevDateHead!==Kr)xt._prevDateHead=Kr,Gr+="<br>"+Kr;else{var aa=Ia(xt),da=xt._trueSide||xt.side;(!aa&&da==="top"||aa&&da==="bottom")&&(Gr+="<br> ")}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+="<sup>"+(It>0?"":z)+dr+"</sup>"),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=["<sup>",Gr[0],"</sup>","\u2044","<sub>",Gr[1],"</sub>","\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<fa)xt="0",Rr=!1;else{if(xt+=fa,Kr&&(xt*=Math.pow(10,-Kr),Lr+=Kr),Lr===0)xt=String(Math.floor(xt));else if(Lr<0){xt=String(Math.round(xt)),xt=xt.substr(0,xt.length+Lr);for(var It=Lr;It<0;It++)xt+="0"}else{xt=String(xt);var dr=xt.indexOf(".")+1;dr&&(xt=xt.substr(0,dr+Lr).replace(/\.?0+$/,""))}xt=e.numSeparate(xt,ct._separators,aa)}if(Kr&&Gr!=="hide"){Ce(Gr)&&Te(Kr)&&(Gr="power");var kr;Kr<0?kr=z+-Kr:Gr!=="power"?kr="+"+Kr:kr=String(Kr),Gr==="e"||Gr==="E"?xt+=Gr+kr:Gr==="power"?xt+="\xD710<sup>"+kr+"</sup>":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<xt.tickformatstops.length;ct++)if(Kr=xt.tickformatstops[ct],Kr.enabled&&Rr(xt.dtick,Kr.dtickrange,Nr)){Gr=Kr;break}break}case"log":{for(ct=0;ct<xt.tickformatstops.length;ct++)if(Kr=xt.tickformatstops[ct],Kr.enabled&&Lr(xt.dtick,Kr.dtickrange)){Gr=Kr;break}break}default:}return Gr?Gr.value:xt.tickformat},J.getSubplots=function(xt,ct){var Nr=xt._fullLayout._subplots,Or=Nr.cartesian.concat(Nr.gl2d||[]),Rr=ct?J.findSubplotsWithAxis(Or,ct):Or;return Rr.sort(function(Lr,Gr){var Kr=Lr.substr(1).split("y"),Ur=Gr.substr(1).split("y");return Kr[0]===Ur[0]?+Kr[1]-+Ur[1]:+Kr[0]-+Ur[0]}),Rr},J.findSubplotsWithAxis=function(xt,ct){for(var Nr=new RegExp(ct._id.charAt(0)==="x"?"^"+ct._id+"y":ct._id+"$"),Or=[],Rr=0;Rr<xt.length;Rr++){var Lr=xt[Rr];Nr.test(Lr)&&Or.push(Lr)}return Or},J.makeClipPaths=function(xt){var ct=xt._fullLayout;if(!ct._hasOnlyLargeSploms){var Nr={_offset:0,_length:ct.width,_id:""},Or={_offset:0,_length:ct.height,_id:""},Rr=J.list(xt,"x",!0),Lr=J.list(xt,"y",!0),Gr=[],Kr,Ur;for(Kr=0;Kr<Rr.length;Kr++)for(Gr.push({x:Rr[Kr],y:Or}),Ur=0;Ur<Lr.length;Ur++)Kr===0&&Gr.push({x:Nr,y:Lr[Ur]}),Gr.push({x:Rr[Kr],y:Lr[Ur]});var aa=ct._clips.selectAll(".axesclip").data(Gr,function(da){return da.x._id+da.y._id});aa.enter().append("clipPath").classed("axesclip",!0).attr("id",function(da){return"clip"+ct._uid+da.x._id+da.y._id}).append("rect"),aa.exit().remove(),aa.each(function(da){v.select(this).select("rect").attr({x:da.x._offset||0,y:da.y._offset||0,width:da.x._length||1,height:da.y._length||1})})}},J.draw=function(xt,ct,Nr){var Or=xt._fullLayout;ct==="redraw"&&Or._paper.selectAll("g.subplot").each(function(Ur){var aa=Ur[0],da=Or._plots[aa];if(da){var fa=da.xaxis,It=da.yaxis;da.xaxislayer.selectAll("."+fa._id+"tick").remove(),da.yaxislayer.selectAll("."+It._id+"tick").remove(),da.xaxislayer.selectAll("."+fa._id+"tick2").remove(),da.yaxislayer.selectAll("."+It._id+"tick2").remove(),da.xaxislayer.selectAll("."+fa._id+"divider").remove(),da.yaxislayer.selectAll("."+It._id+"divider").remove(),da.minorGridlayer&&da.minorGridlayer.selectAll("path").remove(),da.gridlayer&&da.gridlayer.selectAll("path").remove(),da.zerolinelayer&&da.zerolinelayer.selectAll("path").remove(),da.zerolinelayerAbove&&da.zerolinelayerAbove.selectAll("path").remove(),Or._infolayer.select(".g-"+fa._id+"title").remove(),Or._infolayer.select(".g-"+It._id+"title").remove()}});var Rr=!ct||ct==="redraw"?J.listIds(xt):ct,Lr=J.list(xt),Gr=Lr.filter(function(Ur){return Ur.autoshift}).map(function(Ur){return Ur.overlaying});Rr.map(function(Ur){var aa=J.getFromId(xt,Ur);if(aa.tickmode==="sync"&&aa.overlaying){var da=Rr.findIndex(function(fa){return fa===aa.overlaying});da>=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;Lr<ha.length;Lr++)ha[Lr].axInfo=Da;ct._selections={},ct._tickAngles&&(ct._prevTickAngles=ct._tickAngles),ct._tickAngles={},ct._depth=null;var Zn={};function Pn(po){var ro=aa+(po||"tick");return Zn[ro]||(Zn[ro]=Gt(ct,ro,Fa)),Zn[ro]}if(ct.visible){var fi=J.makeTransTickFn(ct),Ai=J.makeTransTickLabelFn(ct),ki,zi,Xi=ct.ticks==="inside",to=ct.ticks==="outside";if(ct.tickson==="boundaries"){var go=yt(ct,ha);zi=J.clipEnds(ct,go),ki=Xi?zi:go}else zi=J.clipEnds(ct,ha),ki=Xi&&ct.ticklabelmode!=="period"?zi:ha;var pi=ct._gridVals=zi,Jo=Ot(ct,ha);if(!Ur._hasOnlyLargeSploms){var Xo=ct._subplotsWith,Ts={};for(Lr=0;Lr<Xo.length;Lr++){Gr=Xo[Lr],Kr=Ur._plots[Gr];var Po=Kr[fa+"axis"],so=Po._mainAxis._id;if(!Ts[so]){Ts[so]=1;var qi=da==="x"?"M0,"+Po._offset+"v"+Po._length:"M"+Po._offset+",0h"+Po._length;J.drawGrid(xt,ct,{vals:pi,counterAxis:Po,layer:Kr.gridlayer.select("."+aa),minorLayer:Kr.minorGridlayer.select("."+aa),path:qi,transFn:fi}),J.drawZeroLine(xt,ct,{counterAxis:Po,layer:dr?Kr.zerolinelayerAbove:Kr.zerolinelayer,path:qi,transFn:fi})}}}var To,Vo=J.getTickSigns(ct),Oo=J.getTickSigns(ct,"minor");if(ct.ticks||ct.minor&&ct.minor.ticks){var lo=J.makeTickPath(ct,Fa,Vo[2]),Co=J.makeTickPath(ct,Fa,Oo[2],{minor:!0}),os,Ys,Os,Yo;if(ct._anchorAxis&&ct.mirror&&ct.mirror!==!0?(os=J.makeTickPath(ct,Ya,Vo[3]),Ys=J.makeTickPath(ct,Ya,Oo[3],{minor:!0}),Os=lo+os,Yo=Co+Ys):(os="",Ys="",Os=lo,Yo=Co),ct.showdividers&&to&&ct.tickson==="boundaries"){var jn={};for(Lr=0;Lr<Jo.length;Lr++)jn[Jo[Lr].x]=1;To=function(po){return jn[po.x]?os:Os}}else To=function(po){return po.minor?Yo:Os}}if(J.drawTicks(xt,ct,{vals:ki,layer:na,path:To,transFn:fi}),ct.mirror==="allticks"){var Ci=Object.keys(ct._linepositions||{});for(Lr=0;Lr<Ci.length;Lr++){Gr=Ci[Lr],Kr=Ur._plots[Gr];var tl=ct._linepositions[Gr]||[],Bs=tl[0],uo=tl[1],$s=tl[2],ms=J.makeTickPath(ct,Bs,$s?Vo[0]:Oo[0],{minor:$s})+J.makeTickPath(ct,uo,$s?Vo[1]:Oo[1],{minor:$s});J.drawTicks(xt,ct,{vals:ki,layer:Kr[da+"axislayer"],path:ms,transFn:fi})}}var Is=[];if(Is.push(function(){return J.drawLabels(xt,ct,{vals:ha,layer:na,plotinfo:Kr,transFn:Ai,labelFns:J.makeLabelFns(ct,Fa)})}),ct.type==="multicategory"){var rl={x:2,y:10}[da];Is.push(function(){var po={x:"height",y:"width"}[da],ro=Pn()[po]+rl+(ct._tickAngles[aa+"tick"]?ct.tickfont.size*he:0);return J.drawLabels(xt,ct,{vals:Tt(ct,ha),layer:na,cls:aa+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:fi,labelFns:J.makeLabelFns(ct,Fa+ro*Vo[4])})}),Is.push(function(){return ct._depth=Vo[4]*(Pn("tick2")[ct.side]-Fa),la(xt,ct,{vals:Jo,layer:na,path:J.makeTickPath(ct,Fa,Vo[4],{len:ct._depth}),transFn:fi})})}else ct.title.hasOwnProperty("standoff")&&Is.push(function(){ct._depth=Vo[4]*(Pn()[ct.side]-Fa)});var Si=M.getComponentMethod("rangeslider","isVisible")(ct);return!Nr.skipTitle&&!(Si&&ct.side==="bottom")&&Is.push(function(){return Ba(xt,ct)}),Is.push(function(){var po=ct.side.charAt(0),ro=H[ct.side].charAt(0),As=J.getPxPosition(xt,ct),al=to?ct.ticklen:0,$i,zs,au,fl;(ct.automargin||Si||ct._shiftPusher)&&(ct.type==="multicategory"?$i=Pn("tick2"):($i=Pn(),da==="x"&&po==="b"&&(ct._depth=Math.max($i.width>0?$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;Or<ct.length;Or++)Rr(ct[Or],0);Rr(ct[Or-1],1)}return Nr}function Tt(xt,ct){for(var Nr=[],Or={},Rr=0;Rr<ct.length;Rr++){var Lr=ct[Rr];Or[Lr.text2]?Or[Lr.text2].push(Lr.x):Or[Lr.text2]=[Lr.x]}for(var Gr in Or)Nr.push(jr(xt,e.interp(Or[Gr],.5),Gr));return Nr}function Ot(xt,ct){var Nr=[],Or,Rr,Lr=ct.length&&ct[ct.length-1].x<ct[0].x,Gr=function(Ur,aa){var da=Ur.xbnd[aa];da!==null&&Nr.push(e.extendFlat({},Ur,{x:da}))};if(xt.showdividers&&ct.length){for(Or=0;Or<ct.length;Or++){var Kr=ct[Or];Kr.text2!==Rr&&Gr(Kr,Lr?1:0),Rr=Kr.text2}Gr(ct[Or-1],Lr?0:1)}return Nr}function Gt(xt,ct,Nr){var Or,Rr,Lr,Gr;if(xt._selections[ct].size())Or=1/0,Rr=-1/0,Lr=1/0,Gr=-1/0,xt._selections[ct].each(function(){var Ur=en(this);if(Ur.node().style.display!=="none"){var aa=n.bBox(Ur.node().parentNode);Or=Math.min(Or,aa.top),Rr=Math.max(Rr,aa.bottom),Lr=Math.min(Lr,aa.left),Gr=Math.max(Gr,aa.right)}});else{var Kr=J.makeLabelFns(xt,Nr);Or=Rr=Kr.yFn({dx:0,dy:0,fontSize:0}),Lr=Gr=Kr.xFn({dx:0,dy:0,fontSize:0})}return{top:Or,bottom:Rr,left:Lr,right:Gr,height:Rr-Or,width:Gr-Lr}}J.getTickSigns=function(xt,ct){var Nr=xt._id.charAt(0),Or={x:"top",y:"right"}[Nr],Rr=xt.side===Or?1:-1,Lr=[-1,1,Rr,-Rr],Gr=ct?(xt.minor||{}).ticks:xt.ticks;return Gr!=="inside"==(Nr==="x")&&(Lr=Lr.map(function(Kr){return-Kr})),xt.side&&Lr.push({l:-1,t:-1,r:1,b:1}[xt.side.charAt(0)]),Lr},J.makeTransTickFn=function(xt){return xt._id.charAt(0)==="x"?function(ct){return t(xt._offset+xt.l2p(ct.x),0)}:function(ct){return t(0,xt._offset+xt.l2p(ct.x))}},J.makeTransTickLabelFn=function(xt){var ct=Qt(xt),Nr=xt.ticklabelshift||0,Or=xt.ticklabelstandoff||0,Rr=ct[0],Lr=ct[1],Gr=xt.range[0]>xt.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<Gr.length;aa++){var da=Gr[aa].x;if(Ur?!da:Math.abs(da)<ct.dtick/100)if(Gr=Gr.slice(0,aa).concat(Gr.slice(aa+1)),Ur)aa--;else break}ct._gw=n.crispRound(xt,ct.gridwidth,1);for(var fa=Rr?n.crispRound(xt,ct.minor.gridwidth,1):0,It=Nr.layer,dr=Nr.minorLayer,kr=1;kr>=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.left<Co)&&(Is=1):(ms.bottom>os||ms.top+(ct.tickangle?0:Bs.fontSize/4)<Co)&&(Is=1);var rl=uo.select("text");Is?qi&&rl.style("display","none"):rl.node().style.display!=="none"&&(rl.style("display",null),Ys==="bottom"||Ys==="right"?Os=Math.min(Os,To?ms.top:ms.left):Os=-1/0,Ys==="top"||Ys==="left"?Yo=Math.max(Yo,To?ms.bottom:ms.right):Yo=1/0)}});for(var jn in Or._plots){var Ci=Or._plots[jn];if(!(ct._id!==Ci.xaxis._id&&ct._id!==Ci.yaxis._id)){var tl=To?Ci.yaxis:Ci.xaxis;tl&&(tl["_visibleLabelMin_"+ct._id]=Os,tl["_visibleLabelMax_"+ct._id]=Yo)}}}},ct._hideCounterAxisInsideTickLabels=function(so){var qi=ct._id.charAt(0)==="x",To=[];for(var Vo in Or._plots){var Oo=Or._plots[Vo];ct._id!==Oo.xaxis._id&&ct._id!==Oo.yaxis._id||To.push(qi?Oo.yaxis:Oo.xaxis)}To.forEach(function(lo,Co){lo&&Ia(lo)&&(so||[B,I,O,N,U]).forEach(function(os){var Ys=os.K==="tick"&&os.L==="text"&&ct.ticklabelmode==="period",Os=Or._plots[ct._mainSubplot],Yo;if(os.K===B.K){var jn=Lr?Os.zerolinelayerAbove:Os.zerolinelayer;Yo=jn.selectAll("."+ct._id+"zl")}else os.K===I.K?Yo=Os.minorGridlayer.selectAll("."+ct._id):os.K===O.K?Yo=Os.gridlayer.selectAll("."+ct._id):Yo=Os[ct._id.charAt(0)+"axislayer"];Yo.each(function(){var Ci=v.select(this);os.L&&(Ci=Ci.selectAll(os.L)),Ci.each(function(tl){var Bs=ct.l2p(Ys?rr(tl):tl.x)+ct._offset,uo=v.select(this);Bs<ct["_visibleLabelMax_"+lo._id]&&Bs>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))<Math.abs(Math.cos(au))?zs:au},jn[0]));var tl=Ci*(180/Math.PI);if(Oo){var Bs=2;for(ct.ticks&&(Bs+=ct.tickwidth/2),To=0;To<qi.length;To++){var uo=Kr[To].xbnd,$s=qi[To];if(uo[0]!==null&&$s.left-ct.l2p(uo[0])<Bs||uo[1]!==null&&ct.l2p(uo[1])-$s.right<Bs){na=tl;break}}}else{var ms=ct.ticklabelposition||"",Is=ct.tickson||"",rl=function(zs){return ms.indexOf(zs)!==-1},Si=rl("top"),po=rl("left"),ro=rl("right"),As=rl("bottom"),al=Is!=="boundaries"&&(As||po||Si||ro),$i=al?(ct.tickwidth||0)+2*$:0;for(To=0;To<qi.length-1;To++)if(e.bBoxIntersect(qi[To],qi[To+1],$i)){na=tl;break}}na&&dr(fa,na)}}ct._selections&&(ct._selections[Gr]=fa);var Fa=[kr];ct.automargin&&Or._redrawFromAutoMarginCount&&da===90?(na=da,Fa.push(function(){dr(fa,da)})):Fa.push(Ca),ct._tickAngles&&Fa.push(function(){ct._tickAngles[Gr]=na===null?x(aa)?aa:0:na});var Ya=function(){var so=0,qi=0;return fa.each(function(To,Vo){var Oo=en(this),lo=Oo.select(".text-math-group");if(lo.empty()){var Co;ct._vals[Vo]&&(Co=ct._vals[Vo].bb||n.bBox(Oo.node()),ct._vals[Vo].bb=Co),so=Math.max(so,Co.width),qi=Math.max(qi,Co.height)}}),{labelsMaxW:so,labelsMaxH:qi}},ha=ct._anchorAxis;if(ha&&(ha.autorange||ha.insiderange)&&Ia(ct)&&!j(Or,ct._id)&&(Or._insideTickLabelsUpdaterange||(Or._insideTickLabelsUpdaterange={}),ha.autorange&&(Or._insideTickLabelsUpdaterange[ha._name+".autorange"]=ha.autorange,Fa.push(Ya)),ha.insiderange)){var Da=Ya(),Zn=ct._id.charAt(0)==="y"?Da.labelsMaxW:Da.labelsMaxH;Zn+=2*$,ct.ticklabelposition==="inside"&&(Zn+=ct.ticklen||0);var Pn=ct.side==="right"||ct.side==="top"?1:-1,fi=Pn===1?1:0,Ai=Pn===1?0:1,ki=[];ki[Ai]=ha.range[Ai];var zi=ha.range,Xi=ha.r2p(zi[fi]),to=ha.r2p(zi[Ai]),go=Or._insideTickLabelsUpdaterange[ha._name+".range"];if(go){var pi=ha.r2p(go[fi]),Jo=ha.r2p(go[Ai]),Xo=Pn*(ct._id.charAt(0)==="y"?1:-1);Xo*Xi<Xo*pi&&(Xi=pi,ki[fi]=zi[fi]=go[fi]),Xo*to>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&&Nr<xt._length-1}function Qa(xt,ct,Nr,Or){var Rr=Nr._mainAxis;if(!Rr)return;var Lr=xt._fullLayout,Gr=ct._id.charAt(0),Kr=J.counterLetter(ct._id),Ur=ct._offset+(Math.abs(Or[0])<Math.abs(Or[1])==(Gr==="x")?0:ct._length);function aa(kr){if(!kr.showline||!kr.linewidth)return!1;var na=Math.max((kr.linewidth+ct.zerolinewidth)/2,1);function Ca(ha){return typeof ha=="number"&&Math.abs(ha-Ur)<na}if(Ca(kr._mainLinePosition)||Ca(kr._mainMirrorPosition))return!0;var Fa=kr._linepositions||{};for(var Ya in Fa)if(Ca(Fa[Ya][0])||Ca(Fa[Ya][1]))return!0}var da=Lr._plots[Nr._mainSubplot];if(!(da.mainplotinfo||da).overlays.length)return aa(Nr,Ur);for(var fa=J.list(xt,Kr),It=0;It<fa.length;It++){var dr=fa[It];if(dr._mainAxis===Rr&&aa(dr,Ur))return!0}}function za(xt,ct){for(var Nr=xt._fullData,Or=ct._mainSubplot,Rr=ct._id.charAt(0),Lr=0;Lr<Nr.length;Lr++){var Gr=Nr[Lr];if(Gr.visible===!0&&Gr.xaxis+Gr.yaxis===Or&&(M.traceIs(Gr,"bar-like")&&Gr.orientation==={x:"h",y:"v"}[Rr]||Gr.fill&&Gr.fill.charAt(Gr.fill.length-1)===Rr))return!0}return!1}function en(xt){var ct=v.select(xt),Nr=ct.select(".text-math-group");return Nr.empty()?ct.select("text"):Nr}J.allowAutoMargin=function(xt){for(var ct=J.list(xt,"",!0),Nr=0;Nr<ct.length;Nr++){var Or=ct[Nr];Or.automargin&&(A.allowAutoMargin(xt,kn(Or)),Or.mirror&&A.allowAutoMargin(xt,Jt(Or))),M.getComponentMethod("rangeslider","isVisible")(Or)&&A.allowAutoMargin(xt,Nt(Or))}};function kn(xt){return xt._id+".automargin"}function Jt(xt){return kn(xt)+".mirror"}function Nt(xt){return xt._id+".rangeslider"}J.swap=function(xt,ct){for(var Nr=Kt(xt,ct),Or=0;Or<Nr.length;Or++)Pr(xt,Nr[Or].x,Nr[Or].y)};function Kt(xt,ct){var Nr=[],Or,Rr;for(Or=0;Or<ct.length;Or++){var Lr=[],Gr=xt._fullData[ct[Or]].xaxis,Kr=xt._fullData[ct[Or]].yaxis;if(!(!Gr||!Kr)){for(Rr=0;Rr<Nr.length;Rr++)(Nr[Rr].x.indexOf(Gr)!==-1||Nr[Rr].y.indexOf(Kr)!==-1)&&Lr.push(Rr);if(!Lr.length){Nr.push({x:[Gr],y:[Kr]});continue}var Ur=Nr[Lr[0]],aa;if(Lr.length>1)for(Rr=1;Rr<Lr.length;Rr++)aa=Nr[Lr[Rr]],Wt(Ur.x,aa.x),Wt(Ur.y,aa.y);Wt(Ur.x,[Gr]),Wt(Ur.y,[Kr])}}return Nr}function Wt(xt,ct){for(var Nr=0;Nr<ct.length;Nr++)xt.indexOf(ct[Nr])===-1&&xt.push(ct[Nr])}function Pr(xt,ct,Nr){var Or=[],Rr=[],Lr=xt.layout,Gr,Kr;for(Gr=0;Gr<ct.length;Gr++)Or.push(J.getFromId(xt,ct[Gr]));for(Gr=0;Gr<Nr.length;Gr++)Rr.push(J.getFromId(xt,Nr[Gr]));var Ur=Object.keys(o),aa=["anchor","domain","overlaying","position","side","tickangle","editType"],da=["linear","log"];for(Gr=0;Gr<Ur.length;Gr++){var fa=Ur[Gr],It=Or[0][fa],dr=Rr[0][fa],kr=!0,na=!1,Ca=!1;if(!(fa.charAt(0)==="_"||typeof It=="function"||aa.indexOf(fa)!==-1)){for(Kr=1;Kr<Or.length&&kr;Kr++){var Fa=Or[Kr][fa];fa==="type"&&da.indexOf(It)!==-1&&da.indexOf(Fa)!==-1&&It!==Fa?na=!0:Fa!==It&&(kr=!1)}for(Kr=1;Kr<Rr.length&&kr;Kr++){var Ya=Rr[Kr][fa];fa==="type"&&da.indexOf(dr)!==-1&&da.indexOf(Ya)!==-1&&dr!==Ya?Ca=!0:Rr[Kr][fa]!==dr&&(kr=!1)}kr&&(na&&(Lr[Or[0]._name].type="linear"),Ca&&(Lr[Rr[0]._name].type="linear"),ta(Lr,fa,Or,Rr,xt._fullLayout._dfltTitle))}}for(Gr=0;Gr<xt._fullLayout.annotations.length;Gr++){var ha=xt._fullLayout.annotations[Gr];ct.indexOf(ha.xref)!==-1&&Nr.indexOf(ha.yref)!==-1&&e.swapAttrs(Lr.annotations[Gr],["?"])}}function ta(xt,ct,Nr,Or,Rr){var Lr=e.nestedProperty,Gr=Lr(xt[Nr[0]._name],ct).get(),Kr=Lr(xt[Or[0]._name],ct).get(),Ur;for(ct==="title"&&(Gr&&Gr.text===Rr.x&&(Gr.text=Rr.y),Kr&&Kr.text===Rr.y&&(Kr.text=Rr.x)),Ur=0;Ur<Nr.length;Ur++)Lr(xt,Nr[Ur]._name+"."+ct).set(Kr);for(Ur=0;Ur<Or.length;Ur++)Lr(xt,Or[Ur]._name+"."+ct).set(Gr)}function ma(xt){return xt._id==="angularaxis"}function ra(xt,ct){for(var Nr=ct._rangebreaks.length,Or=0;Or<Nr;Or++){var Rr=ct._rangebreaks[Or];if(xt>=Rr.min&&xt<Rr.max)return Rr.max}return xt}function Ia(xt){return(xt.ticklabelposition||"").indexOf("inside")!==-1}function Ha(xt,ct){Ia(xt._anchorAxis||{})&&xt._hideCounterAxisInsideTickLabels&&xt._hideCounterAxisInsideTickLabels(ct)}function rn(xt,ct,Nr,Or){var Rr=xt.anchor!=="free"&&(xt.overlaying===void 0||xt.overlaying===!1)?xt._id:xt.overlaying,Lr;Or?Lr=xt.side==="right"?ct:-ct:Lr=ct,Rr in Nr||(Nr[Rr]={}),xt.side in Nr[Rr]||(Nr[Rr][xt.side]=0),Nr[Rr][xt.side]+=Lr}function nn(xt,ct){return xt.autoshift?ct[xt.overlaying][xt.side]:xt.shift||0}function yn(xt,ct){return/%f/.test(ct)?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)<z&&(P=0),Math.abs(L)<z&&(L=0),[P,L]}var p=o.clampFn||b;function u(P){s._dragged=!1,s._dragging=!0;var L=a(P);d=L[0],T=L[1],E=P.target,S=P,g=P.buttons===2||P.ctrlKey,typeof P.clientX>"u"&&typeof P.clientY>"u"&&(P.clientX=d,P.clientY=T),l=new Date().getTime(),l-s._mouseDownTime<h?c+=1:(c=1,s._mouseDownTime=l),o.prepFn&&o.prepFn(P,d,T),x&&!g?(w=i(),w.style.cursor=window.getComputedStyle(m).cursor):x||(w=document,_=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(m).cursor),document.addEventListener("mouseup",f),document.addEventListener("touchend",f),o.dragmode!==!1&&(P.preventDefault(),document.addEventListener("mousemove",y),document.addEventListener("touchmove",y,{passive:!1}))}function y(P){P.preventDefault();var L=a(P),z=o.minDrag||e.MINDRAG,F=p(L[0]-d,L[1]-T,z),B=F[0],O=F[1];(B||O)&&(s._dragged=!0,t.unhover(s,P)),s._dragged&&o.moveFn&&!g&&(s._dragdata={element:m,dx:B,dy:O},o.moveFn(B,O))}function f(P){if(delete s._dragdata,o.dragmode!==!1&&(P.preventDefault(),document.removeEventListener("mousemove",y),document.removeEventListener("touchmove",y)),document.removeEventListener("mouseup",f),document.removeEventListener("touchend",f),x?M(w):_&&(w.documentElement.style.cursor=_,_=null),!s._dragging){s._dragged=!1;return}if(s._dragging=!1,new Date().getTime()-s._mouseDownTime>h&&(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<i.length;a++){var n=i[a];n.indexOf("cursor-")===0&&e.attr(x,n.substr(7)).classed(n,!1)}e.attr(x)||e.attr(x,A)}v(e,t)}else r&&(e.attr(x,null),r===A?v(e):v(e,r))}}}),pS=Ze({"src/components/legend/attributes.js"(Z,q){"use strict";var v=tc(),x=oh();q.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:x.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:v({editType:"legend"}),grouptitlefont:v({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:v({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}}),b2=Ze({"src/components/legend/helpers.js"(Z){"use strict";Z.isGrouped=function(v){return(v.traceorder||"").indexOf("grouped")!==-1},Z.isVertical=function(v){return v.orientation!=="h"},Z.isReversed=function(v){return(v.traceorder||"").indexOf("reversed")!==-1}}}),dS=Ze({"src/components/legend/defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=Dl(),M=eu(),e=pS(),t=$y(),r=b2();function i(a,n,o,s){var c=n[a]||{},h=A.newContainer(o,a);function m(he,H){return x.coerce(c,h,e,he,H)}var d=x.coerceFont(m,"font",o.font);m("bgcolor",o.paper_bgcolor),m("bordercolor");var T=m("visible");if(T){for(var l,_=function(he,H){var $=l._input,J=l;return x.coerce($,J,M,he,H)},w=o.font||{},S=x.coerceFont(m,"grouptitlefont",w,{overrideDflt:{size:Math.round(w.size*1.1)}}),E=0,g=!1,b="normal",p=(o.shapes||[]).filter(function(he){return he.showlegend}),u=s.concat(p).filter(function(he){return a===(he.legend||"legend")}),y=0;y<u.length;y++)if(l=u[y],!!l.visible){var f=l._isShape;(l.showlegend||l._dfltShowLegend&&!(l._module&&l._module.attributes&&l._module.attributes.showlegend&&l._module.attributes.showlegend.dflt===!1))&&(E++,l.showlegend&&(g=!0,(!f&&v.traceIs(l,"pie-like")||l._input.showlegend===!0)&&E++),x.coerceFont(_,"legendgrouptitle.font",S)),(!f&&v.traceIs(l,"bar")&&o.barmode==="stack"||["tonextx","tonexty"].indexOf(l.fill)!==-1)&&(b=r.isGrouped({traceorder:b})?"grouped+reversed":"reversed"),l.legendgroup!==void 0&&l.legendgroup!==""&&(b=r.isReversed({traceorder:b})?"reversed+grouped":"grouped")}var P=x.coerce(n,o,t,"showlegend",g&&E>(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;c<m.length;c++){var d=m[c];if(d.showlegend){var T={_input:d._input,visible:d.visible,showlegend:d.showlegend,legend:d.legend};h.push(T)}}var l=["legend"];for(c=0;c<h.length;c++)x.pushUnique(l,h[c].legend);for(o._legends=[],c=0;c<l.length;c++){var _=l[c];i(_,n,o,h),o[_]&&o[_].visible&&(o[_]._id=_),o._legends.push(_)}}}}),pO=Ze({"src/components/legend/handle_click.js"(Z,q){"use strict";var v=oo(),x=ca(),A=x.pushUnique,M=!0;q.exports=function(t,r,i){var a=r._fullLayout;if(r._dragged||r._editing)return;var n=a.legend.itemclick,o=a.legend.itemdoubleclick,s=a.legend.groupclick;i===1&&n==="toggle"&&o==="toggleothers"&&M&&r.data&&r._context.showTips&&x.notifier(x._(r,"Double-click on legend to isolate one trace"),"long"),M=!1;var c;if(i===1?c=n:i===2&&(c=o),!c)return;var h=s==="togglegroup",m=a.hiddenlabels?a.hiddenlabels.slice():[],d=t.data()[0][0];if(d.groupTitle&&d.noClick)return;var T=r._fullData,l=(a.shapes||[]).filter(function(Me){return Me.showlegend}),_=T.concat(l),w=d.trace;w._isShape&&(w=w._fullInput);var S=w.legendgroup,E,g,b,p,u,y,f={},P=[],L=[],z=[];function F(Me,_e){var fe=P.indexOf(Me),Fe=f.visible;return Fe||(Fe=f.visible=[]),P.indexOf(Me)===-1&&(P.push(Me),fe=P.length-1),Fe[fe]=_e,fe}var B=(a.shapes||[]).map(function(Me){return Me._input}),O=!1;function I(Me,_e){B[Me].visible=_e,O=!0}function N(Me,_e){if(!(d.groupTitle&&!h)){var fe=Me._fullInput||Me,Fe=fe._isShape,rt=fe.index;rt===void 0&&(rt=fe._index);var st=fe.visible===!1?!1:_e;Fe?I(rt,st):F(rt,st)}}var U=w.legend,W=w._fullInput,Q=W&&W._isShape;if(!Q&&v.traceIs(w,"pie-like")){var ue=d.label,se=m.indexOf(ue);if(c==="toggle")se===-1?m.push(ue):m.splice(se,1);else if(c==="toggleothers"){var he=se!==-1,H=[];for(E=0;E<r.calcdata.length;E++){var $=r.calcdata[E];for(g=0;g<$.length;g++){var J=$[g],X=J.label;U===$[0].trace.legend&&ue!==X&&(m.indexOf(X)===-1&&(he=!0),A(m,X),H.push(X))}}if(!he)for(var oe=0;oe<H.length;oe++){var ne=m.indexOf(H[oe]);ne!==-1&&m.splice(ne,1)}}v.call("_guiRelayout",r,"hiddenlabels",m)}else{var j=S&&S.length,ee=[],re;if(j)for(E=0;E<_.length;E++)re=_[E],re.visible&&re.legendgroup===S&&ee.push(E);if(c==="toggle"){var ce;switch(w.visible){case!0:ce="legendonly";break;case!1:ce=!1;break;case"legendonly":ce=!0;break}if(j)if(h)for(E=0;E<_.length;E++){var be=_[E];be.visible!==!1&&be.legendgroup===S&&N(be,ce)}else N(w,ce);else N(w,ce)}else if(c==="toggleothers"){var Ae,ze,Re,We,it,ot=!0;for(E=0;E<_.length;E++)if(it=_[E],Ae=it===w,Re=it.showlegend!==!0,!(Ae||Re)&&(ze=j&&it.legendgroup===S,!ze&&it.legend===U&&it.visible===!0&&!v.traceIs(it,"notLegendIsolatable"))){ot=!1;break}for(E=0;E<_.length;E++)if(it=_[E],!(it.visible===!1||it.legend!==U)&&!v.traceIs(it,"notLegendIsolatable"))switch(w.visible){case"legendonly":N(it,!0);break;case!0:We=ot?!0:"legendonly",Ae=it===w,Re=it.showlegend!==!0&&!it.legendgroup,ze=Ae||j&&it.legendgroup===S,N(it,ze||Re?!0:We);break}}for(E=0;E<L.length;E++)if(b=L[E],!!b){var tt=b.constructUpdate(),ut=Object.keys(tt);for(g=0;g<ut.length;g++)p=ut[g],y=f[p]=f[p]||[],y[z[E]]=tt[p]}for(u=Object.keys(f),E=0;E<u.length;E++)for(p=u[E],g=0;g<P.length;g++)f[p].hasOwnProperty(g)||(f[p][g]=void 0);O?v.call("_guiUpdate",r,f,{shapes:B},P):v.call("_guiRestyle",r,f,P)}}}}),vS=Ze({"src/components/legend/constants.js"(Z,q){"use strict";q.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}}),dO=Ze({"src/components/legend/get_legend_data.js"(Z,q){"use strict";var v=oo(),x=b2();q.exports=function(M,e,t){var r=e._inHover,i=x.isGrouped(e),a=x.isReversed(e),n={},o=[],s=!1,c={},h=0,m=0,d,T;function l(N,U,W){if(e.visible!==!1&&!(t&&N!==e._id))if(U===""||!x.isGrouped(e)){var Q="~~i"+h;o.push(Q),n[Q]=[W],h++}else o.indexOf(U)===-1?(o.push(U),s=!0,n[U]=[W]):n[U].push(W)}for(d=0;d<M.length;d++){var _=M[d],w=_[0],S=w.trace,E=S.legend,g=S.legendgroup;if(!(!r&&(!S.visible||!S.showlegend)))if(v.traceIs(S,"pie-like"))for(c[g]||(c[g]={}),T=0;T<_.length;T++){var b=_[T].label;c[g][b]||(l(E,g,{label:b,color:_[T].color,i:_[T].i,trace:S,pts:_[T].pts}),c[g][b]=!0,m=Math.max(m,(b||"").length))}else l(E,g,w),m=Math.max(m,(S.name||"").length)}if(!o.length)return[];var p=!s||!i,u=[];for(d=0;d<o.length;d++){var y=n[o[d]];p?u.push(y[0]):u.push(y)}for(p&&(u=[u]),d=0;d<u.length;d++){var f=1/0;for(T=0;T<u[d].length;T++){var P=u[d][T].trace.legendrank;f>P&&(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;d<u.length;d++){u[d].forEach(function(N,U){N._preSort=U}),u[d].sort(z);var F=u[d][0].trace,B=null;for(T=0;T<u[d].length;T++){var O=u[d][T].trace.legendgrouptitle;if(O&&O.text){B=O,r&&(O.font=e._groupTitleFont);break}}if(a&&u[d].reverse(),B){var I=!1;for(T=0;T<u[d].length;T++)if(v.traceIs(u[d][T].trace,"pie-like")){I=!0;break}u[d].unshift({i:-1,groupTitle:B,noClick:I,trace:{showlegend:F.showlegend,legendgroup:F.legendgroup,visible:e.groupclick==="toggleitem"?!0:F.visible}})}for(T=0;T<u[d].length;T++)u[d][T]=[u[d][T]]}return e._lgroupsLength=u.length,e._maxNameLength=m,u}}}),eg=Ze({"src/traces/pie/helpers.js"(Z){"use strict";var q=ca();function v(x){return x.indexOf("e")!==-1?x.replace(/[.]?0+e/,"e"):x.indexOf(".")!==-1?x.replace(/[.]?0+$/,""):x}Z.formatPiePercent=function(A,M){var e=v((A*100).toPrecision(3));return q.numSeparate(e,M)+"%"},Z.formatPieValue=function(A,M){var e=v(A.toPrecision(10));return q.numSeparate(e,M)},Z.getFirstFilled=function(A,M){if(q.isArrayOrTypedArray(A))for(var e=0;e<M.length;e++){var t=A[M[e]];if(t||t===0||t==="")return t}},Z.castOption=function(A,M){if(q.isArrayOrTypedArray(A))return Z.getFirstFilled(A,M);if(A)return A},Z.getRotationAngle=function(x){return(x==="auto"?0:x)*Math.PI/180}}}),vO=Ze({"src/traces/pie/fill_one.js"(Z,q){"use strict";var v=as(),x=Yi();q.exports=function(M,e,t,r){var i=t.marker.pattern;i&&i.shape?v.pointStyle(M,t,r,e):x.fill(M,e.color)}}}),n1=Ze({"src/traces/pie/style_one.js"(Z,q){"use strict";var v=Yi(),x=eg().castOption,A=vO();q.exports=function(e,t,r,i){var a=r.marker.line,n=x(a.color,t.pts)||v.defaultLine,o=x(a.width,t.pts)||0;e.call(A,t,r,i).style("stroke-width",o).call(v.stroke,n)}}}),mS=Ze({"src/components/legend/style.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=ca(),M=A.strTranslate,e=as(),t=Yi(),r=Up().extractOpts,i=Fu(),a=n1(),n=eg().castOption,o=vS(),s=12,c=5,h=2,m=10,d=5;q.exports=function(S,E,g){var b=E._fullLayout;g||(g=b.legend);var p=g.itemsizing==="constant",u=g.itemwidth,y=(u+o.itemGap*2)/2,f=M(y,0),P=function(H,$,J,X){var oe;if(H+1)oe=H;else if($&&$.width>0)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(st<fe[0])return fe[0];if(st>fe[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;he<ue.length;he++){var H=ue[he],$=U._fullLayout[H];E(U,$)}}};function S(N,U,W){if(!(U.title.side!=="top center"&&U.title.side!=="top right")){var Q=U.title.font,ue=Q.size*c,se=0,he=N.node(),H=r.bBox(he).width;U.title.side==="top center"?se=.5*(U._width-2*W-2*o.titlePad-H):U.title.side==="top right"&&(se=U._width-2*W-2*o.titlePad-H),a.positionText(N,W+o.titlePad+se,W+ue)}}function E(N,U){var W=U||{},Q=N._fullLayout,ue=I(W),se,he,H=W._inHover;if(H?(he=W.layer,se="hover"):(he=Q._infolayer,se=ue),!!he){se+=Q._uid,N._legendMouseDownTime||(N._legendMouseDownTime=0);var $;if(H){if(!W.entries)return;$=d(W.entries,W)}else{for(var J=(N.calcdata||[]).slice(),X=Q.shapes,oe=0;oe<X.length;oe++){var ne=X[oe];if(ne.showlegend){var j={_isShape:!0,_fullInput:ne,index:ne._index,name:ne.name||ne.label.text||"shape "+ne._index,legend:ne.legend,legendgroup:ne.legendgroup,legendgrouptitle:ne.legendgrouptitle,legendrank:ne.legendrank,legendwidth:ne.legendwidth,showlegend:ne.showlegend,visible:ne.visible,opacity:ne.opacity,mode:ne.type==="line"?"lines":"markers",line:ne.line,marker:{line:ne.line,color:ne.fillcolor,size:12,symbol:ne.type==="rect"?"square":ne.type==="circle"?"circle":"hexagon2"}};J.push([{trace:j}])}}$=Q.showlegend&&d(J,W,Q._legends.length>1)}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._legendMouseDownTime<Q?se+=1:(se=1,U._legendMouseDownTime=ue)}),he.on("mouseup",function(){if(!(U._dragged||U._editing)){var H=U._fullLayout[W];new Date().getTime()-U._legendMouseDownTime>Q&&(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,wr=0,Ir=0,bt=0,Be=0;W.each(function(Ee){var Ve=Ee[0].height,Ce=g(Ee,Q,j,$),Te=jr?Ce:Qe;J||(Te+=ne),Te+X+Ir-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-tt<ut?Fe.offset=ut-st+tt:Fe.offset=0,ut=st+Fe.by+Fe.offset,rt===re.anchorIndex&&(Me=Fe.offset)}).each(function(Fe){Fe.offset-=Me});var _e=be._fullLayout._invScaleX,fe=be._fullLayout._invScaleY;return W(ot,We,_e,fe),ce?ot:ot.node()};function L(j,ee,re,ce,be){re||(re="xy"),typeof re=="string"&&(re=re.split(h)[0]);var Ae=Array.isArray(re)?re:[re],ze,Re=j._fullLayout,We=Re.hoversubplots,it=Re._plots||[],ot=it[re],tt=Re._has("cartesian"),ut=ee.hovermode||Re.hovermode,Me=(ut||"").charAt(0)==="x",_e=(ut||"").charAt(0)==="y",fe,Fe;if(tt&&(Me||_e)&&We==="axis"){for(var rt=Ae.length,st=0;st<rt;st++)if(ze=Ae[st],it[ze]){fe=c.getFromId(j,ze,"x"),Fe=c.getFromId(j,ze,"y");var Qe=(Me?fe:Fe)._subplotsWith;if(Qe&&Qe.length)for(var Lt=0;Lt<Qe.length;Lt++)M(Ae,Qe[Lt])}}if(ot&&We!=="single"){var kt=ot.overlays.map(function(pi){return pi.id});Ae=Ae.concat(kt)}for(var qt=Ae.length,Zt=new Array(qt),Sr=new Array(qt),xr=!1,jr=0;jr<qt;jr++)if(ze=Ae[jr],it[ze])xr=!0,Zt[jr]=it[ze].xaxis,Sr[jr]=it[ze].yaxis;else if(Re[ze]&&Re[ze]._subplot){var wr=Re[ze]._subplot;Zt[jr]=wr.xaxis,Sr[jr]=wr.yaxis}else{A.warn("Unrecognized subplot: "+ze);return}if(ut&&!xr&&(ut="closest"),["x","y","closest","x unified","y unified"].indexOf(ut)===-1||!j.calcdata||j.querySelector(".zoombox")||j._dragging)return s.unhoverRaw(j,ee);var Ir=Re.hoverdistance;Ir===-1&&(Ir=1/0);var bt=Re.spikedistance;bt===-1&&(bt=1/0);var Be=[],Ke=[],Ue,Ee,Ve,Ce,Te,Pe,at,yt,Tt,Ot,Gt,rr,Qt,Tr={hLinePoint:null,vLinePoint:null},la=!1;if(Array.isArray(ee))for(ut="array",Ve=0;Ve<ee.length;Ve++)Te=j.calcdata[ee[Ve].curveNumber||0],Te&&(Pe=Te[0].trace,Te[0].trace.hoverinfo!=="skip"&&(Ke.push(Te),Pe.orientation==="h"&&(la=!0)));else{var Ua=j.calcdata.slice();for(Ua.sort(function(pi,Jo){var Xo=pi[0].trace.zorder||0,Ts=Jo[0].trace.zorder||0;return Xo-Ts}),Ce=0;Ce<Ua.length;Ce++)Te=Ua[Ce],Pe=Te[0].trace,Pe.hoverinfo!=="skip"&&d.isTraceInSubplots(Pe,Ae)&&(Ke.push(Te),Pe.orientation==="h"&&(la=!0));var Ba=!be,Ra,Qa;if(Ba)"xpx"in ee?Ra=ee.xpx:Ra=Zt[0]._length/2,"ypx"in ee?Qa=ee.ypx:Qa=Sr[0]._length/2;else{if(r.triggerHandler(j,"plotly_beforehover",ee)===!1)return;var za=be.getBoundingClientRect();Ra=ee.clientX-za.left,Qa=ee.clientY-za.top,Re._calcInverseTransform(j);var en=A.apply3DTransform(Re._invTransform)(Ra,Qa);if(Ra=en[0],Qa=en[1],Ra<0||Ra>Zt[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;Ce<Ke.length;Ce++)if(Te=Ke[Ce],!(!Te||!Te[0]||!Te[0].trace)&&(Pe=Te[0].trace,!(Pe.visible!==!0||Pe._length===0)&&["carpet","contourcarpet"].indexOf(Pe._module.name)===-1)){if(Tt=ut,d.isUnifiedHover(Tt)&&(Tt=Tt.charAt(0)),Pe.type==="splom"?(yt=0,at=Ae[yt]):(at=d.getSubplot(Pe),yt=Ae.indexOf(at)),rr={cd:Te,trace:Pe,xa:Zt[yt],ya:Sr[yt],maxHoverDistance:Ir,maxSpikeDistance:bt,index:!1,distance:Math.min(kn,Ir),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:o.defaultLine,name:Pe.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},Re[at]&&(rr.subplot=Re[at]._subplot),Re._splomScenes&&Re._splomScenes[Pe.uid]&&(rr.scene=Re._splomScenes[Pe.uid]),Tt==="array"){var Xo=ee[Ce];"pointNumber"in Xo?(rr.index=Xo.pointNumber,Tt="closest"):(Tt="","xval"in Xo&&(Ot=Xo.xval,Tt="x"),"yval"in Xo&&(Gt=Xo.yval,Tt=Tt?"closest":"y"))}else pi!==void 0&&Jo!==void 0?(Ot=pi,Gt=Jo):(Ot=Ue[yt],Gt=Ee[yt]);if(Qt=Be.length,Ir!==0)if(Pe._module&&Pe._module.hoverPoints){var Ts=Pe._module.hoverPoints(rr,Ot,Gt,Tt,{finiteRange:!0,hoverLayer:Re._hoverlayer,hoversubplots:We,gd:j});if(Ts)for(var Po,so=0;so<Ts.length;so++)Po=Ts[so],v(Po.x0)&&v(Po.y0)&&Be.push(Q(Po,ut))}else A.log("Unrecognized trace type in hover:",Pe);if(ut==="closest"&&Be.length>Qt&&(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;qi<pi.length;qi++)fe&&fe._id!==pi[qi].xa._id||Fe&&Fe._id!==pi[qi].ya._id||(so=pi[qi].spikeDistance,Xo&&qi===0&&(so=-1/0),so<=Po&&so<=Jo&&(Ts=pi[qi],Po=so));return Ts}function Kt(pi){return pi?{xa:pi.xa,ya:pi.ya,x:pi.xSpike!==void 0?pi.xSpike:(pi.x0+pi.x1)/2,y:pi.ySpike!==void 0?pi.ySpike:(pi.y0+pi.y1)/2,distance:pi.distance,spikeDistance:pi.spikeDistance,curveNumber:pi.trace.index,color:pi.color,pointNumber:pi.index}:null}var Wt={fullLayout:Re,container:Re._hoverlayer,event:ee},Pr=j._spikepoints,ta={vLinePoint:Tr.vLinePoint,hLinePoint:Tr.hLinePoint};j._spikepoints=ta;var ma=function(){var pi=Be.filter(function(Xo){return fe&&fe._id===Xo.xa._id&&Fe&&Fe._id===Xo.ya._id}),Jo=Be.filter(function(Xo){return!(fe&&fe._id===Xo.xa._id&&Fe&&Fe._id===Xo.ya._id)});pi.sort(P),Jo.sort(P),Be=pi.concat(Jo),Be=$(Be,ut)};ma();var ra=ut.charAt(0),Ia=(ra==="x"||ra==="y")&&Be[0]&&f[Be[0].trace.type];if(tt&&bt!==0&&Be.length!==0){var Ha=Be.filter(function(pi){return pi.ya.showspikes}),rn=Nt(Ha,bt,Ia);Tr.hLinePoint=Kt(rn);var nn=Be.filter(function(pi){return pi.xa.showspikes}),yn=Nt(nn,bt,Ia);Tr.vLinePoint=Kt(yn)}if(Be.length===0){var xt=s.unhoverRaw(j,ee);return tt&&(Tr.hLinePoint!==null||Tr.vLinePoint!==null)&&he(Pr)&&ue(j,Tr,Wt),xt}if(tt&&he(Pr)&&ue(j,Tr,Wt),d.isXYhover(Tt)&&Be[0].length!==0&&Be[0].trace.type!=="splom"){var ct=Be[0];y[ct.trace.type]?Be=Be.filter(function(pi){return pi.trace.index===ct.trace.index}):Be=[ct];var Nr=Be.length,Or=J("x",ct,Re),Rr=J("y",ct,Re);Jt(Or,Rr);var Lr=[],Gr={},Kr=0,Ur=function(pi){var Jo=y[pi.trace.type]?z(pi):pi.trace.index;if(!Gr[Jo])Kr++,Gr[Jo]=Kr,Lr.push(pi);else{var Xo=Gr[Jo]-1,Ts=Lr[Xo];Xo>0&&Math.abs(pi.distance)<Math.abs(Ts.distance)&&(Lr[Xo]=pi)}},aa;for(aa=0;aa<Nr;aa++)Ur(Be[aa]);for(aa=Be.length-1;aa>Nr-1;aa--)Ur(Be[aa]);Be=Lr,ma()}var da=j._hoverdata,fa=[],It=X(j),dr=oe(j);for(Ve=0;Ve<Be.length;Ve++){var kr=Be[Ve],na=d.makeEventData(kr,kr.trace,kr.cd);if(kr.hovertemplate!==!1){var Ca=!1;kr.cd[kr.index]&&kr.cd[kr.index].ht&&(Ca=kr.cd[kr.index].ht),kr.hovertemplate=Ca||kr.trace.hovertemplate||!1}if(kr.xa&&kr.ya){var Fa=kr.x0+kr.xa._offset,Ya=kr.x1+kr.xa._offset,ha=kr.y0+kr.ya._offset,Da=kr.y1+kr.ya._offset,Zn=Math.min(Fa,Ya),Pn=Math.max(Fa,Ya),fi=Math.min(ha,Da),Ai=Math.max(ha,Da);na.bbox={x0:Zn+dr,x1:Pn+dr,y0:fi+It,y1:Ai+It}}kr.eventData=[na],fa.push(na)}j._hoverdata=fa;var ki=ut==="y"&&(Ke.length>1||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=/<extra>([\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;Sr<j.length&&(Zt=j[Sr][qt],Zt===void 0);Sr++);var xr=ne(re,We),jr=xr.top,wr=xr.width,Ir=xr.height,bt=Zt!==void 0&&st.distance<=ee.hoverdistance&&(be==="x"||be==="y");if(bt){var Be=!0,Ke,Ue;for(Ke=0;Ke<j.length;Ke++)if(Be&&j[Ke].zLabel===void 0&&(Be=!1),Ue=j[Ke].hoverinfo||j[Ke].trace.hoverinfo,Ue){var Ee=Array.isArray(Ue)?Ue:Ue.split("+");if(Ee.indexOf("all")===-1&&Ee.indexOf(be)===-1){bt=!1;break}}Be&&(bt=!1)}var Ve=Re.selectAll("g.axistext").data(bt?[0]:[]);Ve.enter().append("g").classed("axistext",!0),Ve.exit().remove();var Ce={minX:0,maxX:0,minY:0,maxY:0};if(Ve.each(function(){var ct=q.select(this),Nr=A.ensureSingle(ct,"path","",function(Ai){Ai.style({"stroke-width":"1px"})}),Or=A.ensureSingle(ct,"text","",function(Ai){Ai.attr("data-notex",1)}),Rr=it.bgcolor||o.defaultLine,Lr=it.bordercolor||o.contrast(Rr),Gr=o.contrast(Rr),Kr=it.font,Ur={weight:Kr.weight||ut,style:Kr.style||Me,variant:Kr.variant||_e,textcase:Kr.textcase||fe,lineposition:Kr.lineposition||Fe,shadow:Kr.shadow||rt,family:Kr.family||ot,size:Kr.size||tt,color:Kr.color||Gr};Nr.style({fill:Rr,stroke:Lr}),Or.text(Zt).call(n.font,Ur).call(i.positionText,0,0).call(i.convertToTspans,re),ct.attr("transform","");var aa=ne(re,Or.node()),da,fa;if(be==="x"){var It=Qe.side==="top"?"-":"";Or.attr("text-anchor","middle").call(i.positionText,0,Qe.side==="top"?jr-aa.bottom-p-u:jr-aa.top+p+u),da=Qe._offset+(st.x0+st.x1)/2,fa=Lt._offset+(Qe.side==="top"?0:Lt._length);var dr=aa.width/2+u,kr=da;da<dr?kr=dr:da>ce.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<aa.width+2*u+p){Zn="M-"+(p+u)+"-"+Ya+"h-"+(aa.width-u)+"V"+Ya+"h"+(aa.width-u)+"Z";var Pn=aa.width-da+u;i.positionText(Or,Pn,ha),na==="end"&&Or.selectAll("tspan").each(function(){var Ai=q.select(this),ki=n.tester.append("text").text(Ai.text()).call(n.font,Ur),zi=ne(re,ki.node());Math.round(zi.width)<Math.round(aa.width)&&Ai.attr("x",Pn-zi.width),ki.remove()})}else i.positionText(Or,Ca*(u+p),ha),Zn=null;var fi=ce._topclips.selectAll("#"+Da).data(Zn?[0]:[]);fi.enter().append("clipPath").attr("id",Da).append("path"),fi.exit().remove(),fi.select("path").attr("d",Zn),n.setClipUrl(Or,Zn?Da:null,re)}ct.attr("transform",e(da,fa))}),d.isUnifiedHover(be)){Re.selectAll("g.hovertext").remove();var Te=j.filter(function(ct){return ct.hoverinfo!=="none"});if(Te.length===0)return[];var Pe=ce.hoverlabel,at=Pe.font,yt=Te[0],Tt=((be==="x unified"?yt.xa:yt.ya).unifiedhovertitle||{}).text,Ot=Tt?A.hovertemplateString(Tt,{},ce._d3locale,be==="x unified"?{xa:yt.xa,x:yt.xVal}:{ya:yt.ya,y:yt.yVal}):Zt,Gt={showlegend:!0,legend:{title:{text:Ot,font:at},font:at,bgcolor:Pe.bgcolor,bordercolor:Pe.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:ce.legend?ce.legend.traceorder:void 0,orientation:"v"}},rr={font:at};l(Gt,rr,re._fullData);var Qt=rr.legend;Qt.entries=[];for(var Tr=0;Tr<Te.length;Tr++){var la=Te[Tr];if(la.hoverinfo!=="none"){var Ua=O(la,!0,be,ce,Zt),Ba=Ua[0],Ra=Ua[1];la.name=Ra,Ra!==""?la.text=Ra+" : "+Ba:la.text=Ba;var Qa=la.cd[la.index];Qa&&(Qa.mc&&(la.mc=Qa.mc),Qa.mcc&&(la.mc=Qa.mcc),Qa.mlc&&(la.mlc=Qa.mlc),Qa.mlcc&&(la.mlc=Qa.mlcc),Qa.mlw&&(la.mlw=Qa.mlw),Qa.mrc&&(la.mrc=Qa.mrc),Qa.dir&&(la.dir=Qa.dir)),la._distinct=!0,Qt.entries.push([la])}}Qt.entries.sort(function(ct,Nr){return ct[0].trace.index-Nr[0].trace.index}),Qt.layer=Re,Qt._inHover=!0,Qt._groupTitleFont=Pe.grouptitlefont,_(re,Qt);var za=Re.select("g.legend"),en=ne(re,za.node()),kn=en.width+2*u,Jt=en.height+2*u,Nt=Te[0],Kt=(Nt.x0+Nt.x1)/2,Wt=(Nt.y0+Nt.y1)/2,Pr=!(m.traceIs(Nt.trace,"bar-like")||m.traceIs(Nt.trace,"box-violin")),ta,ma;kt==="y"?Pr?(ma=Wt-u,ta=Wt+u):(ma=Math.min.apply(null,Te.map(function(ct){return Math.min(ct.y0,ct.y1)})),ta=Math.max.apply(null,Te.map(function(ct){return Math.max(ct.y0,ct.y1)}))):ma=ta=A.mean(Te.map(function(ct){return(ct.y0+ct.y1)/2}))-Jt/2;var ra,Ia;kt==="x"?Pr?(ra=Kt+u,Ia=Kt-u):(ra=Math.max.apply(null,Te.map(function(ct){return Math.max(ct.x0,ct.x1)})),Ia=Math.min.apply(null,Te.map(function(ct){return Math.min(ct.x0,ct.x1)}))):ra=Ia=A.mean(Te.map(function(ct){return(ct.x0+ct.x1)/2}))-kn/2;var Ha=Qe._offset,rn=Lt._offset;ta+=rn,ra+=Ha,Ia+=Ha-kn,ma+=rn-Jt;var nn,yn;return ra+kn<wr&&ra>=0?nn=ra:Ia+kn<wr&&Ia>=0?nn=Ia:Ha+kn<wr?nn=Ha:ra-Kt<Kt-Ia+kn?nn=wr-kn:nn=0,nn+=u,ta+Jt<Ir&&ta>=0?yn=ta:ma+Jt<Ir&&ma>=0?yn=ma:rn+Jt<Ir?yn=rn:ta-Wt<Wt-ma+Jt?yn=Ir-Jt:yn=0,yn+=u,za.attr("transform",e(nn-1,yn-1)),za}var xt=Re.selectAll("g.hovertext").data(j,function(ct){return z(ct)});return xt.enter().append("g").classed("hovertext",!0).each(function(){var ct=q.select(this);ct.append("rect").call(o.fill,o.addOpacity(ze,.8)),ct.append("text").classed("name",!0),ct.append("path").style("stroke-width","1px"),ct.append("text").classed("nums",!0).call(n.font,{weight:ut,style:Me,variant:_e,textcase:fe,lineposition:Fe,shadow:rt,family:ot,size:tt})}),xt.exit().remove(),xt.each(function(ct){var Nr=q.select(this).attr("transform",""),Or=ct.color;Array.isArray(Or)&&(Or=Or[ct.eventData[0].pointNumber]);var Rr=ct.bgcolor||Or,Lr=o.combine(o.opacity(Rr)?Rr:o.defaultLine,ze),Gr=o.combine(o.opacity(Or)?Or:o.defaultLine,ze),Kr=ct.borderColor||o.contrast(Lr),Ur=O(ct,bt,be,ce,Zt,Nr),aa=Ur[0],da=Ur[1],fa=Nr.select("text.nums").call(n.font,{family:ct.fontFamily||ot,size:ct.fontSize||tt,color:ct.fontColor||Kr,weight:ct.fontWeight||ut,style:ct.fontStyle||Me,variant:ct.fontVariant||_e,textcase:ct.fontTextcase||fe,lineposition:ct.fontLineposition||Fe,shadow:ct.fontShadow||rt}).text(aa).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,re),It=Nr.select("text.name"),dr=0,kr=0;if(da&&da!==aa){It.call(n.font,{family:ct.fontFamily||ot,size:ct.fontSize||tt,color:Gr,weight:ct.fontWeight||ut,style:ct.fontStyle||Me,variant:ct.fontVariant||_e,textcase:ct.fontTextcase||fe,lineposition:ct.fontLineposition||Fe,shadow:ct.fontShadow||rt}).text(da).attr("data-notex",1).call(i.positionText,0,0).call(i.convertToTspans,re);var na=ne(re,It.node());dr=na.width+2*u,kr=na.height+2*u}else It.remove(),Nr.select("rect").remove();Nr.select("path").style({fill:Lr,stroke:Kr});var Ca=ct.xa._offset+(ct.x0+ct.x1)/2,Fa=ct.ya._offset+(ct.y0+ct.y1)/2,Ya=Math.abs(ct.x1-ct.x0),ha=Math.abs(ct.y1-ct.y0),Da=ne(re,fa.node()),Zn=Da.width/ce._invScaleX,Pn=Da.height/ce._invScaleY;ct.ty0=(jr-Da.top)/ce._invScaleY,ct.bx=Zn+2*u,ct.by=Math.max(Pn+2*u,kr),ct.anchor="start",ct.txwidth=Zn,ct.tx2width=dr,ct.offset=0;var fi=(Zn+p+u+dr)*ce._invScaleX,Ai,ki;if(Ae)ct.pos=Ca,Ai=Fa+ha/2+fi<=Ir,ki=Fa-ha/2-fi>=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+"<br>"),j.yLabel!==void 0&&(Re+="y: "+j.yLabel+"<br>"),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?"<br>":"")+j.text),j.extraText!==void 0&&(Re+=(Re?"<br>":"")+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;Lt<Ue.length;Lt++)qt=Ue[Lt],qt.pos+qt.dp+qt.size>Ee.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<Ue.length&&!(Ce<=0);Lt++)if(qt=Ue[Lt],qt.pos<Ee.pmin+1)for(qt.del=!0,Ce--,Qe=qt.size*2,kt=Ue.length-1;kt>=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<it.length-1;){var xr=it[Lt],jr=it[Lt+1],wr=xr[xr.length-1],Ir=jr[0];if(st=wr.pos+wr.dp+wr.size-Ir.pos-Ir.dp+Ir.size,st>.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<j.length;ze++){var Re=j[ze];m.traceIs(Re.trace,"bar-like")||m.traceIs(Re.trace,"box-violin")?Ae.push(Re):Re.trace[re+"period"]?be.push(Re):ce.push(Re)}return ce.concat(be).concat(Ae)}function J(j,ee,re){var ce=ee[j+"a"],be=ee[j+"Val"],Ae=ee.cd[0];if(ce.type==="category"||ce.type==="multicategory")be=ce._categoriesMap[be];else if(ce.type==="date"){var ze=ee.trace[j+"periodalignment"];if(ze){var Re=ee.cd[ee.index],We=Re[j+"Start"];We===void 0&&(We=Re[j]);var it=Re[j+"End"];it===void 0&&(it=Re[j]);var ot=it-We;ze==="end"?be+=ot:ze==="middle"&&(be+=ot/2)}be=ce.d2c(be)}return Ae&&Ae.t&&Ae.t.posLetter===ce._id&&(re.boxmode==="group"||re.violinmode==="group")&&(be+=Ae.t.dPos),be}function X(j){return j.offsetTop+j.clientTop}function oe(j){return j.offsetLeft+j.clientLeft}function ne(j,ee){var re=j._fullLayout,ce=ee.getBoundingClientRect(),be=ce.left,Ae=ce.top,ze=be+ce.width,Re=Ae+ce.height,We=A.apply3DTransform(re._invTransform)(be,Ae),it=A.apply3DTransform(re._invTransform)(ze,Re),ot=We[0],tt=We[1],ut=it[0],Me=it[1];return{x:ot,y:tt,width:ut-ot,height:Me-tt,top:Math.min(tt,Me),left:Math.min(ot,ut),right:Math.max(ot,ut),bottom:Math.max(tt,Me)}}}}),E_=Ze({"src/components/fx/hoverlabel_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Qp().isUnifiedHover;q.exports=function(e,t,r,i){i=i||{};var a=t.legend;function n(o){i.font[o]||(i.font[o]=a?t.legend.font[o]:t.font[o])}t&&A(t.hovermode)&&(i.font||(i.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),a?(i.bgcolor||(i.bgcolor=x.combine(t.legend.bgcolor,t.paper_bgcolor)),i.bordercolor||(i.bordercolor=t.legend.bordercolor)):i.bgcolor||(i.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),r("hoverlabel.showarrow",i.showarrow),v.coerceFont(r,"hoverlabel.font",i.font),r("hoverlabel.align",i.align)}}}),mO=Ze({"src/components/fx/layout_global_defaults.js"(Z,q){"use strict";var v=ca(),x=E_(),A=Xm();q.exports=function(e,t){function r(i,a){return v.coerce(e,t,A,i,a)}x(e,t,r)}}}),gO=Ze({"src/components/fx/defaults.js"(Z,q){"use strict";var v=ca(),x=Ky(),A=E_();q.exports=function(e,t,r,i){function a(o,s){return v.coerce(e,t,x,o,s)}var n=v.extendFlat({},i.hoverlabel);t.hovertemplate&&(n.namelength=-1),A(e,t,a,n)}}}),_S=Ze({"src/components/fx/hovermode_defaults.js"(Z,q){"use strict";var v=ca(),x=Xm();q.exports=function(M,e){function t(r,i){return e[r]!==void 0?e[r]:v.coerce(M,e,x,r,i)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),yO=Ze({"src/components/fx/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=Xm(),A=_S(),M=E_();q.exports=function(t,r){function i(m,d){return v.coerce(t,r,x,m,d)}var a=A(t,r);a&&(i("hoverdistance"),i("spikedistance"));var n=i("dragmode");n==="select"&&i("selectdirection");var o=r._has("mapbox"),s=r._has("map"),c=r._has("geo"),h=r._basePlotModules.length;r.dragmode==="zoom"&&((o||s||c)&&h===1||(o||s)&&c&&h===2)&&(r.dragmode="pan"),M(t,r,i),v.coerceFont(i,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),_O=Ze({"src/components/fx/calc.js"(Z,q){"use strict";var v=ca(),x=oo();q.exports=function(e){var t=e.calcdata,r=e._fullLayout;function i(c){return function(h){return v.coerceHoverinfo({hoverinfo:h},{_module:c._module},r)}}for(var a=0;a<t.length;a++){var n=t[a],o=n[0].trace;if(!x.traceIs(o,"pie-like")){var s=x.traceIs(o,"2dMap")?A:v.fillArray;s(o.hoverinfo,n,"hi",i(o)),o.hovertemplate&&s(o.hovertemplate,n,"ht"),o.hoverlabel&&(s(o.hoverlabel.bgcolor,n,"hbg"),s(o.hoverlabel.bordercolor,n,"hbc"),s(o.hoverlabel.font.size,n,"hts"),s(o.hoverlabel.font.color,n,"htc"),s(o.hoverlabel.font.family,n,"htf"),s(o.hoverlabel.font.weight,n,"htw"),s(o.hoverlabel.font.style,n,"hty"),s(o.hoverlabel.font.variant,n,"htv"),s(o.hoverlabel.namelength,n,"hnl"),s(o.hoverlabel.align,n,"hta"),s(o.hoverlabel.showarrow,n,"htsa"))}}};function A(M,e,t,r){r=r||v.identity,Array.isArray(M)&&(e[0][t]=r(M))}}}),xO=Ze({"src/components/fx/click.js"(Z,q){"use strict";var v=oo(),x=yS().hover;q.exports=function(M,e,t){var r=v.getComponentMethod("annotations","onClick")(M,M._hoverdata);t!==void 0&&x(M,e,t,!0);function i(){M.emit("plotly_click",{points:M._hoverdata,event:e})}M._hoverdata&&e&&e.target&&(r&&r.then?r.then(i):i(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}}}),ef=Ze({"src/components/fx/index.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=bp(),M=Qp(),e=Xm(),t=yS();q.exports={moduleType:"component",name:"fx",constants:w_(),schema:{layout:e},attributes:Ky(),layoutAttributes:e,supplyLayoutGlobalDefaults:mO(),supplyDefaults:gO(),supplyLayoutDefaults:yO(),calc:_O(),getDistanceFunction:M.getDistanceFunction,getClosest:M.getClosest,inbox:M.inbox,quadrature:M.quadrature,appendArrayPointValue:M.appendArrayPointValue,castHoverOption:i,castHoverinfo:a,hover:t.hover,unhover:A.unhover,loneHover:t.loneHover,loneUnhover:r,click:xO()};function r(n){var o=x.isD3Selection(n)?n:v.select(n);o.selectAll("g.hovertext").remove(),o.selectAll(".spikeline").remove()}function i(n,o,s){return x.castOption(n,o,"hoverlabel."+s)}function a(n,o,s){function c(h){return x.coerceHoverinfo({hoverinfo:h},{_module:n._module},o)}return x.castOption(n,s,"hoverinfo",c)}}}),Jd=Ze({"src/components/dragelement/helpers.js"(Z){"use strict";Z.selectMode=function(q){return q==="lasso"||q==="select"},Z.drawMode=function(q){return q==="drawclosedpath"||q==="drawopenpath"||q==="drawline"||q==="drawrect"||q==="drawcircle"},Z.openMode=function(q){return q==="drawline"||q==="drawopenpath"},Z.rectMode=function(q){return q==="select"||q==="drawline"||q==="drawrect"||q==="drawcircle"},Z.freeMode=function(q){return q==="lasso"||q==="drawclosedpath"||q==="drawopenpath"},Z.selectingOrDrawing=function(q){return Z.freeMode(q)||Z.rectMode(q)}}}),C_=Ze({"src/lib/clear_gl_canvases.js"(Z,q){"use strict";q.exports=function(x){var A=x._fullLayout;A._glcanvas&&A._glcanvas.size()&&A._glcanvas.each(function(M){M.regl&&M.regl.clear({color:!0,depth:!0})})}}}),w2=Ze({"src/fonts/ploticon.js"(Z,q){"use strict";q.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].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;h<s;h++)for(var m=o[h].length,d=0;d<m;d++){var T=o[h][d][0];if(T==="Z")c+="Z";else for(var l=o[h][d].length,_=0;_<l;_++){var w=_;T==="Q"||T==="S"?w=i[_]:T==="C"&&(w=r[_]),c+=o[h][d][w],_>0&&_<l-1&&(c+=",")}}return c},Z.readPaths=function(o,s,c,h){var m=q(o),d=[],T=-1,l=function(){T++,d[T]=[]},_,w=0,S=0,E,g,b=function(){E=w,g=S};b();for(var p=0;p<m.length;p++){var u=[],y,f,P,L,z=m[p][0],F=z;switch(z){case"M":l(),w=+m[p][1],S=+m[p][2],u.push([F,w,S]),b();break;case"Q":case"S":y=+m[p][1],P=+m[p][2],w=+m[p][3],S=+m[p][4],u.push([F,w,S,y,P]);break;case"C":y=+m[p][1],P=+m[p][2],f=+m[p][3],L=+m[p][4],w=+m[p][5],S=+m[p][6],u.push([F,w,S,y,P,f,L]);break;case"T":case"L":w=+m[p][1],S=+m[p][2],u.push([F,w,S]);break;case"H":F="L",w=+m[p][1],u.push([F,w,S]);break;case"V":F="L",S=+m[p][1],u.push([F,w,S]);break;case"A":F="L";var B=+m[p][1],O=+m[p][2];+m[p][4]||(B=-B,O=-O);var I=w-B,N=S;for(_=1;_<=x/2;_++){var U=2*Math.PI*_/x;u.push([F,I+B*Math.cos(U),N+O*Math.sin(U)])}break;case"Z":(w!==E||S!==g)&&(w=E,S=g,u.push([F,w,S]));break}for(var W=(c||{}).domain,Q=s._fullLayout._size,ue=c&&c.xsizemode==="pixel",se=c&&c.ysizemode==="pixel",he=h===!1,H=0;H<u.length;H++){for(_=0;_+2<7;_+=2){var $=u[H][_+1],J=u[H][_+2];$===void 0||J===void 0||(w=$,S=J,c&&(c.xaxis&&c.xaxis.p2r?(he&&($-=c.xaxis._offset),ue?$=t(c.xaxis,c.xanchor)+$:$=e(c.xaxis,$)):(he&&($-=Q.l),W?$=W.x[0]+$/Q.w:$=$/Q.w),c.yaxis&&c.yaxis.p2r?(he&&(J-=c.yaxis._offset),se?J=t(c.yaxis,c.yanchor)-J:J=e(c.yaxis,J)):(he&&(J-=Q.t),W?J=W.y[1]-J/Q.h:J=1-J/Q.h)),u[H][_+1]=$,u[H][_+2]=J)}d[T].push(u[H].slice())}}return d};function a(o,s){return Math.abs(o-s)<=1e-6}function n(o,s){var c=s[1]-o[1],h=s[2]-o[2];return Math.sqrt(c*c+h*h)}Z.pointsOnRectangle=function(o){var s=o.length;if(s!==5)return!1;for(var c=1;c<3;c++){var h=o[0][c]-o[1][c],m=o[3][c]-o[2][c];if(!a(h,m))return!1;var d=o[0][c]-o[3][c],T=o[1][c]-o[2][c];if(!a(d,T))return!1}return!a(o[0][1],o[1][1])&&!a(o[0][1],o[3][1])?!1:!!(n(o[0],o[1])*n(o[0],o[3]))},Z.pointsOnEllipse=function(o){var s=o.length;if(s!==x+1)return!1;s=x;for(var c=0;c<s;c++){var h=(s*2-c)%s,m=(s/2+h)%s,d=(s/2+c)%s;if(!a(n(o[c],o[d]),n(o[h],o[m])))return!1}return!0},Z.handleEllipse=function(o,s,c){if(!o)return[s,c];var h=Z.ellipseOver({x0:s[0],y0:s[1],x1:c[0],y1:c[1]}),m=(h.x1+h.x0)/2,d=(h.y1+h.y0)/2,T=(h.x1-h.x0)/2,l=(h.y1-h.y0)/2;T||(T=l=l/A),l||(l=T=T/A);for(var _=[],w=0;w<x;w++){var S=w*2*Math.PI/x;_.push([m+T*Math.cos(S),d+l*Math.sin(S)])}return _},Z.ellipseOver=function(o){var s=o.x0,c=o.y0,h=o.x1,m=o.y1,d=h-s,T=m-c;s-=d,c-=T;var l=(s+h)/2,_=(c+m)/2,w=A;return d*=w,T*=w,{x0:l-d,y0:_-T,x1:l+d,y1:_+T}},Z.fixDatesForPaths=function(o,s,c){var h=s.type==="date",m=c.type==="date";if(!h&&!m)return o;for(var d=0;d<o.length;d++)for(var T=0;T<o[d].length;T++)for(var l=0;l+2<o[d][T].length;l+=2)h&&(o[d][T][l+1]=o[d][T][l+1].replace(" ","_")),m&&(o[d][T][l+2]=o[d][T][l+2].replace(" ","_"));return o}}}),S2=Ze({"src/components/shapes/draw_newshape/newshapes.js"(Z,q){"use strict";var v=$c(),x=Jd(),A=x.drawMode,M=x.openMode,e=T2(),t=e.i000,r=e.i090,i=e.i180,a=e.i270,n=e.cos45,o=e.sin45,s=A2(),c=s.p2r,h=s.r2p,m=Jm(),d=m.clearOutline,T=tg(),l=T.readPaths,_=T.writePaths,w=T.ellipseOver,S=T.fixDatesForPaths;function E(b,p){if(b.length){var u=b[0][0];if(u){var y=p.gd,f=p.isActiveShape,P=p.dragmode,L=(y.layout||{}).shapes||[];if(!A(P)&&f!==void 0){var z=y._fullLayout._activeShapeIndex;if(z<L.length)switch(y._fullLayout.shapes[z].type){case"rect":P="drawrect";break;case"circle":P="drawcircle";break;case"line":P="drawline";break;case"path":var F=L[z].path||"";F[F.length-1]==="Z"?P="drawclosedpath":P="drawopenpath";break}}var B=g(b,p,P);d(y);for(var O=p.editHelpers,I=(O||{}).modifyItem,N=[],U=0;U<L.length;U++){var W=y._fullLayout.shapes[U];if(N[U]=W._input,f!==void 0&&U===y._fullLayout._activeShapeIndex){var Q=B;switch(W.type){case"line":case"rect":case"circle":var ue=v.getFromId(y,W.xref);W.xref.charAt(0)==="x"&&ue.type.includes("category")?(I("x0",Q.x0-(W.x0shift||0)),I("x1",Q.x1-(W.x1shift||0))):(I("x0",Q.x0),I("x1",Q.x1));var se=v.getFromId(y,W.yref);W.yref.charAt(0)==="y"&&se.type.includes("category")?(I("y0",Q.y0-(W.y0shift||0)),I("y1",Q.y1-(W.y1shift||0))):(I("y0",Q.y0),I("y1",Q.y1));break;case"path":I("path",Q.path);break}}}return f===void 0?(N.push(B),N):O?O.getUpdateObj():{}}}}function g(b,p,u){var y=b[0][0],f=p.gd,P=y.getAttribute("d"),L=f._fullLayout.newshape,z=p.plotinfo,F=p.isActiveShape,B=z.xaxis,O=z.yaxis,I=!!z.domain||!z.xaxis,N=!!z.domain||!z.yaxis,U=M(u),W=l(P,f,z,F),Q={editable:!0,visible:L.visible,name:L.name,showlegend:L.showlegend,legend:L.legend,legendwidth:L.legendwidth,legendgroup:L.legendgroup,legendgrouptitle:{text:L.legendgrouptitle.text,font:L.legendgrouptitle.font},legendrank:L.legendrank,label:L.label,xref:I?"paper":B._id,yref:N?"paper":O._id,layer:L.layer,opacity:L.opacity,line:{color:L.line.color,width:L.line.width,dash:L.line.dash}};U||(Q.fillcolor=L.fillcolor,Q.fillrule=L.fillrule);var ue;if(W.length===1&&(ue=W[0]),ue&&ue.length===5&&u==="drawrect")Q.type="rect",Q.x0=ue[0][1],Q.y0=ue[0][2],Q.x1=ue[2][1],Q.y1=ue[2][2];else if(ue&&u==="drawline")Q.type="line",Q.x0=ue[0][1],Q.y0=ue[0][2],Q.x1=ue[1][1],Q.y1=ue[1][2];else if(ue&&u==="drawcircle"){Q.type="circle";var se=ue[t][1],he=ue[r][1],H=ue[i][1],$=ue[a][1],J=ue[t][2],X=ue[r][2],oe=ue[i][2],ne=ue[a][2],j=z.xaxis&&(z.xaxis.type==="date"||z.xaxis.type==="log"),ee=z.yaxis&&(z.yaxis.type==="date"||z.yaxis.type==="log");j&&(se=h(z.xaxis,se),he=h(z.xaxis,he),H=h(z.xaxis,H),$=h(z.xaxis,$)),ee&&(J=h(z.yaxis,J),X=h(z.yaxis,X),oe=h(z.yaxis,oe),ne=h(z.yaxis,ne));var re=(he+$)/2,ce=(J+oe)/2,be=($-he+H-se)/2,Ae=(ne-X+oe-J)/2,ze=w({x0:re,y0:ce,x1:re+be*n,y1:ce+Ae*o});j&&(ze.x0=c(z.xaxis,ze.x0),ze.x1=c(z.xaxis,ze.x1)),ee&&(ze.y0=c(z.yaxis,ze.y0),ze.y1=c(z.yaxis,ze.y1)),Q.x0=ze.x0,Q.y0=ze.y0,Q.x1=ze.x1,Q.y1=ze.y1}else Q.type="path",B&&O&&S(W,B,O),Q.path=_(W),ue=null;return Q}q.exports={newShapes:E,createShapeObj:g}}}),xS=Ze({"src/components/selections/draw_newselection/newselections.js"(Z,q){"use strict";var v=Jd(),x=v.selectMode,A=Jm(),M=A.clearOutline,e=tg(),t=e.readPaths,r=e.writePaths,i=e.fixDatesForPaths;q.exports=function(n,o){if(n.length){var s=n[0][0];if(s){var c=s.getAttribute("d"),h=o.gd,m=h._fullLayout.newselection,d=o.plotinfo,T=d.xaxis,l=d.yaxis,_=o.isActiveSelection,w=o.dragmode,S=(h.layout||{}).selections||[];if(!x(w)&&_!==void 0){var E=h._fullLayout._activeSelectionIndex;if(E<S.length)switch(h._fullLayout.selections[E].type){case"rect":w="select";break;case"path":w="lasso";break}}var g=t(c,h,d,_),b={xref:T._id,yref:l._id,opacity:m.opacity,line:{color:m.line.color,width:m.line.width,dash:m.line.dash}},p;g.length===1&&(p=g[0]),p&&p.length===5&&w==="select"?(b.type="rect",b.x0=p[0][1],b.y0=p[0][2],b.x1=p[2][1],b.y1=p[2][2]):(b.type="path",T&&l&&i(g,T,l),b.path=r(g),p=null),M(h);for(var u=o.editHelpers,y=(u||{}).modifyItem,f=[],P=0;P<S.length;P++){var L=h._fullLayout.selections[P];if(!L){f[P]=L;continue}if(f[P]=L._input,_!==void 0&&P===h._fullLayout._activeSelectionIndex){var z=b;switch(L.type){case"rect":y("x0",z.x0),y("x1",z.x1),y("y0",z.y0),y("y1",z.y1);break;case"path":y("path",z.path);break}}}return _===void 0?(f.push(b),f):u?u.getUpdateObj():{}}}}}}),k_=Ze({"src/components/shapes/constants.js"(Z,q){"use strict";q.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}}),rg=Ze({"src/components/shapes/helpers.js"(Z){"use strict";var q=k_(),v=ca(),x=Wo();Z.rangeToShapePosition=function(e){return e.type==="log"?e.r2d:function(t){return t}},Z.shapePositionToRange=function(e){return e.type==="log"?e.d2r:function(t){return t}},Z.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace("_"," ")),e(t)}},Z.encodeDate=function(e){return function(t){return e(t).replace(" ","_")}},Z.extractPathCoords=function(e,t,r){var i=[],a=e.match(q.segmentRE);return a.forEach(function(n){var o=t[n.charAt(0)].drawn;if(o!==void 0){var s=n.substr(1).match(q.paramRE);if(!(!s||s.length<o)){var c=s[o],h=r?c:v.cleanNumber(c);i.push(h)}}}),i},Z.getDataToPixel=function(e,t,r,i,a){var n=e._fullLayout._size,o;if(t)if(a==="domain")o=function(c){return t._length*(i?1-c:c)+t._offset};else{var s=Z.shapePositionToRange(t);o=function(c){var h=M(t,r);return t._offset+t.r2p(s(c,!0))+h},t.type==="date"&&(o=Z.decodeDate(o))}else i?o=function(c){return n.t+n.h*(1-c)}:o=function(c){return n.l+n.w*c};return o},Z.getPixelToData=function(e,t,r,i){var a=e._fullLayout._size,n;if(t)if(i==="domain")n=function(s){var c=(s-t._offset)/t._length;return r?1-c:c};else{var o=Z.rangeToShapePosition(t);n=function(s){return o(t.p2r(s-t._offset))}}else r?n=function(s){return 1-(s-a.t)/a.h}:n=function(s){return(s-a.l)/a.w};return n},Z.roundPositionForSharpStrokeRendering=function(e,t){var r=Math.round(t%2)===1,i=Math.round(e);return r?i+.5:i},Z.makeShapesOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},i=e._fullLayout._plots[r.xref+r.yref],a=!!i;return a?i._hadPlotinfo=!0:(i={},r.xref&&r.xref!=="paper"&&(i.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&r.yref!=="paper"&&(i.yaxis=e._fullLayout[r.yref+"axis"])),i.xsizemode=r.xsizemode,i.ysizemode=r.ysizemode,i.xanchor=r.xanchor,i.yanchor=r.yanchor,{options:r,plotinfo:i}},Z.makeSelectionsOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.selections[t]||{},i=e._fullLayout._plots[r.xref+r.yref],a=!!i;return a?i._hadPlotinfo=!0:(i={},r.xref&&(i.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&(i.yaxis=e._fullLayout[r.yref+"axis"])),{options:r,plotinfo:i}},Z.getPathString=function(e,t){var r=t.type,i=x.getRefType(t.xref),a=x.getRefType(t.yref),n=x.getFromId(e,t.xref),o=x.getFromId(e,t.yref),s=e._fullLayout._size,c,h,m,d,T=M(n,t.x0shift),l=M(n,t.x1shift),_=M(o,t.y0shift),w=M(o,t.y1shift),S,E,g,b;if(n?i==="domain"?h=function(O){return n._offset+n._length*O}:(c=Z.shapePositionToRange(n),h=function(O){return n._offset+n.r2p(c(O,!0))}):h=function(O){return s.l+s.w*O},o?a==="domain"?d=function(O){return o._offset+o._length*(1-O)}:(m=Z.shapePositionToRange(o),d=function(O){return o._offset+o.r2p(m(O,!0))}):d=function(O){return s.t+s.h*(1-O)},r==="path")return n&&n.type==="date"&&(h=Z.decodeDate(h)),o&&o.type==="date"&&(d=Z.decodeDate(d)),A(t,h,d);if(t.xsizemode==="pixel"){var p=h(t.xanchor);S=p+t.x0+T,E=p+t.x1+l}else S=h(t.x0)+T,E=h(t.x1)+l;if(t.ysizemode==="pixel"){var u=d(t.yanchor);g=u-t.y0+_,b=u-t.y1+w}else g=d(t.y0)+_,b=d(t.y1)+w;if(r==="line")return"M"+S+","+g+"L"+E+","+b;if(r==="rect")return"M"+S+","+g+"H"+E+"V"+b+"H"+S+"Z";var y=(S+E)/2,f=(g+b)/2,P=Math.abs(y-S),L=Math.abs(f-g),z="A"+P+","+L,F=y+P+","+f,B=y+","+(f-L);return"M"+F+z+" 0 1,1 "+B+z+" 0 0,1 "+F+"Z"};function A(e,t,r){var i=e.path,a=e.xsizemode,n=e.ysizemode,o=e.xanchor,s=e.yanchor;return i.replace(q.segmentRE,function(c){var h=0,m=c.charAt(0),d=q.paramIsX[m],T=q.paramIsY[m],l=q.numParams[m],_=c.substr(1).replace(q.paramRE,function(w){return d[h]?a==="pixel"?w=t(o)+Number(w):w=t(w):T[h]&&(n==="pixel"?w=r(s)-Number(w):w=r(w)),h++,h>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<B.length;O++)for(var I=0;I<B[O].length;I++)for(var N=B[O][I],U=1;U<N.length;U+=2){var W=N[U],Q=N[U+1];f=Math.min(f,W),P=Math.max(P,W),L=Math.min(L,Q),z=Math.max(z,Q)}}else{var ue=x.getFromId(c,m.xref),se=m.x0shift,he=m.x1shift,H=x.getRefType(m.xref),$=x.getFromId(c,m.yref),J=m.y0shift,X=m.y1shift,oe=x.getRefType(m.yref),ne=function(Re,We){var it=t.getDataToPixel(c,ue,We,!1,H);return it(Re)},j=function(Re,We){var it=t.getDataToPixel(c,$,We,!0,oe);return it(Re)};f=ne(m.x0,se),P=ne(m.x1,he),L=j(m.y0,J),z=j(m.y1,X)}var ee=m.label.textangle;ee==="auto"&&(m.type==="line"?ee=n(f,L,P,z):ee=0),y.call(function(Re){return Re.call(M.font,b).attr({}),A.convertToTspans(Re,c),Re});var re=M.bBox(y.node()),ce=o(f,L,P,z,m,ee,re),be=ce.textx,Ae=ce.texty,ze=ce.xanchor;y.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[ze],y:Ae,x:be,transform:"rotate("+ee+","+be+","+Ae+")"}).call(A.positionText,be,Ae)}};function n(s,c,h,m){var d,T;return T=Math.abs(h-s),h>=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":h<s?u="right":u="center":h>s?u="right":h<s?u="left":u="center":_==="end"?w==="auto"?h>s?u="right":h<s?u="left":u="center":h>s?u="left":h<s?u="right":u="center":u="center");var F={left:1,center:0,right:-1},B={bottom:-1,middle:0,top:1};if(w==="auto"){var O=B[y];L=-S*b*O,z=S*p*O}else{var I=F[u],N=B[y];L=S*I,z=S*N}f=f+L,P=P+z}else L=S+3,_.indexOf("right")!==-1?(f=Math.max(s,h)-L,u==="auto"&&(u="right")):_.indexOf("left")!==-1?(f=Math.min(s,h)+L,u==="auto"&&(u="left")):(f=(s+h)/2,u==="auto"&&(u="center")),_.indexOf("top")!==-1?P=Math.min(c,m):_.indexOf("bottom")!==-1?P=Math.max(c,m):P=(c+m)/2,z=S,y==="bottom"?P=P-z:y==="top"&&(P=P+z);var U=a[y],W=d.label.font.size,Q=l.height,ue=(Q*U-W)*b,se=-(Q*U-W)*p;return{textx:f+ue,texty:P+se,xanchor:u}}}}),M2=Ze({"src/components/shapes/display_outlines.js"(Z,q){"use strict";var v=ca(),x=v.strTranslate,A=bp(),M=Jd(),e=M.drawMode,t=M.selectMode,r=oo(),i=Yi(),a=T2(),n=a.i000,o=a.i090,s=a.i180,c=a.i270,h=Jm(),m=h.clearOutlineControllers,d=tg(),T=d.pointsOnRectangle,l=d.pointsOnEllipse,_=d.writePaths,w=S2().newShapes,S=S2().createShapeObj,E=xS(),g=bS();q.exports=function y(f,P,L,z){z||(z=0);var F=L.gd;function B(){y(f,P,L,z++),(l(f[0])||L.hasText)&&O({redrawing:!0})}function O(tt){var ut={};L.isActiveShape!==void 0&&(L.isActiveShape=!1,ut=w(P,L)),L.isActiveSelection!==void 0&&(L.isActiveSelection=!1,ut=E(P,L),F._fullLayout._reselect=!0),Object.keys(ut).length&&r.call((tt||{}).redrawing?"relayout":"_guiRelayout",F,ut)}var I=F._fullLayout,N=I._zoomlayer,U=L.dragmode,W=e(U),Q=t(U);(W||Q)&&(F._fullLayout._outlining=!0),m(F),P.attr("d",_(f));var ue,se,he,H,$;if(!z&&(L.isActiveShape||L.isActiveSelection)){$=b([],f);var J=N.append("g").attr("class","outline-controllers");be(J),ot()}if(W&&L.hasText){var X=N.select(".label-temp"),oe=S(P,L,L.dragmode);g(F,"label-temp",oe,X)}function ne(tt){he=+tt.srcElement.getAttribute("data-i"),H=+tt.srcElement.getAttribute("data-j"),ue[he][H].moveFn=j}function j(tt,ut){if(f.length){var Me=$[he][H][1],_e=$[he][H][2],fe=f[he],Fe=fe.length;if(T(fe)){var rt=tt,st=ut;if(L.isActiveSelection){var Qe=p(fe,H);Qe[1]===fe[H][1]?st=0:rt=0}for(var Lt=0;Lt<Fe;Lt++)if(Lt!==H){var kt=fe[Lt];kt[1]===fe[H][1]&&(kt[1]=Me+rt),kt[2]===fe[H][2]&&(kt[2]=_e+st)}if(fe[H][1]=Me+rt,fe[H][2]=_e+st,!T(fe))for(var qt=0;qt<Fe;qt++)for(var Zt=0;Zt<fe[qt].length;Zt++)fe[qt][Zt]=$[he][qt][Zt]}else fe[H][1]=Me+tt,fe[H][2]=_e+ut;B()}}function ee(){O()}function re(){if(f.length&&f[he]&&f[he].length){for(var tt=[],ut=0;ut<f[he].length;ut++)ut!==H&&tt.push(f[he][ut]);tt.length>1&&!(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;ut<f.length;ut++){var Me=f[ut],_e=T(Me),fe=!_e&&l(Me);ue[ut]=[];for(var Fe=Me.length,rt=0;rt<Fe;rt++)if(Me[rt][0]!=="Z"&&!(fe&&rt!==n&&rt!==o&&rt!==s&&rt!==c)){var st=_e&&L.isActiveSelection,Qe;st&&(Qe=p(Me,rt));var Lt=Me[rt][1],kt=Me[rt][2],qt=tt.append(st?"rect":"circle").attr("data-i",ut).attr("data-j",rt).style({fill:i.background,stroke:i.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(st){var Zt=Qe[1]-Lt,Sr=Qe[2]-kt,xr=Sr?5:Math.max(Math.min(25,Math.abs(Zt)-5),5),jr=Zt?5:Math.max(Math.min(25,Math.abs(Sr)-5),5);qt.classed(Sr?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",xr).attr("height",jr).attr("x",Lt-xr/2).attr("y",kt-jr/2).attr("transform",x(Zt/2,Sr/2))}else qt.classed("cursor-grab",!0).attr("r",5).attr("cx",Lt).attr("cy",kt);ue[ut][rt]={element:qt.node(),gd:F,prepFn:ne,doneFn:ee,clickFn:ce},A.init(ue[ut][rt])}}}function Ae(tt,ut){if(f.length)for(var Me=0;Me<f.length;Me++)for(var _e=0;_e<f[Me].length;_e++)for(var fe=0;fe+2<f[Me][_e].length;fe+=2)f[Me][_e][fe+1]=$[Me][_e][fe+1]+tt,f[Me][_e][fe+2]=$[Me][_e][fe+2]+ut}function ze(tt,ut){Ae(tt,ut),B()}function Re(tt){he=+tt.srcElement.getAttribute("data-i"),he||(he=0),se[he].moveFn=ze}function We(){O()}function it(tt){tt===2&&u(F)}function ot(){if(se=[],!!f.length){var tt=0;se[tt]={element:P[0][0],gd:F,prepFn:Re,doneFn:We,clickFn:it},A.init(se[tt])}}};function b(y,f){for(var P=0;P<f.length;P++){var L=f[P];y[P]=[];for(var z=0;z<L.length;z++){y[P][z]=[];for(var F=0;F<L[z].length;F++)y[P][z][F]=L[z][F]}}return y}function p(y,f){var P=y[f][1],L=y[f][2],z=y.length,F,B,O;return F=(f+1)%z,B=y[F][1],O=y[F][2],B===P&&O===L&&(F=(f+2)%z,B=y[F][1],O=y[F][2]),[F,B,O]}function u(y){if(t(y._fullLayout.dragmode)){m(y);var f=y._fullLayout._activeSelectionIndex,P=(y.layout||{}).selections||[];if(f<P.length){for(var L=[],z=0;z<P.length;z++)z!==f&&L.push(P[z]);delete y._fullLayout._activeSelectionIndex;var F=y._fullLayout.selections[f];y._fullLayout._deselect={xref:F.xref,yref:F.yref},r.call("_guiRelayout",y,{selections:L})}}}}}),E2=Ze({"src/components/shapes/draw.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=ca(),M=Wo(),e=tg().readPaths,t=M2(),r=bS(),i=Jm().clearOutlineControllers,a=Yi(),n=as(),o=Dl().arrayEditor,s=bp(),c=Kd(),h=k_(),m=rg(),d=m.getPathString;q.exports={draw:T,drawOne:w,eraseActiveShape:u,drawLabel:r};function T(y){var f=y._fullLayout;f._shapeUpperLayer.selectAll("path").remove(),f._shapeLowerLayer.selectAll("path").remove(),f._shapeUpperLayer.selectAll("text").remove(),f._shapeLowerLayer.selectAll("text").remove();for(var P in f._plots){var L=f._plots[P].shapelayer;L&&(L.selectAll("path").remove(),L.selectAll("text").remove())}for(var z=0;z<f.shapes.length;z++)f.shapes[z].visible===!0&&w(y,z)}function l(y){return!!y._fullLayout._outlining}function _(y){return!y._context.edits.shapePosition}function w(y,f){y._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+f+'"]').remove();var P=m.makeShapesOptionsAndPlotinfo(y,f),L=P.options,z=P.plotinfo;if(!L._input||L.visible!==!0)return;if(L.layer==="above")B(y._fullLayout._shapeUpperLayer);else if(L.xref==="paper"||L.yref==="paper")B(y._fullLayout._shapeLowerLayer);else if(L.layer==="between")B(z.shapelayerBetween);else if(z._hadPlotinfo){var F=z.mainplotinfo||z;B(F.shapelayer)}else B(y._fullLayout._shapeLowerLayer);function B(O){var I=d(y,L),N={"data-index":f,"fill-rule":L.fillrule,d:I},U=L.opacity,W=L.fillcolor,Q=L.line.width?L.line.color:"rgba(0,0,0,0)",ue=L.line.width,se=L.line.dash;!ue&&L.editable===!0&&(ue=5,se="solid");var he=I[I.length-1]!=="Z",H=_(y)&&L.editable&&y._fullLayout._activeShapeIndex===f;H&&(W=he?"rgba(0,0,0,0)":y._fullLayout.activeshape.fillcolor,U=y._fullLayout.activeshape.opacity);var $=O.append("g").classed("shape-group",!0).attr({"data-index":f}),J=$.append("path").attr(N).style("opacity",U).call(a.stroke,Q).call(a.fill,W).call(n.dashLine,se,ue);S($,y,L),r(y,f,L,$);var X;if((H||y._context.edits.shapePosition)&&(X=o(y.layout,"shapes",L)),H){J.style({cursor:"move"});var oe={element:J.node(),plotinfo:z,gd:y,editHelpers:X,hasText:L.label.text||L.label.texttemplate,isActiveShape:!0},ne=e(I,y);t(ne,J,oe)}else y._context.edits.shapePosition?E(y,J,L,f,O,X):L.editable===!0&&J.style("pointer-events",he||a.opacity(W)*U<=.5?"stroke":"all");J.node().addEventListener("click",function(){return b(y,J)})}}function S(y,f,P){var L=(P.xref+P.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");n.setClipUrl(y,L?"clip"+f._fullLayout._uid+L:null,f)}function E(y,f,P,L,z,F){var B=10,O=10,I=P.xsizemode==="pixel",N=P.ysizemode==="pixel",U=P.type==="line",W=P.type==="path",Q=F.modifyItem,ue,se,he,H,$,J,X,oe,ne,j,ee,re,ce,be,Ae,ze=v.select(f.node().parentNode),Re=M.getFromId(y,P.xref),We=M.getRefType(P.xref),it=M.getFromId(y,P.yref),ot=M.getRefType(P.yref),tt=P.x0shift,ut=P.x1shift,Me=P.y0shift,_e=P.y1shift,fe=function(Ee,Ve){var Ce=m.getDataToPixel(y,Re,Ve,!1,We);return Ce(Ee)},Fe=function(Ee,Ve){var Ce=m.getDataToPixel(y,it,Ve,!0,ot);return Ce(Ee)},rt=m.getPixelToData(y,Re,!1,We),st=m.getPixelToData(y,it,!0,ot),Qe=qt(),Lt={element:Qe.node(),gd:y,prepFn:xr,doneFn:jr,clickFn:wr},kt;s.init(Lt),Qe.node().onmousemove=Sr;function qt(){return U?Zt():f}function Zt(){var Ee=10,Ve=Math.max(P.line.width,Ee),Ce=z.append("g").attr("data-index",L).attr("drag-helper",!0);Ce.append("path").attr("d",f.attr("d")).style({cursor:"move","stroke-width":Ve,"stroke-opacity":"0"});var Te={"fill-opacity":"0"},Pe=Math.max(Ve/2,Ee);return Ce.append("circle").attr({"data-line-point":"start-point",cx:I?fe(P.xanchor)+P.x0:fe(P.x0,tt),cy:N?Fe(P.yanchor)-P.y0:Fe(P.y0,Me),r:Pe}).style(Te).classed("cursor-grab",!0),Ce.append("circle").attr({"data-line-point":"end-point",cx:I?fe(P.xanchor)+P.x1:fe(P.x1,ut),cy:N?Fe(P.yanchor)-P.y1:Fe(P.y1,_e),r:Pe}).style(Te).classed("cursor-grab",!0),Ce}function Sr(Ee){if(l(y)){kt=null;return}if(U)Ee.target.tagName==="path"?kt="move":kt=Ee.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var Ve=Lt.element.getBoundingClientRect(),Ce=Ve.right-Ve.left,Te=Ve.bottom-Ve.top,Pe=Ee.clientX-Ve.left,at=Ee.clientY-Ve.top,yt=!W&&Ce>B&&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)),ue<he?(ne=ue,ce="x0",j=he,be="x1"):(ne=he,ce="x1",j=ue,be="x0"),!N&&se<H||N&&se>H?(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(f<P.length){for(var L=[],z=0;z<P.length;z++)z!==f&&L.push(P[z]);return delete y._fullLayout._activeShapeIndex,x.call("_guiRelayout",y,{shapes:L})}}}}}),wS=Ze({"src/components/modebar/buttons.js"(Z,q){"use strict";var v=oo(),x=xc(),A=$c(),M=w2(),e=E2().eraseActiveShape,t=ca(),r=t._,i=q.exports={};i.toImage={name:"toImage",title:function(E){var g=E._context.toImageButtonOptions||{},b=g.format||"png";return b==="png"?r(E,"Download plot as a PNG"):r(E,"Download plot")},icon:M.camera,click:function(E){var g=E._context.toImageButtonOptions,b={format:g.format||"png"};t.notifier(r(E,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(p){p in g&&(b[p]=g[p])}),v.call("downloadImage",E,b).then(function(p){t.notifier(r(E,"Snapshot succeeded")+" - "+p,"long")}).catch(function(){t.notifier(r(E,"Sorry, there was a problem downloading your snapshot!"),"long")})}},i.sendDataToCloud={name:"sendDataToCloud",title:function(E){return r(E,"Edit in Chart Studio")},icon:M.disk,click:function(E){x.sendDataToCloud(E)}},i.editInChartStudio={name:"editInChartStudio",title:function(E){return r(E,"Edit in Chart Studio")},icon:M.pencil,click:function(E){x.sendDataToCloud(E)}},i.zoom2d={name:"zoom2d",_cat:"zoom",title:function(E){return r(E,"Zoom")},attr:"dragmode",val:"zoom",icon:M.zoombox,click:a},i.pan2d={name:"pan2d",_cat:"pan",title:function(E){return r(E,"Pan")},attr:"dragmode",val:"pan",icon:M.pan,click:a},i.select2d={name:"select2d",_cat:"select",title:function(E){return r(E,"Box Select")},attr:"dragmode",val:"select",icon:M.selectbox,click:a},i.lasso2d={name:"lasso2d",_cat:"lasso",title:function(E){return r(E,"Lasso Select")},attr:"dragmode",val:"lasso",icon:M.lasso,click:a},i.drawclosedpath={name:"drawclosedpath",title:function(E){return r(E,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:M.drawclosedpath,click:a},i.drawopenpath={name:"drawopenpath",title:function(E){return r(E,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:M.drawopenpath,click:a},i.drawline={name:"drawline",title:function(E){return r(E,"Draw line")},attr:"dragmode",val:"drawline",icon:M.drawline,click:a},i.drawrect={name:"drawrect",title:function(E){return r(E,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:M.drawrect,click:a},i.drawcircle={name:"drawcircle",title:function(E){return r(E,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:M.drawcircle,click:a},i.eraseshape={name:"eraseshape",title:function(E){return r(E,"Erase active shape")},icon:M.eraseshape,click:e},i.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(E){return r(E,"Zoom in")},attr:"zoom",val:"in",icon:M.zoom_plus,click:a},i.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(E){return r(E,"Zoom out")},attr:"zoom",val:"out",icon:M.zoom_minus,click:a},i.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(E){return r(E,"Autoscale")},attr:"zoom",val:"auto",icon:M.autoscale,click:a},i.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(E){return r(E,"Reset axes")},attr:"zoom",val:"reset",icon:M.home,click:a},i.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(E){return r(E,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:M.tooltip_basic,gravity:"ne",click:a},i.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(E){return r(E,"Compare data on hover")},attr:"hovermode",val:function(E){return E._fullLayout._isHoriz?"y":"x"},icon:M.tooltip_compare,gravity:"ne",click:a};function a(E,g){var b=g.currentTarget,p=b.getAttribute("data-attr"),u=b.getAttribute("data-val")||!0,y=E._fullLayout,f={},P=A.list(E,null,!0),L=y._cartesianSpikesEnabled,z,F;if(p==="zoom"){var B=u==="in"?.5:2,O=(1+B)/2,I=(1-B)/2,N,U;for(F=0;F<P.length;F++)if(z=P[F],U=z.modebardisable==="none"||z.modebardisable.indexOf(u==="auto"||u==="reset"?"autoscale":"zoominout")===-1,U&&!z.fixedrange)if(N=z._name,u==="auto")f[N+".autorange"]=!0;else if(u==="reset")z._rangeInitial0===void 0&&z._rangeInitial1===void 0?f[N+".autorange"]=!0:z._rangeInitial0===void 0?(f[N+".autorange"]=z._autorangeInitial,f[N+".range"]=[null,z._rangeInitial1]):z._rangeInitial1===void 0?(f[N+".range"]=[z._rangeInitial0,null],f[N+".autorange"]=z._autorangeInitial):f[N+".range"]=[z._rangeInitial0,z._rangeInitial1],z._showSpikeInitial!==void 0&&(f[N+".showspikes"]=z._showSpikeInitial,L==="on"&&!z._showSpikeInitial&&(L="off"));else{var W=[z.r2l(z.range[0]),z.r2l(z.range[1])],Q=[O*W[0]+I*W[1],O*W[1]+I*W[0]];f[N+".range[0]"]=z.l2r(Q[0]),f[N+".range[1]"]=z.l2r(Q[1])}}else p==="hovermode"&&(u==="x"||u==="y")&&(u=y._isHoriz?"y":"x",b.setAttribute("data-val",u)),f[p]=u;y._cartesianSpikesEnabled=L,v.call("_guiRelayout",E,f)}i.zoom3d={name:"zoom3d",_cat:"zoom",title:function(E){return r(E,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:M.zoombox,click:n},i.pan3d={name:"pan3d",_cat:"pan",title:function(E){return r(E,"Pan")},attr:"scene.dragmode",val:"pan",icon:M.pan,click:n},i.orbitRotation={name:"orbitRotation",title:function(E){return r(E,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:M["3d_rotate"],click:n},i.tableRotation={name:"tableRotation",title:function(E){return r(E,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:M["z-axis"],click:n};function n(E,g){for(var b=g.currentTarget,p=b.getAttribute("data-attr"),u=b.getAttribute("data-val")||!0,y=E._fullLayout._subplots.gl3d||[],f={},P=p.split("."),L=0;L<y.length;L++)f[y[L]+"."+P[1]]=u;var z=u==="pan"?u:"zoom";f.dragmode=z,v.call("_guiRelayout",E,f)}i.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(E){return r(E,"Reset camera to default")},attr:"resetDefault",icon:M.home,click:o},i.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(E){return r(E,"Reset camera to last save")},attr:"resetLastSave",icon:M.movie,click:o};function o(E,g){for(var b=g.currentTarget,p=b.getAttribute("data-attr"),u=p==="resetLastSave",y=p==="resetDefault",f=E._fullLayout,P=f._subplots.gl3d||[],L={},z=0;z<P.length;z++){var F=P[z],B=F+".camera",O=F+".aspectratio",I=F+".aspectmode",N=f[F]._scene,U;u?(L[B+".up"]=N.viewInitial.up,L[B+".eye"]=N.viewInitial.eye,L[B+".center"]=N.viewInitial.center,U=!0):y&&(L[B+".up"]=null,L[B+".eye"]=null,L[B+".center"]=null,U=!0),U&&(L[O+".x"]=N.viewInitial.aspectratio.x,L[O+".y"]=N.viewInitial.aspectratio.y,L[O+".z"]=N.viewInitial.aspectratio.z,L[I]=N.viewInitial.aspectmode)}v.call("_guiRelayout",E,L)}i.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(E){return r(E,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:M.tooltip_basic,gravity:"ne",click:c};function s(E,g){var b=g.currentTarget,p=b._previousVal,u=E._fullLayout,y=u._subplots.gl3d||[],f=["xaxis","yaxis","zaxis"],P={},L={};if(p)L=p,b._previousVal=null;else{for(var z=0;z<y.length;z++){var F=y[z],B=u[F],O=F+".hovermode";P[O]=B.hovermode,L[O]=!1;for(var I=0;I<3;I++){var N=f[I],U=F+"."+N+".showspikes";L[U]=!1,P[U]=B[N].showspikes}}b._previousVal=P}return L}function c(E,g){var b=s(E,g);v.call("_guiRelayout",E,b)}i.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(E){return r(E,"Zoom in")},attr:"zoom",val:"in",icon:M.zoom_plus,click:h},i.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(E){return r(E,"Zoom out")},attr:"zoom",val:"out",icon:M.zoom_minus,click:h},i.resetGeo={name:"resetGeo",_cat:"reset",title:function(E){return r(E,"Reset")},attr:"reset",val:null,icon:M.autoscale,click:h},i.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(E){return r(E,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:M.tooltip_basic,gravity:"ne",click:d};function h(E,g){for(var b=g.currentTarget,p=b.getAttribute("data-attr"),u=b.getAttribute("data-val")||!0,y=E._fullLayout,f=y._subplots.geo||[],P=0;P<f.length;P++){var L=f[P],z=y[L];if(p==="zoom"){var F=z.projection.scale,B=u==="in"?2*F:.5*F;v.call("_guiRelayout",E,L+".projection.scale",B)}}p==="reset"&&S(E,"geo")}i.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(E){return r(E,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:M.tooltip_basic,gravity:"ne",click:d};function m(E){var g=E._fullLayout;return g.hovermode?!1:g._has("cartesian")?g._isHoriz?"y":"x":"closest"}function d(E){var g=m(E);v.call("_guiRelayout",E,"hovermode",g)}i.resetViewSankey={name:"resetSankeyGroup",title:function(E){return r(E,"Reset view")},icon:M.home,click:function(E){for(var g={"node.groups":[],"node.x":[],"node.y":[]},b=0;b<E._fullData.length;b++){var p=E._fullData[b]._viewInitial;g["node.groups"].push(p.node.groups.slice()),g["node.x"].push(p.node.x.slice()),g["node.y"].push(p.node.y.slice())}v.call("restyle",E,g)}},i.toggleHover={name:"toggleHover",title:function(E){return r(E,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:M.tooltip_basic,gravity:"ne",click:function(E,g){var b=s(E,g);b.hovermode=m(E),v.call("_guiRelayout",E,b)}},i.resetViews={name:"resetViews",title:function(E){return r(E,"Reset views")},icon:M.home,click:function(E,g){var b=g.currentTarget;b.setAttribute("data-attr","zoom"),b.setAttribute("data-val","reset"),a(E,g),b.setAttribute("data-attr","resetLastSave"),o(E,g),S(E,"geo"),S(E,"mapbox"),S(E,"map")}},i.toggleSpikelines={name:"toggleSpikelines",title:function(E){return r(E,"Toggle Spike Lines")},icon:M.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(E){var g=E._fullLayout,b=g._cartesianSpikesEnabled;g._cartesianSpikesEnabled=b==="on"?"off":"on",v.call("_guiRelayout",E,T(E))}};function T(E){for(var g=E._fullLayout,b=g._cartesianSpikesEnabled==="on",p=A.list(E,null,!0),u={},y=0;y<p.length;y++){var f=p[y];u[f._name+".showspikes"]=b?!0:f._showSpikeInitial}return u}i.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(E){return r(E,"Reset view")},attr:"reset",icon:M.home,click:function(E){S(E,"mapbox")}},i.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(E){return r(E,"Reset view")},attr:"reset",icon:M.home,click:function(E){S(E,"map")}},i.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(E){return r(E,"Zoom in")},attr:"zoom",val:"in",icon:M.zoom_plus,click:l},i.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(E){return r(E,"Zoom in")},attr:"zoom",val:"in",icon:M.zoom_plus,click:_},i.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(E){return r(E,"Zoom out")},attr:"zoom",val:"out",icon:M.zoom_minus,click:l},i.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(E){return r(E,"Zoom out")},attr:"zoom",val:"out",icon:M.zoom_minus,click:_};function l(E,g){w(E,g,"mapbox")}function _(E,g){w(E,g,"map")}function w(E,g,b){for(var p=g.currentTarget,u=p.getAttribute("data-val"),y=E._fullLayout,f=y._subplots[b]||[],P=1.05,L={},z=0;z<f.length;z++){var F=f[z],B=y[F].zoom,O=u==="in"?P*B:B/P;L[F+".zoom"]=O}v.call("_guiRelayout",E,L)}function S(E,g){for(var b=E._fullLayout,p=b._subplots[g]||[],u={},y=0;y<p.length;y++)for(var f=p[y],P=b[f]._subplot,L=P.viewInitial,z=Object.keys(L),F=0;F<z.length;F++){var B=z[F];u[f+"."+B]=L[B]}v.call("_guiRelayout",E,u)}}}),TS=Ze({"src/components/modebar/constants.js"(Z,q){"use strict";var v=wS(),x=Object.keys(v),A=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],M=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(A),e=[],t=function(r){if(M.indexOf(r._cat||r.name)===-1){var i=r.name,a=(r._cat||r.name).toLowerCase();e.indexOf(i)===-1&&e.push(i),e.indexOf(a)===-1&&e.push(a)}};x.forEach(function(r){t(v[r])}),e.sort(),q.exports={DRAW_MODES:A,backButtons:M,foreButtons:e}}}),AS=Ze({"src/components/modebar/attributes.js"(Z,q){"use strict";var v=TS();q.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}}),bO=Ze({"src/components/modebar/defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Dl(),M=AS();q.exports=function(t,r){var i=t.modebar||{},a=A.newContainer(r,"modebar");function n(s,c){return v.coerce(i,a,M,s,c)}n("orientation"),n("bgcolor",x.addOpacity(r.paper_bgcolor,.5));var o=x.contrast(x.rgb(r.modebar.bgcolor));n("color",x.addOpacity(o,.3)),n("activecolor",x.addOpacity(o,.7)),n("uirevision",r.uirevision),n("add"),n("remove")}}}),wO=Ze({"src/components/modebar/modebar.js"(Z,q){"use strict";var v=Oi(),x=is(),A=ca(),M=w2(),e=Eh().version,t=new DOMParser;function r(o){this.container=o.container,this.element=document.createElement("div"),this.update(o.graphInfo,o.buttons),this.container.appendChild(this.element)}var i=r.prototype;i.update=function(o,s){this.graphInfo=o;var c=this.graphInfo._context,h=this.graphInfo._fullLayout,m="modebar-"+h._uid;this.element.setAttribute("id",m),this.element.setAttribute("role","toolbar"),this._uid=m,this.element.className="modebar modebar--custom",c.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),h.modebar.orientation==="v"&&(this.element.className+=" vertical",s=s.reverse());var d=h.modebar,T="#"+m+" .modebar-group";document.querySelectorAll(T).forEach(function(E){E.style.backgroundColor=d.bgcolor});var l=!this.hasButtons(s),_=this.hasLogo!==c.displaylogo,w=this.locale!==c.locale;if(this.locale=c.locale,(l||_||w)&&(this.removeAllButtons(),this.updateButtons(s),c.watermark||c.displaylogo)){var S=this.getLogo();c.watermark&&(S.className=S.className+" watermark"),h.modebar.orientation==="v"?this.element.insertBefore(S,this.element.childNodes[0]):this.element.appendChild(S),this.hasLogo=!0}this.updateActiveButton(),A.setStyleOnHover("#"+m+" .modebar-btn",".active",".icon path","fill: "+d.activecolor,"fill: "+d.color,this.element)},i.updateButtons=function(o){var s=this;this.buttons=o,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(c){var h=s.createGroup();c.forEach(function(m){var d=m.name;if(!d)throw new Error("must provide button 'name' in button config");if(s.buttonsNames.indexOf(d)!==-1)throw new Error("button name '"+d+"' is taken");s.buttonsNames.push(d);var T=s.createButton(m);s.buttonElements.push(T),h.appendChild(T)}),s.element.appendChild(h)})},i.createGroup=function(){var o=document.createElement("div");o.className="modebar-group";var s=this.graphInfo._fullLayout.modebar;return o.style.backgroundColor=s.bgcolor,o},i.createButton=function(o){var s=this,c=document.createElement("button");c.setAttribute("type","button"),c.setAttribute("rel","tooltip"),c.className="modebar-btn";var h=o.title;h===void 0?h=o.name:typeof h=="function"&&(h=h(this.graphInfo)),(h||h===0)&&(c.setAttribute("data-title",h),c.setAttribute("aria-label",h)),o.attr!==void 0&&c.setAttribute("data-attr",o.attr);var m=o.val;m!==void 0&&(typeof m=="function"&&(m=m(this.graphInfo)),c.setAttribute("data-val",m));var d=o.click;if(typeof d!="function")throw new Error("must provide button 'click' function in button config");c.addEventListener("click",function(l){o.click(s.graphInfo,l),s.updateActiveButton(l.currentTarget)}),c.setAttribute("data-toggle",o.toggle||!1),o.toggle&&v.select(c).classed("active",!0);var T=o.icon;return typeof T=="function"?c.appendChild(T()):c.appendChild(this.createIcon(T||M.question)),c.setAttribute("data-gravity",o.gravity||"n"),c},i.createIcon=function(o){var s=x(o.height)?Number(o.height):o.ascent-o.descent,c="http://www.w3.org/2000/svg",h;if(o.path){h=document.createElementNS(c,"svg"),h.setAttribute("viewBox",[0,0,o.width,s].join(" ")),h.setAttribute("class","icon");var m=document.createElementNS(c,"path");m.setAttribute("d",o.path),o.transform?m.setAttribute("transform",o.transform):o.ascent!==void 0&&m.setAttribute("transform","matrix(1 0 0 -1 0 "+o.ascent+")"),h.appendChild(m)}if(o.svg){var d=t.parseFromString(o.svg,"application/xml");h=d.childNodes[0]}return h.setAttribute("height","1em"),h.setAttribute("width","1em"),h},i.updateActiveButton=function(o){var s=this.graphInfo._fullLayout,c=o!==void 0?o.getAttribute("data-attr"):null;this.buttonElements.forEach(function(h){var m=h.getAttribute("data-val")||!0,d=h.getAttribute("data-attr"),T=h.getAttribute("data-toggle")==="true",l=v.select(h),_=function(E,g){var b=s.modebar,p=E.querySelector(".icon path");p&&(g||E.matches(":hover")?p.style.fill=b.activecolor:p.style.fill=b.color)};if(T){if(d===c){var w=!l.classed("active");l.classed("active",w),_(h,w)}}else{var S=d===null?d:A.nestedProperty(s,d).get();l.classed("active",S===m),_(h,S===m)}})},i.hasButtons=function(o){var s=this.buttons;if(!s||o.length!==s.length)return!1;for(var c=0;c<o.length;++c){if(o[c].length!==s[c].length)return!1;for(var h=0;h<o[c].length;h++)if(o[c][h].name!==s[c][h].name)return!1}return!0};function a(o){return o+" (v"+e+")"}i.getLogo=function(){var o=this.createGroup(),s=document.createElement("a");return s.href="https://plotly.com/",s.target="_blank",s.setAttribute("data-title",a(A._(this.graphInfo,"Produced with Plotly.js"))),s.className="modebar-btn plotlyjsicon modebar-btn--logo",s.appendChild(this.createIcon(M.newplotlylogo)),o.appendChild(s),o},i.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},i.destroy=function(){A.removeElement(this.container.querySelector(".modebar"))};function n(o,s){var c=o._fullLayout,h=new r({graphInfo:o,container:c._modebardiv.node(),buttons:s});return c._privateplot&&v.select(h.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),h}q.exports=n}}),TO=Ze({"src/components/modebar/manage.js"(Z,q){"use strict";var v=$c(),x=Fu(),A=oo(),M=Qp().isUnifiedHover,e=wO(),t=wS(),r=TS().DRAW_MODES,i=ca().extendDeep;q.exports=function(d){var T=d._fullLayout,l=d._context,_=T._modeBar;if(!l.displayModeBar&&!l.watermark){_&&(_.destroy(),delete T._modeBar);return}if(!Array.isArray(l.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(l.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var w=l.modeBarButtons,S;Array.isArray(w)&&w.length?S=h(w):!l.displayModeBar&&l.watermark?S=[]:S=a(d),_?_.update(d,S):T._modeBar=e(d,S)};function a(m){var d=m._fullLayout,T=m._fullData,l=m._context;function _(j,ee){if(typeof ee=="string"){if(ee.toLowerCase()===j.toLowerCase())return!0}else{var re=ee.name,ce=ee._cat||ee.name;if(re===j||ce===j.toLowerCase())return!0}return!1}var w=d.modebar.add;typeof w=="string"&&(w=[w]);var S=d.modebar.remove;typeof S=="string"&&(S=[S]);var E=l.modeBarButtonsToAdd.concat(w.filter(function(j){for(var ee=0;ee<l.modeBarButtonsToRemove.length;ee++)if(_(j,l.modeBarButtonsToRemove[ee]))return!1;return!0})),g=l.modeBarButtonsToRemove.concat(S.filter(function(j){for(var ee=0;ee<l.modeBarButtonsToAdd.length;ee++)if(_(j,l.modeBarButtonsToAdd[ee]))return!1;return!0})),b=d._has("cartesian"),p=d._has("gl3d"),u=d._has("geo"),y=d._has("pie"),f=d._has("funnelarea"),P=d._has("ternary"),L=d._has("mapbox"),z=d._has("map"),F=d._has("polar"),B=d._has("smith"),O=d._has("sankey"),I=n(d),N=M(d.hovermode),U=[];function W(j){if(j.length){for(var ee=[],re=0;re<j.length;re++){for(var ce=j[re],be=t[ce],Ae=be.name.toLowerCase(),ze=(be._cat||be.name).toLowerCase(),Re=!1,We=0;We<g.length;We++){var it=g[We].toLowerCase();if(it===Ae||it===ze){Re=!0;break}}Re||ee.push(t[ce])}U.push(ee)}}var Q=["toImage"];l.showEditInChartStudio?Q.push("editInChartStudio"):l.showSendToCloud&&Q.push("sendDataToCloud"),W(Q);var ue=[],se=[],he=[],H=[];(b||y||f||P)+u+p+L+z+F+B>1?(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;oe<E.length;oe++){var ne=E[oe];typeof ne=="string"?(ne=ne.toLowerCase(),r.indexOf(ne)!==-1?(d._has("mapbox")||d._has("map")||d._has("cartesian"))&&H.push(ne):ne==="togglespikelines"?J("toggleSpikelines"):ne==="togglehover"?J("toggleHover"):ne==="hovercompare"?J("hoverCompareCartesian"):ne==="hoverclosest"?(J("hoverClosestCartesian"),J("hoverClosestGeo"),J("hoverClosest3d"),J("hoverClosestPie")):ne==="v1hovermode"&&(J("hoverClosestCartesian"),J("hoverCompareCartesian"),J("hoverClosestGeo"),J("hoverClosest3d"),J("hoverClosestPie"))):X.push(ne)}E=X}return W(H),W(ue.concat(he)),W($),c(U,E)}function n(m){for(var d=v.list({_fullLayout:m},null,!0),T=0;T<d.length;T++){var l=d[T].modebardisable;if(!d[T].fixedrange&&l!=="autoscale+zoominout"&&l!=="zoominout+autoscale")return!1}return!0}function o(m){for(var d=!1,T=0;T<m.length&&!d;T++){var l=m[T];!l._module||!l._module.selectPoints||(A.traceIs(l,"scatter-like")?(x.hasMarkers(l)||x.hasText(l))&&(d=!0):A.traceIs(l,"box-violin")?(l.boxpoints==="all"||l.points==="all")&&(d=!0):d=!0)}return d}function s(m){for(var d=0;d<m.length;d++)if(!A.traceIs(m[d],"noHover"))return!1;return!0}function c(m,d){if(d.length)if(Array.isArray(d[0]))for(var T=0;T<d.length;T++)m.push(d[T]);else m.push(d);return m}function h(m){for(var d=i([],m),T=0;T<d.length;T++)for(var l=d[T],_=0;_<l.length;_++){var w=l[_];if(typeof w=="string")if(t[w]!==void 0)d[T][_]=t[w];else throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "))}return d}}}),SS=Ze({"src/components/modebar/index.js"(Z,q){"use strict";q.exports={moduleType:"component",name:"modebar",layoutAttributes:AS(),supplyLayoutDefaults:bO(),manage:TO()}}}),MS=Ze({"src/plots/cartesian/scale_zoom.js"(Z,q){"use strict";var v=mh().FROM_BL;q.exports=function(A,M,e){e===void 0&&(e=v[A.constraintoward||"center"]);var t=[A.r2l(A.range[0]),A.r2l(A.range[1])],r=t[0]+(t[1]-t[0])*e;A.range=A._input.range=[A.l2r(r+(t[0]-r)*M),A.l2r(r+(t[1]-r)*M)],A.setScale()}}}),Yg=Ze({"src/plots/cartesian/constraints.js"(Z){"use strict";var q=ca(),v=Yd(),x=$c().id2name,A=Wh(),M=MS(),e=wv(),t=Vs().ALMOST_EQUAL,r=mh().FROM_BL;Z.handleDefaults=function(m,d,T){var l=T.axIds,_=T.axHasImage,w=d._axisConstraintGroups=[],S=d._axisMatchGroups=[],E,g,b,p,u,y,f,P;for(E=0;E<l.length;E++)p=x(l[E]),u=m[p],y=d[p],i(u,y,{axIds:l,layoutOut:d,hasImage:_[p]});function L(Q,ue){for(E=0;E<Q.length;E++){g=Q[E];for(b in g)d[x(b)][ue]=g}}for(L(S,"_matchGroup"),E=0;E<w.length;E++){g=w[E];for(b in g)if(y=d[x(b)],y.fixedrange){for(var z in g){var F=x(z);(m[F]||{}).fixedrange===!1&&q.warn("fixedrange was specified as false for axis "+F+" but was overridden because another axis in its constraint group has fixedrange true"),d[F].fixedrange=!0}break}}for(E=0;E<w.length;){g=w[E];for(b in g){y=d[x(b)],y._matchGroup&&Object.keys(y._matchGroup).length===Object.keys(g).length&&(w.splice(E,1),E--);break}E++}L(w,"_constraintGroup");var B=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],O=!1,I=!1;function N(){P=y[f],f==="rangebreaks"&&(I=y._hasDayOfWeekBreaks)}for(E=0;E<S.length;E++){g=S[E];for(var U=0;U<B.length;U++){f=B[U],P=null;var W;for(b in g)if(p=x(b),u=m[p],y=d[p],f in y){if(!y.matches&&(W=y,f in u)){N();break}P===null&&f in u&&N()}if(f==="range"&&P&&u.range&&u.range.length===2&&u.range[0]!==null&&u.range[1]!==null&&(O=!0),f==="autorange"&&P===null&&O&&(P=!1),P===null&&f in W&&(P=W[f]),P!==null)for(b in g)y=d[x(b)],y[f]=f==="range"?P.slice():P,f==="rangebreaks"&&(y._hasDayOfWeekBreaks=I,e(y,d))}}};function i(m,d,T){var l=T.axIds,_=T.layoutOut,w=T.hasImage,S=_._axisConstraintGroups,E=_._axisMatchGroups,g=d._id,b=g.charAt(0),p=((_._splomAxes||{})[b]||{})[g]||{},u=d._id,y=u.charAt(0)==="x";d._matchGroup=null,d._constraintGroup=null;function f(H,$){return q.coerce(m,d,A,H,$)}f("constrain",w?"domain":"range"),q.coerce(m,d,{constraintoward:{valType:"enumerated",values:y?["left","center","right"]:["bottom","middle","top"],dflt:y?"center":"middle"}},"constraintoward");var P=d.type,L,z,F=[];for(L=0;L<l.length;L++)if(z=l[L],z!==u){var B=_[x(z)];B.type===P&&F.push(z)}var O=n(S,u);if(O){var I=[];for(L=0;L<F.length;L++)z=F[L],O[z]||I.push(z);F=I}var N=F.length,U,W;N&&(m.matches||p.matches)&&(U=q.coerce(m,d,{matches:{valType:"enumerated",values:F,dflt:F.indexOf(p.matches)!==-1?p.matches:void 0}},"matches"));var Q=w&&!y?d.anchor:void 0;if(N&&!U&&(m.scaleanchor||Q)&&(W=q.coerce(m,d,{scaleanchor:{valType:"enumerated",values:F.concat([!1])}},"scaleanchor",Q)),U){d._matchGroup=o(E,u,U,1);var ue=_[x(U)],se=a(_,d)/a(_,ue);y!==(U.charAt(0)==="x")&&(se=(y?"x":"y")+se),o(S,u,U,se)}else m.matches&&l.indexOf(m.matches)!==-1&&q.warn("ignored "+d._name+'.matches: "'+m.matches+'" to avoid an infinite loop');if(W){var he=f("scaleratio");he||(he=d.scaleratio=1),o(S,u,W,he)}else m.scaleanchor&&l.indexOf(m.scaleanchor)!==-1&&q.warn("ignored "+d._name+'.scaleanchor: "'+m.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function a(m,d){var T=d.domain;return T||(T=m[x(d.overlaying)].domain),T[1]-T[0]}function n(m,d){for(var T=0;T<m.length;T++)if(m[T][d])return m[T];return null}function o(m,d,T,l){var _,w,S,E,g,b=n(m,d);b===null?(b={},b[d]=1,g=m.length,m.push(b)):g=m.indexOf(b);var p=Object.keys(b);for(_=0;_<m.length;_++)if(S=m[_],_!==g&&S[T]){var u=S[T];for(w=0;w<p.length;w++)E=p[w],S[E]=s(u,s(l,b[E]));m.splice(g,1);return}if(l!==1)for(w=0;w<p.length;w++){var y=p[w];b[y]=s(l,b[y])}b[T]=1}function s(m,d){var T="",l="",_,w;typeof m=="string"&&(T=m.match(/^[xy]*/)[0],_=T.length,m=+m.substr(_)),typeof d=="string"&&(l=d.match(/^[xy]*/)[0],w=l.length,d=+d.substr(w));var S=m*d;return!_&&!w?S:!_||!w||T.charAt(0)===l.charAt(0)?T+l+m*d:_===w?S:(_>w?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;S<w.length;S++){var E=w[S],g=m[E];if(typeof g=="string"){var b=g.match(/^[xy]*/)[0],p=b.length;g=+g.substr(p);for(var u=b.charAt(0)==="y"?l:1/l,y=0;y<p;y++)g*=u}_[E]=g}return _}Z.enforce=function(d){var T=d._fullLayout,l=T._axisConstraintGroups||[],_,w,S,E,g,b,p,u;for(_=0;_<l.length;_++){S=c(l[_],T);var y=Object.keys(S),f=1/0,P=0,L=1/0,z={},F={},B=!1;for(w=0;w<y.length;w++)E=y[w],F[E]=g=T[x(E)],g._inputDomain?g.domain=g._inputDomain.slice():g._inputDomain=g.domain.slice(),g._inputRange||(g._inputRange=g.range.slice()),g.setScale(),z[E]=b=Math.abs(g._m)/S[E],f=Math.min(f,b),(g.constrain==="domain"||!g._constraintShrinkable)&&(L=Math.min(L,b)),delete g._constraintShrinkable,P=Math.max(P,b),g.constrain==="domain"&&(B=!0);if(!(f>t*P&&!B)){for(w=0;w<y.length;w++)if(E=y[w],b=z[E],g=F[E],p=g.constrain,b!==L||p==="domain")if(u=b/L,p==="range")M(g,u);else{var O=g._inputDomain,I=(g.domain[1]-g.domain[0])/(O[1]-O[0]),N=(g.r2l(g.range[1])-g.r2l(g.range[0]))/(g.r2l(g._inputRange[1])-g.r2l(g._inputRange[0]));if(u/=I,u*N<1){g.domain=g._input.domain=O.slice(),M(g,u);continue}if(N<1&&(g.range=g._input.range=g._inputRange.slice(),u*=N),g.autorange){var U=g.r2l(g.range[0]),W=g.r2l(g.range[1]),Q=(U+W)/2,ue=Q,se=Q,he=Math.abs(W-Q),H=Q-he*u*1.0001,$=Q+he*u*1.0001,J=v.makePadFn(T,g,0),X=v.makePadFn(T,g,1);h(g,u);var oe=Math.abs(g._m),ne=v.concatExtremes(d,g),j=ne.min,ee=ne.max,re,ce;for(ce=0;ce<j.length;ce++)re=j[ce].val-J(j[ce])/oe,re>H&&re<ue&&(ue=re);for(ce=0;ce<ee.length;ce++)re=ee[ce].val+X(ee[ce])/oe,re<$&&re>se&&(se=re);var be=(se-ue)/(2*he);u/=be,ue=g.l2r(ue),se=g.l2r(se),g.range=g._input.range=U<W?[ue,se]:[se,ue]}h(g,u)}}}},Z.getAxisGroup=function(d,T){for(var l=d._axisMatchGroups,_=0;_<l.length;_++){var w=l[_];if(w[T])return"g"+_}return T},Z.clean=function(d,T){if(T._inputDomain){for(var l=!1,_=T._id,w=d._fullLayout._axisConstraintGroups,S=0;S<w.length;S++)if(w[S][_]){l=!0;break}(!l||T.constrain!=="domain")&&(T._input.domain=T.domain=T._inputDomain,delete T._inputDomain)}};function h(m,d){var T=m._inputDomain,l=r[m.constraintoward],_=T[0]+(T[1]-T[0])*l;m.domain=m._input.domain=[_+(T[0]-_)/d,_+(T[1]-_)/d],m.setScale()}}}),L_=Ze({"src/plot_api/subroutines.js"(Z){"use strict";var q=Oi(),v=oo(),x=xc(),A=ca(),M=fu(),e=C_(),t=Yi(),r=as(),i=Zg(),a=SS(),n=Wo(),o=mh(),s=Yg(),c=s.enforce,h=s.clean,m=Yd().doAutoRange,d="start",T="middle",l="end",_=kh().zindexSeparator;Z.layoutStyles=function(O){return A.syncOrAsync([x.doAutoMargin,S],O)};function w(O,I,N){for(var U=0;U<N.length;U++){var W=N[U][0],Q=N[U][1];if(!(W[0]>=O[1]||W[1]<=O[0])&&Q[0]<I[1]&&Q[1]>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;Q<W.length;Q++){he=W[Q];var X=he._anchorAxis;he._linepositions={},he._lw=r.crispRound(O,he.linewidth,1),he._mainLinePosition=J(he,X,he.side),he._mainMirrorPosition=he.mirror&&X?J(he,X,o.OPPOSITE_SIDE[he.side]):null}var oe=[],ne=[],j=[],ee=t.opacity(I.paper_bgcolor)===1&&t.opacity(I.plot_bgcolor)===1&&I.paper_bgcolor===I.plot_bgcolor;for(ue in I._plots)if(se=I._plots[ue],se.mainplot)se.bg&&se.bg.remove(),se.bg=void 0;else{var re=se.xaxis.domain,ce=se.yaxis.domain,be=se.plotgroup;if(w(re,ce,j)&&ue.indexOf(_)===-1){var Ae=be.node(),ze=se.bg=A.ensureSingle(be,"rect","bg");Ae.insertBefore(ze.node(),Ae.childNodes[0]),ne.push(ue)}else be.select("rect.bg").remove(),j.push([re,ce]),ee||(oe.push(ue),ne.push(ue))}var Re=I._bgLayer.selectAll(".bg").data(oe);for(Re.enter().append("rect").classed("bg",!0),Re.exit().remove(),Re.each(function(Ue){I._plots[Ue].bg=q.select(this)}),Q=0;Q<ne.length;Q++)se=I._plots[ne[Q]],H=se.xaxis,$=se.yaxis,se.bg&&H._offset!==void 0&&$._offset!==void 0&&se.bg.call(r.setRect,H._offset-U,$._offset-U,H._length+2*U,$._length+2*U).call(t.fill,I.plot_bgcolor).style("stroke-width",0);if(!I._hasOnlyLargeSploms)for(ue in I._plots){se=I._plots[ue],H=se.xaxis,$=se.yaxis;var We=se.clipId="clip"+I._uid+ue+"plot",it=A.ensureSingleById(I._clips,"clipPath",We,function(Ue){Ue.classed("plotclip",!0).append("rect")});se.clipRect=it.select("rect").attr({width:H._length,height:$._length}),r.setTranslate(se.plot,H._offset,$._offset);var ot,tt;se._hasClipOnAxisFalse?(ot=null,tt=We):(ot=We,tt=null),r.setClipUrl(se.plot,ot,O),se.layerClipId=tt}var ut,Me,_e,fe,Fe,rt,st,Qe,Lt,kt,qt,Zt,Sr;function xr(Ue){return"M"+ut+","+Ue+"H"+Me}function jr(Ue){return"M"+H._offset+","+Ue+"h"+H._length}function wr(Ue){return"M"+Ue+","+Qe+"V"+st}function Ir(Ue){return $._shift!==void 0&&(Ue+=$._shift),"M"+Ue+","+$._offset+"v"+$._length}function bt(Ue,Ee,Ve){if(!Ue.showline||ue!==Ue._mainSubplot)return"";if(!Ue._anchorAxis)return Ve(Ue._mainLinePosition);var Ce=Ee(Ue._mainLinePosition);return Ue.mirror&&(Ce+=Ee(Ue._mainMirrorPosition)),Ce}for(ue in I._plots){se=I._plots[ue],H=se.xaxis,$=se.yaxis;var Be="M0,0";E(H,ue)&&(Fe=b(H,"left",$,W),ut=H._offset-(Fe?U+Fe:0),rt=b(H,"right",$,W),Me=H._offset+H._length+(rt?U+rt:0),_e=J(H,$,"bottom"),fe=J(H,$,"top"),Sr=!H._anchorAxis||ue!==H._mainSubplot,Sr&&(H.mirror==="allticks"||H.mirror==="all")&&(H._linepositions[ue]=[_e,fe]),Be=bt(H,xr,jr),Sr&&H.showline&&(H.mirror==="all"||H.mirror==="allticks")&&(Be+=xr(_e)+xr(fe)),se.xlines.style("stroke-width",H._lw+"px").call(t.stroke,H.showline?H.linecolor:"rgba(0,0,0,0)")),se.xlines.attr("d",Be);var Ke="M0,0";E($,ue)&&(qt=b($,"bottom",H,W),st=$._offset+$._length+(qt?U:0),Zt=b($,"top",H,W),Qe=$._offset-(Zt?U:0),Lt=J($,H,"left"),kt=J($,H,"right"),Sr=!$._anchorAxis||ue!==$._mainSubplot,Sr&&($.mirror==="allticks"||$.mirror==="all")&&($._linepositions[ue]=[Lt,kt]),Ke=bt($,wr,Ir),Sr&&$.showline&&($.mirror==="all"||$.mirror==="allticks")&&(Ke+=wr(Lt)+wr(kt)),se.ylines.style("stroke-width",$._lw+"px").call(t.stroke,$.showline?$.linecolor:"rgba(0,0,0,0)")),se.ylines.attr("d",Ke)}return n.makeClipPaths(O),x.previousPromises(O)}function E(O,I){return(O.ticks||O.showline)&&(I===O._mainSubplot||O.mirror==="all"||O.mirror==="allticks")}function g(O,I,N){if(!N.showline||!N._lw)return!1;if(N.mirror==="all"||N.mirror==="allticks")return!0;var U=N._anchorAxis;if(!U)return!1;var W=o.FROM_BL[I];return N.side===I?U.domain[W]===O.domain[W]:N.mirror&&U.domain[1-W]===O.domain[1-W]}function b(O,I,N,U){if(g(O,I,N))return N._lw;for(var W=0;W<U.length;W++){var Q=U[W];if(Q._mainAxis===N._mainAxis&&g(O,I,Q))return Q._lw}return 0}Z.drawMainTitle=function(O){var I=O._fullLayout.title,N=O._fullLayout,U=F(N),W=B(N),Q=L(N,W),ue=P(N,U);if(i.draw(O,"gtitle",{propContainer:N,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:N._dfltTitle.plot,subtitlePlaceholder:N._dfltTitle.subtitle,attributes:{x:ue,y:Q,"text-anchor":U,dy:W}}),I.text&&I.automargin){var se=q.selectAll(".gtitle"),he=r.bBox(q.selectAll(".g-gtitle").node()).height,H=y(O,I,he);if(H>0){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<W}function u(O,I,N,U,W){var Q=0;return N==="middle"&&(Q+=W/2),O==="t"?(N==="top"&&(Q+=W),Q+=U-I*U):(N==="bottom"&&(Q+=W),Q+=I*U),Q}function y(O,I,N){var U=I.y,W=I.yanchor,Q=U>.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<I.length;U++){var W=I[U],Q=W[0]||{},ue=Q.trace||{},se=ue._module||{},he=se.arraysToCalcdata;he&&he(W,ue);var H=se.editStyle;H&&N.push({fn:H,cd0:Q})}if(N.length){for(U=0;U<N.length;U++){var $=N[U];$.fn(O,$.cd0)}e(O),Z.redrawReglTraces(O)}return x.style(O),v.getComponentMethod("legend","draw")(O),x.previousPromises(O)},Z.doColorBars=function(O){return v.getComponentMethod("colorbar","draw")(O),x.previousPromises(O)},Z.layoutReplot=function(O){var I=O.layout;return O.layout=void 0,v.call("_doPlot",O,"",I)},Z.doLegend=function(O){return v.getComponentMethod("legend","draw")(O),x.previousPromises(O)},Z.doTicksRelayout=function(O){return n.draw(O,"redraw"),O._fullLayout._hasOnlyLargeSploms&&(v.subplotsRegistry.splom.updateGrid(O),e(O),Z.redrawReglTraces(O)),Z.drawMainTitle(O),x.previousPromises(O)},Z.doModeBar=function(O){var I=O._fullLayout;a.manage(O);for(var N=0;N<I._basePlotModules.length;N++){var U=I._basePlotModules[N].updateFx;U&&U(O)}return x.previousPromises(O)},Z.doCamera=function(O){for(var I=O._fullLayout,N=I._subplots.gl3d,U=0;U<N.length;U++){var W=I[N[U]],Q=W._scene;Q.setViewport(W)}},Z.drawData=function(O){var I=O._fullLayout;e(O);for(var N=I._basePlotModules,U=0;U<N.length;U++)N[U].plot(O);return Z.redrawReglTraces(O),x.style(O),v.getComponentMethod("selections","draw")(O),v.getComponentMethod("shapes","draw")(O),v.getComponentMethod("annotations","draw")(O),v.getComponentMethod("images","draw")(O),I._replotting=!1,x.previousPromises(O)},Z.redrawReglTraces=function(O){var I=O._fullLayout;if(I._has("regl")){var N=O._fullData,U=[],W=[],Q,ue;for(I._hasOnlyLargeSploms&&I._splomGrid.draw(),Q=0;Q<N.length;Q++){var se=N[Q];se.visible===!0&&se._length!==0&&(se.type==="splom"?I._splomScenes[se.uid].draw():se.type==="scattergl"?A.pushUnique(U,se.xaxis+se.yaxis):se.type==="scatterpolargl"&&A.pushUnique(W,se.subplot))}for(Q=0;Q<U.length;Q++)ue=I._plots[U[Q]],ue._scene&&ue._scene.draw();for(Q=0;Q<W.length;Q++)ue=I[W[Q]]._subplot,ue._scene&&ue._scene.draw()}},Z.doAutoRangeAndConstraints=function(O){for(var I=n.list(O,"",!0),N,U={},W=0;W<I.length;W++)if(N=I[W],!U[N._id]){U[N._id]=1,h(O,N),m(O,N);var Q=N._matchGroup;if(Q)for(var ue in Q){var se=n.getFromId(O,ue);m(O,se,N.range),U[ue]=1}}c(O)},Z.finalDraw=function(O){v.getComponentMethod("rangeslider","draw")(O),v.getComponentMethod("rangeselector","draw")(O)},Z.drawMarginPushers=function(O){v.getComponentMethod("legend","draw")(O),v.getComponentMethod("rangeselector","draw")(O),v.getComponentMethod("sliders","draw")(O),v.getComponentMethod("updatemenus","draw")(O),v.getComponentMethod("colorbar","draw")(O)}}}),ES=Ze({"src/components/selections/draw.js"(Z,q){"use strict";var v=tg().readPaths,x=M2(),A=Jm().clearOutlineControllers,M=Yi(),e=as(),t=Dl().arrayEditor,r=rg(),i=r.getPathString;q.exports={draw:a,drawOne:o,activateLastSelection:h};function a(d){var T=d._fullLayout;A(d),T._selectionLayer.selectAll("path").remove();for(var l in T._plots){var _=T._plots[l].selectionLayer;_&&_.selectAll("path").remove()}for(var w=0;w<T.selections.length;w++)o(d,w)}function n(d){return d._context.editSelection}function o(d,T){d._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+T+'"]').remove();var l=r.makeSelectionsOptionsAndPlotinfo(d,T),_=l.options,w=l.plotinfo;if(!_._input)return;S(d._fullLayout._selectionLayer);function S(E){var g=i(d,_),b={"data-index":T,"fill-rule":"evenodd",d:g},p=_.opacity,u="rgba(0,0,0,0)",y=_.line.color||M.contrast(d._fullLayout.plot_bgcolor),f=_.line.width,P=_.line.dash;f||(f=5,P="solid");var L=n(d)&&d._fullLayout._activeSelectionIndex===T;L&&(u=d._fullLayout.activeselection.fillcolor,p=d._fullLayout.activeselection.opacity);for(var z=[],F=1;F>=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)return!1;var s=i*i+n*n;return!(o-s>-x)},pointsSameX:function(M,e){return Math.abs(M[0]-e[0])<x},pointsSameY:function(M,e){return Math.abs(M[1]-e[1])<x},pointsSame:function(M,e){return A.pointsSameX(M,e)&&A.pointsSameY(M,e)},pointsCompare:function(M,e){return A.pointsSameX(M,e)?A.pointsSameY(M,e)?0:M[1]<e[1]?-1:1:M[0]<e[0]?-1:1},pointsCollinear:function(M,e,t){var r=M[0]-e[0],i=M[1]-e[1],a=e[0]-t[0],n=e[1]-t[1];return Math.abs(r*n-a*i)<x},linesIntersect:function(M,e,t,r){var i=e[0]-M[0],a=e[1]-M[1],n=r[0]-t[0],o=r[1]-t[1],s=i*o-a*n;if(Math.abs(s)<x)return!1;var c=M[0]-t[0],h=M[1]-t[1],m=(n*h-o*c)/s,d=(i*h-a*c)/s,T={alongA:0,alongB:0,pt:[M[0]+m*i,M[1]+m*a]};return m<=-x?T.alongA=-2:m<x?T.alongA=-1:m-1<=-x?T.alongA=0:m-1<x?T.alongA=1:T.alongA=2,d<=-x?T.alongB=-2:d<x?T.alongB=-1:d-1<=-x?T.alongB=0:d-1<x?T.alongB=1:T.alongB=2,T},pointInsideRegion:function(M,e){for(var t=M[0],r=M[1],i=e[e.length-1][0],a=e[e.length-1][1],n=!1,o=0;o<e.length;o++){var s=e[o][0],c=e[o][1];c-r>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;w<T.length;w++){l=_,_=T[w];var S=M.pointsCompare(l,_);S!==0&&c(t(S<0?l:_,S<0?_:l),!0)}},calculate:function(T){return d(T,!1)}}:{calculate:function(T,l,_,w){return T.forEach(function(S){c(r(S.start,S.end,S),!0)}),_.forEach(function(S){c(r(S.start,S.end,S),!1)}),d(l,w)}}}q.exports=x}}),CO=Ze({"node_modules/polybooljs/lib/segment-chainer.js"(Z,q){function v(x,A,M){var e=[],t=[];return x.forEach(function(r){var i=r.start,a=r.end;if(A.pointsSame(i,a)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}M&&M.chainStart(r);var n={index:0,matches_head:!1,matches_pt1:!1},o={index:0,matches_head:!1,matches_pt1:!1},s=n;function c(F,B,O){return s.index=F,s.matches_head=B,s.matches_pt1=O,s===n?(s=o,!1):(s=null,!0)}for(var h=0;h<e.length;h++){var m=e[h],d=m[0],T=m[1],l=m[m.length-1],_=m[m.length-2];if(A.pointsSame(d,i)){if(c(h,!0,!0))break}else if(A.pointsSame(d,a)){if(c(h,!0,!1))break}else if(A.pointsSame(l,i)){if(c(h,!1,!0))break}else if(A.pointsSame(l,a)&&c(h,!1,!1))break}if(s===n){e.push([i,a]),M&&M.chainNew(i,a);return}if(s===o){M&&M.chainMatch(n.index);var w=n.index,S=n.matches_pt1?a:i,E=n.matches_head,m=e[w],g=E?m[0]:m[m.length-1],b=E?m[1]:m[m.length-2],p=E?m[m.length-1]:m[0],u=E?m[m.length-2]:m[1];if(A.pointsCollinear(b,g,S)&&(E?(M&&M.chainRemoveHead(n.index,S),m.shift()):(M&&M.chainRemoveTail(n.index,S),m.pop()),g=b),A.pointsSame(p,S)){e.splice(w,1),A.pointsCollinear(u,p,g)&&(E?(M&&M.chainRemoveTail(n.index,g),m.pop()):(M&&M.chainRemoveHead(n.index,g),m.shift())),M&&M.chainClose(n.index),t.push(m);return}E?(M&&M.chainAddHead(n.index,S),m.unshift(S)):(M&&M.chainAddTail(n.index,S),m.push(S));return}function y(F){M&&M.chainReverse(F),e[F].reverse()}function f(F,B){var O=e[F],I=e[B],N=O[O.length-1],U=O[O.length-2],W=I[0],Q=I[1];A.pointsCollinear(U,N,W)&&(M&&M.chainRemoveTail(F,N),O.pop(),N=U),A.pointsCollinear(N,W,Q)&&(M&&M.chainRemoveHead(B,W),I.shift()),M&&M.chainJoin(F,B),e[F]=O.concat(I),e.splice(B,1)}var P=n.index,L=o.index;M&&M.chainConnect(P,L);var z=e[P].length<e[L].length;n.matches_head?o.matches_head?z?(y(P),f(P,L)):(y(L),f(L,P)):f(L,P):o.matches_head?f(P,L):z?(y(P),f(L,P)):(y(L),f(P,L))}),t}q.exports=v}}),kO=Ze({"node_modules/polybooljs/lib/segment-selector.js"(Z,q){function v(A,M,e){var t=[];return A.forEach(function(r){var i=(r.myFill.above?8:0)+(r.myFill.below?4:0)+(r.otherFill&&r.otherFill.above?2:0)+(r.otherFill&&r.otherFill.below?1:0);M[i]!==0&&t.push({id:e?e.segmentId():-1,start:r.start,end:r.end,myFill:{above:M[i]===1,below:M[i]===2},otherFill:null})}),e&&e.selected(t),t}var x={union:function(A,M){return v(A,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],M)},intersect:function(A,M){return v(A,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],M)},difference:function(A,M){return v(A,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],M)},differenceRev:function(A,M){return v(A,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],M)},xor:function(A,M){return v(A,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],M)}};q.exports=x}}),LO=Ze({"node_modules/polybooljs/lib/geojson.js"(Z,q){var v={toPolygon:function(x,A){function M(r){if(r.length<=0)return x.segments({inverted:!1,regions:[]});function i(o){var s=o.slice(0,o.length-1);return x.segments({inverted:!1,regions:[s]})}for(var a=i(r[0]),n=1;n<r.length;n++)a=x.selectDifference(x.combine(a,i(r[n])));return a}if(A.type==="Polygon")return x.polygon(M(A.coordinates));if(A.type==="MultiPolygon"){for(var e=x.segments({inverted:!1,regions:[]}),t=0;t<A.coordinates.length;t++)e=x.selectUnion(x.combine(e,M(A.coordinates[t])));return x.polygon(e)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(x,A,M){M=x.polygon(x.segments(M));function e(m,d){return A.pointInsideRegion([(m[0][0]+m[1][0])*.5,(m[0][1]+m[1][1])*.5],d)}function t(m){return{region:m,children:[]}}var r=t(null);function i(m,d){for(var T=0;T<m.children.length;T++){var l=m.children[T];if(e(d,l.region)){i(l,d);return}}for(var _=t(d),T=0;T<m.children.length;T++){var l=m.children[T];e(l.region,d)&&(_.children.push(l),m.children.splice(T,1),T--)}m.children.push(_)}for(var a=0;a<M.regions.length;a++){var n=M.regions[a];n.length<3||i(r,n)}function o(m,d){for(var T=0,l=m[m.length-1][0],_=m[m.length-1][1],w=[],S=0;S<m.length;S++){var E=m[S][0],g=m[S][1];w.push([E,g]),T+=g*l-E*_,l=E,_=g}var b=T<0;return b!==d&&w.reverse(),w.push([w[0][0],w[0][1]]),w}var s=[];function c(m){var d=[o(m.region,!1)];s.push(d);for(var T=0;T<m.children.length;T++)d.push(h(m.children[T]))}function h(m){for(var d=0;d<m.children.length;d++)c(m.children[d]);return o(m.region,!0)}for(var a=0;a<r.children.length;a++)c(r.children[a]);return s.length<=0?{type:"Polygon",coordinates:[]}:s.length==1?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s}}};q.exports=v}}),PO=Ze({"node_modules/polybooljs/index.js"(Z,q){var v=AO(),x=SO(),A=EO(),M=CO(),e=kO(),t=LO(),r=!1,i=x(),a;a={buildLog:function(o){return o===!0?r=v():o===!1&&(r=!1),r===!1?!1:r.list},epsilon:function(o){return i.epsilon(o)},segments:function(o){var s=A(!0,i,r);return o.regions.forEach(s.addRegion),{segments:s.calculate(o.inverted),inverted:o.inverted}},combine:function(o,s){var c=A(!1,i,r);return{combined:c.calculate(o.segments,o.inverted,s.segments,s.inverted),inverted1:o.inverted,inverted2:s.inverted}},selectUnion:function(o){return{segments:e.union(o.combined,r),inverted:o.inverted1||o.inverted2}},selectIntersect:function(o){return{segments:e.intersect(o.combined,r),inverted:o.inverted1&&o.inverted2}},selectDifference:function(o){return{segments:e.difference(o.combined,r),inverted:o.inverted1&&!o.inverted2}},selectDifferenceRev:function(o){return{segments:e.differenceRev(o.combined,r),inverted:!o.inverted1&&o.inverted2}},selectXor:function(o){return{segments:e.xor(o.combined,r),inverted:o.inverted1!==o.inverted2}},polygon:function(o){return{regions:M(o.segments,i,r),inverted:o.inverted}},polygonFromGeoJSON:function(o){return t.toPolygon(a,o)},polygonToGeoJSON:function(o){return t.fromPolygon(a,i,o)},union:function(o,s){return n(o,s,a.selectUnion)},intersect:function(o,s){return n(o,s,a.selectIntersect)},difference:function(o,s){return n(o,s,a.selectDifference)},differenceRev:function(o,s){return n(o,s,a.selectDifferenceRev)},xor:function(o,s){return n(o,s,a.selectXor)}};function n(o,s,c){var h=a.segments(o),m=a.segments(s),d=a.combine(h,m),T=c(d);return a.polygon(T)}typeof window=="object"&&(window.PolyBool=a),q.exports=a}}),IO=Ze({"node_modules/point-in-polygon/nested.js"(Z,q){q.exports=function(x,A,M,e){var t=x[0],r=x[1],i=!1;M===void 0&&(M=0),e===void 0&&(e=A.length);for(var a=e-M,n=0,o=a-1;n<a;o=n++){var s=A[n+M][0],c=A[n+M][1],h=A[o+M][0],m=A[o+M][1],d=c>r!=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;o<t.length;o++)r=Math.min(r,t[o][0]),i=Math.max(i,t[o][0]),a=Math.min(a,t[o][1]),n=Math.max(n,t[o][1]);var s=!1,c;t.length===5&&(t[0][0]===t[1][0]?t[2][0]===t[3][0]&&t[0][1]===t[3][1]&&t[1][1]===t[2][1]&&(s=!0,c=function(l){return l[0]===t[0][0]}):t[0][1]===t[1][1]&&t[2][1]===t[3][1]&&t[0][0]===t[3][0]&&t[1][0]===t[2][0]&&(s=!0,c=function(l){return l[1]===t[0][1]}));function h(l,_){var w=l[0],S=l[1];return!(w===x||w<r||w>i||S===x||S<a||S>n||_&&c(l))}function m(l,_){var w=l[0],S=l[1];if(w===x||w<r||w>i||S===x||S<a||S>n)return!1;var E=t.length,g=t[0][0],b=t[0][1],p=0,u,y,f,P,L;for(u=1;u<E;u++)if(y=g,f=b,g=t[u][0],b=t[u][1],P=Math.min(y,g),!(w<P||w>Math.max(y,g)||S>Math.max(f,b)))if(S<Math.min(f,b))w!==P&&p++;else{if(g===y?L=S:L=f+(w-y)*(b-f)/(g-y),S===L)return!(u===1&&_);S<=L&&w!==P&&p++}return p%2===1}var d=!0,T=t[0];for(o=1;o<t.length;o++)if(T[0]!==t[o][0]||T[1]!==t[o][1]){d=!1;break}return{xmin:r,xmax:i,ymin:a,ymax:n,pts:t,contains:s?h:m,isRect:s,degenerate:d}},A.isSegmentBent=function(e,t,r,i){var a=e[t],n=[e[r][0]-a[0],e[r][1]-a[1]],o=v(n,n),s=Math.sqrt(o),c=[-n[1]/s,n[0]/s],h,m,d;for(h=t+1;h<r;h++)if(m=[e[h][0]-a[0],e[h][1]-a[1]],d=v(m,n),d<0||d>o||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;m<e.length;m++)(m===e.length-1||A.isSegmentBent(e,h,m+1,t))&&(r.push(e[m]),r.length<c-2&&(i=m,a=r.length-1),h=m)}if(e.length>1){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<Ca.length;ha++){var Da=Tr.selections[ha];!Da||Da.xref!==kr||Da.yref!==na?Fa.push(Ca[ha]):Ya=!0}Ya&&(Qt._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",Qt,{selections:Fa}))}});var dr=jr(Ee);Ee.moveFn=function(kr,na){Ee._clearSubplotSelections&&(Ee._clearSubplotSelections(),Ee._clearSubplotSelections=void 0),Kt=Math.max(0,Math.min(ra,Jt*kr+za)),Wt=Math.max(0,Math.min(Ia,Nt*na+en));var Ca=Math.abs(Kt-za),Fa=Math.abs(Wt-en);if(Pe){var Ya,ha,Da;if(Tt){var Zn=Tr.selectdirection;switch(Zn==="any"?Fa<Math.min(Ca*.6,F)?Ya="h":Ca<Math.min(Fa*.6,F)?Ya="v":Ya="d":Ya=Zn,Ya){case"h":ha=Gt?Ia/2:0,Da=Ia;break;case"v":ha=Gt?ra/2:0,Da=ra;break}}if(yt)switch(Tr.newshape.drawdirection){case"vertical":Ya="h",ha=Gt?Ia/2:0,Da=Ia;break;case"horizontal":Ya="v",ha=Gt?ra/2:0,Da=ra;break;case"ortho":Ca<Fa?(Ya="h",ha=en,Da=Wt):(Ya="v",ha=za,Da=Kt);break;default:Ya="d"}Ya==="h"?(xt=rr?_(Gt,[Kt,ha],[Kt,Da]):[[za,ha],[za,Da],[Kt,Da],[Kt,ha]],xt.xmin=rr?Kt:Math.min(za,Kt),xt.xmax=rr?Kt:Math.max(za,Kt),xt.ymin=Math.min(ha,Da),xt.ymax=Math.max(ha,Da),Ur.attr("d","M"+xt.xmin+","+(en-F)+"h-4v"+2*F+"h4ZM"+(xt.xmax-1)+","+(en-F)+"h4v"+2*F+"h-4Z")):Ya==="v"?(xt=rr?_(Gt,[ha,Wt],[Da,Wt]):[[ha,en],[ha,Wt],[Da,Wt],[Da,en]],xt.xmin=Math.min(ha,Da),xt.xmax=Math.max(ha,Da),xt.ymin=rr?Wt:Math.min(en,Wt),xt.ymax=rr?Wt:Math.max(en,Wt),Ur.attr("d","M"+(za-F)+","+xt.ymin+"v-4h"+2*F+"v4ZM"+(za-F)+","+(xt.ymax-1)+"v4h"+2*F+"v-4Z")):Ya==="d"&&(xt=rr?_(Gt,[za,en],[Kt,Wt]):[[za,en],[za,Wt],[Kt,Wt],[Kt,en]],xt.xmin=Math.min(za,Kt),xt.xmax=Math.max(za,Kt),xt.ymin=Math.min(en,Wt),xt.ymax=Math.max(en,Wt),Ur.attr("d","M0,0Z"))}else Te&&(rn.addPt([Kt,Wt]),xt=rn.filtered);if(Ee.selectionDefs&&Ee.selectionDefs.length?(yn=tt(Ee.mergedPolygons,xt,Ha),xt.subtract=Ha,nn=J(Ee.selectionDefs.concat([xt]))):(yn=[xt],nn=O(xt)),d(Me(yn,at),Rr,Ee),Tt){var Pn=fe(Qt,!1),fi=Pn.eventData?Pn.eventData.points.slice():[];Pn=fe(Qt,!1,nn,It,Ee),nn=Pn.selectionTesters,Or=Pn.eventData;var Ai;rn?Ai=rn.filtered:Ai=Zt(yn),y.throttle(da,z.SELECTDELAY,function(){fa=_e(nn,It);for(var ki=fa.slice(),zi=0;zi<fi.length;zi++){for(var Xi=fi[zi],to=!1,go=0;go<ki.length;go++)if(ki[go].curveNumber===Xi.curveNumber&&ki[go].pointNumber===Xi.pointNumber){to=!0;break}to||ki.push(Xi)}ki.length&&(Or||(Or={}),Or.points=ki),dr(Or,Ai),wr(Qt,Or)})}},Ee.clickFn=function(kr,na){if(Ur.remove(),Qt._fullLayout._activeShapeIndex>=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<It.length;ct++)Nr=It[ct],Nr._module.selectPoints(Nr,!1);if(it(Qt,It),j(Ee),bt(Qt),It.length){var Fa=It[0].xaxis,Ya=It[0].yaxis;if(Fa&&Ya){for(var ha=[],Da=Qt._fullLayout.selections,Zn=0;Zn<Da.length;Zn++){var Pn=Da[Zn];Pn&&(Pn.xref!==Fa._id||Pn.yref!==Ya._id)&&ha.push(Pn)}ha.length<Da.length&&(Qt._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",Qt,{selections:ha}))}}}else Ca.indexOf("select")>-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<Gt.length;za++)rr=Gt[za],rr._module.selectPoints(rr,!1);it(Ke,Gt),j(Ce),Tt&&bt(Ke)}else{Ra=Be.shiftKey&&(Ba!==void 0?Ba:ze(en)),Qt=he(en.pointNumber,en.searchInfo,Ra);var Jt=Ce.selectionDefs.concat([Qt]);for(Tr=J(Jt,Tr),za=0;za<Gt.length;za++)if(la=Gt[za]._module.selectPoints(Gt[za],Tr),Ua=ut(la,Gt[za]),Ot.length)for(var Nt=0;Nt<Ua.length;Nt++)Ot.push(Ua[Nt]);else Ot=Ua;if(Qa={points:Ot},it(Ke,Gt,Qa),Qt&&Ce&&Ce.selectionDefs.push(Qt),Te){var Kt=Ce.mergedPolygons,Wt=s(Ce.dragmode);d(Me(Kt,Wt),Te,Ce)}Tt&&Ir(Ke,Qa)}}}function he(Be,Ke,Ue){return{pointNumber:Be,searchInfo:Ke,subtract:!!Ue}}function H(Be){return"pointNumber"in Be&&"searchInfo"in Be}function $(Be){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(Ke,Ue,Ee,Ve){var Ce=Be.searchInfo.cd[0].trace.index,Te=Ve.cd[0].trace.index;return Te===Ce&&Ee===Be.pointNumber},isRect:!1,degenerate:!1,subtract:!!Be.subtract}}function J(Be){if(!Be.length)return;for(var Ke=[],Ue=H(Be[0])?0:Be[0][0][0],Ee=Ue,Ve=H(Be[0])?0:Be[0][0][1],Ce=Ve,Te=0;Te<Be.length;Te++)if(H(Be[Te]))Ke.push($(Be[Te]));else{var Pe=O(Be[Te]);Pe.subtract=!!Be[Te].subtract,Ke.push(Pe),Ue=Math.min(Ue,Pe.xmin),Ee=Math.max(Ee,Pe.xmax),Ve=Math.min(Ve,Pe.ymin),Ce=Math.max(Ce,Pe.ymax)}function at(yt,Tt,Ot,Gt){for(var rr=!1,Qt=0;Qt<Ke.length;Qt++)Ke[Qt].contains(yt,Tt,Ot,Gt)&&(rr=!Ke[Qt].subtract);return rr}return{xmin:Ue,xmax:Ee,ymin:Ve,ymax:Ce,pts:[],contains:at,isRect:!1,degenerate:!1}}function X(Be,Ke,Ue){var Ee=Ke._fullLayout,Ve=Ue.plotinfo,Ce=Ue.dragmode,Te=Ee._lastSelectedSubplot&&Ee._lastSelectedSubplot===Ve.id,Pe=(Be.shiftKey||Be.altKey)&&!(o(Ce)&&s(Ce));Te&&Pe&&Ve.selection&&Ve.selection.selectionDefs&&!Ue.selectionDefs?(Ue.selectionDefs=Ve.selection.selectionDefs,Ue.mergedPolygons=Ve.selection.mergedPolygons):(!Pe||!Ve.selection)&&j(Ue),Te||(T(Ke),Ee._lastSelectedSubplot=Ve.id)}function oe(Be){return Be._fullLayout._activeShapeIndex>=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;yt<Be.calcdata.length;yt++)if(Pe=Be.calcdata[yt],at=Pe[0].trace,!(at.visible!==!0||!at._module||!at._module.selectPoints))if(Q({subplot:Ee})&&(at.subplot===Ee||at.geo===Ee))Ve.push(ce(at._module,Pe,Ke[0],Ue[0]));else if(at.type==="splom"){if(at._xaxes[Ce[0]]&&at._yaxes[Te[0]]){var Tt=ce(at._module,Pe,Ke[0],Ue[0]);Tt.scene=Be._fullLayout._splomScenes[at.uid],Ve.push(Tt)}}else if(at.type==="sankey"){var Ot=ce(at._module,Pe,Ke[0],Ue[0]);Ve.push(Ot)}else{if(Ce.indexOf(at.xaxis)===-1&&(!at._xA||!at._xA.overlaying)||Te.indexOf(at.yaxis)===-1&&(!at._yA||!at._yA.overlaying))continue;Ve.push(ce(at._module,Pe,f(Be,at.xaxis),f(Be,at.yaxis)))}return Ve}function ce(Be,Ke,Ue,Ee){return{_module:Be,cd:Ke,xaxis:Ue,yaxis:Ee}}function be(Be){return Be&&Array.isArray(Be)&&Be[0].hoverOnBox!==!0}function Ae(Be,Ke){var Ue=Be[0],Ee=-1,Ve=[],Ce,Te;for(Te=0;Te<Ke.length;Te++)if(Ce=Ke[Te],Ue.fullData.index===Ce.cd[0].trace.index){if(Ue.hoverOnBox===!0)break;Ue.pointNumber!==void 0?Ee=Ue.pointNumber:Ue.binNumber!==void 0&&(Ee=Ue.binNumber,Ve=Ue.pointNumbers);break}return{pointNumber:Ee,pointNumbers:Ve,searchInfo:Ce}}function ze(Be){var Ke=Be.searchInfo.cd[0].trace,Ue=Be.pointNumber,Ee=Be.pointNumbers,Ve=Ee.length>0,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;Te<Be.length;Te++)Ee=Be[Te],Ee.cd[0].trace.selectedpoints&&Ee.cd[0].trace.selectedpoints.length>0&&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;Te<Ke.pointNumbers.length;Te++)if(Ve.selectedpoints.indexOf(Ke.pointNumbers[Te])<0)return!1;return!0}return!1}function We(Be){var Ke=0,Ue,Ee,Ve;for(Ve=0;Ve<Be.length;Ve++)if(Ue=Be[Ve],Ee=Ue.cd[0].trace,Ee.selectedpoints&&(Ee.selectedpoints.length>1||(Ke+=Ee.selectedpoints.length,Ke>1)))return!1;return Ke===1}function it(Be,Ke,Ue){var Ee;for(Ee=0;Ee<Ke.length;Ee++){var Ve=Ke[Ee].cd[0].trace._fullInput,Ce=Be._fullLayout._tracePreGUI[Ve.uid]||{};Ce.selectedpoints===void 0&&(Ce.selectedpoints=Ve._input.selectedpoints||null)}var Te;if(Ue){var Pe=Ue.points||[];for(Ee=0;Ee<Ke.length;Ee++)Te=Ke[Ee].cd[0].trace,Te._input.selectedpoints=Te._fullInput.selectedpoints=[],Te._fullInput!==Te&&(Te.selectedpoints=[]);for(var at=0;at<Pe.length;at++){var yt=Pe[at],Tt=yt.data,Ot=yt.fullData,Gt=yt.pointIndex,rr=yt.pointIndices;rr?([].push.apply(Tt.selectedpoints,rr),Te._fullInput!==Te&&[].push.apply(Ot.selectedpoints,rr)):(Tt.selectedpoints.push(Gt),Te._fullInput!==Te&&Ot.selectedpoints.push(Gt))}}else for(Ee=0;Ee<Ke.length;Ee++)Te=Ke[Ee].cd[0].trace,delete Te.selectedpoints,delete Te._input.selectedpoints,Te._fullInput!==Te&&delete Te._fullInput.selectedpoints;ot(Be,Ke)}function ot(Be,Ke){for(var Ue=!1,Ee=0;Ee<Ke.length;Ee++){var Ve=Ke[Ee],Ce=Ve.cd;A.traceIs(Ce[0].trace,"regl")&&(Ue=!0);var Te=Ve._module,Pe=Te.styleOnSelect||Te.style;Pe&&(Pe(Be,Ce,Ce[0].node3),Ce[0].nodeRangePlot3&&Pe(Be,Ce,Ce[0].nodeRangePlot3))}Ue&&(P(Be),L(Be))}function tt(Be,Ke,Ue){for(var Ee=Ue?v.difference:v.union,Ve=Ee({regions:Be},{regions:[Ke]}),Ce=Ve.regions.reverse(),Te=0;Te<Ce.length;Te++){var Pe=Ce[Te];Pe.subtract=kt(Pe,Ce.slice(0,Te))}return Ce}function ut(Be,Ke){if(Array.isArray(Be))for(var Ue=Ke.cd,Ee=Ke.cd[0].trace,Ve=0;Ve<Be.length;Ve++)Be[Ve]=r(Be[Ve],Ee,Ue);return Be}function Me(Be,Ke){for(var Ue=[],Ee=0;Ee<Be.length;Ee++){Ue[Ee]=[];for(var Ve=0;Ve<Be[Ee].length;Ve++){Ue[Ee][Ve]=[],Ue[Ee][Ve][0]=Ve?"L":"M";for(var Ce=0;Ce<Be[Ee][Ve].length;Ce++)Ue[Ee][Ve].push(Be[Ee][Ve][Ce])}Ke||Ue[Ee].push(["Z",Ue[Ee][0][1],Ue[Ee][0][2]])}return Ue}function _e(Be,Ke){for(var Ue=[],Ee,Ve=[],Ce,Te=0;Te<Ke.length;Te++){var Pe=Ke[Te];Ce=Pe._module.selectPoints(Pe,Be),Ve.push(Ce),Ee=ut(Ce,Pe),Ue=Ue.concat(Ee)}return Ue}function fe(Be,Ke,Ue,Ee,Ve){var Ce=!!Ee,Te,Pe,at;Ve&&(Te=Ve.plotinfo,Pe=Ve.xaxes[0]._id,at=Ve.yaxes[0]._id);var yt=[],Tt=[],Ot=Lt(Be),Gt=Be._fullLayout;if(Te){var rr=Gt._zoomlayer,Qt=Gt.dragmode,Tr=o(Qt),la=c(Qt);if(Tr||la){var Ua=f(Be,Pe,"x"),Ba=f(Be,at,"y");if(Ua&&Ba){var Ra=rr.selectAll(".select-outline-"+Te.id);if(Ra&&Be._fullLayout._outlining&&Ra.length){for(var Qa=Ra[0][0],za=Qa.getAttribute("d"),en=w(za,Be,Te),kn=[],Jt=0;Jt<en.length;Jt++){for(var Nt=en[Jt],Kt=[],Wt=0;Wt<Nt.length;Wt++)Kt.push([qt(Ua,Nt[Wt][1]),qt(Ba,Nt[Wt][2])]);Kt.xref=Pe,Kt.yref=at,Kt.subtract=kt(Kt,kn),kn.push(Kt)}Ot=Ot.concat(kn)}}}}var Pr=Pe&&at?[Pe+at]:Gt._subplots.cartesian;Fe(Be);for(var ta={},ma=0;ma<Pr.length;ma++){var ra=Pr[ma],Ia=ra.indexOf("y"),Ha=ra.slice(0,Ia),rn=ra.slice(Ia),nn=Pe&&at?Ue:void 0;if(nn=Qe(Ot,Ha,rn,nn),nn){var yn=Ee;if(!Ce){var xt=f(Be,Ha,"x"),ct=f(Be,rn,"y");yn=re(Be,[xt],[ct],ra);for(var Nr=0;Nr<yn.length;Nr++){var Or=yn[Nr],Rr=Or.cd[0],Lr=Rr.trace;if(Or._module.name==="scattergl"&&!Rr.t.xpx){var Gr=Lr.x,Kr=Lr.y,Ur=Lr._length;Rr.t.xpx=[],Rr.t.ypx=[];for(var aa=0;aa<Ur;aa++)Rr.t.xpx[aa]=xt.c2p(Gr[aa]),Rr.t.ypx[aa]=ct.c2p(Kr[aa])}Or._module.name==="splom"&&(ta[Lr.uid]||(ta[Lr.uid]=!0))}}var da=_e(nn,yn);yt=yt.concat(da),Tt=Tt.concat(yn)}}var fa={points:yt};it(Be,Tt,fa);var It=Gt.clickmode,dr=It.indexOf("event")>-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<Ke.length;Ue++){var Ee=Ke[Ue][0],Ve=Ee.trace,Ce=Be._fullLayout._splomScenes;if(Ce){var Te=Ce[Ve.uid];Te&&(Te.selectBatch=[])}}}function rt(Be,Ke,Ue){for(var Ee=0;Ee<Ue.length;Ee++){var Ve=Ue[Ee];if(Ve.xaxis&&Ve.xaxis._id===Be&&Ve.yaxis&&Ve.yaxis._id===Ke)return!0}return!1}function st(Be,Ke,Ue,Ee){Ee=re(Be,[f(Be,Ke,"x")],[f(Be,Ue,"y")],Ke+Ue);for(var Ve=0;Ve<Ee.length;Ve++){var Ce=Ee[Ve];Ce._module.selectPoints(Ce,!1)}it(Be,Ee)}function Qe(Be,Ke,Ue,Ee){for(var Ve,Ce=0;Ce<Be.length;Ce++){var Te=Be[Ce];if(!(Ke!==Te.xref||Ue!==Te.yref))if(Ve){var Pe=!!Te.subtract;Ve=tt(Ve,Te,Pe),Ee=J(Ve)}else Ve=[Te],Ee=O(Te)}return Ee}function Lt(Be,Ke){for(var Ue=[],Ee=Be._fullLayout,Ve=Ee.selections,Ce=Ve.length,Te=0;Te<Ce;Te++)if(!(Ke&&Te!==Ee._activeSelectionIndex)){var Pe=Ve[Te];if(Pe){var at=Pe.xref,yt=Pe.yref,Tt=f(Be,at,"x"),Ot=f(Be,yt,"y"),Gt,rr,Qt,Tr,la;if(Pe.type==="rect"){la=[];var Ua=qt(Tt,Pe.x0),Ba=qt(Tt,Pe.x1),Ra=qt(Ot,Pe.y0),Qa=qt(Ot,Pe.y1);la=[[Ua,Ra],[Ua,Qa],[Ba,Qa],[Ba,Ra]],Gt=Math.min(Ua,Ba),rr=Math.max(Ua,Ba),Qt=Math.min(Ra,Qa),Tr=Math.max(Ra,Qa),la.xmin=Gt,la.xmax=rr,la.ymin=Qt,la.ymax=Tr,la.xref=at,la.yref=yt,la.subtract=!1,la.isRect=!0,Ue.push(la)}else if(Pe.type==="path")for(var za=Pe.path.split("Z"),en=[],kn=0;kn<za.length;kn++){var Jt=za[kn];if(Jt){Jt+="Z";var Nt=h.extractPathCoords(Jt,m.paramIsX,"raw"),Kt=h.extractPathCoords(Jt,m.paramIsY,"raw");Gt=1/0,rr=-1/0,Qt=1/0,Tr=-1/0,la=[];for(var Wt=0;Wt<Nt.length;Wt++){var Pr=qt(Tt,Nt[Wt]),ta=qt(Ot,Kt[Wt]);la.push([Pr,ta]),Gt=Math.min(Pr,Gt),rr=Math.max(Pr,rr),Qt=Math.min(ta,Qt),Tr=Math.max(ta,Tr)}la.xmin=Gt,la.xmax=rr,la.ymin=Qt,la.ymax=Tr,la.xref=at,la.yref=yt,la.subtract=kt(la,en),en.push(la),Ue.push(la)}}}}return Ue}function kt(Be,Ke){for(var Ue=!1,Ee=0;Ee<Ke.length;Ee++)for(var Ve=Ke[Ee],Ce=0;Ce<Be.length;Ce++)if(x(Be[Ce],Ve)){Ue=!Ue;break}return Ue}function qt(Be,Ke){return Be.type==="date"&&(Ke=Ke.replace("_"," ")),Be.type==="log"?Be.c2p(Ke):Be.r2p(Ke,null,Be.calendar)}function Zt(Be){for(var Ke=Be.length,Ue=[],Ee=0;Ee<Ke;Ee++){var Ve=Be[Ee];Ue=Ue.concat(Ve),Ue=Ue.concat([Ve[0]])}return Sr(Ue)}function Sr(Be){return Be.isRect=Be.length===5&&Be[0][0]===Be[4][0]&&Be[0][1]===Be[4][1]&&Be[0][0]===Be[1][0]&&Be[2][0]===Be[3][0]&&Be[0][1]===Be[3][1]&&Be[1][1]===Be[2][1]||Be[0][1]===Be[1][1]&&Be[2][1]===Be[3][1]&&Be[0][0]===Be[3][0]&&Be[1][0]===Be[2][0],Be.isRect&&(Be.xmin=Math.min(Be[0][0],Be[2][0]),Be.xmax=Math.max(Be[0][0],Be[2][0]),Be.ymin=Math.min(Be[0][1],Be[2][1]),Be.ymax=Math.max(Be[0][1],Be[2][1])),Be}function xr(Be){return function(Ke,Ue){for(var Ee,Ve,Ce=0;Ce<Be.length;Ce++){var Te=Be[Ce],Pe=Te._id,at=Pe.charAt(0);if(Ue.isRect){Ee||(Ee={});var yt=Ue[at+"min"],Tt=Ue[at+"max"];yt!==void 0&&Tt!==void 0&&(Ee[Pe]=[N(Te,yt),N(Te,Tt)].sort(p))}else Ve||(Ve={}),Ve[Pe]=Ue.map(U(Te))}Ee&&(Ke.range=Ee),Ve&&(Ke.lassoPoints=Ve)}}function jr(Be){var Ke=Be.plotinfo;return Ke.fillRangeItems||xr(Be.xaxes.concat(Be.yaxes))}function wr(Be,Ke){Be.emit("plotly_selecting",Ke)}function Ir(Be,Ke){Ke&&(Ke.selections=(Be.layout||{}).selections||[]),Be.emit("plotly_selected",Ke)}function bt(Be){Be.emit("plotly_deselect",null)}q.exports={reselect:fe,prepSelect:ue,clearOutline:T,clearSelectionsCache:j,selectOnClick:se}}}),CS=Ze({"src/components/annotations/arrow_paths.js"(Z,q){"use strict";q.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),I_=Ze({"src/constants/axis_placeable_objects.js"(Z,q){"use strict";q.exports={axisRefDescription:function(v,x,A){return["If set to a",v,"axis id (e.g. *"+v+"* or","*"+v+"2*), the `"+v+"` position refers to a",v,"coordinate. If set to *paper*, the `"+v+"`","position refers to the distance from the",x,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",x,"("+A+"). If set to a",v,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",x,"of the domain of that axis: e.g.,","*"+v+"2 domain* refers to the domain of the second",v," axis and a",v,"position of 0.5 refers to the","point between the",x,"and the",A,"of the domain of the","second",v,"axis."].join(" ")}}}}),Kg=Ze({"src/components/annotations/attributes.js"(Z,q){"use strict";var v=CS(),x=tc(),A=kh(),M=Dl().templatedArray,e=I_();q.exports=M("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:x({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:v.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:v.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",A.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",A.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",A.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",A.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:x({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),Tv=Ze({"src/traces/scatter/constants.js"(Z,q){"use strict";q.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),$d=Ze({"src/traces/scatter/fillcolor_attribute.js"(Z,q){"use strict";q.exports=function(x){return{valType:"color",editType:"style",anim:!0}}}}),tf=Ze({"src/traces/scatter/attributes.js"(Z,q){"use strict";var v=Qc().axisHoverFormat,x=Cs().texttemplateAttrs,A=Cs().hovertemplateAttrs,M=Mu(),e=tc(),t=Gh().dash,r=Gh().pattern,i=as(),a=Tv(),n=rs().extendFlat,o=$d();function s(m){return{valType:"any",dflt:0,editType:"calc"}}function c(m){return{valType:"any",editType:"calc"}}function h(m){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}q.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:s("x"),yperiod:s("y"),xperiod0:c("x0"),yperiod0:c("y0"),xperiodalignment:h("x"),yperiodalignment:h("y"),xhoverformat:v("x"),yhoverformat:v("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:x({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:A({},{keys:a.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:n({},t,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:o(!0),fillgradient:n({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:r,marker:n({symbol:{valType:"enumerated",values:i.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:n({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},M("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},M("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:e({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),kS=Ze({"src/components/selections/attributes.js"(Z,q){"use strict";var v=Kg(),x=tf().line,A=Gh().dash,M=rs().extendFlat,e=pc().overrideAll,t=Dl().templatedArray,r=I_();q.exports=e(t("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:M({},v.xref,{}),yref:M({},v.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:x.color,width:M({},x.width,{min:1,dflt:1}),dash:M({},A,{dflt:"dot"})}}),"arraydraw","from-root")}}),zO=Ze({"src/components/selections/defaults.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fp(),M=kS(),e=rg();q.exports=function(i,a){A(i,a,{name:"selections",handleItemDefaults:t});for(var n=a.selections,o=0;o<n.length;o++){var s=n[o];s&&s.path===void 0&&(s.x0===void 0||s.x1===void 0||s.y0===void 0||s.y1===void 0)&&(a.selections[o]=null)}};function t(r,i,a){function n(P,L){return v.coerce(r,i,M,P,L)}var o=n("path"),s=o?"path":"rect",c=n("type",s),h=c!=="path";h&&delete i.path,n("opacity"),n("line.color"),n("line.width"),n("line.dash");for(var m=["x","y"],d=0;d<2;d++){var T=m[d],l={_fullLayout:a},_,w,S,E=x.coerceRef(r,i,l,T);if(_=x.getFromId(l,E),_._selectionIndices.push(i._index),S=e.rangeToShapePosition(_),w=e.shapePositionToRange(_),h){var g=T+"0",b=T+"1",p=r[g],u=r[b];r[g]=w(r[g],!0),r[b]=w(r[b],!0),x.coercePosition(i,l,n,E,g),x.coercePosition(i,l,n,E,b);var y=i[g],f=i[b];y!==void 0&&f!==void 0&&(i[g]=S(y),i[b]=S(f),r[g]=p,r[b]=u)}}h&&v.noneOrAll(r,i,["x0","x1","y0","y1"])}}}),FO=Ze({"src/components/selections/draw_newselection/defaults.js"(Z,q){"use strict";q.exports=function(x,A,M){M("newselection.mode");var e=M("newselection.line.width");e&&(M("newselection.line.color"),M("newselection.line.dash")),M("activeselection.fillcolor"),M("activeselection.opacity")}}}),R_=Ze({"src/plots/cartesian/include_components.js"(Z,q){"use strict";var v=oo(),x=ca(),A=$c();q.exports=function(e){return function(r,i){var a=r[e];if(Array.isArray(a))for(var n=v.subplotsRegistry.cartesian,o=n.idRegex,s=i._subplots,c=s.xaxis,h=s.yaxis,m=s.cartesian,d=i._has("cartesian"),T=0;T<a.length;T++){var l=a[T];if(x.isPlainObject(l)){var _=A.cleanId(l.xref,"x",!1),w=A.cleanId(l.yref,"y",!1),S=o.x.test(_),E=o.y.test(w);if(S||E){d||x.pushUnique(i._basePlotModules,n);var g=!1;S&&c.indexOf(_)===-1&&(c.push(_),g=!0),E&&h.indexOf(w)===-1&&(h.push(w),g=!0),g&&S&&E&&m.push(_+w)}}}}}}}),Tf=Ze({"src/components/selections/index.js"(Z,q){"use strict";var v=ES(),x=DO();q.exports={moduleType:"component",name:"selections",layoutAttributes:kS(),supplyLayoutDefaults:zO(),supplyDrawNewSelectionDefaults:FO(),includeBasePlot:R_()("selections"),draw:v.draw,drawOne:v.drawOne,reselect:x.reselect,prepSelect:x.prepSelect,clearOutline:x.clearOutline,clearSelectionsCache:x.clearSelectionsCache,selectOnClick:x.selectOnClick}}}),LS=Ze({"src/plots/cartesian/dragbox.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=x.numberFormat,M=Ch(),e=x2(),t=oo(),r=x.strTranslate,i=fu(),a=Yi(),n=as(),o=ef(),s=Wo(),c=Kd(),h=bp(),m=Jd(),d=m.selectingOrDrawing,T=m.freeMode,l=mh().FROM_TL,_=C_(),w=L_().redrawReglTraces,S=xc(),E=$c().getFromId,g=Tf().prepSelect,b=Tf().clearOutline,p=Tf().selectOnClick,u=MS(),y=kh(),f=y.MINDRAG,P=y.MINZOOM,L=!0;function z(ce,be,Ae,ze,Re,We,it,ot){var tt=ce._fullLayout._zoomlayer,ut=it+ot==="nsew",Me=(it+ot).length===1,_e,fe,Fe,rt,st,Qe,Lt,kt,qt,Zt,Sr,xr,jr,wr,Ir,bt,Be,Ke,Ue,Ee,Ve,Ce,Te;Ae+=be.yaxis._shift;function Pe(){if(_e=be.xaxis,fe=be.yaxis,qt=_e._length,Zt=fe._length,Lt=_e._offset,kt=fe._offset,Fe={},Fe[_e._id]=_e,rt={},rt[fe._id]=fe,it&&ot)for(var Rr=be.overlays,Lr=0;Lr<Rr.length;Lr++){var Gr=Rr[Lr].xaxis;Fe[Gr._id]=Gr;var Kr=Rr[Lr].yaxis;rt[Kr._id]=Kr}st=re(Fe),Qe=re(rt),jr=O(st,ot),wr=O(Qe,it),Ir=!wr&&!jr,xr=j(ce,ce._fullLayout._axisMatchGroups,Fe,rt),Sr=j(ce,ce._fullLayout._axisConstraintGroups,Fe,rt,xr);var Ur=Sr.isSubplotConstrained||xr.isSubplotConstrained;bt=ot||Ur,Be=it||Ur;var aa=ce._fullLayout;Ke=aa._has("scattergl"),Ue=aa._has("splom"),Ee=aa._has("svg")}Pe();var at=Q(wr+jr,ce._fullLayout.dragmode,ut),yt=B(be,it+ot+"drag",at,Ae,ze,Re,We);if(Ir&&!ut)return yt.onmousedown=null,yt.style.pointerEvents="none",yt;var Tt={element:yt,gd:ce,plotinfo:be};Tt.prepFn=function(Rr,Lr,Gr){var Kr=Tt.dragmode,Ur=ce._fullLayout.dragmode;Ur!==Kr&&(Tt.dragmode=Ur),Pe(),Ce=ce._fullLayout._invScaleX,Te=ce._fullLayout._invScaleY,Ir||(ut?Rr.shiftKey?Ur==="pan"?Ur="zoom":d(Ur)||(Ur="pan"):Rr.ctrlKey&&(Ur="pan"):Ur="pan"),T(Ur)?Tt.minDrag=1:Tt.minDrag=void 0,d(Ur)?(Tt.xaxes=st,Tt.yaxes=Qe,g(Rr,Lr,Gr,Tt,Ur)):(Tt.clickFn=Gt,d(Kr)&&Ot(),Ir||(Ur==="zoom"?(Tt.moveFn=Jt,Tt.doneFn=Kt,Tt.minDrag=1,kn(Rr,Lr,Gr)):Ur==="pan"&&(Tt.moveFn=Ia,Tt.doneFn=yn))),ce._fullLayout._redrag=function(){var aa=ce._dragdata;if(aa&&aa.element===yt){var da=ce._fullLayout.dragmode;d(da)||(Pe(),xt([0,0,qt,Zt]),Tt.moveFn(aa.dx,aa.dy))}}};function Ot(){Tt.plotinfo.selection=!1,b(ce)}function Gt(Rr,Lr){var Gr=Tt.gd;if(Gr._fullLayout._activeShapeIndex>=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||aa<Math.min(Math.max(Ur*.6,f),P)?Ur<f||!jr?da():(Tr.t=0,Tr.b=Zt,Ra="x",za.attr("d",X(Tr,Qt))):!jr||Ur<Math.min(aa*.6,P)?(Tr.l=0,Tr.r=qt,Ra="y",za.attr("d",oe(Tr,rr))):(Ra="xy",za.attr("d",ne(Tr)));Tr.w=Tr.r-Tr.l,Tr.h=Tr.b-Tr.t,Ra&&(en=!0),ce._dragged=en,he(Qa,za,Tr,Ua,Ba,la),Nt(),ce.emit("plotly_relayouting",Ve),Ba=!0}function Nt(){Ve={},(Ra==="xy"||Ra==="x")&&(N(st,Tr.l/qt,Tr.r/qt,Ve,Sr.xaxes),Ha("x",Ve)),(Ra==="xy"||Ra==="y")&&(N(Qe,(Zt-Tr.b)/Zt,(Zt-Tr.t)/Zt,Ve,Sr.yaxes),Ha("y",Ve))}function Kt(){Nt(),$(ce),yn(),J(ce)}var Wt=[0,0,qt,Zt],Pr=null,ta=y.REDRAWDELAY,ma=be.mainplot?ce._fullLayout._plots[be.mainplot]:be;function ra(Rr){if(!ce._context._scrollZoom.cartesian&&!ce._fullLayout._enablescrollzoom)return;if(Ot(),ce._transitioningWithDuration){Rr.preventDefault(),Rr.stopPropagation();return}Pe(),clearTimeout(Pr);var Lr=-Rr.deltaY;if(isFinite(Lr)||(Lr=Rr.wheelDelta/10),!isFinite(Lr)){x.log("Did not find wheel motion attributes: ",Rr);return}var Gr=Math.exp(-Math.min(Math.max(Lr,-20),20)/200),Kr=ma.draglayer.select(".nsewdrag").node().getBoundingClientRect(),Ur=(Rr.clientX-Kr.left)/Kr.width,aa=(Kr.bottom-Rr.clientY)/Kr.height,da;function fa(It,dr,kr){if(It.fixedrange)return;var na=x.simpleMap(It.range,It.r2l),Ca=na[0]+(na[1]-na[0])*dr;function Fa(Ya){return It.l2r(Ca+(Ya-Ca)*kr)}It.range=na.map(Fa)}if(bt){for(ot||(Ur=.5),da=0;da<st.length;da++)fa(st[da],Ur,Gr);Ha("x"),Wt[2]*=Gr,Wt[0]+=Wt[2]*Ur*(1/Gr-1)}if(Be){for(it||(aa=.5),da=0;da<Qe.length;da++)fa(Qe[da],aa,Gr);Ha("y"),Wt[3]*=Gr,Wt[1]+=Wt[3]*(1-aa)*(1/Gr-1)}xt(Wt),rn(),ce.emit("plotly_relayouting",Ve),Pr=setTimeout(function(){ce._fullLayout&&(Wt=[0,0,qt,Zt],yn())},ta),Rr.preventDefault()}it.length*ot.length!==1&&ee(yt,ra);function Ia(Rr,Lr){if(Rr=Rr*Ce,Lr=Lr*Te,ce._transitioningWithDuration)return;if(ce._fullLayout._replotting=!0,jr==="ew"||wr==="ns"){var Gr=jr?-Rr:0,Kr=wr?-Lr:0;if(xr.isSubplotConstrained){if(jr&&wr){var Ur=(Rr/qt-Lr/Zt)/2;Rr=Ur*qt,Lr=-Ur*Zt,Gr=-Rr,Kr=-Lr}wr?Gr=-Kr*qt/Zt:Kr=-Gr*Zt/qt}jr&&(U(st,Rr),Ha("x")),wr&&(U(Qe,Lr),Ha("y")),xt([Gr,Kr,qt,Zt]),rn(),ce.emit("plotly_relayouting",Ve);return}function aa(Fa,Ya,ha){for(var Da=1-Ya,Zn,Pn,fi=0;fi<Fa.length;fi++){var Ai=Fa[fi];if(!Ai.fixedrange){Zn=Ai,Pn=Ai._rl[Da]+(Ai._rl[Ya]-Ai._rl[Da])/W(ha/Ai._length);var ki=Ai.l2r(Pn);ki!==!1&&ki!==void 0&&(Ai.range[Ya]=ki)}}return Zn._length*(Zn._rl[Ya]-Pn)/(Zn._rl[Ya]-Zn._rl[Da])}var da=jr==="w"==(wr==="n")?1:-1;if(jr&&wr&&(Sr.isSubplotConstrained||xr.isSubplotConstrained)){var fa=(Rr/qt+da*Lr/Zt)/2;Rr=fa*qt,Lr=da*fa*Zt}var It,dr;if(jr==="w"?Rr=aa(st,0,Rr):jr==="e"?Rr=aa(st,1,-Rr):jr||(Rr=0),wr==="n"?Lr=aa(Qe,1,Lr):wr==="s"?Lr=aa(Qe,0,-Lr):wr||(Lr=0),It=jr==="w"?Rr:0,dr=wr==="n"?Lr:0,Sr.isSubplotConstrained&&!xr.isSubplotConstrained||xr.isSubplotConstrained&&jr&&wr&&da>0){var kr;if(xr.isSubplotConstrained||!jr&&wr.length===1){for(kr=0;kr<st.length;kr++)st[kr].range=st[kr]._r.slice(),u(st[kr],1-Lr/Zt);Rr=Lr*qt/Zt,It=Rr/2}if(xr.isSubplotConstrained||!wr&&jr.length===1){for(kr=0;kr<Qe.length;kr++)Qe[kr].range=Qe[kr]._r.slice(),u(Qe[kr],1-Rr/qt);Lr=Rr*Zt/qt,dr=Lr/2}}(!xr.isSubplotConstrained||!wr)&&Ha("x"),(!xr.isSubplotConstrained||!jr)&&Ha("y");var na=qt-Rr,Ca=Zt-Lr;xr.isSubplotConstrained&&!(jr&&wr)&&(jr?(dr=It?0:Rr*Zt/qt,Ca=na*Zt/qt):(It=dr?0:Lr*qt/Zt,na=Ca*qt/Zt)),xt([It,dr,na,Ca]),rn(),ce.emit("plotly_relayouting",Ve)}function Ha(Rr,Lr){for(var Gr=xr.isSubplotConstrained?{x:Qe,y:st}[Rr]:xr[Rr+"axes"],Kr=xr.isSubplotConstrained?{x:st,y:Qe}[Rr]:[],Ur=0;Ur<Gr.length;Ur++){var aa=Gr[Ur],da=aa._id,fa=xr.xLinks[da]||xr.yLinks[da],It=Kr[0]||Fe[fa]||rt[fa];It&&(Lr?(Lr[aa._name+".range[0]"]=Lr[It._name+".range[0]"],Lr[aa._name+".range[1]"]=Lr[It._name+".range[1]"]):aa.range=It.range.slice())}}function rn(){var Rr=[],Lr;function Gr(da){for(Lr=0;Lr<da.length;Lr++)da[Lr].fixedrange||Rr.push(da[Lr]._id)}function Kr(da,fa){for(Lr=0;Lr<da.length;Lr++){var It=da[Lr],dr=It[fa];!It.fixedrange&&dr.tickmode==="sync"&&Rr.push(dr._id)}}for(bt&&(Gr(st),Gr(Sr.xaxes),Gr(xr.xaxes),Kr(be.overlays,"xaxis")),Be&&(Gr(Qe),Gr(Sr.yaxes),Gr(xr.yaxes),Kr(be.overlays,"yaxis")),Ve={},Lr=0;Lr<Rr.length;Lr++){var Ur=Rr[Lr],aa=E(ce,Ur);s.drawOne(ce,aa,{skipTitle:!0}),Ve[aa._name+".range[0]"]=aa.range[0],Ve[aa._name+".range[1]"]=aa.range[1]}s.redrawComponents(ce,Rr)}function nn(){if(!ce._transitioningWithDuration){var Rr=ce._context.doubleClick,Lr=[];jr&&(Lr=Lr.concat(st)),wr&&(Lr=Lr.concat(Qe)),xr.xaxes&&(Lr=Lr.concat(xr.xaxes)),xr.yaxes&&(Lr=Lr.concat(xr.yaxes));var Gr={},Kr,Ur;if(Rr==="reset+autosize")for(Rr="autosize",Ur=0;Ur<Lr.length;Ur++){Kr=Lr[Ur];var aa=Kr._rangeInitial0,da=Kr._rangeInitial1,fa=aa!==void 0||da!==void 0;if(fa&&(aa!==void 0&&aa!==Kr.range[0]||da!==void 0&&da!==Kr.range[1])||!fa&&Kr.autorange!==!0){Rr="reset";break}}if(Rr==="autosize")for(Ur=0;Ur<Lr.length;Ur++)Kr=Lr[Ur],Kr.fixedrange||(Gr[Kr._name+".autorange"]=!0);else if(Rr==="reset"){for((jr||Sr.isSubplotConstrained)&&(Lr=Lr.concat(Sr.xaxes)),wr&&!Sr.isSubplotConstrained&&(Lr=Lr.concat(Sr.yaxes)),Sr.isSubplotConstrained&&(jr?wr||(Lr=Lr.concat(Qe)):Lr=Lr.concat(st)),Ur=0;Ur<Lr.length;Ur++)if(Kr=Lr[Ur],!Kr.fixedrange){var It=Kr._name,dr=Kr._autorangeInitial;Kr._rangeInitial0===void 0&&Kr._rangeInitial1===void 0?Gr[It+".autorange"]=!0:Kr._rangeInitial0===void 0?(Gr[It+".autorange"]=dr,Gr[It+".range"]=[null,Kr._rangeInitial1]):Kr._rangeInitial1===void 0?(Gr[It+".range"]=[Kr._rangeInitial0,null],Gr[It+".autorange"]=dr):Gr[It+".range"]=[Kr._rangeInitial0,Kr._rangeInitial1]}}ce.emit("plotly_doubleclick",null),t.call("_guiRelayout",ce,Gr)}}function yn(){xt([0,0,qt,Zt]),x.syncOrAsync([S.previousPromises,function(){ce._fullLayout._replotting=!1,t.call("_guiRelayout",ce,Ve)}],ce)}function xt(Rr){var Lr=ce._fullLayout,Gr=Lr._plots,Kr=Lr._subplots.cartesian,Ur,aa,da,fa;if(Ue&&t.subplotsRegistry.splom.drag(ce),Ke){for(Ur=0;Ur<Kr.length;Ur++)if(aa=Gr[Kr[Ur]],da=aa.xaxis,fa=aa.yaxis,aa._scene){da.limitRange&&da.limitRange(),fa.limitRange&&fa.limitRange();var It=x.simpleMap(da.range,da.r2l),dr=x.simpleMap(fa.range,fa.r2l);aa._scene.update({range:[It[0],dr[0],It[1],dr[1]]})}}if((Ue||Ke)&&(_(ce),w(ce)),Ee){var kr=Rr[2]/_e._length,na=Rr[3]/fe._length;for(Ur=0;Ur<Kr.length;Ur++){aa=Gr[Kr[Ur]],da=aa.xaxis,fa=aa.yaxis;var Ca=(bt||xr.isSubplotConstrained)&&!da.fixedrange&&Fe[da._id],Fa=(Be||xr.isSubplotConstrained)&&!fa.fixedrange&&rt[fa._id],Ya,ha,Da,Zn;if(Ca?(Ya=kr,Da=ot||xr.isSubplotConstrained?Rr[0]:Or(da,Ya)):xr.xaHash[da._id]?(Ya=kr,Da=Rr[0]*da._length/_e._length):xr.yaHash[da._id]?(Ya=na,Da=wr==="ns"?-Rr[1]*da._length/fe._length:Or(da,Ya,{n:"top",s:"bottom"}[wr])):(Ya=ct(da,kr,na),Da=Nr(da,Ya)),Ya>1&&(da.maxallowed!==void 0&&bt===(da.range[0]<da.range[1]?"e":"w")||da.minallowed!==void 0&&bt===(da.range[0]<da.range[1]?"w":"e"))&&(Ya=1,Da=0),Fa?(ha=na,Zn=it||xr.isSubplotConstrained?Rr[1]:Or(fa,ha)):xr.yaHash[fa._id]?(ha=na,Zn=Rr[1]*fa._length/fe._length):xr.xaHash[fa._id]?(ha=kr,Zn=jr==="ew"?-Rr[0]*fa._length/_e._length:Or(fa,ha,{e:"right",w:"left"}[jr])):(ha=ct(fa,kr,na),Zn=Nr(fa,ha)),ha>1&&(fa.maxallowed!==void 0&&Be===(fa.range[0]<fa.range[1]?"n":"s")||fa.minallowed!==void 0&&Be===(fa.range[0]<fa.range[1]?"s":"n"))&&(ha=1,Zn=0),!(!Ya&&!ha)){Ya||(Ya=1),ha||(ha=1);var Pn=da._offset-Da/Ya,fi=fa._offset-Zn/ha;aa.clipRect.call(n.setTranslate,Da,Zn).call(n.setScale,Ya,ha),aa.plot.call(n.setTranslate,Pn,fi).call(n.setScale,1/Ya,1/ha),(Ya!==aa.xScaleFactor||ha!==aa.yScaleFactor)&&(n.setPointGroupScale(aa.zoomScalePts,Ya,ha),n.setTextPointsScale(aa.zoomScaleTxt,Ya,ha)),n.hideOutsideRangePoints(aa.clipOnAxisFalseTraces,aa),aa.xScaleFactor=Ya,aa.yScaleFactor=ha}}}}function ct(Rr,Lr,Gr){return Rr.fixedrange?0:bt&&Sr.xaHash[Rr._id]?Lr:Be&&(Sr.isSubplotConstrained?Sr.xaHash:Sr.yaHash)[Rr._id]?Gr:0}function Nr(Rr,Lr){return Lr?(Rr.range=Rr._r.slice(),u(Rr,Lr),Or(Rr,Lr)):0}function Or(Rr,Lr,Gr){return Rr._length*(1-Lr)*l[Gr||Rr.constraintoward||"middle"]}return yt}function F(ce,be,Ae,ze){var Re=x.ensureSingle(ce.draglayer,be,Ae,function(We){We.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",ce.id)});return Re.call(c,ze),Re.node()}function B(ce,be,Ae,ze,Re,We,it){var ot=F(ce,"rect",be,Ae);return v.select(ot).call(n.setRect,ze,Re,We,it),ot}function O(ce,be){for(var Ae=0;Ae<ce.length;Ae++)if(!ce[Ae].fixedrange)return be;return""}function I(ce,be){var Ae=ce.range[be],ze=Math.abs(Ae-ce.range[1-be]),Re;return ce.type==="date"?Ae:ce.type==="log"?(Re=Math.ceil(Math.max(0,-Math.log(ze)/Math.LN10))+3,A("."+Re+"g")(Math.pow(10,Ae))):(Re=Math.floor(Math.log(Math.abs(Ae))/Math.LN10)-Math.floor(Math.log(ze)/Math.LN10)+4,A("."+String(Re)+"g")(Ae))}function N(ce,be,Ae,ze,Re){for(var We=0;We<ce.length;We++){var it=ce[We];if(!it.fixedrange)if(it.rangebreaks){var ot=it._id.charAt(0)==="y",tt=ot?1-be:be,ut=ot?1-Ae:Ae;ze[it._name+".range[0]"]=it.l2r(it.p2l(tt*it._length)),ze[it._name+".range[1]"]=it.l2r(it.p2l(ut*it._length))}else{var Me=it._rl[0],_e=it._rl[1]-Me;ze[it._name+".range[0]"]=it.l2r(Me+_e*be),ze[it._name+".range[1]"]=it.l2r(Me+_e*Ae)}}if(Re&&Re.length){var fe=(be+(1-Ae))/2;N(Re,fe,1-fe,ze,[])}}function U(ce,be){for(var Ae=0;Ae<ce.length;Ae++){var ze=ce[Ae];if(!ze.fixedrange){if(ze.rangebreaks){var Re=0,We=ze._length,it=ze.p2l(Re+be)-ze.p2l(Re),ot=ze.p2l(We+be)-ze.p2l(We),tt=(it+ot)/2;ze.range=[ze.l2r(ze._rl[0]-tt),ze.l2r(ze._rl[1]-tt)]}else ze.range=[ze.l2r(ze._rl[0]-be/ze._m),ze.l2r(ze._rl[1]-be/ze._m)];ze.limitRange&&ze.limitRange()}}}function W(ce){return 1-(ce>=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;rt<be.length;rt++){var st=be[rt];for(tt in Ae)if(st[tt]){for(Me in st)!(Re&&(fe[Me]||Fe[Me]))&&!(Me.charAt(0)==="x"?Ae:ze)[Me]&&(it[Me]=tt);for(ut in ze)!(Re&&(fe[ut]||Fe[ut]))&&st[ut]&&(We=!0)}for(ut in ze)if(st[ut])for(_e in st)!(Re&&(fe[_e]||Fe[_e]))&&!(_e.charAt(0)==="x"?Ae:ze)[_e]&&(ot[_e]=ut)}We&&(x.extendFlat(it,ot),ot={});var Qe={},Lt=[];for(Me in it){var kt=E(ce,Me);Lt.push(kt),Qe[kt._id]=kt}var qt={},Zt=[];for(_e in ot){var Sr=E(ce,_e);Zt.push(Sr),qt[Sr._id]=Sr}return{xaHash:Qe,yaHash:qt,xaxes:Lt,yaxes:Zt,xLinks:it,yLinks:ot,isSubplotConstrained:We}}function ee(ce,be){if(!e)ce.onwheel!==void 0?ce.onwheel=be:ce.onmousewheel!==void 0?ce.onmousewheel=be:ce.isAddedWheelEvent||(ce.isAddedWheelEvent=!0,ce.addEventListener("wheel",be,{passive:!1}));else{var Ae=ce.onwheel!==void 0?"wheel":"mousewheel";ce._onwheel&&ce.removeEventListener(Ae,ce._onwheel),ce._onwheel=be,ce.addEventListener(Ae,be,{passive:!1})}}function re(ce){var be=[];for(var Ae in ce)be.push(ce[Ae]);return be}q.exports={makeDragBox:z,makeDragger:F,makeRectDragger:B,makeZoombox:ue,makeCorners:se,updateZoombox:he,xyCorners:ne,transitionZoombox:H,removeZoombox:$,showDoubleClickNotifier:J,attachWheelEventHandler:ee}}}),PS=Ze({"src/plots/cartesian/graph_interact.js"(Z){"use strict";var q=Oi(),v=ef(),x=bp(),A=Kd(),M=LS().makeDragBox,e=kh().DRAGGERSIZE;Z.initInteractions=function(r){var i=r._fullLayout;if(r._context.staticPlot){q.select(r).selectAll(".drag").remove();return}if(!(!i._has("cartesian")&&!i._has("splom"))){var a=Object.keys(i._plots||{}).sort(function(o,s){if((i._plots[o].mainplot&&!0)===(i._plots[s].mainplot&&!0)){var c=o.split("y"),h=s.split("y");return c[0]===h[0]?Number(c[1]||1)-Number(h[1]||1):Number(c[0]||1)-Number(h[0]||1)}return i._plots[o].mainplot?1:-1});a.forEach(function(o){var s=i._plots[o],c=s.xaxis,h=s.yaxis;if(!s.mainplot){var m=M(r,s,c._offset,h._offset,c._length,h._length,"ns","ew");m.onmousemove=function(l){r._fullLayout._rehover=function(){r._fullLayout._hoversubplot===o&&r._fullLayout._plots[o]&&v.hover(r,l,o)},v.hover(r,l,o),r._fullLayout._lasthover=m,r._fullLayout._hoversubplot=o},m.onmouseout=function(l){r._dragging||(r._fullLayout._hoversubplot=null,x.unhover(r,l))},r._context.showAxisDragHandles&&(M(r,s,c._offset-e,h._offset-e,e,e,"n","w"),M(r,s,c._offset+c._length,h._offset-e,e,e,"n","e"),M(r,s,c._offset-e,h._offset+h._length,e,e,"s","w"),M(r,s,c._offset+c._length,h._offset+h._length,e,e,"s","e"))}if(r._context.showAxisDragHandles){if(o===c._mainSubplot){var d=c._mainLinePosition;c.side==="top"&&(d-=e),M(r,s,c._offset+c._length*.1,d,c._length*.8,e,"","ew"),M(r,s,c._offset,d,c._length*.1,e,"","w"),M(r,s,c._offset+c._length*.9,d,c._length*.1,e,"","e")}if(o===h._mainSubplot){var T=h._mainLinePosition;h.side!=="right"&&(T-=e),M(r,s,T,h._offset+h._length*.1,e,h._length*.8,"ns",""),M(r,s,T,h._offset+h._length*.9,e,h._length*.1,"s",""),M(r,s,T,h._offset,e,h._length*.1,"n","")}}});var n=i._hoverlayer.node();n.onmousemove=function(o){o.target=r._fullLayout._lasthover,v.hover(r,o,i._hoversubplot)},n.onclick=function(o){o.target=r._fullLayout._lasthover,v.click(r,o)},n.onmousedown=function(o){r._fullLayout._lasthover.onmousedown(o)},Z.updateFx(r)}},Z.updateFx=function(t){var r=t._fullLayout,i=r.dragmode==="pan"?"move":"crosshair";A(r._draggers,i)}}}),OO=Ze({"src/plot_api/container_array_match.js"(Z,q){"use strict";var v=oo();q.exports=function(A){for(var M=v.layoutArrayContainers,e=v.layoutArrayRegexes,t=A.split("[")[0],r,i,a=0;a<e.length;a++)if(i=A.match(e[a]),i&&i.index===0){r=i[0];break}if(r||(r=M[M.indexOf(t)]),!r)return!1;var n=A.substr(r.length);return n?(i=n.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/),i?{array:r,index:Number(i[1]),property:i[3]||""}:!1):{array:r,index:"",property:""}}}}),BO=Ze({"src/plot_api/manage_arrays.js"(Z){"use strict";var q=Xv(),v=h2(),x=Ym(),A=m2().sorterAsc,M=oo();Z.containerArrayMatch=OO();var e=Z.isAddVal=function(i){return i==="add"||q(i)},t=Z.isRemoveVal=function(i){return i===null||i==="remove"};Z.applyContainerArrayChanges=function(i,a,n,o,s){var c=a.astr,h=M.getComponentMethod(c,"supplyLayoutDefaults"),m=M.getComponentMethod(c,"draw"),d=M.getComponentMethod(c,"drawOne"),T=o.replot||o.recalc||h===v||m===v,l=i.layout,_=i._fullLayout;if(n[""]){Object.keys(n).length>1&&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;f<S.length;f++){if(L=S[f],z=n[L],F=Object.keys(z),B=z[""],O=e(B),L<0||L>g.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<F.length;P++)I=c+"["+L+"].",s(g[L],F[P],I).set(z[F[P]])}for(f=p.length-1;f>=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<S.length&&(L=S[f],!(L>=u));f++)N.push(L);for(f=u;f<y;f++)N.push(f)}for(f=0;f<N.length;f++)d(i,N[f])}else m(i);return!0}}}),NO=Ze({"src/plot_api/helpers.js"(Z){"use strict";var q=is(),v=QA(),x=oo(),A=ca(),M=xc(),e=$c(),t=Yi(),r=e.cleanId,i=e.getFromTrace,a=x.traceIs;Z.clearPromiseQueue=function(l){Array.isArray(l._promises)&&l._promises.length>0&&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;_<p.length;_++){var u=p[_];if(S&&S.test(u)){var y=l[u];y.anchor&&y.anchor!=="free"&&(y.anchor=r(y.anchor)),y.overlaying&&(y.overlaying=r(y.overlaying)),y.type||(y.isdate?y.type="date":y.islog?y.type="log":y.isdate===!1&&y.islog===!1&&(y.type="linear")),(y.autorange==="withzero"||y.autorange==="tozero")&&(y.autorange=!0,y.rangemode="tozero"),y.insiderange&&delete y.range,delete y.islog,delete y.isdate,delete y.categories,h(y,"domain")&&delete y.domain}}var f=Array.isArray(l.annotations)?l.annotations.length:0;for(_=0;_<f;_++){var P=l.annotations[_];A.isPlainObject(P)&&(n(P,"xref"),n(P,"yref"))}var L=Array.isArray(l.shapes)?l.shapes.length:0;for(_=0;_<L;_++){var z=l.shapes[_];A.isPlainObject(z)&&(n(z,"xref"),n(z,"yref"))}var F=Array.isArray(l.images)?l.images.length:0;for(_=0;_<F;_++){var B=l.images[_];A.isPlainObject(B)&&(n(B,"xref"),n(B,"yref"))}var O=l.legend;return O&&(O.x>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;_<l.length;_++){var w=l[_],S;if(w.type==="histogramy"&&"xbins"in w&&!("ybins"in w)&&(w.ybins=w.xbins,delete w.xbins),w.type==="histogramy"&&Z.swapXYData(w),(w.type==="histogramx"||w.type==="histogramy")&&(w.type="histogram"),"scl"in w&&!("colorscale"in w)&&(w.colorscale=w.scl,delete w.scl),"reversescl"in w&&!("reversescale"in w)&&(w.reversescale=w.reversescl,delete w.reversescl),w.xaxis&&(w.xaxis=r(w.xaxis,"x")),w.yaxis&&(w.yaxis=r(w.yaxis,"y")),a(w,"gl3d")&&w.scene&&(w.scene=M.subplotsRegistry.gl3d.cleanId(w.scene)),!a(w,"pie-like")&&!a(w,"bar-like"))if(Array.isArray(w.textposition))for(S=0;S<w.textposition.length;S++)w.textposition[S]=c(w.textposition[S]);else w.textposition&&(w.textposition=c(w.textposition));var E=x.getModule(w);if(E&&E.colorbar){var g=E.colorbar.container,b=g?w[g]:w;b&&b.colorscale&&(b.colorscale==="YIGnBu"&&(b.colorscale="YlGnBu"),b.colorscale==="YIOrRd"&&(b.colorscale="YlOrRd"))}if(w.type==="surface"&&A.isPlainObject(w.contours)){var p=["x","y","z"];for(S=0;S<p.length;S++){var u=w.contours[p[S]];A.isPlainObject(u)&&(u.highlightColor&&(u.highlightcolor=u.highlightColor,delete u.highlightColor),u.highlightWidth&&(u.highlightwidth=u.highlightWidth,delete u.highlightWidth))}}if(w.type==="candlestick"||w.type==="ohlc"){var y=(w.increasing||{}).showlegend!==!1,f=(w.decreasing||{}).showlegend!==!1,P=o(w.increasing),L=o(w.decreasing);if(P!==!1&&L!==!1){var z=s(P,L,y,f);z&&(w.name=z)}else(P||L)&&!w.name&&(w.name=P||L)}h(w,"line")&&delete w.line,"marker"in w&&(h(w.marker,"line")&&delete w.marker.line,h(w,"marker")&&delete w.marker),t.clean(w),w.autobinx&&(delete w.autobinx,delete w.xbins),w.autobiny&&(delete w.autobiny,delete w.ybins)}};function o(l){if(!A.isPlainObject(l))return!1;var _=l.name;return delete l.name,delete l.showlegend,(typeof _=="string"||typeof _=="number")&&String(_)}function s(l,_,w,S){if(w&&!S)return l;if(S&&!w||!l.trim())return _;if(!_.trim())return l;var E=Math.min(l.length,_.length),g;for(g=0;g<E&&l.charAt(g)===_.charAt(g);g++);var b=l.substr(0,g);return b.trim()}function c(l){var _="middle",w="center";return typeof l=="string"&&(l.indexOf("top")!==-1?_="top":l.indexOf("bottom")!==-1&&(_="bottom"),l.indexOf("left")!==-1?w="left":l.indexOf("right")!==-1&&(w="right")),_+" "+w}function h(l,_){return _ in l&&typeof l[_]=="object"&&Object.keys(l[_]).length===0}Z.swapXYData=function(l){var _;if(A.swapAttrs(l,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(l.z)&&Array.isArray(l.z[0])&&(l.transpose?delete l.transpose:l.transpose=!0),l.error_x&&l.error_y){var w=l.error_y,S="copy_ystyle"in w?w.copy_ystyle:!(w.color||w.thickness||w.width);A.swapAttrs(l,["error_?.copy_ystyle"]),S&&A.swapAttrs(l,["error_?.color","error_?.thickness","error_?.width"])}if(typeof l.hoverinfo=="string"){var E=l.hoverinfo.split("+");for(_=0;_<E.length;_++)E[_]==="x"?E[_]="y":E[_]==="y"&&(E[_]="x");l.hoverinfo=E.join("+")}},Z.coerceTraceIndices=function(l,_){if(q(_))return[_];if(!Array.isArray(_)||!_.length)return l.data.map(function(E,g){return g});if(Array.isArray(_)){for(var w=[],S=0;S<_.length;S++)A.isIndex(_[S],l.data.length)?w.push(_[S]):A.warn("trace index (",_[S],") is not a number or is out of bounds");return w}return _},Z.manageArrayContainers=function(l,_,w){var S=l.obj,E=l.parts,g=E.length,b=E[g-1],p=q(b);if(p&&_===null){var u=E.slice(0,g-1).join("."),y=A.nestedProperty(S,u).get();y.splice(b,1)}else p&&l.get()===void 0&&l.get()===void 0&&(w[l.astr]=null),l.set(_)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function d(l){var _=l.search(m);if(_>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.calcdata.length;Tr++)Ee.calcdata[Tr][0].trace=Ee._fullData[Tr];Ee._context.responsive?Ee._responsiveChartHandler||(Ee._responsiveChartHandler=function(){A.isHidden(Ee)||a.resize(Ee)},window.addEventListener("resize",Ee._responsiveChartHandler)):A.clearResponsive(Ee);var la=A.extendFlat({},Gt._size),Ua=0;function Ba(){for(var Kt=Gt._basePlotModules,Wt=0;Wt<Kt.length;Wt++)Kt[Wt].drawFramework&&Kt[Wt].drawFramework(Ee);!Gt._glcanvas&&Gt._has("gl")&&(Gt._glcanvas=Gt._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(ra){return ra.key}),Gt._glcanvas.enter().append("canvas").attr("class",function(ra){return"gl-canvas gl-canvas-"+ra.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var Pr=Ee._context.plotGlPixelRatio;if(Gt._glcanvas){Gt._glcanvas.attr("width",Gt.width*Pr).attr("height",Gt.height*Pr).style("width",Gt.width+"px").style("height",Gt.height+"px");var ta=Gt._glcanvas.data()[0].regl;if(ta&&(Math.floor(Gt.width*Pr)!==ta._gl.drawingBufferWidth||Math.floor(Gt.height*Pr)!==ta._gl.drawingBufferHeight)){var ma="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(Ua)A.error(ma);else return A.log(ma+" Clearing graph and plotting again."),a.cleanPlot([],{},Ee._fullData,Gt),a.supplyDefaults(Ee),Gt=Ee._fullLayout,a.doCalcdata(Ee),Ua++,Ba()}}return Gt.modebar.orientation==="h"?Gt._modebardiv.style("height",null).style("width","100%"):Gt._modebardiv.style("width",null).style("height",Gt.height+"px"),a.previousPromises(Ee)}function Ra(){if(a.clearAutoMarginIds(Ee),S.drawMarginPushers(Ee),n.allowAutoMargin(Ee),Ee._fullLayout.title.text&&Ee._fullLayout.title.automargin&&a.allowAutoMargin(Ee,"title.automargin"),Gt._has("pie"))for(var Kt=Ee._fullData,Wt=0;Wt<Kt.length;Wt++){var Pr=Kt[Wt];Pr.type==="pie"&&Pr.automargin&&a.allowAutoMargin(Ee,"pie."+Pr.uid+".automargin")}return a.doAutoMargin(Ee),a.previousPromises(Ee)}function Qa(){if(a.didMarginChange(la,Gt._size))return A.syncOrAsync([Ra,S.layoutStyles],Ee)}function za(){if(!Qt){en();return}return A.syncOrAsync([r.getComponentMethod("shapes","calcAutorange"),r.getComponentMethod("annotations","calcAutorange"),en],Ee)}function en(){Ee._transitioning||(S.doAutoRangeAndConstraints(Ee),Ot&&n.saveRangeInitial(Ee),r.getComponentMethod("rangeslider","calcAutorange")(Ee))}function kn(){return n.draw(Ee,Ot?"":"redraw")}var Jt=[a.previousPromises,Tt,Ba,Ra,Qa];rr&&Jt.push(za),Jt.push(S.layoutStyles),rr&&Jt.push(kn,function(Wt){var Pr=Wt._fullLayout._insideTickLabelsUpdaterange;if(Pr)return Wt._fullLayout._insideTickLabelsUpdaterange=void 0,be(Wt,Pr).then(function(){n.saveRangeInitial(Wt,!0)})}),Jt.push(S.drawData,S.finalDraw,m,a.addLinks,a.rehover,a.redrag,a.reselect,a.doAutoMargin,a.previousPromises);var Nt=A.syncOrAsync(Jt,Ee);return(!Nt||!Nt.then)&&(Nt=Promise.resolve()),Nt.then(function(){return y(Ee),Ee})}function y(Ee){var Ve=Ee._fullLayout;Ve._redrawFromAutoMarginCount?Ve._redrawFromAutoMarginCount--:Ee.emit("plotly_afterplot")}function f(Ee){return A.extendFlat(l,Ee)}function P(Ee,Ve){try{Ee._fullLayout._paper.style("background",Ve)}catch(Ce){A.error(Ce)}}function L(Ee,Ve){var Ce=h.combine(Ve,"white");P(Ee,Ce)}function z(Ee,Ve){if(!Ee._context){Ee._context=A.extendDeep({},l);var Ce=q.select("base");Ee._context._baseUrl=Ce.size()&&Ce.attr("href")?window.location.href.split("#")[0]:""}var Te=Ee._context,Pe,at,yt;if(Ve){for(at=Object.keys(Ve),Pe=0;Pe<at.length;Pe++)yt=at[Pe],!(yt==="editable"||yt==="edits")&&yt in Te&&(yt==="setBackground"&&Ve[yt]==="opaque"?Te[yt]=L:Te[yt]=Ve[yt]);var Tt=Ve.editable;if(Tt!==void 0)for(Te.editable=Tt,at=Object.keys(Te.edits),Pe=0;Pe<at.length;Pe++)Te.edits[at[Pe]]=Tt;if(Ve.edits)for(at=Object.keys(Ve.edits),Pe=0;Pe<at.length;Pe++)yt=at[Pe],yt in Te.edits&&(Te.edits[yt]=Ve.edits[yt]);Te._exportedPlot=Ve._exportedPlot}Te.staticPlot&&(Te.editable=!1,Te.edits={},Te.autosizable=!1,Te.scrollZoom=!1,Te.doubleClick=!1,Te.showTips=!1,Te.showLink=!1,Te.displayModeBar=!1),Te.displayModeBar==="hover"&&!x&&(Te.displayModeBar=!0),(Te.setBackground==="transparent"||typeof Te.setBackground!="function")&&(Te.setBackground=P),Te._hasZeroHeight=Te._hasZeroHeight||Ee.clientHeight===0,Te._hasZeroWidth=Te._hasZeroWidth||Ee.clientWidth===0;var Ot=Te.scrollZoom,Gt=Te._scrollZoom={};if(Ot===!0)Gt.cartesian=1,Gt.gl3d=1,Gt.geo=1,Gt.mapbox=1,Gt.map=1;else if(typeof Ot=="string"){var rr=Ot.split("+");for(Pe=0;Pe<rr.length;Pe++)Gt[rr[Pe]]=1}else Ot!==!1&&(Gt.gl3d=1,Gt.geo=1,Gt.mapbox=1,Gt.map=1)}function F(Ee){if(Ee=A.getGraphDiv(Ee),!A.isPlotDiv(Ee))throw new Error("This element is not a Plotly plot: "+Ee);return w.cleanData(Ee.data),w.cleanLayout(Ee.layout),Ee.calcdata=void 0,Z._doPlot(Ee).then(function(){return Ee.emit("plotly_redraw"),Ee})}function B(Ee,Ve,Ce,Te){return Ee=A.getGraphDiv(Ee),a.cleanPlot([],{},Ee._fullData||[],Ee._fullLayout||{}),a.purge(Ee),Z._doPlot(Ee,Ve,Ce,Te)}function O(Ee,Ve){var Ce=Ve+1,Te=[],Pe,at;for(Pe=0;Pe<Ee.length;Pe++)at=Ee[Pe],at<0?Te.push(Ce+at):Te.push(at);return Te}function I(Ee,Ve,Ce){var Te,Pe;for(Te=0;Te<Ve.length;Te++){if(Pe=Ve[Te],Pe!==parseInt(Pe,10))throw new Error("all values in "+Ce+" must be integers");if(Pe>=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<Ve.length;Te++)if(Pe=Ve[Te],typeof Pe!="object"||Array.isArray(Pe)||Pe===null)throw new Error("all values in traces array must be non-array objects");if(typeof Ce<"u"&&!Array.isArray(Ce)&&(Ce=[Ce]),typeof Ce<"u"&&Ce.length!==Ve.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function W(Ee,Ve,Ce,Te){var Pe=A.isPlainObject(Te);if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array");if(!A.isPlainObject(Ve))throw new Error("update must be a key:value object");if(typeof Ce>"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<Ce.length;Tr++){if(yt=Ee.data[Ce[Tr]],Ot=M(yt,Qt),Tt=Ot.get(),Gt=Ve[Qt][Tr],!A.isArrayOrTypedArray(Gt))throw new Error("attribute: "+Qt+" index: "+Tr+" must be an array");if(!A.isArrayOrTypedArray(Tt))throw new Error("cannot extend missing or non-array attribute: "+Qt);if(Tt.constructor!==Gt.constructor)throw new Error("cannot extend array with an array of a different type: "+Qt);rr=Pe?Te[Qt][Tr]:Te,v(rr)||(rr=-1),at.push({prop:Ot,target:Tt,insert:Gt,maxp:Math.floor(rr)})}return at}function ue(Ee,Ve,Ce,Te,Pe){W(Ee,Ve,Ce,Te);for(var at=Q(Ee,Ve,Ce,Te),yt={},Tt={},Ot=0;Ot<at.length;Ot++){var Gt=at[Ot].prop,rr=at[Ot].maxp,Qt=Pe(at[Ot].target,at[Ot].insert,rr);Gt.set(Qt[0]),Array.isArray(yt[Gt.astr])||(yt[Gt.astr]=[]),yt[Gt.astr].push(Qt[1]),Array.isArray(Tt[Gt.astr])||(Tt[Gt.astr]=[]),Tt[Gt.astr].push(at[Ot].target.length)}return{update:yt,maxPoints:Tt}}function se(Ee,Ve){var Ce=new Ee.constructor(Ee.length+Ve.length);return Ce.set(Ee),Ce.set(Ve,Ee.length),Ce}function he(Ee,Ve,Ce,Te){Ee=A.getGraphDiv(Ee);function Pe(Ot,Gt,rr){var Qt,Tr;if(A.isTypedArray(Ot))if(rr<0){var la=new Ot.constructor(0),Ua=se(Ot,Gt);rr<0?(Qt=Ua,Tr=la):(Qt=la,Tr=Ua)}else if(Qt=new Ot.constructor(rr),Tr=new Ot.constructor(Ot.length+Gt.length-rr),rr===Gt.length)Qt.set(Gt),Tr.set(Ot);else if(rr<Gt.length){var Ba=Gt.length-rr;Qt.set(Gt.subarray(Ba)),Tr.set(Ot),Tr.set(Gt.subarray(0,Ba),Ot.length)}else{var Ra=rr-Gt.length,Qa=Ot.length-Ra;Qt.set(Ot.subarray(Qa)),Qt.set(Gt,Ra),Tr.set(Ot.subarray(0,Qa))}else Qt=Ot.concat(Gt),Tr=rr>=0&&rr<Qt.length?Qt.splice(0,Qt.length-rr):[];return[Qt,Tr]}var at=ue(Ee,Ve,Ce,Te,Pe),yt=Z.redraw(Ee),Tt=[Ee,at.update,Ce,at.maxPoints];return t.add(Ee,Z.prependTraces,Tt,he,arguments),yt}function H(Ee,Ve,Ce,Te){Ee=A.getGraphDiv(Ee);function Pe(Ot,Gt,rr){var Qt,Tr;if(A.isTypedArray(Ot))if(rr<=0){var la=new Ot.constructor(0),Ua=se(Gt,Ot);rr<0?(Qt=Ua,Tr=la):(Qt=la,Tr=Ua)}else if(Qt=new Ot.constructor(rr),Tr=new Ot.constructor(Ot.length+Gt.length-rr),rr===Gt.length)Qt.set(Gt),Tr.set(Ot);else if(rr<Gt.length){var Ba=Gt.length-rr;Qt.set(Gt.subarray(0,Ba)),Tr.set(Gt.subarray(Ba)),Tr.set(Ot,Ba)}else{var Ra=rr-Gt.length;Qt.set(Gt),Qt.set(Ot.subarray(0,Ra),Gt.length),Tr.set(Ot.subarray(Ra))}else Qt=Gt.concat(Ot),Tr=rr>=0&&rr<Qt.length?Qt.splice(rr,Qt.length):[];return[Qt,Tr]}var at=ue(Ee,Ve,Ce,Te,Pe),yt=Z.redraw(Ee),Tt=[Ee,at.update,Ce,at.maxPoints];return t.add(Ee,Z.extendTraces,Tt,H,arguments),yt}function $(Ee,Ve,Ce){Ee=A.getGraphDiv(Ee);var Te=[],Pe=Z.deleteTraces,at=$,yt=[Ee,Te],Tt=[Ee,Ve],Ot,Gt;for(U(Ee,Ve,Ce),Array.isArray(Ve)||(Ve=[Ve]),Ve=Ve.map(function(rr){return A.extendFlat({},rr)}),w.cleanData(Ve),Ot=0;Ot<Ve.length;Ot++)Ee.data.push(Ve[Ot]);for(Ot=0;Ot<Ve.length;Ot++)Te.push(-Ve.length+Ot);if(typeof Ce>"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<Ve.length;Tt+=1)Ot=Ee.data.splice(Ve[Tt],1)[0],Ce.push(Ot);var Gt=Z.redraw(Ee);return t.add(Ee,Te,at,Pe,yt),Gt}function X(Ee,Ve,Ce){Ee=A.getGraphDiv(Ee);var Te=[],Pe=[],at=X,yt=X,Tt=[Ee,Ce,Ve],Ot=[Ee,Ve,Ce],Gt;if(N(Ee,Ve,Ce),Ve=Array.isArray(Ve)?Ve:[Ve],typeof Ce>"u")for(Ce=[],Gt=0;Gt<Ve.length;Gt++)Ce.push(-Ve.length+Gt);for(Ce=Array.isArray(Ce)?Ce:[Ce],Ve=O(Ve,Ee.data.length-1),Ce=O(Ce,Ee.data.length-1),Gt=0;Gt<Ee.data.length;Gt++)Ve.indexOf(Gt)===-1&&Te.push(Ee.data[Gt]);for(Gt=0;Gt<Ve.length;Gt++)Pe.push({newIndex:Ce[Gt],trace:Ee.data[Ve[Gt]]});for(Pe.sort(function(Qt,Tr){return Qt.newIndex-Tr.newIndex}),Gt=0;Gt<Pe.length;Gt+=1)Te.splice(Pe[Gt].newIndex,0,Pe[Gt].trace);Ee.data=Te;var rr=Z.redraw(Ee);return t.add(Ee,at,Tt,yt,Ot),rr}function oe(Ee,Ve,Ce,Te){Ee=A.getGraphDiv(Ee),w.clearPromiseQueue(Ee);var Pe={};if(typeof Ve=="string")Pe[Ve]=Ce;else if(A.isPlainObject(Ve))Pe=A.extendFlat({},Ve),Te===void 0&&(Te=Ce);else return A.warn("Restyle fail.",Ve,Ce,Te),Promise.reject();Object.keys(Pe).length&&(Ee.changed=!0);var at=w.coerceTraceIndices(Ee,Te),yt=ce(Ee,Pe,at),Tt=yt.flags;Tt.calc&&(Ee.calcdata=void 0),Tt.clearAxisTypes&&w.clearAxisTypes(Ee,at,{});var Ot=[];Tt.fullReplot?Ot.push(Z._doPlot):(Ot.push(a.previousPromises),a.supplyDefaults(Ee),Tt.markerSize&&(a.doCalcdata(Ee),ze(Ot)),Tt.style&&Ot.push(S.doTraceStyle),Tt.colorbars&&Ot.push(S.doColorBars),Ot.push(y)),Ot.push(a.rehover,a.redrag,a.reselect),t.add(Ee,oe,[Ee,yt.undoit,yt.traces],oe,[Ee,yt.redoit,yt.traces]);var Gt=A.syncOrAsync(Ot,Ee);return(!Gt||!Gt.then)&&(Gt=Promise.resolve()),Gt.then(function(){return Ee.emit("plotly_restyle",yt.eventData),Ee})}function ne(Ee){return Ee===void 0?null:Ee}function j(Ee,Ve){return Ve?function(Ce,Te,Pe){var at=M(Ce,Te),yt=at.set;return at.set=function(Tt){var Ot=(Pe||"")+Te;ee(Ot,at.get(),Tt,Ee),yt(Tt)},at}:M}function ee(Ee,Ve,Ce,Te){if(Array.isArray(Ve)||Array.isArray(Ce))for(var Pe=Array.isArray(Ve)?Ve:[],at=Array.isArray(Ce)?Ce:[],yt=Math.max(Pe.length,at.length),Tt=0;Tt<yt;Tt++)ee(Ee+"["+Tt+"]",Pe[Tt],at[Tt],Te);else if(A.isPlainObject(Ve)||A.isPlainObject(Ce)){var Ot=A.isPlainObject(Ve)?Ve:{},Gt=A.isPlainObject(Ce)?Ce:{},rr=A.extendFlat({},Ot,Gt);for(var Qt in rr)ee(Ee+"."+Qt,Ot[Qt],Gt[Qt],Te)}else Te[Ee]===void 0&&(Te[Ee]=ne(Ve))}function re(Ee,Ve,Ce){for(var Te in Ce){var Pe=M(Ee,Te);ee(Te,Pe.get(),Ce[Te],Ve)}}function ce(Ee,Ve,Ce){var Te=Ee._fullLayout,Pe=Ee._fullData,at=Ee.data,yt=Te._guiEditing,Tt=j(Te._preGUI,yt),Ot=A.extendDeepAll({},Ve),Gt,rr=E.traceFlags(),Qt={},Tr={},la;function Ua(){return Ce.map(function(){})}function Ba(kr){var na=n.id2name(kr);la.indexOf(na)===-1&&la.push(na)}function Ra(kr){return"LAYOUT"+kr+".autorange"}function Qa(kr){return"LAYOUT"+kr+".range"}function za(kr){for(var na=kr;na<Pe.length;na++)if(Pe[na]._input===at[kr])return Pe[na]}function en(kr,na,Ca){if(Array.isArray(kr)){kr.forEach(function(Da){en(Da,na,Ca)});return}if(!(kr in Ve||w.hasParent(Ve,kr))){var Fa;if(kr.substr(0,6)==="LAYOUT")Fa=Tt(Ee.layout,kr.replace("LAYOUT",""));else{var Ya=Ce[Ca],ha=Te._tracePreGUI[za(Ya)._fullInput.uid];Fa=j(ha,yt)(at[Ya],kr)}kr in Tr||(Tr[kr]=Ua()),Tr[kr][Ca]===void 0&&(Tr[kr][Ca]=ne(Fa.get())),na!==void 0&&Fa.set(na)}}function kn(kr){return function(na){return Pe[na][kr]}}function Jt(kr){return function(na,Ca){return na===!1?Pe[Ce[Ca]][kr]:null}}for(var Nt in Ve){if(w.hasParent(Ve,Nt))throw new Error("cannot set "+Nt+" and a parent attribute simultaneously");var Kt=Ve[Nt],Wt,Pr,ta,ma,ra,Ia;if((Nt==="autobinx"||Nt==="autobiny")&&(Nt=Nt.charAt(Nt.length-1)+"bins",Array.isArray(Kt)?Kt=Kt.map(Jt(Nt)):Kt===!1?Kt=Ce.map(kn(Nt)):Kt=null),Qt[Nt]=Kt,Nt.substr(0,6)==="LAYOUT"){ta=Tt(Ee.layout,Nt.replace("LAYOUT","")),Tr[Nt]=[ne(ta.get())],ta.set(Array.isArray(Kt)?Kt[0]:Kt),rr.calc=!0;continue}for(Tr[Nt]=Ua(),Gt=0;Gt<Ce.length;Gt++){Wt=at[Ce[Gt]],Pr=za(Ce[Gt]);var Ha=Te._tracePreGUI[Pr._fullInput.uid];if(ta=j(Ha,yt)(Wt,Nt),ma=ta.get(),ra=Array.isArray(Kt)?Kt[Gt%Kt.length]:Kt,ra!==void 0){var rn=ta.parts[ta.parts.length-1],nn=Nt.substr(0,Nt.length-rn.length-1),yn=nn?nn+".":"",xt=nn?M(Pr,nn).get():Pr;if(Ia=i.getTraceValObject(Pr,ta.parts),Ia&&Ia.impliedEdits&&ra!==null)for(var ct in Ia.impliedEdits)en(A.relativeAttr(Nt,ct),Ia.impliedEdits[ct],Gt);else if((rn==="thicknessmode"||rn==="lenmode")&&ma!==ra&&(ra==="fraction"||ra==="pixels")&&xt){var Nr=Te._size,Or=xt.orient,Rr=Or==="top"||Or==="bottom";if(rn==="thicknessmode"){var Lr=Rr?Nr.h:Nr.w;en(yn+"thickness",xt.thickness*(ra==="fraction"?1/Lr:Lr),Gt)}else{var Gr=Rr?Nr.w:Nr.h;en(yn+"len",xt.len*(ra==="fraction"?1/Gr:Gr),Gt)}}else if(Nt==="type"&&(ra==="pie"!=(ma==="pie")||ra==="funnelarea"!=(ma==="funnelarea"))){var Kr="x",Ur="y";(ra==="bar"||ma==="bar")&&Wt.orientation==="h"&&(Kr="y",Ur="x"),A.swapAttrs(Wt,["?","?src"],"labels",Kr),A.swapAttrs(Wt,["d?","?0"],"label",Kr),A.swapAttrs(Wt,["?","?src"],"values",Ur),ma==="pie"||ma==="funnelarea"?(M(Wt,"marker.color").set(M(Wt,"marker.colors").get()),Te._pielayer.selectAll("g.trace").remove()):r.traceIs(Wt,"cartesian")&&M(Wt,"marker.colors").set(M(Wt,"marker.color").get())}Tr[Nt][Gt]=ne(ma);var aa=["swapxy","swapxyaxes","orientation","orientationaxes"];if(aa.indexOf(Nt)!==-1){if(Nt==="orientation"){ta.set(ra);var da=Wt.x&&!Wt.y?"h":"v";if((ta.get()||da)===Pr.orientation)continue}else Nt==="orientationaxes"&&(Wt.orientation={v:"h",h:"v"}[Pr.orientation]);w.swapXYData(Wt),rr.calc=rr.clearAxisTypes=!0}else a.dataArrayContainers.indexOf(ta.parts[0])!==-1?(w.manageArrayContainers(ta,ra,Tr),rr.calc=!0):(Ia?Ia.arrayOk&&!r.traceIs(Pr,"regl")&&(A.isArrayOrTypedArray(ra)||A.isArrayOrTypedArray(ma))?rr.calc=!0:E.update(rr,Ia):rr.calc=!0,ta.set(ra))}}if(["swapxyaxes","orientationaxes"].indexOf(Nt)!==-1&&n.swap(Ee,Ce),Nt==="orientationaxes"){var fa=M(Ee.layout,"hovermode"),It=fa.get();It==="x"?fa.set("y"):It==="y"?fa.set("x"):It==="x unified"?fa.set("y unified"):It==="y unified"&&fa.set("x unified")}if(["orientation","type"].indexOf(Nt)!==-1){for(la=[],Gt=0;Gt<Ce.length;Gt++){var dr=at[Ce[Gt]];r.traceIs(dr,"cartesian")&&(Ba(dr.xaxis||"x"),Ba(dr.yaxis||"y"))}en(la.map(Ra),!0,0),en(la.map(Qa),[0,1],0)}}return(rr.calc||rr.plot)&&(rr.fullReplot=!0),{flags:rr,undoit:Tr,redoit:Qt,traces:Ce,eventData:A.extendDeepNoArrays([],[Ot,Ce])}}function be(Ee,Ve,Ce){Ee=A.getGraphDiv(Ee),w.clearPromiseQueue(Ee);var Te={};if(typeof Ve=="string")Te[Ve]=Ce;else if(A.isPlainObject(Ve))Te=A.extendFlat({},Ve);else return A.warn("Relayout fail.",Ve,Ce),Promise.reject();Object.keys(Te).length&&(Ee.changed=!0);var Pe=ot(Ee,Te),at=Pe.flags;at.calc&&(Ee.calcdata=void 0);var yt=[a.previousPromises];at.layoutReplot?yt.push(S.layoutReplot):Object.keys(Te).length&&(Ae(Ee,at,Pe)||a.supplyDefaults(Ee),at.legend&&yt.push(S.doLegend),at.layoutstyle&&yt.push(S.layoutStyles),at.axrange&&ze(yt,Pe.rangesAltered),at.ticks&&yt.push(S.doTicksRelayout),at.modebar&&yt.push(S.doModeBar),at.camera&&yt.push(S.doCamera),at.colorbars&&yt.push(S.doColorBars),yt.push(y)),yt.push(a.rehover,a.redrag,a.reselect),t.add(Ee,be,[Ee,Pe.undoit],be,[Ee,Pe.redoit]);var Tt=A.syncOrAsync(yt,Ee);return(!Tt||!Tt.then)&&(Tt=Promise.resolve(Ee)),Tt.then(function(){return Ee.emit("plotly_relayout",Pe.eventData),Ee})}function Ae(Ee,Ve,Ce){var Te=Ee._fullLayout;if(!Ve.axrange)return!1;for(var Pe in Ve)if(Pe!=="axrange"&&Ve[Pe])return!1;var at,yt,Tt=function(la,Ua){return A.coerce(at,yt,s,la,Ua)},Ot={};for(var Gt in Ce.rangesAltered){var rr=n.id2name(Gt);if(at=Ee.layout[rr],yt=Te[rr],o(at,yt,Tt,Ot),yt._matchGroup){for(var Qt in yt._matchGroup)if(Qt!==Gt){var Tr=Te[n.id2name(Qt)];Tr.autorange=yt.autorange,Tr.range=yt.range.slice(),Tr._input.range=yt.range.slice()}}}return!0}function ze(Ee,Ve){var Ce=Ve?function(Te){var Pe=[],at=!0;for(var yt in Ve){var Tt=n.getFromId(Te,yt);if(Pe.push(yt),(Tt.ticklabelposition||"").indexOf("inside")!==-1&&Tt._anchorAxis&&Pe.push(Tt._anchorAxis._id),Tt._matchGroup)for(var Ot in Tt._matchGroup)Ve[Ot]||Pe.push(Ot)}return n.draw(Te,Pe,{skipTitle:at})}:function(Te){return n.draw(Te,"redraw")};Ee.push(T,S.doAutoRangeAndConstraints,Ce,S.drawData,S.finalDraw)}var Re=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,We=/^[xyz]axis[0-9]*\.autorange$/,it=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function ot(Ee,Ve){var Ce=Ee.layout,Te=Ee._fullLayout,Pe=Te._guiEditing,at=j(Te._preGUI,Pe),yt=Object.keys(Ve),Tt=n.list(Ee),Ot=A.extendDeepAll({},Ve),Gt={},rr,Qt,Tr;for(yt=Object.keys(Ve),Qt=0;Qt<yt.length;Qt++)if(yt[Qt].indexOf("allaxes")===0){for(Tr=0;Tr<Tt.length;Tr++){var la=Tt[Tr]._id.substr(1),Ua=la.indexOf("scene")!==-1?la+".":"",Ba=yt[Qt].replace("allaxes",Ua+Tt[Tr]._name);Ve[Ba]||(Ve[Ba]=Ve[yt[Qt]])}delete Ve[yt[Qt]]}var Ra=E.layoutFlags(),Qa={},za={};function en(ha,Da){if(Array.isArray(ha)){ha.forEach(function(Pn){en(Pn,Da)});return}if(!(ha in Ve||w.hasParent(Ve,ha))){var Zn=at(Ce,ha);ha in za||(za[ha]=ne(Zn.get())),Da!==void 0&&Zn.set(Da)}}var kn={},Jt;function Nt(ha){var Da=n.name2id(ha.split(".")[0]);return kn[Da]=1,Da}for(var Kt in Ve){if(w.hasParent(Ve,Kt))throw new Error("cannot set "+Kt+" and a parent attribute simultaneously");for(var Wt=at(Ce,Kt),Pr=Ve[Kt],ta=Wt.parts.length,ma=ta-1;ma>0&&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;Qt<Ya.length;Qt++)if(Ya[Qt].showlegend){Ra.calc=!0;break}return(Ra.plot||Ra.calc)&&(Ra.layoutReplot=!0),{flags:Ra,rangesAltered:kn,undoit:za,redoit:Qa,eventData:Ot}}function tt(Ee){var Ve=Ee._fullLayout,Ce=Ve.width,Te=Ve.height;return Ee.layout.autosize&&a.plotAutoSize(Ee,Ee.layout,Ve),Ve.width!==Ce||Ve.height!==Te}function ut(Ee,Ve,Ce,Te){Ee=A.getGraphDiv(Ee),w.clearPromiseQueue(Ee),A.isPlainObject(Ve)||(Ve={}),A.isPlainObject(Ce)||(Ce={}),Object.keys(Ve).length&&(Ee.changed=!0),Object.keys(Ce).length&&(Ee.changed=!0);var Pe=w.coerceTraceIndices(Ee,Te),at=ce(Ee,A.extendFlat({},Ve),Pe),yt=at.flags,Tt=ot(Ee,A.extendFlat({},Ce)),Ot=Tt.flags;(yt.calc||Ot.calc)&&(Ee.calcdata=void 0),yt.clearAxisTypes&&w.clearAxisTypes(Ee,Pe,Ce);var Gt=[];Ot.layoutReplot?Gt.push(S.layoutReplot):yt.fullReplot?Gt.push(Z._doPlot):(Gt.push(a.previousPromises),Ae(Ee,Ot,Tt)||a.supplyDefaults(Ee),yt.style&&Gt.push(S.doTraceStyle),(yt.colorbars||Ot.colorbars)&&Gt.push(S.doColorBars),Ot.legend&&Gt.push(S.doLegend),Ot.layoutstyle&&Gt.push(S.layoutStyles),Ot.axrange&&ze(Gt,Tt.rangesAltered),Ot.ticks&&Gt.push(S.doTicksRelayout),Ot.modebar&&Gt.push(S.doModeBar),Ot.camera&&Gt.push(S.doCamera),Gt.push(y)),Gt.push(a.rehover,a.redrag,a.reselect),t.add(Ee,ut,[Ee,at.undoit,Tt.undoit,at.traces],ut,[Ee,at.redoit,Tt.redoit,at.traces]);var rr=A.syncOrAsync(Gt,Ee);return(!rr||!rr.then)&&(rr=Promise.resolve(Ee)),rr.then(function(){return Ee.emit("plotly_update",{data:at.eventData,layout:Tt.eventData}),Ee})}function Me(Ee){return function(Ce){Ce._fullLayout._guiEditing=!0;var Te=Ee.apply(null,arguments);return Ce._fullLayout._guiEditing=!1,Te}}var _e=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],fe=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function Fe(Ee,Ve){for(var Ce=0;Ce<Ve.length;Ce++){var Te=Ve[Ce],Pe=Ee.match(Te.pattern);if(Pe){var at=Pe[1]||"";return{head:at,tail:Ee.substr(at.length+1),attr:Te.attr}}}}function rt(Ee,Ve){var Ce=M(Ve,Ee).get();if(Ce!==void 0)return Ce;var Te=Ee.split(".");for(Te.pop();Te.length>1;)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<Ve.length;Ce++)if(Ve[Ce]._fullInput.uid===Ee)return Ce;return-1}function Qe(Ee,Ve,Ce){for(var Te=0;Te<Ve.length;Te++)if(Ve[Te].uid===Ee)return Te;return!Ve[Ce]||Ve[Ce].uid?-1:Ce}function Lt(Ee,Ve){var Ce=A.isPlainObject(Ee),Te=Array.isArray(Ee);return Ce||Te?(Ce&&A.isPlainObject(Ve)||Te&&Array.isArray(Ve))&&JSON.stringify(Ee)===JSON.stringify(Ve):Ee===Ve}function kt(Ee,Ve,Ce,Te){var Pe=Te._preGUI,at,yt,Tt,Ot,Gt,rr,Qt,Tr,la,Ua,Ba=[],Ra={},Qa={};for(at in Pe){if(Gt=Fe(at,_e),Gt){if(la=Gt.head,Ua=Gt.tail,yt=Gt.attr||la+".uirevision",Tt=M(Te,yt).get(),Ot=Tt&&rt(yt,Ve),Ot&&Ot===Tt){if(rr=Pe[at],rr===null&&(rr=void 0),Qt=M(Ve,at),Tr=Qt.get(),Lt(Tr,rr)){Tr===void 0&&Ua==="autorange"&&Ba.push(la),Qt.set(ne(M(Te,at).get()));continue}else if(Ua==="autorange"||Ua.substr(0,6)==="range["){var za=Pe[la+".range[0]"],en=Pe[la+".range[1]"],kn=Pe[la+".autorange"];if(kn||kn===null&&za===null&&en===null){if(!(la in Ra)){var Jt=M(Ve,la).get();Ra[la]=Jt&&(Jt.autorange||Jt.autorange!==!1&&(!Jt.range||Jt.range.length!==2))}if(Ra[la]){Qt.set(ne(M(Te,at).get()));continue}}}}}else A.warn("unrecognized GUI edit: "+at);delete Pe[at],Gt&&Gt.tail.substr(0,6)==="range["&&(Qa[Gt.head]=1)}for(var Nt=0;Nt<Ba.length;Nt++){var Kt=Ba[Nt];if(Qa[Kt]){var Wt=M(Ve,Kt).get();Wt&&delete Wt.autorange}}var Pr=Te._tracePreGUI;for(var ta in Pr){var ma=Pr[ta],ra=null,Ia;for(at in ma){if(!ra){var Ha=st(ta,Ce);if(Ha<0){delete Pr[ta];break}var rn=Ce[Ha];Ia=rn._fullInput;var nn=Qe(ta,Ee,Ia.index);if(nn<0){delete Pr[ta];break}ra=Ee[nn]}if(Gt=Fe(at,fe),Gt){if(Gt.attr?(Tt=M(Te,Gt.attr).get(),Ot=Tt&&rt(Gt.attr,Ve)):(Tt=Ia.uirevision,Ot=ra.uirevision,Ot===void 0&&(Ot=Ve.uirevision)),Ot&&Ot===Tt&&(rr=ma[at],rr===null&&(rr=void 0),Qt=M(ra,at),Tr=Qt.get(),Lt(Tr,rr))){Qt.set(ne(M(Ia,at).get()));continue}}else A.warn("unrecognized GUI edit: "+at+" in trace uid "+ta);delete ma[at]}}}function qt(Ee,Ve,Ce,Te){var Pe,at;function yt(){return Z.addFrames(Ee,Pe)}Ee=A.getGraphDiv(Ee),w.clearPromiseQueue(Ee);var Tt=Ee._fullData,Ot=Ee._fullLayout;if(!A.isPlotDiv(Ee)||!Tt||!Ot)at=Z.newPlot(Ee,Ve,Ce,Te);else{if(A.isPlainObject(Ve)){var Gt=Ve;Ve=Gt.data,Ce=Gt.layout,Te=Gt.config,Pe=Gt.frames}var rr=!1;if(Te){var Qt=A.extendDeep({},Ee._context);Ee._context=void 0,z(Ee,Te),rr=jr(Qt,Ee._context)}Ee.data=Ve||[],w.cleanData(Ee.data),Ee.layout=Ce||{},w.cleanLayout(Ee.layout),kt(Ee.data,Ee.layout,Tt,Ot),a.supplyDefaults(Ee,{skipUpdateCalc:!0});var Tr=Ee._fullData,la=Ee._fullLayout,Ua=la.datarevision===void 0,Ba=la.transition,Ra=Sr(Ee,Ot,la,Ua,Ba),Qa=Ra.newDataRevision,za=Zt(Ee,Tt,Tr,Ua,Ba,Qa);if(tt(Ee)&&(Ra.layoutReplot=!0),za.calc||Ra.calc){Ee.calcdata=void 0;for(var en=Object.getOwnPropertyNames(la),kn=0;kn<en.length;kn++){var Jt=en[kn],Nt=Jt.substring(0,5);if(Nt==="xaxis"||Nt==="yaxis"){var Kt=la[Jt]._emptyCategories;Kt&&Kt()}}}else a.supplyDefaultsUpdateCalc(Ee.calcdata,Tr);var Wt=[];if(Pe&&(Ee._transitionData={},a.createTransitionData(Ee),Wt.push(yt)),la.transition&&!rr&&(za.anim||Ra.anim))Ra.ticks&&Wt.push(S.doTicksRelayout),a.doCalcdata(Ee),S.doAutoRangeAndConstraints(Ee),Wt.push(function(){return a.transitionFromReact(Ee,za,Ra,Ot)});else if(za.fullReplot||Ra.layoutReplot||rr)Ee._fullLayout._skipDefaults=!0,Wt.push(Z._doPlot);else{for(var Pr in Ra.arrays){var ta=Ra.arrays[Pr];if(ta.length){var ma=r.getComponentMethod(Pr,"drawOne");if(ma!==A.noop)for(var ra=0;ra<ta.length;ra++)ma(Ee,ta[ra]);else{var Ia=r.getComponentMethod(Pr,"draw");if(Ia===A.noop)throw new Error("cannot draw components: "+Pr);Ia(Ee)}}}Wt.push(a.previousPromises),za.style&&Wt.push(S.doTraceStyle),(za.colorbars||Ra.colorbars)&&Wt.push(S.doColorBars),Ra.legend&&Wt.push(S.doLegend),Ra.layoutstyle&&Wt.push(S.layoutStyles),Ra.axrange&&ze(Wt),Ra.ticks&&Wt.push(S.doTicksRelayout),Ra.modebar&&Wt.push(S.doModeBar),Ra.camera&&Wt.push(S.doCamera),Wt.push(y)}Wt.push(a.rehover,a.redrag,a.reselect),at=A.syncOrAsync(Wt,Ee),(!at||!at.then)&&(at=Promise.resolve(Ee))}return at.then(function(){return Ee.emit("plotly_react",{data:Ve,layout:Ce}),Ee})}function Zt(Ee,Ve,Ce,Te,Pe,at){var yt=Ve.length===Ce.length;if(!Pe&&!yt)return{fullReplot:!0,calc:!0};var Tt=E.traceFlags();Tt.arrays={},Tt.nChanges=0,Tt.nChangesAnim=0;var Ot,Gt;function rr(la){var Ua=i.getTraceValObject(Gt,la);return!Gt._module.animatable&&Ua.anim&&(Ua.anim=!1),Ua}var Qt={getValObject:rr,flags:Tt,immutable:Te,transition:Pe,newDataRevision:at,gd:Ee},Tr={};for(Ot=0;Ot<Ve.length;Ot++)if(Ce[Ot]){if(Gt=Ce[Ot]._fullInput,Tr[Gt.uid])continue;Tr[Gt.uid]=1,xr(Ve[Ot]._fullInput,Gt,[],Qt)}return(Tt.calc||Tt.plot)&&(Tt.fullReplot=!0),Pe&&Tt.nChanges&&Tt.nChangesAnim&&(Tt.anim=Tt.nChanges===Tt.nChangesAnim&&yt?"all":"some"),Tt}function Sr(Ee,Ve,Ce,Te,Pe){var at=E.layoutFlags();at.arrays={},at.rangesAltered={},at.nChanges=0,at.nChangesAnim=0;function yt(Tr){return i.getLayoutValObject(Ce,Tr)}for(var Tt in Ce)if(!(!Tt.startsWith("xaxis")&&!Tt.startsWith("yaxis"))&&Ve[Tt]){var Ot=Ce[Tt].domain,Gt=Ve[Tt].domain,rr=Ve[Tt]._inputDomain;Ve[Tt]._inputDomain&&(Ot[0]===rr[0]&&Ot[1]===rr[1]?Ce[Tt].domain=Ve[Tt].domain:(Ot[0]!==Gt[0]||Ot[1]!==Gt[1])&&(Ce[Tt]._inputDomain=null))}var Qt={getValObject:yt,flags:at,immutable:Te,transition:Pe,gd:Ee};return xr(Ve,Ce,[],Qt),(at.plot||at.calc)&&(at.layoutReplot=!0),Pe&&at.nChanges&&at.nChangesAnim&&(at.anim=at.nChanges===at.nChangesAnim?"all":"some"),at}function xr(Ee,Ve,Ce,Te){var Pe,at,yt,Tt=Te.getValObject,Ot=Te.flags,Gt=Te.immutable,rr=Te.inArray,Qt=Te.arrayIndex;function Tr(){var Ha=Pe.editType;if(rr&&Ha.indexOf("arraydraw")!==-1){A.pushUnique(Ot.arrays[rr],Qt);return}E.update(Ot,Pe),Ha!=="none"&&Ot.nChanges++,Te.transition&&Pe.anim&&Ot.nChangesAnim++,(Re.test(yt)||We.test(yt))&&(Ot.rangesAltered[Ce[0]]=1),at==="datarevision"&&(Ot.newDataRevision=1)}function la(Ha){return Ha.valType==="data_array"||Ha.arrayOk}for(at in Ee){if(Ot.calc&&!Te.transition)return;var Ua=Ee[at],Ba=Ve[at],Ra=Ce.concat(at);if(yt=Ra.join("."),!(at.charAt(0)==="_"||typeof Ua=="function"||Ua===Ba)){if((at==="tick0"||at==="dtick")&&Ce[0]!=="geo"){var Qa=Ve.tickmode;if(Qa==="auto"||Qa==="array"||!Qa)continue}if(!(at==="range"&&Ve.autorange)&&!((at==="zmin"||at==="zmax")&&Ve.type==="contourcarpet")&&(Pe=Tt(Ra),!!Pe&&!(Pe._compareAsJSON&&JSON.stringify(Ua)===JSON.stringify(Ba)))){var za=Pe.valType,en,kn=la(Pe),Jt=Array.isArray(Ua),Nt=Array.isArray(Ba);if(Jt&&Nt){var Kt="_input_"+at,Wt=Ee[Kt],Pr=Ve[Kt];if(Array.isArray(Wt)&&Wt===Pr)continue}if(Ba===void 0)kn&&Jt?Ot.calc=!0:Tr();else if(Pe._isLinkedToArray){var ta=[],ma=!1;rr||(Ot.arrays[at]=ta);var ra=Math.min(Ua.length,Ba.length),Ia=Math.max(Ua.length,Ba.length);if(ra!==Ia)if(Pe.editType==="arraydraw")ma=!0;else{Tr();continue}for(en=0;en<ra;en++)xr(Ua[en],Ba[en],Ra.concat(en),A.extendFlat({inArray:at,arrayIndex:en},Te));if(ma)for(en=ra;en<Ia;en++)ta.push(en)}else!za&&A.isPlainObject(Ua)?xr(Ua,Ba,Ra,Te):kn?Jt&&Nt?(Gt&&(Ot.calc=!0),(Gt||Te.newDataRevision)&&Tr()):Jt!==Nt?Ot.calc=!0:Tr():Jt&&Nt?(Ua.length!==Ba.length||String(Ua)!==String(Ba))&&Tr():Tr()}}}for(at in Ve)if(!(at in Ee||at.charAt(0)==="_"||typeof Ve[at]=="function"))if(Pe=Tt(Ce.concat(at)),la(Pe)&&Array.isArray(Ve[at])){Ot.calc=!0;return}else Tr()}function jr(Ee,Ve){var Ce;for(Ce in Ee)if(Ce.charAt(0)!=="_"){var Te=Ee[Ce],Pe=Ve[Ce];if(Te!==Pe)if(A.isPlainObject(Te)&&A.isPlainObject(Pe)){if(jr(Te,Pe))return!0}else if(Array.isArray(Te)&&Array.isArray(Pe)){if(Te.length!==Pe.length)return!0;for(var at=0;at<Te.length;at++)if(Te[at]!==Pe[at])if(A.isPlainObject(Te[at])&&A.isPlainObject(Pe[at])){if(jr(Te[at],Pe[at]))return!0}else return!0}else return!0}}function wr(Ee,Ve,Ce){if(Ee=A.getGraphDiv(Ee),!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 animating it. For more details, see https://plotly.com/javascript/animations/");var Te=Ee._transitionData;Te._frameQueue||(Te._frameQueue=[]),Ce=a.supplyAnimationDefaults(Ce);var Pe=Ce.transition,at=Ce.frame;Te._frameWaitingCnt===void 0&&(Te._frameWaitingCnt=0);function yt(Gt){return Array.isArray(Pe)?Gt>=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;Ia<ra.length;Ia++){var Ha;ra[Ia].type==="byname"?Ha=a.computeFrame(Ee,ra[Ia].name):Ha=ra[Ia].data;var rn=Tt(Ia),nn=yt(Ia);nn.duration=Math.min(nn.duration,rn.duration);var yn={frame:Ha,name:ra[Ia].name,frameOpts:rn,transitionOpts:nn};Ia===ra.length-1&&(yn.onComplete=Ot(Gt,2),yn.onInterrupt=rr),Te._frameQueue.push(yn)}Ce.mode==="immediate"&&(Te._lastFrameAt=-1/0),Te._animationRaf||Ba()}}function la(){Ee.emit("plotly_animated"),window.cancelAnimationFrame(Te._animationRaf),Te._animationRaf=null}function Ua(){Te._currentFrame&&Te._currentFrame.onComplete&&Te._currentFrame.onComplete();var ra=Te._currentFrame=Te._frameQueue.shift();if(ra){var Ia=ra.name?ra.name.toString():null;Ee._fullLayout._currentFrame=Ia,Te._lastFrameAt=Date.now(),Te._timeToNext=ra.frameOpts.duration,a.transition(Ee,ra.frame.data,ra.frame.layout,w.coerceTraceIndices(Ee,ra.frame.traces),ra.frameOpts,ra.transitionOpts).then(function(){ra.onComplete&&ra.onComplete()}),Ee.emit("plotly_animatingframe",{name:Ia,frame:ra.frame,animation:{frame:ra.frameOpts,transition:ra.transitionOpts}})}else la()}function Ba(){Ee.emit("plotly_animating"),Te._lastFrameAt=-1/0,Te._timeToNext=0,Te._runningTransitions=0,Te._currentFrame=null;var ra=function(){Te._animationRaf=window.requestAnimationFrame(ra),Date.now()-Te._lastFrameAt>Te._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;za<Te._frames.length;za++)en=Te._frames[za],en&&(Jt||String(en.group)===String(Ve))&&kn.push({type:"byname",name:String(en.name),data:Qa({name:en.name})});else if(Nt)for(za=0;za<Ve.length;za++){var Wt=Ve[za];["number","string"].indexOf(typeof Wt)!==-1?(Wt=String(Wt),kn.push({type:"byname",name:Wt,data:Qa({name:Wt})})):A.isPlainObject(Wt)&&kn.push({type:"object",data:Qa(A.extendFlat({},Wt))})}for(za=0;za<kn.length;za++)if(en=kn[za],en.type==="byname"&&!Te._frameHash[en.data.name]){A.warn('animate failure: frame not found: "'+en.data.name+'"'),rr();return}["next","immediate"].indexOf(Ce.mode)!==-1&&Qt(),Ce.direction==="reverse"&&kn.reverse();var Pr=Ee._fullLayout._currentFrame;if(Pr&&Ce.fromcurrent){var ta=-1;for(za=0;za<kn.length;za++)if(en=kn[za],en.type==="byname"&&en.name===Pr){ta=za;break}if(ta>0&&ta<kn.length-1){var ma=[];for(za=0;za<kn.length;za++)en=kn[za],(kn[za].type!=="byname"||za>ta)&&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&&b<p&&(b++,A.warn('addFrames: overwriting frame "'+(Ot[la]||Qt[la]).name+'" with a frame whose name of type "number" also equates to "'+la+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),b===p&&A.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),Qt[Tr]={name:Tr},rr.push({frame:a.supplyFrameDefaults(Ve[Te]),index:Ce&&Ce[Te]!==void 0&&Ce[Te]!==null?Ce[Te]:Gt+Te})}rr.sort(function(Kt,Wt){return Kt.index>Wt.index?-1:Kt.index<Wt.index?1:0});var Ra=[],Qa=[],za=Tt.length;for(Te=rr.length-1;Te>=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<Tt.length&&(Tt[at]||{}).name!==Pe.name;at++);Ra.push({type:"replace",index:at,value:Pe}),Qa.unshift({type:"replace",index:at,value:Tt[at]})}else yt=Math.max(0,Math.min(rr[Te].index,za)),Ra.push({type:"insert",index:yt,value:Pe}),Qa.unshift({type:"delete",index:yt}),za++}var en=a.modifyFrames,kn=a.modifyFrames,Jt=[Ee,Qa],Nt=[Ee,Ra];return t&&t.add(Ee,en,Jt,kn,Nt),a.modifyFrames(Ee,Ra)}function bt(Ee,Ve){if(Ee=A.getGraphDiv(Ee),!A.isPlotDiv(Ee))throw new Error("This element is not a Plotly plot: "+Ee);var Ce,Te,Pe=Ee._transitionData._frames,at=[],yt=[];if(!Ve)for(Ve=[],Ce=0;Ce<Pe.length;Ce++)Ve.push(Ce);for(Ve=Ve.slice(),Ve.sort(),Ce=Ve.length-1;Ce>=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<M;r++)t[r]=A.charCodeAt(r);return e}Z.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}}),k2=Ze({"src/snapshot/tosvg.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=Yi(),e=vd(),t=/"/g,r="TOBESTRIPPED",i=new RegExp('("'+r+")|("+r+'")',"g");function a(o){var s=v.select("body").append("div").style({display:"none"}).html(""),c=o.replace(/(&[^;]*;)/gi,function(h){return h==="<"?"<":h==="&rt;"?">":h.indexOf("<")!==-1||h.indexOf(">")!==-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;w<S.length;w++){var E=S[w];E.toSVG&&E.toSVG(s)}if(T){var g=T.node().childNodes,b=Array.prototype.slice.call(g);for(w=0;w<b.length;w++){var p=b[w];p.childNodes.length&&d.node().appendChild(p)}}m._draggers&&m._draggers.remove(),d.node().style.background="",d.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var y=v.select(this);if(this.style.visibility==="hidden"||this.style.display==="none"){y.remove();return}else y.style({visibility:null,display:null});var f=this.style.fontFamily;f&&f.indexOf('"')!==-1&&y.style("font-family",f.replace(t,r));var P=this.style.fontWeight;P&&(P==="normal"||P==="400")&&y.style("font-weight",void 0);var L=this.style.fontStyle;L&&L==="normal"&&y.style("font-style",void 0);var z=this.style.fontVariant;z&&z==="normal"&&y.style("font-variant",void 0)}),d.selectAll(".gradient_filled,.pattern_filled").each(function(){var y=v.select(this),f=this.style.fill;f&&f.indexOf("url(")!==-1&&y.style("fill",f.replace(t,r));var P=this.style.stroke;P&&P.indexOf("url(")!==-1&&y.style("stroke",P.replace(t,r))}),(c==="pdf"||c==="eps")&&d.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),c==="svg"&&h&&(d.attr("width",h*l),d.attr("height",h*_),d.attr("viewBox","0 0 "+l+" "+_));var u=new window.XMLSerializer().serializeToString(d.node());return u=a(u),u=n(u),u=u.replace(i,"'"),u}}}),L2=Ze({"src/snapshot/svgtoimg.js"(Z,q){"use strict";var v=ca(),x=Wg().EventEmitter,A=Zv();function M(e){var t=e.emitter||new x,r=new Promise(function(i,a){var n=window.Image,o=e.svg,s=e.format||"png",c=e.canvas,h=e.scale||1,m=e.width||300,d=e.height||150,T=h*m,l=h*d,_=c.getContext("2d",{willReadFrequently:!0}),w=new n,S,E;s==="svg"||v.isSafari()?E=A.encodeSVG(o):(S=A.createBlob(o,"svg"),E=A.createObjectURL(S)),c.width=T,c.height=l,w.onload=function(){var g;switch(S=null,A.revokeObjectURL(E),s!=="svg"&&_.drawImage(w,0,0,T,l),s){case"jpeg":g=c.toDataURL("image/jpeg");break;case"png":g=c.toDataURL("image/png");break;case"webp":g=c.toDataURL("image/webp");break;case"svg":g=E;break;default:var b="Image format is not jpeg, png, svg or webp.";if(a(new Error(b)),!e.promise)return t.emit("error",b)}i(g),e.promise||t.emit("success",g)},w.onerror=function(g){if(S=null,A.revokeObjectURL(E),a(g),!e.promise)return t.emit("error",g)},w.src=E});return e.promise?r:t}q.exports=M}}),IS=Ze({"src/plot_api/to_image.js"(Z,q){"use strict";var v=is(),x=C2(),A=xc(),M=ca(),e=Zv(),t=k2(),r=L2(),i=Eh().version,a={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function n(o,s){s=s||{};var c,h,m,d;M.isPlainObject(o)?(c=o.data||[],h=o.layout||{},m=o.config||{},d={}):(o=M.getGraphDiv(o),c=M.extendDeep([],o.data),h=M.extendDeep({},o.layout),m=o._context,d=o._fullLayout||{});function T(B){return!(B in s)||M.validate(s[B],a[B])}if(!T("width")&&s.width!==null||!T("height")&&s.height!==null)throw new Error("Height and width should be pixel values.");if(!T("format"))throw new Error("Export format is not "+M.join2(a.format.values,", "," or ")+".");var l={};function _(B,O){return M.coerce(s,l,a,B,O)}var w=_("format"),S=_("width"),E=_("height"),g=_("scale"),b=_("setBackground"),p=_("imageDataOnly"),u=document.createElement("div");u.style.position="absolute",u.style.left="-5000px",document.body.appendChild(u);var y=M.extendFlat({},h);S?y.width=S:s.width===null&&v(d.width)&&(y.width=d.width),E?y.height=E:s.height===null&&v(d.height)&&(y.height=d.height);var f=M.extendFlat({},m,{_exportedPlot:!0,staticPlot:!0,setBackground:b}),P=e.getRedrawFunc(u);function L(){return new Promise(function(B){setTimeout(B,e.getDelay(u._fullLayout))})}function z(){return new Promise(function(B,O){var I=t(u,w,g),N=u._fullLayout.width,U=u._fullLayout.height;function W(){x.purge(u),document.body.removeChild(u)}if(w==="full-json"){var Q=A.graphJson(u,!1,"keepdata","object",!0,!0);return Q.version=i,Q=JSON.stringify(Q),W(),B(p?Q:e.encodeJSON(Q))}if(W(),w==="svg")return B(p?I:e.encodeSVG(I));var ue=document.createElement("canvas");ue.id=M.randstr(),r({format:w,width:N,height:U,scale:g,canvas:ue,svg:I,promise:!0}).then(B).catch(O)})}function F(B){return p?B.replace(e.IMAGE_URL_PREFIX,""):B}return new Promise(function(B,O){x.newPlot(u,c,y,f).then(P).then(L).then(z).then(function(I){B(F(I))}).catch(function(I){O(I)})})}q.exports=n}}),UO=Ze({"src/plot_api/validate.js"(Z,q){"use strict";var v=ca(),x=xc(),A=e1(),M=Hg().dfltConfig,e=v.isPlainObject,t=Array.isArray,r=v.isArrayOrTypedArray;q.exports=function(_,w){_===void 0&&(_=[]),w===void 0&&(w={});var S=A.get(),E=[],g={_context:v.extendFlat({},M)},b,p;t(_)?(g.data=v.extendDeep([],_),b=_):(g.data=[],b=[],E.push(s("array","data"))),e(w)?(g.layout=v.extendDeep({},w),p=w):(g.layout={},p={},arguments.length>1&&E.push(s("object","layout"))),x.supplyDefaults(g);for(var u=g._fullData,y=b.length,f=0;f<y;f++){var P=b[f],L=["data",f];if(!e(P)){E.push(s("object",L));continue}var z=u[f],F=z.type,B=S.traces[F].attributes;B.type={valType:"enumerated",values:[F]},z.visible===!1&&P.visible!==!1&&E.push(s("invisible",L)),i(P,z,B,E,L)}var O=g._fullLayout,I=a(S,u);return i(p,O,I,E,"layout"),E.length===0?void 0:E};function i(l,_,w,S,E,g){g=g||[];for(var b=Object.keys(l),p=0;p<b.length;p++){var u=b[p],y=g.slice();y.push(u);var f=l[u],P=_[u],L=h(w,u),z=(L||{}).valType,F=z==="info_array",B=z==="colorscale",O=(L||{}).items;if(!c(w,u))S.push(s("schema",E,y));else if(e(f)&&e(P)&&z!=="any")i(f,P,L,S,E,y);else if(F&&t(f)){f.length>P.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;W<I;W++)if(t(f[W])){f[W].length>P[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;W<I;W++)Q=N?O[W]:O,ue=f[W],se=P[W],v.validate(ue,Q)?se!==ue&&se!==+ue&&S.push(s("dynamic",E,y.concat(W),ue,se)):S.push(s("value",E,y.concat(W),ue))}else if(L.items&&!F&&t(f)){var H=O[Object.keys(O)[0]],$=[],J,X;for(J=0;J<P.length;J++){var oe=P[J]._index||J;if(X=y.slice(),X.push(oe),e(f[oe])&&e(P[J])){$.push(oe);var ne=f[oe],j=P[J];e(ne)&&ne.visible!==!1&&j.visible===!1?S.push(s("invisible",E,X)):i(ne,j,H,S,E,X)}}for(J=0;J<f.length;J++)X=y.slice(),X.push(J),e(f[J])?$.indexOf(J)===-1&&S.push(s("unused",E,X)):S.push(s("object",E,X,f[J]))}else!e(f)&&e(P)?S.push(s("object",E,y,f)):!r(f)&&r(P)&&!F&&!B?S.push(s("array",E,y,f)):u in _?v.validate(f,L)?L.valType==="enumerated"&&(L.coerceNumber&&f!==+P||!r(f)&&f!==P||String(f)!==String(P))&&S.push(s("dynamic",E,y,f,P)):S.push(s("value",E,y,f)):S.push(s("unused",E,y,f))}return S}function a(l,_){for(var w=l.layout.layoutAttributes,S=0;S<_.length;S++){var E=_[S],g=l.traces[E.type],b=g.layoutAttributes;b&&(E.subplot?v.extendFlat(w[g.attributes.subplot.dflt],b):v.extendFlat(w,b))}return w}var n={object:function(l,_){var w;return l==="layout"&&_===""?w="The layout argument":l[0]==="data"&&_===""?w="Trace "+l[1]+" in the data argument":w=o(l)+"key "+_,w+" must be linked to an object container"},array:function(l,_){var w;return l==="data"?w="The data argument":w=o(l)+"key "+_,w+" must be linked to an array container"},schema:function(l,_){return o(l)+"key "+_+" is not part of the schema"},unused:function(l,_,w){var S=e(w)?"container":"key";return o(l)+S+" "+_+" did not get coerced"},dynamic:function(l,_,w,S){return[o(l)+"key",_,"(set to '"+w+"')","got reset to","'"+S+"'","during defaults."].join(" ")},invisible:function(l,_){return(_?o(l)+"item "+_:"Trace "+l[1])+" got defaulted to be not visible"},value:function(l,_,w){return[o(l)+"key "+_,"is set to an invalid value ("+w+")"].join(" ")}};function o(l){return t(l)?"In data trace "+l[1]+", ":"In "+l+", "}function s(l,_,w,S,E){w=w||"";var g,b;t(_)?(g=_[0],b=_[1]):(g=_,b=null);var p=T(w),u=n[l](_,p,S,E);return v.log(u),{code:l,container:g,trace:b,path:w,astr:p,msg:u}}function c(l,_){var w=d(_),S=w.keyMinusId,E=w.id;return S in l&&l[S]._isSubplotObj&&E?!0:_ in l}function h(l,_){if(_ in l)return l[_];var w=d(_);return l[w.keyMinusId]}var m=v.counterRegex("([a-z]+)");function d(l){var _=l.match(m);return{keyMinusId:_&&_[1],id:_&&_[2]}}function T(l){if(!t(l))return String(l);for(var _="",w=0;w<l.length;w++){var S=l[w];typeof S=="number"?_=_.substr(0,_.length-1)+"["+S+"]":_+=S,w<l.length-1&&(_+=".")}return _}}}),jO=Ze({"src/snapshot/filesaver.js"(Z,q){"use strict";var v=ca(),x=Zv();function A(M,e,t){var r=document.createElement("a"),i="download"in r,a=new Promise(function(n,o){var s,c;if(i)return s=x.createBlob(M,t),c=x.createObjectURL(s),r.href=c,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),x.revokeObjectURL(c),s=null,n(e);if(v.isSafari()){var h=t==="svg"?",":";base64,";return x.octetStream(h+encodeURIComponent(M)),n(e)}o(new Error("download error"))});return a}q.exports=A}}),RS=Ze({"src/snapshot/download.js"(Z,q){"use strict";var v=ca(),x=IS(),A=jO(),M=Zv();function e(t,r){var i;return v.isPlainObject(t)||(i=v.getGraphDiv(t)),r=r||{},r.format=r.format||"png",r.width=r.width||null,r.height=r.height||null,r.imageDataOnly=!0,new Promise(function(a,n){i&&i._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),i&&(i._snapshotInProgress=!0);var o=x(t,r),s=r.filename||t.fn||"newplot";s+="."+r.format.replace("-","."),o.then(function(c){return i&&(i._snapshotInProgress=!1),A(c,s,r.format)}).then(function(c){a(c)}).catch(function(c){i&&(i._snapshotInProgress=!1),n(c)})})}q.exports=e}}),VO=Ze({"src/plot_api/template_api.js"(Z){"use strict";var q=ca(),v=q.isPlainObject,x=e1(),A=xc(),M=eu(),e=Dl(),t=Hg().dfltConfig;Z.makeTemplate=function(m){m=q.isPlainObject(m)?m:q.getGraphDiv(m),m=q.extendDeep({_context:t},{data:m.data,layout:m.layout}),A.supplyDefaults(m);var d=m.data||[],T=m.layout||{};T._basePlotModules=m._fullLayout._basePlotModules,T._modules=m._fullLayout._modules;var l={data:{},layout:{}};d.forEach(function(f){var P={};a(f,P,o.bind(null,f));var L=q.coerce(f,{},M,"type"),z=l.data[L];z||(z=l.data[L]=[]),z.push(P)}),a(T,l.layout,n.bind(null,T)),delete l.layout.template;var _=T.template;if(v(_)){var w=_.layout,S,E,g,b,p,u;v(w)&&r(w,l.layout);var y=_.data;if(v(y)){for(E in l.data)if(g=y[E],Array.isArray(g)){for(p=l.data[E],u=p.length,b=g.length,S=0;S<u;S++)r(g[S%b],p[S]);for(S=u;S<b;S++)p.push(q.extendDeep({},g[S]))}for(E in y)E in l.data||(l.data[E]=q.extendDeep([],y[E]))}}return l};function r(m,d){m=q.extendDeep({},m);var T=Object.keys(m).sort(),l,_;function w(p,u,y){if(v(u)&&v(p))r(p,u);else if(Array.isArray(u)&&Array.isArray(p)){var f=e.arrayTemplater({_template:m},y);for(_=0;_<u.length;_++){var P=u[_],L=f.newItem(P)._template;L&&r(L,P)}var z=f.defaultItems();for(_=0;_<z.length;_++)u.push(z[_]._template);for(_=0;_<u.length;_++)delete u[_].templateitemname}}for(l=0;l<T.length;l++){var S=T[l],E=m[S];if(S in d?w(E,d[S],S):d[S]=E,i(S)===S)for(var g in d){var b=i(g);g!==b&&b===S&&!(g in m)&&w(E,d[g],S)}}}function i(m){return m.replace(/[0-9]+$/,"")}function a(m,d,T,l,_){var w=_&&T(_);for(var S in m){var E=m[S],g=s(m,S,l),b=s(m,S,_),p=T(b);if(!p){var u=i(S);u!==S&&(b=s(m,u,_),p=T(b))}if(!(w&&w===p)&&!(!p||p._noTemplating||p.valType==="data_array"||p.arrayOk&&Array.isArray(E)))if(!p.valType&&v(E))a(E,d,T,g,b);else if(p._isLinkedToArray&&Array.isArray(E))for(var y=!1,f=0,P={},L=0;L<E.length;L++){var z=E[L];if(v(z)){var F=z.name;if(F)P[F]||(a(z,d,T,s(E,f,g),s(E,f,b)),f++,P[F]=1);else if(!y){var B=e.arrayDefaultKey(S),O=s(m,B,l),I=s(E,f,g);a(z,d,T,I,s(E,f,b));var N=q.nestedProperty(d,I),U=q.nestedProperty(d,O);U.set(N.get()),N.set(null),y=!0}}}else{var W=q.nestedProperty(d,g);W.set(E)}}}function n(m,d){return x.getLayoutValObject(m,q.nestedProperty({},d).parts)}function o(m,d){return x.getTraceValObject(m,q.nestedProperty({},d).parts)}function s(m,d,T){var l;return T?Array.isArray(m)?l=T+"["+d+"]":l=T+"."+d:l=d,l}Z.validateTemplate=function(m,d){var T=q.extendDeep({},{_context:t,data:m.data,layout:m.layout}),l=T.layout||{};v(d)||(d=l.template||{});var _=d.layout,w=d.data,S=[];T.layout=l,T.layout.template=d,A.supplyDefaults(T);var E=T._fullLayout,g=T._fullData,b={};function p(O,I){for(var N in O)if(N.charAt(0)!=="_"&&v(O[N])){var U=i(N),W=[],Q;for(Q=0;Q<I.length;Q++)W.push(s(O,N,I[Q])),U!==N&&W.push(s(O,U,I[Q]));for(Q=0;Q<W.length;Q++)b[W[Q]]=1;p(O[N],W)}}function u(O,I){for(var N in O)if(N.indexOf("defaults")===-1&&v(O[N])){var U=s(O,N,I);b[U]?u(O[N],U):S.push({code:"unused",path:U})}}if(v(_)?(p(E,["layout"]),u(_,"layout")):S.push({code:"layout"}),!v(w))S.push({code:"data"});else{for(var y={},f,P=0;P<g.length;P++){var L=g[P];f=L.type,y[f]=(y[f]||0)+1,L._fullInput._template||S.push({code:"missing",index:L.index,traceType:f})}for(f in w){var z=w[f].length,F=y[f]||0;z>F?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<m.length;d++)if(v(m[d]))return!0}function h(m){var d;switch(m.code){case"data":d="The template has no key data.";break;case"layout":d="The template has no key layout.";break;case"missing":m.path?d="There are no templates for item "+m.path+" with name "+m.templateitemname:d="There are no templates for trace "+m.index+", of type "+m.traceType+".";break;case"unused":m.path?d="The template item at "+m.path+" was not used in constructing the plot.":m.dataCount?d="Some of the templates of type "+m.traceType+" were not used. The template has "+m.templateCount+" traces, the data only has "+m.dataCount+" of this type.":d="The template has "+m.templateCount+" traces of type "+m.traceType+" but there are none in the data.";break;case"reused":d="Some of the templates of type "+m.traceType+" were used more than once. The template has "+m.templateCount+" traces, the data has "+m.dataCount+" of this type.";break}return m.msg=d,m}}}),qO=Ze({"src/plot_api/index.js"(Z){"use strict";var q=C2();Z._doPlot=q._doPlot,Z.newPlot=q.newPlot,Z.restyle=q.restyle,Z.relayout=q.relayout,Z.redraw=q.redraw,Z.update=q.update,Z._guiRestyle=q._guiRestyle,Z._guiRelayout=q._guiRelayout,Z._guiUpdate=q._guiUpdate,Z._storeDirectGUIEdit=q._storeDirectGUIEdit,Z.react=q.react,Z.extendTraces=q.extendTraces,Z.prependTraces=q.prependTraces,Z.addTraces=q.addTraces,Z.deleteTraces=q.deleteTraces,Z.moveTraces=q.moveTraces,Z.purge=q.purge,Z.addFrames=q.addFrames,Z.deleteFrames=q.deleteFrames,Z.animate=q.animate,Z.setPlotConfig=q.setPlotConfig;var v=T_().getGraphDiv,x=E2().eraseActiveShape;Z.deleteActiveShape=function(M){return x(v(M))},Z.toImage=IS(),Z.validate=UO(),Z.downloadImage=RS();var A=VO();Z.makeTemplate=A.makeTemplate,Z.validateTemplate=A.validateTemplate}}),i1=Ze({"src/traces/scatter/xy_defaults.js"(Z,q){"use strict";var v=ca(),x=oo();q.exports=function(M,e,t,r){var i=r("x"),a=r("y"),n,o=x.getComponentMethod("calendars","handleTraceDefaults");if(o(M,e,["x","y"],t),i){var s=v.minRowLength(i);a?n=Math.min(s,v.minRowLength(a)):(n=s,r("y0"),r("dy"))}else{if(!a)return 0;n=v.minRowLength(a),r("x0"),r("dx")}return e._length=n,n}}}),Qd=Ze({"src/traces/scatter/period_defaults.js"(Z,q){"use strict";var v=ca().dateTick0,x=Vs(),A=x.ONEWEEK;function M(e,t){return e%A===0?v(t,1):v(t,0)}q.exports=function(t,r,i,a,n){if(n||(n={x:!0,y:!0}),n.x){var o=a("xperiod");o&&(a("xperiod0",M(o,r.xcalendar)),a("xperiodalignment"))}if(n.y){var s=a("yperiod");s&&(a("yperiod0",M(s,r.ycalendar)),a("yperiodalignment"))}}}}),GO=Ze({"src/traces/scatter/stack_defaults.js"(Z,q){"use strict";var v=["orientation","groupnorm","stackgaps"];q.exports=function(A,M,e,t){var r=e._scatterStackOpts,i=t("stackgroup");if(i){var a=M.xaxis+M.yaxis,n=r[a];n||(n=r[a]={});var o=n[i],s=!1;o?o.traces.push(M):(o=n[i]={traceIndices:[],traces:[M]},s=!0);for(var c={orientation:M.x&&!M.y?"h":"v"},h=0;h<v.length;h++){var m=v[h],d=m+"Found";if(!o[d]){var T=A[m]!==void 0,l=m==="orientation";if((T||s)&&(o[m]=t(m,c[m]),l&&(o.fillDflt=o[m]==="h"?"tonextx":"tonexty"),T&&(o[d]=!0,!s&&(delete o.traces[0][m],l))))for(var _=0;_<o.traces.length-1;_++){var w=o.traces[_];w._input.fill!==w.fill&&(w.fill=o.fillDflt)}}}return o}}}}),md=Ze({"src/traces/scatter/marker_defaults.js"(Z,q){"use strict";var v=Yi(),x=Up().hasColorscale,A=gh(),M=Fu();q.exports=function(t,r,i,a,n,o){var s=M.isBubble(t),c=(t.line||{}).color,h;if(o=o||{},c&&(i=c),n("marker.symbol"),n("marker.opacity",s?.7:1),n("marker.size"),o.noAngle||(n("marker.angle"),o.noAngleRef||n("marker.angleref"),o.noStandOff||n("marker.standoff")),n("marker.color",i),x(t,"marker")&&A(t,r,a,n,{prefix:"marker.",cLetter:"c"}),o.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),o.noLine||(c&&!Array.isArray(c)&&r.marker.color!==c?h=c:s?h=v.background:h=v.defaultLine,n("marker.line.color",h),x(t,"marker.line")&&A(t,r,a,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",s?1:0)),s&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),o.gradient){var m=n("marker.gradient.type");m!=="none"&&n("marker.gradient.color")}}}}),Dd=Ze({"src/traces/scatter/line_defaults.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray,x=Up().hasColorscale,A=gh();q.exports=function(e,t,r,i,a,n){n||(n={});var o=(e.marker||{}).color;if(o&&o._inputArray&&(o=o._inputArray),a("line.color",r),x(e,"line"))A(e,t,i,a,{prefix:"line.",cLetter:"c"});else{var s=(v(o)?!1:o)||r;a("line.color",s)}a("line.width"),n.noDash||a("line.dash"),n.backoff&&a("line.backoff")}}}),o1=Ze({"src/traces/scatter/line_shape_defaults.js"(Z,q){"use strict";q.exports=function(x,A,M){var e=M("line.shape");e==="spline"&&M("line.smoothing")}}}),zd=Ze({"src/traces/scatter/text_defaults.js"(Z,q){"use strict";var v=ca();q.exports=function(x,A,M,e,t){t=t||{},e("textposition"),v.coerceFont(e,"textfont",t.font||M.font,t),t.noSelect||(e("selected.textfont.color"),e("unselected.textfont.color"))}}}),ev=Ze({"src/traces/scatter/fillcolor_defaults.js"(Z,q){"use strict";var v=Yi(),x=ca().isArrayOrTypedArray;function A(M){for(var e=v.interpolate(M[0][1],M[1][1],.5),t=2;t<M.length;t++){var r=v.interpolate(M[t-1][1],M[t][1],.5);e=v.interpolate(e,r,M[t-1][0]/M[t][0])}return e}q.exports=function(e,t,r,i,a){a||(a={});var n=!1;if(t.marker){var o=t.marker.color,s=(t.marker.line||{}).color;o&&!x(o)?n=o:s&&!x(s)&&(n=s)}var c;if(a.moduleHasFillgradient){var h=i("fillgradient.type");if(h!=="none"){i("fillgradient.start"),i("fillgradient.stop");var m=i("fillgradient.colorscale");m&&(c=A(m))}}i("fillcolor",v.addOpacity((t.line||{}).color||n||c||r,.5))}}}),HO=Ze({"src/traces/scatter/defaults.js"(Z,q){"use strict";var v=ca(),x=oo(),A=tf(),M=Tv(),e=Fu(),t=i1(),r=Qd(),i=GO(),a=md(),n=Dd(),o=o1(),s=zd(),c=ev(),h=ca().coercePattern;q.exports=function(d,T,l,_){function w(f,P){return v.coerce(d,T,A,f,P)}var S=t(d,T,_,w);if(S||(T.visible=!1),!!T.visible){r(d,T,_,w),w("xhoverformat"),w("yhoverformat"),w("zorder");var E=i(d,T,_,w);_.scattermode==="group"&&T.orientation===void 0&&w("orientation","v");var g=!E&&S<M.PTS_LINESONLY?"lines+markers":"lines";w("text"),w("hovertext"),w("mode",g),e.hasMarkers(T)&&a(d,T,l,_,w,{gradient:!0}),e.hasLines(T)&&(n(d,T,l,_,w,{backoff:!0}),o(d,T,w),w("connectgaps"),w("line.simplify")),e.hasText(T)&&(w("texttemplate"),s(d,T,_,w));var b=[];(e.hasMarkers(T)||e.hasText(T))&&(w("cliponaxis"),w("marker.maxdisplayed"),b.push("points")),w("fill",E?E.fillDflt:"none"),T.fill!=="none"&&(c(d,T,l,w,{moduleHasFillgradient:!0}),e.hasLines(T)||o(d,T,w),h(w,"fillpattern",T.fillcolor,!1));var p=(T.line||{}).color,u=(T.marker||{}).color;(T.fill==="tonext"||T.fill==="toself")&&b.push("fills"),w("hoveron",b.join("+")||"points"),T.hoveron!=="fills"&&w("hovertemplate");var y=x.getComponentMethod("errorbars","supplyDefaults");y(d,T,p||u||l,{axis:"y"}),y(d,T,p||u||l,{axis:"x",inherit:"y"}),v.coerceSelectionMarkerOpacity(T,w)}}}}),Jg=Ze({"src/traces/scatter/grouping_defaults.js"(Z,q){"use strict";var v=Yg().getAxisGroup;q.exports=function(A,M,e,t,r){var i=M.orientation,a=M[{v:"x",h:"y"}[i]+"axis"],n=v(e,a)+i,o=e._alignmentOpts||{},s=t("alignmentgroup"),c=o[n];c||(c=o[n]={});var h=c[s];h?h.traces.push(M):h=c[s]={traces:[M],alignmentIndex:Object.keys(c).length,offsetGroups:{}};var m=t("offsetgroup")||"",d=h.offsetGroups,T=d[m];M._offsetIndex=0,(r!=="group"||m)&&(T||(T=d[m]={offsetIndex:Object.keys(d).length}),M._offsetIndex=T.offsetIndex)}}}),DS=Ze({"src/traces/scatter/cross_trace_defaults.js"(Z,q){"use strict";var v=ca(),x=Jg(),A=tf();q.exports=function(e,t){var r,i,a,n=t.scattermode;function o(d){return v.coerce(i._input,i,A,d)}if(t.scattermode==="group")for(a=0;a<e.length;a++)i=e[a],i.type==="scatter"&&(r=i._input,x(r,i,t,o,n));for(a=0;a<e.length;a++){var s=e[a];if(s.type==="scatter"){var c=s.fill;if(!(c==="none"||c==="toself")&&(s.opacity=void 0,c==="tonexty"||c==="tonextx"))for(var h=a-1;h>=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;p<b;p++){var u=o[p],y,f,P;if(h){for(y=Math.round((u-w)/(h*t)),P=M(w,h*y,d);P>u;)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;e<A.length;e++)A[e].i=e;v.mergeArray(M.text,A,"tx"),v.mergeArray(M.texttemplate,A,"txt"),v.mergeArray(M.hovertext,A,"htx"),v.mergeArray(M.customdata,A,"data"),v.mergeArray(M.textposition,A,"tp"),M.textfont&&(v.mergeArrayCastPositive(M.textfont.size,A,"ts"),v.mergeArray(M.textfont.color,A,"tc"),v.mergeArray(M.textfont.family,A,"tf"),v.mergeArray(M.textfont.weight,A,"tw"),v.mergeArray(M.textfont.style,A,"ty"),v.mergeArray(M.textfont.variant,A,"tv"),v.mergeArray(M.textfont.textcase,A,"tC"),v.mergeArray(M.textfont.lineposition,A,"tE"),v.mergeArray(M.textfont.shadow,A,"tS"));var t=M.marker;if(t){v.mergeArrayCastPositive(t.size,A,"ms"),v.mergeArrayCastPositive(t.opacity,A,"mo"),v.mergeArray(t.symbol,A,"mx"),v.mergeArray(t.angle,A,"ma"),v.mergeArray(t.standoff,A,"mf"),v.mergeArray(t.color,A,"mc");var r=t.line;t.line&&(v.mergeArray(r.color,A,"mlc"),v.mergeArrayCastPositive(r.width,A,"mlw"));var i=t.gradient;i&&i.type!=="none"&&(v.mergeArray(i.type,A,"mgt"),v.mergeArray(i.color,A,"mgc"))}}}}),Od=Ze({"src/traces/scatter/calc_selection.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){v.isArrayOrTypedArray(M.selectedpoints)&&v.tagSelected(A,M)}}}),Bd=Ze({"src/traces/scatter/calc.js"(Z,q){"use strict";var v=is(),x=ca(),A=Wo(),M=tv(),e=Vs().BADNUM,t=Fu(),r=Fd(),i=Av(),a=Od();function n(d,T){var l=d._fullLayout,_=T._xA=A.getFromId(d,T.xaxis||"x","x"),w=T._yA=A.getFromId(d,T.yaxis||"y","y"),S=_.makeCalcdata(T,"x"),E=w.makeCalcdata(T,"y"),g=M(T,_,"x",S),b=M(T,w,"y",E),p=g.vals,u=b.vals,y=T._length,f=new Array(y),P=T.ids,L=m(T,l,_,w),z=!1,F,B,O,I,N,U;c(l,T);var W="x",Q="y",ue;if(L)x.pushUnique(L.traceIndices,T.index),F=L.orientation==="v",F?(Q="s",ue="x"):(W="s",ue="y"),N=L.stackgaps==="interpolate";else{var se=s(T,y);o(d,T,_,w,p,u,se)}var he=!!T.xperiodalignment,H=!!T.yperiodalignment;for(B=0;B<y;B++){var $=f[B]={},J=v(p[B]),X=v(u[B]);J&&X?($[W]=p[B],$[Q]=u[B],he&&($.orig_x=S[B],$.xEnd=g.ends[B],$.xStart=g.starts[B]),H&&($.orig_y=E[B],$.yEnd=b.ends[B],$.yStart=b.starts[B])):L&&(F?J:X)?($[ue]=F?p[B]:u[B],$.gap=!0,N?($.s=e,z=!0):$.s=0):$[W]=$[Q]=e,P&&($.id=String(P[B]))}if(i(f,T),r(d,T),a(f,T),L){for(B=0;B<f.length;)f[B][ue]===e?f.splice(B,1):B++;if(x.sort(f,function(ee,re){return ee[ue]-re[ue]||ee.i-re.i}),z){for(B=0;B<f.length-1&&f[B].gap;)B++;for(U=f[B].s,U||(U=f[B].s=0),O=0;O<B;O++)f[O].s=U;for(I=f.length-1;I>B&&f[I].gap;)I--;for(U=f[I].s,O=f.length-1;O>I;O--)f[O].s=U;for(;B<I;)if(B++,f[B].gap){for(O=B+1;f[O].gap;)O++;for(var oe=f[B-1][ue],ne=f[B-1].s,j=(f[O].s-ne)/(f[O][ue]-oe);B<O;)f[B].s=ne+(f[B][ue]-oe)*j,B++}}}return f}function o(d,T,l,_,w,S,E){var g=T._length,b=d._fullLayout,p=l._id,u=_._id,y=b._firstScatter[h(T)]===T.uid,f=(m(T,b,l,_)||{}).orientation,P=T.fill;l._minDtick=0,_._minDtick=0;var L={padded:!0},z={padded:!0};E&&(L.ppad=z.ppad=E);var F=g<2||w[0]!==w[g-1]||S[0]!==S[g-1];F&&(P==="tozerox"||P==="tonextx"&&(y||f==="h"))?L.tozero=!0:!(T.error_y||{}).visible&&(P==="tonexty"||P==="tozeroy"||!t.hasMarkers(T)&&!t.hasText(T))&&(L.padded=!1,L.ppad=0),F&&(P==="tozeroy"||P==="tonexty"&&(y||f==="v"))?z.tozero=!0:(P==="tonextx"||P==="tozerox")&&(z.padded=!1),p&&(T._extremes[p]=A.findExtremes(l,w,L)),u&&(T._extremes[u]=A.findExtremes(_,S,z))}function s(d,T){if(t.hasMarkers(d)){var l=d.marker,_=1.6*(d.marker.sizeref||1),w;if(d.marker.sizemode==="area"?w=function(p){return Math.max(Math.sqrt((p||0)/_),3)}:w=function(p){return Math.max((p||0)/_,3)},x.isArrayOrTypedArray(l.size)){var S={type:"linear"};A.setConvert(S);for(var E=S.makeCalcdata(d.marker,"size"),g=new Array(T),b=0;b<T;b++)g[b]=w(E[b]);return g}else return w(l.size)}}function c(d,T){var l=h(T),_=d._firstScatter;_[l]||(_[l]=T.uid)}function h(d){var T=d.stackgroup;return d.xaxis+d.yaxis+d.type+(T?"-"+T:"")}function m(d,T,l,_){var w=d.stackgroup;if(w){var S=T._scatterStackOpts[l._id+_._id][w],E=S.orientation==="v"?_:l;if(E.type==="linear"||E.type==="log")return S}}q.exports={calc:n,calcMarkerSize:s,calcAxisExpansion:o,setFirstScatter:c,getStackOpts:m}}}),XO=Ze({"src/traces/bar/sieve.js"(Z,q){"use strict";q.exports=x;var v=ca().distinctVals;function x(A,M){this.traces=A,this.sepNegVal=M.sepNegVal,this.overlapNoMerge=M.overlapNoMerge;for(var e=1/0,t=M.posAxis._id.charAt(0),r=[],i=0;i<A.length;i++){for(var a=A[i],n=0;n<a.length;n++){var o=a[n],s=o.p;s===void 0&&(s=o[t]),s!==void 0&&r.push(s)}a[0]&&a[0].width1&&(e=Math.min(a[0].width1,e))}this.positions=r;var c=v(r);this.distinctPositions=c.vals,c.vals.length===1&&e!==1/0?this.minDiff=e:this.minDiff=Math.min(c.minDiff,e);var h=(M.posAxis||{}).type;(h==="category"||h==="multicategory")&&(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}x.prototype.put=function(M,e,t){var r=this.getLabel(M,e,t),i=this.bins[r]||0;return this.bins[r]=i+t,i},x.prototype.get=function(M,e,t){var r=this.getLabel(M,e,t);return this.bins[r]||0},x.prototype.getLabel=function(M,e,t){var r=t<0&&this.sepNegVal?"v":"^",i=this.overlapNoMerge?M:Math.round(M/this.binWidth);return r+i+"g"+e}}}),$g=Ze({"src/traces/bar/cross_trace_calc.js"(Z,q){"use strict";var v=is(),x=ca().isArrayOrTypedArray,A=Vs().BADNUM,M=oo(),e=Wo(),t=Yg().getAxisGroup,r=XO();function i(f,P){for(var L=P.xaxis,z=P.yaxis,F=f._fullLayout,B=f._fullData,O=f.calcdata,I=[],N=[],U=0;U<B.length;U++){var W=B[U];if(W.visible===!0&&M.traceIs(W,"bar")&&W.xaxis===L._id&&W.yaxis===z._id&&(W.orientation==="h"?I.push(O[U]):N.push(O[U]),W._computePh))for(var Q=f.calcdata[U],ue=0;ue<Q.length;ue++)typeof Q[ue].ph0=="function"&&(Q[ue].ph0=Q[ue].ph0()),typeof Q[ue].ph1=="function"&&(Q[ue].ph1=Q[ue].ph1())}var se={xCat:L.type==="category"||L.type==="multicategory",yCat:z.type==="category"||z.type==="multicategory",mode:F.barmode,norm:F.barnorm,gap:F.bargap,groupgap:F.bargroupgap};a(f,L,z,N,se),a(f,z,L,I,se)}function a(f,P,L,z,F){if(z.length){var B,O,I,N,U;switch(s(L,z),F.mode){case"overlay":c(f,P,L,z,F);break;case"group":for(B=[],O=[],I=0;I<z.length;I++)N=z[I],U=N[0].trace,U.offset===void 0?O.push(N):B.push(N);O.length&&h(f,P,L,O,F),B.length&&c(f,P,L,B,F);break;case"stack":case"relative":for(B=[],O=[],I=0;I<z.length;I++)N=z[I],U=N[0].trace,U.base===void 0?O.push(N):B.push(N);o(O),O.length&&m(f,P,L,O,F),B.length&&c(f,P,L,B,F);break}n(z),u(z,P)}}function n(f){var P,L,z,F,B,O,I;for(P=0;P<f.length;P++)L=f[P],z=L[0].trace,F=L[0].t,F.cornerradiusvalue===void 0&&(B=z.marker?z.marker.cornerradius:void 0,B!==void 0&&(O=v(B)?+B:+B.slice(0,-1),I=v(B)?"px":"%",F.cornerradiusvalue=O,F.cornerradiusform=I))}function o(f){if(!(f.length<2)){var P,L,z,F,B,O,I;for(P=0;P<f.length&&(L=f[P],z=L[0].trace,B=z.marker?z.marker.cornerradius:void 0,B===void 0);P++);if(B!==void 0)for(O=v(B)?+B:+B.slice(0,-1),I=v(B)?"px":"%",P=0;P<f.length;P++)L=f[P],F=L[0].t,F.cornerradiusvalue=O,F.cornerradiusform=I}}function s(f,P){var L,z;for(L=0;L<P.length;L++){var F=P[L],B=F[0].trace,O=B.type==="funnel"?B._base:B.base,I,N=B.orientation==="h"?B.xcalendar:B.ycalendar,U=f.type==="category"||f.type==="multicategory"?function(){return null}:f.d2c;if(x(O)){for(z=0;z<Math.min(O.length,F.length);z++)I=U(O[z],0,N),v(I)?(F[z].b=+I,F[z].hasB=1):F[z].b=0;for(;z<F.length;z++)F[z].b=0}else{I=U(O,0,N);var W=v(I);for(I=W?I:0,z=0;z<F.length;z++)F[z].b=I,W&&(F[z].hasB=1)}}}function c(f,P,L,z,F){for(var B=0;B<z.length;B++){var O=z[B],I=new r([O],{posAxis:P,sepNegVal:!1,overlapNoMerge:!F.norm});d(f,P,I,F),F.norm?(E(I),b(L,I,F)):w(L,I)}}function h(f,P,L,z,F){var B=new r(z,{posAxis:P,sepNegVal:!1,overlapNoMerge:!F.norm});d(f,P,B,F),g(B,P),F.norm?(E(B),b(L,B,F)):w(L,B)}function m(f,P,L,z,F){var B=new r(z,{posAxis:P,sepNegVal:F.mode==="relative",overlapNoMerge:!(F.norm||F.mode==="stack"||F.mode==="relative")});d(f,P,B,F),S(L,B,F);for(var O=0;O<z.length;O++)for(var I=z[O],N=I[0].t.offsetindex,U=0;U<I.length;U++){var W=I[U];if(W.s!==A){var Q=W.b+W.s===B.get(W.p,N,W.s);Q&&(W._outmost=!0)}}F.norm&&b(L,B,F)}function d(f,P,L,z){var F=f._fullLayout,B=L.positions,O=L.distinctPositions,I=L.minDiff,N=L.traces,U=N.length,W=B.length!==O.length,Q=I*(1-z.gap),ue,se,he,H;if(P._id==="angularaxis")ue=Q,se=ue*(1-(z.groupgap||0)),he=-se/2;else{var $=t(F,P._id)+N[0][0].trace.orientation;H=F._alignmentOpts[$]||{}}for(var J=0;J<U;J++){var X=N[J],oe=X[0].trace;if(P._id!=="angularaxis"){var ne=H[oe.alignmentgroup]||{},j=Object.keys(ne.offsetGroups||{}).length;j?ue=Q/j:ue=W?Q/U:Q,se=ue*(1-(z.groupgap||0)),j?he=((2*oe._offsetIndex+1-j)*ue-se)/2:he=W?((2*J+1-U)*ue-se)/2:-se/2}var ee=X[0].t;ee.barwidth=se,ee.offsetindex=oe._offsetIndex||0,ee.poffset=he,ee.bargroupwidth=Q,ee.bardelta=I}L.binWidth=N[0][0].t.barwidth/100,T(L),l(P,L),P._id==="angularaxis"?_(P,L):_(P,L,W)}function T(f){var P=f.traces,L,z;for(L=0;L<P.length;L++){var F=P[L],B=F[0],O=B.trace,I=B.t,N=O._offset||O.offset,U=I.poffset,W;if(x(N)){for(W=Array.prototype.slice.call(N,0,F.length),z=0;z<W.length;z++)v(W[z])||(W[z]=U);for(z=W.length;z<F.length;z++)W.push(U);I.poffset=W}else N!==void 0&&(I.poffset=N);var Q=O._width||O.width,ue=I.barwidth;if(x(Q)){var se=Array.prototype.slice.call(Q,0,F.length);for(z=0;z<se.length;z++)v(se[z])||(se[z]=ue);for(z=se.length;z<F.length;z++)se.push(ue);if(I.barwidth=se,N===void 0){for(W=[],z=0;z<F.length;z++)W.push(U+(ue-se[z])/2);I.poffset=W}}else Q!==void 0&&(I.barwidth=Q,N===void 0&&(I.poffset=U+(ue-Q)/2))}}function l(f,P){for(var L=P.traces,z=y(f),F=0;F<L.length;F++)for(var B=L[F],O=B[0].t,I=O.poffset,N=x(I),U=O.barwidth,W=x(U),Q=0;Q<B.length;Q++){var ue=B[Q],se=ue.w=W?U[Q]:U;ue.p===void 0&&(ue.p=ue[z],ue["orig_"+z]=ue[z]);var he=(N?I[Q]:I)+se/2;ue[z]=ue.p+he}}function _(f,P,L){var z=P.traces,F=P.minDiff,B=F/2;e.minDtick(f,P.minDiff,P.distinctPositions[0],L);for(var O=0;O<z.length;O++){var I=z[O],N=I[0],U=N.trace,W=[],Q,ue,se,he;for(he=0;he<I.length;he++)Q=I[he],ue=Q.p-B,se=Q.p+B,W.push(ue,se);if(U.width||U.offset){var H=N.t,$=H.poffset,J=H.barwidth,X=x($),oe=x(J);for(he=0;he<I.length;he++){Q=I[he];var ne=X?$[he]:$,j=oe?J[he]:J;ue=Q.p+ne,se=ue+j,W.push(ue,se)}}U._extremes[f._id]=e.findExtremes(f,W,{padded:!1})}}function w(f,P){for(var L=P.traces,z=y(f),F=0;F<L.length;F++){for(var B=L[F],O=B[0].trace,I=O.type==="scatter",N=O.orientation==="v",U=[],W=!1,Q=0;Q<B.length;Q++){var ue=B[Q],se=I?0:ue.b,he=I?N?ue.y:ue.x:se+ue.s;ue[z]=he,U.push(he),ue.hasB&&U.push(se),(!ue.hasB||!ue.b)&&(W=!0)}O._extremes[f._id]=e.findExtremes(f,U,{tozero:W,padded:!0})}}function S(f,P,L){var z=y(f),F=P.traces,B,O,I,N,U,W,Q;for(N=0;N<F.length;N++)if(B=F[N],O=B[0].trace,O.type==="funnel")for(Q=B[0].t.offsetindex,U=0;U<B.length;U++)W=B[U],W.s!==A&&P.put(W.p,Q,-.5*W.s);for(N=0;N<F.length;N++){B=F[N],O=B[0].trace,I=O.type==="funnel",Q=O.type==="barpolar"?0:B[0].t.offsetindex;var ue=[];for(U=0;U<B.length;U++)if(W=B[U],W.s!==A){var se;I?se=W.s:se=W.s+W.b;var he=P.put(W.p,Q,se),H=he+se;W.b=he,W[z]=H,L.norm||(ue.push(H),W.hasB&&ue.push(he))}L.norm||(O._extremes[f._id]=e.findExtremes(f,ue,{tozero:!0,padded:!0}))}}function E(f){for(var P=f.traces,L=0;L<P.length;L++)for(var z=P[L],F=z[0].t.offsetindex,B=0;B<z.length;B++){var O=z[B];O.s!==A&&f.put(O.p,F,O.b+O.s)}}function g(f,P){for(var L=f.traces,z=0;z<L.length;z++){var F=L[z],B=F[0].trace,O=F[0].t.offsetindex;if(B.base===void 0)for(var I=new r([F],{posAxis:P,sepNegVal:!0,overlapNoMerge:!0}),N=0;N<F.length;N++){var U=F[N];if(U.p!==A){var W=I.put(U.p,O,U.b+U.s);W&&(U.b=W)}}}}function b(f,P,L){var z=P.traces,F=y(f),B=L.norm==="fraction"?1:100,O=B/1e9,I=f.l2c(f.c2l(0)),N=L.mode==="stack"?B:I;function U(ee){return v(f.c2l(ee))&&(ee<I-O||ee>N+O||!v(I))}for(var W=0;W<z.length;W++){for(var Q=z[W],ue=Q[0].t.offsetindex,se=Q[0].trace,he=[],H=!1,$=!1,J=0;J<Q.length;J++){var X=Q[J];if(X.s!==A){var oe=Math.abs(B/P.get(X.p,ue,X.s));X.b*=oe,X.s*=oe;var ne=X.b,j=ne+X.s;X[F]=j,he.push(j),$=$||U(j),X.hasB&&(he.push(ne),$=$||U(ne)),(!X.hasB||!X.b)&&(H=!0)}}se._extremes[f._id]=e.findExtremes(f,he,{tozero:H,padded:$})}}function p(f,P,L,z){for(var F=y(z),B=0;B<f.length;B++)for(var O=f[B],I=0;I<O.length;I++){var N=O[I],U=N[F];N._sMin=P[U],N._sMax=L[U]}}function u(f,P){var L=y(P),z={},F,B,O,I=1/0,N=-1/0;for(F=0;F<f.length;F++)for(O=f[F],B=0;B<O.length;B++){var U=O[B].p;v(U)&&(I=Math.min(I,U),N=Math.max(N,U))}var W=1e4/(N-I),Q=z.round=function(ce){return String(Math.round(W*(ce-I)))},ue={},se={},he=f.some(function(ce){var be=ce[0].trace;return"marker"in be&&be.marker.cornerradius});for(F=0;F<f.length;F++){O=f[F],O[0].t.extents=z;var H=O[0].t.poffset,$=x(H);for(B=0;B<O.length;B++){var J=O[B],X=J[L]-J.w/2;if(v(X)){var oe=J[L]+J.w/2,ne=Q(J.p);z[ne]?z[ne]=[Math.min(X,z[ne][0]),Math.max(oe,z[ne][1])]:z[ne]=[X,oe]}if(J.p0=J.p+($?H[B]:H),J.p1=J.p0+J.w,J.s0=J.b,J.s1=J.s0+J.s,he){var j=Math.min(J.s0,J.s1)||0,ee=Math.max(J.s0,J.s1)||0,re=J[L];ue[re]=re in ue?Math.min(ue[re],j):j,se[re]=re in se?Math.max(se[re],ee):ee}}}he&&p(f,ue,se,P)}function y(f){return f._id.charAt(0)}q.exports={crossTraceCalc:i,setGroupPositions:a}}}),ZO=Ze({"src/traces/scatter/cross_trace_calc.js"(Z,q){"use strict";var v=Bd(),x=$g().setGroupPositions;function A(t,r){for(var i=r.xaxis,a=r.yaxis,n=t._fullLayout,o=t._fullData,s=t.calcdata,c=[],h=[],m=0;m<o.length;m++){var d=o[m];d.visible===!0&&d.type==="scatter"&&d.xaxis===i._id&&d.yaxis===a._id&&(d.orientation==="h"?c.push(s[m]):d.orientation==="v"&&h.push(s[m]))}var T={mode:n.scattermode,gap:n.scattergap};x(t,i,a,h,T),x(t,a,i,c,T)}q.exports=function(r,i){r._fullLayout.scattermode==="group"&&A(r,i);var a=i.xaxis,n=i.yaxis,o=a._id+n._id,s=r._fullLayout._scatterStackOpts[o];if(s){var c=r.calcdata,h,m,d,T,l,_,w,S,E,g,b,p,u,y,f;for(var P in s){g=s[P];var L=g.traceIndices;if(L.length){for(b=g.stackgaps==="interpolate",p=g.groupnorm,g.orientation==="v"?(u="x",y="y"):(u="y",y="x"),f=new Array(L.length),h=0;h<f.length;h++)f[h]=!1;_=c[L[0]];var z=new Array(_.length);for(h=0;h<_.length;h++)z[h]=_[h][u];for(h=1;h<L.length;h++){for(l=c[L[h]],m=d=0;m<l.length;m++){for(w=l[m][u];w>z[d]&&d<z.length;d++)M(l,m,z[d],h,f,b,u),m++;if(w!==z[d]){for(T=0;T<h;T++)M(c[L[T]],d,w,T,f,b,u);z.splice(d,0,w)}d++}for(;d<z.length;d++)M(l,m,z[d],h,f,b,u),m++}var F=z.length;for(m=0;m<_.length;m++){for(S=_[m][y]=_[m].s,h=1;h<L.length;h++)l=c[L[h]],l[0].trace._rawLength=l[0].trace._length,l[0].trace._length=F,S+=l[m].s,l[m][y]=S;if(p)for(E=(p==="fraction"?S:S/100)||1,h=0;h<L.length;h++){var B=c[L[h]][m];B[y]/=E,B.sNorm=B.s/E}}for(h=0;h<L.length;h++){l=c[L[h]];var O=l[0].trace,I=v.calcMarkerSize(O,O._rawLength),N=Array.isArray(I);if(I&&f[h]||N){var U=I;for(I=new Array(F),m=0;m<F;m++)I[m]=l[m].gap?0:N?U[l[m].i]:U}var W=new Array(F),Q=new Array(F);for(m=0;m<F;m++)W[m]=l[m].x,Q[m]=l[m].y;v.calcAxisExpansion(r,O,a,n,W,Q,I),l[0].t.orientation=g.orientation}}}}};function M(t,r,i,a,n,o,s){n[a]=!0;var c={i:null,gap:!0,s:0};if(c[s]=i,t.splice(r,0,c),r&&i===t[r-1][s]){var h=t[r-1];c.s=h.s,c.i=h.i,c.gap=h.gap}else o&&(c.s=e(t,r,i,s));r||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}function e(t,r,i,a){var n=t[r-1],o=t[r+1];return o?n?n.s+(o.s-n.s)*(i-n[a])/(o[a]-n[a]):o.s:n.s}}}),zS=Ze({"src/traces/scatter/line_points.js"(Z,q){"use strict";var v=as(),x=Vs(),A=x.BADNUM,M=x.LOG_CLIP,e=M+.5,t=M-.5,r=ca(),i=r.segmentsIntersect,a=r.constrain,n=Tv();q.exports=function(s,c){var h=c.trace||{},m=c.xaxis,d=c.yaxis,T=m.type==="log",l=d.type==="log",_=m._length,w=d._length,S=c.backoff,E=h.marker,g=c.connectGaps,b=c.baseTolerance,p=c.shape,u=p==="linear",y=h.fill&&h.fill!=="none",f=[],P=n.minTolerance,L=s.length,z=new Array(L),F=0,B,O,I,N,U,W,Q,ue,se,he,H,$,J,X,oe,ne;function j(yt){var Tt=s[yt];if(!Tt)return!1;var Ot=c.linearized?m.l2p(Tt.x):m.c2p(Tt.x),Gt=c.linearized?d.l2p(Tt.y):d.c2p(Tt.y);if(Ot===A){if(T&&(Ot=m.c2p(Tt.x,!0)),Ot===A)return!1;l&&Gt===A&&(Ot*=Math.abs(m._m*w*(m._m>0?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&&Ba<Ua){var Ra=Tr*Qt-la*rr;if(Ra*Ra<Ua)return!0}}var re,ce;function be(yt,Tt){var Ot=yt[0]/_,Gt=yt[1]/w,rr=Math.max(0,-Ot,Ot-1,-Gt,Gt-1);return rr&&re!==void 0&&ee(Ot,Gt,re,ce)&&(rr=0),rr&&Tt&&ee(Ot,Gt,Tt[0]/_,Tt[1]/w)&&(rr=0),(1+n.toleranceGrowth*rr)*b}function Ae(yt,Tt){var Ot=yt[0]-Tt[0],Gt=yt[1]-Tt[1];return Math.sqrt(Ot*Ot+Gt*Gt)}var ze=n.maxScreensAway,Re=-_*ze,We=_*(1+ze),it=-w*ze,ot=w*(1+ze),tt=[[Re,it,We,it],[We,it,We,ot],[We,ot,Re,ot],[Re,ot,Re,it]],ut,Me,_e,fe,Fe,rt;function st(yt,Tt){for(var Ot=[],Gt=0,rr=0;rr<4;rr++){var Qt=tt[rr],Tr=i(yt[0],yt[1],Tt[0],Tt[1],Qt[0],Qt[1],Qt[2],Qt[3]);Tr&&(!Gt||Math.abs(Tr.x-Ot[0][0])>1||Math.abs(Tr.y-Ot[0][1])>1)&&(Tr=[Tr.x,Tr.y],Gt&&Ae(Tr,yt)<Ae(Ot[0],yt)?Ot.unshift(Tr):Ot.push(Tr),Gt++)}return Ot}function Qe(yt){if(yt[0]<Re||yt[0]>We||yt[1]<it||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]<Re?Re:yt[0]>We?We:0,Me=yt[1]<it?it: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;B<L;B++)if(O=j(B),!!O){for(F=0,Fe=null,Ir(O),B++;B<L;B++){if(N=j(B),!N){if(g)continue;break}if(!u||!c.simplify){Ir(N);continue}var bt=j(B+1);if(he=Ae(N,O),!(!(y&&(F===0||F===L-1))&&he<be(N,bt)*P)){for(ue=[(N[0]-O[0])/he,(N[1]-O[1])/he],U=O,H=he,$=X=oe=0,Q=!1,I=N,B++;B<s.length;B++){if(W=bt,bt=j(B+1),!W){if(g)continue;break}if(se=[W[0]-O[0],W[1]-O[1]],ne=se[0]*ue[1]-se[1]*ue[0],X=Math.min(X,ne),oe=Math.max(oe,ne),oe-X>be(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<f.length;Ve++)for(var Ce=0;Ce<f[Ve].length-1;Ce++){var Te=f[Ve][Ce],Pe=f[Ve][Ce+1],at=v.applyBackoff(Pe,Te);(at[0]!==Pe[0]||at[1]!==Pe[1])&&(Ke=!0),Ee[Ue+1]||(Ue++,Ee[Ue]=[Te,[at[0],at[1]]])}return Ke?Ee:f}return f}}}),FS=Ze({"src/traces/scatter/link_traces.js"(Z,q){"use strict";var v={tonextx:1,tonexty:1,tonext:1};q.exports=function(A,M,e){var t,r,i,a,n,o={},s=!1,c=-1,h=0,m=-1;for(r=0;r<e.length;r++)t=e[r][0].trace,i=t.stackgroup||"",i?i in o?n=o[i]:(n=o[i]=h,h++):t.fill in v&&m>=0?n=m:(n=m=h,h++),n<c&&(s=!0),t._groupIndex=c=n;var d=e.slice();s&&d.sort(function(l,_){var w=l[0].trace,S=_[0].trace;return w._groupIndex-S._groupIndex||w.index-S.index});var T={};for(r=0;r<d.length;r++)t=d[r][0].trace,i=t.stackgroup||"",t.visible===!0?(t._nexttrace=null,t.fill in v&&(a=T[i],t._prevtrace=a||null,a&&(a._nexttrace=t)),t._ownfill=t.fill&&(t.fill.substr(0,6)==="tozero"||t.fill==="toself"||t.fill.substr(0,2)==="to"&&!t._prevtrace),T[i]=t):t._prevtrace=t._nexttrace=t._ownfill=null;return d}}}),s1=Ze({"src/traces/scatter/plot.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=ca(),M=A.ensureSingle,e=A.identity,t=as(),r=Fu(),i=zS(),a=FS(),n=P_().tester;q.exports=function(m,d,T,l,_,w){var S,E,g=!_,b=!!_&&_.duration>0,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<Re.length;E++){var ot,tt=Re[E];!ot||!N?(ot=tt.slice(),ze[it]=ot,it++):ot.push.apply(ot,tt)}y._fillElement=null,y._fillExclusionElement=H,y._fillsegments=ze.slice(0,it),ze=y._fillsegments,Re.length&&(re=Re[0][0].slice(),ce=Re[Re.length-1],be=ce[ce.length-1].slice()),We=function(xr){return function(jr){if($=ne(jr),J=ee(jr),X?N?(X+="L"+$.substr(1),oe=J+("L"+oe.substr(1))):(X+="Z"+$,oe=J+"Z"+oe):(X=$,oe=J),r.hasLines(y)){var wr=v.select(this);if(wr.datum(T),xr)b(wr.style("opacity",0).attr("d",$).call(t.lineGroupStyle)).style("opacity",1);else{var Ir=b(wr);Ir.attr("d",$),t.singleLineStyle(T,Ir)}}}}}var ut=z.selectAll(".js-line").data(Re);b(ut.exit()).style("opacity",0).remove(),ut.each(We(!1)),ut.enter().append("path").classed("js-line",!0).style("vector-effect",S?"none":"non-scaling-stroke").call(t.lineGroupStyle).each(We(!0)),t.setClipUrl(ut,d.layerClipId,h);function Me(xr){b(xr).attr("d","M0,0Z")}var _e=function(){var xr=new Array(ze.length);for(E=0;E<ze.length;E++)xr[E]=n(ze[E]);return xr},fe=function(xr){var jr,wr;if(!xr||xr.length===0)for(jr=new Array(ze.length),wr=0;wr<ze.length;wr++){var Ir=ze[wr][0].slice(),bt=ze[wr][ze[wr].length-1].slice();Ir[U]=bt[U]=W;var Be=[bt,Ir],Ke=Be.concat(ze[wr]);jr[wr]=n(Ke)}else{for(jr=new Array(xr.length-1+ze.length),wr=0;wr<xr.length-1;wr++)jr[wr]=n(xr[wr]);var Ue=xr[xr.length-1].slice();for(Ue.reverse(),wr=0;wr<ze.length;wr++)jr[xr.length-1+wr]=n(ze[wr].concat(Ue))}return jr};Re.length?(O?(O.datum(T),re&&be&&(N?(re[U]=be[U]=W,b(O).attr("d","M"+be+"L"+re+"L"+X.substr(1)).call(t.singleFillStyle,h),Ae=fe(null)):(b(O).attr("d",X+"Z").call(t.singleFillStyle,h),Ae=_e())),y._polygons=Ae,y._fillElement=O):I&&(y.fill.substr(0,6)==="tonext"&&X&&Q?(y.fill==="tonext"?(b(I).attr("d",X+"Z"+Q+"Z").call(t.singleFillStyle,h),Ae=_e(),y._polygons=Ae.concat(ue)):(b(I).attr("d",X+"L"+Q.substr(1)+"Z").call(t.singleFillStyle,h),Ae=fe(he),y._polygons=Ae),y._fillElement=I):Me(I)),y._prevRevpath=oe):(O?Me(O):I&&Me(I),y._prevRevpath=null),y._ownPolygons=Ae;function Fe(xr){return xr.filter(function(jr){return!jr.gap&&jr.vis})}function rt(xr){return xr.filter(function(jr){return jr.vis})}function st(xr){return xr.filter(function(jr){return!jr.gap})}function Qe(xr){return xr.id}function Lt(xr){if(xr.ids)return Qe}function kt(){return!1}function qt(xr,jr,wr){var Ir,bt,Be,Ke=wr[0].trace,Ue=r.hasMarkers(Ke),Ee=r.hasText(Ke),Ve=Lt(Ke),Ce=kt,Te=kt;if(Ue||Ee){var Pe=e,at=Ke.stackgroup,yt=at&&h._fullLayout._scatterStackOpts[p._id+u._id][at].stackgaps==="infer zero";Ke.marker.maxdisplayed||Ke._needsCull?Pe=yt?rt:Fe:at&&!yt&&(Pe=st),Ue&&(Ce=Pe),Ee&&(Te=Pe)}bt=xr.selectAll("path.point"),Ir=bt.data(Ce,Ve);var Tt=Ir.enter().append("path").classed("point",!0);g&&Tt.call(t.pointStyle,Ke,h).call(t.translatePoints,p,u).style("opacity",0).transition().style("opacity",1),Ir.order();var Ot;Ue&&(Ot=t.makePointStyleFns(Ke)),Ir.each(function(Gt){var rr=v.select(this),Qt=b(rr);Be=t.translatePoint(Gt,Qt,p,u),Be?(t.singlePointStyle(Gt,Qt,Ke,Ot,h),d.layerClipId&&t.hideOutsideRangePoint(Gt,Qt,p,u,Ke.xcalendar,Ke.ycalendar),Ke.customdata&&rr.classed("plotly-customdata",Gt.data!==null&&Gt.data!==void 0)):Qt.remove()}),g?Ir.exit().transition().style("opacity",0).remove():Ir.exit().remove(),bt=jr.selectAll("g"),Ir=bt.data(Te,Ve),Ir.enter().append("g").classed("textpoint",!0).append("text"),Ir.order(),Ir.each(function(Gt){var rr=v.select(this),Qt=b(rr.select("text"));Be=t.translatePoint(Gt,Qt,p,u),Be?d.layerClipId&&t.hideOutsideRangePoint(Gt,rr,p,u,Ke.xcalendar,Ke.ycalendar):rr.remove()}),Ir.selectAll("text").call(t.textPointStyle,Ke,h).each(function(Gt){var rr=p.c2p(Gt.x),Qt=u.c2p(Gt.y);v.select(this).selectAll("tspan.line").each(function(){b(v.select(this)).attr({x:rr,y:Qt})})}),Ir.exit().remove()}F.datum(T),B.datum(T),qt(F,B,T);var Zt=y.cliponaxis===!1,Sr=Zt?null:d.layerClipId;t.setClipUrl(F,Sr,h),t.setClipUrl(B,Sr,h)}function c(h,m,d,T,l){var _=d.xaxis,w=d.yaxis,S=v.extent(A.simpleMap(_.range,_.r2c)),E=v.extent(A.simpleMap(w.range,w.r2c)),g=T[0].trace;if(r.hasMarkers(g)){var b=g.marker.maxdisplayed;if(b!==0){var p=T.filter(function(P){return P.x>=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<m&&y++});var f=Math.round(y*u/3+Math.floor(y/3)*u/7.1);T.forEach(function(P){delete P.vis}),p.forEach(function(P,L){Math.round((L+f)%u)===0&&(P.vis=!0)})}}}}}),hp=Ze({"src/traces/scatter/marker_colorbar.js"(Z,q){"use strict";q.exports={container:"marker",min:"cmin",max:"cmax"}}}),P2=Ze({"src/traces/scatter/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r={_fullLayout:e},i=v.getFromTrace(r,M,"x"),a=v.getFromTrace(r,M,"y"),n=A.orig_x;n===void 0&&(n=A.x);var o=A.orig_y;return o===void 0&&(o=A.y),t.xLabel=v.tickText(i,i.c2l(n),!0).text,t.yLabel=v.tickText(a,a.c2l(o),!0).text,t}}}),ed=Ze({"src/traces/scatter/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=oo();function M(i){var a=v.select(i).selectAll("g.trace.scatter");a.style("opacity",function(n){return n[0].trace.opacity}),a.selectAll("g.points").each(function(n){var o=v.select(this),s=n.trace||n[0].trace;e(o,s,i)}),a.selectAll("g.text").each(function(n){var o=v.select(this),s=n.trace||n[0].trace;t(o,s,i)}),a.selectAll("g.trace path.js-line").call(x.lineGroupStyle),a.selectAll("g.trace path.js-fill").call(x.fillGroupStyle,i,!1),A.getComponentMethod("errorbars","style")(a)}function e(i,a,n){x.pointStyle(i.selectAll("path.point"),a,n)}function t(i,a,n){x.textPointStyle(i.selectAll("text"),a,n)}function r(i,a,n){var o=a[0].trace;o.selectedpoints?(x.selectedPointStyle(n.selectAll("path.point"),o),x.selectedTextStyle(n.selectAll("text"),o)):(e(n,o,i),t(n,o,i))}q.exports={style:M,stylePoints:e,styleText:t,styleOnSelect:r}}}),l1=Ze({"src/traces/scatter/get_trace_color.js"(Z,q){"use strict";var v=Yi(),x=Fu();q.exports=function(M,e){var t,r;if(M.mode==="lines")return t=M.line.color,t&&v.opacity(t)?t:M.fillcolor;if(M.mode==="none")return M.fill?M.fillcolor:"";var i=e.mcc||(M.marker||{}).color,a=e.mlcc||((M.marker||{}).line||{}).color;return r=i&&v.opacity(i)?i:a&&v.opacity(a)&&(e.mlw||((M.marker||{}).line||{}).width)?a:"",r?v.opacity(r)<.3?v.addOpacity(r,.3):r:(t=(M.line||{}).color,t&&v.opacity(t)&&x.hasLines(M)&&M.line.width?t:M.fillcolor)}}}),u1=Ze({"src/traces/scatter/hover.js"(Z,q){"use strict";var v=ca(),x=ef(),A=oo(),M=l1(),e=Yi(),t=v.fillText;q.exports=function(i,a,n,o){var s=i.cd,c=s[0].trace,h=i.xa,m=i.ya,d=h.c2p(a),T=m.c2p(n),l=[d,T],_=c.hoveron||"",w=c.mode.indexOf("markers")!==-1?3:.5,S=!!c.xperiodalignment,E=!!c.yperiodalignment;if(_.indexOf("points")!==-1){var g=function(ue){if(S){var se=h.c2p(ue.xStart),he=h.c2p(ue.xEnd);return d>=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<H?$*J/H:J-H+$},b=function(ue){if(E){var se=m.c2p(ue.yStart),he=m.c2p(ue.yEnd);return T>=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 J<H?$*J/H:J-H+$},p=function(ue){var se=Math.max(w,ue.mrc||0),he=h.c2p(ue.x)-d,H=m.c2p(ue.y)-T;return Math.max(Math.sqrt(he*he+H*H)-se,1-w/se)},u=x.getDistanceFunction(o,g,b,p);if(x.getClosest(s,u,i),i.index!==!1){var y=s[i.index],f=h.c2p(y.x,!0),P=m.c2p(y.y,!0),L=y.mrc||1;i.index=y.i;var z=s[0].t.orientation,F=z&&(y.sNorm||y.s),B=z==="h"?F:y.orig_x!==void 0?y.orig_x:y.x,O=z==="v"?F:y.orig_y!==void 0?y.orig_y:y.y;return v.extendFlat(i,{color:M(c,y),x0:f-L,x1:f+L,xLabelVal:B,y0:P-L,y1:P+L,yLabelVal:O,spikeDistance:p(y),hovertemplate:c.hovertemplate}),t(y,c,i),A.getComponentMethod("errorbars","hoverInfo")(y,c,i),[i]}}function I(ue){if(!ue)return!1;var se=ue.node();try{var he=new DOMPoint(l[0],l[1]);return se.isPointInFill(he)}catch{var H=se.ownerSVGElement.createSVGPoint();return H.x=l[0],H.y=l[1],se.isPointInFill(H)}}function N(ue){var se,he=[],H=1/0,$=-1/0,J=1/0,X=-1/0,oe;for(se=0;se<ue.length;se++){var ne=ue[se];ne.contains(l)&&(he.push(ne),J=Math.min(J,ne.ymin),X=Math.max(X,ne.ymax))}if(he.length===0)return null;J=Math.max(J,0),X=Math.min(X,m._length),oe=(J+X)/2;var j,ee,re,ce,be,Ae,ze;for(se=0;se<he.length;se++)for(ee=he[se].pts,j=1;j<ee.length;j++)Ae=ee[j-1][1],ze=ee[j][1],Ae>oe!=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;n<e.length;n++)e[n].selected=0;else for(n=0;n<e.length;n++)o=e[n],s=t.c2p(o.x),c=r.c2p(o.y),o.i!==null&&M.contains([s,c],!1,n,A)?(i.push({pointNumber:o.i,x:t.c2d(o.x),y:r.c2d(o.y)}),o.selected=1):o.selected=0;return i}}}),YO=Ze({"src/plots/cartesian/attributes.js"(Z,q){"use strict";q.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}}),OS=Ze({"src/plots/cartesian/type_defaults.js"(Z,q){"use strict";var v=oo().traceIs,x=a1();q.exports=function(i,a,n,o){n("autotypenumbers",o.autotypenumbersDflt);var s=n("type",(o.splomStash||{}).type);s==="-"&&(A(a,o.data),a.type==="-"?a.type="linear":i.type=a.type)};function A(r,i){if(r.type==="-"){var a=r._id,n=a.charAt(0),o;a.indexOf("scene")!==-1&&(a=n);var s=M(i,a,n);if(s){if(s.type==="histogram"&&n==={v:"y",h:"x"}[s.orientation||"v"]){r.type="linear";return}var c=n+"calendar",h=s[c],m={noMultiCategory:!v(s,"cartesian")||v(s,"noMultiCategory")};if(s.type==="box"&&s._hasPreCompStats&&n==={h:"x",v:"y"}[s.orientation||"v"]&&(m.noMultiCategory=!0),m.autotypenumbers=r.autotypenumbers,t(s,n)){var d=e(s),T=[];for(o=0;o<i.length;o++){var l=i[o];!v(l,"box-violin")||(l[n+"axis"]||n)!==a||(l[d]!==void 0?T.push(l[d][0]):l.name!==void 0?T.push(l.name):T.push("text"),l[c]!==h&&(h=void 0))}r.type=x(T,h,m)}else if(s.type==="splom"){var _=s.dimensions,w=_[s._axesDim[a]];w.visible&&(r.type=x(w.values,h,m))}else r.type=x(s[n]||[s[n+"0"]],h,m)}}}function M(r,i,a){for(var n=0;n<r.length;n++){var o=r[n];if(o.type==="splom"&&o._length>0&&(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;i<M.data.length;i++){var n=M.data[i];n[e+"axis"]===A._id&&r.push(n)}for(i=0;i<r.length;i++){var o=r[i][e];for(a=0;a<o.length;a++){var s=o[a];s!=null&&(t[s]=1)}}return Object.keys(t)}q.exports=function(M,e,t,r){if(e.type==="category"){var i=M.categoryarray,a=Array.isArray(i)&&i.length>0||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<E.rangebreaks.length;he++)if(E.rangebreaks[he].pattern===m){E._hasDayOfWeekBreaks=!0;break}if(h(E,p),p._has("scattergl")||p._has("splom"))for(var H=0;H<b.data.length;H++){var $=b.data[H];($.type==="scattergl"||$.type==="splom")&&($.visible=!1,A.warn($.type+" traces do not work on axes with rangebreaks. Setting trace "+$.index+" to `visible: false`."))}}return E};function T(w,S,E){function g(F,B){return A.coerce(w,S,t.rangebreaks,F,B)}var b=g("enabled");if(b){var p=g("bounds");if(p&&p.length>=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]){if(p[0]<L[0]&&p[1]>L[1]){S.enabled=!1;return}}else if(p[0]>L[0]&&p[1]<L[1]){S.enabled=!1;return}}}else{var z=g("values");if(z&&z.length)g("dvalue");else{S.enabled=!1;return}}}}var l={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function _(w){if(typeof w=="string")return l[w.substr(0,3).toLowerCase()]}}}),R2=Ze({"src/plots/cartesian/position_defaults.js"(Z,q){"use strict";var v=is(),x=ca();q.exports=function(M,e,t,r){var i=r.counterAxes||[],a=r.overlayableAxes||[],n=r.letter,o=r.grid,s=r.overlayingDomain,c,h,m,d,T,l;o&&(h=o._domains[n][o._axisMap[e._id]],c=o._anchors[e._id],h&&(m=o[n+"side"].split(" ")[0],d=o.domain[n][m==="right"||m==="top"?1:0])),h=h||[0,1],c=c||(v(M.position)?"free":i[0]||"free"),m=m||(n==="x"?"bottom":"left"),d=d||0,T=0,l=!1;var _=x.coerce(M,e,{anchor:{valType:"enumerated",values:["free"].concat(i),dflt:c}},"anchor"),w=x.coerce(M,e,{side:{valType:"enumerated",values:n==="x"?["bottom","top"]:["left","right"],dflt:m}},"side");if(_==="free"){if(n==="y"){var S=t("autoshift");S&&(d=w==="left"?s[0]:s[1],l=e.automargin?e.automargin:!0,T=w==="left"?-3:3),t("shift",T)}t("position",d)}t("automargin",l);var E=!1;if(a.length&&(E=x.coerce(M,e,{overlaying:{valType:"enumerated",values:[!1].concat(a),dflt:!1}},"overlaying")),!E){var g=t("domain",h);g[0]>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<g.length;I++){var U=g[I];if(T(U,"cartesian")){var W;if(U.xaxis)W=c(U.xaxis),_(p,W,U);else if(U.xaxes)for(N=0;N<U.xaxes.length;N++)_(p,c(U.xaxes[N]),U);var Q;if(U.yaxis)Q=c(U.yaxis),_(p,Q,U);else if(U.yaxes)for(N=0;N<U.yaxes.length;N++)_(p,c(U.yaxes[N]),U);if(U.type==="funnel"?U.orientation==="h"?(W&&(u[W]=!0),Q&&(z[Q]=!0)):Q&&(y[Q]=!0):U.type==="image"?(Q&&(F[Q]=!0),W&&(F[W]=!0)):(Q&&(P[Q]=!0,L[Q]=!0),(!T(U,"carpet")||U.type==="carpet"&&!U._cheater)&&W&&(f[W]=!0)),U.type==="carpet"&&U._cheater&&W&&(u[W]=!0),T(U,"2dMap")&&(B[W]=!0,B[Q]=!0),T(U,"oriented")){var ue=U.orientation==="h"?Q:W;O[ue]=!0}}}var se=E._subplots,he=se.xaxis,H=se.yaxis,$=v.simpleMap(he,c),J=v.simpleMap(H,c),X=$.concat(J),oe=x.background;he.length&&H.length&&(oe=v.coerce(S,E,t,"plot_bgcolor"));var ne=x.combine(oe,E.paper_bgcolor),j,ee,re,ce,be;function Ae(){var Ce=p[j]||[];be._traceIndices=Ce.map(function(Te){return Te.index}),be._annIndices=[],be._shapeIndices=[],be._selectionIndices=[],be._imgIndices=[],be._subplotsWith=[],be._counterAxes=[],be._name=be._attr=j,be._id=ee}function ze(Ce,Te){return v.coerce(ce,be,r,Ce,Te)}function Re(Ce,Te){return v.coerce2(ce,be,r,Ce,Te)}function We(Ce){return Ce==="x"?H:he}function it(Ce,Te){for(var Pe=Ce==="x"?$:J,at=[],yt=0;yt<Pe.length;yt++){var Tt=Pe[yt];Tt!==Te&&!(S[Tt]||{}).overlaying&&at.push(h(Tt))}return at}var ot={x:We("x"),y:We("y")},tt=ot.x.concat(ot.y),ut={},Me=[];function _e(){var Ce=ce.matches;m.test(Ce)&&tt.indexOf(Ce)===-1&&(ut[Ce]=ce.type,Me=Object.keys(ut))}var fe=M(S,E),Fe=A(fe);for(I=0;I<X.length;I++){j=X[I],ee=h(j),re=j.charAt(0),v.isPlainObject(S[j])||(S[j]={}),ce=S[j],be=e.newContainer(E,j,re+"axis"),Ae();var rt=re==="x"&&!f[j]&&u[j]||re==="y"&&!P[j]&&y[j],st=re==="y"&&(!L[j]&&z[j]||F[j]),Qe={hasMinor:!0,letter:re,font:E.font,outerTicks:B[j],showGrid:!O[j],data:p[j]||[],bgColor:ne,calendar:E.calendar,automargin:!0,visibleDflt:rt,reverseDflt:st,autotypenumbersDflt:b,splomStash:((E._splomAxes||{})[re]||{})[ee],noAutotickangles:re==="y"};ze("uirevision",E.uirevision),i(ce,be,ze,Qe),a(ce,be,ze,Qe,E);var Lt=Fe&&re===fe.charAt(0),kt=Re("spikecolor",Fe?be.color:void 0),qt=Re("spikethickness",Fe?1.5:void 0),Zt=Re("spikedash",Fe?"dot":void 0),Sr=Re("spikemode",Fe?"across":void 0),xr=Re("spikesnap"),jr=ze("showspikes",!!Lt||!!kt||!!qt||!!Zt||!!Sr||!!xr);jr||(delete be.spikecolor,delete be.spikethickness,delete be.spikedash,delete be.spikemode,delete be.spikesnap);var wr=c(ce.overlaying),Ir=[0,1];if(E[wr]!==void 0){var bt=c(E[wr].anchor);E[bt]!==void 0&&(Ir=E[bt].domain)}o(ce,be,ze,{letter:re,counterAxes:ot[re],overlayableAxes:it(re,j),grid:E.grid,overlayingDomain:Ir}),ze("title.standoff"),_e(),be._input=ce}for(I=0;I<Me.length;){ee=Me[I++],j=c(ee),re=j.charAt(0),v.isPlainObject(S[j])||(S[j]={}),ce=S[j],be=e.newContainer(E,j,re+"axis"),Ae();var Be={letter:re,font:E.font,outerTicks:B[j],showGrid:!O[j],data:[],bgColor:ne,calendar:E.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:b,splomStash:((E._splomAxes||{})[re]||{})[ee]};ze("uirevision",E.uirevision),be.type=ut[ee]||"linear",a(ce,be,ze,Be,E),o(ce,be,ze,{letter:re,counterAxes:ot[re],overlayableAxes:it(re,j),grid:E.grid}),ze("fixedrange"),ze("modebardisable"),_e(),be._input=ce}var Ke=l("rangeslider","handleDefaults"),Ue=l("rangeselector","handleDefaults");for(I=0;I<$.length;I++)j=$[I],ce=S[j],be=E[j],Ke(S,E,j),be.type==="date"&&Ue(ce,be,E,J,be.calendar),ze("fixedrange"),ze("modebardisable");for(I=0;I<J.length;I++){j=J[I],ce=S[j],be=E[j];var Ee=E[c(be.anchor)],Ve=l("rangeslider","isVisible")(Ee);ze("fixedrange",Ve),ze("modebardisable")}n.handleDefaults(S,E,{axIds:tt.concat(Me).sort(s.idSort),axHasImage:F})}}}),JO=Ze({"src/plots/cartesian/transition_axes.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=ca(),M=as(),e=Wo();q.exports=function(r,i,a,n){var o=r._fullLayout;if(i.length===0){e.redrawComponents(r);return}function s(E){var g=E.xaxis,b=E.yaxis;o._defs.select("#"+E.clipId+"> 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;g<i.length;g++){var b=i[g],p=b.plotinfo.xaxis,u=b.plotinfo.yaxis;b.xr1&&(E[p._name+".range"]=b.xr1.slice()),b.yr1&&(E[u._name+".range"]=b.yr1.slice())}return h&&h(),x.call("relayout",r,E).then(function(){for(var y=0;y<i.length;y++)s(i[y].plotinfo)})}function d(){for(var E={},g=0;g<i.length;g++){var b=i[g],p=b.plotinfo.xaxis,u=b.plotinfo.yaxis;b.xr0&&(E[p._name+".range"]=b.xr0.slice()),b.yr0&&(E[u._name+".range"]=b.yr0.slice())}return x.call("relayout",r,E).then(function(){for(var y=0;y<i.length;y++)s(i[y].plotinfo)})}var T,l,_,w=v.ease(a.easing);r._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(_),_=null,d()});function S(){l=Date.now();for(var E=Math.min(1,(l-T)/a.duration),g=w(E),b=0;b<i.length;b++)c(i[b],g);l-T>a.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;u<g.length;u++){var P=g[u].split("y");b[P[0]]=1,p["y"+P[1]]=1}for(u=0;u<w.length;u++)y=w[u],b[y]||(f=(T[t.id2name(y)]||{}).anchor,r.idRegex.y.test(f)||(f="y"),E.push(y+f),g.push(y+f),p[f]||(p[f]=1,x.pushUnique(S,f)));for(u=0;u<S.length;u++)f=S[u],p[f]||(y=(T[t.id2name(f)]||{}).anchor,r.idRegex.x.test(y)||(y="x"),E.push(y+f),g.push(y+f),b[y]||(b[y]=1,x.pushUnique(w,y)));if(!g.length){y="",f="";for(var L in T)if(r.attrRegex.test(L)){var z=L.charAt(0);z==="x"?(!y||+L.substr(5)<+y.substr(5))&&(y=L):(!f||+L.substr(5)<+f.substr(5))&&(f=L)}y=y?t.name2id(y):"x",f=f?t.name2id(f):"y",w.push(y),S.push(f),E.push(y+f)}},Z.plot=function(T,l,_,w){var S=T._fullLayout,E=S._subplots.cartesian,g=T.calcdata,b;if(!Array.isArray(l))for(l=[],b=0;b<g.length;b++)l.push(b);for(var p=S._zindices,u=0;u<p.length;u++){var y=p[u];for(b=0;b<E.length;b++){var f=E[b],P=S._plots[f];if(u>0){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;B<g.length;B++){var O=g[B],I=O[0].trace;y===(I.zorder||0)&&I.xaxis+I.yaxis===f&&((l.indexOf(I.index)!==-1||I.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===f&&["tonextx","tonexty","tonext"].indexOf(I.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(O)),F=O)}s(T,P,z,_,w)}}};function s(T,l,_,w,S){for(var E=r.traceLayerClasses,g=T._fullLayout,b=g._zindices,p=g._modules,u,y,f,P=[],L=[],z=0;z<b.length;z++)for(var F=b[z],B=0;B<p.length;B++){u=p[B];var O=u.name,I=v.modules[O].categories;if(I.svg){var N=u.layerName||O+"layer",U=N+(z?Number(z)+1:""),W=u.plot;y=e(_,W,F),f=y[0],_=y[1],f.length&&P.push({i:E.indexOf(N),zindex:z,className:U,plotMethod:W,cdModule:f}),I.zoomScale&&L.push("."+U)}}P.sort(function(se,he){return(se.zindex||0)-(he.zindex||0)||se.i-he.i});var Q=l.plot.selectAll("g.mlayer").data(P,function(se){return se.className});if(Q.enter().append("g").attr("class",function(se){return se.className}).classed("mlayer",!0).classed("rangeplot",l.isRangePlot),Q.exit().remove(),Q.order(),Q.each(function(se){var he=q.select(this),H=se.className;se.plotMethod(T,l,se.cdModule,he,w,S),r.clipOnAxisFalseQuery.indexOf("."+H)===-1&&M.setClipUrl(he,l.layerClipId,T)}),g._has("scattergl")&&(u=v.getModule("scattergl"),f=e(_,u)[0],u.plot(T,l,f)),!T._context.staticPlot&&(l._hasClipOnAxisFalse&&(l.clipOnAxisFalseTraces=l.plot.selectAll(r.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),L.length)){var ue=l.plot.selectAll(L.join(",")).selectAll(".trace");l.zoomScalePts=ue.selectAll("path.point"),l.zoomScaleTxt=ue.selectAll(".textpoint")}}Z.clean=function(T,l,_,w){var S=w._plots||{},E=l._plots||{},g=w._subplots||{},b,p,u;if(w._hasOnlyLargeSploms&&!l._hasOnlyLargeSploms)for(u in S)b=S[u],b.plotgroup&&b.plotgroup.remove();var y=w._has&&w._has("gl"),f=l._has&&l._has("gl");if(y&&!f)for(u in S)b=S[u],b._scene&&b._scene.destroy();if(g.xaxis&&g.yaxis){var P=t.listIds({_fullLayout:w});for(p=0;p<P.length;p++){var L=P[p];l[t.id2name(L)]||w._infolayer.selectAll(".g-"+L+"title").remove()}}var z=w._has&&w._has("cartesian"),F=l._has&&l._has("cartesian");if(z&&!F)m(w._cartesianlayer.selectAll(".subplot"),w),w._defs.selectAll(".axesclip").remove(),delete w._axisConstraintGroups,delete w._axisMatchGroups;else if(g.cartesian)for(p=0;p<g.cartesian.length;p++){var B=g.cartesian[p];if(B.indexOf(o)===-1&&!E[B]){var O="."+B+",."+B+"-x,."+B+"-y";w._cartesianlayer.selectAll(O).remove(),d(B,w)}}},Z.drawFramework=function(T){var l=T._fullLayout,_=T.calcdata,w,S={};for(w=0;w<_.length;w++){var E=_[w][0],g=E.trace,b=g.zorder||0;S[b]||(S[b]=[]),S[b].push(E)}var p=Object.keys(S).map(Number).sort(x.sorterAsc);p.length||(p=[0]),l._zindices=p;var u=c(T),y=u.length,f=[];for(w=0;w<y;w++)f[w]=u[w].slice();for(var P=1;P<p.length;P++){var L=[];for(w=0;w<y;w++)L[w]=u[w].slice(),L[w][0]+=o+(P+1);f=f.concat(L)}var z=l._cartesianlayer.selectAll(".subplot").data(f,String);z.enter().append("g").attr("class",function(F){return"subplot "+F[0]}),z.order(),z.exit().call(m,l),z.each(function(F){var B=F[0],O=B.indexOf(o),I=O!==-1,N=I?B.slice(0,O):B,U=l._plots[B];U||(U=x.extendFlat({},l._plots[N]),U&&(U.id=B,l._plots[B]=U,l._subplots.cartesian.push(B))),U&&(U.plotgroup=q.select(this),h(T,U),I||(U.draglayer=a(l._draggers,"g",B)))})},Z.rangePlot=function(T,l,_){h(T,l),s(T,l,_),A.style(T)};function c(T){var l=T._fullLayout,_=l._zindices.length,w=l._subplots.cartesian,S=w.length,E,g,b,p,u,y,f=[],P=[];for(E=0;E<S;E++){b=w[E],p=l._plots[b],u=p.xaxis,y=p.yaxis;var L=u._mainAxis,z=y._mainAxis,F=L._id+z._id,B=l._plots[F];p.overlays=[],F!==b&&B?(p.mainplot=F,p.mainplotinfo=B,P.push(b)):(p.mainplot=void 0,p.mainplotinfo=void 0,f.push(b))}for(E=0;E<P.length;E++)b=P[E],p=l._plots[b],p.mainplotinfo.overlays.push(p);var O=f.concat(P),I=[];for(E=0;E<S;E++){b=O[E],p=l._plots[b],u=p.xaxis,y=p.yaxis;for(var N=[],U=1;U<=_;U++){var W="";for(U>1&&(W+=o+U),N.push(b+W),g=0;g<p.overlays.length;g++)N.push(p.overlays[g].id+W)}N=N.concat([u.layer,y.layer,u.overlaying||"",y.overlaying||""]),I.push(N)}return I}function h(T,l){var _=T._fullLayout,w=l.plotgroup,S=l.id,E=S.indexOf(o),g=E!==-1,b=r.layerValue2layerClass[l.xaxis.layer],p=r.layerValue2layerClass[l.yaxis.layer],u=_._hasOnlyLargeSploms,y=_._zindices.length>1,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<E.length;g++){var b=E[g];_[b.id]&&b.plot.selectAll(".trace").remove()}}}function d(T,l){l._draggers.selectAll("g."+T).remove(),l._defs.select("#clip"+l._uid+T+"plot").remove()}Z.toSVG=function(T){var l=T._fullLayout._glimages,_=q.select(T).selectAll(".svg-container"),w=_.filter(function(E,g){return g===_.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function S(){var E=this,g=E.toDataURL("image/png"),b=l.append("svg:image");b.attr({xmlns:i.svg,"xlink:href":g,preserveAspectRatio:"none",x:0,y:0,width:E.style.width,height:E.style.height})}w.each(S)},Z.updateFx=PS().updateFx}}),$O=Ze({"src/traces/scatter/index.js"(Z,q){"use strict";var v=Fu();q.exports={hasLines:v.hasLines,hasMarkers:v.hasMarkers,hasText:v.hasText,isBubble:v.isBubble,attributes:tf(),layoutAttributes:y2(),supplyDefaults:HO(),crossTraceDefaults:DS(),supplyLayoutDefaults:WO(),calc:Bd().calc,crossTraceCalc:ZO(),arraysToCalcdata:Av(),plot:s1(),colorbar:hp(),formatLabels:P2(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:u1(),selectPoints:c1(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Zf(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}}),QO=Ze({"src/components/annotations/draw_arrow_head.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=CS(),M=ca(),e=M.strScale,t=M.strRotate,r=M.strTranslate;q.exports=function(a,n,o){var s=a.node(),c=A[o.arrowhead||0],h=A[o.startarrowhead||0],m=(o.arrowwidth||1)*(o.arrowsize||1),d=(o.arrowwidth||1)*(o.startarrowsize||1),T=n.indexOf("start")>=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;S<w.annotations.length;S++)w.annotations[S].visible&&d(_,S);return A.previousPromises(_)}function d(_,w){var S=_._fullLayout,E=S.annotations[w]||{},g=t.getFromId(_,E.xref),b=t.getFromId(_,E.yref);g&&g.setScale(),b&&b.setScale(),l(_,E,w,!1,g,b)}function T(_,w,S,E,g){var b=g[S],p=g[S+"ref"],u=S.indexOf("y")!==-1,y=t.getRefType(p)==="domain",f=u?E.h:E.w;return _?y?b+(u?-w:w)/_._length:_.p2r(_.r2p(b)+w):b+(u?-w:w)/f}function l(_,w,S,E,g,b){var p=_._fullLayout,u=_._fullLayout._size,y=_._context.edits,f,P;E?(f="annotation-"+E,P=E+".annotations"):(f="annotation",P="annotations");var L=c(_.layout,P,w),z=L.modifyBase,F=L.modifyItem,B=L.getUpdateObj;p._infolayer.selectAll("."+f+'[data-index="'+S+'"]').remove();var O="clip"+p._uid+"_ann"+S;if(!w._input||w.visible===!1){v.selectAll("#"+O).remove();return}var I={x:{},y:{}},N=+w.textangle||0,U=p._infolayer.append("g").classed(f,!0).attr("data-index",String(S)).style("opacity",w.opacity),W=U.append("g").classed("annotation-text-g",!0),Q=y[w.showarrow?"annotationTail":"annotationPosition"],ue=w.captureevents||y.annotationText||Q;function se(Ae){var ze={index:S,annotation:w._input,fullAnnotation:w,event:Ae};return E&&(ze.subplotId=E),ze}var he=W.append("g").style("pointer-events",ue?"all":null).call(o,"pointer").on("click",function(){_._dragging=!1,_.emit("plotly_clickannotation",se(v.event))});w.hovertext&&he.on("mouseover",function(){var Ae=w.hoverlabel,ze=Ae.font,Re=this.getBoundingClientRect(),We=_.getBoundingClientRect();a.loneHover({x0:Re.left-We.left,x1:Re.right-We.left,y:(Re.top+Re.bottom)/2-We.top,text:w.hovertext,color:Ae.bgcolor,borderColor:Ae.bordercolor,fontFamily:ze.family,fontSize:ze.size,fontColor:ze.color,fontWeight:ze.weight,fontStyle:ze.style,fontVariant:ze.variant,fontShadow:ze.fontShadow,fontLineposition:ze.fontLineposition,fontTextcase:ze.fontTextcase},{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:_})}).on("mouseout",function(){a.loneUnhover(p._hoverlayer.node())});var H=w.borderwidth,$=w.borderpad,J=H+$,X=he.append("rect").attr("class","bg").style("stroke-width",H+"px").call(r.stroke,w.bordercolor).call(r.fill,w.bgcolor),oe=w.width||w.height,ne=p._topclips.selectAll("#"+O).data(oe?[0]:[]);ne.enter().append("clipPath").classed("annclip",!0).attr("id",O).append("rect"),ne.exit().remove();var j=w.font,ee=p._meta?M.templateString(w.text,p._meta):w.text,re=he.append("text").classed("annotation-text",!0).text(ee);function ce(Ae){return Ae.call(i.font,j).attr({"text-anchor":{left:"start",right:"end"}[w.align]||"middle"}),n.convertToTspans(Ae,_,be),Ae}function be(){var Ae=re.selectAll("a");if(Ae.size()===1&&Ae.text()===re.text()){var ze=he.insert("a",":first-child").attr({"xlink:xlink:href":Ae.attr("xlink:href"),"xlink:xlink:show":Ae.attr("xlink:show")}).style({cursor:"pointer"});ze.node().appendChild(X.node())}var Re=he.select(".annotation-text-math-group"),We=!Re.empty(),it=i.bBox((We?Re:re).node()),ot=it.width,tt=it.height,ut=w.width||ot,Me=w.height||tt,_e=Math.round(ut+2*J),fe=Math.round(Me+2*J);function Fe(Qa,za){return za==="auto"&&(Qa<1/3?za="left":Qa>2/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;Qe<st.length;Qe++){var Lt=st[Qe],kt=w[Lt+"ref"]||Lt,qt=w["a"+Lt+"ref"],Zt={x:g,y:b}[Lt],Sr=(N+(Lt==="x"?0:-90))*Math.PI/180,xr=_e*Math.cos(Sr),jr=fe*Math.sin(Sr),wr=Math.abs(xr)+Math.abs(jr),Ir=w[Lt+"anchor"],bt=w[Lt+"shift"]*(Lt==="x"?1:-1),Be=I[Lt],Ke,Ue,Ee,Ve,Ce,Te=t.getRefType(kt);if(Zt&&Te!=="domain"){var Pe=Zt.r2fraction(w[Lt]);(Pe<0||Pe>1)&&(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;m<o.length;m++)d=A(i.layout,"annotations",h[o[m]]),d.modifyItem("visible",!0),v.extendFlat(c,d.getUpdateObj());for(m=0;m<s.length;m++)d=A(i.layout,"annotations",h[s[m]]),d.modifyItem("visible",!1),v.extendFlat(c,d.getUpdateObj());return x.call("update",i,{},c)}}function t(i,a){var n=i._fullLayout.annotations,o=[],s=[],c=[],h=(a||[]).length,m,d,T,l,_,w,S,E;for(m=0;m<n.length;m++)if(T=n[m],l=T.clicktoshow,l){for(d=0;d<h;d++)if(_=a[d],w=_.xaxis,S=_.yaxis,w._id===T.xref&&S._id===T.yref&&w.d2r(_.x)===r(T._xclick,w)&&S.d2r(_.y)===r(T._yclick,S)){T.visible?l==="onout"?E=s:E=c:E=o,E.push(m);break}d===h&&T.visible&&l==="onout"&&s.push(m)}return{on:o,off:s,explicitOff:c}}function r(i,a){return a.type==="log"?a.l2r(i):a.d2r(i)}}}),BS=Ze({"src/components/annotations/common_defaults.js"(Z,q){"use strict";var v=ca(),x=Yi();q.exports=function(M,e,t,r){r("opacity");var i=r("bgcolor"),a=r("bordercolor"),n=x.opacity(a);r("borderpad");var o=r("borderwidth"),s=r("showarrow");r("text",s?" ":t._dfltTitle.annotation),r("textangle"),v.coerceFont(r,"font",t.font),r("width"),r("align");var c=r("height");if(c&&r("valign"),s){var h=r("arrowside"),m,d;h.indexOf("end")!==-1&&(m=r("arrowhead"),d=r("arrowsize")),h.indexOf("start")!==-1&&(r("startarrowhead",m),r("startarrowsize",d)),r("arrowcolor",n?e.bordercolor:x.defaultLine),r("arrowwidth",(n&&o||1)*2),r("standoff"),r("startstandoff")}var T=r("hovertext"),l=t.hoverlabel||{};if(T){var _=r("hoverlabel.bgcolor",l.bgcolor||(x.opacity(i)?x.rgb(i):x.defaultLine)),w=r("hoverlabel.bordercolor",l.bordercolor||x.contrast(_)),S=v.extendFlat({},l.font);S.color||(S.color=w),v.coerceFont(r,"hoverlabel.font",S)}r("captureevents",!!T)}}}),tB=Ze({"src/components/annotations/defaults.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fp(),M=BS(),e=Kg();q.exports=function(i,a){A(i,a,{name:"annotations",handleItemDefaults:t})};function t(r,i,a){function n(u,y){return v.coerce(r,i,e,u,y)}var o=n("visible"),s=n("clicktoshow");if(o||s){M(r,i,a,n);for(var c=i.showarrow,h=["x","y"],m=[-10,-30],d={_fullLayout:a},T=0;T<2;T++){var l=h[T],_=x.coerceRef(r,i,d,l,"","paper");if(_!=="paper"){var w=x.getFromId(d,_);w._annIndices.push(i._index)}if(x.coercePosition(i,d,n,_,l,.5),c){var S="a"+l,E=x.coerceRef(r,i,d,S,"pixel",["pixel","paper"]);E!=="pixel"&&E!==_&&(E=i[S]="pixel");var g=E==="pixel"?m[T]:.4;x.coercePosition(i,d,n,E,S,g)}n(l+"anchor"),n(l+"shift")}if(v.noneOrAll(r,i,["x","y"]),c&&v.noneOrAll(r,i,["ax","ay"]),s){var b=n("xclick"),p=n("yclick");i._xclick=b===void 0?i.x:x.cleanPosition(b,d,i.xref),i._yclick=p===void 0?i.y:x.cleanPosition(p,d,i.yref)}}}}}),rB=Ze({"src/components/annotations/calc_autorange.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=D2().draw;q.exports=function(r){var i=r._fullLayout,a=v.filterVisible(i.annotations);if(a.length&&r._fullData.length)return v.syncOrAsync([A,M],r)};function M(t){var r=t._fullLayout;v.filterVisible(r.annotations).forEach(function(i){var a=x.getFromId(t,i.xref),n=x.getFromId(t,i.yref),o=x.getRefType(i.xref),s=x.getRefType(i.yref);i._extremes={},o==="range"&&e(i,a),s==="range"&&e(i,n)})}function e(t,r){var i=r._id,a=i.charAt(0),n=t[a],o=t["a"+a],s=t[a+"ref"],c=t["a"+a+"ref"],h=t["_"+a+"padplus"],m=t["_"+a+"padminus"],d={x:1,y:-1}[a]*t[a+"shift"],T=3*t.arrowsize*t.arrowwidth||0,l=T+d,_=T-d,w=3*t.startarrowsize*t.arrowwidth||0,S=w+d,E=w-d,g;if(c===s){var b=x.findExtremes(r,[r.r2c(n)],{ppadplus:l,ppadminus:_}),p=x.findExtremes(r,[r.r2c(o)],{ppadplus:Math.max(h,S),ppadminus:Math.max(m,E)});g={min:[b.min[0],p.min[0]],max:[b.max[0],p.max[0]]}}else S=o?S+o:S,E=o?E-o:E,g=x.findExtremes(r,[r.r2c(n)],{ppadplus:Math.max(h,l,S),ppadminus:Math.max(m,_,E)});t._extremes[i]=g}}}),aB=Ze({"src/components/annotations/convert_coords.js"(Z,q){"use strict";var v=is(),x=f2();q.exports=function(M,e,t,r){e=e||{};var i=t==="log"&&e.type==="linear",a=t==="linear"&&e.type==="log";if(!(i||a))return;var n=M._fullLayout.annotations,o=e._id.charAt(0),s,c;function h(d){var T=s[d],l=null;i?l=x(T,e.range):l=Math.pow(10,T),v(l)||(l=null),r(c+d,l)}for(var m=0;m<n.length;m++)s=n[m],c="annotations["+m+"].",s[o+"ref"]===e._id&&h(o),s["a"+o+"ref"]===e._id&&h("a"+o)}}}),nB=Ze({"src/components/annotations/index.js"(Z,q){"use strict";var v=D2(),x=eB();q.exports={moduleType:"component",name:"annotations",layoutAttributes:Kg(),supplyLayoutDefaults:tB(),includeBasePlot:R_()("annotations"),calcAutorange:rB(),draw:v.draw,drawOne:v.drawOne,drawRaw:v.drawRaw,hasClickToShow:x.hasClickToShow,onClick:x.onClick,convertCoords:aB()}}}),z2=Ze({"src/components/annotations3d/attributes.js"(Z,q){"use strict";var v=Kg(),x=pc().overrideAll,A=Dl().templatedArray;q.exports=x(A("annotation",{visible:v.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:v.xanchor,xshift:v.xshift,yanchor:v.yanchor,yshift:v.yshift,text:v.text,textangle:v.textangle,font:v.font,width:v.width,height:v.height,opacity:v.opacity,align:v.align,valign:v.valign,bgcolor:v.bgcolor,bordercolor:v.bordercolor,borderpad:v.borderpad,borderwidth:v.borderwidth,showarrow:v.showarrow,arrowcolor:v.arrowcolor,arrowhead:v.arrowhead,startarrowhead:v.startarrowhead,arrowside:v.arrowside,arrowsize:v.arrowsize,startarrowsize:v.startarrowsize,arrowwidth:v.arrowwidth,standoff:v.standoff,startstandoff:v.startstandoff,hovertext:v.hovertext,hoverlabel:v.hoverlabel,captureevents:v.captureevents}),"calc","from-root")}}),iB=Ze({"src/components/annotations3d/defaults.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fp(),M=BS(),e=z2();q.exports=function(i,a,n){A(i,a,{name:"annotations",handleItemDefaults:t,fullLayout:n.fullLayout})};function t(r,i,a,n){function o(h,m){return v.coerce(r,i,e,h,m)}function s(h){var m=h+"axis",d={_fullLayout:{}};return d._fullLayout[m]=a[m],x.coercePosition(i,d,o,h,h,.5)}var c=o("visible");c&&(M(r,i,n.fullLayout,o),s("x"),s("y"),s("z"),v.noneOrAll(r,i,["x","y","z"]),i.xref="x",i.yref="y",i.zref="z",o("xanchor"),o("yanchor"),o("xshift"),o("yshift"),i.showarrow&&(i.axref="pixel",i.ayref="pixel",o("ax",-10),o("ay",-30),v.noneOrAll(r,i,["ax","ay"])))}}}),oB=Ze({"src/components/annotations3d/convert.js"(Z,q){"use strict";var v=ca(),x=Wo();q.exports=function(e){for(var t=e.fullSceneLayout,r=t.annotations,i=0;i<r.length;i++)A(r[i],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()};function A(M,e){var t=e.fullSceneLayout,r=t.domain,i=e.fullLayout._size,a={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};M._xa={},v.extendFlat(M._xa,a),x.setConvert(M._xa),M._xa._offset=i.l+r.x[0]*i.w,M._xa.l2p=function(){return .5*(1+M._pdata[0]/M._pdata[3])*i.w*(r.x[1]-r.x[0])},M._ya={},v.extendFlat(M._ya,a),x.setConvert(M._ya),M._ya._offset=i.t+(1-r.y[1])*i.h,M._ya.l2p=function(){return .5*(1-M._pdata[1]/M._pdata[3])*i.h*(r.y[1]-r.y[0])}}}}),NS=Ze({"src/plots/gl3d/project.js"(Z,q){"use strict";function v(A,M){var e=[0,0,0,0],t,r;for(t=0;t<4;++t)for(r=0;r<4;++r)e[r]+=A[4*t+r]*M[t];return e}function x(A,M){var e=v(A.projection,v(A.view,v(A.model,[M[0],M[1],M[2],1])));return e}q.exports=x}}),sB=Ze({"src/components/annotations3d/draw.js"(Z,q){"use strict";var v=D2().drawRaw,x=NS(),A=["x","y","z"];q.exports=function(e){for(var t=e.fullSceneLayout,r=e.dataScale,i=t.annotations,a=0;a<i.length;a++){for(var n=i[a],o=!1,s=0;s<3;s++){var c=A[s],h=n[c],m=t[c+"axis"],d=m.r2fraction(h);if(d<0||d>1){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;a<i.length;a++){var n=i[a];r.test(n)&&(M[n].annotations||[]).length&&(x.pushUnique(e._basePlotModules,t),x.pushUnique(e._subplots.gl3d,n))}}}}),US=Ze({"src/components/shapes/attributes.js"(Z,q){"use strict";var v=Kg(),x=tc(),A=tf().line,M=Gh().dash,e=rs().extendFlat,t=Dl().templatedArray,r=I_(),i=eu(),a=Cs().shapeTexttemplateAttrs,n=d2();q.exports=t("shape",{visible:e({},i.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:e({},i.legend,{editType:"calc+arraydraw"}),legendgroup:e({},i.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:e({},i.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:x({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:e({},i.legendrank,{editType:"calc+arraydraw"}),legendwidth:e({},i.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:e({},v.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:e({},v.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:e({},A.color,{editType:"arraydraw"}),width:e({},A.width,{editType:"calc+arraydraw"}),dash:e({},M,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:a({},{keys:Object.keys(n)}),font:x({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}}),uB=Ze({"src/components/shapes/defaults.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=fp(),M=US(),e=rg();q.exports=function(a,n){A(a,n,{name:"shapes",handleItemDefaults:r})};function t(i,a){return i?"bottom":a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle"}function r(i,a,n){function o(H,$){return v.coerce(i,a,M,H,$)}a._isShape=!0;var s=o("visible");if(s){var c=o("showlegend");c&&(o("legend"),o("legendwidth"),o("legendgroup"),o("legendgrouptitle.text"),v.coerceFont(o,"legendgrouptitle.font"),o("legendrank"));var h=o("path"),m=h?"path":"rect",d=o("type",m),T=d!=="path";T&&delete a.path,o("editable"),o("layer"),o("opacity"),o("fillcolor"),o("fillrule");var l=o("line.width");l&&(o("line.color"),o("line.dash"));for(var _=o("xsizemode"),w=o("ysizemode"),S=["x","y"],E=0;E<2;E++){var g=S[E],b=g+"anchor",p=g==="x"?_:w,u={_fullLayout:n},y,f,P,L=x.coerceRef(i,a,u,g,void 0,"paper"),z=x.getRefType(L);if(z==="range"?(y=x.getFromId(u,L),y._shapeIndices.push(a._index),P=e.rangeToShapePosition(y),f=e.shapePositionToRange(y),(y.type==="category"||y.type==="multicategory")&&(o(g+"0shift"),o(g+"1shift"))):f=P=v.identity,T){var F=.25,B=.75,O=g+"0",I=g+"1",N=i[O],U=i[I];i[O]=f(i[O],!0),i[I]=f(i[I],!0),p==="pixel"?(o(O,0),o(I,10)):(x.coercePosition(a,u,o,L,O,F),x.coercePosition(a,u,o,L,I,B)),a[O]=P(a[O]),a[I]=P(a[I]),i[O]=N,i[I]=U}if(p==="pixel"){var W=i[b];i[b]=f(i[b],!0),x.coercePosition(a,u,o,L,b,.25),a[b]=P(a[b]),i[b]=W}}T&&v.noneOrAll(i,a,["x0","x1","y0","y1"]);var Q=d==="line",ue,se;if(T&&(ue=o("label.texttemplate")),ue||(se=o("label.text")),se||ue){o("label.textangle");var he=o("label.textposition",Q?"middle":"middle center");o("label.xanchor"),o("label.yanchor",t(Q,he)),o("label.padding"),v.coerceFont(o,"label.font",n.font)}}}}}),cB=Ze({"src/components/shapes/draw_newshape/defaults.js"(Z,q){"use strict";var v=Yi(),x=ca();function A(M,e){return M?"bottom":e.indexOf("top")!==-1?"top":e.indexOf("bottom")!==-1?"bottom":"middle"}q.exports=function(e,t,r){r("newshape.visible"),r("newshape.name"),r("newshape.showlegend"),r("newshape.legend"),r("newshape.legendwidth"),r("newshape.legendgroup"),r("newshape.legendgrouptitle.text"),x.coerceFont(r,"newshape.legendgrouptitle.font"),r("newshape.legendrank"),r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity");var i=r("newshape.line.width");if(i){var a=(e||{}).plot_bgcolor||"#FFF";r("newshape.line.color",v.contrast(a)),r("newshape.line.dash")}var n=e.dragmode==="drawline",o=r("newshape.label.text"),s=r("newshape.label.texttemplate");if(o||s){r("newshape.label.textangle");var c=r("newshape.label.textposition",n?"middle":"middle center");r("newshape.label.xanchor"),r("newshape.label.yanchor",A(n,c)),r("newshape.label.padding"),x.coerceFont(r,"newshape.label.font",t.font)}r("activeshape.fillcolor"),r("activeshape.opacity")}}}),fB=Ze({"src/components/shapes/calc_autorange.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=k_(),M=rg();q.exports=function(n){var o=n._fullLayout,s=v.filterVisible(o.shapes);if(!(!s.length||!n._fullData.length))for(var c=0;c<s.length;c++){var h=s[c];h._extremes={};var m,d,T=x.getRefType(h.xref),l=x.getRefType(h.yref);h.xref!=="paper"&&T!=="domain"&&(m=x.getFromId(n,h.xref),d=i(m,h,A.paramIsX),d&&(h._extremes[m._id]=x.findExtremes(m,d,e(h)))),h.yref!=="paper"&&l!=="domain"&&(m=x.getFromId(n,h.yref),d=i(m,h,A.paramIsY),d&&(h._extremes[m._id]=x.findExtremes(m,d,t(h))))}};function e(a){return r(a.line.width,a.xsizemode,a.x0,a.x1,a.path,!1)}function t(a){return r(a.line.width,a.ysizemode,a.y0,a.y1,a.path,!0)}function r(a,n,o,s,c,h){var m=a/2,d=h;if(n==="pixel"){var T=c?M.extractPathCoords(c,h?A.paramIsY:A.paramIsX):[o,s],l=v.aggNums(Math.max,null,T),_=v.aggNums(Math.min,null,T),w=_<0?Math.abs(_)+m:m,S=l>0?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;g<E.length;g++)b=E[g],p=o[b.charAt(0)].drawn,p!==void 0&&(u=E[g].substr(1).match(A.paramRE),!(!u||u.length<p)&&(y=l(u[p]),y<w&&(w=y),y>S&&(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;c<i.images.length;c++){var h=i.images[c];if(h.visible)if(h.layer==="below"&&h.xref!=="paper"&&h.yref!=="paper"){s=M.ref2id(h.xref)+M.ref2id(h.yref);var m=i._plots[s];if(!m){o.push(h);continue}m.mainplot&&(s=m.mainplot.id),n[s]||(n[s]=[]),n[s].push(h)}else h.layer==="above"?a.push(h):o.push(h)}var d={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-1/2},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-1/2},bottom:{sizing:"YMax",offset:-1}}};function T(u){var y=v.select(this);if(this._imgSrc!==u.source)if(y.attr("xmlns",e.svg),!r._context.staticPlot||u.source&&u.source.slice(0,5)==="data:")y.attr("xlink:href",u.source),this._imgSrc=u.source;else{var f=new Promise(function(P){var L=new Image;this.img=L,L.setAttribute("crossOrigin","anonymous"),L.onerror=z,L.onload=function(){var F=document.createElement("canvas");F.width=this.width,F.height=this.height;var B=F.getContext("2d",{willReadFrequently:!0});B.drawImage(this,0,0);var O=F.toDataURL("image/png");y.attr("xlink:href",O),P()},y.on("error",z),L.src=u.source,this._imgSrc=u.source;function z(){y.remove(),P()}}.bind(this));r._promises.push(f)}}function l(u){var y=v.select(this),f=A.getFromId(r,u.xref),P=A.getFromId(r,u.yref),L=A.getRefType(u.xref)==="domain",z=A.getRefType(u.yref)==="domain",F=i._size,B,O;f!==void 0?B=typeof u.xref=="string"&&L?f._length*u.sizex:Math.abs(f.l2p(u.sizex)-f.l2p(0)):B=u.sizex*F.w,P!==void 0?O=typeof u.yref=="string"&&z?P._length*u.sizey:Math.abs(P.l2p(u.sizey)-P.l2p(0)):O=u.sizey*F.h;var I=B*d.x[u.xanchor].offset,N=O*d.y[u.yanchor].offset,U=d.x[u.xanchor].sizing+d.y[u.yanchor].sizing,W,Q;switch(f!==void 0?W=typeof u.xref=="string"&&L?f._length*u.x+f._offset:f.r2p(u.x)+f._offset:W=u.x*F.w+F.l,W+=I,P!==void 0?Q=typeof u.yref=="string"&&z?P._length*(1-u.y)+P._offset:P.r2p(u.y)+P._offset:Q=F.h-u.y*F.h+F.t,Q+=N,u.sizing){case"fill":U+=" slice";break;case"stretch":U="none";break}y.attr({x:W,y:Q,width:B,height:O,preserveAspectRatio:U,opacity:u.opacity});var ue=f&&A.getRefType(u.xref)!=="domain"?f._id:"",se=P&&A.getRefType(u.yref)!=="domain"?P._id:"",he=ue+se;x.setClipUrl(y,he?"clip"+i._uid+he:null,r)}function _(u){return[u.xref,u.x,u.sizex,u.yref,u.y,u.sizey].join("_")}function w(u,y){return u._index-y._index}var S=i._imageLowerLayer.selectAll("image").data(o,_),E=i._imageUpperLayer.selectAll("image").data(a,_);S.enter().append("image"),E.enter().append("image"),S.exit().remove(),E.exit().remove(),S.each(function(u){T.bind(this)(u),l.bind(this)(u)}),E.each(function(u){T.bind(this)(u),l.bind(this)(u)}),S.sort(w),E.sort(w);var g=Object.keys(i._plots);for(c=0;c<g.length;c++){s=g[c];var b=i._plots[s];if(b.imagelayer){var p=b.imagelayer.selectAll("image").data(n[s]||[],_);p.enter().append("image"),p.exit().remove(),p.each(function(u){T.bind(this)(u),l.bind(this)(u)}),p.sort(w)}}}}}),vB=Ze({"src/components/images/convert_coords.js"(Z,q){"use strict";var v=is(),x=f2();q.exports=function(M,e,t,r){e=e||{};var i=t==="log"&&e.type==="linear",a=t==="linear"&&e.type==="log";if(i||a){for(var n=M._fullLayout.images,o=e._id.charAt(0),s,c,h=0;h<n.length;h++)if(s=n[h],c="images["+h+"].",s[o+"ref"]===e._id){var m=s[o],d=s["size"+o],T=null,l=null;if(i){T=x(m,e.range);var _=d/Math.pow(10,T)/2;l=2*Math.log(_+Math.sqrt(1+_*_))/Math.LN10}else T=Math.pow(10,m),l=T*(Math.pow(10,d/2)-Math.pow(10,-d/2));v(T)?v(l)||(l=null):(T=null,l=null),r(c+o,T),r(c+"size"+o,l)}}}}}),mB=Ze({"src/components/images/index.js"(Z,q){"use strict";q.exports={moduleType:"component",name:"images",layoutAttributes:jS(),supplyLayoutDefaults:pB(),includeBasePlot:R_()("images"),draw:dB(),convertCoords:vB()}}}),F2=Ze({"src/components/updatemenus/constants.js"(Z,q){"use strict";q.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25C4",right:"\u25BA",up:"\u25B2",down:"\u25BC"}}}}),VS=Ze({"src/components/updatemenus/attributes.js"(Z,q){"use strict";var v=tc(),x=oh(),A=rs().extendFlat,M=pc().overrideAll,e=v2(),t=Dl().templatedArray,r=t("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});q.exports=M(t("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:r,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:A(e({editType:"arraydraw"}),{}),font:v({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:x.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}}),gB=Ze({"src/components/updatemenus/defaults.js"(Z,q){"use strict";var v=ca(),x=fp(),A=VS(),M=F2(),e=M.name,t=A.buttons;q.exports=function(n,o){var s={name:e,handleItemDefaults:r};x(n,o,s)};function r(a,n,o){function s(m,d){return v.coerce(a,n,A,m,d)}var c=x(a,n,{name:"buttons",handleItemDefaults:i}),h=s("visible",c.length>0);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;U<F.length;U++){var W=F[U];p(L,W)}var Q="updatemenus"+z._uid,ue=new n(L,N,Q);I.enter().size()&&(N.node().parentNode.appendChild(N.node()),N.call(f)),I.exit().each(function(se){N.call(f),B(se)}).remove(),I.each(function(se){var he=v.select(this),H=se.type==="dropdown"?N:null;x.manageCommandObserver(L,se,se.buttons,function($){h(L,se,se.buttons[$.index],he,H,ue,$.index,!0)}),se.type==="dropdown"?(m(L,he,N,ue,se),c(N,se)&&d(L,he,N,ue,se)):d(L,he,null,null,se)})}};function o(P){return P._index}function s(P){return+P.attr(a.menuIndexAttrName)==-1}function c(P,L){return+P.attr(a.menuIndexAttrName)===L._index}function h(P,L,z,F,B,O,I,N){L.active=I,r(P.layout,a.name,L).applyUpdate("active",I),L.type==="buttons"?d(P,F,null,null,L):L.type==="dropdown"&&(B.attr(a.menuIndexAttrName,"-1"),m(P,F,B,O,L),N||d(P,F,B,O,L))}function m(P,L,z,F,B){var O=e.ensureSingle(L,"g",a.headerClassName,function(se){se.style("pointer-events","all")}),I=B._dims,N=B.active,U=B.buttons[N]||a.blankHeaderOpts,W={y:B.pad.t,yPad:0,x:B.pad.l,xPad:0,index:0},Q={width:I.headerWidth,height:I.headerHeight};O.call(_,B,U,P).call(y,B,W,Q);var ue=e.ensureSingle(L,"text",a.headerArrowClassName,function(se){se.attr("text-anchor","end").call(M.font,B.font).text(a.arrowSymbol[B.direction])});ue.attr({x:I.headerWidth-a.arrowOffsetX+B.pad.l,y:I.headerHeight/2+a.textOffsetY+B.pad.t}),O.on("click",function(){z.call(f,String(c(z,B)?-1:B._index)),d(P,L,z,F,B)}),O.on("mouseover",function(){O.call(g)}),O.on("mouseout",function(){O.call(b,B)}),M.setTranslate(L,I.lx,I.ly)}function d(P,L,z,F,B){z||(z=L,z.attr("pointer-events","all"));var O=!s(z)||B.type==="buttons"?B.buttons:[],I=B.type==="dropdown"?a.dropdownButtonClassName:a.buttonClassName,N=z.selectAll("g."+I).data(e.filterVisible(O)),U=N.enter().append("g").classed(I,!0),W=N.exit();B.type==="dropdown"?(U.attr("opacity","0").transition().attr("opacity","1"),W.transition().attr("opacity","0").remove()):W.remove();var Q=0,ue=0,se=B._dims,he=["up","down"].indexOf(B.direction)!==-1;B.type==="dropdown"&&(he?ue=se.headerHeight+a.gapButtonHeader:Q=se.headerWidth+a.gapButtonHeader),B.type==="dropdown"&&B.direction==="up"&&(ue=-a.gapButtonHeader+a.gapButton-se.openHeight),B.type==="dropdown"&&B.direction==="left"&&(Q=-a.gapButtonHeader+a.gapButton-se.openWidth);var H={x:se.lx+Q+B.pad.l,y:se.ly+ue+B.pad.t,yPad:a.gapButton,xPad:a.gapButton,index:0},$={l:H.x+B.borderwidth,t:H.y+B.borderwidth};N.each(function(J,X){var oe=v.select(this);oe.call(_,B,J,P).call(y,B,H),oe.on("click",function(){v.event.defaultPrevented||(J.execute&&(J.args2&&B.active===X?(h(P,B,J,L,z,F,-1),x.executeAPICommand(P,J.method,J.args2)):(h(P,B,J,L,z,F,X),x.executeAPICommand(P,J.method,J.args))),P.emit("plotly_buttonclicked",{menu:B,button:J,active:B.active}))}),oe.on("mouseover",function(){oe.call(g)}),oe.on("mouseout",function(){oe.call(b,B),N.call(E,B)})}),N.call(E,B),he?($.w=Math.max(se.openWidth,se.headerWidth),$.h=H.y-$.t):($.w=H.x-$.l,$.h=Math.max(se.openHeight,se.headerHeight)),$.direction=B.direction,F&&(N.size()?T(P,L,z,F,B,$):l(F))}function T(P,L,z,F,B,O){var I=B.direction,N=I==="up"||I==="down",U=B._dims,W=B.active,Q,ue,se;if(N)for(ue=0,se=0;se<W;se++)ue+=U.heights[se]+a.gapButton;else for(Q=0,se=0;se<W;se++)Q+=U.widths[se]+a.gapButton;F.enable(O,Q,ue),F.hbar&&F.hbar.attr("opacity","0").transition().attr("opacity","1"),F.vbar&&F.vbar.attr("opacity","0").transition().attr("opacity","1")}function l(P){var L=!!P.hbar,z=!!P.vbar;L&&P.hbar.transition().attr("opacity","0").each("end",function(){L=!1,z||P.disable()}),z&&P.vbar.transition().attr("opacity","0").each("end",function(){z=!1,L||P.disable()})}function _(P,L,z,F){P.call(w,L).call(S,L,z,F)}function w(P,L){var z=e.ensureSingle(P,"rect",a.itemRectClassName,function(F){F.attr({rx:a.rx,ry:a.ry,"shape-rendering":"crispEdges"})});z.call(A.stroke,L.bordercolor).call(A.fill,L.bgcolor).style("stroke-width",L.borderwidth+"px")}function S(P,L,z,F){var B=e.ensureSingle(P,"text",a.itemTextClassName,function(N){N.attr({"text-anchor":"start","data-notex":1})}),O=z.label,I=F._fullLayout._meta;I&&(O=e.templateString(O,I)),B.call(M.font,L.font).text(O).call(t.convertToTspans,F)}function E(P,L){var z=L.active;P.each(function(F,B){var O=v.select(this);B===z&&L.showactive&&O.select("rect."+a.itemRectClassName).call(A.fill,a.activeColor)})}function g(P){P.select("rect."+a.itemRectClassName).call(A.fill,a.hoverColor)}function b(P,L){P.select("rect."+a.itemRectClassName).call(A.fill,L.bgcolor)}function p(P,L){var z=L._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},F=M.tester.selectAll("g."+a.dropdownButtonClassName).data(e.filterVisible(L.buttons));F.enter().append("g").classed(a.dropdownButtonClassName,!0);var B=["up","down"].indexOf(L.direction)!==-1;F.each(function(Q,ue){var se=v.select(this);se.call(_,L,Q,P);var he=se.select("."+a.itemTextClassName),H=he.node()&&M.bBox(he.node()).width,$=Math.max(H+a.textPadX,a.minWidth),J=L.font.size*i,X=t.lineCount(he),oe=Math.max(J*X,a.minHeight)+a.textOffsetY;oe=Math.ceil(oe),$=Math.ceil($),z.widths[ue]=$,z.heights[ue]=oe,z.height1=Math.max(z.height1,oe),z.width1=Math.max(z.width1,$),B?(z.totalWidth=Math.max(z.totalWidth,$),z.openWidth=z.totalWidth,z.totalHeight+=oe+a.gapButton,z.openHeight+=oe+a.gapButton):(z.totalWidth+=$+a.gapButton,z.openWidth+=$+a.gapButton,z.totalHeight=Math.max(z.totalHeight,oe),z.openHeight=z.totalHeight)}),B?z.totalHeight-=a.gapButton:z.totalWidth-=a.gapButton,z.headerWidth=z.width1+a.arrowPadX,z.headerHeight=z.height1,L.type==="dropdown"&&(B?(z.width1+=a.arrowPadX,z.totalHeight=z.height1):z.totalWidth=z.width1,z.totalWidth+=a.arrowPadX),F.remove();var O=z.totalWidth+L.pad.l+L.pad.r,I=z.totalHeight+L.pad.t+L.pad.b,N=P._fullLayout._size;z.lx=N.l+N.w*L.x,z.ly=N.t+N.h*(1-L.y);var U="left";e.isRightAnchor(L)&&(z.lx-=O,U="right"),e.isCenterAnchor(L)&&(z.lx-=O/2,U="center");var W="top";e.isBottomAnchor(L)&&(z.ly-=I,W="bottom"),e.isMiddleAnchor(L)&&(z.ly-=I/2,W="middle"),z.totalWidth=Math.ceil(z.totalWidth),z.totalHeight=Math.ceil(z.totalHeight),z.lx=Math.round(z.lx),z.ly=Math.round(z.ly),x.autoMargin(P,u(L),{x:L.x,y:L.y,l:O*({right:1,center:.5}[U]||0),r:O*({left:1,center:.5}[U]||0),b:I*({top:1,middle:.5}[W]||0),t:I*({bottom:1,middle:.5}[W]||0)})}function u(P){return a.autoMarginIdRoot+P._index}function y(P,L,z,F){F=F||{};var B=P.select("."+a.itemRectClassName),O=P.select("."+a.itemTextClassName),I=L.borderwidth,N=z.index,U=L._dims;M.setTranslate(P,I+z.x,I+z.y);var W=["up","down"].indexOf(L.direction)!==-1,Q=F.height||(W?U.heights[N]:U.height1);B.attr({x:0,y:0,width:F.width||(W?U.width1:U.widths[N]),height:Q});var ue=L.font.size*i,se=t.lineCount(O),he=(se-1)*ue/2;t.positionText(O,a.textOffsetX,Q/2-he+a.textOffsetY),W?z.y+=U.heights[N]+z.yPad:z.x+=U.widths[N]+z.xPad,z.index++}function f(P,L){P.attr(a.menuIndexAttrName,L||"-1").selectAll("g."+a.dropdownButtonClassName).remove()}}}),xB=Ze({"src/components/updatemenus/index.js"(Z,q){"use strict";var v=F2();q.exports={moduleType:"component",name:v.name,layoutAttributes:VS(),supplyLayoutDefaults:gB(),draw:_B()}}}),F_=Ze({"src/components/sliders/constants.js"(Z,q){"use strict";q.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}}),qS=Ze({"src/components/sliders/attributes.js"(Z,q){"use strict";var v=tc(),x=v2(),A=rs().extendDeepAll,M=pc().overrideAll,e=A_(),t=Dl().templatedArray,r=F_(),i=t("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});q.exports=M(t("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:i,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:A(x({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:e.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:v({})},font:v({}),activebgcolor:{valType:"color",dflt:r.gripBgActiveColor},bgcolor:{valType:"color",dflt:r.railBgColor},bordercolor:{valType:"color",dflt:r.railBorderColor},borderwidth:{valType:"number",min:0,dflt:r.railBorderWidth},ticklen:{valType:"number",min:0,dflt:r.tickLength},tickcolor:{valType:"color",dflt:r.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:r.minorTickLength}}),"arraydraw","from-root")}}),bB=Ze({"src/components/sliders/defaults.js"(Z,q){"use strict";var v=ca(),x=fp(),A=qS(),M=F_(),e=M.name,t=A.steps;q.exports=function(n,o){x(n,o,{name:e,handleItemDefaults:r})};function r(a,n,o){function s(w,S){return v.coerce(a,n,A,w,S)}for(var c=x(a,n,{name:"steps",handleItemDefaults:i}),h=0,m=0;m<c.length;m++)c[m].visible&&h++;var d;if(h<2?d=n.visible=!1:d=s("visible"),!!d){n._stepCount=h;var T=n._visibleSteps=v.filterVisible(c),l=s("active");(c[l]||{}).visible||(n.active=T[0]._index),s("x"),s("y"),v.noneOrAll(a,n,["x","y"]),s("xanchor"),s("yanchor"),s("len"),s("lenmode"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),v.coerceFont(s,"font",o.font);var _=s("currentvalue.visible");_&&(s("currentvalue.xanchor"),s("currentvalue.prefix"),s("currentvalue.suffix"),s("currentvalue.offset"),v.coerceFont(s,"currentvalue.font",n.font)),s("transition.duration"),s("transition.easing"),s("bgcolor"),s("activebgcolor"),s("bordercolor"),s("borderwidth"),s("ticklen"),s("tickwidth"),s("tickcolor"),s("minorticklen")}}function i(a,n){function o(h,m){return v.coerce(a,n,t,h,m)}var s;if(a.method!=="skip"&&!Array.isArray(a.args)?s=n.visible=!1:s=o("visible"),s){o("method"),o("args");var c=o("label","step-"+n._index);o("value",c),o("execute")}}}}),wB=Ze({"src/components/sliders/draw.js"(Z,q){"use strict";var v=Oi(),x=xc(),A=Yi(),M=as(),e=ca(),t=e.strTranslate,r=fu(),i=Dl().arrayEditor,a=F_(),n=mh(),o=n.LINE_SPACING,s=n.FROM_TL,c=n.FROM_BR;q.exports=function(O){var I=O._context.staticPlot,N=O._fullLayout,U=m(N,O),W=N._infolayer.selectAll("g."+a.containerClassName).data(U.length>0?[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;se<U.length;se++){var he=U[se];T(O,he)}ue.each(function(H){var $=v.select(this);y(H),x.manageCommandObserver(O,H,H._visibleSteps,function(J){var X=$.data()[0];X.active!==J.index&&(X._dragging||b(O,$,X,J.index,!1,!0))}),l(O,v.select(this),H)})}};function h(B){return a.autoMarginIdRoot+B._index}function m(B,O){for(var I=B[a.name],N=[],U=0;U<I.length;U++){var W=I[U];W.visible&&(W._gd=O,N.push(W))}return N}function d(B){return B._index}function T(B,O){var I=M.tester.selectAll("g."+a.labelGroupClass).data(O._visibleSteps);I.enter().append("g").classed(a.labelGroupClass,!0);var N=0,U=0;I.each(function(oe){var ne=v.select(this),j=S(ne,{step:oe},O),ee=j.node();if(ee){var re=M.bBox(ee);U=Math.max(U,re.height),N=Math.max(N,re.width)}}),I.remove();var W=O._dims={};W.inputAreaWidth=Math.max(a.railWidth,a.gripHeight);var Q=B._fullLayout._size;W.lx=Q.l+Q.w*O.x,W.ly=Q.t+Q.h*(1-O.y),O.lenmode==="fraction"?W.outerLength=Math.round(Q.w*O.len):W.outerLength=O.len,W.inputAreaStart=0,W.inputAreaLength=Math.round(W.outerLength-O.pad.l-O.pad.r);var ue=W.inputAreaLength-2*a.stepInset,se=ue/(O._stepCount-1),he=N+a.labelPadding;if(W.labelStride=Math.max(1,Math.ceil(he/se)),W.labelHeight=U,W.currentValueMaxWidth=0,W.currentValueHeight=0,W.currentValueTotalHeight=0,W.currentValueMaxLines=1,O.currentvalue.visible){var H=M.tester.append("g");I.each(function(oe){var ne=_(H,O,oe.label),j=ne.node()&&M.bBox(ne.node())||{width:0,height:0},ee=r.lineCount(ne);W.currentValueMaxWidth=Math.max(W.currentValueMaxWidth,Math.ceil(j.width)),W.currentValueHeight=Math.max(W.currentValueHeight,Math.ceil(j.height)),W.currentValueMaxLines=Math.max(W.currentValueMaxLines,ee)}),W.currentValueTotalHeight=W.currentValueHeight+O.currentvalue.offset,H.remove()}W.height=W.currentValueTotalHeight+a.tickOffset+O.ticklen+a.labelOffset+W.labelHeight+O.pad.t+O.pad.b;var $="left";e.isRightAnchor(O)&&(W.lx-=W.outerLength,$="right"),e.isCenterAnchor(O)&&(W.lx-=W.outerLength/2,$="center");var J="top";e.isBottomAnchor(O)&&(W.ly-=W.height,J="bottom"),e.isMiddleAnchor(O)&&(W.ly-=W.height/2,J="middle"),W.outerLength=Math.ceil(W.outerLength),W.height=Math.ceil(W.height),W.lx=Math.round(W.lx),W.ly=Math.round(W.ly);var X={y:O.y,b:W.height*c[J],t:W.height*s[J]};O.lenmode==="fraction"?(X.l=0,X.xl=O.x-O.len*s[$],X.r=0,X.xr=O.x+O.len*c[$]):(X.x=O.x,X.l=W.outerLength*s[$],X.r=W.outerLength*c[$]),x.autoMargin(B,h(O),X)}function l(B,O,I){(I.steps[I.active]||{}).visible||(I.active=I._visibleSteps[0]._index),O.call(_,I).call(F,I).call(E,I).call(u,I).call(z,B,I).call(w,B,I);var N=I._dims;M.setTranslate(O,N.lx+I.pad.l,N.ly+I.pad.t),O.call(f,I,!1),O.call(_,I)}function _(B,O,I){if(O.currentvalue.visible){var N=O._dims,U,W;switch(O.currentvalue.xanchor){case"right":U=N.inputAreaLength-a.currentValueInset-N.currentValueMaxWidth,W="left";break;case"center":U=N.inputAreaLength*.5,W="middle";break;default:U=a.currentValueInset,W="left"}var Q=e.ensureSingle(B,"text",a.labelClass,function(J){J.attr({"text-anchor":W,"data-notex":1})}),ue=O.currentvalue.prefix?O.currentvalue.prefix:"";if(typeof I=="string")ue+=I;else{var se=O.steps[O.active].label,he=O._gd._fullLayout._meta;he&&(se=e.templateString(se,he)),ue+=se}O.currentvalue.suffix&&(ue+=O.currentvalue.suffix),Q.call(M.font,O.currentvalue.font).text(ue).call(r.convertToTspans,O._gd);var H=r.lineCount(Q),$=(N.currentValueMaxLines+1-H)*O.currentvalue.font.size*o;return r.positionText(Q,U,$),Q}}function w(B,O,I){var N=e.ensureSingle(B,"rect",a.gripRectClass,function(U){U.call(p,O,B,I).style("pointer-events","all")});N.attr({width:a.gripWidth,height:a.gripHeight,rx:a.gripRadius,ry:a.gripRadius}).call(A.stroke,I.bordercolor).call(A.fill,I.bgcolor).style("stroke-width",I.borderwidth+"px")}function S(B,O,I){var N=e.ensureSingle(B,"text",a.labelClass,function(Q){Q.attr({"text-anchor":"middle","data-notex":1})}),U=O.step.label,W=I._gd._fullLayout._meta;return W&&(U=e.templateString(U,W)),N.call(M.font,I.font).text(U).call(r.convertToTspans,I._gd),N}function E(B,O){var I=e.ensureSingle(B,"g",a.labelsClass),N=O._dims,U=I.selectAll("g."+a.labelGroupClass).data(N.labelSteps);U.enter().append("g").classed(a.labelGroupClass,!0),U.exit().remove(),U.each(function(W){var Q=v.select(this);Q.call(S,W,O),M.setTranslate(Q,P(O,W.fraction),a.tickOffset+O.ticklen+O.font.size*o+a.labelOffset+N.currentValueTotalHeight)})}function g(B,O,I,N,U){var W=Math.round(N*(I._stepCount-1)),Q=I._visibleSteps[W]._index;Q!==I.active&&b(B,O,I,Q,!0,U)}function b(B,O,I,N,U,W){var Q=I.active;I.active=N,i(B.layout,a.name,I).applyUpdate("active",N);var ue=I.steps[I.active];O.call(f,I,W),O.call(_,I),B.emit("plotly_sliderchange",{slider:I,step:I.steps[I.active],interaction:U,previousActive:Q}),ue&&ue.method&&U&&(O._nextMethod?(O._nextMethod.step=ue,O._nextMethod.doCallback=U,O._nextMethod.doTransition=W):(O._nextMethod={step:ue,doCallback:U,doTransition:W},O._nextMethodRaf=window.requestAnimationFrame(function(){var se=O._nextMethod.step;se.method&&(se.execute&&x.executeAPICommand(B,se.method,se.args),O._nextMethod=null,O._nextMethodRaf=null)})))}function p(B,O,I){if(O._context.staticPlot)return;var N=I.node(),U=v.select(O);function W(){return I.data()[0]}function Q(){var ue=W();O.emit("plotly_sliderstart",{slider:ue});var se=I.select("."+a.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),se.call(A.fill,ue.activebgcolor);var he=L(ue,v.mouse(N)[0]);g(O,I,ue,he,!0),ue._dragging=!0;function H(){var J=W(),X=L(J,v.mouse(N)[0]);g(O,I,J,X,!1)}U.on("mousemove",H),U.on("touchmove",H);function $(){var J=W();J._dragging=!1,se.call(A.fill,J.bgcolor),U.on("mouseup",null),U.on("mousemove",null),U.on("touchend",null),U.on("touchmove",null),O.emit("plotly_sliderend",{slider:J,step:J.steps[J.active]})}U.on("mouseup",$),U.on("touchend",$)}B.on("mousedown",Q),B.on("touchstart",Q)}function u(B,O){var I=B.selectAll("rect."+a.tickRectClass).data(O._visibleSteps),N=O._dims;I.enter().append("rect").classed(a.tickRectClass,!0),I.exit().remove(),I.attr({width:O.tickwidth+"px","shape-rendering":"crispEdges"}),I.each(function(U,W){var Q=W%N.labelStride===0,ue=v.select(this);ue.attr({height:Q?O.ticklen:O.minorticklen}).call(A.fill,O.tickcolor),M.setTranslate(ue,P(O,W/(O._stepCount-1))-.5*O.tickwidth,(Q?a.tickOffset:a.minorTickOffset)+N.currentValueTotalHeight)})}function y(B){var O=B._dims;O.labelSteps=[];for(var I=B._stepCount,N=0;N<I;N+=O.labelStride)O.labelSteps.push({fraction:N/(I-1),step:B._visibleSteps[N]})}function f(B,O,I){for(var N=B.select("rect."+a.gripRectClass),U=0,W=0;W<O._stepCount;W++)if(O._visibleSteps[W]._index===O.active){U=W;break}var Q=P(O,U/(O._stepCount-1));if(!O._invokingCommand){var ue=N;I&&O.transition.duration>0&&(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<r.length;n++){var o=r[n];if(e(o)){a.push(o);var s=o[M];s._id=M+o._id,s._height=(t.height-i.b-i.t)*s.thickness,s._offsetShift=Math.floor(s.borderwidth/2)}}t._rangeSliderData=a},Z.autoMarginOpts=function(t,r){var i=t._fullLayout,a=r[M],n=r._id.charAt(0),o=0,s=0;if(r.side==="bottom"&&(o=r._depth,r.title.text!==i._dfltTitle[n])){s=1.5*r.title.font.size+10+a._offsetShift;var c=(r.title.text.match(v.BR_TAG_ALL)||[]).length;s+=c*r.title.font.size*A}return{x:0,y:r._counterDomainMin,l:0,r:0,t:0,b:a._height+o+Math.max(i.margin.b,s),pad:x.extraPad+a._offsetShift*2}}}}),SB=Ze({"src/components/rangeslider/defaults.js"(Z,q){"use strict";var v=ca(),x=Dl(),A=$c(),M=O2(),e=GS();q.exports=function(r,i,a){var n=r[a],o=i[a];if(!(n.rangeslider||i._requestRangeslider[o._id]))return;v.isPlainObject(n.rangeslider)||(n.rangeslider={});var s=n.rangeslider,c=x.newContainer(o,"rangeslider");function h(y,f){return v.coerce(s,c,M,y,f)}var m,d;function T(y,f){return v.coerce(m,d,e,y,f)}var l=h("visible");if(l){h("bgcolor",i.plot_bgcolor),h("bordercolor"),h("borderwidth"),h("thickness"),h("autorange",!o.isValidRange(s.range)),h("range");var _=i._subplots;if(_)for(var w=_.cartesian.filter(function(y){return y.substr(0,y.indexOf("y"))===A.name2id(a)}).map(function(y){return y.substr(y.indexOf("y"),y.length)}),S=v.simpleMap(w,A.id2name),E=0;E<S.length;E++){var g=S[E];m=s[g]||{},d=x.newContainer(c,g,"yaxis");var b=i[g],p;m.range&&b.isValidRange(m.range)&&(p="fixed");var u=T("rangemode",p);u!=="match"&&T("range",b.range.slice())}c._input=s}}}}),MB=Ze({"src/components/rangeslider/calc_autorange.js"(Z,q){"use strict";var v=$c().list,x=Yd().getAutoRange,A=B2();q.exports=function(e){for(var t=v(e,"x",!0),r=0;r<t.length;r++){var i=t[r],a=i[A.name];a&&a.visible&&a.autorange&&(a._input.autorange=!0,a._input.range=a.range=x(e,i))}}}}),EB=Ze({"src/components/rangeslider/draw.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=xc(),M=ca(),e=M.strTranslate,t=as(),r=Yi(),i=Zg(),a=Zf(),n=$c(),o=bp(),s=Kd(),c=B2();q.exports=function(p){for(var u=p._fullLayout,y=u._rangeSliderData,f=0;f<y.length;f++){var P=y[f][c.name];P._clipId=P._id+"-"+u._uid}function L(F){return F._name}var z=u._infolayer.selectAll("g."+c.containerClassName).data(y,L);z.exit().each(function(F){var B=F[c.name];u._topdefs.select("#"+B._clipId).remove()}).remove(),y.length!==0&&(z.enter().append("g").classed(c.containerClassName,!0).attr("pointer-events","all"),z.each(function(F){var B=v.select(this),O=F[c.name],I=u[n.id2name(F.anchor)],N=O[n.id2name(F.anchor)];if(O.range){var U=M.simpleMap(O.range,F.r2l),W=M.simpleMap(F.range,F.r2l),Q;W[0]<W[1]?Q=[Math.min(U[0],W[0]),Math.max(U[1],W[1])]:Q=[Math.max(U[0],W[0]),Math.min(U[1],W[1])],O.range=O._input.range=M.simpleMap(Q,F.l2r)}F.cleanRange("rangeslider.range");var ue=u._size,se=F.domain;O._width=ue.w*(se[1]-se[0]);var he=Math.round(ue.l+ue.w*se[0]),H=Math.round(ue.t+ue.h*(1-F._counterDomainMin)+(F.side==="bottom"?F._depth:0)+O._offsetShift+c.extraPad);B.attr("transform",e(he,H)),O._rl=M.simpleMap(O.range,F.r2l);var $=O._rl[0],J=O._rl[1],X=J-$;if(O.p2d=function(Re){return Re/O._width*X+$},O.d2p=function(Re){return(Re-$)/X*O._width},F.rangebreaks){var oe=F.locateBreaks($,J);if(oe.length){var ne,j,ee=0;for(ne=0;ne<oe.length;ne++)j=oe[ne],ee+=j.max-j.min;var re=O._width/(J-$-ee),ce=[-re*$];for(ne=0;ne<oe.length;ne++)j=oe[ne],ce.push(ce[ce.length-1]-re*(j.max-j.min));for(O.d2p=function(Re){for(var We=ce[0],it=0;it<oe.length;it++){var ot=oe[it];if(Re>=ot.max)We=ce[it+1];else if(Re<ot.min)break}return We+re*Re},ne=0;ne<oe.length;ne++)j=oe[ne],j.pmin=O.d2p(j.min),j.pmax=O.d2p(j.max);O.p2d=function(Re){for(var We=ce[0],it=0;it<oe.length;it++){var ot=oe[it];if(Re>=ot.pmax)We=ce[it+1];else if(Re<ot.pmin)break}return(Re-We)/re}}}if(N.rangemode!=="match"){var be=I.r2l(N.range[0]),Ae=I.r2l(N.range[1]),ze=Ae-be;O.d2pOppAxis=function(Re){return(Re-be)/ze*O._height}}B.call(l,p,F,O).call(_,p,F,O).call(w,p,F,O).call(E,p,F,O,N).call(g,p,F,O).call(b,p,F,O),m(B,p,F,O),T(B,p,F,O,I,N),F.side==="bottom"&&i.draw(p,F._id+"title",{propContainer:F,propName:F._name+".title",placeholder:u._dfltTitle.x,attributes:{x:F._offset+F._length/2,y:H+O._height+O._offsetShift+10+1.5*F.title.font.size,"text-anchor":"middle"}})}))};function h(p){return typeof p.clientX=="number"?p.clientX:p.touches&&p.touches.length>0?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(X<J){var ne=X;X=J,J=ne}f._pixelMin=J,f._pixelMax=X,s(v.select(Q),oe),d(p,u,y,f)}function se(){Q.removeEventListener("mousemove",ue),Q.removeEventListener("mouseup",se),this.removeEventListener("touchmove",ue),this.removeEventListener("touchend",se),M.removeElement(Q)}}p.on("mousedown",F),p.on("touchstart",F)}function d(p,u,y,f){function P(F){return y.l2r(M.constrain(F,f._rl[0],f._rl[1]))}var L=P(f.p2d(f._pixelMin)),z=P(f.p2d(f._pixelMax));window.requestAnimationFrame(function(){x.call("_guiRelayout",u,y._name+".range",[L,z])})}function T(p,u,y,f,P,L){var z=c.handleWidth/2;function F(he){return M.constrain(he,0,f._width)}function B(he){return M.constrain(he,0,f._height)}function O(he){return M.constrain(he,-z,f._width+z)}var I=F(f.d2p(y._rl[0])),N=F(f.d2p(y._rl[1]));if(p.select("rect."+c.slideBoxClassName).attr("x",I).attr("width",N-I),p.select("rect."+c.maskMinClassName).attr("width",I),p.select("rect."+c.maskMaxClassName).attr("x",N).attr("width",f._width-N),L.rangemode!=="match"){var U=f._height-B(f.d2pOppAxis(P._rl[1])),W=f._height-B(f.d2pOppAxis(P._rl[0]));p.select("rect."+c.maskMinOppAxisClassName).attr("x",I).attr("height",U).attr("width",N-I),p.select("rect."+c.maskMaxOppAxisClassName).attr("x",I).attr("y",W).attr("height",f._height-W).attr("width",N-I),p.select("rect."+c.slideBoxClassName).attr("y",U).attr("height",W-U)}var Q=.5,ue=Math.round(O(I-z))-Q,se=Math.round(O(N-z))+Q;p.select("g."+c.grabberMinClassName).attr("transform",e(ue,Q)),p.select("g."+c.grabberMaxClassName).attr("transform",e(se,Q))}function l(p,u,y,f){var P=M.ensureSingle(p,"rect",c.bgClassName,function(B){B.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),L=f.borderwidth%2===0?f.borderwidth:f.borderwidth-1,z=-f._offsetShift,F=t.crispRound(u,f.borderwidth);P.attr({width:f._width+L,height:f._height+L,transform:e(z,z),"stroke-width":F}).call(r.stroke,f.bordercolor).call(r.fill,f.bgcolor)}function _(p,u,y,f){var P=u._fullLayout,L=M.ensureSingleById(P._topdefs,"clipPath",f._clipId,function(z){z.append("rect").attr({x:0,y:0})});L.select("rect").attr({width:f._width,height:f._height})}function w(p,u,y,f){var P=u.calcdata,L=p.selectAll("g."+c.rangePlotClassName).data(y._subplotsWith,M.identity);L.enter().append("g").attr("class",function(F){return c.rangePlotClassName+" "+F}).call(t.setClipUrl,f._clipId,u),L.order(),L.exit().remove();var z;L.each(function(F,B){var O=v.select(this),I=B===0,N=n.getFromId(u,F,"y"),U=N._name,W=f[U],Q={data:[],layout:{xaxis:{type:y.type,domain:[0,1],range:f.range.slice(),calendar:y.calendar},width:f._width,height:f._height,margin:{t:0,b:0,l:0,r:0}},_context:u._context};y.rangebreaks&&(Q.layout.xaxis.rangebreaks=y.rangebreaks),Q.layout[U]={type:N.type,domain:[0,1],range:W.rangemode!=="match"?W.range.slice():N.range.slice(),calendar:N.calendar},N.rangebreaks&&(Q.layout[U].rangebreaks=N.rangebreaks),A.supplyDefaults(Q);var ue=Q._fullLayout.xaxis,se=Q._fullLayout[U];ue.clearCalc(),ue.setScale(),se.clearCalc(),se.setScale();var he={id:F,plotgroup:O,xaxis:ue,yaxis:se,isRangePlot:!0};I?z=he:(he.mainplot="xy",he.mainplotinfo=z),a.rangePlot(u,he,S(P,F))})}function S(p,u){for(var y=[],f=0;f<p.length;f++){var P=p[f],L=P[0].trace;L.xaxis+L.yaxis===u&&y.push(P)}return y}function E(p,u,y,f,P){var L=M.ensureSingle(p,"rect",c.maskMinClassName,function(O){O.attr({x:0,y:0,"shape-rendering":"crispEdges"})});L.attr("height",f._height).call(r.fill,c.maskColor);var z=M.ensureSingle(p,"rect",c.maskMaxClassName,function(O){O.attr({y:0,"shape-rendering":"crispEdges"})});if(z.attr("height",f._height).call(r.fill,c.maskColor),P.rangemode!=="match"){var F=M.ensureSingle(p,"rect",c.maskMinOppAxisClassName,function(O){O.attr({y:0,"shape-rendering":"crispEdges"})});F.attr("width",f._width).call(r.fill,c.maskOppAxisColor);var B=M.ensureSingle(p,"rect",c.maskMaxOppAxisClassName,function(O){O.attr({y:0,"shape-rendering":"crispEdges"})});B.attr("width",f._width).style("border-top",c.maskOppBorder).call(r.fill,c.maskOppAxisColor)}}function g(p,u,y,f){if(!u._context.staticPlot){var P=M.ensureSingle(p,"rect",c.slideBoxClassName,function(L){L.attr({y:0,cursor:c.slideBoxCursor,"shape-rendering":"crispEdges"})});P.attr({height:f._height,fill:c.slideBoxFill})}}function b(p,u,y,f){var P=M.ensureSingle(p,"g",c.grabberMinClassName),L=M.ensureSingle(p,"g",c.grabberMaxClassName),z={x:0,width:c.handleWidth,rx:c.handleRadius,fill:r.background,stroke:r.defaultLine,"stroke-width":c.handleStrokeWidth,"shape-rendering":"crispEdges"},F={y:Math.round(f._height/4),height:Math.round(f._height/2)},B=M.ensureSingle(P,"rect",c.handleMinClassName,function(W){W.attr(z)});B.attr(F);var O=M.ensureSingle(L,"rect",c.handleMaxClassName,function(W){W.attr(z)});O.attr(F);var I={width:c.grabAreaWidth,x:0,y:0,fill:c.grabAreaFill,cursor:u._context.staticPlot?void 0:c.grabAreaCursor},N=M.ensureSingle(P,"rect",c.grabAreaMinClassName,function(W){W.attr(I)});N.attr("height",f._height);var U=M.ensureSingle(L,"rect",c.grabAreaMaxClassName,function(W){W.attr(I)});U.attr("height",f._height)}}}),CB=Ze({"src/components/rangeslider/index.js"(Z,q){"use strict";var v=ca(),x=O2(),A=GS(),M=AB();q.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:v.extendFlat({},x,{yaxis:A})}}},layoutAttributes:O2(),handleDefaults:SB(),calcAutorange:MB(),draw:EB(),isVisible:M.isVisible,makeData:M.makeData,autoMarginOpts:M.autoMarginOpts}}}),N2=Ze({"src/components/rangeselector/attributes.js"(Z,q){"use strict";var v=tc(),x=oh(),A=Dl().templatedArray,M=A("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});q.exports={visible:{valType:"boolean",editType:"plot"},buttons:M,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:v({editType:"plot"}),bgcolor:{valType:"color",dflt:x.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:x.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}}),HS=Ze({"src/components/rangeselector/constants.js"(Z,q){"use strict";q.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}}),kB=Ze({"src/components/rangeselector/defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=Dl(),M=fp(),e=N2(),t=HS();q.exports=function(n,o,s,c,h){var m=n.rangeselector||{},d=A.newContainer(o,"rangeselector");function T(E,g){return v.coerce(m,d,e,E,g)}var l=M(m,d,{name:"buttons",handleItemDefaults:r,calendar:h}),_=T("visible",l.length>0);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;h<s.length;h++){var m=n[s[h]].domain;m&&(c=Math.max(m[1],c))}return[a.domain[0],c+t.yPad]}}}),LB=Ze({"src/components/rangeselector/get_update_object.js"(Z,q){"use strict";var v=$p(),x=ca().titleCase;q.exports=function(e,t){var r=e._name,i={};if(t.step==="all")i[r+".autorange"]=!0;else{var a=A(e,t);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i};function A(M,e){var t=M.range,r=new Date(M.r2l(t[1])),i=e.step,a=v["utc"+x(i)],n=e.count,o;switch(e.stepmode){case"backward":o=M.l2r(+a.offset(r,-n));break;case"todate":var s=a.offset(r,-n);o=M.l2r(+a.ceil(s));break}var c=t[1];return[o,c]}}}),PB=Ze({"src/components/rangeselector/draw.js"(Z,q){"use strict";var v=Oi(),x=oo(),A=xc(),M=Yi(),e=as(),t=ca(),r=t.strTranslate,i=fu(),a=$c(),n=mh(),o=n.LINE_SPACING,s=n.FROM_TL,c=n.FROM_BR,h=HS(),m=LB();q.exports=function(p){var u=p._fullLayout,y=u._infolayer.selectAll(".rangeselector").data(d(p),T);y.enter().append("g").classed("rangeselector",!0),y.exit().remove(),y.style({cursor:"pointer","pointer-events":"all"}),y.each(function(f){var P=v.select(this),L=f,z=L.rangeselector,F=P.selectAll("g.button").data(t.filterVisible(z.buttons));F.enter().append("g").classed("button",!0),F.exit().remove(),F.each(function(B){var O=v.select(this),I=m(L,B);B._isActive=l(L,B,I),O.call(_,z,B),O.call(S,z,B,p),O.on("click",function(){p._dragged||x.call("_guiRelayout",p,I)}),O.on("mouseover",function(){B._isHovered=!0,O.call(_,z,B)}),O.on("mouseout",function(){B._isHovered=!1,O.call(_,z,B)})}),g(p,F,z,L._name,P)})};function d(b){for(var p=a.list(b,"x",!0),u=[],y=0;y<p.length;y++){var f=p[y];f.rangeselector&&f.rangeselector.visible&&u.push(f)}return u}function T(b){return b._id}function l(b,p,u){if(p.step==="all")return b.autorange===!0;var y=Object.keys(u);return b.range[0]===u[y[0]]&&b.range[1]===u[y[1]]}function _(b,p,u){var y=t.ensureSingle(b,"rect","selector-rect",function(f){f.attr("shape-rendering","crispEdges")});y.attr({rx:h.rx,ry:h.ry}),y.call(M.stroke,p.bordercolor).call(M.fill,w(p,u)).style("stroke-width",p.borderwidth+"px")}function w(b,p){return p._isActive||p._isHovered?b.activecolor:b.bgcolor}function S(b,p,u,y){function f(L){i.convertToTspans(L,y)}var P=t.ensureSingle(b,"text","selector-text",function(L){L.attr("text-anchor","middle")});P.call(e.font,p.font).text(E(u,y._fullLayout._meta)).call(f)}function E(b,p){return b.label?p?t.templateString(b.label,p):b.label:b.step==="all"?"all":b.count+b.step.charAt(0)}function g(b,p,u,y,f){var P=0,L=0,z=u.borderwidth;p.each(function(){var U=v.select(this),W=U.select(".selector-text"),Q=u.font.size*o,ue=Math.max(Q*i.lineCount(W),16)+3;L=Math.max(L,ue)}),p.each(function(){var U=v.select(this),W=U.select(".selector-rect"),Q=U.select(".selector-text"),ue=Q.node()&&e.bBox(Q.node()).width,se=u.font.size*o,he=i.lineCount(Q),H=Math.max(ue+10,h.minButtonWidth);U.attr("transform",r(z+P,z)),W.attr({x:0,y:0,width:H,height:L}),i.positionText(Q,H/2,L/2-(he-1)*se/2+3),P+=H+5});var F=b._fullLayout._size,B=F.l+F.w*u.x,O=F.t+F.h*(1-u.y),I="left";t.isRightAnchor(u)&&(B-=P,I="right"),t.isCenterAnchor(u)&&(B-=P/2,I="center");var N="top";t.isBottomAnchor(u)&&(O-=L,N="bottom"),t.isMiddleAnchor(u)&&(O-=L/2,N="middle"),P=Math.ceil(P),L=Math.ceil(L),B=Math.round(B),O=Math.round(O),A.autoMargin(b,y+"-range-selector",{x:u.x,y:u.y,l:P*s[I],r:P*c[I],b:L*c[N],t:L*s[N]}),f.attr("transform",r(B,O))}}}),IB=Ze({"src/components/rangeselector/index.js"(Z,q){"use strict";q.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:N2()}}},layoutAttributes:N2(),handleDefaults:kB(),draw:PB()}}}),bc=Ze({"src/plots/domain.js"(Z){"use strict";var q=rs().extendFlat;Z.attributes=function(v,x){v=v||{},x=x||{};var A={valType:"info_array",editType:v.editType,items:[{valType:"number",min:0,max:1,editType:v.editType},{valType:"number",min:0,max:1,editType:v.editType}],dflt:[0,1]},M=v.name?v.name+" ":"",e=v.trace?"trace ":"subplot ",t=x.description?" "+x.description:"",r={x:q({},A,{}),y:q({},A,{}),editType:v.editType};return v.noGridCell||(r.row={valType:"integer",min:0,dflt:0,editType:v.editType},r.column={valType:"integer",min:0,dflt:0,editType:v.editType}),r},Z.defaults=function(v,x,A,M){var e=M&&M.x||[0,1],t=M&&M.y||[0,1],r=x.grid;if(r){var i=A("domain.column");i!==void 0&&(i<r.columns?e=r._domains.x[i]:delete v.domain.column);var a=A("domain.row");a!==void 0&&(a<r.rows?t=r._domains.y[a]:delete v.domain.row)}var n=A("domain.x",e),o=A("domain.y",t);n[0]<n[1]||(v.domain.x=e.slice()),o[0]<o[1]||(v.domain.y=t.slice())}}}),WS=Ze({"src/components/grid/index.js"(Z,q){"use strict";var v=ca(),x=Jy().counter,A=bc().attributes,M=kh().idRegex,e=Dl(),t={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[x("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[M.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[M.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:A({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function r(s,c,h){var m=c[h+"axes"],d=Object.keys((s._splomAxes||{})[h]||{});if(Array.isArray(m))return m;if(d.length)return d}function i(s,c){var h=s.grid||{},m=r(c,h,"x"),d=r(c,h,"y");if(!s.grid&&!m&&!d)return;var T=Array.isArray(h.subplots)&&Array.isArray(h.subplots[0]),l=Array.isArray(m),_=Array.isArray(d),w=l&&m!==h.xaxes&&_&&d!==h.yaxes,S,E;T?(S=h.subplots.length,E=h.subplots[0].length):(_&&(S=d.length),l&&(E=m.length));var g=e.newContainer(c,"grid");function b(O,I){return v.coerce(h,g,t,O,I)}var p=b("rows",S),u=b("columns",E);if(!(p*u>1)){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;b<d;b++){var p=S+E*b;w[T?d-1-b:b]=[p,p+g]}return w}function n(s,c){var h=c.grid;if(!(!h||!h._domains)){var m=s.grid||{},d=c._subplots,T=h._hasSubplotGrid,l=h.rows,_=h.columns,w=h.pattern==="independent",S,E,g,b,p,u,y,f=h._axisMap={};if(T){var P=m.subplots||[];u=h.subplots=new Array(l);var L=1;for(S=0;S<l;S++){var z=u[S]=new Array(_),F=P[S]||[];for(E=0;E<_;E++)if(w?(p=L===1?"xy":"x"+L+"y"+L,L++):p=F[E],z[E]="",d.cartesian.indexOf(p)!==-1){if(y=p.indexOf("y"),g=p.slice(0,y),b=p.slice(y),f[g]!==void 0&&f[g]!==E||f[b]!==void 0&&f[b]!==S)continue;z[E]=p,f[g]=E,f[b]=S}}}else{var B=r(c,m,"x"),O=r(c,m,"y");h.xaxes=o(B,d.xaxis,_,f,"x"),h.yaxes=o(O,d.yaxis,l,f,"y")}var I=h._anchors={},N=h.roworder==="top to bottom";for(var U in f){var W=U.charAt(0),Q=h[W+"side"],ue,se,he;if(Q.length<8)I[U]="free";else if(W==="x"){if(Q.charAt(0)==="t"===N?(ue=0,se=1,he=l):(ue=l-1,se=-1,he=-1),T){var H=f[U];for(S=ue;S!==he;S+=se)if(p=u[S][H],!!p&&(y=p.indexOf("y"),p.slice(0,y)===U)){I[U]=p.slice(y);break}}else for(S=ue;S!==he;S+=se)if(b=h.yaxes[S],d.cartesian.indexOf(U+b)!==-1){I[U]=b;break}}else if(Q.charAt(0)==="l"?(ue=0,se=1,he=_):(ue=_-1,se=-1,he=-1),T){var $=f[U];for(S=ue;S!==he;S+=se)if(p=u[$][S],!!p&&(y=p.indexOf("y"),p.slice(y)===U)){I[U]=p.slice(0,y);break}}else for(S=ue;S!==he;S+=se)if(g=h.xaxes[S],d.cartesian.indexOf(g+U)!==-1){I[U]=g;break}}}}function o(s,c,h,m,d){var T=new Array(h),l;function _(w,S){c.indexOf(S)!==-1&&m[S]===void 0?(T[w]=S,m[S]=w):T[w]=""}if(Array.isArray(s))for(l=0;l<h;l++)_(l,s[l]);else for(_(0,d),l=1;l<h;l++)_(l,d+(l+1));return T}q.exports={moduleType:"component",name:"grid",schema:{layout:{grid:t}},layoutAttributes:t,sizeDefaults:i,contentDefaults:n}}}),XS=Ze({"src/components/errorbars/attributes.js"(Z,q){"use strict";q.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}}),RB=Ze({"src/components/errorbars/defaults.js"(Z,q){"use strict";var v=is(),x=oo(),A=ca(),M=Dl(),e=XS();q.exports=function(t,r,i,a){var n="error_"+a.axis,o=M.newContainer(r,n),s=t[n]||{};function c(w,S){return A.coerce(s,o,e,w,S)}var h=s.array!==void 0||s.value!==void 0||s.type==="sqrt",m=c("visible",h);if(m!==!1){var d=c("type","array"in s?"data":"percent"),T=!0;d!=="sqrt"&&(T=c("symmetric",!((d==="data"?"arrayminus":"valueminus")in s))),d==="data"?(c("array"),c("traceref"),T||(c("arrayminus"),c("tracerefminus"))):(d==="percent"||d==="constant")&&(c("value"),T||c("valueminus"));var l="copy_"+a.inherit+"style";if(a.inherit){var _=r["error_"+a.inherit];(_||{}).visible&&c(l,!(s.color||v(s.thickness)||v(s.width)))}(!a.inherit||!o[l])&&(c("color",i),c("thickness"),c("width",x.traceIs(r,"gl3d")?0:4))}}}}),ZS=Ze({"src/components/errorbars/compute_error.js"(Z,q){"use strict";q.exports=function(A){var M=A.type,e=A.symmetric;if(M==="data"){var t=A.array||[];if(e)return function(o,s){var c=+t[s];return[c,c]};var r=A.arrayminus||[];return function(o,s){var c=+t[s],h=+r[s];return!isNaN(c)||!isNaN(h)?[h||0,c||0]:[NaN,NaN]}}else{var i=v(M,A.value),a=v(M,A.valueminus);return e||A.valueminus===void 0?function(o){var s=i(o);return[s,s]}:function(o){return[a(o),i(o)]}}};function v(x,A){if(x==="percent")return function(M){return Math.abs(M*A/100)};if(x==="constant")return function(){return Math.abs(A)};if(x==="sqrt")return function(M){return Math.sqrt(Math.abs(M))}}}}),DB=Ze({"src/components/errorbars/calc.js"(Z,q){"use strict";var v=is(),x=oo(),A=Wo(),M=ca(),e=ZS();q.exports=function(i){for(var a=i.calcdata,n=0;n<a.length;n++){var o=a[n],s=o[0].trace;if(s.visible===!0&&x.traceIs(s,"errorBarsOK")){var c=A.getFromId(i,s.xaxis),h=A.getFromId(i,s.yaxis);t(o,s,c,"x"),t(o,s,h,"y")}}};function t(r,i,a,n){var o=i["error_"+n]||{},s=o.visible&&["linear","log"].indexOf(a.type)!==-1,c=[];if(s){for(var h=e(o),m=0;m<r.length;m++){var d=r[m],T=d.i;if(T===void 0)T=m;else if(T===null)continue;var l=d[n];if(v(a.c2l(l))){var _=h(l,T);if(v(_[0])&&v(_[1])){var w=d[n+"s"]=l-_[0],S=d[n+"h"]=l+_[1];c.push(w,S)}}}var E=a._id,g=i._extremes[E],b=A.findExtremes(a,c,M.extendFlat({tozero:g.opts.tozero},{padded:!0}));g.min=g.min.concat(b.min),g.max=g.max.concat(b.max)}}}}),zB=Ze({"src/components/errorbars/plot.js"(Z,q){"use strict";var v=Oi(),x=is(),A=as(),M=Fu();q.exports=function(r,i,a,n){var o,s=a.xaxis,c=a.yaxis,h=n&&n.duration>0,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;ue<F.length;ue++){var se=F[ue];if(N=se[0].trace,!!N._module){var he=N._module.colorbar;if(N.visible===!0&&he)for(var H=Array.isArray(he),$=H?he:[he],J=0;J<$.length;J++){U=$[J];var X=U.container;I=X?N[X]:N,I&&I.showscale&&(O=W(I.colorbar),O._id="cb"+N.uid+(H&&X?"-"+X:""),O._traceIndex=N.index,O._propPrefix=(X?X+".":"")+"colorbar.",O._meta=N._meta,Q(),B.push(O))}}}for(var oe in z._colorAxes)if(I=z[oe],I.showscale){var ne=z._colorAxes[oe];O=W(I.colorbar),O._id="cb"+oe,O._propPrefix=oe+".colorbar.",O._meta=z._meta,U={min:"cmin",max:"cmax"},ne[0]!=="heatmap"&&(N=ne[1],U.calc=N._module.colorbar.calc),Q(),B.push(O)}return B}function u(L,z,F){var B=z.orientation==="v",O=z.len,I=z.lenmode,N=z.thickness,U=z.thicknessmode,W=z.outlinewidth,Q=z.borderwidth,ue=z.bgcolor,se=z.xanchor,he=z.yanchor,H=z.xpad,$=z.ypad,J=z.x,X=B?z.y:1-z.y,oe=z.yref==="paper",ne=z.xref==="paper",j=F._fullLayout,ee=j._size,re=z._fillcolor,ce=z._line,be=z.title,Ae=be.side,ze=z._zrange||v.extent((typeof re=="function"?re:ce.color).domain()),Re=typeof ce.color=="function"?ce.color:function(){return ce.color},We=typeof re=="function"?re:function(){return re},it=z._levels,ot=f(F,z,ze),tt=ot.fill,ut=ot.line,Me=Math.round(N*(U==="fraction"?B?ee.w:ee.h:1)),_e=Me/(B?ee.w:ee.h),fe=Math.round(O*(I==="fraction"?B?ee.h:ee.w:1)),Fe=fe/(B?ee.h:ee.w),rt=ne?ee.w:F._fullLayout.width,st=oe?ee.h:F._fullLayout.height,Qe=Math.round(B?J*rt+H:X*st+$),Lt={center:.5,right:1}[se]||0,kt={top:1,middle:.5}[he]||0,qt=B?J-Lt*_e:X-kt*_e,Zt=B?X-kt*Fe:J-Lt*Fe,Sr=Math.round(B?st*(1-Zt):rt*Zt);z._lenFrac=Fe,z._thickFrac=_e,z._uFrac=qt,z._vFrac=Zt;var xr=z._axis=P(F,z,ze);xr.position=_e+(B?J+H/ee.w:X+$/ee.h);var jr=["top","bottom"].indexOf(Ae)!==-1;if(B&&jr&&(xr.title.side=Ae,xr.titlex=J+H/ee.w,xr.titley=Zt+(be.side==="top"?Fe-$/ee.h:$/ee.h)),!B&&!jr&&(xr.title.side=Ae,xr.titley=X+$/ee.h,xr.titlex=Zt+H/ee.w),ce.color&&z.tickmode==="auto"){xr.tickmode="linear",xr.tick0=it.start;var wr=it.size,Ir=r.constrain(fe/50,4,15)+1,bt=(ze[1]-ze[0])/((z.nticks||Ir)*wr);if(bt>1){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("<br>").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&&N<se&&O.push(N);if(z._fillgradient)I=[0];else if(typeof z._fillcolor=="function"){var he=z._filllevels;if(he)for(W=he.end+he.size/100,Q=he.size,U=0;U<1e5&&(N=he.start+U*Q,!(Q>0?N>=W:N<=W));U++)N>F[0]&&N<F[1]&&I.push(N);else I=O.map(function(H){return H-B.size/2}),I.push(I[I.length-1]+B.size)}else z._fillcolor&&typeof z._fillcolor=="string"&&(I=[0]);return B.size<0&&(O.reverse(),I.reverse()),{line:O,fill:I}}function P(L,z,F){var B=L._fullLayout,O=z.orientation==="v",I={type:"linear",range:F,tickmode:z.tickmode,nticks:z.nticks,tick0:z.tick0,dtick:z.dtick,tickvals:z.tickvals,ticktext:z.ticktext,ticks:z.ticks,ticklen:z.ticklen,tickwidth:z.tickwidth,tickcolor:z.tickcolor,showticklabels:z.showticklabels,labelalias:z.labelalias,ticklabelposition:z.ticklabelposition,ticklabeloverflow:z.ticklabeloverflow,ticklabelstep:z.ticklabelstep,tickfont:z.tickfont,tickangle:z.tickangle,tickformat:z.tickformat,exponentformat:z.exponentformat,minexponent:z.minexponent,separatethousands:z.separatethousands,showexponent:z.showexponent,showtickprefix:z.showtickprefix,tickprefix:z.tickprefix,showticksuffix:z.showticksuffix,ticksuffix:z.ticksuffix,title:z.title,showline:!0,anchor:"free",side:O?"right":"bottom",position:1},N=O?"y":"x",U={type:"linear",_id:N+z._id},W={letter:N,font:B.font,noAutotickangles:N==="y",noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:B.calendar};function Q(ue,se){return r.coerce(I,U,l,ue,se)}return d(I,U,Q,W,B),T(I,U,Q,W),U}q.exports={draw:b}}}),UB=Ze({"src/components/colorbar/index.js"(Z,q){"use strict";q.exports={moduleType:"component",name:"colorbar",attributes:_2(),supplyDefaults:cS(),draw:NB().draw,hasColorbar:sS()}}}),jB=Ze({"src/components/legend/index.js"(Z,q){"use strict";q.exports={moduleType:"component",name:"legend",layoutAttributes:pS(),supplyLayoutDefaults:dS(),draw:gS(),style:mS()}}}),VB=Ze({"src/locale-en.js"(Z,q){"use strict";q.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),qB=Ze({"src/locale-en-us.js"(Z,q){"use strict";q.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),YS=Ze({"src/snapshot/cloneplot.js"(Z,q){"use strict";var v=oo(),x=ca(),A=x.extendFlat,M=x.extendDeep;function e(r){var i;switch(r){case"themes__thumb":i={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":i={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:i={}}return i}function t(r){var i=["xaxis","yaxis","zaxis"];return i.indexOf(r.slice(0,5))>-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<d.length;n++)t(d[n])&&(h[d[n]].title={text:""});for(n=0;n<c.length;n++){var T=c[n];T.showscale=!1,T.marker&&(T.marker.showscale=!1),v.traceIs(T,"pie-like")&&(T.textposition="none")}}if(Array.isArray(a.annotations))for(n=0;n<a.annotations.length;n++)h.annotations.push(a.annotations[n]);var l=Object.keys(h).filter(function(g){return g.match(/^scene\d*$/)});if(l.length){var _={};for(a.tileClass==="thumbnail"&&(_={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<l.length;n++){var w=h[l[n]];w.xaxis||(w.xaxis={}),w.yaxis||(w.yaxis={}),w.zaxis||(w.zaxis={}),A(w.xaxis,_),A(w.yaxis,_),A(w.zaxis,_),w._scene=null}}var S=document.createElement("div");a.tileClass&&(S.className=a.tileClass);var E={gd:S,td:S,layout:h,data:c,config:{staticPlot:a.staticPlot===void 0?!0:a.staticPlot,plotGlPixelRatio:a.plotGlPixelRatio===void 0?2:a.plotGlPixelRatio,displaylogo:a.displaylogo||!1,showLink:a.showLink||!1,showTips:a.showTips||!1,mapboxAccessToken:m.mapboxAccessToken}};return a.setBackground!=="transparent"&&(E.config.setBackground=a.setBackground||"opaque"),E.gd.defaultLayout=e(a.tileClass),E}}}),GB=Ze({"src/snapshot/toimage.js"(Z,q){"use strict";var v=Wg().EventEmitter,x=oo(),A=ca(),M=Zv(),e=YS(),t=k2(),r=L2();function i(a,n){var o=new v,s=e(a,{format:"png"}),c=s.gd;c.style.position="absolute",c.style.left="-5000px",document.body.appendChild(c);function h(){var d=M.getDelay(c._fullLayout);setTimeout(function(){var T=t(c),l=document.createElement("canvas");l.id=A.randstr(),o=r({format:n.format,width:c._fullLayout.width,height:c._fullLayout.height,canvas:l,emitter:o,svg:T}),o.clean=function(){c&&document.body.removeChild(c)}},d)}var m=M.getRedrawFunc(c);return x.call("_doPlot",c,s.data,s.layout,s.config).then(m).then(h).catch(function(d){o.emit("error",d)}),o}q.exports=i}}),HB=Ze({"src/snapshot/index.js"(Z,q){"use strict";var v=Zv(),x={getDelay:v.getDelay,getRedrawFunc:v.getRedrawFunc,clone:YS(),toSVG:k2(),svgToImg:L2(),toImage:GB(),downloadImage:RS()};q.exports=x}}),WB=Ze({"src/core.js"(Z){"use strict";Z.version=Eh().version,Bp(),rO();var q=oo(),v=Z.register=q.register,x=qO(),A=Object.keys(x);for(e=0;e<A.length;e++)M=A[e],M.charAt(0)!=="_"&&(Z[M]=x[M]),v({moduleType:"apiMethod",name:M,fn:x[M]});var M,e;v($O()),v([nB(),lB(),Tf(),hB(),mB(),xB(),TB(),CB(),IB(),WS(),OB(),rc(),UB(),jB(),ef(),SS()]),v([VB(),qB()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(v(window.PlotlyLocales),delete window.PlotlyLocales),Z.Icons=w2();var t=ef(),r=xc();Z.Plots={resize:r.resize,graphJson:r.graphJson,sendDataToCloud:r.sendDataToCloud},Z.Fx={hover:t.hover,unhover:t.unhover,loneHover:t.loneHover,loneUnhover:t.loneUnhover},Z.Snapshot=HB(),Z.PlotSchema=e1()}}),XB=Ze({"lib/core.js"(Z,q){"use strict";q.exports=WB()}}),Qg=Ze({"src/traces/bar/constants.js"(Z,q){"use strict";q.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}}),Sv=Ze({"src/traces/bar/attributes.js"(Z,q){"use strict";var v=tf(),x=Qc().axisHoverFormat,A=Cs().hovertemplateAttrs,M=Cs().texttemplateAttrs,e=Mu(),t=tc(),r=Qg(),i=Gh().pattern,a=rs().extendFlat,n=t({editType:"calc",arrayOk:!0,colorEditType:"style"}),o=v.marker,s=o.line,c=a({},s.width,{dflt:0}),h=a({width:c,editType:"calc"},e("marker.line")),m=a({line:h,editType:"calc"},e("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:i,cornerradius:{valType:"any",editType:"calc"}});q.exports={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:x("x"),yhoverformat:x("y"),text:v.text,texttemplate:M({editType:"plot"},{keys:r.eventDataKeys}),hovertext:v.hovertext,hovertemplate:A({},{keys:r.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:a({},n,{}),insidetextfont:a({},n,{}),outsidetextfont:a({},n,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:a({},v.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:m,offsetgroup:v.offsetgroup,alignmentgroup:v.alignmentgroup,selected:{marker:{opacity:v.selected.marker.opacity,color:v.selected.marker.color,editType:"style"},textfont:v.selected.textfont,editType:"style"},unselected:{marker:{opacity:v.unselected.marker.opacity,color:v.unselected.marker.color,editType:"style"},textfont:v.unselected.textfont,editType:"style"},zorder:v.zorder}}}),U2=Ze({"src/traces/bar/layout_attributes.js"(Z,q){"use strict";q.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}}),j2=Ze({"src/traces/bar/style_defaults.js"(Z,q){"use strict";var v=Yi(),x=Up().hasColorscale,A=gh(),M=ca().coercePattern;q.exports=function(t,r,i,a,n){var o=i("marker.color",a),s=x(t,"marker");s&&A(t,r,n,i,{prefix:"marker.",cLetter:"c"}),i("marker.line.color",v.defaultLine),x(t,"marker.line")&&A(t,r,n,i,{prefix:"marker.line.",cLetter:"c"}),i("marker.line.width"),i("marker.opacity"),M(i,"marker.pattern",o,s),i("selected.marker.color"),i("unselected.marker.color")}}}),gd=Ze({"src/traces/bar/defaults.js"(Z,q){"use strict";var v=is(),x=ca(),A=Yi(),M=oo(),e=i1(),t=Qd(),r=j2(),i=Jg(),a=Sv(),n=x.coerceFont;function o(m,d,T,l){function _(b,p){return x.coerce(m,d,a,b,p)}var w=e(m,d,l,_);if(!w){d.visible=!1;return}t(m,d,l,_),_("xhoverformat"),_("yhoverformat"),_("zorder"),_("orientation",d.x&&!d.y?"h":"v"),_("base"),_("offset"),_("width"),_("text"),_("hovertext"),_("hovertemplate");var S=_("textposition");h(m,d,l,_,S,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),r(m,d,_,T,l);var E=(d.marker.line||{}).color,g=M.getComponentMethod("errorbars","supplyDefaults");g(m,d,E||A.defaultLine,{axis:"y"}),g(m,d,E||A.defaultLine,{axis:"x",inherit:"y"}),x.coerceSelectionMarkerOpacity(d,_)}function s(m,d){var T,l;function _(E,g){return x.coerce(l._input,l,a,E,g)}for(var w=0;w<m.length;w++)if(l=m[w],l.type==="bar"){T=l._input;var S=_("marker.cornerradius",d.barcornerradius);l.marker&&(l.marker.cornerradius=c(S)),i(T,l,d,_,d.barmode)}}function c(m){if(v(m)){if(m=+m,m>=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;d<i.length;d++){var T=i[d];if(v.traceIs(T,"bar")&&T.visible)n=!0;else continue;var l=T.xaxis+T.yaxis;if(m?(c[l]&&(s=!0),c[l]=!0):(l+=T._input.offsetgroup,c.length>0&&!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;e<A.length;e++)A[e].i=e;v.mergeArray(M.text,A,"tx"),v.mergeArray(M.hovertext,A,"htx");var t=M.marker;if(t){v.mergeArray(t.opacity,A,"mo",!0),v.mergeArray(t.color,A,"mc");var r=t.line;r&&(v.mergeArray(r.color,A,"mlc"),v.mergeArrayCastPositive(r.width,A,"mlw"))}}}}),ZB=Ze({"src/traces/bar/calc.js"(Z,q){"use strict";var v=Wo(),x=tv(),A=Up().hasColorscale,M=jp(),e=O_(),t=Od();q.exports=function(i,a){var n=v.getFromId(i,a.xaxis||"x"),o=v.getFromId(i,a.yaxis||"y"),s,c,h,m,d,T,l={msUTC:!!(a.base||a.base===0)};a.orientation==="h"?(s=n.makeCalcdata(a,"x",l),h=o.makeCalcdata(a,"y"),m=x(a,o,"y",h),d=!!a.yperiodalignment,T="y"):(s=o.makeCalcdata(a,"y",l),h=n.makeCalcdata(a,"x"),m=x(a,n,"x",h),d=!!a.xperiodalignment,T="x"),c=m.vals;for(var _=Math.min(c.length,s.length),w=new Array(_),S=0;S<_;S++)w[S]={p:c[S],s:s[S]},d&&(w[S].orig_p=h[S],w[S][T+"End"]=m.ends[S],w[S][T+"Start"]=m.starts[S]),a.ids&&(w[S].id=String(a.ids[S]));return A(a,"marker")&&M(i,a,{vals:a.marker.color,containerStr:"marker",cLetter:"c"}),A(a,"marker.line")&&M(i,a,{vals:a.marker.line.color,containerStr:"marker.line",cLetter:"c"}),e(w,a),t(w,a),w}}}),wp=Ze({"src/traces/bar/uniform_text.js"(Z,q){"use strict";var v=Oi(),x=ca();function A(r,i,a){var n=r._fullLayout,o=n["_"+a+"Text_minsize"];if(o){var s=n.uniformtext.mode==="hide",c;switch(a){case"funnelarea":case"pie":case"sunburst":c="g.slice";break;case"treemap":case"icicle":c="g.slice, g.pathbar";break;default:c="g.points > g.point"}i.selectAll(c).each(function(h){var m=h.transform;if(m){m.scale=s&&m.hide?0:o/m.fontSize;var d=v.select(this).select("text");x.setTransormAndDisplay(d,m)}})}}function M(r,i,a){if(a.uniformtext.mode){var n=t(r),o=a.uniformtext.minsize,s=i.scale*i.fontSize;i.hide=s<o,a[n]=a[n]||1/0,i.hide||(a[n]=Math.min(a[n],Math.max(s,o)))}}function e(r,i){var a=t(r);i[a]=void 0}function t(r){return"_"+r+"Text_minsize"}q.exports={recordMinTextSize:M,clearMinTextSize:e,resizeText:A}}}),V2=Ze({"src/traces/bar/helpers.js"(Z){"use strict";var q=is(),v=Ch(),x=ca().isArrayOrTypedArray;Z.coerceString=function(A,M,e){if(typeof M=="string"){if(M||!A.noBlank)return M}else if((typeof M=="number"||M===!0)&&!A.strict)return String(M);return e!==void 0?e:A.dflt},Z.coerceNumber=function(A,M,e){if(q(M)){M=+M;var t=A.min,r=A.max,i=t!==void 0&&M<t||r!==void 0&&M>r;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)?M<A.length&&(e=A[M]):e=A,e},Z.getLineWidth=function(A,M){var e=0<M.mlw?M.mlw:x(A.marker.line.width)?0:A.marker.line.width;return e}}}),Nd=Ze({"src/traces/bar/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=as(),M=ca(),e=oo(),t=wp().resizeText,r=Sv(),i=r.textfont,a=r.insidetextfont,n=r.outsidetextfont,o=V2();function s(b){var p=v.select(b).selectAll('g[class^="barlayer"]').selectAll("g.trace");t(b,p,"bar");var u=p.size(),y=b._fullLayout;p.style("opacity",function(f){return f[0].trace.opacity}).each(function(f){(y.barmode==="stack"&&u>1||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 Q<ue?1:-1}function b(Q,ue,se,he){var H=[],$=[],J=he?ue:se,X=he?se:ue;return H[0]=J.c2p(Q.s0,!0),$[0]=X.c2p(Q.p0,!0),H[1]=J.c2p(Q.s1,!0),$[1]=X.c2p(Q.p1,!0),he?[H,$]:[$,H]}function p(Q,ue,se,he){if(!ue.uniformtext.mode&&u(se)){var H;return he&&(H=he()),Q.transition().duration(se.duration).ease(se.easing).each("end",function(){H&&H()}).each("interrupt",function(){H&&H()})}else return Q}function u(Q){return Q&&Q.duration>0}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))),Tt<Te){var Gt=g(kt,qt),rr=g(Zt,Sr),Qt=Gt===-rr?1:0;if(tt)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(qt-kt)+Tt;var Tr=at<Te?Te-Math.sqrt(at*(2*Te-at)):0,la=Tt>0?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=at<Te?Te-Math.sqrt(at*(2*Te-at)):0,Ra=Tt>0?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]<ce.range[1]?$=0:$=ce._length):be.type==="log"&&kt.s0<=0&&(be.range[0]<be.range[1]?X=be._length:X=0);var qt=Math.abs(J-$),Zt=Math.abs(oe-X),Sr=qt-2*_,xr=Zt-2*_,jr,wr,Ir,bt,Be;if(ze==="outside"&&!Me&&!ut.hasB&&(ze="inside"),ze==="auto")if(Me){ze="inside",Be=A.ensureUniformFontSize(Q,st),jr=Re(se,ot,Be),wr=t.bBox(jr.node()),Ir=wr.width,bt=wr.height;var Ke=Ir>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<it!=ot<tt)&&(Me+=90);var _e=z(H,Me),fe,Fe;if(ze&&ze-Re>_){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("<br>")}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;s<e.length;s++)e[s].selected=0;else for(s=0;s<e.length;s++){var c=e[s],h="ct"in c?c.ct:v(c,t,r,n,a);M.contains(h,!1,s,A)?(o.push({pointNumber:s,x:t.c2d(c.x),y:r.c2d(c.y)}),c.selected=1):c.selected=0}return o};function v(x,A,M,e,t){var r=A.c2p(e?x.s0:x.p0,!0),i=A.c2p(e?x.s1:x.p1,!0),a=M.c2p(e?x.p0:x.s0,!0),n=M.c2p(e?x.p1:x.s1,!0);return t?[(r+i)/2,(a+n)/2]:e?[i,(a+n)/2]:[(r+i)/2,n]}}}),KB=Ze({"src/traces/bar/index.js"(Z,q){"use strict";q.exports={attributes:Sv(),layoutAttributes:U2(),supplyDefaults:gd().supplyDefaults,crossTraceDefaults:gd().crossTraceDefaults,supplyLayoutDefaults:KS(),calc:ZB(),crossTraceCalc:$g().crossTraceCalc,colorbar:hp(),arraysToCalcdata:O_(),plot:e0().plot,style:Nd().style,styleOnSelect:Nd().styleOnSelect,hoverPoints:f1().hoverPoints,eventData:YB(),selectPoints:h1(),moduleType:"trace",name:"bar",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}}),JB=Ze({"lib/bar.js"(Z,q){"use strict";q.exports=KB()}}),B_=Ze({"src/traces/box/attributes.js"(Z,q){"use strict";var v=$d(),x=tf(),A=Sv(),M=oh(),e=Qc().axisHoverFormat,t=Cs().hovertemplateAttrs,r=rs().extendFlat,i=x.marker,a=i.line;q.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:x.xperiod,yperiod:x.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:x.xperiodalignment,yperiodalignment:x.yperiodalignment,xhoverformat:e("x"),yhoverformat:e("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:r({},i.symbol,{arrayOk:!1,editType:"plot"}),opacity:r({},i.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:r({},i.angle,{arrayOk:!1,editType:"calc"}),size:r({},i.size,{arrayOk:!1,editType:"calc"}),color:r({},i.color,{arrayOk:!1,editType:"style"}),line:{color:r({},a.color,{arrayOk:!1,dflt:M.defaultLine,editType:"style"}),width:r({},a.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:v(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:A.offsetgroup,alignmentgroup:A.alignmentgroup,selected:{marker:x.selected.marker,editType:"style"},unselected:{marker:x.unselected.marker,editType:"style"},text:r({},x.text,{}),hovertext:r({},x.hovertext,{}),hovertemplate:t({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:x.zorder}}}),N_=Ze({"src/traces/box/layout_attributes.js"(Z,q){"use strict";q.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}}),U_=Ze({"src/traces/box/defaults.js"(Z,q){"use strict";var v=ca(),x=oo(),A=Yi(),M=Qd(),e=Jg(),t=a1(),r=B_();function i(s,c,h,m){function d(u,y){return v.coerce(s,c,r,u,y)}if(a(s,c,d,m),c.visible!==!1){M(s,c,m,d),d("xhoverformat"),d("yhoverformat");var T=c._hasPreCompStats;T&&(d("lowerfence"),d("upperfence")),d("line.color",(s.marker||{}).color||h),d("line.width"),d("fillcolor",A.addOpacity(c.line.color,.5));var l=!1;if(T){var _=d("mean"),w=d("sd");_&&_.length&&(l=!0,w&&w.length&&(l="sd"))}d("whiskerwidth");var S=d("sizemode"),E;S==="quartiles"&&(E=d("boxmean",l)),d("showwhiskers",S==="quartiles"),(S==="sd"||E==="sd")&&d("sdmultiple"),d("width"),d("quartilemethod");var g=!1;if(T){var b=d("notchspan");b&&b.length&&(g=!0)}else v.validate(s.notchwidth,r.notchwidth)&&(g=!0);var p=d("notched",g);p&&d("notchwidth"),n(s,c,d,{prefix:"box"}),d("zorder")}}function a(s,c,h,m){function d(W){var Q=0;return W&&W.length&&(Q+=1,v.isArrayOrTypedArray(W[0])&&W[0].length&&(Q+=1)),Q}function T(W){return v.validate(s[W],r[W])}var l=h("y"),_=h("x"),w;if(c.type==="box"){var S=h("q1"),E=h("median"),g=h("q3");c._hasPreCompStats=S&&S.length&&E&&E.length&&g&&g.length,w=Math.min(v.minRowLength(S),v.minRowLength(E),v.minRowLength(g))}var b=d(l),p=d(_),u=b&&v.minRowLength(l),y=p&&v.minRowLength(_),f=m.calendar,P={autotypenumbers:m.autotypenumbers},L,z;if(c._hasPreCompStats)switch(String(p)+String(b)){case"00":var F=T("x0")||T("dx"),B=T("y0")||T("dy");B&&!F?L="h":L="v",z=w;break;case"10":L="v",z=Math.min(w,y);break;case"20":L="h",z=Math.min(w,_.length);break;case"01":L="h",z=Math.min(w,u);break;case"02":L="v",z=Math.min(w,l.length);break;case"12":L="v",z=Math.min(w,y,l.length);break;case"21":L="h",z=Math.min(w,_.length,u);break;case"11":z=0;break;case"22":var O=!1,I;for(I=0;I<_.length;I++)if(t(_[I],f,P)==="category"){O=!0;break}if(O)L="v",z=Math.min(w,y,l.length);else{for(I=0;I<l.length;I++)if(t(l[I],f,P)==="category"){O=!0;break}O?(L="h",z=Math.min(w,_.length,u)):(L="v",z=Math.min(w,y,l.length))}break}else b>0?(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;T<s.length;T++){m=s[T];var l=m.type;if(l==="box"||l==="violin"){h=m._input;var _=c[l+"mode"];_==="group"&&e(h,m,c,d,_)}}}q.exports={supplyDefaults:i,crossTraceDefaults:o,handleSampleDefaults:a,handlePointsDefaults:n}}}),q2=Ze({"src/traces/box/layout_defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=N_();function M(t,r,i,a,n){for(var o=n+"Layout",s=!1,c=0;c<i.length;c++){var h=i[c];if(v.traceIs(h,o)){s=!0;break}}s&&(a(n+"mode"),a(n+"gap"),a(n+"groupgap"))}function e(t,r,i){function a(n,o){return x.coerce(t,r,A,n,o)}M(t,r,i,a,"box")}q.exports={supplyLayoutDefaults:e,_supply:M}}}),JS=Ze({"src/traces/box/calc.js"(Z,q){"use strict";var v=is(),x=Wo(),A=tv(),M=ca(),e=Vs().BADNUM,t=M._;q.exports=function(S,E){var g=S._fullLayout,b=x.getFromId(S,E.xaxis||"x"),p=x.getFromId(S,E.yaxis||"y"),u=[],y=E.type==="violin"?"_numViolins":"_numBoxes",f,P,L,z,F,B,O;E.orientation==="h"?(L=b,z="x",F=p,B="y",O=!!E.yperiodalignment):(L=p,z="y",F=b,B="x",O=!!E.xperiodalignment);var I=r(E,B,F,g[y]),N=I[0],U=I[1],W=M.distinctVals(N,F),Q=W.vals,ue=W.minDiff/2,se,he,H,$,J,X,oe=(E.boxpoints||E.points)==="all"?M.identity:function(xr){return xr.v<se.lf||xr.v>se.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<E._length;f++){var ce=N[f];if(v(ce)){if(se={},se.pos=se[B]=ce,O&&U&&(se.orig_p=U[f]),se.q1=j("q1"),se.med=j("median"),se.q3=j("q3"),he=[],ne&&M.isArrayOrTypedArray(ne[f]))for(P=0;P<ne[f].length;P++)X=L.d2c(ne[f][P]),X!==e&&(J={v:X,i:[f,P]},o(J,E,[f,P]),he.push(J));if(se.pts=he.sort(c),H=se[z]=he.map(h),$=H.length,se.med!==e&&se.q1!==e&&se.q3!==e&&se.med>=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<E._length;f++)if(X=ut[f],!!v(X)){var Fe=M.findBin(N[f],Me);Fe>=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;B<z;B++)F[B]=L;return[F]}function i(w,S){for(var E=w.length,g=new Array(E+1),b=0;b<E;b++)g[b]=w[b]-S;return g[E]=w[E-1]+S,g}function a(w){for(var S=new Array(w),E=0;E<w;E++)S[E]=[];return S}var n={text:"tx",hovertext:"htx"};function o(w,S,E){for(var g in n)M.isArrayOrTypedArray(S[g])&&(Array.isArray(E)?M.isArrayOrTypedArray(S[g][E[0]])&&(w[n[g]]=S[g][E[0]][E[1]]):w[n[g]]=S[g][E])}function s(w,S){if(M.isArrayOrTypedArray(S.selectedpoints))for(var E=0;E<w.length;E++){for(var g=w[E].pts||[],b={},p=0;p<g.length;p++)b[g[p].i]=p;M.tagSelected(g,S,b)}}function c(w,S){return w.v-S.v}function h(w){return w.v}function m(w,S,E){return E===0?w.q1:Math.min(w.q1,S[Math.min(M.findBin(2.5*w.q1-1.5*w.q3,S,!0)+1,E-1)])}function d(w,S,E){return E===0?w.q3:Math.max(w.q3,S[Math.max(M.findBin(2.5*w.q3-1.5*w.q1,S),0)])}function T(w){return 4*w.q1-3*w.q3}function l(w){return 4*w.q3-3*w.q1}function _(w,S){return S===0?0:1.57*(w.q3-w.q1)/Math.sqrt(S)}}}),G2=Ze({"src/traces/box/cross_trace_calc.js"(Z,q){"use strict";var v=Wo(),x=ca(),A=Yg().getAxisGroup,M=["v","h"];function e(r,i){for(var a=r.calcdata,n=i.xaxis,o=i.yaxis,s=0;s<M.length;s++){for(var c=M[s],h=c==="h"?o:n,m=[],d=0;d<a.length;d++){var T=a[d],l=T[0].t,_=T[0].trace;_.visible===!0&&(_.type==="box"||_.type==="candlestick")&&!l.empty&&(_.orientation||"v")===c&&_.xaxis===n._id&&_.yaxis===o._id&&m.push(d)}t("box",r,m,h)}}function t(r,i,a,n){var o=i.calcdata,s=i._fullLayout,c=n._id,h=c.charAt(0),m,d,T,l=[],_=0;for(m=0;m<a.length;m++)for(T=o[a[m]],d=0;d<T.length;d++)l.push(n.c2l(T[d].pos,!0)),_+=(T[d].pts2||[]).length;if(l.length){var w=x.distinctVals(l);(n.type==="category"||n.type==="multicategory")&&(w.minDiff=1);var S=w.minDiff/2;v.minDtick(n,w.minDiff,w.vals[0],!0);var E=r==="violin"?"_numViolins":"_numBoxes",g=s[E],b=s[r+"mode"]==="group"&&g>1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(m=0;m<a.length;m++){T=o[a[m]];var y=T[0].trace,f=T[0].t,P=y.width,L=y.side,z,F,B,O;if(P)z=F=O=P/2,B=0;else if(z=S,b){var I=A(s,n._id)+y.orientation,N=s._alignmentOpts[I]||{},U=N[y.alignmentgroup]||{},W=Object.keys(U.offsetGroups||{}).length,Q=W||g,ue=W?y._offsetIndex:f.num;F=z*p*u/Q,B=2*z*(-.5+(ue+.5)/Q)*p,O=z*p/Q}else F=z*p*u,B=0,O=z;f.dPos=z,f.bPos=B,f.bdPos=F,f.wHover=O;var se,he,H=B+F,$,J,X,oe,ne,j,ee=!!P,re=(y.boxpoints||y.points)&&_>0;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;d<T.length;d++)We[d]=T[d].pos;y._extremes[c]=v.findExtremes(n,We,{padded:ee,vpadminus:oe,vpadplus:X,vpadLinearized:!0,ppadminus:{x:j,y:ne}[h],ppadplus:{x:ne,y:j}[h]})}}}q.exports={crossTraceCalc:e,setPositionOffset:t}}}),H2=Ze({"src/traces/box/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=5,e=.01;function t(n,o,s,c){var h=n._context.staticPlot,m=o.xaxis,d=o.yaxis;x.makeTraceGroups(c,s,"trace boxes").each(function(T){var l=v.select(this),_=T[0],w=_.t,S=_.trace;if(w.wdPos=w.bdPos*S.whiskerwidth,S.visible!==!0||w.empty){l.remove();return}var E,g;S.orientation==="h"?(E=d,g=m):(E=m,g=d),r(l,{pos:E,val:g},S,w,h),i(l,{x:m,y:d},S,w),a(l,{pos:E,val:g},S,w)})}function r(n,o,s,c,h){var m=s.orientation==="h",d=o.val,T=o.pos,l=!!T.rangebreaks,_=c.bPos,w=c.wdPos||0,S=c.bPosPxOffset||0,E=s.whiskerwidth||0,g=s.showwhiskers!==!1,b=s.notched||!1,p=b?1-2*s.notchwidth:1,u,y;Array.isArray(c.bdPos)?(u=c.bdPos[0],y=c.bdPos[1]):(u=c.bdPos,y=c.bdPos);var f=n.selectAll("path.box").data(s.type!=="violin"||s.box.visible?x.identity:[]);f.enter().append("path").style("vector-effect",h?"none":"non-scaling-stroke").attr("class","box"),f.exit().remove(),f.each(function(P){if(P.empty)return v.select(this).attr("d","M0,0Z");var L=T.c2l(P.pos+_,!0),z=T.l2p(L-u)+S,F=T.l2p(L+y)+S,B=l?(z+F)/2:T.l2p(L)+S,O=s.whiskerwidth,I=l?z*O+(1-O)*B:T.l2p(L-w)+S,N=l?F*O+(1-O)*B:T.l2p(L+w)+S,U=T.l2p(L-u*p)+S,W=T.l2p(L+y*p)+S,Q=s.sizemode==="sd",ue=d.c2p(Q?P.mean-P.sd:P.q1,!0),se=Q?d.c2p(P.mean+P.sd,!0):d.c2p(P.q3,!0),he=x.constrain(Q?d.c2p(P.mean,!0):d.c2p(P.med,!0),Math.min(ue,se)+1,Math.max(ue,se)-1),H=P.lf===void 0||s.boxpoints===!1||Q,$=d.c2p(H?P.min:P.lf,!0),J=d.c2p(H?P.max:P.uf,!0),X=d.c2p(P.ln,!0),oe=d.c2p(P.un,!0);m?v.select(this).attr("d","M"+he+","+U+"V"+W+"M"+ue+","+z+"V"+F+(b?"H"+X+"L"+he+","+W+"L"+oe+","+F:"")+"H"+se+"V"+z+(b?"H"+oe+"L"+he+","+U+"L"+X+","+z:"")+"Z"+(g?"M"+ue+","+B+"H"+$+"M"+se+","+B+"H"+J+(E===0?"":"M"+$+","+I+"V"+N+"M"+J+","+I+"V"+N):"")):v.select(this).attr("d","M"+U+","+he+"H"+W+"M"+z+","+ue+"H"+F+(b?"V"+X+"L"+W+","+he+"L"+F+","+oe:"")+"V"+se+"H"+z+(b?"V"+oe+"L"+U+","+he+"L"+z+","+X:"")+"Z"+(g?"M"+B+","+ue+"V"+$+"M"+B+","+se+"V"+J+(E===0?"":"M"+I+","+$+"H"+N+"M"+I+","+J+"H"+N):""))})}function i(n,o,s,c){var h=o.x,m=o.y,d=c.bdPos,T=c.bPos,l=s.boxpoints||s.points;x.seedPseudoRandom();var _=function(E){return E.forEach(function(g){g.t=c,g.trace=s}),E},w=n.selectAll("g.points").data(l?_:[]);w.enter().append("g").attr("class","points"),w.exit().remove();var S=w.selectAll("path").data(function(E){var g,b=E.pts2,p=Math.max((E.max-E.min)/10,E.q3-E.q1),u=p*1e-9,y=p*e,f=[],P=0,L;if(s.jitter){if(p===0)for(P=1,f=new Array(b.length),g=0;g<b.length;g++)f[g]=1;else for(g=0;g<b.length;g++){var z=Math.max(0,g-M),F=b[z].v,B=Math.min(b.length-1,g+M),O=b[B].v;l!=="all"&&(b[g].v<E.lf?O=Math.min(O,E.lf):F=Math.max(F,E.uf));var I=Math.sqrt(y*(B-z)/(O-F+u))||0;I=x.constrain(Math.abs(I),0,1),f.push(I),P=Math.max(I,P)}L=s.jitter*2/(P||1)}for(g=0;g<b.length;g++){var N=b[g],U=N.v,W=s.jitter?L*f[g]*(x.pseudoRandom()-.5):0,Q=E.pos+T+d*(s.pointpos+W);s.orientation==="h"?(N.y=Q,N.x=U):(N.x=Q,N.y=U),l==="suspectedoutliers"&&U<E.uo&&U>E.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]<E.range[0];d.orientation===(X?"v":"h")&&J.reverse();for(var oe=a.spikeDistance,ne=a[he],j=[],ee=0;ee<J.length;ee++){var re=J[ee];if(re in Q){var ce=Q[re],be=E.c2p(ce,!0),Ae=x.extendFlat({},a);Ae.attr=re,Ae[w+"0"]=Ae[w+"1"]=be,Ae[w+"LabelVal"]=ce,Ae[w+"Label"]=(T.labels?T.labels[re]+" ":"")+v.hoverLabelText(E,ce,d[w+"hoverformat"]),Ae.hoverOnBox=!0,re==="mean"&&"sd"in Q&&(d.boxmean==="sd"||d.sizemode==="sd")&&(Ae[w+"err"]=Q.sd),Ae.hovertemplate=!1,j.push(Ae)}}a.name="",a.spikeDistance=void 0,a[he]=void 0;for(var ze=0;ze<j.length;ze++)j[ze].attr!=="med"?(j[ze].name="",j[ze].spikeDistance=void 0,j[ze][he]=void 0):(j[ze].spikeDistance=oe,j[ze][he]=ne);return j}function i(a,n,o){for(var s=a.cd,c=a.xa,h=a.ya,m=s[0].trace,d=c.c2p(n),T=h.c2p(o),l,_=function(I){var N=Math.max(3,I.mrc||0);return Math.max(Math.abs(c.c2p(I.x)-d)-N,1-3/N)},w=function(I){var N=Math.max(3,I.mrc||0);return Math.max(Math.abs(h.c2p(I.y)-T)-N,1-3/N)},S=A.quadrature(_,w),E=!1,g,b,p=0;p<s.length;p++){g=s[p];for(var u=0;u<(g.pts||[]).length;u++){b=g.pts[u];var y=S(b);y<=a.distance&&(a.distance=y,E=[p,u])}}if(!E)return!1;g=s[E[0]],b=g.pts[E[1]];var f=c.c2p(b.x,!0),P=h.c2p(b.y,!0),L=b.mrc||1;l=x.extendFlat({},a,{index:b.i,color:(m.marker||{}).color,name:m.name,x0:f-L,x1:f+L,y0:P-L,y1:P+L,spikeDistance:a.distance,hovertemplate:m.hovertemplate});var z=g.orig_p,F=z!==void 0?z:g.pos,B;m.orientation==="h"?(B=h,l.xLabelVal=b.x,l.yLabelVal=F):(B=c,l.xLabelVal=F,l.yLabelVal=b.y);var O=B._id.charAt(0);return l[O+"Spike"]=B.c2p(g.pos,!0),e(b,m,l),l}q.exports={hoverPoints:t,hoverOnBoxes:r,hoverOnPoints:i}}}),$B=Ze({"src/traces/box/event_data.js"(Z,q){"use strict";q.exports=function(x,A){return A.hoverOnBox&&(x.hoverOnBox=A.hoverOnBox),"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}}}),QS=Ze({"src/traces/box/select.js"(Z,q){"use strict";q.exports=function(x,A){var M=x.cd,e=x.xaxis,t=x.yaxis,r=[],i,a;if(A===!1)for(i=0;i<M.length;i++)for(a=0;a<(M[i].pts||[]).length;a++)M[i].pts[a].selected=0;else for(i=0;i<M.length;i++)for(a=0;a<(M[i].pts||[]).length;a++){var n=M[i].pts[a],o=e.c2p(n.x),s=t.c2p(n.y);A.contains([o,s],null,n.i,x)?(r.push({pointNumber:n.i,x:e.c2d(n.x),y:t.c2d(n.y)}),n.selected=1):n.selected=0}return r}}}),QB=Ze({"src/traces/box/index.js"(Z,q){"use strict";q.exports={attributes:B_(),layoutAttributes:N_(),supplyDefaults:U_().supplyDefaults,crossTraceDefaults:U_().crossTraceDefaults,supplyLayoutDefaults:q2().supplyLayoutDefaults,calc:JS(),crossTraceCalc:G2().crossTraceCalc,plot:H2().plot,style:W2().style,styleOnSelect:W2().styleOnSelect,hoverPoints:$S().hoverPoints,eventData:$B(),selectPoints:QS(),moduleType:"trace",name:"box",basePlotModule:Zf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}}),e4=Ze({"lib/box.js"(Z,q){"use strict";q.exports=QB()}}),p1=Ze({"src/traces/heatmap/attributes.js"(Z,q){"use strict";var v=tf(),x=eu(),A=tc(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=Mu(),i=rs().extendFlat;q.exports=i({z:{valType:"data_array",editType:"calc"},x:i({},v.x,{impliedEdits:{xtype:"array"}}),x0:i({},v.x0,{impliedEdits:{xtype:"scaled"}}),dx:i({},v.dx,{impliedEdits:{xtype:"scaled"}}),y:i({},v.y,{impliedEdits:{ytype:"array"}}),y0:i({},v.y0,{impliedEdits:{ytype:"scaled"}}),dy:i({},v.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:i({},v.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:i({},v.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:i({},v.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:i({},v.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:i({},v.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:i({},v.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:M("x"),yhoverformat:M("y"),zhoverformat:M("z",1),hovertemplate:e(),texttemplate:t({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:A({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:i({},x.showlegend,{dflt:!1}),zorder:v.zorder},r("",{cLetter:"z",autoColorDflt:!1}))}}),X2=Ze({"src/traces/heatmap/xyz_defaults.js"(Z,q){"use strict";var v=is(),x=ca(),A=oo();q.exports=function(r,i,a,n,o,s){var c=a("z");o=o||"x",s=s||"y";var h,m;if(c===void 0||!c.length)return 0;if(x.isArray1D(c)){h=a(o),m=a(s);var d=x.minRowLength(h),T=x.minRowLength(m);if(d===0||T===0)return 0;i._length=Math.min(d,T,c.length)}else{if(h=M(o,a),m=M(s,a),!e(c))return 0;a("transpose"),i._length=null}var l=A.getComponentMethod("calendars","handleTraceDefaults");return l(r,i,[o,s],n),!0};function M(t,r){var i=r(t),a=i?r(t+"type","array"):"scaled";return a==="scaled"&&(r(t+"0"),r("d"+t)),i}function e(t){for(var r=!0,i=!1,a=!1,n,o=0;o<t.length;o++){if(n=t[o],!x.isArrayOrTypedArray(n)){r=!1;break}n.length>0&&(i=!0);for(var s=0;s<n.length;s++)if(v(n[s])){a=!0;break}}return r&&i&&a}}}),j_=Ze({"src/traces/heatmap/label_defaults.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){A("texttemplate");var e=v.extendFlat({},M.font,{color:"auto",size:"auto"});v.coerceFont(A,"textfont",e)}}}),eM=Ze({"src/traces/heatmap/style_defaults.js"(Z,q){"use strict";q.exports=function(x,A,M){var e=M("zsmooth");e===!1&&(M("xgap"),M("ygap")),M("zhoverformat")}}}),t4=Ze({"src/traces/heatmap/defaults.js"(Z,q){"use strict";var v=ca(),x=X2(),A=j_(),M=Qd(),e=eM(),t=gh(),r=p1();q.exports=function(a,n,o,s){function c(m,d){return v.coerce(a,n,r,m,d)}var h=x(a,n,c,s);if(!h){n.visible=!1;return}M(a,n,s,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hovertemplate"),A(c,s),e(a,n,c,s),c("hoverongaps"),c("connectgaps",v.isArray1D(n.z)&&n.zsmooth!==!1),t(a,n,s,c,{prefix:"",cLetter:"z"}),c("zorder")}}}),tM=Ze({"src/traces/histogram/bin_functions.js"(Z,q){"use strict";var v=is();q.exports={count:function(x,A,M){return M[x]++,1},sum:function(x,A,M,e){var t=e[A];return v(t)?(t=Number(t),M[x]+=t,t):0},avg:function(x,A,M,e,t){var r=e[A];return v(r)&&(r=Number(r),M[x]+=r,t[x]++),0},min:function(x,A,M,e){var t=e[A];if(v(t))if(t=Number(t),v(M[x])){if(M[x]>t){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]<t){var r=t-M[x];return M[x]=t,r}}else return M[x]=t,t;return 0}}}}),rM=Ze({"src/traces/histogram/norm_functions.js"(Z,q){"use strict";q.exports={percent:function(v,x){for(var A=v.length,M=100/x,e=0;e<A;e++)v[e]*=M},probability:function(v,x){for(var A=v.length,M=0;M<A;M++)v[M]/=x},density:function(v,x,A,M){var e=v.length;M=M||1;for(var t=0;t<e;t++)v[t]*=A[t]*M},"probability density":function(v,x,A,M){var e=v.length;M&&(x/=M);for(var t=0;t<e;t++)v[t]*=A[t]/x}}}}),aM=Ze({"src/traces/histogram/average.js"(Z,q){"use strict";q.exports=function(x,A){for(var M=x.length,e=0,t=0;t<M;t++)A[t]?(x[t]/=A[t],e+=x[t]):x[t]=null;return e}}}),nM=Ze({"src/traces/histogram/bin_label_vals.js"(Z,q){"use strict";var v=Vs(),x=v.ONEAVGYEAR,A=v.ONEAVGMONTH,M=v.ONEDAY,e=v.ONEHOUR,t=v.ONEMIN,r=v.ONESEC,i=Wo().tickIncrement;q.exports=function(h,m,d,T,l){var _=-1.1*m,w=-.1*m,S=h-w,E=d[0],g=d[1],b=Math.min(a(E+w,E+S,T,l),a(g+w,g+S,T,l)),p=Math.min(a(E+_,E+w,T,l),a(g+_,g+w,T,l)),u,y;if(b>p&&p<Math.abs(g-E)/4e3?(u=b,y=!1):(u=Math.min(b,p),y=!0),T.type==="date"&&u>M){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(O<L){var I=i(O,P,!1,l);(O+I)/2<L+h&&(O=I)}return z&&y?i(O,P,!0,l):O}}return function(L,z){var F=u*Math.round(L/u);return F+u/10<L&&F+u*.9<L+h&&(F+=u),z&&y&&(F-=u),F}};function a(c,h,m,d){if(c*h<=0)return 1/0;for(var T=Math.abs(h-c),l=m.type==="date",_=n(T,l),w=0;w<10;w++){var S=n(_*80,l);if(_===S)break;if(o(S,c,h,l,m,d))_=S;else break}return _}function n(c,h){return h&&c>r?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<ue&&T.length<1e6&&(Q=M.tickIncrement(p,y.size,!1,g),T.push((p+Q)/2),l.push(H),O.push([]),L.push(p),W&&F.push(1/(Q-p)),X&&B.push(0),!(Q<=p));)p=Q;L.push(p),!P&&w.type==="date"&&(z={start:oe(z.start),end:oe(z.end),size:z.size}),m._fullLayout._roundFnOpts||(m._fullLayout._roundFnOpts={});var j=d["_"+S+"bingroup"],ee={leftGap:1/0,rightGap:1/0};j&&(m._fullLayout._roundFnOpts[j]||(m._fullLayout._roundFnOpts[j]=ee),ee=m._fullLayout._roundFnOpts[j]);var re=l.length,ce=!0,be=ee.leftGap,Ae=ee.rightGap,ze={};for(p=0;p<f.length;p++){var Re=f[p];se=x.findBin(Re,z),se>=0&&se<re&&(I+=$(se,p,l,ne,B),ce&&O[se].length&&Re!==f[O[se][0]]&&(ce=!1),O[se].push(p),ze[p]=se,be=Math.min(be,Re-L[se]),Ae=Math.min(Ae,L[se+1]-Re))}ee.leftGap=be,ee.rightGap=Ae;var We;ce||(We=function(_e,fe){return function(){var Fe=m._fullLayout._roundFnOpts[j];return a(Fe.leftGap,Fe.rightGap,L,w,g)(_e,fe)}}),X&&(I=i(l,B)),J&&J(l,I,F),b.enabled&&h(l,b.direction,b.currentbin);var it=Math.min(T.length,l.length),ot=[],tt=0,ut=it-1;for(p=0;p<it;p++)if(l[p]){tt=p;break}for(p=it-1;p>=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.length;p++)if(y=u[p],y.visible){var ue=g.dirs[p];P=y["_"+ue+"pos0"]=T.makeCalcdata(y,ue),N=x.concat(N,P),delete y["_"+l+"autoBinFinished"],d.visible===!0&&(U?U=!1:(delete y._autoBin,y["_"+l+"autoBinFinished"]=1),A.traceIs(y,"2dMap")&&(W=!0),y.type==="histogram2dcontour"&&(Q=!0))}f=u[0][l+"calendar"];var se=M.autoBin(N,T,g.nbins,W,f,g.sizeFound&&g.size),he=u[0]._autoBin={};if(L=he[g.dirs[0]]={},Q&&(g.size||(se.start=B(M.tickIncrement(F(se.start),se.size,!0,f))),g.end===void 0&&(se.end=B(M.tickIncrement(F(se.end),se.size,!1,f)))),b&&!A.traceIs(d,"2dMap")&&se._dataSpan===0&&T.type!=="category"&&T.type!=="multicategory"&&d.bingroup===""&&typeof d.xbins>"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<S.length;p++)if(u=S[p],u===d)E=!0;else if(!E)y=w._histogramBinOpts[u["_"+l+"bingroup"]],g=Math.min(g,y.size||u[_].size);else{var f=o(m,u,T,l,!0),P=f[0],L=f[2];u["_"+l+"autoBinFinished"]=1,u["_"+l+"pos0"]=f[1],L?b.push(u):g=Math.min(g,P.size)}var z=new Array(b.length);for(p=0;p<b.length;p++)for(var F=b[p]["_"+l+"pos0"],B=0;B<F.length;B++)if(F[B]!==void 0){z[p]=F[B];break}for(isFinite(g)||(g=x.distinctVals(z).minDiff),p=0;p<b.length;p++){u=b[p];var O=u[l+"calendar"],I={start:T.c2r(z[p]-g/2,0,O),end:T.c2r(z[p]+g/2,0,O),size:g};u._input[_]=u[_]=I,y=w._histogramBinOpts[u["_"+l+"bingroup"]],y&&x.extendFlat(y,I)}return d[_]}function c(m,d){for(var T=d.xaxis,l=d.yaxis,_=d.orientation,w=[],S=m._fullData,E=0;E<S.length;E++){var g=S[E];g.type==="histogram"&&g.visible===!0&&g.orientation===_&&g.xaxis===T&&g.yaxis===l&&w.push(g)}return w}function h(m,d,T){var l,_,w;function S(g){w=m[g],m[g]/=2}function E(g){_=m[g],m[g]=w+_/2,w+=_}if(T==="half")if(d==="increasing")for(S(0),l=1;l<m.length;l++)E(l);else for(S(m.length-1),l=m.length-2;l>=0;l--)E(l);else if(d==="increasing"){for(l=1;l<m.length;l++)m[l]+=m[l-1];T==="exclude"&&(m.unshift(0),m.pop())}else{for(l=m.length-2;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<it;E=x.tickIncrement(E,Re,!1,d))O.push(j),W.push(E),ce&&I.push(0);W.push(E);var ot=O.length,tt=(E-We)/ot,ut=w(We+tt/2),Me=L.size,_e=_(L.start),fe=_(L.end)+(_e-x.tickIncrement(_e,Me,!1,T))/1e6;for(E=_e;E<fe;E=x.tickIncrement(E,Me,!1,T)){B.push(O.slice()),Q.push(E);var Fe=new Array(ot);for(g=0;g<ot;g++)Fe[g]=[];$.push(Fe),ce&&H.push(I.slice())}Q.push(E);var rt=B.length,st=(E-_e)/rt,Qe=S(_e+st/2);oe&&(be=i(O.length,ue,tt,N),Ae=i(B.length,se,st,U)),!N&&h.type==="date"&&(ue=a(l,ue)),!U&&m.type==="date"&&(se=a(_,se));var Lt=!0,kt=!0,qt=new Array(ot),Zt=new Array(rt),Sr=1/0,xr=1/0,jr=1/0,wr=1/0;for(E=0;E<F;E++){var Ir=f[E],bt=z[E];b=v.findBin(Ir,ue),p=v.findBin(bt,se),b>=0&&b<ot&&p>=0&&p<rt&&(he+=ee(b,E,B[p],ze,H[p]),$[p][b].push(E),Lt&&(qt[b]===void 0?qt[b]=Ir:qt[b]!==Ir&&(Lt=!1)),kt&&(Zt[p]===void 0?Zt[p]=bt:Zt[p]!==bt&&(kt=!1)),Sr=Math.min(Sr,Ir-W[b]),xr=Math.min(xr,W[b+1]-Ir),jr=Math.min(jr,bt-Q[p]),wr=Math.min(wr,Q[p+1]-bt))}if(ce)for(p=0;p<rt;p++)he+=e(B[p],H[p]);if(re)for(p=0;p<rt;p++)re(B[p],he,be,Ae[p]);return{x:f,xRanges:n(W,Lt&&qt,Sr,xr,h,d),x0:ut,dx:tt,y:z,yRanges:n(Q,kt&&Zt,jr,wr,m,T),y0:Qe,dy:st,z:B,pts:$}};function i(o,s,c,h){var m=new Array(o),d;if(h)for(d=0;d<o;d++)m[d]=1/(s[d+1]-s[d]);else{var T=1/c;for(d=0;d<o;d++)m[d]=T}return m}function a(o,s){return{start:o(s.start),end:o(s.end),size:s.size}}function n(o,s,c,h,m,d){var T,l=o.length-1,_=new Array(l),w=t(c,h,o,m,d);for(T=0;T<l;T++){var S=(s||[])[T];_[T]=S===void 0?[w(o[T]),w(o[T+1],!0)]:[S,S]}return _}}}),Z2=Ze({"src/traces/heatmap/convert_column_xyz.js"(Z,q){"use strict";var v=ca(),x=Vs().BADNUM,A=tv();q.exports=function(e,t,r,i,a,n){var o=e._length,s=t.makeCalcdata(e,i),c=r.makeCalcdata(e,a);s=A(e,t,i,s).vals,c=A(e,r,a,c).vals;var h=e.text,m=h!==void 0&&v.isArray1D(h),d=e.hovertext,T=d!==void 0&&v.isArray1D(d),l,_,w=v.distinctVals(s),S=w.vals,E=v.distinctVals(c),g=E.vals,b=[],p,u,y=g.length,f=S.length;for(l=0;l<n.length;l++)b[l]=v.init2dArray(y,f);m&&(p=v.init2dArray(y,f)),T&&(u=v.init2dArray(y,f));var P=v.init2dArray(y,f);for(l=0;l<o;l++)if(s[l]!==x&&c[l]!==x){var L=v.findBin(s[l]+w.minDiff/2,S),z=v.findBin(c[l]+E.minDiff/2,g);for(_=0;_<n.length;_++){var F=n[_],B=e[F],O=b[_];O[z][L]=B[l],P[z][L]=l}m&&(p[z][L]=h[l]),T&&(u[z][L]=d[l])}for(e["_"+i]=S,e["_"+a]=g,_=0;_<n.length;_++)e["_"+n[_]]=b[_];m&&(e._text=p),T&&(e._hovertext=u),t&&t.type==="category"&&(e["_"+i+"CategoryMap"]=S.map(function(I){return t._categories[I]})),r&&r.type==="category"&&(e["_"+a+"CategoryMap"]=g.map(function(I){return r._categories[I]})),e._after2before=P}}}),Y2=Ze({"src/traces/heatmap/clean_2d_array.js"(Z,q){"use strict";var v=is(),x=ca(),A=Vs().BADNUM;q.exports=function(e,t,r,i){var a,n,o,s,c,h;function m(S){if(v(S))return+S}if(t&&t.transpose){for(a=0,c=0;c<e.length;c++)a=Math.max(a,e[c].length);if(a===0)return!1;o=function(S){return S.length},s=function(S,E,g){return(S[g]||[])[E]}}else a=e.length,o=function(S,E){return S[E].length},s=function(S,E,g){return(S[E]||[])[g]};var d=function(S,E,g){return E===A||g===A?A:s(S,E,g)};function T(S){if(t&&t.type!=="carpet"&&t.type!=="contourcarpet"&&S&&S.type==="category"&&t["_"+S._id.charAt(0)].length){var E=S._id.charAt(0),g={},b=t["_"+E+"CategoryMap"]||t[E];for(c=0;c<b.length;c++)g[b[c]]=c;return function(p){var u=g[S._categories[p]];return u+1?u:A}}else return x.identity}var l=T(r),_=T(i);i&&i.type==="category"&&(a=i._categories.length);var w=new Array(a);for(c=0;c<a;c++)for(r&&r.type==="category"?n=r._categories.length:n=o(e,c),w[c]=new Array(n),h=0;h<n;h++)w[c][h]=m(d(e,_(c),l(h)));return w}}}),K2=Ze({"src/traces/heatmap/interp2d.js"(Z,q){"use strict";var v=ca(),x=.01,A=[[-1,0],[1,0],[0,-1],[0,1]];function M(t){return .5-.25*Math.min(1,t*.5)}q.exports=function(r,i){var a=1,n;for(e(r,i),n=0;n<i.length&&!(i[n][2]<4);n++);for(i=i.slice(n),n=0;n<100&&a>x;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;c<r.length;c++){for(n=r[c],o=n[0],s=n[1],w=t[o][s],_=0,l=0,h=0;h<4;h++)m=A[h],d=t[o+m[0]],d&&(T=d[s+m[1]],T!==void 0&&(_===0?S=E=T:(S=Math.min(S,T),E=Math.max(E,T)),l++,_+=T));if(l===0)throw"iterateInterp2d order is wrong: no defined neighbors";t[o][s]=_/l,w===void 0?l<4&&(a=1):(t[o][s]=(1+i)*t[o][s]-i*w,E>S&&(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<A.length;s++)for(o=i,i=r,r=A[s+1]||[],c=0;c<n;c++)i[c]===void 0&&(d=(i[c-1]!==void 0?1:0)+(i[c+1]!==void 0?1:0)+(o[c]!==void 0?1:0)+(r[c]!==void 0?1:0),d?(s===0&&d++,c===0&&d++,s===A.length-1&&d++,c===i.length-1&&d++,d<4&&(e[[s,c]]=[s,c,d]),M.push([s,c,d])):t.push([s,c]));for(;t.length;){for(T={},l=!1,m=t.length-1;m>=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;m<T;m++)n.push(Math.sqrt(e[m-1]*e[m]));n.push(Math.pow(e[T-1],1.5)/Math.pow(e[T-2],.5))}else{for(n=[1.5*e[0]-.5*e[1]],m=1;m<T;m++)n.push((e[m-1]+e[m])*.5);n.push(1.5*e[T-1]-.5*e[T-2])}if(T<i){var l=n[n.length-1],_;if(a.type==="log")for(_=l/n[n.length-2],m=T;m<i;m++)l*=_,n.push(l);else for(_=l-n[n.length-2],m=T;m<i;m++)l+=_,n.push(l)}}else return o?e.slice(0,i):e.slice(0,i+1)}else{var w=M[a._id.charAt(0)+"calendar"];if(s)c=a.r2c(t,0,w);else if(x(e)&&e.length===1)c=e[0];else if(t===void 0)c=0;else{var S=a.type==="log"?a.d2c:a.r2c;c=S(t,0,w)}for(h=r||1,m=o?0:-.5;m<i;m++)n.push(c+h*m)}return n}}}),$2=Ze({"src/traces/heatmap/calc.js"(Z,q){"use strict";var v=oo(),x=ca(),A=Wo(),M=tv(),e=r4(),t=jp(),r=Z2(),i=Y2(),a=K2(),n=J2(),o=oM(),s=Vs().BADNUM;q.exports=function(d,T){var l=A.getFromId(d,T.xaxis||"x"),_=A.getFromId(d,T.yaxis||"y"),w=v.traceIs(T,"contour"),S=v.traceIs(T,"histogram"),E=w?"best":T.zsmooth,g,b,p,u,y,f,P,L,z,F,B;if(l._minDtick=0,_._minDtick=0,S)B=e(d,T),u=B.orig_x,g=B.x,b=B.x0,p=B.dx,L=B.orig_y,y=B.y,f=B.y0,P=B.dy,z=B.z;else{var O=T.z;x.isArray1D(O)?(r(T,l,_,"x","y",["z"]),g=T._x,y=T._y,O=T._z):(u=T.x?l.makeCalcdata(T,"x"):[],L=T.y?_.makeCalcdata(T,"y"):[],g=M(T,l,"x",u).vals,y=M(T,_,"y",L).vals,T._x=g,T._y=y),b=T.x0,p=T.dx,f=T.y0,P=T.dy,z=i(O,T,l,_)}(l.rangebreaks||_.rangebreaks)&&(z=h(g,y,z),S||(g=c(g),y=c(y),T._x=g,T._y=y)),!S&&(w||T.connectgaps)&&(T._emptypoints=n(z),a(z,T._emptypoints));function I($){E=T._input.zsmooth=T.zsmooth=!1,x.warn('cannot use zsmooth: "fast": '+$)}function N($){if($.length>1){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;l<T;l++){var _=m[l];_!==s&&d.push(_)}return d}function h(m,d,T){for(var l=[],_=-1,w=0;w<T.length;w++)if(d[w]!==s){_++,l[_]=[];for(var S=0;S<T[w].length;S++)m[S]!==s&&l[_].push(T[w][S])}return l}}}),Q2=Ze({"src/constants/pixelated_image.js"(Z){"use strict";Z.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],Z.STYLE=Z.CSS_DECLARATIONS.map(function(q){return q.join(": ")+"; "}).join("")}}),sM=Ze({"src/lib/supports_pixelated_image.js"(Z,q){"use strict";var v=Q2(),x=as(),A=ca(),M=null;function e(){if(M!==null)return M;M=!1;var t=A.isSafari()||A.isMacWKWebView()||A.isIOS();if(window.navigator.userAgent&&!t){var r=Array.from(v.CSS_DECLARATIONS).reverse(),i=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof i=="function")M=r.some(function(s){return i.apply(null,s)});else{var a=x.tester.append("image").attr("style",v.STYLE),n=window.getComputedStyle(a.node()),o=n.imageRendering;M=r.some(function(s){var c=s[1];return o===c||o===c.toLowerCase()}),a.remove()}}return M}q.exports=e}}),e3=Ze({"src/traces/heatmap/plot.js"(Z,q){"use strict";var v=Oi(),x=Ch(),A=oo(),M=as(),e=Wo(),t=ca(),r=fu(),i=P2(),a=Yi(),n=rc().extractOpts,o=rc().makeColorScaleFuncFromTrace,s=vd(),c=mh(),h=c.LINE_SPACING,m=sM(),d=Q2().STYLE,T="heatmap-label";function l(g){return g.selectAll("g."+T)}function _(g){l(g).remove()}q.exports=function(g,b,p,u){var y=b.xaxis,f=b.yaxis;t.makeTraceGroups(u,p,"hm").each(function(P){var L=v.select(this),z=P[0],F=z.trace,B=F.xgap||0,O=F.ygap||0,I=z.z,N=z.x,U=z.y,W=z.xCenter,Q=z.yCenter,ue=A.traceIs(F,"contour"),se=ue?"best":F.zsmooth,he=I.length,H=t.maxRowLength(I),$=!1,J=!1,X,oe,ne,j,ee,re,ce,be;for(re=0;X===void 0&&re<N.length-1;)X=y.c2p(N[re]),re++;for(re=N.length-1;oe===void 0&&re>0;)oe=y.c2p(N[re]),re--;for(oe<X&&(ne=oe,oe=X,X=ne,$=!0),re=0;j===void 0&&re<U.length-1;)j=f.c2p(U[re]),re++;for(re=U.length-1;ee===void 0&&re>0;)ee=f.c2p(U[re]),re--;ee<j&&(ne=j,j=ee,ee=ne,J=!0),ue&&(W=N,Q=U,N=z.xfill,U=z.yfill);var Ae="default";if(se?Ae=se==="best"?"smooth":"fast":F._islinear&&B===0&&O===0&&m()&&(Ae="fast"),Ae!=="fast"){var ze=se==="best"?0:.5;X=Math.max(-ze*y._length,X),oe=Math.min((1+ze)*y._length,oe),j=Math.max(-ze*f._length,j),ee=Math.min((1+ze)*f._length,ee)}var Re=Math.round(oe-X),We=Math.round(ee-j),it=X>=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;re<Ce.length;re++)Pe[re]=Math.round(y.c2p(Ce[re])-X);for(re=0;re<Te.length;re++)at[re]=Math.round(f.c2p(Te[re])-j);for(re=0;re<Re;re++)yt[re]=Tt(re,Pe);for(ce=0;ce<We;ce++)for(Gt=Ot(ce,at),rr=I[Gt.bin0],Qt=I[Gt.bin1],re=0;re<Re;re++,Ee+=4)Be=Ue(rr,Qt,yt[re],Gt),E(Ve,Ee,Be)}else for(ce=0;ce<he;ce++)for(bt=I[ce],Qe=rt(ce),re=0;re<H;re++)Be=Ke(bt[re],1),Ee=(Qe*H+Fe(re))*4,E(Ve,Ee,Be);var Tr=_e.createImageData(tt,ut);try{Tr.data.set(Ve)}catch{var la=Tr.data,Ua=la.length;for(ce=0;ce<Ua;ce++)la[ce]=Ve[ce]}_e.putImageData(Tr,0,0)}else{var Ba=Math.floor(B/2),Ra=Math.floor(O/2);for(ce=0;ce<he;ce++)if(bt=I[ce],Qe.reverse(),Qe[kt]=rt(ce+1),!(Qe[0]===Qe[1]||Qe[0]===void 0||Qe[1]===void 0))for(wr=Fe(0),jr=[wr,wr],re=0;re<H;re++)jr.reverse(),jr[Lt]=Fe(re+1),!(jr[0]===jr[1]||jr[0]===void 0||jr[1]===void 0)&&(Ir=bt[re],Be=Ke(Ir,(jr[1]-jr[0])*(Qe[1]-Qe[0])),_e.fillStyle="rgba("+Be.join(",")+")",_e.fillRect(jr[0]+Ba,Qe[0]+Ra,jr[1]-jr[0]-B,Qe[1]-Qe[0]-O))}Zt=Math.round(Zt/qt),Sr=Math.round(Sr/qt),xr=Math.round(xr/qt);var Qa=x("rgb("+Zt+","+Sr+","+xr+")");g._hmpixcount=(g._hmpixcount||0)+qt,g._hmlumcount=(g._hmlumcount||0)+qt*Qa.getLuminance();var za=L.selectAll("image").data(P);za.enter().append("svg:image").attr({xmlns:s.svg,preserveAspectRatio:"none"}),za.attr({height:We,width:Re,x:X,y:j,"xlink:href":Me.toDataURL("image/png")}),Ae==="fast"&&!se&&za.attr("style",d),_(L);var en=F.texttemplate;if(en){var kn=n(F),Jt={type:"linear",range:[kn.min,kn.max],_separators:y._separators,_numFormat:y._numFormat},Nt=F.type==="histogram2dcontour",Kt=F.type==="contour",Wt=Kt?1:0,Pr=Kt?he-1:he,ta=Kt?1:0,ma=Kt?H-1:H,ra=[];for(re=Wt;re<Pr;re++){var Ia;if(Kt)Ia=z.y[re];else if(Nt){if(re===0||re===he-1)continue;Ia=z.y[re]}else if(z.yCenter)Ia=z.yCenter[re];else{if(re+1===he&&z.y[re+1]===void 0)continue;Ia=(z.y[re]+z.y[re+1])/2}var Ha=Math.round(f.c2p(Ia));if(!(0>Ha||Ha>f._length))for(ce=ta;ce<ma;ce++){var rn;if(Kt)rn=z.x[ce];else if(Nt){if(ce===0||ce===H-1)continue;rn=z.x[ce]}else if(z.xCenter)rn=z.xCenter[ce];else{if(ce+1===H&&z.x[ce+1]===void 0)continue;rn=(z.x[ce]+z.x[ce+1])/2}var nn=Math.round(y.c2p(rn));if(!(0>nn||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("<br>"),Rr=Or.length,Lr=0;for(be=0;be<Rr;be++)Lr=Math.max(Lr,Or[be].length);ra.push({l:Rr,c:Lr,t:Nr,x:nn,y:Ha,z:xt})}}}}var Gr=F.textfont,Kr=Gr.size,Ur=g._fullLayout.font.size;if(!Kr||Kr==="auto"){var aa=1/0,da=1/0,fa=0,It=0;for(be=0;be<ra.length;be++){var dr=ra[be];if(fa=Math.max(fa,dr.l),It=Math.max(It,dr.c),be<ra.length-1){var kr=ra[be+1],na=Math.abs(kr.x-dr.x),Ca=Math.abs(kr.y-dr.y);na&&(aa=Math.min(aa,na)),Ca&&(da=Math.min(da,Ca))}}!isFinite(aa)||!isFinite(da)?Kr=Ur:(aa-=B,da-=O,aa/=It,da/=fa,aa/=h/2,da/=h,Kr=Math.min(Math.floor(aa),Math.floor(da),Ur))}if(Kr<=0||!isFinite(Kr))return;var Fa=function(Da){return Da.x},Ya=function(Da){return Da.y-Kr*(Da.l*h/2-1)},ha=l(L).data(ra);ha.enter().append("g").classed(T,1).append("text").attr("text-anchor","middle").each(function(Da){var Zn=v.select(this),Pn=Gr.color;(!Pn||Pn==="auto")&&(Pn=a.contrast(Da.z===void 0?g._fullLayout.plot_bgcolor:"rgba("+fe(Da.z).join()+")")),Zn.attr("data-notex",1).call(r.positionText,Fa(Da),Ya(Da)).call(M.font,{family:Gr.family,size:Kr,color:Pn,weight:Gr.weight,style:Gr.style,variant:Gr.variant,textcase:Gr.textcase,lineposition:Gr.lineposition,shadow:Gr.shadow}).text(Da.t).call(r.convertToTspans,g)})}})};function w(g,b){var p=b.length-2,u=t.constrain(t.findBin(g,b),0,p),y=b[u],f=b[u+1],P=t.constrain(u+(g-y)/(f-y)-.5,0,p),L=Math.round(P),z=Math.abs(P-L);return!P||P===p||!z?{bin0:L,bin1:L,frac:0}:{bin0:L,frac:z,bin1:Math.round(L+z/(P-L))}}function S(g,b){var p=b.length-1,u=t.constrain(t.findBin(g,b),0,p),y=b[u],f=b[u+1],P=(g-y)/(f-y)||0;return P<=0?{bin0:u,bin1:u,frac:0}:P<.5?{bin0:u,bin1:u+1,frac:P}:{bin0:u+1,bin1:u,frac:1-P}}function E(g,b,p){g[b]=p[0],g[b+1]=p[1],g[b+2]=p[2],g[b+3]=Math.round(p[3]*255)}}}),ag=Ze({"src/traces/heatmap/colorbar.js"(Z,q){"use strict";q.exports={min:"zmin",max:"zmax"}}}),t3=Ze({"src/traces/heatmap/style.js"(Z,q){"use strict";var v=Oi();q.exports=function(A){v.select(A).selectAll(".hm image").style("opacity",function(M){return M.trace.opacity})}}}),r3=Ze({"src/traces/heatmap/hover.js"(Z,q){"use strict";var v=ef(),x=ca(),A=x.isArrayOrTypedArray,M=Wo(),e=rc().extractOpts;q.exports=function(r,i,a,n,o){o||(o={});var s=o.isContour,c=r.cd[0],h=c.trace,m=r.xa,d=r.ya,T=c.x,l=c.y,_=c.z,w=c.xCenter,S=c.yCenter,E=c.zmask,g=h.zhoverformat,b=T,p=l,u,y,f,P;if(r.index!==!1){try{f=Math.round(r.index[1]),P=Math.round(r.index[0])}catch{x.error("Error hovering on heatmap, pointNumber must be [row,col], found:",r.index);return}if(f<0||f>=_[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<T.length;L++)b.push((T[L]+T[L-1])/2);for(b.push([2*T[T.length-1]-T[T.length-2]]),p=[2*l[0]-l[1]],L=1;L<l.length;L++)p.push((l[L]+l[L-1])/2);p.push([2*l[l.length-1]-l[l.length-2]])}f=Math.max(0,Math.min(b.length-2,x.findBin(i,b))),P=Math.max(0,Math.min(p.length-2,x.findBin(a,p)))}var z=m.c2p(T[f]),F=m.c2p(T[f+1]),B=d.c2p(l[P]),O=d.c2p(l[P+1]),I,N;s?(I=c.orig_x||T,N=c.orig_y||l,F=z,u=I[f],O=B,y=N[P]):(I=c.orig_x||w||T,N=c.orig_y||S||l,u=w?I[f]:(I[f]+I[f+1])/2,y=S?N[P]:(N[P]+N[P+1])/2,m&&m.type==="category"&&(u=T[f]),d&&d.type==="category"&&(y=l[P]),h.zsmooth&&(z=F=m.c2p(u),B=O=d.c2p(y)));var U=_[P][f];if(E&&!E[P][f]&&(U=void 0),!(U===void 0&&!h.hoverongaps)){var W;A(c.hovertext)&&A(c.hovertext[P])?W=c.hovertext[P][f]:A(c.text)&&A(c.text[P])&&(W=c.text[P][f]);var Q=e(h),ue={type:"linear",range:[Q.min,Q.max],hoverformat:g,_separators:m._separators,_numFormat:m._numFormat},se=M.tickText(ue,U,"hover").text;return[x.extendFlat(r,{index:h._after2before?h._after2before[P][f]:[P,f],distance:r.maxHoverDistance,spikeDistance:r.maxSpikeDistance,x0:z,x1:F,y0:B,y1:O,xLabelVal:u,yLabelVal:y,zLabelVal:U,zLabel:se,text:W})]}}}}),a4=Ze({"src/traces/heatmap/index.js"(Z,q){"use strict";q.exports={attributes:p1(),supplyDefaults:t4(),calc:$2(),plot:e3(),colorbar:ag(),style:t3(),hoverPoints:r3(),moduleType:"trace",name:"heatmap",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}}),n4=Ze({"lib/heatmap.js"(Z,q){"use strict";q.exports=a4()}}),lM=Ze({"src/traces/histogram/bin_attributes.js"(Z,q){"use strict";q.exports=function(x,A){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}}),i4=Ze({"src/traces/histogram/constants.js"(Z,q){"use strict";q.exports={eventDataKeys:["binNumber"]}}}),a3=Ze({"src/traces/histogram/attributes.js"(Z,q){"use strict";var v=Sv(),x=Qc().axisHoverFormat,A=Cs().hovertemplateAttrs,M=Cs().texttemplateAttrs,e=tc(),t=lM(),r=i4(),i=rs().extendFlat;q.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:x("x"),yhoverformat:x("y"),text:i({},v.text,{}),hovertext:i({},v.hovertext,{}),orientation:v.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:t("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:t("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:A({},{keys:r.eventDataKeys}),texttemplate:M({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:i({},v.textposition,{arrayOk:!1}),textfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:e({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:v.insidetextanchor,textangle:v.textangle,cliponaxis:v.cliponaxis,constraintext:v.constraintext,marker:v.marker,offsetgroup:v.offsetgroup,alignmentgroup:v.alignmentgroup,selected:v.selected,unselected:v.unselected,zorder:v.zorder}}}),o4=Ze({"src/traces/histogram/defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=Yi(),M=gd().handleText,e=j2(),t=a3();q.exports=function(i,a,n,o){function s(p,u){return x.coerce(i,a,t,p,u)}var c=s("x"),h=s("y"),m=s("cumulative.enabled");m&&(s("cumulative.direction"),s("cumulative.currentbin")),s("text");var d=s("textposition");M(i,a,o,s,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s("hovertext"),s("hovertemplate"),s("xhoverformat"),s("yhoverformat");var T=s("orientation",h&&!c?"h":"v"),l=T==="v"?"x":"y",_=T==="v"?"y":"x",w=c&&h?Math.min(x.minRowLength(c)&&x.minRowLength(h)):x.minRowLength(a[l]||[]);if(!w){a.visible=!1;return}a._length=w;var S=v.getComponentMethod("calendars","handleTraceDefaults");S(i,a,["x","y"],o);var E=a[_];E&&s("histfunc"),s("histnorm"),s("autobin"+l),e(i,a,s,n,o),x.coerceSelectionMarkerOpacity(a,s);var g=(a.marker.line||{}).color,b=v.getComponentMethod("errorbars","supplyDefaults");b(i,a,g||A.defaultLine,{axis:"y"}),b(i,a,g||A.defaultLine,{axis:"x",inherit:"y"}),s("zorder")}}}),n3=Ze({"src/traces/histogram/cross_trace_defaults.js"(Z,q){"use strict";var v=ca(),x=$c(),A=oo().traceIs,M=Jg(),e=gd().validateCornerradius,t=v.nestedProperty,r=Yg().getAxisGroup,i=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],a=["x","y"];q.exports=function(o,s){var c=s._histogramBinOpts={},h=[],m={},d=[],T,l,_,w,S,E,g;function b(se,he){return v.coerce(T._input,T,T._module.attributes,se,he)}function p(se){return se.orientation==="v"?"x":"y"}function u(se,he){var H=x.getFromTrace({_fullLayout:s},se,he);return H.type}function y(se,he,H){var $=se.uid+"__"+H;he||(he=$);var J=u(se,H),X=se[H+"calendar"]||"",oe=c[he],ne=!0;oe&&(J===oe.axType&&X===oe.calendar?(ne=!1,oe.traces.push(se),oe.dirs.push(H)):(he=$,J!==oe.axType&&v.warn(["Attempted to group the bins of trace",se.index,"set on a","type:"+J,"axis","with bins on","type:"+oe.axType,"axis."].join(" ")),X!==oe.calendar&&v.warn(["Attempted to group the bins of trace",se.index,"set with a",X,"calendar","with bins",oe.calendar?"on a "+oe.calendar+" calendar":"w/o a set calendar"].join(" ")))),ne&&(c[he]={traces:[se],dirs:[H],axType:J,calendar:se[H+"calendar"]||""}),se["_"+H+"bingroup"]=he}for(S=0;S<o.length;S++)if(T=o[S],A(T,"histogram")){if(h.push(T),delete T._xautoBinFinished,delete T._yautoBinFinished,T.type==="histogram"){var f=b("marker.cornerradius",s.barcornerradius);T.marker&&(T.marker.cornerradius=e(f))}A(T,"2dMap")||M(T._input,T,s,b,s.barmode)}var P=s._alignmentOpts||{};for(S=0;S<h.length;S++){if(T=h[S],_="",!A(T,"2dMap")){if(w=p(T),s.barmode==="group"&&T.alignmentgroup){var L=T[w+"axis"],z=r(s,L)+T.orientation;(P[z]||{})[T.alignmentgroup]&&(_=z)}!_&&s.barmode!=="overlay"&&(_=r(s,T.xaxis)+r(s,T.yaxis)+p(T))}_?(m[_]||(m[_]=[]),m[_].push(T)):d.push(T)}for(_ in m){if(l=m[_],l.length===1){d.push(l[0]);continue}var F=!1;for(l.length&&(T=l[0],F=b("bingroup")),_=F||_,S=0;S<l.length;S++){T=l[S];var B=T._input.bingroup;B&&B!==_&&v.warn(["Trace",T.index,"must match","within bingroup",_+".","Ignoring its bingroup:",B,"setting."].join(" ")),T.bingroup=_,y(T,_,p(T))}}for(S=0;S<d.length;S++){T=d[S];var O=b("bingroup");if(A(T,"2dMap"))for(g=0;g<2;g++){w=a[g];var I=b(w+"bingroup",O?O+"__"+w:null);y(T,I,w)}else y(T,O,p(T))}for(_ in c){var N=c[_];for(l=N.traces,E=0;E<i.length;E++){var U=i[E],W=U.name,Q,ue;if(!(W==="nbins"&&N.sizeFound)){for(S=0;S<l.length;S++){if(T=l[S],w=N.dirs[S],Q=U.aStr[w],t(T._input,Q).get()!==void 0){N[W]=b(Q),N[W+"Found"]=!0;break}ue=(T._autoBin||{})[w]||{},ue[W]&&t(T,Q).set(ue[W])}if(W==="start"||W==="end")for(;S<l.length;S++)T=l[S],T["_"+w+"bingroup"]&&(ue=(T._autoBin||{})[w]||{},b(Q,ue[W]));W==="nbins"&&!N.sizeFound&&!N.nbinsFound&&(T=l[0],N[W]=b(Q))}}}}}}),s4=Ze({"src/traces/histogram/hover.js"(Z,q){"use strict";var v=f1().hoverPoints,x=Wo().hoverLabelText;q.exports=function(M,e,t,r,i){var a=v(M,e,t,r,i);if(a){M=a[0];var n=M.cd[M.index],o=M.cd[0].trace;if(!o.cumulative.enabled){var s=o.orientation==="h"?"y":"x";M[s+"Label"]=x(M[s+"a"],[n.ph0,n.ph1],o[s+"hoverformat"])}return a}}}}),uM=Ze({"src/traces/histogram/event_data.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t){if(x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"zLabelVal"in A&&(x.z=A.zLabelVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),!(M.cumulative||{}).enabled){var r=Array.isArray(t)?e[0].pts[t[0]][t[1]]:e[t].pts;x.pointNumbers=r,x.binNumber=x.pointNumber,delete x.pointNumber,delete x.pointIndex;var i;if(M._indexToPoints){i=[];for(var a=0;a<r.length;a++)i=i.concat(M._indexToPoints[r[a]])}else i=r;x.pointIndices=i}return x}}}),l4=Ze({"src/traces/histogram/index.js"(Z,q){"use strict";q.exports={attributes:a3(),layoutAttributes:U2(),supplyDefaults:o4(),crossTraceDefaults:n3(),supplyLayoutDefaults:KS(),calc:iM().calc,crossTraceCalc:$g().crossTraceCalc,plot:e0().plot,layerName:"barlayer",style:Nd().style,styleOnSelect:Nd().styleOnSelect,colorbar:hp(),hoverPoints:s4(),selectPoints:h1(),eventData:uM(),moduleType:"trace",name:"histogram",basePlotModule:Zf(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}}),u4=Ze({"lib/histogram.js"(Z,q){"use strict";q.exports=l4()}}),i3=Ze({"src/traces/histogram2d/attributes.js"(Z,q){"use strict";var v=a3(),x=lM(),A=p1(),M=eu(),e=Qc().axisHoverFormat,t=Cs().hovertemplateAttrs,r=Cs().texttemplateAttrs,i=Mu(),a=rs().extendFlat;q.exports=a({x:v.x,y:v.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:v.histnorm,histfunc:v.histfunc,nbinsx:v.nbinsx,xbins:x("x"),nbinsy:v.nbinsy,ybins:x("y"),autobinx:v.autobinx,autobiny:v.autobiny,bingroup:a({},v.bingroup,{}),xbingroup:a({},v.bingroup,{}),ybingroup:a({},v.bingroup,{}),xgap:A.xgap,ygap:A.ygap,zsmooth:A.zsmooth,xhoverformat:e("x"),yhoverformat:e("y"),zhoverformat:e("z",1),hovertemplate:t({},{keys:"z"}),texttemplate:r({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:A.textfont,showlegend:a({},M.showlegend,{dflt:!1})},i("",{cLetter:"z",autoColorDflt:!1}))}}),cM=Ze({"src/traces/histogram2d/sample_defaults.js"(Z,q){"use strict";var v=oo(),x=ca();q.exports=function(M,e,t,r){var i=t("x"),a=t("y"),n=x.minRowLength(i),o=x.minRowLength(a);if(!n||!o){e.visible=!1;return}e._length=Math.min(n,o);var s=v.getComponentMethod("calendars","handleTraceDefaults");s(M,e,["x","y"],r);var c=t("z")||t("marker.color");c&&t("histfunc"),t("histnorm"),t("autobinx"),t("autobiny")}}}),c4=Ze({"src/traces/histogram2d/defaults.js"(Z,q){"use strict";var v=ca(),x=cM(),A=eM(),M=gh(),e=j_(),t=i3();q.exports=function(i,a,n,o){function s(c,h){return v.coerce(i,a,t,c,h)}x(i,a,s,o),a.visible!==!1&&(A(i,a,s,o),M(i,a,o,s,{prefix:"",cLetter:"z"}),s("hovertemplate"),e(s,o),s("xhoverformat"),s("yhoverformat"))}}}),f4=Ze({"src/traces/histogram2d/hover.js"(Z,q){"use strict";var v=r3(),x=Wo().hoverLabelText;q.exports=function(M,e,t,r,i){var a=v(M,e,t,r,i);if(a){M=a[0];var n=M.index,o=n[0],s=n[1],c=M.cd[0],h=c.trace,m=c.xRanges[s],d=c.yRanges[o];return M.xLabel=x(M.xa,[m[0],m[1]],h.xhoverformat),M.yLabel=x(M.ya,[d[0],d[1]],h.yhoverformat),a}}}}),h4=Ze({"src/traces/histogram2d/index.js"(Z,q){"use strict";q.exports={attributes:i3(),supplyDefaults:c4(),crossTraceDefaults:n3(),calc:$2(),plot:e3(),layerName:"heatmaplayer",colorbar:ag(),style:t3(),hoverPoints:f4(),eventData:uM(),moduleType:"trace",name:"histogram2d",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}}),p4=Ze({"lib/histogram2d.js"(Z,q){"use strict";q.exports=h4()}}),o3=Ze({"src/constants/filter_ops.js"(Z,q){"use strict";q.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],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;n<t-1;n++)for(s=[],n===0&&(s=s.concat(v.BOTTOMSTART)),n===t-2&&(s=s.concat(v.TOPSTART)),a=0;a<r-1;a++)for(o=s.slice(),a===0&&(o=o.concat(v.LEFTSTART)),a===r-2&&(o=o.concat(v.RIGHTSTART)),c=a+","+n,h=[[e[n][a],e[n][a+1]],[e[n+1][a],e[n+1][a+1]]],T=0;T<M.length;T++)d=M[T],m=x(d.level,h),m&&(d.crossings[c]=m,o.indexOf(m)!==-1&&(d.starts.push([a,n]),i&&o.indexOf(m,o.indexOf(m)+1)!==-1&&d.starts.push([a,n])))};function x(A,M){var e=(M[0][0]>A?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;h<a.length;h++){for(m=a[h],d=0;d<m.starts.length;d++)c=m.starts[d],e(m,c,"edge",n,o);for(s=0;Object.keys(m.crossings).length&&s<1e4;)s++,c=Object.keys(m.crossings)[0].split(",").map(Number),e(m,c,void 0,n,o);s===1e4&&v.log("Infinite loop in contour?")}};function A(i,a,n,o){return Math.abs(i[0]-a[0])<n&&Math.abs(i[1]-a[1])<o}function M(i,a){var n=i[2]-a[2],o=i[3]-a[3];return Math.sqrt(n*n+o*o)}function e(i,a,n,o,s){var c=a.join(","),h=i.crossings[c],m=t(h,n,a),d=[r(i,a,[-m[0],-m[1]])],T=i.z.length,l=i.z[0].length,_=a.slice(),w=m.slice(),S;for(S=0;S<1e4;S++){if(h>20?(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<d.length;S++)I=M(d[S],d[S-1]),p+=I,y.push(I);var ue=p/y.length*u;function se($){return d[$%d.length]}for(S=d.length-2;S>=f;S--)if(P=y[S],P<ue){for(z=0,L=S-1;L>=f&&P+y[L]<ue;L--)P+=y[L];if(b&&S===d.length-2)for(z=0;z<L&&P+y[z]<ue;z++)P+=y[z];B=S-L+z+1,O=Math.floor((S+L+z+2)/2),!b&&S===d.length-2?F=d[d.length-1]:!b&&L===-1?F=d[0]:B%2?F=se(O):F=[(se(O)[0]+se(O+1)[0])/2,(se(O)[1]+se(O+1)[1])/2],d.splice(L+1,S-L+1,F),S=L+1,z&&(f=z),b&&(S===d.length-2?d[z]=d[d.length-1]:S===0&&(d[d.length-1]=d[0]))}for(d.splice(0,f),S=0;S<d.length;S++)d[S].length=2;if(!(d.length<2))if(b)d.pop(),i.paths.push(d);else{n||v.log("Unclosed interior contour?",i.level,_.join(","),d.join("L"));var he=!1;for(N=0;N<i.edgepaths.length;N++)if(W=i.edgepaths[N],!he&&A(W[0],d[d.length-1],o,s)){d.pop(),he=!0;var H=!1;for(U=0;U<i.edgepaths.length;U++)if(Q=i.edgepaths[U],A(Q[Q.length-1],d[0],o,s)){H=!0,d.shift(),i.edgepaths.splice(N,1),U===N?i.paths.push(d.concat(Q)):(U>N&&U--,i.edgepaths[U]=Q.concat(d,W));break}H||(i.edgepaths[N]=d.concat(W))}for(N=0;N<i.edgepaths.length&&!he;N++)W=i.edgepaths[N],A(W[W.length-1],d[0],o,s)&&(d.shift(),i.edgepaths[N]=W.concat(d),he=!0);he||i.edgepaths.push(d)}}function t(i,a,n){var o=0,s=0;return i>20&&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;h<o;h+=a)if(n.push(v.extendFlat({level:h,crossings:{},starts:[],edgepaths:[],paths:[],z:r.z,smoothing:r.trace.line.smoothing},c)),n.length>1e3){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;e<t.edgepaths.length;e++)t.edgepaths[e]=i(t.edgepaths[e]);for(e=0;e<t.paths.length;e++)t.paths[e]=i(t.paths[e]);for(e=0;e<t.starts.length;e++)t.starts[e]=i(t.starts[e]);return A;case"][":var n=i;i=a,a=n;case"[]":for(A.length!==2&&v.warn("Contour data invalid for the specified inequality range operation."),t=x(A[0]),r=x(A[1]),e=0;e<t.edgepaths.length;e++)t.edgepaths[e]=i(t.edgepaths[e]);for(e=0;e<t.paths.length;e++)t.paths[e]=i(t.paths[e]);for(e=0;e<t.starts.length;e++)t.starts[e]=i(t.starts[e]);for(;r.edgepaths.length;)t.edgepaths.push(a(r.edgepaths.shift()));for(;r.paths.length;)t.paths.push(a(r.paths.shift()));for(;r.starts.length;)t.starts.push(a(r.starts.shift()));return[t]}};function x(A){return v.extendFlat({},A,{edgepaths:v.extendDeep([],A.edgepaths),paths:v.extendDeep([],A.paths),starts:v.extendDeep([],A.starts)})}}}),_M=Ze({"src/traces/contour/close_boundaries.js"(Z,q){"use strict";q.exports=function(v,x){var A=v[0],M=A.z,e;switch(x.type){case"levels":var t=Math.min(M[0][0],M[0][1]);for(e=0;e<v.length;e++){var r=v[e];r.prefixBoundary=!r.edgepaths.length&&(t>r.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<a;e++)o=Math.min(o,M[e][0]),o=Math.min(o,M[e][i-1]),n=Math.max(n,M[e][0]),n=Math.max(n,M[e][i-1]);for(e=1;e<i-1;e++)o=Math.min(o,M[0][e]),o=Math.min(o,M[a-1][e]),n=Math.max(n,M[0][e]),n=Math.max(n,M[a-1][e]);var s=x.value,c,h;switch(x._operation){case">":s>n&&(A.prefixBoundary=!0);break;case"<":(s<o||A.starts.length&&s===o)&&(A.prefixBoundary=!0);break;case"[]":c=Math.min(s[0],s[1]),h=Math.max(s[0],s[1]),(h<o||c>n||A.starts.length&&h===o)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),h=Math.max(s[0],s[1]),c<o&&h>n&&(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<E.edgepaths.length;F++){var W=E.edgepaths[F][0];Math.abs(f[0]-P[0])<.01?Math.abs(f[0]-W[0])<.01&&(W[1]-f[1])*(P[1]-W[1])>=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;p<E.paths.length;p++)b+=x.smoothclosed(E.paths[p],E.smoothing);return b}function l(E,g,b,p,u){var y=b._context.staticPlot,f=v.ensureSingle(E,"g","contourlines"),P=u.showlines!==!1,L=u.showlabels,z=P&&L,F=Z.createLines(f,P||L,g,y),B=Z.createLineClip(f,z,b,p.trace.uid),O=E.selectAll("g.contourlabels").data(L?[0]:[]);if(O.exit().remove(),O.enter().append("g").classed("contourlabels",!0),L){var I=[],N=[];v.clearLocationCache();var U=Z.labelFormatter(b,p),W=x.tester.append("text").attr("data-notex",1).call(x.font,u.labelfont),Q=g[0].xaxis,ue=g[0].yaxis,se=Q._length,he=ue._length,H=Q.range,$=ue.range,J=v.aggNums(Math.min,null,p.x),X=v.aggNums(Math.max,null,p.x),oe=v.aggNums(Math.min,null,p.y),ne=v.aggNums(Math.max,null,p.y),j=Math.max(Q.c2p(J,!0),0),ee=Math.min(Q.c2p(X,!0),se),re=Math.max(ue.c2p(ne,!0),0),ce=Math.min(ue.c2p(oe,!0),he),be={};H[0]<H[1]?(be.left=j,be.right=ee):(be.left=ee,be.right=j),$[0]<$[1]?(be.top=re,be.bottom=ce):(be.top=ce,be.bottom=re),be.middle=(be.top+be.bottom)/2,be.center=(be.left+be.right)/2,I.push([[be.left,be.top],[be.right,be.top],[be.right,be.bottom],[be.left,be.bottom]]);var Ae=Math.sqrt(se*se+he*he),ze=c.LABELDISTANCE*Ae/Math.max(1,g.length/c.LABELINCREASE);F.each(function(Re){var We=Z.calcTextOpts(Re.level,U,W,b);q.select(this).selectAll("path").each(function(){var it=this,ot=v.getVisibleSegment(it,be,We.height/2);if(ot&&!(ot.len<(We.width+We.height)*c.LABELMIN))for(var tt=Math.min(Math.ceil(ot.len/ze),c.LABELMAX),ut=0;ut<tt;ut++){var Me=Z.findBestTextLocation(it,ot,We,N,be);if(!Me)break;Z.addLabelData(Me,We,N,I)}})}),W.remove(),Z.drawLabels(O,N,b,B,z?I:null)}L&&!P&&F.remove()}Z.createLines=function(E,g,b,p){var u=b[0].smoothing,y=E.selectAll("g.contourlevel").data(g?b:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlevel",!0),g){var f=y.selectAll("path.openline").data(function(L){return L.pedgepaths||L.edgepaths});f.exit().remove(),f.enter().append("path").classed("openline",!0),f.attr("d",function(L){return x.smoothopen(L,u)}).style("stroke-miterlimit",1).style("vector-effect",p?"none":"non-scaling-stroke");var P=y.selectAll("path.closedline").data(function(L){return L.ppaths||L.paths});P.exit().remove(),P.enter().append("path").classed("closedline",!0),P.attr("d",function(L){return x.smoothclosed(L,u)}).style("stroke-miterlimit",1).style("vector-effect",p?"none":"non-scaling-stroke")}return y},Z.createLineClip=function(E,g,b,p){var u=b._fullLayout._clips,y=g?"clipline"+p:null,f=u.selectAll("#"+y).data(g?[0]:[]);return f.exit().remove(),f.enter().append("clipPath").classed("contourlineclip",!0).attr("id",y),x.setClipUrl(E,y,b),f},Z.labelFormatter=function(E,g){var b=E._fullLayout,p=g.trace,u=p.contours,y={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(u.labelformat)y.tickformat=u.labelformat,t(y,b);else{var f=A.extractOpts(p);if(f&&f.colorbar&&f.colorbar._axis)y=f.colorbar._axis;else{if(u.type==="constraint"){var P=u.value;v.isArrayOrTypedArray(P)?y.range=[P[0],P[P.length-1]]:y.range=[P,P]}else y.range=[u.start,u.end],y.nticks=(u.end-u.start)/u.size;y.range[0]===y.range[1]&&(y.range[1]+=y.range[0]||1),y.nticks||(y.nticks=1e3),t(y,b),e.prepTicks(y),y._tmin=null,y._tmax=null}}return function(L){return e.tickText(y,L).text}},Z.calcTextOpts=function(E,g,b,p){var u=g(E);b.text(u).call(M.convertToTspans,p);var y=b.node(),f=x.bBox(y,!0);return{text:u,width:f.width,height:f.height,fontSize:+y.style["font-size"].replace("px",""),level:E,dy:(f.top+f.bottom)/2}},Z.findBestTextLocation=function(E,g,b,p,u){var y=b.width,f,P,L,z,F;g.isClosed?(P=g.len/h.INITIALSEARCHPOINTS,f=g.min+P/2,L=g.max):(P=(g.len-y)/(h.INITIALSEARCHPOINTS+1),f=g.min+P+y/2,L=g.max-(P+y)/2);for(var B=1/0,O=0;O<h.ITERATIONS;O++){for(var I=f;I<L;I+=P){var N=v.getTextLocation(E,g.total,I,y),U=_(N,b,p,u);U<B&&(B=U,F=N,z=I)}if(B>h.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<b.length;ue++){var se=b[ue],he=Math.cos(se.theta)*se.width/2,H=Math.sin(se.theta)*se.width/2,$=v.segmentDistance(N,U,W,Q,se.x-he,se.y-H,se.x+he,se.y+H)*2/(g.height+se.height),J=se.level===g.level,X=J?h.SAMELEVELDISTANCE:1;if($<=X)return 1/0;var oe=h.NEIGHBORCOST*(J?h.SAMELEVELFACTOR:1);I+=oe/($-X)}return I}Z.addLabelData=function(E,g,b,p){var u=g.fontSize,y=g.width+u/3,f=Math.max(0,g.height-u/3),P=E.x,L=E.y,z=E.theta,F=Math.sin(z),B=Math.cos(z),O=function(N,U){return[P+N*B-U*F,L+N*F+U*B]},I=[O(-y/2,-f/2),O(-y/2,f/2),O(y/2,f/2),O(y/2,-f/2)];b.push({text:g.text,x:P,y:L,dy:g.dy,theta:z,level:g.level,width:y,height:f}),p.push(I)},Z.drawLabels=function(E,g,b,p,u){var y=E.selectAll("text").data(g,function(z){return z.text+","+z.x+","+z.y+","+z.theta});if(y.exit().remove(),y.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(z){var F=z.x+Math.sin(z.theta)*z.dy,B=z.y-Math.cos(z.theta)*z.dy;q.select(this).text(z.text).attr({x:F,y:B,transform:"rotate("+180*z.theta/Math.PI+" "+F+" "+B+")"}).call(M.convertToTspans,b)}),u){for(var f="",P=0;P<u.length;P++)f+="M"+u[P].join("L")+"Z";var L=v.ensureSingle(p,"path","");L.attr("d",f)}};function w(E,g,b,p,u){var y=p.trace,f=b._fullLayout._clips,P="clip"+y.uid,L=f.selectAll("#"+P).data(y.connectgaps?[]:[0]);if(L.enter().append("clipPath").classed("contourclip",!0).attr("id",P),L.exit().remove(),y.connectgaps===!1){var z={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:g.xaxis,yaxis:g.yaxis,x:p.x,y:p.y,z:S(p),smoothing:0};i([z]),a([z]),s([z],{type:"levels"});var F=v.ensureSingle(L,"path","");F.attr("d",(z.prefixBoundary?"M"+u.join("L")+"Z":"")+T(z,u))}else P=null;x.setClipUrl(E,P,b)}function S(E){var g=E.trace._emptypoints,b=[],p=E.z.length,u=E.z[0].length,y,f=[],P;for(y=0;y<u;y++)f.push(1);for(y=0;y<p;y++)b.push(f.slice());for(y=0;y<g.length;y++)P=g[y],b[P[0]][P[1]]=0;return E.zmask=b,b}}}),xM=Ze({"src/traces/contour/make_color_map.js"(Z,q){"use strict";var v=Oi(),x=rc(),A=q_();q.exports=function(e){var t=e.contours,r=t.start,i=A(t),a=t.size||1,n=Math.floor((i-r)/a)+1,o=t.coloring==="lines"?0:1,s=x.extractOpts(e);isFinite(a)||(a=1,n=1);var c=s.reversescale?x.flipScale(s.colorscale):s.colorscale,h=c.length,m=new Array(h),d=new Array(h),T,l,_=s.min,w=s.max;if(t.coloring==="heatmap"){for(l=0;l<h;l++)T=c[l],m[l]=T[0]*(w-_)+_,d[l]=T[1];var S=v.extent([_,w,t.start,t.start+a*(n-1)]),E=S[_<w?0:1],g=S[_<w?1:0];E!==_&&(m.splice(0,0,E),d.splice(0,0,d[0])),g!==w&&(m.push(g),d.push(d[d.length-1]))}else{var b=e._input&&typeof e._input.zmin=="number"&&typeof e._input.zmax=="number";for(b&&(r<=_||i>=w)&&(r<=_&&(r=_),i>=w&&(i=w),n=Math.floor((i-r)/a)+1,o=0),l=0;l<h;l++)T=c[l],m[l]=(T[0]*(n+o-1)-o/2)*a+r,d[l]=T[1];(b||e.autocontour)&&(m[0]>_&&(m.unshift(_),d.unshift(d[0])),m[m.length-1]<w&&(m.push(w),d.push(d[d.length-1])))}return x.makeColorScaleFunc({domain:m,range:d},{noNumericCheck:!0})}}}),c3=Ze({"src/traces/contour/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=t3(),M=xM();q.exports=function(t){var r=v.select(t).selectAll("g.contour");r.style("opacity",function(i){return i[0].trace.opacity}),r.each(function(i){var a=v.select(this),n=i[0].trace,o=n.contours,s=n.line,c=o.size||1,h=o.start,m=o.type==="constraint",d=!m&&o.coloring==="lines",T=!m&&o.coloring==="fill",l=d||T?M(n):null;a.selectAll("g.contourlevel").each(function(S){v.select(this).selectAll("path").call(x.lineGroupStyle,s.width,d?l(S.level):s.color,s.dash)});var _=o.labelfont;if(a.selectAll("g.contourlabels text").each(function(S){x.font(v.select(this),{weight:_.weight,style:_.style,variant:_.variant,textcase:_.textcase,lineposition:_.lineposition,shadow:_.shadow,family:_.family,size:_.size,color:_.color||(d?l(S.level):s.color)})}),m)a.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(T){var w;a.selectAll("g.contourfill path").style("fill",function(S){return w===void 0&&(w=S.level),l(S.level+.5*c)}),w===void 0&&(w=h),a.selectAll("g.contourbg path").style("fill",l(w-.5*c))}}),A(t)}}}),f3=Ze({"src/traces/contour/colorbar.js"(Z,q){"use strict";var v=rc(),x=xM(),A=q_();function M(e,t,r){var i=t.contours,a=t.line,n=i.size||1,o=i.coloring,s=x(t,{isColorbar:!0});if(o==="heatmap"){var c=v.extractOpts(t);r._fillgradient=c.reversescale?v.flipScale(c.colorscale):c.colorscale,r._zrange=[c.min,c.max]}else o==="fill"&&(r._fillcolor=s);r._line={color:o==="lines"?s:a.color,width:i.showlines!==!1?a.width:0,dash:a.dash},r._levels={start:i.start,end:A(i),size:n}}q.exports={min:"zmin",max:"zmax",calc:M}}}),bM=Ze({"src/traces/contour/hover.js"(Z,q){"use strict";var v=Yi(),x=r3();q.exports=function(M,e,t,r,i){i||(i={}),i.isContour=!0;var a=x(M,e,t,r,i);return a&&a.forEach(function(n){var o=n.trace;o.contours.type==="constraint"&&(o.fillcolor&&v.opacity(o.fillcolor)?n.color=v.addOpacity(o.fillcolor,1):o.contours.showlines&&v.opacity(o.line.color)&&(n.color=v.addOpacity(o.line.color,1)))}),a}}}),m4=Ze({"src/traces/histogram2dcontour/index.js"(Z,q){"use strict";q.exports={attributes:fM(),supplyDefaults:d4(),crossTraceDefaults:n3(),calc:dM(),plot:u3().plot,layerName:"contourlayer",style:c3(),colorbar:f3(),hoverPoints:bM(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Zf(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}}),g4=Ze({"lib/histogram2dcontour.js"(Z,q){"use strict";q.exports=m4()}}),wM=Ze({"src/traces/contour/constraint_defaults.js"(Z,q){"use strict";var v=is(),x=hM(),A=Yi(),M=A.addOpacity,e=A.opacity,t=o3(),r=ca().isArrayOrTypedArray,i=t.CONSTRAINT_REDUCTION,a=t.COMPARISON_OPS2;q.exports=function(s,c,h,m,d,T){var l=c.contours,_,w,S,E=h("contours.operation");if(l._operation=i[E],n(h,l),E==="="?_=l.showlines=!0:(_=h("contours.showlines"),S=h("fillcolor",M((s.line||{}).color||d,.5))),_){var g=S&&e(S)?M(c.fillcolor,1):d;w=h("line.color",g),h("line.width",2),h("line.dash")}h("line.smoothing"),x(h,m,w,T)};function n(o,s){var c;a.indexOf(s.operation)===-1?(o("contours.value",[0,1]),r(s.value)?s.value.length>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=_<x.PTS_LINESONLY?"lines+markers":"lines";m("mode",w),A.hasMarkers(s)&&M(o,s,c,h,m,{gradient:!0}),A.hasLines(s)&&(e(o,s,c,h,m,{backoff:!0}),t(o,s,m),m("connectgaps")),A.hasText(s)&&(m("texttemplate"),r(o,s,h,m));var S=[];(A.hasMarkers(s)||A.hasText(s))&&(m("cliponaxis"),m("marker.maxdisplayed"),S.push("points")),m("fill"),s.fill!=="none"&&(i(o,s,c,m),A.hasLines(s)||t(o,s,m)),(s.fill==="tonext"||s.fill==="toself")&&S.push("fills"),m("hoveron",S.join("+")||"points"),v.coerceSelectionMarkerOpacity(s,m)}}}),w4=Ze({"src/traces/scatterternary/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot;return t.aLabel=v.tickText(r.aaxis,A.a,!0).text,t.bLabel=v.tickText(r.baxis,A.b,!0).text,t.cLabel=v.tickText(r.caxis,A.c,!0).text,t}}}),T4=Ze({"src/traces/scatterternary/calc.js"(Z,q){"use strict";var v=is(),x=Fd(),A=Av(),M=Od(),e=Bd().calcMarkerSize,t=["a","b","c"],r={a:["b","c"],b:["a","c"],c:["a","b"]};q.exports=function(a,n){var o=a._fullLayout[n.subplot],s=o.sum,c=n.sum||s,h={a:n.a,b:n.b,c:n.c},m=n.ids,d,T,l,_,w,S;for(d=0;d<t.length;d++)if(l=t[d],!h[l]){for(w=h[r[l][0]],S=h[r[l][1]],_=new Array(w.length),T=0;T<w.length;T++)_[T]=c-w[T]-S[T];h[l]=_}var E=n._length,g=new Array(E),b,p,u,y,f,P;for(d=0;d<E;d++)b=h.a[d],p=h.b[d],u=h.c[d],v(b)&&v(p)&&v(u)?(b=+b,p=+p,u=+u,y=s/(b+p+u),y!==1&&(b*=y,p*=y,u*=y),P=b,f=u-p,g[d]={x:f,y:P,a:b,b:p,c:u},m&&(g[d].id=m[d])):g[d]={x:!1,y:!1};return e(n,E),x(a,n),A(g,n),M(g,n),g}}}),A4=Ze({"src/traces/scatterternary/plot.js"(Z,q){"use strict";var v=s1();q.exports=function(A,M,e){var t=M.plotContainer;t.select(".scatterlayer").selectAll("*").remove();for(var r=M.xaxis,i=M.yaxis,a={xaxis:r,yaxis:i,plot:t,layerClipId:M._hasClipOnAxisFalse?M.clipIdRelative:null},n=M.layers.frontplot.select("g.scatterlayer"),o=0;o<e.length;o++){var s=e[o];s.length&&(s[0].trace._xA=r,s[0].trace._yA=i)}v(A,a,e,n)}}}),S4=Ze({"src/traces/scatterternary/hover.js"(Z,q){"use strict";var v=u1();q.exports=function(A,M,e,t){var r=v(A,M,e,t);if(!r||r[0].index===!1)return;var i=r[0];if(i.index===void 0){var a=1-i.y0/A.ya._length,n=A.xa._length,o=n*a/2,s=n-o;return i.x0=Math.max(Math.min(i.x0,s),o),i.x1=Math.max(Math.min(i.x1,s),o),r}var c=i.cd[i.index],h=i.trace,m=i.subplot;i.a=c.a,i.b=c.b,i.c=c.c,i.xLabelVal=void 0,i.yLabelVal=void 0;var d={};d[h.subplot]={_subplot:m};var T=h._module.formatLabels(c,h,d);i.aLabel=T.aLabel,i.bLabel=T.bLabel,i.cLabel=T.cLabel;var l=c.hi||h.hoverinfo,_=[];function w(E,g){_.push(E._hovertitle+": "+g)}if(!h.hovertemplate){var S=l.split("+");S.indexOf("all")!==-1&&(S=["a","b","c"]),S.indexOf("a")!==-1&&w(m.aaxis,i.aLabel),S.indexOf("b")!==-1&&w(m.baxis,i.bLabel),S.indexOf("c")!==-1&&w(m.caxis,i.cLabel)}return i.extraText=_.join("<br>"),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;ue<I.length;ue++){var se=I[ue][0].trace;if(se.cliponaxis===!1){U._hasClipOnAxisFalse=!0;break}}U.updateLayers(W),U.adjustLayout(W,Q),o.generalUpdatePerTraceModule(U.graphDiv,U,I,W),U.layers.plotbg.select("path").call(r.fill,W.bgcolor)},p.makeFramework=function(I){var N=this,U=N.graphDiv,W=I[N.id],Q=N.clipId="clip"+N.layoutId+N.id,ue=N.clipIdRelative="clip-relative"+N.layoutId+N.id;N.clipDef=M.ensureSingleById(I._clips,"clipPath",Q,function(se){se.append("path").attr("d","M0,0Z")}),N.clipDefRelative=M.ensureSingleById(I._clips,"clipPath",ue,function(se){se.append("path").attr("d","M0,0Z")}),N.plotContainer=M.ensureSingle(N.container,"g",N.id),N.updateLayers(W),i.setClipUrl(N.layers.backplot,Q,U),i.setClipUrl(N.layers.grids,Q,U)},p.updateFx=function(I){I._ternarylayer.selectAll("g.toplevel").style("cursor",I.dragmode==="pan"?"move":"crosshair")},p.updateLayers=function(I){var N=this,U=N.layers,W=["draglayer","plotbg","backplot","grids"];I.aaxis.layer==="below traces"&&W.push("aaxis","aline"),I.baxis.layer==="below traces"&&W.push("baxis","bline"),I.caxis.layer==="below traces"&&W.push("caxis","cline"),W.push("frontplot"),I.aaxis.layer==="above traces"&&W.push("aaxis","aline"),I.baxis.layer==="above traces"&&W.push("baxis","bline"),I.caxis.layer==="above traces"&&W.push("caxis","cline");var Q=N.plotContainer.selectAll("g.toplevel").data(W,String),ue=["agrid","bgrid","cgrid"];Q.enter().append("g").attr("class",function(se){return"toplevel "+se}).each(function(se){var he=v.select(this);U[se]=he,se==="frontplot"?he.append("g").classed("scatterlayer",!0):se==="backplot"?he.append("g").classed("maplayer",!0):se==="plotbg"?he.append("path").attr("d","M0,0Z"):se==="aline"||se==="bline"||se==="cline"?he.append("path"):se==="grids"&&ue.forEach(function(H){U[H]=he.append("g").classed("grid "+H,!0)})}),Q.order()};var u=Math.sqrt(4/3);p.adjustLayout=function(I,N){var U=this,W=I.domain,Q=(W.x[0]+W.x[1])/2,ue=(W.y[0]+W.y[1])/2,se=W.x[1]-W.x[0],he=W.y[1]-W.y[0],H=se*N.w,$=he*N.h,J=I.sum,X=I.aaxis.min,oe=I.baxis.min,ne=I.caxis.min,j,ee,re,ce,be,Ae;H>u*$?(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<g.MINZOOM?(J=H,j.attr("d",oe),ee.attr("d","M0,0Z")):(J={a:H.a+rt*$,b:H.b+st*$,c:H.c+Qe*$},j.attr("d",oe+"M"+Lt+","+Sr+"H"+kt+"L"+qt+","+xr+"L"+Lt+","+Sr+"Z"),ee.attr("d","M"+se+","+he+F+"M"+Lt+","+Sr+P+"M"+kt+","+Sr+L+"M"+qt+","+xr+z)),ne||(j.transition().style("fill",X>.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;_<h;_++){var w=c[_];e[w]?d=e[w]:d=e[w]={},T=x.newContainer(t,w,m),i.noUirevision||l("uirevision",t.uirevision);var S={};S[s]=[_/h,(_+1)/h],A(T,t,l,S),i.id=w,o(d,T,l,i)}}}}),C4=Ze({"src/plots/ternary/layout_defaults.js"(Z,q){"use strict";var v=Yi(),x=Dl(),A=ca(),M=ng(),e=$m(),t=Qm(),r=t1(),i=Xg(),a=D_(),n=AM(),o=["aaxis","baxis","caxis"];q.exports=function(m,d,T){M(m,d,T,{type:"ternary",attributes:n,handleDefaults:s,font:d.font,paper_bgcolor:d.paper_bgcolor})};function s(h,m,d,T){var l=d("bgcolor"),_=d("sum");T.bgColor=v.combine(l,T.paper_bgcolor);for(var w,S,E,g=0;g<o.length;g++)w=o[g],S=h[w]||{},E=x.newContainer(m,w),E._name=w,c(S,E,T,m);var b=m.aaxis,p=m.baxis,u=m.caxis;b.min+p.min+u.min>=_&&(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;o<n.length;o++){var s=n[o],c=v(a,A,s),h=i[s]._subplot;h||(h=new q({id:s,graphDiv:r,container:i._ternarylayer.node()},i),i[s]._subplot=h),h.plot(c,i,r._promises)}},Z.clean=function(t,r,i,a){for(var n=a._subplots[A]||[],o=0;o<n.length;o++){var s=n[o],c=a[s]._subplot;!r[s]&&c&&(c.plotContainer.remove(),c.clipDef.remove(),c.clipDefRelative.remove(),c.layers["a-title"].remove(),c.layers["b-title"].remove(),c.layers["c-title"].remove())}},Z.updateFx=function(t){var r=t._fullLayout;r._ternarylayer.selectAll("g.toplevel").style("cursor",r.dragmode==="pan"?"move":"crosshair")}}}),L4=Ze({"src/traces/scatterternary/index.js"(Z,q){"use strict";q.exports={attributes:TM(),supplyDefaults:b4(),colorbar:hp(),formatLabels:w4(),calc:T4(),plot:A4(),style:ed().style,styleOnSelect:ed().styleOnSelect,hoverPoints:S4(),selectPoints:c1(),eventData:M4(),moduleType:"trace",name:"scatterternary",basePlotModule:k4(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}}),P4=Ze({"lib/scatterternary.js"(Z,q){"use strict";q.exports=L4()}}),SM=Ze({"src/traces/violin/attributes.js"(Z,q){"use strict";var v=B_(),x=rs().extendFlat,A=Qc().axisHoverFormat;q.exports={y:v.y,x:v.x,x0:v.x0,y0:v.y0,xhoverformat:A("x"),yhoverformat:A("y"),name:x({},v.name,{}),orientation:x({},v.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:v.fillcolor,points:x({},v.boxpoints,{}),jitter:x({},v.jitter,{}),pointpos:x({},v.pointpos,{}),width:x({},v.width,{}),marker:v.marker,text:v.text,hovertext:v.hovertext,hovertemplate:v.hovertemplate,quartilemethod:v.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:v.offsetgroup,alignmentgroup:v.alignmentgroup,selected:v.selected,unselected:v.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:v.zorder}}}),MM=Ze({"src/traces/violin/layout_attributes.js"(Z,q){"use strict";var v=N_(),x=ca().extendFlat;q.exports={violinmode:x({},v.boxmode,{}),violingap:x({},v.boxgap,{}),violingroupgap:x({},v.boxgroupgap,{})}}}),I4=Ze({"src/traces/violin/defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=U_(),M=SM();q.exports=function(t,r,i,a){function n(u,y){return v.coerce(t,r,M,u,y)}function o(u,y){return v.coerce2(t,r,M,u,y)}if(A.handleSampleDefaults(t,r,n,a),r.visible!==!1){n("bandwidth"),n("side");var s=n("width");s||(n("scalegroup",r.name),n("scalemode"));var c=n("span"),h;Array.isArray(c)&&(h="manual"),n("spanmode",h);var m=n("line.color",(t.marker||{}).color||i),d=n("line.width"),T=n("fillcolor",x.addOpacity(r.line.color,.5));A.handlePointsDefaults(t,r,n,{prefix:""});var l=o("box.width"),_=o("box.fillcolor",T),w=o("box.line.color",m),S=o("box.line.width",d),E=n("box.visible",!!(l||_||w||S));E||(r.box={visible:!1});var g=o("meanline.color",m),b=o("meanline.width",d),p=n("meanline.visible",!!(g||b));p||(r.meanline={visible:!1}),n("quartilemethod"),n("zorder")}}}}),R4=Ze({"src/traces/violin/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=MM(),A=q2();q.exports=function(e,t,r){function i(a,n){return v.coerce(e,t,x,a,n)}A._supply(e,t,r,i,"violin")}}}),h3=Ze({"src/traces/violin/helpers.js"(Z){"use strict";var q=ca(),v={gaussian:function(x){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*x*x)}};Z.makeKDE=function(x,A,M){var e=M.length,t=v.gaussian,r=x.bandwidth,i=1/(e*r);return function(a){for(var n=0,o=0;o<e;o++)n+=t((a-M[o])/r);return i*n}},Z.getPositionOnKdePath=function(x,A,M){var e,t;A.orientation==="h"?(e="y",t="x"):(e="x",t="y");var r=q.findPointOnPath(x.path,M,t,{pathLength:x.pathLength}),i=x.posCenterPx,a=r[e],n=A.side==="both"?2*i-a:i;return[a,n]},Z.getKdeValue=function(x,A,M){var e=x.pts.map(Z.extractVal),t=Z.makeKDE(x,A,e);return t(M)/x.posDensityScale},Z.extractVal=function(x){return x.v}}}),D4=Ze({"src/traces/violin/calc.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=JS(),M=h3(),e=Vs().BADNUM;q.exports=function(n,o){var s=A(n,o);if(s[0].t.empty)return s;for(var c=n._fullLayout,h=x.getFromId(n,o[o.orientation==="h"?"xaxis":"yaxis"]),m=1/0,d=-1/0,T=0,l=0,_=0;_<s.length;_++){var w=s[_],S=w.pts.map(M.extractVal),E=w.bandwidth=r(o,w,S),g=w.span=i(o,w,h,E);if(w.min===w.max&&E===0)g=w.span=[w.min,w.max],w.density=[{v:1,t:g[0]}],w.bandwidth=E,T=Math.max(T,1);else{var b=g[1]-g[0],p=Math.ceil(b/(E/3)),u=b/p;if(!isFinite(u)||!isFinite(p))return v.error("Something went wrong with computing the violin span"),s[0].t.empty=!0,s;var y=M.makeKDE(w,o,S);w.density=new Array(p);for(var f=0,P=g[0];P<g[1]+u/2;f++,P+=u){var L=y(P);w.density[f]={v:L,t:P},T=Math.max(T,L)}}l=Math.max(l,S.length),m=Math.min(m,g[0]),d=Math.max(d,g[1])}var z=x.findExtremes(h,[m,d],{padded:!0});if(o._extremes[h._id]=z,o.width)s[0].t.maxKDE=T;else{var F=c._violinScaleGroupStats,B=o.scalegroup,O=F[B];O?(O.maxKDE=Math.max(O.maxKDE,T),O.maxCount=Math.max(O.maxCount,l)):F[B]={maxKDE:T,maxCount:l}}return s[0].t.labels.kde=v._(n,"kde:"),s};function t(a,n,o){var s=Math.min(n,o/1.349);return 1.059*s*Math.pow(a,-.2)}function r(a,n,o){var s=n.max-n.min;if(!s)return a.bandwidth?a.bandwidth:0;if(a.bandwidth)return Math.max(a.bandwidth,s/1e4);var c=o.length,h=v.stdev(o,c-1,n.mean);return Math.max(t(c,h,n.q3-n.q1),s/100)}function i(a,n,o,s){var c=a.spanmode,h=a.span||[],m=[n.min,n.max],d=[n.min-2*s,n.max+2*s],T;function l(w){var S=h[w],E=o.type==="multicategory"?o.r2c(S):o.d2c(S,0,a[n.valLetter+"calendar"]);return E===e?d[w]:E}c==="soft"?T=d:c==="hard"?T=m:T=[l(0),l(1)];var _={type:"linear",range:T};return x.setConvert(_),_.cleanRange(),T}}}),z4=Ze({"src/traces/violin/cross_trace_calc.js"(Z,q){"use strict";var v=G2().setPositionOffset,x=["v","h"];q.exports=function(M,e){for(var t=M.calcdata,r=e.xaxis,i=e.yaxis,a=0;a<x.length;a++){for(var n=x[a],o=n==="h"?i:r,s=[],c=0;c<t.length;c++){var h=t[c],m=h[0].t,d=h[0].trace;d.visible===!0&&d.type==="violin"&&!m.empty&&d.orientation===n&&d.xaxis===r._id&&d.yaxis===i._id&&s.push(c)}v("violin",M,s,o)}}}}),F4=Ze({"src/traces/violin/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=H2(),e=zS(),t=h3();q.exports=function(i,a,n,o){var s=i._context.staticPlot,c=i._fullLayout,h=a.xaxis,m=a.yaxis;function d(T,l){var _=e(T,{xaxis:h,yaxis:m,trace:l,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return A.smoothopen(_[0],1)}x.makeTraceGroups(o,n,"trace violins").each(function(T){var l=v.select(this),_=T[0],w=_.t,S=_.trace;if(S.visible!==!0||w.empty){l.remove();return}var E=w.bPos,g=w.bdPos,b=a[w.valLetter+"axis"],p=a[w.posLetter+"axis"],u=S.side==="both",y=u||S.side==="positive",f=u||S.side==="negative",P=l.selectAll("path.violin").data(x.identity);P.enter().append("path").style("vector-effect",s?"none":"non-scaling-stroke").attr("class","violin"),P.exit().remove(),P.each(function(U){var W=v.select(this),Q=U.density,ue=Q.length,se=p.c2l(U.pos+E,!0),he=p.l2p(se),H;if(S.width)H=w.maxKDE/g;else{var $=c._violinScaleGroupStats[S.scalegroup];H=S.scalemode==="count"?$.maxKDE/g*($.maxCount/U.pts.length):$.maxKDE/g}var J,X,oe,ne,j,ee,re;if(y){for(ee=new Array(ue),ne=0;ne<ue;ne++)re=ee[ne]={},re[w.posLetter]=se+Q[ne].v/H,re[w.valLetter]=b.c2l(Q[ne].t,!0);J=d(ee,S)}if(f){for(ee=new Array(ue),j=0,ne=ue-1;j<ue;j++,ne--)re=ee[j]={},re[w.posLetter]=se-Q[ne].v/H,re[w.valLetter]=b.c2l(Q[ne].t,!0);X=d(ee,S)}if(u)oe=J+"L"+X.substr(1)+"Z";else{var ce=[he,b.c2p(Q[0].t)],be=[he,b.c2p(Q[ue-1].t)];S.orientation==="h"&&(ce.reverse(),be.reverse()),y?oe="M"+ce+"L"+J.substr(1)+"L"+be:oe="M"+be+"L"+X.substr(1)+"L"+ce}W.attr("d",oe),U.posCenterPx=he,U.posDensityScale=H*g,U.path=W.node(),U.pathLength=U.path.getTotalLength()/(u?2:1)});var L=S.box,z=L.width,F=(L.line||{}).width,B,O;u?(B=g*z,O=0):y?(B=[0,g*z/2],O=F*{x:1,y:-1}[w.posLetter]):(B=[g*z/2,0],O=F*{x:-1,y:1}[w.posLetter]),M.plotBoxAndWhiskers(l,{pos:p,val:b},S,{bPos:E,bdPos:B,bPosPxOffset:O}),M.plotBoxMean(l,{pos:p,val:b},S,{bPos:E,bdPos:B,bPosPxOffset:O});var I;!S.box.visible&&S.meanline.visible&&(I=x.identity);var N=l.selectAll("path.meanline").data(I||[]);N.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",s?"none":"non-scaling-stroke"),N.exit().remove(),N.each(function(U){var W=b.c2p(U.mean,!0),Q=t.getPositionOnKdePath(U,S,W);v.select(this).attr("d",S.orientation==="h"?"M"+W+","+Q[0]+"V"+Q[1]:"M"+Q[0]+","+W+"H"+Q[1])}),M.plotPoints(l,{x:h,y:m},S,w)})}}}),O4=Ze({"src/traces/violin/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=ed().stylePoints;q.exports=function(e){var t=v.select(e).selectAll("g.trace.violins");t.style("opacity",function(r){return r[0].trace.opacity}),t.each(function(r){var i=r[0].trace,a=v.select(this),n=i.box||{},o=n.line||{},s=i.meanline||{},c=s.width;a.selectAll("path.violin").style("stroke-width",i.line.width+"px").call(x.stroke,i.line.color).call(x.fill,i.fillcolor),a.selectAll("path.box").style("stroke-width",o.width+"px").call(x.stroke,o.color).call(x.fill,n.fillcolor);var h={"stroke-width":c+"px","stroke-dasharray":2*c+"px,"+c+"px"};a.selectAll("path.mean").style(h).call(x.stroke,s.color),a.selectAll("path.meanline").style(h).call(x.stroke,s.color),A(a,i,e)})}}}),B4=Ze({"src/traces/violin/hover.js"(Z,q){"use strict";var v=Yi(),x=ca(),A=Wo(),M=$S(),e=h3();q.exports=function(r,i,a,n,o){o||(o={});var s=o.hoverLayer,c=r.cd,h=c[0].trace,m=h.hoveron,d=m.indexOf("violins")!==-1,T=m.indexOf("kde")!==-1,l=[],_,w;if(d||T){var S=M.hoverOnBoxes(r,i,a,n);if(T&&S.length>0){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<S.length;U++)if(S[U].attr==="med"){N=U;break}L.spikeDistance=S[N].spikeDistance;var W=b+"Spike";L[W]=S[N][W],S[N].spikeDistance=void 0,S[N][W]=void 0,L.hovertemplate=!1,l.push(L),w={},w[b+"1"]=x.constrain(O+B[0],O,O+I),w[b+"2"]=x.constrain(O+B[1],O,O+I),w[p+"1"]=w[p+"2"]=y._offset+z}}d&&(l=l.concat(S))}m.indexOf("points")!==-1&&(_=M.hoverOnPoints(r,i,a));var Q=s.selectAll(".violinline-"+h.uid).data(w?[0]:[]);return Q.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),Q.exit().remove(),Q.attr(w).call(v.stroke,r.color),n==="closest"?_?[_]:l:(_&&l.push(_),l)}}}),N4=Ze({"src/traces/violin/index.js"(Z,q){"use strict";q.exports={attributes:SM(),layoutAttributes:MM(),supplyDefaults:I4(),crossTraceDefaults:U_().crossTraceDefaults,supplyLayoutDefaults:R4(),calc:D4(),crossTraceCalc:z4(),plot:F4(),style:O4(),styleOnSelect:ed().styleOnSelect,hoverPoints:B4(),selectPoints:QS(),moduleType:"trace",name:"violin",basePlotModule:Zf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}}),U4=Ze({"lib/violin.js"(Z,q){"use strict";q.exports=N4()}}),j4=Ze({"src/traces/funnel/constants.js"(Z,q){"use strict";q.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}}),EM=Ze({"src/traces/funnel/attributes.js"(Z,q){"use strict";var v=Sv(),x=tf().line,A=eu(),M=Qc().axisHoverFormat,e=Cs().hovertemplateAttrs,t=Cs().texttemplateAttrs,r=j4(),i=rs().extendFlat,a=Yi();q.exports={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","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),text:v.text,textposition:v.textposition,insidetextanchor:i({},v.insidetextanchor,{dflt:"middle"}),textangle:i({},v.textangle,{dflt:0}),textfont:v.textfont,insidetextfont:v.insidetextfont,outsidetextfont:v.outsidetextfont,constraintext:v.constraintext,cliponaxis:v.cliponaxis,orientation:i({},v.orientation,{}),offset:i({},v.offset,{arrayOk:!1}),width:i({},v.width,{arrayOk:!1}),marker:n(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:i({},x.color,{dflt:a.defaultLine}),width:i({},x.width,{dflt:0,editType:"plot"}),dash:x.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:v.offsetgroup,alignmentgroup:v.alignmentgroup,zorder:v.zorder};function n(){var o=i({},v.marker);return delete o.pattern,delete o.cornerradius,o}}}),CM=Ze({"src/traces/funnel/layout_attributes.js"(Z,q){"use strict";q.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),kM=Ze({"src/traces/funnel/defaults.js"(Z,q){"use strict";var v=ca(),x=Jg(),A=gd().handleText,M=i1(),e=Qd(),t=EM(),r=Yi();function i(o,s,c,h){function m(E,g){return v.coerce(o,s,t,E,g)}var d=M(o,s,h,m);if(!d){s.visible=!1;return}e(o,s,h,m),m("xhoverformat"),m("yhoverformat"),m("orientation",s.y&&!s.x?"v":"h"),m("offset"),m("width");var T=m("text");m("hovertext"),m("hovertemplate");var l=m("textposition");A(o,s,h,m,l,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s.textposition!=="none"&&!s.texttemplate&&m("textinfo",v.isArrayOrTypedArray(T)?"text+value":"value");var _=m("marker.color",c);m("marker.line.color",r.defaultLine),m("marker.line.width");var w=m("connector.visible");if(w){m("connector.fillcolor",a(_));var S=m("connector.line.width");S&&(m("connector.line.color"),m("connector.line.dash"))}m("zorder")}function a(o){var s=v.isArrayOrTypedArray(o)?"#000":o;return r.addOpacity(s,.5*r.opacity(s))}function n(o,s){var c,h;function m(T){return v.coerce(h._input,h,t,T)}for(var d=0;d<o.length;d++)h=o[d],h.type==="funnel"&&(c=h._input,x(c,h,s,m,s.funnelmode))}q.exports={supplyDefaults:i,crossTraceDefaults:n}}}),V4=Ze({"src/traces/funnel/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=CM();q.exports=function(A,M,e){var t=!1;function r(n,o){return v.coerce(A,M,x,n,o)}for(var i=0;i<e.length;i++){var a=e[i];if(a.visible&&a.type==="funnel"){t=!0;break}}t&&(r("funnelmode"),r("funnelgap",.2),r("funnelgroupgap"))}}}),q4=Ze({"src/traces/funnel/arrays_to_calcdata.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){for(var e=0;e<A.length;e++)A[e].i=e;v.mergeArray(M.text,A,"tx"),v.mergeArray(M.hovertext,A,"htx");var t=M.marker;if(t){v.mergeArray(t.opacity,A,"mo"),v.mergeArray(t.color,A,"mc");var r=t.line;r&&(v.mergeArray(r.color,A,"mlc"),v.mergeArrayCastPositive(r.width,A,"mlw"))}}}}),G4=Ze({"src/traces/funnel/calc.js"(Z,q){"use strict";var v=Wo(),x=tv(),A=q4(),M=Od(),e=Vs().BADNUM;q.exports=function(i,a){var n=v.getFromId(i,a.xaxis||"x"),o=v.getFromId(i,a.yaxis||"y"),s,c,h,m,d,T,l,_;a.orientation==="h"?(s=n.makeCalcdata(a,"x"),h=o.makeCalcdata(a,"y"),m=x(a,o,"y",h),d=!!a.yperiodalignment,T="y"):(s=o.makeCalcdata(a,"y"),h=n.makeCalcdata(a,"x"),m=x(a,n,"x",h),d=!!a.xperiodalignment,T="x"),c=m.vals;var w=Math.min(c.length,s.length),S=new Array(w);for(a._base=[],l=0;l<w;l++){s[l]<0&&(s[l]=e);var E=!1;s[l]!==e&&l+1<w&&s[l+1]!==e&&(E=!0),_=S[l]={p:c[l],s:s[l],cNext:E},a._base[l]=-.5*_.s,d&&(S[l].orig_p=h[l],S[l][T+"End"]=m.ends[l],S[l][T+"Start"]=m.starts[l]),a.ids&&(_.id=String(a.ids[l])),l===0&&(S[0].vTotal=0),S[0].vTotal+=t(_.s),_.begR=t(_.s)/t(S[0].s)}var g;for(l=0;l<w;l++)_=S[l],_.s!==e&&(_.sumR=_.s/S[0].vTotal,_.difR=g!==void 0?_.s/g:1,g=_.s);return A(S,a),M(S,a),S};function t(r){return r===e?0:r}}}),H4=Ze({"src/traces/funnel/cross_trace_calc.js"(Z,q){"use strict";var v=$g().setGroupPositions;q.exports=function(A,M){var e=A._fullLayout,t=A._fullData,r=A.calcdata,i=M.xaxis,a=M.yaxis,n=[],o=[],s=[],c,h;for(h=0;h<t.length;h++){var m=t[h],d=m.orientation==="h";m.visible===!0&&m.xaxis===i._id&&m.yaxis===a._id&&m.type==="funnel"&&(c=r[h],d?s.push(c):o.push(c),n.push(c))}var T={mode:e.funnelmode,norm:e.funnelnorm,gap:e.funnelgap,groupgap:e.funnelgroupgap};for(v(A,i,a,o,T),v(A,a,i,s,T),h=0;h<n.length;h++){c=n[h];for(var l=0;l<c.length;l++)l+1<c.length&&(c[l].nextP0=c[l+1].p0,c[l].nextS0=c[l+1].s0,c[l].nextP1=c[l+1].p1,c[l].nextS1=c[l+1].s1)}}}}),W4=Ze({"src/traces/funnel/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=Vs().BADNUM,e=e0(),t=wp().clearMinTextSize;q.exports=function(o,s,c,h){var m=o._fullLayout;t("funnel",m),r(o,s,c,h),i(o,s,c,h),e.plot(o,s,c,h,{mode:m.funnelmode,norm:m.funnelmode,gap:m.funnelgap,groupgap:m.funnelgroupgap})};function r(n,o,s,c){var h=o.xaxis,m=o.yaxis;x.makeTraceGroups(c,s,"trace bars").each(function(d){var T=v.select(this),l=d[0].trace,_=x.ensureSingle(T,"g","regions");if(!l.connector||!l.connector.visible){_.remove();return}var w=l.orientation==="h",S=_.selectAll("g.region").data(x.identity);S.enter().append("g").classed("region",!0),S.exit().remove();var E=S.size();S.each(function(g,b){if(!(b!==E-1&&!g.cNext)){var p=a(g,h,m,w),u=p[0],y=p[1],f="";u[0]!==M&&y[0]!==M&&u[1]!==M&&y[1]!==M&&u[2]!==M&&y[2]!==M&&u[3]!==M&&y[3]!==M&&(w?f+="M"+u[0]+","+y[1]+"L"+u[2]+","+y[2]+"H"+u[3]+"L"+u[1]+","+y[1]+"Z":f+="M"+u[1]+","+y[1]+"L"+u[2]+","+y[3]+"V"+y[2]+"L"+u[1]+","+y[0]+"Z"),f===""&&(f="M0,0Z"),x.ensureSingle(v.select(this),"path").attr("d",f).call(A.setClipUrl,o.layerClipId,n)}})})}function i(n,o,s,c){var h=o.xaxis,m=o.yaxis;x.makeTraceGroups(c,s,"trace bars").each(function(d){var T=v.select(this),l=d[0].trace,_=x.ensureSingle(T,"g","lines");if(!l.connector||!l.connector.visible||!l.connector.line.width){_.remove();return}var w=l.orientation==="h",S=_.selectAll("g.line").data(x.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var E=S.size();S.each(function(g,b){if(!(b!==E-1&&!g.cNext)){var p=a(g,h,m,w),u=p[0],y=p[1],f="";u[3]!==void 0&&y[3]!==void 0&&(w?(f+="M"+u[0]+","+y[1]+"L"+u[2]+","+y[2],f+="M"+u[1]+","+y[1]+"L"+u[3]+","+y[2]):(f+="M"+u[1]+","+y[1]+"L"+u[2]+","+y[3],f+="M"+u[1]+","+y[0]+"L"+u[2]+","+y[2])),f===""&&(f="M0,0Z"),x.ensureSingle(v.select(this),"path").attr("d",f).call(A.setClipUrl,o.layerClipId,n)}})})}function a(n,o,s,c){var h=[],m=[],d=c?o:s,T=c?s:o;return h[0]=d.c2p(n.s0,!0),m[0]=T.c2p(n.p0,!0),h[1]=d.c2p(n.s1,!0),m[1]=T.c2p(n.p1,!0),h[2]=d.c2p(n.nextS0,!0),m[2]=T.c2p(n.nextP0,!0),h[3]=d.c2p(n.nextS1,!0),m[3]=T.c2p(n.nextP1,!0),c?[h,m]:[m,h]}}}),X4=Ze({"src/traces/funnel/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=Yi(),M=Zm().DESELECTDIM,e=Nd(),t=wp().resizeText,r=e.styleTextPoints;function i(a,n,o){var s=o||v.select(a).selectAll('g[class^="funnellayer"]').selectAll("g.trace");t(a,s,"funnel"),s.style("opacity",function(c){return c[0].trace.opacity}),s.each(function(c){var h=v.select(this),m=c[0].trace;h.selectAll(".point > 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("<br>"),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;w<m.length;w++)l=m[w],T=l._input,x(T,l,d,_,d.waterfallmode)}q.exports={supplyDefaults:c,crossTraceDefaults:h}}}),Q4=Ze({"src/traces/waterfall/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=PM();q.exports=function(A,M,e){var t=!1;function r(n,o){return v.coerce(A,M,x,n,o)}for(var i=0;i<e.length;i++){var a=e[i];if(a.visible&&a.type==="waterfall"){t=!0;break}}t&&(r("waterfallmode"),r("waterfallgap",.2),r("waterfallgroupgap"))}}}),e7=Ze({"src/traces/waterfall/calc.js"(Z,q){"use strict";var v=Wo(),x=tv(),A=ca().mergeArray,M=Od(),e=Vs().BADNUM;function t(i){return i==="a"||i==="absolute"}function r(i){return i==="t"||i==="total"}q.exports=function(a,n){var o=v.getFromId(a,n.xaxis||"x"),s=v.getFromId(a,n.yaxis||"y"),c,h,m,d,T,l;n.orientation==="h"?(c=o.makeCalcdata(n,"x"),m=s.makeCalcdata(n,"y"),d=x(n,s,"y",m),T=!!n.yperiodalignment,l="y"):(c=s.makeCalcdata(n,"y"),m=o.makeCalcdata(n,"x"),d=x(n,o,"x",m),T=!!n.xperiodalignment,l="x"),h=d.vals;for(var _=Math.min(h.length,c.length),w=new Array(_),S=0,E,g=!1,b=0;b<_;b++){var p=c[b]||0,u=!1;(c[b]!==e||r(n.measure[b])||t(n.measure[b]))&&b+1<_&&(c[b+1]!==e||r(n.measure[b+1])||t(n.measure[b+1]))&&(u=!0);var y=w[b]={i:b,p:h[b],s:p,rawS:p,cNext:u};t(n.measure[b])?(S=y.s,y.isSum=!0,y.dir="totals",y.s=S):r(n.measure[b])?(y.isSum=!0,y.dir="totals",y.s=S):(y.isSum=!1,y.dir=y.rawS<0?"decreasing":"increasing",E=y.s,y.s=S+E,S+=E),y.dir==="totals"&&(g=!0),T&&(w[b].orig_p=m[b],w[b][l+"End"]=d.ends[b],w[b][l+"Start"]=d.starts[b]),n.ids&&(y.id=String(n.ids[b])),y.v=(n.base||0)+S}return w.length&&(w[0].hasTotals=g),A(n.text,w,"tx"),A(n.hovertext,w,"htx"),M(w,n),w}}}),t7=Ze({"src/traces/waterfall/cross_trace_calc.js"(Z,q){"use strict";var v=$g().setGroupPositions;q.exports=function(A,M){var e=A._fullLayout,t=A._fullData,r=A.calcdata,i=M.xaxis,a=M.yaxis,n=[],o=[],s=[],c,h;for(h=0;h<t.length;h++){var m=t[h];m.visible===!0&&m.xaxis===i._id&&m.yaxis===a._id&&m.type==="waterfall"&&(c=r[h],m.orientation==="h"?s.push(c):o.push(c),n.push(c))}var d={mode:e.waterfallmode,norm:e.waterfallnorm,gap:e.waterfallgap,groupgap:e.waterfallgroupgap};for(v(A,i,a,o,d),v(A,a,i,s,d),h=0;h<n.length;h++){c=n[h];for(var T=0;T<c.length;T++){var l=c[T];l.isSum===!1&&(l.s0+=T===0?0:c[T-1].s),T+1<c.length&&(c[T].nextP0=c[T+1].p0,c[T].nextS0=c[T+1].s0)}}}}}),r7=Ze({"src/traces/waterfall/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=Vs().BADNUM,e=e0(),t=wp().clearMinTextSize;q.exports=function(n,o,s,c){var h=n._fullLayout;t("waterfall",h),e.plot(n,o,s,c,{mode:h.waterfallmode,norm:h.waterfallmode,gap:h.waterfallgap,groupgap:h.waterfallgroupgap}),r(n,o,s,c)};function r(a,n,o,s){var c=n.xaxis,h=n.yaxis;x.makeTraceGroups(s,o,"trace bars").each(function(m){var d=v.select(this),T=m[0].trace,l=x.ensureSingle(d,"g","lines");if(!T.connector||!T.connector.visible){l.remove();return}var _=T.orientation==="h",w=T.connector.mode,S=l.selectAll("g.line").data(x.identity);S.enter().append("g").classed("line",!0),S.exit().remove();var E=S.size();S.each(function(g,b){if(!(b!==E-1&&!g.cNext)){var p=i(g,c,h,_),u=p[0],y=p[1],f="";u[0]!==M&&y[0]!==M&&u[1]!==M&&y[1]!==M&&(w==="spanning"&&!g.isSum&&b>0&&(_?f+="M"+u[0]+","+y[1]+"V"+y[0]:f+="M"+u[1]+","+y[0]+"H"+u[0]),w!=="between"&&(g.isSum||b<E-1)&&(_?f+="M"+u[1]+","+y[0]+"V"+y[1]:f+="M"+u[0]+","+y[1]+"H"+u[1]),u[2]!==M&&y[2]!==M&&(_?f+="M"+u[1]+","+y[1]+"V"+y[2]:f+="M"+u[1]+","+y[1]+"H"+u[2])),f===""&&(f="M0,0Z"),x.ensureSingle(v.select(this),"path").attr("d",f).call(A.setClipUrl,n.layerClipId,a)}})})}function i(a,n,o,s){var c=[],h=[],m=s?n:o,d=s?o:n;return c[0]=m.c2p(a.s0,!0),h[0]=d.c2p(a.p0,!0),c[1]=m.c2p(a.s1,!0),h[1]=d.c2p(a.p1,!0),c[2]=m.c2p(a.nextS0,!0),h[2]=d.c2p(a.nextP0,!0),s?[c,h]:[h,c]}}}),a7=Ze({"src/traces/waterfall/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=Yi(),M=Zm().DESELECTDIM,e=Nd(),t=wp().resizeText,r=e.styleTextPoints;function i(a,n,o){var s=o||v.select(a).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");t(a,s,"waterfall"),s.style("opacity",function(c){return c[0].trace.opacity}),s.each(function(c){var h=v.select(this),m=c[0].trace;h.selectAll(".point > 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("<br>")),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;n<t.length;n++)a=e[t[n]],r.push("For the `"+t[n]+"` colormodel, it is ["+(a.zminDflt||a.min).join(", ")+"]."),i.push("For the `"+t[n]+"` colormodel, it is ["+(a.zmaxDflt||a.max).join(", ")+"].");var a,n;q.exports=M({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:t,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:M({},v.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:A({},{keys:["z","color","colormodel"]}),zorder:x})}}),l7=Ze({"src/traces/image/defaults.js"(Z,q){"use strict";var v=ca(),x=RM(),A=v1(),M=Zv().IMAGE_URL_PREFIX;q.exports=function(t,r){function i(o,s){return v.coerce(t,r,x,o,s)}i("source"),r.source&&!r.source.match(M)&&delete r.source,r._hasSource=!!r.source;var a=i("z");if(r._hasZ=!(a===void 0||!a.length||!a[0]||!a[0].length),!r._hasZ&&!r._hasSource){r.visible=!1;return}i("x0"),i("y0"),i("dx"),i("dy");var n;r._hasZ?(i("colormodel","rgb"),n=A.colormodel[r.colormodel],i("zmin",n.zminDflt||n.min),i("zmax",n.zmaxDflt||n.max)):r._hasSource&&(r.colormodel="rgba256",n=A.colormodel[r.colormodel],r.zmin=n.zminDflt,r.zmax=n.zmaxDflt),i("zsmooth"),i("text"),i("hovertext"),i("hovertemplate"),r._length=null,i("zorder")}}}),Yv=Ze({"node_modules/inherits/inherits_browser.js"(Z,q){typeof Object.create=="function"?q.exports=function(x,A){A&&(x.super_=A,x.prototype=Object.create(A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}))}:q.exports=function(x,A){if(A){x.super_=A;var M=function(){};M.prototype=A.prototype,x.prototype=new M,x.prototype.constructor=x}}}}),DM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js"(Z,q){q.exports=Wg().EventEmitter}}),u7=Ze({"node_modules/base64-js/index.js"(Z){"use strict";Z.byteLength=r,Z.toByteArray=a,Z.fromByteArray=s;var q=[],v=[],x=typeof Uint8Array<"u"?Uint8Array:Array,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(M=0,e=A.length;M<e;++M)q[M]=A[M],v[A.charCodeAt(M)]=M;var M,e;v[45]=62,v[95]=63;function t(c){var h=c.length;if(h%4>0)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<w;S+=4)h=v[c.charCodeAt(S)]<<18|v[c.charCodeAt(S+1)]<<12|v[c.charCodeAt(S+2)]<<6|v[c.charCodeAt(S+3)],l[_++]=h>>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;l<m;l+=3)d=(c[l]<<16&16711680)+(c[l+1]<<8&65280)+(c[l+2]&255),T.push(n(d));return T.join("")}function s(c){for(var h,m=c.length,d=m%3,T=[],l=16383,_=0,w=m-d;_<w;_+=l)T.push(o(c,_,_+l>w?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<<r)-1,a=i>>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<<a)-1,o=n>>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<<M|r,a+=M;a>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);st<Qe;++st)if(_e[st]!==fe[st]){Fe=_e[st],rt=fe[st];break}return Fe<rt?-1:rt<Fe?1:0},t.isEncoding=function(_e){switch(String(_e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(_e,fe){if(!Array.isArray(_e))throw new TypeError('"list" argument must be an Array of Buffers');if(_e.length===0)return t.alloc(0);let Fe;if(fe===void 0)for(fe=0,Fe=0;Fe<_e.length;++Fe)fe+=_e[Fe].length;let rt=t.allocUnsafe(fe),st=0;for(Fe=0;Fe<_e.length;++Fe){let Qe=_e[Fe];if(We(Qe,Uint8Array))st+Qe.length>rt.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+=" ... "),"<Buffer "+_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;Sr<kt;++Sr)if(qt[Sr]!==Zt[Sr]){Qe=qt[Sr],Lt=Zt[Sr];break}return Qe<Lt?-1:Lt<Qe?1:0};function S(Me,_e,fe,Fe,rt){if(Me.length===0)return-1;if(typeof fe=="string"?(Fe=fe,fe=0):fe>2147483647?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;qt<Qe;qt++)if(kt(Me,qt)===kt(_e,Zt===-1?0:qt-Zt)){if(Zt===-1&&(Zt=qt),qt-Zt+1===Lt)return Zt*st}else Zt!==-1&&(qt-=qt-Zt),Zt=-1}else for(fe+Lt>Qe&&(fe=Qe-Lt),qt=fe;qt>=0;qt--){let Zt=!0;for(let Sr=0;Sr<Lt;Sr++)if(kt(Me,qt+Sr)!==kt(_e,Sr)){Zt=!1;break}if(Zt)return qt}return-1}t.prototype.includes=function(_e,fe,Fe){return this.indexOf(_e,fe,Fe)!==-1},t.prototype.indexOf=function(_e,fe,Fe){return S(this,_e,fe,Fe,!0)},t.prototype.lastIndexOf=function(_e,fe,Fe){return S(this,_e,fe,Fe,!1)};function g(Me,_e,fe,Fe){fe=Number(fe)||0;let rt=Me.length-fe;Fe?(Fe=Number(Fe),Fe>rt&&(Fe=rt)):Fe=rt;let st=_e.length;Fe>st/2&&(Fe=st/2);let Qe;for(Qe=0;Qe<Fe;++Qe){let Lt=parseInt(_e.substr(Qe*2,2),16);if(it(Lt))return Qe;Me[fe+Qe]=Lt}return Qe}function b(Me,_e,fe,Fe){return Re(ce(_e,Me.length-fe),Me,fe,Fe)}function p(Me,_e,fe,Fe){return Re(be(_e),Me,fe,Fe)}function u(Me,_e,fe,Fe){return Re(ze(_e),Me,fe,Fe)}function y(Me,_e,fe,Fe){return Re(Ae(_e,Me.length-fe),Me,fe,Fe)}t.prototype.write=function(_e,fe,Fe,rt){if(fe===void 0)rt="utf8",Fe=this.length,fe=0;else if(Fe===void 0&&typeof fe=="string")rt=fe,Fe=this.length,fe=0;else if(isFinite(fe))fe=fe>>>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(;rt<fe;){let st=Me[rt],Qe=null,Lt=st>239?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;rt<fe;++rt)Fe+=String.fromCharCode(Me[rt]&127);return Fe}function B(Me,_e,fe){let Fe="";fe=Math.min(Me.length,fe);for(let rt=_e;rt<fe;++rt)Fe+=String.fromCharCode(Me[rt]);return Fe}function O(Me,_e,fe){let Fe=Me.length;(!_e||_e<0)&&(_e=0),(!fe||fe<0||fe>Fe)&&(fe=Fe);let rt="";for(let st=_e;st<fe;++st)rt+=ot[Me[st]];return rt}function I(Me,_e,fe){let Fe=Me.slice(_e,fe),rt="";for(let st=0;st<Fe.length-1;st+=2)rt+=String.fromCharCode(Fe[st]+Fe[st+1]*256);return rt}t.prototype.slice=function(_e,fe){let Fe=this.length;_e=~~_e,fe=fe===void 0?Fe:~~fe,_e<0?(_e+=Fe,_e<0&&(_e=0)):_e>Fe&&(_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<fe&&(st*=256);)rt+=this[_e+Qe]*st;return rt},t.prototype.readUintBE=t.prototype.readUIntBE=function(_e,fe,Fe){_e=_e>>>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)<<BigInt(32))}),t.prototype.readBigUInt64BE=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*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)<<BigInt(32))+BigInt(st)}),t.prototype.readIntLE=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<fe&&(st*=256);)rt+=this[_e+Qe]*st;return st*=128,rt>=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)<<BigInt(32))+BigInt(fe+this[++_e]*2**8+this[++_e]*2**16+this[++_e]*2**24)}),t.prototype.readBigInt64BE=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<<24)+this[++_e]*2**16+this[++_e]*2**8+this[++_e];return(BigInt(rt)<<BigInt(32))+BigInt(this[++_e]*2**24+this[++_e]*2**16+this[++_e]*2**8+Fe)}),t.prototype.readFloatLE=function(_e,fe){return _e=_e>>>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||_e<st)throw new RangeError('"value" argument is out of bounds');if(fe+Fe>Me.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<Fe&&(st*=256);)this[fe+Qe]=_e/st&255;return fe+Fe},t.prototype.writeUintBE=t.prototype.writeUIntBE=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=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<Fe&&(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.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<Fe&&(rt=Fe),rt===Fe||_e.length===0||this.length===0)return 0;if(fe<0)throw new RangeError("targetStart out of bounds");if(Fe<0||Fe>=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<rt-Fe&&(rt=_e.length-fe+Fe);let st=rt-Fe;return this===_e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(fe,Fe,rt):Uint8Array.prototype.set.call(_e,this.subarray(Fe,rt),fe),st},t.prototype.fill=function(_e,fe,Fe,rt){if(typeof _e=="string"){if(typeof fe=="string"?(rt=fe,fe=0,Fe=this.length):typeof Fe=="string"&&(rt=Fe,Fe=this.length),rt!==void 0&&typeof rt!="string")throw new TypeError("encoding must be a string");if(typeof rt=="string"&&!t.isEncoding(rt))throw new TypeError("Unknown encoding: "+rt);if(_e.length===1){let Qe=_e.charCodeAt(0);(rt==="utf8"&&Qe<128||rt==="latin1")&&(_e=Qe)}}else typeof _e=="number"?_e=_e&255:typeof _e=="boolean"&&(_e=Number(_e));if(fe<0||this.length<fe||this.length<Fe)throw new RangeError("Out of range index");if(Fe<=fe)return this;fe=fe>>>0,Fe=Fe===void 0?this.length:Fe>>>0,_e||(_e=0);let st;if(typeof _e=="number")for(st=fe;st<Fe;++st)this[st]=_e;else{let Qe=t.isBuffer(_e)?_e:t.from(_e,rt),Lt=Qe.length;if(Lt===0)throw new TypeError('The value "'+_e+'" is invalid for argument "value"');for(st=0;st<Fe-fe;++st)this[st+fe]=Qe[st%Lt]}return this};var H={};function $(Me,_e,fe){H[Me]=class extends fe{constructor(){super(),Object.defineProperty(this,"message",{value:_e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Me}]`,this.stack,delete this.name}get code(){return Me}set code(rt){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:rt,writable:!0})}toString(){return`${this.name} [${Me}]: ${this.message}`}}}$("ERR_BUFFER_OUT_OF_BOUNDS",function(Me){return Me?`${Me} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$("ERR_INVALID_ARG_TYPE",function(Me,_e){return`The "${Me}" argument must be of type number. Received type ${typeof _e}`},TypeError),$("ERR_OUT_OF_RANGE",function(Me,_e,fe){let Fe=`The value of "${Me}" is out of range.`,rt=fe;return Number.isInteger(fe)&&Math.abs(fe)>2**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;Qe<Fe;++Qe){if(fe=Me.charCodeAt(Qe),fe>55295&&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<Me.length;++fe)_e.push(Me.charCodeAt(fe)&255);return _e}function Ae(Me,_e){let fe,Fe,rt,st=[];for(let Qe=0;Qe<Me.length&&!((_e-=2)<0);++Qe)fe=Me.charCodeAt(Qe),Fe=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<Fe&&!(rt+fe>=_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<a.length;s+=1)o[s]=a[s];for(var c=0;c<n.length;c+=1)o[c+a.length]=n[c];return o},t=function(a,n){for(var o=[],s=n||0,c=0;s<a.length;s+=1,c+=1)o[c]=a[s];return o},r=function(i,a){for(var n="",o=0;o<i.length;o+=1)n+=i[o],o+1<i.length&&(n+=a);return n};q.exports=function(a){var n=this;if(typeof n!="function"||x.apply(n)!==M)throw new TypeError(v+n);for(var o=t(arguments,1),s,c=function(){if(this instanceof s){var l=n.apply(this,e(o,arguments));return Object(l)===l?l:this}return n.apply(a,e(o,arguments))},h=A(0,n.length-o.length),m=[],d=0;d<h;d++)m[d]="$"+d;if(s=Function("binder","return function ("+r(m,",")+"){ return binder.apply(this,arguments); }")(c),n.prototype){var T=function(){};T.prototype=n.prototype,s.prototype=new T,T.prototype=null}return s}}}),g1=Ze({"node_modules/function-bind/index.js"(Z,q){"use strict";var v=M7();q.exports=Function.prototype.bind||v}}),d3=Ze({"node_modules/call-bind-apply-helpers/functionCall.js"(Z,q){"use strict";q.exports=Function.prototype.call}}),NM=Ze({"node_modules/call-bind-apply-helpers/functionApply.js"(Z,q){"use strict";q.exports=Function.prototype.apply}}),E7=Ze({"node_modules/call-bind-apply-helpers/reflectApply.js"(Z,q){"use strict";q.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}}),C7=Ze({"node_modules/call-bind-apply-helpers/actualApply.js"(Z,q){"use strict";var v=g1(),x=NM(),A=d3(),M=E7();q.exports=M||v.call(A,x)}}),k7=Ze({"node_modules/call-bind-apply-helpers/index.js"(Z,q){"use strict";var v=g1(),x=m1(),A=d3(),M=C7();q.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new x("a function is required");return M(v,A,t)}}}),L7=Ze({"node_modules/dunder-proto/get.js"(Z,q){"use strict";var v=k7(),x=r0(),A;try{A=[].__proto__===Array.prototype}catch(r){if(!r||typeof r!="object"||!("code"in r)||r.code!=="ERR_PROTO_ACCESS")throw r}var M=!!A&&x&&x(Object.prototype,"__proto__"),e=Object,t=e.getPrototypeOf;q.exports=M&&typeof M.get=="function"?v([M.get]):typeof t=="function"?function(i){return t(i==null?i:e(i))}:!1}}),P7=Ze({"node_modules/get-proto/index.js"(Z,q){"use strict";var v=OM(),x=BM(),A=L7();q.exports=v?function(e){return v(e)}:x?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return x(e)}:A?function(e){return A(e)}:null}}),I7=Ze({"node_modules/hasown/index.js"(Z,q){"use strict";var v=Function.prototype.call,x=Object.prototype.hasOwnProperty,A=g1();q.exports=A.call(v,x)}}),v3=Ze({"node_modules/get-intrinsic/index.js"(Z,q){"use strict";var v,x=zM(),A=f7(),M=h7(),e=p7(),t=d7(),r=FM(),i=m1(),a=v7(),n=m7(),o=g7(),s=y7(),c=_7(),h=x7(),m=b7(),d=T7(),T=Function,l=function(X){try{return T('"use strict"; return ('+X+").constructor;")()}catch{}},_=r0(),w=W_(),S=function(){throw new i},E=_?function(){try{return arguments.callee,S}catch{try{return _(arguments,"callee").get}catch{return S}}}():S,g=S7()(),b=P7(),p=BM(),u=OM(),y=NM(),f=d3(),P={},L=typeof Uint8Array>"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;Re+=1){var it=j[Re],ot=ue(it,0,1),tt=ue(it,-1);if((ot==='"'||ot==="'"||ot==="`"||tt==='"'||tt==="'"||tt==="`")&&ot!==tt)throw new r("property names with quotes must have matching quotes");if((it==="constructor"||!We)&&(Ae=!0),ee+="."+it,ce="%"+ee+"%",N(z,ce))be=z[ce];else if(be!=null){if(!(it in be)){if(!ne)throw new i("base intrinsic for "+oe+" exists, but the property is not available.");return}if(_&&Re+1>=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<c;s++)A.call(a,s)&&(o==null?n(a[s],s,a):n.call(o,a[s],s,a))},e=function(a,n,o){for(var s=0,c=a.length;s<c;s++)o==null?n(a.charAt(s),s,a):n.call(o,a.charAt(s),s,a)},t=function(a,n,o){for(var s in a)A.call(a,s)&&(o==null?n(a[s],s,a):n.call(o,a[s],s,a))},r=function(a,n,o){if(!v(n))throw new TypeError("iterator must be a function");var s;arguments.length>=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<v.length;e++)typeof x[v[e]]=="function"&&(M[M.length]=v[e]);return M}}}),B7=Ze({"node_modules/which-typed-array/index.js"(Z,q){"use strict";var v=jM(),x=VM(),A=X_(),M=y1(),e=r0(),t=M("Object.prototype.toString"),r=H_()(),i=typeof globalThis>"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;_<T.length;_+=1)if(T[_]===l)return _;return-1},c={__proto__:null};r&&e&&o?v(a,function(d){var T=new i[d];if(Symbol.toStringTag in T){var l=o(T),_=e(l,Symbol.toStringTag);if(!_){var w=o(l);_=e(w,Symbol.toStringTag)}c["$"+d]=A(_.get)}}):v(a,function(d){var T=new i[d],l=T.slice||T.set;l&&(c["$"+d]=A(l))});var h=function(T){var l=!1;return v(c,function(_,w){if(!l)try{"$"+_(T)===w&&(l=n(w,1))}catch{}}),l},m=function(T){var l=!1;return v(c,function(_,w){if(!l)try{_(T),l=n(w,1)}catch{}}),l};q.exports=function(T){if(!T||typeof T!="object")return!1;if(!r){var l=n(t(T),8,-1);return s(a,l)>-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<m.length;T+=1)if(m[T]===d)return T;return-1},n=A("String.prototype.slice"),o={},s=Object.getPrototypeOf;e&&t&&s&&v(i,function(h){var m=new r[h];if(Symbol.toStringTag in m){var d=s(m),T=t(d,Symbol.toStringTag);if(!T){var l=s(d);T=t(l,Symbol.toStringTag)}o[h]=T.get}});var c=function(m){var d=!1;return v(o,function(T,l){if(!d)try{d=T.call(m)===l}catch{}}),d};q.exports=function(m){if(!m||typeof m!="object")return!1;if(!e||!(Symbol.toStringTag in m)){var d=n(M(m),8,-1);return a(i,d)>-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<Q.length;se++)ue[Q[se]]=Object.getOwnPropertyDescriptor(W,Q[se]);return ue},v=/%[sdj%]/g;Z.format=function(U){if(!w(U)){for(var W=[],Q=0;Q<arguments.length;Q++)W.push(e(arguments[Q]));return W.join(" ")}for(var Q=1,ue=arguments,se=ue.length,he=String(U).replace(v,function($){if($==="%%")return"%";if(Q>=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<se;H=ue[++Q])T(H)||!b(H)?he+=" "+H:he+=" "+e(H);return he},Z.deprecate=function(U,W){if(typeof process<"u"&&process.noDeprecation===!0)return U;if(typeof process>"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;$<arguments.length;$++)H.push(arguments[$]);H.push(function(J,X){J?se(J):ue(X)});try{W.apply(this,H)}catch(J){se(J)}return he}return Object.setPrototypeOf(Q,Object.getPrototypeOf(W)),O&&Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,q(W))},Z.promisify.custom=O;function I(U,W){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return W(U)}function N(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function W(){for(var Q=[],ue=0;ue<arguments.length;ue++)Q.push(arguments[ue]);var se=Q.pop();if(typeof se!="function")throw new TypeError("The last argument must be of type Function");var he=this,H=function(){return se.apply(he,arguments)};U.apply(this,Q).then(function($){process.nextTick(H.bind(null,null,$))},function($){process.nextTick(I.bind(null,$,H))})}return Object.setPrototypeOf(W,Object.getPrototypeOf(U)),Object.defineProperties(W,q(U)),W}Z.callbackify=N}}),U7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(Z,q){"use strict";function v(c,h){var m=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);h&&(d=d.filter(function(T){return Object.getOwnPropertyDescriptor(c,T).enumerable})),m.push.apply(m,d)}return m}function x(c){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?v(Object(m),!0).forEach(function(d){A(c,d,m[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(m)):v(Object(m)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(m,d))})}return c}function A(c,h,m){return h in c?Object.defineProperty(c,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):c[h]=m,c}function M(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function e(c,h){for(var m=0;m<h.length;m++){var d=h[m];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(c,d.key,d)}}function t(c,h,m){return h&&e(c.prototype,h),m&&e(c,m),c}var r=t0(),i=r.Buffer,a=HM(),n=a.inspect,o=n&&n.custom||"inspect";function s(c,h,m){i.prototype.copy.call(c,h,m)}q.exports=function(){function c(){M(this,c),this.head=null,this.tail=null,this.length=0}return t(c,[{key:"push",value:function(m){var d={data:m,next:null};this.length>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<this.head.data.length?(T=this.head.data.slice(0,m),this.head.data=this.head.data.slice(m)):m===this.head.data.length?T=this.shift():T=d?this._getString(m):this._getBuffer(m),T}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(m){var d=this.head,T=1,l=d.data;for(m-=l.length;d=d.next;){var _=d.data,w=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<M.length;t++)e=M[t],r.prototype[e]||(r.prototype[e]=A.prototype[e]);var M,e,t;function r(n){if(!(this instanceof r))return new r(n);x.call(this,n),A.call(this,n),this.allowHalfOpen=!0,n&&(n.readable===!1&&(this.readable=!1),n.writable===!1&&(this.writable=!1),n.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",i)))}Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(r.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function i(){this._writableState.ended||process.nextTick(a,this)}function a(n){n.end()}Object.defineProperty(r.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(o){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=o,this._writableState.destroyed=o)}})}}),V7=Ze({"node_modules/safe-buffer/index.js"(Z,q){var v=t0(),x=v.Buffer;function A(e,t){for(var r in e)t[r]=e[r]}x.from&&x.alloc&&x.allocUnsafe&&x.allocUnsafeSlow?q.exports=v:(A(v,Z),Z.Buffer=M);function M(e,t,r){return x(e,t,r)}M.prototype=Object.create(x.prototype),A(x,M),M.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return x(e,t,r)},M.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=x(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i},M.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return x(e)},M.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(e)}}}),YM=Ze({"node_modules/stream-browserify/node_modules/string_decoder/lib/string_decoder.js"(Z){"use strict";var q=V7().Buffer,v=q.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function x(T){if(!T)return"utf8";for(var l;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(l)return;T=(""+T).toLowerCase(),l=!0}}function A(T){var l=x(T);if(typeof l!="string"&&(q.isEncoding===v||!v(T)))throw new Error("Unknown encoding: "+T);return l||T}Z.StringDecoder=M;function M(T){this.encoding=A(T);var l;switch(this.encoding){case"utf16le":this.text=o,this.end=s,l=4;break;case"utf8":this.fillLast=i,l=4;break;case"base64":this.text=c,this.end=h,l=3;break;default:this.write=m,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(l)}M.prototype.write=function(T){if(T.length===0)return"";var l,_;if(this.lastNeed){if(l=this.fillLast(T),l===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<T.length?l?l+this.text(T,_):this.text(T,_):l||""},M.prototype.end=n,M.prototype.text=a,M.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function e(T){return T<=127?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;n<i;n++)a[n]=arguments[n];t.apply(this,a)}}}function A(){}function M(t){return t.setHeader&&typeof t.abort=="function"}function e(t,r,i){if(typeof r=="function")return e(t,null,r);r||(r={}),i=x(i||A);var a=r.readable||r.readable!==!1&&t.readable,n=r.writable||r.writable!==!1&&t.writable,o=function(){t.writable||c()},s=t._writableState&&t._writableState.finished,c=function(){n=!1,s=!0,a||i.call(t)},h=t._readableState&&t._readableState.endEmitted,m=function(){a=!1,h=!0,n||i.call(t)},d=function(w){i.call(t,w)},T=function(){var w;if(a&&!h)return(!t._readableState||!t._readableState.ended)&&(w=new v),i.call(t,w);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(w=new v),i.call(t,w)},l=function(){t.req.on("finish",c)};return M(t)?(t.on("complete",c),t.on("abort",T),t.req?l():t.on("request",l)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",m),t.on("finish",c),r.error!==!1&&t.on("error",d),t.on("close",T),function(){t.removeListener("complete",c),t.removeListener("abort",T),t.removeListener("request",l),t.req&&t.req.removeListener("finish",c),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",c),t.removeListener("end",m),t.removeListener("error",d),t.removeListener("close",T)}}q.exports=e}}),q7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(Z,q){"use strict";var v;function x(l,_,w){return _ in l?Object.defineProperty(l,_,{value:w,enumerable:!0,configurable:!0,writable:!0}):l[_]=w,l}var A=m3(),M=Symbol("lastResolve"),e=Symbol("lastReject"),t=Symbol("error"),r=Symbol("ended"),i=Symbol("lastPromise"),a=Symbol("handlePromise"),n=Symbol("stream");function o(l,_){return{value:l,done:_}}function s(l){var _=l[M];if(_!==null){var w=l[n].read();w!==null&&(l[i]=null,l[M]=null,l[e]=null,_(o(w,!1)))}}function c(l){process.nextTick(s,l)}function h(l,_){return function(w,S){l.then(function(){if(_[r]){w(o(void 0,!0));return}_[a](w,S)},S)}}var m=Object.getPrototypeOf(function(){}),d=Object.setPrototypeOf((v={get stream(){return this[n]},next:function(){var _=this,w=this[t];if(w!==null)return Promise.reject(w);if(this[r])return Promise.resolve(o(void 0,!0));if(this[n].destroyed)return new Promise(function(b,p){process.nextTick(function(){_[t]?p(_[t]):b(o(void 0,!0))})});var S=this[i],E;if(S)E=new Promise(h(S,this));else{var g=this[n].read();if(g!==null)return Promise.resolve(o(g,!1));E=new Promise(this[a])}return this[i]=E,E}},x(v,Symbol.asyncIterator,function(){return this}),x(v,"return",function(){var _=this;return new Promise(function(w,S){_[n].destroy(null,function(E){if(E){S(E);return}w(o(void 0,!0))})})}),v),m),T=function(_){var w,S=Object.create(d,(w={},x(w,n,{value:_,writable:!0}),x(w,M,{value:null,writable:!0}),x(w,e,{value:null,writable:!0}),x(w,t,{value:null,writable:!0}),x(w,r,{value:_._readableState.endEmitted,writable:!0}),x(w,a,{value:function(g,b){var p=S[n].read();p?(S[i]=null,S[M]=null,S[e]=null,g(o(p,!1))):(S[M]=g,S[e]=b)},writable:!0}),w));return S[i]=null,A(_,function(E){if(E&&E.code!=="ERR_STREAM_PREMATURE_CLOSE"){var g=S[e];g!==null&&(S[i]=null,S[M]=null,S[e]=null,g(E)),S[t]=E;return}var b=S[M];b!==null&&(S[i]=null,S[M]=null,S[e]=null,b(o(void 0,!0))),S[r]=!0}),_.on("readable",c.bind(null,S)),S};q.exports=T}}),G7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js"(Z,q){q.exports=function(){throw new Error("Readable.from is not available in the browser")}}}),KM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js"(Z,q){"use strict";q.exports=y;var v;y.ReadableState=u;var x=Wg().EventEmitter,A=function(ee,re){return ee.listeners(re).length},M=DM(),e=t0().Buffer,t=window.Uint8Array||function(){};function r(j){return e.from(j)}function i(j){return e.isBuffer(j)||j instanceof t}var a=HM(),n;a&&a.debuglog?n=a.debuglog("stream"):n=function(){};var o=U7(),s=WM(),c=XM(),h=c.getHighWaterMark,m=a0().codes,d=m.ERR_INVALID_ARG_TYPE,T=m.ERR_STREAM_PUSH_AFTER_EOF,l=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,w,S,E;Yv()(y,M);var g=s.errorOrDestroy,b=["error","close","destroy","pause","resume"];function p(j,ee,re){if(typeof j.prependListener=="function")return j.prependListener(ee,re);!j._events||!j._events[ee]?j.on(ee,re):Array.isArray(j._events[ee])?j._events[ee].unshift(re):j._events[ee]=[re,j._events[ee]]}function u(j,ee,re){v=v||n0(),j=j||{},typeof re!="boolean"&&(re=ee instanceof v),this.objectMode=!!j.objectMode,re&&(this.objectMode=this.objectMode||!!j.readableObjectMode),this.highWaterMark=h(this,j,"readableHighWaterMark",re),this.buffer=new o,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.destroyed=!1,this.defaultEncoding=j.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,j.encoding&&(w||(w=YM().StringDecoder),this.decoder=new w(j.encoding),this.encoding=j.encoding)}function y(j){if(v=v||n0(),!(this instanceof y))return new y(j);var ee=this instanceof v;this._readableState=new u(j,this,ee),this.readable=!0,j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy)),M.call(this)}Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ee){this._readableState&&(this._readableState.destroyed=ee)}}),y.prototype.destroy=s.destroy,y.prototype._undestroy=s.undestroy,y.prototype._destroy=function(j,ee){ee(j)},y.prototype.push=function(j,ee){var re=this._readableState,ce;return re.objectMode?ce=!0:typeof j=="string"&&(ee=ee||re.defaultEncoding,ee!==re.encoding&&(j=e.from(j,ee),ee=""),ce=!0),f(this,j,ee,!1,ce)},y.prototype.unshift=function(j){return f(this,j,null,!0,!1)};function f(j,ee,re,ce,be){n("readableAddChunk",ee);var Ae=j._readableState;if(ee===null)Ae.reading=!1,O(j,Ae);else{var ze;if(be||(ze=L(Ae,ee)),ze)g(j,ze);else if(Ae.objectMode||ee&&ee.length>0)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<Ae.highWaterMark||Ae.length===0)}function P(j,ee,re,ce){ee.flowing&&ee.length===0&&!ee.sync?(ee.awaitDrain=0,j.emit("data",re)):(ee.length+=ee.objectMode?1:re.length,ce?ee.buffer.unshift(re):ee.buffer.push(re),ee.needReadable&&I(j)),U(j,ee)}function L(j,ee){var re;return!i(ee)&&typeof ee!="string"&&ee!==void 0&&!j.objectMode&&(re=new d("chunk",["string","Buffer","Uint8Array"],ee)),re}y.prototype.isPaused=function(){return this._readableState.flowing===!1},y.prototype.setEncoding=function(j){w||(w=YM().StringDecoder);var ee=new w(j);this._readableState.decoder=ee,this._readableState.encoding=this._readableState.decoder.encoding;for(var re=this._readableState.buffer.head,ce="";re!==null;)ce+=ee.write(re.data),re=re.next;return this._readableState.buffer.clear(),ce!==""&&this._readableState.buffer.push(ce),this._readableState.length=ce.length,this};var z=1073741824;function F(j){return j>=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-j<ee.highWaterMark)&&(ce=!0,n("length less than watermark",ce)),ee.ended||ee.reading?(ce=!1,n("reading or ended",ce)):ce&&(n("do read"),ee.reading=!0,ee.sync=!0,ee.length===0&&(ee.needReadable=!0),this._read(ee.highWaterMark),ee.sync=!1,ee.reading||(j=B(re,ee)));var be;return j>0?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.length<ee.highWaterMark||ee.flowing&&ee.length===0);){var re=ee.length;if(n("maybeReadMore read 0"),j.read(0),re===ee.length)break}ee.readingMore=!1}y.prototype._read=function(j){g(this,new l("_read()"))},y.prototype.pipe=function(j,ee){var re=this,ce=this._readableState;switch(ce.pipesCount){case 0:ce.pipes=j;break;case 1:ce.pipes=[ce.pipes,j];break;default:ce.pipes.push(j);break}ce.pipesCount+=1,n("pipe count=%d opts=%j",ce.pipesCount,ee);var be=(!ee||ee.end!==!1)&&j!==process.stdout&&j!==process.stderr,Ae=be?Re:fe;ce.endEmitted?process.nextTick(Ae):re.once("end",Ae),j.on("unpipe",ze);function ze(Fe,rt){n("onunpipe"),Fe===re&&rt&&rt.hasUnpiped===!1&&(rt.hasUnpiped=!0,ot())}function Re(){n("onend"),j.end()}var We=Q(re);j.on("drain",We);var it=!1;function ot(){n("cleanup"),j.removeListener("close",Me),j.removeListener("finish",_e),j.removeListener("drain",We),j.removeListener("error",ut),j.removeListener("unpipe",ze),re.removeListener("end",Re),re.removeListener("end",fe),re.removeListener("data",tt),it=!0,ce.awaitDrain&&(!j._writableState||j._writableState.needDrain)&&We()}re.on("data",tt);function tt(Fe){n("ondata");var rt=j.write(Fe);n("dest.write",rt),rt===!1&&((ce.pipesCount===1&&ce.pipes===j||ce.pipesCount>1&&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;Ae<be;Ae++)ce[Ae].emit("unpipe",this,{hasUnpiped:!1});return this}var ze=ne(ee.pipes,j);return ze===-1?this:(ee.pipes.splice(ze,1),ee.pipesCount-=1,ee.pipesCount===1&&(ee.pipes=ee.pipes[0]),j.emit("unpipe",this,re),this)},y.prototype.on=function(j,ee){var re=M.prototype.on.call(this,j,ee),ce=this._readableState;return j==="data"?(ce.readableListening=this.listenerCount("readable")>0,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<b.length;Ae++)j.on(b[Ae],this.emit.bind(this,b[Ae]));return this._read=function(ze){n("wrapped _read",ze),ce&&(ce=!1,j.resume())},this},typeof Symbol=="function"&&(y.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=q7()),S(this)}),Object.defineProperty(y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ee){this._readableState&&(this._readableState.flowing=ee)}}),y._fromList=J,Object.defineProperty(y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function J(j,ee){if(ee.length===0)return null;var re;return ee.objectMode?re=ee.buffer.shift():!j||j>=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;re<ce;re++)if(j[re]===ee)return re;return-1}}}),JM=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(Z,q){"use strict";q.exports=i;var v=a0().codes,x=v.ERR_METHOD_NOT_IMPLEMENTED,A=v.ERR_MULTIPLE_CALLBACK,M=v.ERR_TRANSFORM_ALREADY_TRANSFORMING,e=v.ERR_TRANSFORM_WITH_LENGTH_0,t=n0();Yv()(i,t);function r(o,s){var c=this._transformState;c.transforming=!1;var h=c.writecb;if(h===null)return this.emit("error",new A);c.writechunk=null,c.writecb=null,s!=null&&this.push(s),h(o);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function i(o){if(!(this instanceof i))return new i(o);t.call(this,o),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",a)}function a(){var o=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,c){n(o,s,c)}):n(this,null,null)}i.prototype.push=function(o,s){return this._transformState.needTransform=!1,t.prototype.push.call(this,o,s)},i.prototype._transform=function(o,s,c){c(new x("_transform()"))},i.prototype._write=function(o,s,c){var h=this._transformState;if(h.writecb=c,h.writechunk=o,h.writeencoding=s,!h.transforming){var m=this._readableState;(h.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}},i.prototype._read=function(o){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},i.prototype._destroy=function(o,s){t.prototype._destroy.call(this,o,function(c){s(c)})};function n(o,s,c){if(s)return o.emit("error",s);if(c!=null&&o.push(c),o._writableState.length)throw new e;if(o._transformState.transforming)throw new M;return o.push(null)}}}),H7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"(Z,q){"use strict";q.exports=x;var v=JM();Yv()(x,v);function x(A){if(!(this instanceof x))return new x(A);v.call(this,A)}x.prototype._transform=function(A,M,e){e(null,A)}}}),W7=Ze({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js"(Z,q){"use strict";var v;function x(c){var h=!1;return function(){h||(h=!0,c.apply(void 0,arguments))}}var A=a0().codes,M=A.ERR_MISSING_ARGS,e=A.ERR_STREAM_DESTROYED;function t(c){if(c)throw c}function r(c){return c.setHeader&&typeof c.abort=="function"}function i(c,h,m,d){d=x(d);var T=!1;c.on("close",function(){T=!0}),v===void 0&&(v=m3()),v(c,{readable:h,writable:m},function(_){if(_)return d(_);T=!0,d()});var l=!1;return function(_){if(!T&&!l){if(l=!0,r(c))return c.abort();if(typeof c.destroy=="function")return c.destroy();d(_||new e("pipe"))}}}function a(c){c()}function n(c,h){return c.pipe(h)}function o(c){return!c.length||typeof c[c.length-1]!="function"?t:c.pop()}function s(){for(var c=arguments.length,h=new Array(c),m=0;m<c;m++)h[m]=arguments[m];var d=o(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new M("streams");var T,l=h.map(function(_,w){var S=w<h.length-1,E=w>0;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<Q.length;se++)ue[Q[se]]=Object.getOwnPropertyDescriptor(W,Q[se]);return ue},v=/%[sdj%]/g;Z.format=function(U){if(!w(U)){for(var W=[],Q=0;Q<arguments.length;Q++)W.push(e(arguments[Q]));return W.join(" ")}for(var Q=1,ue=arguments,se=ue.length,he=String(U).replace(v,function($){if($==="%%")return"%";if(Q>=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<se;H=ue[++Q])T(H)||!b(H)?he+=" "+H:he+=" "+e(H);return he},Z.deprecate=function(U,W){if(typeof process<"u"&&process.noDeprecation===!0)return U;if(typeof process>"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;$<arguments.length;$++)H.push(arguments[$]);H.push(function(J,X){J?se(J):ue(X)});try{W.apply(this,H)}catch(J){se(J)}return he}return Object.setPrototypeOf(Q,Object.getPrototypeOf(W)),O&&Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,q(W))},Z.promisify.custom=O;function I(U,W){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return W(U)}function N(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function W(){for(var Q=[],ue=0;ue<arguments.length;ue++)Q.push(arguments[ue]);var se=Q.pop();if(typeof se!="function")throw new TypeError("The last argument must be of type Function");var he=this,H=function(){return se.apply(he,arguments)};U.apply(this,Q).then(function($){process.nextTick(H.bind(null,null,$))},function($){process.nextTick(I.bind(null,$,H))})}return Object.setPrototypeOf(W,Object.getPrototypeOf(U)),Object.defineProperties(W,q(U)),W}Z.callbackify=N}}),$M=Ze({"node_modules/assert/build/internal/errors.js"(Z,q){"use strict";function v(E){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},v(E)}function x(E,g){for(var b=0;b<g.length;b++){var p=g[b];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(E,M(p.key),p)}}function A(E,g,b){return g&&x(E.prototype,g),b&&x(E,b),Object.defineProperty(E,"prototype",{writable:!1}),E}function M(E){var g=e(E,"string");return v(g)==="symbol"?g:String(g)}function e(E,g){if(v(E)!=="object"||E===null)return E;var b=E[Symbol.toPrimitive];if(b!==void 0){var p=b.call(E,g||"default");if(v(p)!=="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(E)}function t(E,g){if(!(E instanceof g))throw new TypeError("Cannot call a class as a function")}function r(E,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(g&&g.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),g&&i(E,g)}function i(E,g){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,u){return p.__proto__=u,p},i(E,g)}function a(E){var g=s();return function(){var p=c(E),u;if(g){var y=c(this).constructor;u=Reflect.construct(p,arguments,y)}else u=p.apply(this,arguments);return n(this,u)}}function n(E,g){if(g&&(v(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o(E)}function o(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function s(){if(typeof Reflect>"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;b<E;b++)g[b]=arguments[b];m===void 0&&(m=Y_()),m(g.length>0,"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<arguments.length;U++){var W=arguments[U]!=null?arguments[U]:{};U%2?v(Object(W),!0).forEach(function(Q){A(N,Q,W[Q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(N,Object.getOwnPropertyDescriptors(W)):v(Object(W)).forEach(function(Q){Object.defineProperty(N,Q,Object.getOwnPropertyDescriptor(W,Q))})}return N}function A(N,U,W){return U=r(U),U in N?Object.defineProperty(N,U,{value:W,enumerable:!0,configurable:!0,writable:!0}):N[U]=W,N}function M(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")}function e(N,U){for(var W=0;W<U.length;W++){var Q=U[W];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(N,r(Q.key),Q)}}function t(N,U,W){return U&&e(N.prototype,U),W&&e(N,W),Object.defineProperty(N,"prototype",{writable:!1}),N}function r(N){var U=i(N,"string");return _(U)==="symbol"?U:String(U)}function i(N,U){if(_(N)!=="object"||N===null)return N;var W=N[Symbol.toPrimitive];if(W!==void 0){var Q=W.call(N,U||"default");if(_(Q)!=="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)(N)}function a(N,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function");N.prototype=Object.create(U&&U.prototype,{constructor:{value:N,writable:!0,configurable:!0}}),Object.defineProperty(N,"prototype",{writable:!1}),U&&T(N,U)}function n(N){var U=m();return function(){var Q=l(N),ue;if(U){var se=l(this).constructor;ue=Reflect.construct(Q,arguments,se)}else ue=Q.apply(this,arguments);return o(this,ue)}}function o(N,U){if(U&&(_(U)==="object"||typeof U=="function"))return U;if(U!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(N)}function s(N){if(N===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N}function c(N){var U=typeof Map=="function"?new Map:void 0;return c=function(Q){if(Q===null||!d(Q))return Q;if(typeof Q!="function")throw new TypeError("Super expression must either be null or a function");if(typeof U<"u"){if(U.has(Q))return U.get(Q);U.set(Q,ue)}function ue(){return h(Q,arguments,l(this).constructor)}return ue.prototype=Object.create(Q.prototype,{constructor:{value:ue,enumerable:!1,writable:!0,configurable:!0}}),T(ue,Q)},c(N)}function h(N,U,W){return m()?h=Reflect.construct.bind():h=function(ue,se,he){var H=[null];H.push.apply(H,se);var $=Function.bind.apply(ue,H),J=new $;return he&&T(J,he.prototype),J},h.apply(null,arguments)}function m(){if(typeof Reflect>"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(j<ee){for(;J[0][oe]===X[0][oe];)oe++;oe>2&&(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;oe<be;oe++){var it=oe-se;if(J.length<oe+1)it>1&&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.length<oe+1)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(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&&oe<be-2)return"".concat(Re).concat(We,`
|
||
`).concat(ue,`
|
||
`).concat(u,"...").concat(P).concat(Q,`
|
||
`)+"".concat(u,"...").concat(P)}return"".concat(Re).concat(H?We:"",`
|
||
`).concat(ue).concat(Q).concat(he).concat(ne)}var I=function(N,U){a(Q,N);var W=n(Q);function Q(ue){var se;if(M(this,Q),_(ue)!=="object"||ue===null)throw new g("options","Object",ue);var he=ue.message,H=ue.operator,$=ue.stackStartFn,J=ue.actual,X=ue.expected,oe=Error.stackTraceLimit;if(Error.stackTraceLimit=0,he!=null)se=W.call(this,String(he));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1?(u="\x1B[34m",y="\x1B[32m",P="\x1B[39m",f="\x1B[31m"):(u="",y="",P="",f="")),_(J)==="object"&&J!==null&&_(X)==="object"&&X!==null&&"stack"in J&&J instanceof Error&&"stack"in X&&X instanceof Error&&(J=F(J),X=F(X)),H==="deepStrictEqual"||H==="strictEqual")se=W.call(this,O(J,X,H));else if(H==="notDeepStrictEqual"||H==="notStrictEqual"){var ne=L[H],j=B(J).split(`
|
||
`);if(H==="notStrictEqual"&&_(J)==="object"&&J!==null&&(ne=L.notStrictEqualObject),j.length>30)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;S<h.length;++S)_.push(String(S));if(T&&h.length>0)for(var E=0;E<h.length;++E)_.push(String(E));else for(var g in h)!(w&&g==="prototype")&&x.call(h,g)&&_.push(String(g));if(t)for(var b=s(h),p=0;p<i.length;++p)!(b&&i[p]==="constructor")&&x.call(h,i[p])&&_.push(i[p]);return _});var x,A,M,e,t,r,i,a,n,o,s;q.exports=v}}),eE=Ze({"node_modules/object-keys/index.js"(Z,q){"use strict";var v=Array.prototype.slice,x=QM(),A=Object.keys,M=A?function(r){return A(r)}:Y7(),e=Object.keys;M.shim=function(){if(Object.keys){var r=function(){var i=Object.keys(arguments);return i&&i.length===arguments.length}(1,2);r||(Object.keys=function(a){return x(a)?e(v.call(a)):e(a)})}else Object.keys=M;return Object.keys||M},q.exports=M}}),K7=Ze({"node_modules/object.assign/implementation.js"(Z,q){"use strict";var v=eE(),x=p3()(),A=y1(),M=Object,e=A("Array.prototype.push"),t=A("Object.prototype.propertyIsEnumerable"),r=x?Object.getOwnPropertySymbols:null;q.exports=function(a,n){if(a==null)throw new TypeError("target must be an object");var o=M(a);if(arguments.length===1)return o;for(var s=1;s<arguments.length;++s){var c=M(arguments[s]),h=v(c),m=x&&(Object.getOwnPropertySymbols||r);if(m)for(var d=m(c),T=0;T<d.length;++T){var l=d[T];t(c,l)&&e(h,l)}for(var _=0;_<h.length;++_){var w=h[_];if(t(c,w)){var S=c[w];o[w]=S}}}return o}}}),J7=Ze({"node_modules/object.assign/polyfill.js"(Z,q){"use strict";var v=K7(),x=function(){if(!Object.assign)return!1;for(var M="abcdefghijklmnopqrst",e=M.split(""),t={},r=0;r<e.length;++r)t[e[r]]=e[r];var i=Object.assign({},t),a="";for(var n in i)a+=n;return M!==a},A=function(){if(!Object.assign||!Object.preventExtensions)return!1;var M=Object.preventExtensions({1:2});try{Object.assign(M,"xy")}catch{return M[1]==="y"}return!1};q.exports=function(){return!Object.assign||x()||A()?v:Object.assign}}}),tE=Ze({"node_modules/object-is/implementation.js"(Z,q){"use strict";var v=function(x){return x!==x};q.exports=function(A,M){return A===0&&M===0?1/A===1/M:!!(A===M||v(A)&&v(M))}}}),g3=Ze({"node_modules/object-is/polyfill.js"(Z,q){"use strict";var v=tE();q.exports=function(){return typeof Object.is=="function"?Object.is:v}}}),Z_=Ze({"node_modules/define-properties/index.js"(Z,q){"use strict";var v=eE(),x=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",A=Object.prototype.toString,M=Array.prototype.concat,e=Object.defineProperty,t=function(o){return typeof o=="function"&&A.call(o)==="[object Function]"},r=UM()(),i=e&&r,a=function(o,s,c,h){if(s in o){if(h===!0){if(o[s]===c)return}else if(!t(h)||!h())return}i?e(o,s,{configurable:!0,enumerable:!1,value:c,writable:!0}):o[s]=c},n=function(o,s){var c=arguments.length>2?arguments[2]:{},h=v(s);x&&(h=M.call(h,Object.getOwnPropertySymbols(s)));for(var m=0;m<h.length;m+=1)a(o,h[m],s[h[m]],c[h[m]])};n.supportsDescriptors=!!i,q.exports=n}}),$7=Ze({"node_modules/object-is/shim.js"(Z,q){"use strict";var v=g3(),x=Z_();q.exports=function(){var M=v();return x(Object,{is:M},{is:function(){return Object.is!==M}}),M}}}),Q7=Ze({"node_modules/object-is/index.js"(Z,q){"use strict";var v=Z_(),x=X_(),A=tE(),M=g3(),e=$7(),t=x(M(),Object);v(t,{getPolyfill:M,implementation:A,shim:e}),q.exports=t}}),rE=Ze({"node_modules/is-nan/implementation.js"(Z,q){"use strict";q.exports=function(x){return x!==x}}}),aE=Ze({"node_modules/is-nan/polyfill.js"(Z,q){"use strict";var v=rE();q.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:v}}}),e9=Ze({"node_modules/is-nan/shim.js"(Z,q){"use strict";var v=Z_(),x=aE();q.exports=function(){var M=x();return v(Number,{isNaN:M},{isNaN:function(){return Number.isNaN!==M}}),M}}}),t9=Ze({"node_modules/is-nan/index.js"(Z,q){"use strict";var v=X_(),x=Z_(),A=rE(),M=aE(),e=e9(),t=v(M(),Number);x(t,{getPolyfill:M,implementation:A,shim:e}),q.exports=t}}),r9=Ze({"node_modules/assert/build/internal/util/comparisons.js"(Z,q){"use strict";function v(Me,_e){return t(Me)||e(Me,_e)||A(Me,_e)||x()}function x(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(Me,_e){if(Me){if(typeof Me=="string")return M(Me,_e);var fe=Object.prototype.toString.call(Me).slice(8,-1);if(fe==="Object"&&Me.constructor&&(fe=Me.constructor.name),fe==="Map"||fe==="Set")return Array.from(Me);if(fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe))return M(Me,_e)}}function M(Me,_e){(_e==null||_e>Me.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;_e<Me.length;_e++){var fe=Me.charCodeAt(_e);if(fe<48||fe>57)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);rt<st;++rt)if(Me[rt]!==_e[rt]){fe=Me[rt],Fe=_e[rt];break}return fe<Fe?-1:Fe<fe?1:0}var U=void 0,W=!0,Q=!1,ue=0,se=1,he=2,H=3;function $(Me,_e){return i?Me.source===_e.source&&Me.flags===_e.flags:RegExp.prototype.toString.call(Me)===RegExp.prototype.toString.call(_e)}function J(Me,_e){if(Me.byteLength!==_e.byteLength)return!1;for(var fe=0;fe<Me.byteLength;fe++)if(Me[fe]!==_e[fe])return!1;return!0}function X(Me,_e){return Me.byteLength!==_e.byteLength?!1:N(new Uint8Array(Me.buffer,Me.byteOffset,Me.byteLength),new Uint8Array(_e.buffer,_e.byteOffset,_e.byteLength))===0}function oe(Me,_e){return Me.byteLength===_e.byteLength&&N(new Uint8Array(Me),new Uint8Array(_e))===0}function ne(Me,_e){return y(Me)?y(_e)&&o(Number.prototype.valueOf.call(Me),Number.prototype.valueOf.call(_e)):f(Me)?f(_e)&&String.prototype.valueOf.call(Me)===String.prototype.valueOf.call(_e):P(Me)?P(_e)&&Boolean.prototype.valueOf.call(Me)===Boolean.prototype.valueOf.call(_e):L(Me)?L(_e)&&BigInt.prototype.valueOf.call(Me)===BigInt.prototype.valueOf.call(_e):z(_e)&&Symbol.prototype.valueOf.call(Me)===Symbol.prototype.valueOf.call(_e)}function j(Me,_e,fe,Fe){if(Me===_e)return Me!==0?!0:fe?o(Me,_e):!0;if(fe){if(r(Me)!=="object")return typeof Me=="number"&&c(Me)&&c(_e);if(r(_e)!=="object"||Me===null||_e===null||Object.getPrototypeOf(Me)!==Object.getPrototypeOf(_e))return!1}else{if(Me===null||r(Me)!=="object")return _e===null||r(_e)!=="object"?Me==_e:!1;if(_e===null||r(_e)!=="object")return!1}var rt=T(Me),st=T(_e);if(rt!==st)return!1;if(Array.isArray(Me)){if(Me.length!==_e.length)return!1;var Qe=I(Me,U),Lt=I(_e,U);return Qe.length!==Lt.length?!1:re(Me,_e,fe,Fe,se,Qe)}if(rt==="[object Object]"&&(!E(Me)&&E(_e)||!b(Me)&&b(_e)))return!1;if(S(Me)){if(!S(_e)||Date.prototype.getTime.call(Me)!==Date.prototype.getTime.call(_e))return!1}else if(g(Me)){if(!g(_e)||!$(Me,_e))return!1}else if(p(Me)||Me instanceof Error){if(Me.message!==_e.message||Me.name!==_e.name)return!1}else if(w(Me)){if(!fe&&(F(Me)||B(Me))){if(!J(Me,_e))return!1}else if(!X(Me,_e))return!1;var kt=I(Me,U),qt=I(_e,U);return kt.length!==qt.length?!1:re(Me,_e,fe,Fe,ue,kt)}else{if(b(Me))return!b(_e)||Me.size!==_e.size?!1:re(Me,_e,fe,Fe,he);if(E(Me))return!E(_e)||Me.size!==_e.size?!1:re(Me,_e,fe,Fe,H);if(_(Me)){if(!oe(Me,_e))return!1}else if(u(Me)&&!ne(Me,_e))return!1}return re(Me,_e,fe,Fe,ue)}function ee(Me,_e){return _e.filter(function(fe){return d(Me,fe)})}function re(Me,_e,fe,Fe,rt,st){if(arguments.length===5){st=Object.keys(Me);var Qe=Object.keys(_e);if(st.length!==Qe.length)return!1}for(var Lt=0;Lt<st.length;Lt++)if(!m(_e,st[Lt]))return!1;if(fe&&arguments.length===5){var kt=s(Me);if(kt.length!==0){var qt=0;for(Lt=0;Lt<kt.length;Lt++){var Zt=kt[Lt];if(d(Me,Zt)){if(!d(_e,Zt))return!1;st.push(Zt),qt++}else if(d(_e,Zt))return!1}var Sr=s(_e);if(kt.length!==Sr.length&&ee(_e,Sr).length!==qt)return!1}else{var xr=s(_e);if(xr.length!==0&&ee(_e,xr).length!==0)return!1}}if(st.length===0&&(rt===ue||rt===se&&Me.length===0||Me.size===0))return!0;if(Fe===void 0)Fe={val1:new Map,val2:new Map,position:0};else{var jr=Fe.val1.get(Me);if(jr!==void 0){var wr=Fe.val2.get(_e);if(wr!==void 0)return jr===wr}Fe.position++}Fe.val1.set(Me,Fe.position),Fe.val2.set(_e,Fe.position);var Ir=ot(Me,_e,fe,st,Fe,rt);return Fe.val1.delete(Me),Fe.val2.delete(_e),Ir}function ce(Me,_e,fe,Fe){for(var rt=a(Me),st=0;st<rt.length;st++){var Qe=rt[st];if(j(_e,Qe,fe,Fe))return Me.delete(Qe),!0}return!1}function be(Me){switch(r(Me)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":Me=+Me;case"number":if(c(Me))return!1}return!0}function Ae(Me,_e,fe){var Fe=be(fe);return Fe??(_e.has(Fe)&&!Me.has(Fe))}function ze(Me,_e,fe,Fe,rt){var st=be(fe);if(st!=null)return st;var Qe=_e.get(st);return Qe===void 0&&!_e.has(st)||!j(Fe,Qe,!1,rt)?!1:!Me.has(st)&&j(Fe,Qe,!1,rt)}function Re(Me,_e,fe,Fe){for(var rt=null,st=a(Me),Qe=0;Qe<st.length;Qe++){var Lt=st[Qe];if(r(Lt)==="object"&&Lt!==null)rt===null&&(rt=new Set),rt.add(Lt);else if(!_e.has(Lt)){if(fe||!Ae(Me,_e,Lt))return!1;rt===null&&(rt=new Set),rt.add(Lt)}}if(rt!==null){for(var kt=a(_e),qt=0;qt<kt.length;qt++){var Zt=kt[qt];if(r(Zt)==="object"&&Zt!==null){if(!ce(rt,Zt,fe,Fe))return!1}else if(!fe&&!Me.has(Zt)&&!ce(rt,Zt,fe,Fe))return!1}return rt.size===0}return!0}function We(Me,_e,fe,Fe,rt,st){for(var Qe=a(Me),Lt=0;Lt<Qe.length;Lt++){var kt=Qe[Lt];if(j(fe,kt,rt,st)&&j(Fe,_e.get(kt),rt,st))return Me.delete(kt),!0}return!1}function it(Me,_e,fe,Fe){for(var rt=null,st=n(Me),Qe=0;Qe<st.length;Qe++){var Lt=v(st[Qe],2),kt=Lt[0],qt=Lt[1];if(r(kt)==="object"&&kt!==null)rt===null&&(rt=new Set),rt.add(kt);else{var Zt=_e.get(kt);if(Zt===void 0&&!_e.has(kt)||!j(qt,Zt,fe,Fe)){if(fe||!ze(Me,_e,kt,qt,Fe))return!1;rt===null&&(rt=new Set),rt.add(kt)}}}if(rt!==null){for(var Sr=n(_e),xr=0;xr<Sr.length;xr++){var jr=v(Sr[xr],2),wr=jr[0],Ir=jr[1];if(r(wr)==="object"&&wr!==null){if(!We(rt,Me,wr,Ir,fe,Fe))return!1}else if(!fe&&(!Me.has(wr)||!j(Me.get(wr),Ir,!1,Fe))&&!We(rt,Me,wr,Ir,!1,Fe))return!1}return rt.size===0}return!0}function ot(Me,_e,fe,Fe,rt,st){var Qe=0;if(st===he){if(!Re(Me,_e,fe,rt))return!1}else if(st===H){if(!it(Me,_e,fe,rt))return!1}else if(st===se)for(;Qe<Me.length;Qe++)if(m(Me,Qe)){if(!m(_e,Qe)||!j(Me[Qe],_e[Qe],fe,rt))return!1}else{if(m(_e,Qe))return!1;for(var Lt=Object.keys(Me);Qe<Lt.length;Qe++){var kt=Lt[Qe];if(!m(_e,kt)||!j(Me[kt],_e[kt],fe,rt))return!1}return Lt.length===Object.keys(_e).length}for(Qe=0;Qe<Fe.length;Qe++){var qt=Fe[Qe];if(!j(Me[qt],_e[qt],fe,rt))return!1}return!0}function tt(Me,_e){return j(Me,_e,Q)}function ut(Me,_e){return j(Me,_e,W)}q.exports={isDeepEqual:tt,isDeepStrictEqual:ut}}}),Y_=Ze({"node_modules/assert/build/assert.js"(Z,q){"use strict";function v($){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(J){return typeof J}:function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},v($)}function x($,J){for(var X=0;X<J.length;X++){var oe=J[X];oe.enumerable=oe.enumerable||!1,oe.configurable=!0,"value"in oe&&(oe.writable=!0),Object.defineProperty($,M(oe.key),oe)}}function A($,J,X){return J&&x($.prototype,J),X&&x($,X),Object.defineProperty($,"prototype",{writable:!1}),$}function M($){var J=e($,"string");return v(J)==="symbol"?J:String(J)}function e($,J){if(v($)!=="object"||$===null)return $;var X=$[Symbol.toPrimitive];if(X!==void 0){var oe=X.call($,J||"default");if(v(oe)!=="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(J==="string"?String:Number)($)}function t($,J){if(!($ instanceof J))throw new TypeError("Cannot call a class as a function")}var r=$M(),i=r.codes,a=i.ERR_AMBIGUOUS_ARGUMENT,n=i.ERR_INVALID_ARG_TYPE,o=i.ERR_INVALID_ARG_VALUE,s=i.ERR_INVALID_RETURN_VALUE,c=i.ERR_MISSING_ARGS,h=Z7(),m=_1(),d=m.inspect,T=_1().types,l=T.isPromise,_=T.isRegExp,w=J7()(),S=g3()(),E=y1()("RegExp.prototype.test"),g,b;function p(){var $=r9();g=$.isDeepEqual,b=$.isDeepStrictEqual}var u=!1,y=q.exports=F,f={};function P($){throw $.message instanceof Error?$.message:new h($)}function L($,J,X,oe,ne){var j=arguments.length,ee;if(j===0)ee="Failed";else if(j===1)X=$,$=void 0;else{if(u===!1){u=!0;var re=process.emitWarning?process.emitWarning:console.warn.bind(console);re("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}j===2&&(oe="!=")}if(X instanceof Error)throw X;var ce={actual:$,expected:J,operator:oe===void 0?"fail":oe,stackStartFn:ne||L};X!==void 0&&(ce.message=X);var be=new h(ce);throw ee&&(be.message=ee,be.generatedMessage=!0),be}y.fail=L,y.AssertionError=h;function z($,J,X,oe){if(!X){var ne=!1;if(J===0)ne=!0,oe="No value argument passed to `assert.ok()`";else if(oe instanceof Error)throw oe;var j=new h({actual:X,expected:!0,message:oe,operator:"==",stackStartFn:$});throw j.generatedMessage=ne,j}}function F(){for(var $=arguments.length,J=new Array($),X=0;X<$;X++)J[X]=arguments[X];z.apply(void 0,[F,J.length].concat(J))}y.ok=F,y.equal=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");J!=X&&P({actual:J,expected:X,message:oe,operator:"==",stackStartFn:$})},y.notEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");J==X&&P({actual:J,expected:X,message:oe,operator:"!=",stackStartFn:$})},y.deepEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");g===void 0&&p(),g(J,X)||P({actual:J,expected:X,message:oe,operator:"deepEqual",stackStartFn:$})},y.notDeepEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");g===void 0&&p(),g(J,X)&&P({actual:J,expected:X,message:oe,operator:"notDeepEqual",stackStartFn:$})},y.deepStrictEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");g===void 0&&p(),b(J,X)||P({actual:J,expected:X,message:oe,operator:"deepStrictEqual",stackStartFn:$})},y.notDeepStrictEqual=B;function B($,J,X){if(arguments.length<2)throw new c("actual","expected");g===void 0&&p(),b($,J)&&P({actual:$,expected:J,message:X,operator:"notDeepStrictEqual",stackStartFn:B})}y.strictEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");S(J,X)||P({actual:J,expected:X,message:oe,operator:"strictEqual",stackStartFn:$})},y.notStrictEqual=function $(J,X,oe){if(arguments.length<2)throw new c("actual","expected");S(J,X)&&P({actual:J,expected:X,message:oe,operator:"notStrictEqual",stackStartFn:$})};var O=A(function $(J,X,oe){var ne=this;t(this,$),X.forEach(function(j){j in J&&(oe!==void 0&&typeof oe[j]=="string"&&_(J[j])&&E(J[j],oe[j])?ne[j]=oe[j]:ne[j]=J[j])})});function I($,J,X,oe,ne,j){if(!(X in $)||!b($[X],J[X])){if(!oe){var ee=new O($,ne),re=new O(J,ne,$),ce=new h({actual:ee,expected:re,operator:"deepStrictEqual",stackStartFn:j});throw ce.actual=$,ce.expected=J,ce.operator=j.name,ce}P({actual:$,expected:J,message:oe,operator:j.name,stackStartFn:j})}}function N($,J,X,oe){if(typeof J!="function"){if(_(J))return E(J,$);if(arguments.length===2)throw new n("expected",["Function","RegExp"],J);if(v($)!=="object"||$===null){var ne=new h({actual:$,expected:J,message:X,operator:"deepStrictEqual",stackStartFn:oe});throw ne.operator=oe.name,ne}var j=Object.keys(J);if(J instanceof Error)j.push("name","message");else if(j.length===0)throw new o("error",J,"may not be an empty object");return g===void 0&&p(),j.forEach(function(ee){typeof $[ee]=="string"&&_(J[ee])&&E(J[ee],$[ee])||I($,J,ee,X,j,oe)}),!0}return J.prototype!==void 0&&$ instanceof J?!0:Error.isPrototypeOf(J)?!1:J.call({},$)===!0}function U($){if(typeof $!="function")throw new n("fn","Function",$);try{$()}catch(J){return J}return f}function W($){return l($)||$!==null&&v($)==="object"&&typeof $.then=="function"&&typeof $.catch=="function"}function Q($){return Promise.resolve().then(function(){var J;if(typeof $=="function"){if(J=$(),!W(J))throw new s("instance of Promise","promiseFn",J)}else if(W($))J=$;else throw new n("promiseFn",["Function","Promise"],$);return Promise.resolve().then(function(){return J}).then(function(){return f}).catch(function(X){return X})})}function ue($,J,X,oe){if(typeof X=="string"){if(arguments.length===4)throw new n("error",["Object","Error","Function","RegExp"],X);if(v(J)==="object"&&J!==null){if(J.message===X)throw new a("error/message",'The error message "'.concat(J.message,'" is identical to the message.'))}else if(J===X)throw new a("error/message",'The error "'.concat(J,'" is identical to the message.'));oe=X,X=void 0}else if(X!=null&&v(X)!=="object"&&typeof X!="function")throw new n("error",["Object","Error","Function","RegExp"],X);if(J===f){var ne="";X&&X.name&&(ne+=" (".concat(X.name,")")),ne+=oe?": ".concat(oe):".";var j=$.name==="rejects"?"rejection":"exception";P({actual:void 0,expected:X,operator:$.name,message:"Missing expected ".concat(j).concat(ne),stackStartFn:$})}if(X&&!N(J,X,oe,$))throw J}function se($,J,X,oe){if(J!==f){if(typeof X=="string"&&(oe=X,X=void 0),!X||N(J,X)){var ne=oe?": ".concat(oe):".",j=$.name==="doesNotReject"?"rejection":"exception";P({actual:J,expected:X,operator:$.name,message:"Got unwanted ".concat(j).concat(ne,`
|
||
`)+'Actual message: "'.concat(J&&J.message,'"'),stackStartFn:$})}throw J}}y.throws=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];ue.apply(void 0,[$,U(J)].concat(oe))},y.rejects=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];return Q(J).then(function(j){return ue.apply(void 0,[$,j].concat(oe))})},y.doesNotThrow=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];se.apply(void 0,[$,U(J)].concat(oe))},y.doesNotReject=function $(J){for(var X=arguments.length,oe=new Array(X>1?X-1:0),ne=1;ne<X;ne++)oe[ne-1]=arguments[ne];return Q(J).then(function(j){return se.apply(void 0,[$,j].concat(oe))})},y.ifError=function $(J){if(J!=null){var X="ifError got unwanted exception: ";v(J)==="object"&&typeof J.message=="string"?J.message.length===0&&J.constructor?X+=J.constructor.name:X+=J.message:X+=d(J);var oe=new h({actual:J,expected:null,operator:"ifError",message:X,stackStartFn:$}),ne=J.stack;if(typeof ne=="string"){var j=ne.split(`
|
||
`);j.shift();for(var ee=oe.stack.split(`
|
||
`),re=0;re<j.length;re++){var ce=ee.indexOf(j[re]);if(ce!==-1){ee=ee.slice(0,ce);break}}oe.stack="".concat(ee.join(`
|
||
`),`
|
||
`).concat(j.join(`
|
||
`))}throw oe}};function he($,J,X,oe,ne){if(!_(J))throw new n("regexp","RegExp",J);var j=ne==="match";if(typeof $!="string"||E(J,$)!==j){if(X instanceof Error)throw X;var ee=!X;X=X||(typeof $!="string"?'The "string" argument must be of type string. Received type '+"".concat(v($)," (").concat(d($),")"):(j?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(d(J),`. Input:
|
||
|
||
`).concat(d($),`
|
||
`));var re=new h({actual:$,expected:J,message:X,operator:ne,stackStartFn:oe});throw re.generatedMessage=ee,re}}y.match=function $(J,X,oe){he(J,X,oe,$,"match")},y.doesNotMatch=function $(J,X,oe){he(J,X,oe,$,"doesNotMatch")};function H(){for(var $=arguments.length,J=new Array($),X=0;X<$;X++)J[X]=arguments[X];z.apply(void 0,[H,J.length].concat(J))}y.strict=w(H,y,{equal:y.strictEqual,deepEqual:y.deepStrictEqual,notEqual:y.notStrictEqual,notDeepEqual:y.notDeepStrictEqual}),y.strict.strict=y.strict}}),a9=Ze({"node_modules/stream-parser/node_modules/ms/index.js"(Z,q){var v=1e3,x=v*60,A=x*60,M=A*24,e=M*365.25;q.exports=function(n,o){o=o||{};var s=typeof n;if(s==="string"&&n.length>0)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<o))return n<o*1.5?Math.floor(n/o)+" "+s:Math.ceil(n/o)+" "+s+"s"}}}),n9=Ze({"node_modules/stream-parser/node_modules/debug/src/debug.js"(Z,q){Z=q.exports=A.debug=A.default=A,Z.coerce=r,Z.disable=e,Z.enable=M,Z.enabled=t,Z.humanize=a9(),Z.names=[],Z.skips=[],Z.formatters={};var v;function x(i){var a=0,n;for(n in i)a=(a<<5)-a+i.charCodeAt(n),a|=0;return Z.colors[Math.abs(a)%Z.colors.length]}function A(i){function a(){if(a.enabled){var n=a,o=+new Date,s=o-(v||o);n.diff=s,n.prev=v,n.curr=o,v=o;for(var c=new Array(arguments.length),h=0;h<c.length;h++)c[h]=arguments[h];c[0]=Z.coerce(c[0]),typeof c[0]!="string"&&c.unshift("%O");var m=0;c[0]=c[0].replace(/%([a-zA-Z%])/g,function(T,l){if(T==="%%")return T;m++;var _=Z.formatters[l];if(typeof _=="function"){var w=c[m];T=_.call(n,w),c.splice(m,1),m--}return T}),Z.formatArgs.call(n,c);var d=a.log||Z.log||console.log.bind(console);d.apply(n,c)}}return a.namespace=i,a.enabled=Z.enabled(i),a.useColors=Z.useColors(),a.color=x(i),typeof Z.init=="function"&&Z.init(a),a}function M(i){Z.save(i),Z.names=[],Z.skips=[];for(var a=(typeof i=="string"?i:"").split(/[\s,]+/),n=a.length,o=0;o<n;o++)a[o]&&(i=a[o].replace(/\*/g,".*?"),i[0]==="-"?Z.skips.push(new RegExp("^"+i.substr(1)+"$")):Z.names.push(new RegExp("^"+i+"$")))}function e(){Z.enable("")}function t(i){var a,n;for(a=0,n=Z.skips.length;a<n;a++)if(Z.skips[a].test(i))return!1;for(a=0,n=Z.names.length;a<n;a++)if(Z.names[a].test(i))return!0;return!1}function r(i){return i instanceof Error?i.stack||i.message:i}}}),i9=Ze({"node_modules/stream-parser/node_modules/debug/src/browser.js"(Z,q){Z=q.exports=n9(),Z.log=A,Z.formatArgs=x,Z.save=M,Z.load=e,Z.useColors=v,Z.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:t(),Z.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function v(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=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<t.length;)if(M[r++]!==t[i++])return!1;return!0},Z.str2arr=function(M,e){var t=[],r=0;if(e&&e==="hex")for(;r<M.length;)t.push(parseInt(M.slice(r,r+2),16)),r+=2;else for(;r<M.length;r++)t.push(M.charCodeAt(r)&255);return t},Z.readUInt16LE=function(M,e){return M[e]|M[e+1]<<8},Z.readUInt16BE=function(M,e){return M[e+1]|M[e]<<8},Z.readUInt32LE=function(M,e){return M[e]|M[e+1]<<8|M[e+2]<<16|M[e+3]*16777216},Z.readUInt32BE=function(M,e){return M[e+3]|M[e+2]<<8|M[e+1]<<16|M[e]*16777216};function A(M,e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"",this.name=this.constructor.name,this.message=M,e&&(this.code=e),t&&(this.statusCode=t)}A.prototype=Object.create(Error.prototype),A.prototype.constructor=A,Z.ProbeError=A}}),s9=Ze({"node_modules/probe-image-size/lib/miaf_utils.js"(Z,q){"use strict";var v=ac().readUInt16BE,x=ac().readUInt32BE;function A(o,s){if(o.length<4+s)return null;var c=x(o,s);return o.length<c+s||c<8?null:{boxtype:String.fromCharCode.apply(null,o.slice(s+4,s+8)),data:o.slice(s+8,s+c),end:s+c}}q.exports.unbox=A;function M(o,s){for(var c=0;;){var h=A(o,c);if(!h)break;switch(h.boxtype){case"ispe":s.sizes.push({width:x(h.data,4),height:x(h.data,8)});break;case"irot":s.transforms.push({type:"irot",value:h.data[0]&3});break;case"imir":s.transforms.push({type:"imir",value:h.data[0]&1});break}c=h.end}}function e(o,s,c){for(var h=0,m=0;m<c;m++)h=h*256+(o[s+m]||0);return h}function t(o,s){for(var c=o[4]>>4&15,h=o[4]&15,m=o[5]>>4&15,d=v(o,6),T=8,l=0;l<d;l++){var _=v(o,T);T+=2;var w=v(o,T);T+=2;var S=e(o,T,m);T+=m;var E=v(o,T);if(T+=2,w===0&&E===1){var g=e(o,T,c),b=e(o,T+c,h);s.item_loc[_]={length:b,offset:g+S}}T+=E*(c+h)}}function r(o,s){for(var c=v(o,4),h=6,m=0;m<c;m++){var d=A(o,h);if(!d)break;if(d.boxtype==="infe"){for(var T=v(d.data,4),l="",_=8;_<d.data.length&&d.data[_];_++)l+=String.fromCharCode(d.data[_]);s.item_inf[l]=T}h=d.end}}function i(o,s){for(var c=0;;){var h=A(o,c);if(!h)break;h.boxtype==="ipco"&&M(h.data,s),c=h.end}}function a(o,s){for(var c=4;;){var h=A(o,c);if(!h)break;h.boxtype==="iprp"&&i(h.data,s),h.boxtype==="iloc"&&t(h.data,s),h.boxtype==="iinf"&&r(h.data,s),c=h.end}}function n(o){var s=o.reduce(function(m,d){return m.width>d.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;_<d.value;_++)h=T[h]});var m=null;return s.item_inf.Exif&&(m=s.item_loc[s.item_inf.Exif]),{width:c.width,height:c.height,orientation:s.transforms.length?h:null,variants:s.sizes,exif_location:m}}},q.exports.getMimeType=function(o){var s=String.fromCharCode.apply(null,o.slice(0,4)),c={};c[s]=!0;for(var h=8;h<o.length;h+=4)c[String.fromCharCode.apply(null,o.slice(h,h+4))]=!0;if(!(!c.mif1&&!c.msf1&&!c.miaf))return s==="avif"||s==="avis"||s==="avio"?{type:"avif",mime:"image/avif"}:s==="heic"||s==="heix"?{type:"heic",mime:"image/heic"}:s==="hevc"||s==="hevx"?{type:"heic",mime:"image/heic-sequence"}:c.avif||c.avis?{type:"avif",mime:"image/avif"}:c.heic||c.heix||c.hevc||c.hevx||c.heis?c.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}}),y3=Ze({"node_modules/probe-image-size/lib/exif_utils.js"(Z,q){"use strict";function v(M,e){var t=new Error(M);return t.code=e,t}function x(M){try{return decodeURIComponent(escape(M))}catch{return M}}function A(M,e,t){this.input=M.subarray(e,t),this.start=e;var r=String.fromCharCode.apply(null,this.input.subarray(0,4));if(r!=="II*\0"&&r!=="MM\0*")throw v("invalid TIFF signature","EBADDATA");this.big_endian=r[0]==="M"}A.prototype.each=function(M){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>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;i<r;i++){var a=this.read_uint16(e),n=this.read_uint16(e+2),o=this.read_uint32(e+4),s=this.exif_format_length(n),c=o*s,h=c<=4?e+8:this.read_uint32(e+8),m=!1;if(h+c>this.input.length)throw v("unexpected EOF","EBADDATA");for(var d=[],T=h,l=0;l<o;l++,T+=s){var _=this.exif_format_read(n,T);if(_===null){d=null;break}d.push(_)}Array.isArray(d)&&n===2&&(d=x(String.fromCharCode.apply(null,d)),d&&d[d.length-1]==="\0"&&(d=d.slice(0,-1))),this.is_subifd_link(M,a)&&Array.isArray(d)&&Number.isInteger(d[0])&&d[0]>0&&(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;o<i;o++){var s=e[6+M*o]||256,c=e[6+M*o+1]||256,h={width:s,height:c};a.push(h),(s>n.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-r<a)return;var o={width:v(t,r+3),height:v(t,r+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return n>0&&(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<h&&v(s[c]);)c++;return c===h?!1:s[c]===60}var M=/<[-_.:a-zA-Z0-9][^>]*>/,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<s.length;h++)c+=String.fromCharCode(s[h]);var m=(c.match(M)||[""])[0];if(e.test(m)){var d=n(m),T=parseFloat(d.width),l=parseFloat(d.height);if(d.width&&d.height)return!x(T)||!x(l)?void 0:{width:T,height:l,type:"svg",mime:"image/svg+xml",wUnits:o(d.width),hUnits:o(d.height)};var _=(d.viewbox||"").split(" "),w={width:_[2],height:_[3]},S=parseFloat(w.width),E=parseFloat(w.height);if(!(!x(S)||!x(E))&&o(w.width)===o(w.height)){var g=S/E;return d.width?x(T)?{width:T,height:T/g,type:"svg",mime:"image/svg+xml",wUnits:o(d.width),hUnits:o(d.width)}:void 0:d.height?x(l)?{width:l*g,height:l,type:"svg",mime:"image/svg+xml",wUnits:o(d.height),hUnits:o(d.height)}:void 0:{width:S,height:E,type:"svg",mime:"image/svg+xml",wUnits:o(w.width),hUnits:o(w.height)}}}}}}}),m9=Ze({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=ac().readUInt16BE,e=ac().readUInt32LE,t=ac().readUInt32BE,r=v("II*\0"),i=v("MM\0*");function a(s,c,h){return h?M(s,c):A(s,c)}function n(s,c,h){return h?t(s,c):e(s,c)}function o(s,c,h){var m=a(s,c+2,h),d=n(s,c+4,h);return d!==1||m!==3&&m!==4?null:m===3?a(s,c+8,h):n(s,c+8,h)}q.exports=function(s){if(!(s.length<8)&&!(!x(s,0,r)&&!x(s,0,i))){var c=s[0]===77,h=n(s,4,c)-8;if(!(h<0)){var m=h+8;if(!(s.length-m<2)){var d=a(s,m+0,c)*12;if(!(d<=0)&&(m+=2,!(s.length-m<d))){var T,l,_,w;for(T=0;T<d;T+=12)w=a(s,m+T,c),w===256?l=o(s,m+T,c):w===257&&(_=o(s,m+T,c));if(l&&_)return{width:l,height:_,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}}),g9=Ze({"node_modules/probe-image-size/lib/parse_sync/webp.js"(Z,q){"use strict";var v=ac().str2arr,x=ac().sliceEq,A=ac().readUInt16LE,M=ac().readUInt32LE,e=y3(),t=v("RIFF"),r=v("WEBP");function i(o,s){if(!(o[s+3]!==157||o[s+4]!==1||o[s+5]!==42))return{width:A(o,s+6)&16383,height:A(o,s+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function a(o,s){if(o[s]===47){var c=M(o,s+1);return{width:(c&16383)+1,height:(c>>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]<<s|o[s+8]<<8|o[s+7])+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}q.exports=function(o){if(!(o.length<16)&&!(!x(o,0,t)&&!x(o,8,r))){var s=12,c=null,h=0,m=M(o,4)+8;if(!(m>o.length)){for(;s+8<m;){if(o[s]===0){s++;continue}var d=String.fromCharCode.apply(null,o.slice(s,s+4)),T=M(o,s+4);d==="VP8 "&&T>=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;e<M.length;e++){var t=v[M[e]](A);if(t)return t}return null}q.exports=function(M){return x(M)},q.exports.parsers=v}}),x9=Ze({"src/traces/image/helpers.js"(Z){"use strict";var q=_9(),v=Zv().IMAGE_URL_PREFIX,x=t0().Buffer;Z.getImageSize=function(A){var M=A.replace(v,""),e=new x(M,"base64");return q(e)}}}),b9=Ze({"src/traces/image/calc.js"(Z,q){"use strict";var v=ca(),x=v1(),A=is(),M=Wo(),e=ca().maxRowLength,t=x9().getImageSize;q.exports=function(o,s){var c,h;if(s._hasZ)c=s.z.length,h=e(s.z);else if(s._hasSource){var m=t(s.source);c=m.height,h=m.width}var d=M.getFromId(o,s.xaxis||"x"),T=M.getFromId(o,s.yaxis||"y"),l=d.d2c(s.x0)-s.dx/2,_=T.d2c(s.y0)-s.dy/2,w,S=[l,l+h*s.dx],E=[_,_+c*s.dy];if(d&&d.type==="log")for(w=0;w<h;w++)S.push(l+w*s.dx);if(T&&T.type==="log")for(w=0;w<c;w++)E.push(_+w*s.dy);s._extremes[d._id]=M.findExtremes(d,S),s._extremes[T._id]=M.findExtremes(T,E),s._scaler=a(s);var g={x0:l,y0:_,z:s.z,w:h,h:c};return[g]};function r(n,o,s,c){return function(h){return v.constrain((h-n)*o,s,c)}}function i(n,o){return function(s){return v.constrain(s,n,o)}}function a(n){var o=x.colormodel[n.colormodel],s=o.colormodel||n.colormodel,c=s.length;n._sArray=[];for(var h=0;h<c;h++)o.min[h]!==n.zmin[h]||o.max[h]!==n.zmax[h]?n._sArray.push(r(n.zmin[h],(o.max[h]-o.min[h])/(n.zmax[h]-n.zmin[h]),o.min[h],o.max[h])):n._sArray.push(i(o.min[h],o.max[h]));return function(m){for(var d=m.slice(0,c),T=0;T<c;T++){var l=d[T];if(!A(l))return!1;d[T]=n._sArray[T](l)}return d}}}}),w9=Ze({"src/traces/image/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=x.strTranslate,M=vd(),e=v1(),t=sM(),r=Q2().STYLE;q.exports=function(a,n,o,s){var c=n.xaxis,h=n.yaxis,m=!a._context._exportedPlot&&t();x.makeTraceGroups(s,o,"im").each(function(d){var T=v.select(this),l=d[0],_=l.trace,w=(_.zsmooth==="fast"||_.zsmooth===!1&&m)&&!_._hasZ&&_._hasSource&&c.type==="linear"&&h.type==="linear";_._realImage=w;var S=l.z,E=l.x0,g=l.y0,b=l.w,p=l.h,u=_.dx,y=_.dy,f,P,L,z,F,B;for(B=0;f===void 0&&B<b;)f=c.c2p(E+B*u),B++;for(B=b;P===void 0&&B>0;)P=c.c2p(E+B*u),B--;for(B=0;z===void 0&&B<p;)z=h.c2p(g+B*y),B++;for(B=p;F===void 0&&B>0;)F=h.c2p(g+B*y),B--;if(P<f&&(L=P,P=f,f=L),F<z&&(L=z,z=F,F=L),!w){var O=.5;f=Math.max(-O*c._length,f),P=Math.min((1+O)*c._length,P),z=Math.max(-O*h._length,z),F=Math.min((1+O)*h._length,F)}var I=Math.round(P-f),N=Math.round(F-z),U=I<=0||N<=0;if(U){var W=T.selectAll("image").data([]);W.exit().remove();return}function Q(j){var ee=document.createElement("canvas");ee.width=I,ee.height=N;var re=ee.getContext("2d",{willReadFrequently:!0}),ce=function(_e){return x.constrain(Math.round(c.c2p(E+_e*u)-f),0,I)},be=function(_e){return x.constrain(Math.round(h.c2p(g+_e*y)-z),0,N)},Ae=e.colormodel[_.colormodel],ze=Ae.colormodel||_.colormodel,Re=Ae.fmt,We;for(B=0;B<l.w;B++){var it=ce(B),ot=ce(B+1);if(!(ot===it||isNaN(ot)||isNaN(it)))for(var tt=0;tt<l.h;tt++){var ut=be(tt),Me=be(tt+1);Me===ut||isNaN(Me)||isNaN(ut)||!j(B,tt)||(We=_._scaler(j(B,tt)),We?re.fillStyle=ze+"("+Re(We).join(",")+")":re.fillStyle="rgba(0,0,0,0)",re.fillRect(it,ut,ot-it,Me-ut))}}return ee}var ue=T.selectAll("image").data([d]);ue.enter().append("svg:image").attr({xmlns:M.svg,preserveAspectRatio:"none"}),ue.exit().remove();var se=_.zsmooth===!1?r:"";if(w){var he=x.simpleMap(c.range,c.r2l),H=x.simpleMap(h.range,h.r2l),$=he[1]<he[0],J=H[1]>H[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;d<h;d++){var T=o[d];if(v(T)&&T>0){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;_<T;_++)h[_]=String(n.label0+_*n.dlabel);var S={},E=t(s["_"+n.type+"colormap"]),g=0,b=!1;for(_=0;_<T;_++){var p,u,y;if(l){if(p=d[_],!v(p))continue;p=+p}else p=1;u=h[_],(u===void 0||u==="")&&(u=_),u=String(u);var f=S[u];f===void 0?(S[u]=o.length,y=c.indexOf(u)!==-1,y||(g+=p),o.push({v:p,label:u,color:E(m[_],u),i:_,pts:[_],hidden:y})):(b=!0,w=o[f],w.v+=p,w.pts.push(_),w.hidden||(g+=p),w.color===!1&&m[_]&&(w.color=E(m[_],u)))}o=o.filter(function(L){return L.v>=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;T<c.length;T++){var l=c[T],_=l[0].trace.type;if(_===o)for(var w=0;w<l.length;w++){var S=l[w];S.color===!1&&(m[S.label]?S.color=m[S.label]:(m[S.label]=S.color=h[d%h.length],d++))}}}function i(a,n){var o,s=JSON.stringify(a),c=n[s];if(!c){for(c=a.slice(),o=0;o<a.length;o++)c.push(x(a[o]).lighten(20).toHexString());for(o=0;o<a.length;o++)c.push(x(a[o]).darken(20).toHexString());n[s]=c}return c}q.exports={calc:e,crossTraceCalc:r,makePullColorFn:t,generateExtendedColors:i}}}),k9=Ze({"src/traces/pie/event_data.js"(Z,q){"use strict";var v=Qp().appendArrayMultiPointValues;q.exports=function(A,M){var e={curveNumber:M.index,pointNumbers:A.pts,data:M._input,fullData:M,label:A.label,color:A.color,value:A.v,percent:A.percent,text:A.text,bbox:A.bbox,v:A.v};return A.pts.length===1&&(e.pointNumber=e.i=A.pts[0]),v(e,M,A.pts),M.type==="funnelarea"&&(delete e.v,delete e.i),e}}}),x3=Ze({"src/traces/pie/plot.js"(Z,q){"use strict";var v=Oi(),x=xc(),A=ef(),M=Yi(),e=as(),t=ca(),r=t.strScale,i=t.strTranslate,a=fu(),n=wp(),o=n.recordMinTextSize,s=n.clearMinTextSize,c=Qg().TEXTPAD,h=eg(),m=k9(),d=ca().isValidTextValue;function T($,J){var X=$._context.staticPlot,oe=$._fullLayout,ne=oe._size;s("pie",oe),E(J,$),W(J,ne);var j=t.makeTraceGroups(oe._pielayer,J,"trace").each(function(ee){var re=v.select(this),ce=ee[0],be=ce.trace;ue(ee),re.attr("stroke-linejoin","round"),re.each(function(){var Ae=v.select(this).selectAll("g.slice").data(ee);Ae.enter().append("g").classed("slice",!0),Ae.exit().remove();var ze=[[[],[]],[[],[]]],Re=!1;Ae.each(function(fe,Fe){if(fe.hidden){v.select(this).selectAll("path,g").remove();return}fe.pointNumber=fe.i,fe.curveNumber=be.index,ze[fe.pxmid[1]<0?0:1][fe.pxmid[0]<0?0:1].push(fe);var rt=ce.cx,st=ce.cy,Qe=v.select(this),Lt=Qe.selectAll("path.surface").data([fe]);if(Lt.enter().append("path").classed("surface",!0).style({"pointer-events":X?"none":"all"}),Qe.call(_,$,ee),be.pull){var kt=+h.castOption(be.pull,fe.pts)||0;kt>0&&(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("<br>"),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<qt?kt:qt;Lt==="tan"?tt=u($,oe,ee,Zt,0):tt=p($,oe,ee,Zt,Math.PI/2),tt.textPosAngle=Qe,ot.push(tt)}},Me;if(ze||Re){for(Me=4;Me>=-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<ot.length;rt++){var st=ot[rt].scale;if(Fe<st&&(Fe=st,fe=rt),!it&&Fe>=1)break}return ot[fe]}function b($,J){var X=$.startangle,oe=$.stopangle;return X>J&&J>oe||X<J&&J<oe}function p($,J,X,oe,ne){J=Math.max(0,J-2*c);var j=$.width/$.height,ee=P(j,oe,J,X);return{scale:ee*2/$.height,rCenter:y(j,ee/J),rotate:f(ne)}}function u($,J,X,oe,ne){J=Math.max(0,J-2*c);var j=$.height/$.width,ee=P(j,oe,J,X);return{scale:ee*2/$.width,rCenter:y(j,ee/J),rotate:f(ne+Math.PI/2)}}function y($,J){return Math.cos(J)-$*J}function f($){return(180/Math.PI*$+720)%180-90}function P($,J,X,oe){var ne=$+1/(2*Math.tan(J));return X*Math.min(1/(Math.sqrt(ne*ne+.5)+ne),oe/(Math.sqrt($*$+oe/2)+$))}function L($,J){return $.v===J.vTotal&&!J.trace.hole?1:Math.min(1/(1+1/Math.sin($.halfangle)),$.ring/2)}function z($,J){var X=J.pxmid[0],oe=J.pxmid[1],ne=$.width/2,j=$.height/2;return X<0&&(ne*=-1),oe<0&&(j*=-1),{scale:1,rCenter:1,rotate:0,x:ne+Math.abs(j)*(ne>0?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<ze.length;qt++)Zt=ze[qt],!(Zt===_e||(h.castOption(J.pull,_e.pts)||0)>=(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;Re<be.length;Re++)be[Re].yLabelMid!==void 0&&We.push(be[Re]);for(it=!1,Re=0;oe&&Re<Ae.length;Re++)if(Ae[Re].yLabelMid!==void 0){it=Ae[Re];break}for(Re=0;Re<We.length;Re++){var Me=Re&&We[Re-1];it&&!Re&&(Me=it),ut(We[Re],Me)}}}function W($,J){for(var X=[],oe=0;oe<$.length;oe++){var ne=$[oe][0],j=ne.trace,ee=j.domain,re=J.w*(ee.x[1]-ee.x[0]),ce=J.h*(ee.y[1]-ee.y[0]);j.title.text&&j.title.position!=="middle center"&&(ce-=I(ne,J));var be=re/2,Ae=ce/2;j.type==="funnelarea"&&!j.scalegroup&&(Ae/=j.aspectratio),ne.r=Math.min(be,Ae)/(1+N(j)),ne.cx=J.l+J.w*(j.domain.x[1]+j.domain.x[0])/2,ne.cy=J.t+J.h*(1-j.domain.y[0])-ce/2,j.title.text&&j.title.position.indexOf("bottom")!==-1&&(ne.cy-=I(ne,J)),j.scalegroup&&X.indexOf(j.scalegroup)===-1&&X.push(j.scalegroup)}Q($,X)}function Q($,J){for(var X,oe,ne,j=0;j<J.length;j++){var ee=1/0,re=J[j];for(oe=0;oe<$.length;oe++)if(X=$[oe][0],ne=X.trace,ne.scalegroup===re){var ce;if(ne.type==="pie")ce=X.r*X.r;else if(ne.type==="funnelarea"){var be,Ae;ne.aspectratio>1?(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("<br>")}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<at;++Pe)Ce.push(Te[Pe]);while(Ce.length);return this}function c(Ue){for(var Ee=this,Ve=[Ee],Ce,Te;Ee=Ve.pop();)if(Ue(Ee),Ce=Ee.children,Ce)for(Te=Ce.length-1;Te>=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<at;++Pe)Ve.push(Te[Pe]);for(;Ee=Ce.pop();)Ue(Ee);return this}function m(Ue){return this.eachAfter(function(Ee){for(var Ve=+Ue(Ee.data)||0,Ce=Ee.children,Te=Ce&&Ce.length;--Te>=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;Ee<Ve;)Te=Ue[Ee],Pe&&O(Pe,Te)?++Ee:(Pe=N(Ce=F(Ce,Te)),Ee=0);return Pe}function F(Ue,Ee){var Ve,Ce;if(I(Ee,Ue))return[Ee];for(Ve=0;Ve<Ue.length;++Ve)if(B(Ee,Ue[Ve])&&I(W(Ue[Ve],Ee),Ue))return[Ue[Ve],Ee];for(Ve=0;Ve<Ue.length-1;++Ve)for(Ce=Ve+1;Ce<Ue.length;++Ce)if(B(W(Ue[Ve],Ue[Ce]),Ee)&&B(W(Ue[Ve],Ee),Ue[Ce])&&B(W(Ue[Ce],Ee),Ue[Ve])&&I(Q(Ue[Ve],Ue[Ce],Ee),Ue))return[Ue[Ve],Ue[Ce],Ee];throw new Error}function B(Ue,Ee){var Ve=Ue.r-Ee.r,Ce=Ee.x-Ue.x,Te=Ee.y-Ue.y;return Ve<0||Ve*Ve<Ce*Ce+Te*Te}function O(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 I(Ue,Ee){for(var Ve=0;Ve<Ee.length;++Ve)if(!O(Ue,Ee[Ve]))return!1;return!0}function N(Ue){switch(Ue.length){case 1:return U(Ue[0]);case 2:return W(Ue[0],Ue[1]);case 3:return Q(Ue[0],Ue[1],Ue[2])}}function U(Ue){return{x:Ue.x,y:Ue.y,r:Ue.r}}function W(Ue,Ee){var Ve=Ue.x,Ce=Ue.y,Te=Ue.r,Pe=Ee.x,at=Ee.y,yt=Ee.r,Tt=Pe-Ve,Ot=at-Ce,Gt=yt-Te,rr=Math.sqrt(Tt*Tt+Ot*Ot);return{x:(Ve+Pe+Tt/rr*Gt)/2,y:(Ce+at+Ot/rr*Gt)/2,r:(rr+Te+yt)/2}}function Q(Ue,Ee,Ve){var Ce=Ue.x,Te=Ue.y,Pe=Ue.r,at=Ee.x,yt=Ee.y,Tt=Ee.r,Ot=Ve.x,Gt=Ve.y,rr=Ve.r,Qt=Ce-at,Tr=Ce-Ot,la=Te-yt,Ua=Te-Gt,Ba=Tt-Pe,Ra=rr-Pe,Qa=Ce*Ce+Te*Te-Pe*Pe,za=Qa-at*at-yt*yt+Tt*Tt,en=Qa-Ot*Ot-Gt*Gt+rr*rr,kn=Tr*la-Qt*Ua,Jt=(la*en-Ua*za)/(kn*2)-Ce,Nt=(Ua*Ba-la*Ra)/kn,Kt=(Tr*za-Qt*en)/(kn*2)-Te,Wt=(Qt*Ra-Tr*Ba)/kn,Pr=Nt*Nt+Wt*Wt-1,ta=2*(Pe+Jt*Nt+Kt*Wt),ma=Jt*Jt+Kt*Kt-Pe*Pe,ra=-(Pr?(ta+Math.sqrt(ta*ta-4*Pr*ma))/(2*Pr):ma/ta);return{x:Ce+Jt+Nt*ra,y:Te+Kt+Wt*ra,r:ra}}function ue(Ue,Ee,Ve){var Ce=Ue.x-Ee.x,Te,Pe,at=Ue.y-Ee.y,yt,Tt,Ot=Ce*Ce+at*at;Ot?(Pe=Ee.r+Ve.r,Pe*=Pe,Tt=Ue.r+Ve.r,Tt*=Tt,Pe>Tt?(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;yt<Te;++yt){ue(Ee._,Ve._,Ce=Ue[yt]),Ce=new H(Ce),Tt=Ve.next,Ot=Ee.previous,Gt=Ve._.r,rr=Ee._.r;do if(Gt<=rr){if(se(Tt._,Ce._)){Ve=Tt,Ee.next=Ve,Ve.previous=Ee,--yt;continue e}Gt+=Tt._.r,Tt=Tt.next}else{if(se(Ot._,Ce._)){Ee=Ot,Ee.next=Ve,Ve.previous=Ee,--yt;continue e}rr+=Ot._.r,Ot=Ot.previous}while(Tt!==Ot.next);for(Ce.previous=Ee,Ce.next=Ve,Ee.next=Ve.previous=Ve=Ce,Pe=he(Ee);(Ce=Ce.next)!==Ve;)(at=he(Ce))<Pe&&(Ee=Ce,Pe=at);Ve=Ee.next}for(Ee=[Ve._],Ce=Ve;(Ce=Ce.next)!==Ve;)Ee.push(Ce._);for(Ce=z(Ee),yt=0;yt<Te;++yt)Ee=Ue[yt],Ee.x-=Ce.x,Ee.y-=Ce.y;return Ce.r}function J(Ue){return $(Ue),Ue}function X(Ue){return Ue==null?null:oe(Ue)}function oe(Ue){if(typeof Ue!="function")throw new Error;return Ue}function ne(){return 0}function j(Ue){return function(){return Ue}}function ee(Ue){return Math.sqrt(Ue.value)}function re(){var Ue=null,Ee=1,Ve=1,Ce=ne;function Te(Pe){return Pe.x=Ee/2,Pe.y=Ve/2,Ue?Pe.eachBefore(ce(Ue)).eachAfter(be(Ce,.5)).eachBefore(Ae(1)):Pe.eachBefore(ce(ee)).eachAfter(be(ne,1)).eachAfter(be(Ce,Pe.r/Math.min(Ee,Ve))).eachBefore(Ae(Math.min(Ee,Ve)/(2*Pe.r))),Pe}return Te.radius=function(Pe){return arguments.length?(Ue=X(Pe),Te):Ue},Te.size=function(Pe){return arguments.length?(Ee=+Pe[0],Ve=+Pe[1],Te):[Ee,Ve]},Te.padding=function(Pe){return arguments.length?(Ce=typeof Pe=="function"?Pe:j(+Pe),Te):Ce},Te}function ce(Ue){return function(Ee){Ee.children||(Ee.r=Math.max(0,+Ue(Ee)||0))}}function be(Ue,Ee){return function(Ve){if(Ce=Ve.children){var Ce,Te,Pe=Ce.length,at=Ue(Ve)*Ee||0,yt;if(at)for(Te=0;Te<Pe;++Te)Ce[Te].r+=at;if(yt=$(Ce),at)for(Te=0;Te<Pe;++Te)Ce[Te].r-=at;Ve.r=yt+at}}}function Ae(Ue){return function(Ee){var Ve=Ee.parent;Ee.r*=Ue,Ve&&(Ee.x=Ve.x+Ue*Ee.x,Ee.y=Ve.y+Ue*Ee.y)}}function ze(Ue){Ue.x0=Math.round(Ue.x0),Ue.y0=Math.round(Ue.y0),Ue.x1=Math.round(Ue.x1),Ue.y1=Math.round(Ue.y1)}function Re(Ue,Ee,Ve,Ce,Te){for(var Pe=Ue.children,at,yt=-1,Tt=Pe.length,Ot=Ue.value&&(Ce-Ee)/Ue.value;++yt<Tt;)at=Pe[yt],at.y0=Ve,at.y1=Te,at.x0=Ee,at.x1=Ee+=at.value*Ot}function We(){var Ue=1,Ee=1,Ve=0,Ce=!1;function Te(at){var yt=at.height+1;return at.x0=at.y0=Ve,at.x1=Ue,at.y1=Ee/yt,at.eachBefore(Pe(Ee,yt)),Ce&&at.eachBefore(ze),at}function Pe(at,yt){return function(Tt){Tt.children&&Re(Tt,Tt.x0,at*(Tt.depth+1)/yt,Tt.x1,at*(Tt.depth+2)/yt);var Ot=Tt.x0,Gt=Tt.y0,rr=Tt.x1-Ve,Qt=Tt.y1-Ve;rr<Ot&&(Ot=rr=(Ot+rr)/2),Qt<Gt&&(Gt=Qt=(Gt+Qt)/2),Tt.x0=Ot,Tt.y0=Gt,Tt.x1=rr,Tt.y1=Qt}}return Te.round=function(at){return arguments.length?(Ce=!!at,Te):Ce},Te.size=function(at){return arguments.length?(Ue=+at[0],Ee=+at[1],Te):[Ue,Ee]},Te.padding=function(at){return arguments.length?(Ve=+at,Te):Ve},Te}var it="$",ot={depth:-1},tt={};function ut(Ue){return Ue.id}function Me(Ue){return Ue.parentId}function _e(){var Ue=ut,Ee=Me;function Ve(Ce){var Te,Pe,at=Ce.length,yt,Tt,Ot,Gt=new Array(at),rr,Qt,Tr={};for(Pe=0;Pe<at;++Pe)Te=Ce[Pe],Ot=Gt[Pe]=new f(Te),(rr=Ue(Te,Pe,Ce))!=null&&(rr+="")&&(Qt=it+(Ot.id=rr),Tr[Qt]=Qt in Tr?tt:Ot);for(Pe=0;Pe<at;++Pe)if(Ot=Gt[Pe],rr=Ee(Ce[Pe],Pe,Ce),rr==null||!(rr+="")){if(yt)throw new Error("multiple roots");yt=Ot}else{if(Tt=Tr[it+rr],!Tt)throw new Error("missing: "+rr);if(Tt===tt)throw new Error("ambiguous: "+rr);Tt.children?Tt.children.push(Ot):Tt.children=[Ot],Ot.parent=Tt}if(!yt)throw new Error("no root");if(yt.parent=ot,yt.eachBefore(function(la){la.depth=la.parent.depth+1,--at}).eachBefore(y),yt.parent=null,at>0)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.x<rr.x&&(rr=Qa),Qa.x>Qt.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;++yt<Tt;)at=Pe[yt],at.x0=Ee,at.x1=Ce,at.y0=Ve,at.y1=Ve+=at.value*Ot}var xr=(1+Math.sqrt(5))/2;function jr(Ue,Ee,Ve,Ce,Te,Pe){for(var at=[],yt=Ee.children,Tt,Ot,Gt=0,rr=0,Qt=yt.length,Tr,la,Ua=Ee.value,Ba,Ra,Qa,za,en,kn,Jt;Gt<Qt;){Tr=Te-Ve,la=Pe-Ce;do Ba=yt[rr++].value;while(!Ba&&rr<Qt);for(Ra=Qa=Ba,kn=Math.max(la/Tr,Tr/la)/(Ua*Ue),Jt=Ba*Ba*kn,en=Math.max(Qa/Jt,Jt/Ra);rr<Qt;++rr){if(Ba+=Ot=yt[rr].value,Ot<Ra&&(Ra=Ot),Ot>Qa&&(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:Tr<la,children:yt.slice(Gt,rr)}),Tt.dice?Re(Tt,Ve,Ce,Te,Ua?Ce+=la*Ba/Ua:Pe):Sr(Tt,Ve,Ce,Ua?Ve+=Tr*Ba/Ua:Te,Pe),Ua-=Ba,Gt=rr}return at}var wr=function Ue(Ee){function Ve(Ce,Te,Pe,at,yt){jr(Ee,Ce,Te,Pe,at,yt)}return Ve.ratio=function(Ce){return Ue((Ce=+Ce)>1?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<la&&(la=Ba=(la+Ba)/2),Ra<Ua&&(Ua=Ra=(Ua+Ra)/2),Qt.x0=la,Qt.y0=Ua,Qt.x1=Ba,Qt.y1=Ra,Qt.children&&(Tr=Te[Qt.depth+1]=Pe(Qt)/2,la+=Ot(Qt)-Tr,Ua+=at(Qt)-Tr,Ba-=yt(Qt)-Tr,Ra-=Tt(Qt)-Tr,Ba<la&&(la=Ba=(la+Ba)/2),Ra<Ua&&(Ua=Ra=(Ua+Ra)/2),Ue(Qt,la,Ua,Ba,Ra))}return Gt.round=function(Qt){return arguments.length?(Ee=!!Qt,Gt):Ee},Gt.size=function(Qt){return arguments.length?(Ve=+Qt[0],Ce=+Qt[1],Gt):[Ve,Ce]},Gt.tile=function(Qt){return arguments.length?(Ue=oe(Qt),Gt):Ue},Gt.padding=function(Qt){return arguments.length?Gt.paddingInner(Qt).paddingOuter(Qt):Gt.paddingInner()},Gt.paddingInner=function(Qt){return arguments.length?(Pe=typeof Qt=="function"?Qt:j(+Qt),Gt):Pe},Gt.paddingOuter=function(Qt){return arguments.length?Gt.paddingTop(Qt).paddingRight(Qt).paddingBottom(Qt).paddingLeft(Qt):Gt.paddingTop()},Gt.paddingTop=function(Qt){return arguments.length?(at=typeof Qt=="function"?Qt:j(+Qt),Gt):at},Gt.paddingRight=function(Qt){return arguments.length?(yt=typeof Qt=="function"?Qt:j(+Qt),Gt):yt},Gt.paddingBottom=function(Qt){return arguments.length?(Tt=typeof Qt=="function"?Qt:j(+Qt),Gt):Tt},Gt.paddingLeft=function(Qt){return arguments.length?(Ot=typeof Qt=="function"?Qt:j(+Qt),Gt):Ot},Gt}function bt(Ue,Ee,Ve,Ce,Te){var Pe=Ue.children,at,yt=Pe.length,Tt,Ot=new Array(yt+1);for(Ot[0]=Tt=at=0;at<yt;++at)Ot[at+1]=Tt+=Pe[at].value;Gt(0,yt,Ue.value,Ee,Ve,Ce,Te);function Gt(rr,Qt,Tr,la,Ua,Ba,Ra){if(rr>=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<Jt;){var Nt=kn+Jt>>>1;Ot[Nt]<en?kn=Nt+1:Jt=Nt}en-Ot[kn-1]<Ot[kn]-en&&rr+1<kn&&--kn;var Kt=Ot[kn]-za,Wt=Tr-Kt;if(Ba-la>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;++Qt<la;){for(Ot=Tt[Qt],Gt=Ot.children,rr=Ot.value=0,Tr=Gt.length;rr<Tr;++rr)Ot.value+=Gt[rr].value;Ot.dice?Re(Ot,Te,Pe,at,Pe+=(yt-Pe)*Ot.value/Ua):Sr(Ot,Te,Pe,Te+=(at-Te)*Ot.value/Ua,yt),Ua-=Ot.value}else Ce._squarify=Tt=jr(Ee,Ce,Te,Pe,at,yt),Tt.ratio=Ee}return Ve.ratio=function(Ce){return Ue((Ce=+Ce)>1?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;L<y;L++)if(f(L)){var z=P(L),F=p(l[L])?String(l[L]):"",B={i:L,id:z,pid:F,label:p(T[L])?String(T[L]):""};w&&(B.v=+_[L]),S.push(B),b(F,z)}if(E[""]){if(E[""].length>1){for(var N=x.randstr(),U=0;U<S.length;U++)S[U].pid===""&&(S[U].pid=N);S.unshift({hasMultipleRoots:!0,id:N,pid:"",label:""})}}else{var O=[],I;for(I in E)g[I]||O.push(I);if(O.length===1)I=O[0],S.unshift({hasImpliedRoot:!0,id:I,pid:"",label:I});else return x.warn(["Multiple implied roots, cannot build",c.type,"hierarchy of",c.name+".","These roots include:",O.join(", ")].join(" "))}var W;try{W=q.stratify().id(function(J){return J.id}).parentId(function(J){return J.pid})(S)}catch(J){return x.warn(["Failed to build",c.type,"hierarchy of",c.name+".","Error:",J.message].join(" "))}var Q=q.hierarchy(W),ue=!1;if(w)switch(c.branchvalues){case"remainder":Q.sum(function(J){return J.data.v});break;case"total":Q.each(function(J){var X=J.data.data,oe=X.v;if(J.children){var ne=J.children.reduce(function(j,ee){return j+ee.data.data.v},0);if((X.hasImpliedRoot||X.hasMultipleRoots)&&(oe=ne),oe<ne*r)return ue=!0,x.warn(["Total value for node",J.data.data.id,"of",c.name,"is smaller than the sum of its children.",`
|
||
parent value =`,oe,`
|
||
children sum =`,ne].join(" "))}J.value=oe});break}else o(Q,c,{branches:c.count.indexOf("branches")!==-1,leaves:c.count.indexOf("leaves")!==-1});if(!ue){c.sort&&Q.sort(function(J,X){return X.value-J.value});var se,he,H=c.marker.colors||[],$=!!H.length;return c._hasColorscale?($||(H=w?c.values:c._values),t(s,c,{vals:H,containerStr:"marker",cLetter:"c"}),he=A(c.marker)):se=M(h["_"+c.type+"colormap"]),Q.each(function(J){var X=J.data.data;X.color=c._hasColorscale?he(H[X.i]):se(H[X.i],X.id)}),S[0].hierarchy=Q,S}},Z._runCrossTraceCalc=function(s,c){var h=c._fullLayout,m=c.calcdata,d=h[s+"colorway"],T=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(d=e(d,s==="icicle"?n:s==="treemap"?a:i));var l=0,_;function w(b){var p=b.data.data,u=p.id;p.color===!1&&(T[u]?p.color=T[u]:b.parent?b.parent.parent?p.color=b.parent.data.data.color:(T[u]=p.color=d[l%d.length],l++):p.color=_)}for(var S=0;S<m.length;S++){var E=m[S],g=E[0];g.trace.type===s&&g.hierarchy&&(_=g.trace.root.color,g.hierarchy.each(w))}},Z.crossTraceCalc=function(s){return Z._runCrossTraceCalc("sunburst",s)};function o(s,c,h){var m=0,d=s.children;if(d){for(var T=d.length,l=0;l<T;l++)m+=o(d[l],c,h);h.branches&&m++}else h.leaves&&m++;return s.value=s.data.data.value=m,c._values||(c._values=[]),c._values[s.data.data.i]=m,m}}});function s0(Z,q,v){Z.prototype=q.prototype=v,v.constructor=Z}function b1(Z,q){var v=Object.create(Z.prototype);for(var x in q)v[x]=q[x];return v}var b3=mo({"node_modules/d3-color/src/define.js"(){}});function Kv(){}function oE(){return this.rgb().formatHex()}function O9(){return this.rgb().formatHex8()}function B9(){return hE(this).formatHsl()}function sE(){return this.rgb().formatRgb()}function w1(Z){var q,v;return Z=(Z+"").trim().toLowerCase(),(q=dE.exec(Z))?(v=q[1].length,q=parseInt(q[1],16),v===6?lE(q):v===3?new Xh(q>>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+(v<x)*6:v===M?e=(x-q)/t+2:e=(q-v)/t+4,t/=r<.5?M+A:2-M-A,e*=60):t=r>0&&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<Z.l&&Z.l<100?0:NaN,Z.l,Z.opacity);var q=Math.atan2(Z.b,Z.a)*C3;return new Mv(q<0?q+360:q,Math.sqrt(Z.a*Z.a+Z.b*Z.b),Z.l,Z.opacity)}function D3(Z,q,v,x){return arguments.length===1?U9(Z):new Mv(Z,q,v,x??1)}function Mv(Z,q,v,x){this.h=+Z,this.c=+q,this.l=+v,this.opacity=+x}function TE(Z){if(isNaN(Z.h))return new rv(Z.l,0,0,Z.opacity);var q=Z.h*E3;return new rv(Z.l,Math.cos(q)*Z.c,Math.sin(q)*Z.c,Z.opacity)}var T1,z3,F3,O3,B3,ug,N3,AE,j9=mo({"node_modules/d3-color/src/lab.js"(){b3(),M3(),bE(),T1=18,z3=.96422,F3=1,O3=.82521,B3=4/29,ug=6/29,N3=3*ug*ug,AE=ug*ug*ug,s0(rv,k3,b1(Kv,{brighter(Z){return new rv(this.l+T1*(Z??1),this.a,this.b,this.opacity)},darker(Z){return new rv(this.l-T1*(Z??1),this.a,this.b,this.opacity)},rgb(){var Z=(this.l+16)/116,q=isNaN(this.a)?Z:Z+this.a/500,v=isNaN(this.b)?Z:Z-this.b/200;return q=z3*P3(q),Z=F3*P3(Z),v=O3*P3(v),new Xh(I3(3.1338561*q-1.6168667*Z-.4906146*v),I3(-.9787684*q+1.9161415*Z+.033454*v),I3(.0719453*q-.2289914*Z+1.4052427*v),this.opacity)}})),s0(Mv,D3,b1(Kv,{brighter(Z){return new Mv(this.h,this.c,this.l+T1*(Z??1),this.opacity)},darker(Z){return new Mv(this.h,this.c,this.l-T1*(Z??1),this.opacity)},rgb(){return TE(this).rgb()}}))}});function V9(Z){if(Z instanceof cg)return new cg(Z.h,Z.s,Z.l,Z.opacity);Z instanceof Xh||(Z=w3(Z));var q=Z.r/255,v=Z.g/255,x=Z.b/255,A=(G3*x+V3*q-q3*v)/(G3+V3-q3),M=x-A,e=(u0*(v-A)-nx*M)/A1,t=Math.sqrt(e*e+M*M)/(u0*A*(1-A)),r=t?Math.atan2(e,M)*C3-120:NaN;return new cg(r<0?r+360:r,t,A,Z.opacity)}function U3(Z,q,v,x){return arguments.length===1?V9(Z):new cg(Z,q,v,x??1)}function cg(Z,q,v,x){this.h=+Z,this.s=+q,this.l=+v,this.opacity=+x}var j3,ax,nx,A1,u0,V3,q3,G3,q9=mo({"node_modules/d3-color/src/cubehelix.js"(){b3(),M3(),bE(),j3=-.14861,ax=1.78277,nx=-.29227,A1=-.90649,u0=1.97294,V3=u0*A1,q3=u0*ax,G3=ax*nx-A1*j3,s0(cg,U3,b1(Kv,{brighter(Z){return Z=Z==null?sg:Math.pow(sg,Z),new cg(this.h,this.s,this.l*Z,this.opacity)},darker(Z){return Z=Z==null?Jv:Math.pow(Jv,Z),new cg(this.h,this.s,this.l*Z,this.opacity)},rgb(){var Z=isNaN(this.h)?0:(this.h+120)*E3,q=+this.l,v=isNaN(this.s)?0:this.s*q*(1-q),x=Math.cos(Z),A=Math.sin(Z);return new Xh(255*(q+v*(j3*x+ax*A)),255*(q+v*(nx*x+A1*A)),255*(q+v*(u0*x)),this.opacity)}}))}}),c0=mo({"node_modules/d3-color/src/index.js"(){M3(),j9(),q9()}});function SE(Z,q,v,x,A){var M=Z*Z,e=M*Z;return((1-3*Z+3*M-e)*q+(4-6*M+3*e)*v+(1+3*Z+3*M-3*e)*x+e*A)/6}function ME(Z){var q=Z.length-1;return function(v){var x=v<=0?v=0:v>=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<q-1?Z[x+2]:2*M-A;return SE((v-x/q)*q,e,A,M,t)}}var H3=mo({"node_modules/d3-interpolate/src/basis.js"(){}});function EE(Z){var q=Z.length;return function(v){var x=Math.floor(((v%=1)<0?++v:v)*q),A=Z[(x+q-1)%q],M=Z[x%q],e=Z[(x+1)%q],t=Z[(x+2)%q];return SE((v-x/q)*q,A,M,e,t)}}var CE=mo({"node_modules/d3-interpolate/src/basisClosed.js"(){H3()}}),S1,kE=mo({"node_modules/d3-interpolate/src/constant.js"(){S1=Z=>()=>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;e<v;++e)t=ex(q[e]),x[e]=t.r||0,A[e]=t.g||0,M[e]=t.b||0;return x=Z(x),A=Z(A),M=Z(M),t.opacity=1,function(r){return t.r=x(r),t.g=A(r),t.b=M(r),t+""}}}var ox,IE,RE,DE=mo({"node_modules/d3-interpolate/src/rgb.js"(){c0(),H3(),CE(),f0(),ox=function Z(q){var v=H9(q);function x(A,M){var e=v((A=ex(A)).r,(M=ex(M)).r),t=v(A.g,M.g),r=v(A.b,M.b),i=Zh(A.opacity,M.opacity);return function(a){return A.r=e(a),A.g=t(a),A.b=r(a),A.opacity=i(a),A+""}}return x.gamma=Z,x}(1),IE=PE(ME),RE=PE(EE)}});function W3(Z,q){q||(q=[]);var v=Z?Math.min(q.length,Z.length):0,x=q.slice(),A;return function(M){for(A=0;A<v;++A)x[A]=Z[A]*(1-M)+q[A]*M;return x}}function zE(Z){return ArrayBuffer.isView(Z)&&!(Z instanceof DataView)}var X3=mo({"node_modules/d3-interpolate/src/numberArray.js"(){}});function W9(Z,q){return(zE(q)?W3:FE)(Z,q)}function FE(Z,q){var v=q?q.length:0,x=Z?Math.min(v,Z.length):0,A=new Array(x),M=new Array(v),e;for(e=0;e<x;++e)A[e]=cx(Z[e],q[e]);for(;e<v;++e)M[e]=q[e];return function(t){for(e=0;e<x;++e)M[e]=A[e](t);return M}}var OE=mo({"node_modules/d3-interpolate/src/array.js"(){fx(),X3()}});function BE(Z,q){var v=new Date;return Z=+Z,q=+q,function(x){return v.setTime(Z*(1-x)+q*x),v}}var NE=mo({"node_modules/d3-interpolate/src/date.js"(){}});function av(Z,q){return Z=+Z,q=+q,function(v){return Z*(1-v)+q*v}}var sx=mo({"node_modules/d3-interpolate/src/number.js"(){}});function UE(Z,q){var v={},x={},A;(Z===null||typeof Z!="object")&&(Z={}),(q===null||typeof q!="object")&&(q={});for(A in q)A in Z?v[A]=cx(Z[A],q[A]):x[A]=q[A];return function(M){for(A in v)x[A]=v[A](M);return x}}var jE=mo({"node_modules/d3-interpolate/src/object.js"(){fx()}});function X9(Z){return function(){return Z}}function Z9(Z){return function(q){return Z(q)+""}}function VE(Z,q){var v=lx.lastIndex=ux.lastIndex=0,x,A,M,e=-1,t=[],r=[];for(Z=Z+"",q=q+"";(x=lx.exec(Z))&&(A=ux.exec(q));)(M=A.index)>v&&(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 v<q.length&&(M=q.slice(v),t[e]?t[e]+=M:t[++e]=M),t.length<2?r[0]?Z9(r[0].x):X9(q):(q=r.length,function(i){for(var a=0,n;a<q;++a)t[(n=r[a]).i]=n.x(i);return t.join("")})}var lx,ux,qE=mo({"node_modules/d3-interpolate/src/string.js"(){sx(),lx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ux=new RegExp(lx.source,"g")}});function cx(Z,q){var v=typeof q,x;return q==null||v==="boolean"?S1(q):(v==="number"?av:v==="string"?(x=w1(q))?(q=x,ox):VE:q instanceof w1?ox:q instanceof Date?BE:zE(q)?W3:Array.isArray(q)?FE:typeof q.valueOf!="function"&&typeof q.toString!="function"||isNaN(q)?UE:av)(Z,q)}var fx=mo({"node_modules/d3-interpolate/src/value.js"(){c0(),DE(),OE(),NE(),sx(),jE(),qE(),kE(),X3()}});function Y9(Z){var q=Z.length;return function(v){return Z[Math.max(0,Math.min(q-1,Math.floor(v*q)))]}}var K9=mo({"node_modules/d3-interpolate/src/discrete.js"(){}});function J9(Z,q){var v=ix(+Z,+q);return function(x){var A=v(x);return A-360*Math.floor(A/360)}}var $9=mo({"node_modules/d3-interpolate/src/hue.js"(){f0()}});function Q9(Z,q){return Z=+Z,q=+q,function(v){return Math.round(Z*(1-v)+q*v)}}var eN=mo({"node_modules/d3-interpolate/src/round.js"(){}});function GE(Z,q,v,x,A,M){var e,t,r;return(e=Math.sqrt(Z*Z+q*q))&&(Z/=e,q/=e),(r=Z*v+q*x)&&(v-=Z*r,x-=q*r),(t=Math.sqrt(v*v+x*x))&&(v/=t,x/=t,r/=t),Z*x<q*v&&(Z=-Z,q=-q,r=-r,e=-e),{translateX:A,translateY:M,rotate:Math.atan2(q,Z)*Z3,skewX:Math.atan(r)*Z3,scaleX:e,scaleY:t}}var Z3,hx,tN=mo({"node_modules/d3-interpolate/src/transform/decompose.js"(){Z3=180/Math.PI,hx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}});function rN(Z){let q=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(Z+"");return q.isIdentity?hx:GE(q.a,q.b,q.c,q.d,q.e,q.f)}function aN(Z){return Z==null||(px||(px=document.createElementNS("http://www.w3.org/2000/svg","g")),px.setAttribute("transform",Z),!(Z=px.transform.baseVal.consolidate()))?hx:(Z=Z.matrix,GE(Z.a,Z.b,Z.c,Z.d,Z.e,Z.f))}var px,nN=mo({"node_modules/d3-interpolate/src/transform/parse.js"(){tN()}});function HE(Z,q,v,x){function A(i){return i.length?i.pop()+" ":""}function M(i,a,n,o,s,c){if(i!==n||a!==o){var h=s.push("translate(",null,q,null,v);c.push({i:h-4,x:av(i,n)},{i:h-2,x:av(a,o)})}else(n||o)&&s.push("translate("+n+q+o+v)}function e(i,a,n,o){i!==a?(i-a>180?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;++c<h;)n[(m=o[c]).i]=m.x(s);return n.join("")}}}var WE,XE,iN=mo({"node_modules/d3-interpolate/src/transform/index.js"(){sx(),nN(),WE=HE(rN,"px, ","px)","deg)"),XE=HE(aN,", ",")",")")}});function ZE(Z){return((Z=Math.exp(Z))+1/Z)/2}function oN(Z){return((Z=Math.exp(Z))-1/Z)/2}function sN(Z){return((Z=Math.exp(2*Z))-1)/(Z+1)}var YE,KE,lN=mo({"node_modules/d3-interpolate/src/zoom.js"(){YE=1e-12,KE=function Z(q,v,x){function A(M,e){var t=M[0],r=M[1],i=M[2],a=e[0],n=e[1],o=e[2],s=a-t,c=n-r,h=s*s+c*c,m,d;if(h<YE)d=Math.log(o/i)/q,m=function(E){return[t+E*s,r+E*c,i*Math.exp(q*E*d)]};else{var T=Math.sqrt(h),l=(o*o-i*i+x*h)/(2*i*v*T),_=(o*o-i*i-x*h)/(2*o*v*T),w=Math.log(Math.sqrt(l*l+1)-l),S=Math.log(Math.sqrt(_*_+1)-_);d=(S-w)/q,m=function(E){var g=E*d,b=ZE(w),p=i/(v*T)*(b*sN(q*g+w)-oN(w));return[t+p*s,r+p*c,i*b/ZE(q*g+w)]}}return m.duration=d*1e3*q/Math.SQRT2,m}return A.rho=function(M){var e=Math.max(.001,+M),t=e*e,r=t*t;return Z(e,t,r)},A}(Math.SQRT2,2,4)}});function JE(Z){return function(q,v){var x=Z((q=T3(q)).h,(v=T3(v)).h),A=Zh(q.s,v.s),M=Zh(q.l,v.l),e=Zh(q.opacity,v.opacity);return function(t){return q.h=x(t),q.s=A(t),q.l=M(t),q.opacity=e(t),q+""}}}var $E,QE,uN=mo({"node_modules/d3-interpolate/src/hsl.js"(){c0(),f0(),$E=JE(ix),QE=JE(Zh)}});function cN(Z,q){var v=Zh((Z=k3(Z)).l,(q=k3(q)).l),x=Zh(Z.a,q.a),A=Zh(Z.b,q.b),M=Zh(Z.opacity,q.opacity);return function(e){return Z.l=v(e),Z.a=x(e),Z.b=A(e),Z.opacity=M(e),Z+""}}var fN=mo({"node_modules/d3-interpolate/src/lab.js"(){c0(),f0()}});function e5(Z){return function(q,v){var x=Z((q=D3(q)).h,(v=D3(v)).h),A=Zh(q.c,v.c),M=Zh(q.l,v.l),e=Zh(q.opacity,v.opacity);return function(t){return q.h=x(t),q.c=A(t),q.l=M(t),q.opacity=e(t),q+""}}}var t5,r5,hN=mo({"node_modules/d3-interpolate/src/hcl.js"(){c0(),f0(),t5=e5(ix),r5=e5(Zh)}});function a5(Z){return function q(v){v=+v;function x(A,M){var e=Z((A=U3(A)).h,(M=U3(M)).h),t=Zh(A.s,M.s),r=Zh(A.l,M.l),i=Zh(A.opacity,M.opacity);return function(a){return A.h=e(a),A.s=t(a),A.l=r(Math.pow(a,v)),A.opacity=i(a),A+""}}return x.gamma=q,x}(1)}var n5,i5,pN=mo({"node_modules/d3-interpolate/src/cubehelix.js"(){c0(),f0(),n5=a5(ix),i5=a5(Zh)}});function dN(Z,q){q===void 0&&(q=Z,Z=cx);for(var v=0,x=q.length-1,A=q[0],M=new Array(x<0?0:x);v<x;)M[v]=Z(A,A=q[++v]);return function(e){var t=Math.max(0,Math.min(x-1,Math.floor(e*=x)));return M[t](e-t)}}var vN=mo({"node_modules/d3-interpolate/src/piecewise.js"(){fx()}});function mN(Z,q){for(var v=new Array(q),x=0;x<q;++x)v[x]=Z(x/(q-1));return v}var gN=mo({"node_modules/d3-interpolate/src/quantize.js"(){}}),fg={};Ws(fg,{interpolate:()=>cx,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;s<o.length;s++){var c=o[s];if(Z.getPtId(c)===i)return a=n.copy()}}),a||r},Z.isEntry=function(r){return!r.parent},Z.isLeaf=function(r){return!r.children},Z.getPtId=function(r){return r.data.data.id},Z.getPtLabel=function(r){return r.data.data.label},Z.getValue=function(r){return r.value},Z.isHierarchyRoot=function(r){return t(r)===""},Z.setSliceCursor=function(r,i,a){var n=a.isTransitioning;if(!n){var o=r.datum();n=a.hideOnRoot&&Z.isHierarchyRoot(o)||a.hideOnLeaves&&Z.isLeaf(o)}x(r,n?null:"pointer")};function M(r,i,a){return{color:Z.getOutsideTextFontKey("color",r,i,a),family:Z.getOutsideTextFontKey("family",r,i,a),size:Z.getOutsideTextFontKey("size",r,i,a),weight:Z.getOutsideTextFontKey("weight",r,i,a),style:Z.getOutsideTextFontKey("style",r,i,a),variant:Z.getOutsideTextFontKey("variant",r,i,a),textcase:Z.getOutsideTextFontKey("textcase",r,i,a),lineposition:Z.getOutsideTextFontKey("lineposition",r,i,a),shadow:Z.getOutsideTextFontKey("shadow",r,i,a)}}function e(r,i,a,n){var o=(n||{}).onPathbar,s=i.data.data,c=s.i,h=q.castOption(r,c,(o?"pathbar.textfont":"insidetextfont")+".color");return!h&&r._input.textfont&&(h=q.castOption(r._input,c,"textfont.color")),{color:h||v.contrast(s.color),family:Z.getInsideTextFontKey("family",r,i,a,n),size:Z.getInsideTextFontKey("size",r,i,a,n),weight:Z.getInsideTextFontKey("weight",r,i,a,n),style:Z.getInsideTextFontKey("style",r,i,a,n),variant:Z.getInsideTextFontKey("variant",r,i,a,n),textcase:Z.getInsideTextFontKey("textcase",r,i,a,n),lineposition:Z.getInsideTextFontKey("lineposition",r,i,a,n),shadow:Z.getInsideTextFontKey("shadow",r,i,a,n)}}Z.getInsideTextFontKey=function(r,i,a,n,o){var s=(o||{}).onPathbar,c=s?"pathbar.textfont":"insidetextfont",h=a.data.data.i;return q.castOption(i,h,c+"."+r)||q.castOption(i,h,"textfont."+r)||n.size},Z.getOutsideTextFontKey=function(r,i,a,n){var o=a.data.data.i;return q.castOption(i,o,"outsidetextfont."+r)||q.castOption(i,o,"textfont."+r)||n.size},Z.isOutsideText=function(r,i){return!r._hasColorscale&&Z.isHierarchyRoot(i)},Z.determineTextFont=function(r,i,a,n){return Z.isOutsideText(r,i)?M(r,i,a):e(r,i,a,n)},Z.hasTransition=function(r){return!!(r&&r.duration>0)},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("<br>"),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;d<c.length;d++){var T=c[d];T in o&&(m[T]=o[T])}return"parentString"in o&&!r.isHierarchyRoot(o)&&(m.parent=o.parentString),A(m,s,h.i),m}}}),K3=Ze({"src/traces/sunburst/plot.js"(Z){"use strict";var q=Oi(),v=J_(),x=(h0(),ih(fg)).interpolate,A=as(),M=ca(),e=fu(),t=wp(),r=t.recordMinTextSize,i=t.clearMinTextSize,a=x3(),n=eg().getRotationAngle,o=a.computeTransform,s=a.transformInsideText,c=o5().styleOne,h=Nd().resizeText,m=dx(),d=nE(),T=$v();Z.plot=function(g,b,p,u){var y=g._fullLayout,f=y._sunburstlayer,P,L,z=!p,F=!y.uniformtext.mode&&T.hasTransition(p);if(i("sunburst",y),P=f.selectAll("g.trace.sunburst").data(b,function(O){return O[0].trace.uid}),P.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),P.order(),F){u&&(L=u());var B=q.transition().duration(p.duration).ease(p.easing).each("end",function(){L&&L()}).each("interrupt",function(){L&&L()});B.each(function(){f.selectAll("g.trace").each(function(O){l(g,O,this,p)})})}else P.each(function(O){l(g,O,this,p)}),y.uniformtext.mode&&h(g,y._sunburstlayer.selectAll(".trace"),"sunburst");z&&P.exit().remove()};function l(g,b,p,u){var y=g._context.staticPlot,f=g._fullLayout,P=!f.uniformtext.mode&&T.hasTransition(u),L=q.select(p),z=L.selectAll("g.slice"),F=b[0],B=F.trace,O=F.hierarchy,I=T.findEntryWithLevel(O,B.level),N=T.getMaxDepth(B),U=f._size,W=B.domain,Q=U.w*(W.x[1]-W.x[0]),ue=U.h*(W.y[1]-W.y[0]),se=.5*Math.min(Q,ue),he=F.cx=U.l+U.w*(W.x[1]+W.x[0])/2,H=F.cy=U.t+U.h*(1-W.y[0])-ue/2;if(!I)return z.remove();var $=null,J={};P&&z.each(function(fe){J[T.getPtId(fe)]={rpx0:fe.rpx0,rpx1:fe.rpx1,x0:fe.x0,x1:fe.x1,transform:fe.transform},!$&&T.isEntry(fe)&&($=fe)});var X=_(I).descendants(),oe=I.height+1,ne=0,j=N;F.hasMultipleRoots&&T.isHierarchyRoot(I)&&(X=X.slice(1),oe-=1,ne=1,j+=1),X=X.filter(function(fe){return fe.y1<=j});var ee=n(B.rotation);ee&&X.forEach(function(fe){fe.x0+=ee,fe.x1+=ee});var re=Math.min(oe,N),ce=function(fe){return(fe-ne)/re*se},be=function(fe,Fe){return[fe*Math.cos(Fe),-fe*Math.sin(Fe)]},Ae=function(fe){return M.pathAnnulus(fe.rpx0,fe.rpx1,fe.x0,fe.x1,he,H)},ze=function(fe){return he+S(fe)[0]*(fe.transform.rCenter||0)+(fe.transform.x||0)},Re=function(fe){return H+S(fe)[1]*(fe.transform.rCenter||0)+(fe.transform.y||0)};z=z.data(X,T.getPtId),z.enter().append("g").classed("slice",!0),P?z.exit().transition().each(function(){var fe=q.select(this),Fe=fe.select("path.surface");Fe.transition().attrTween("d",function(st){var Qe=tt(st);return function(Lt){return Ae(Qe(Lt))}});var rt=fe.select("g.slicetext");rt.attr("opacity",0)}).remove():z.exit().remove(),z.order();var We=null;if(P&&$){var it=T.getPtId($);z.each(function(fe){We===null&&T.getPtId(fe)===it&&(We=fe.x1)})}var ot=z;P&&(ot=ot.transition().each("end",function(){var fe=q.select(this);T.setSliceCursor(fe,g,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),ot.each(function(fe){var Fe=q.select(this),rt=M.ensureSingle(Fe,"path","surface",function(Zt){Zt.style("pointer-events",y?"none":"all")});fe.rpx0=ce(fe.y0),fe.rpx1=ce(fe.y1),fe.xmid=(fe.x0+fe.x1)/2,fe.pxmid=be(fe.rpx1,fe.xmid),fe.midangle=-(fe.xmid-Math.PI/2),fe.startangle=-(fe.x0-Math.PI/2),fe.stopangle=-(fe.x1-Math.PI/2),fe.halfangle=.5*Math.min(M.angleDelta(fe.x0,fe.x1)||Math.PI,Math.PI),fe.ring=1-fe.rpx0/fe.rpx1,fe.rInscribed=w(fe,B),P?rt.transition().attrTween("d",function(Zt){var Sr=ut(Zt);return function(xr){return Ae(Sr(xr))}}):rt.attr("d",Ae),Fe.call(m,I,g,b,{eventDataKeys:d.eventDataKeys,transitionTime:d.CLICK_TRANSITION_TIME,transitionEasing:d.CLICK_TRANSITION_EASING}).call(T.setSliceCursor,g,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:g._transitioning}),rt.call(c,fe,B,g);var st=M.ensureSingle(Fe,"g","slicetext"),Qe=M.ensureSingle(st,"text","",function(Zt){Zt.attr("data-notex",1)}),Lt=M.ensureUniformFontSize(g,T.determineTextFont(B,fe,f.font));Qe.text(Z.formatSliceLabel(fe,I,B,b,f)).classed("slicetext",!0).attr("text-anchor","middle").call(A.font,Lt).call(e.convertToTspans,g);var kt=A.bBox(Qe.node());fe.transform=s(kt,fe,F),fe.transform.targetX=ze(fe),fe.transform.targetY=Re(fe);var qt=function(Zt,Sr){var xr=Zt.transform;return o(xr,Sr),xr.fontSize=Lt.size,r(B.type,xr,f),M.getTextTransform(xr)};P?Qe.transition().attrTween("transform",function(Zt){var Sr=Me(Zt);return function(xr){return qt(Sr(xr),kt)}}):Qe.attr("transform",qt(fe,kt))});function tt(fe){var Fe=T.getPtId(fe),rt=J[Fe],st=J[T.getPtId(I)],Qe;if(st){var Lt=(fe.x1>st.x1?2*Math.PI:0)+ee;Qe=fe.rpx1<st.rpx1?{x0:fe.x0,x1:fe.x1,rpx0:0,rpx1:0}:{x0:Lt,x1:Lt,rpx0:fe.rpx0,rpx1:fe.rpx1}}else{var kt,qt=T.getPtId(fe.parent);z.each(function(wr){if(T.getPtId(wr)===qt)return kt=wr});var Zt=kt.children,Sr;Zt.forEach(function(wr,Ir){if(T.getPtId(wr)===Fe)return Sr=Ir});var xr=Zt.length,jr=x(kt.x0,kt.x1);Qe={rpx0:se,rpx1:se,x0:jr(Sr/xr),x1:jr((Sr+1)/xr)}}return x(rt,Qe)}function ut(fe){var Fe=J[T.getPtId(fe)],rt,st={x0:fe.x0,x1:fe.x1,rpx0:fe.rpx0,rpx1:fe.rpx1};if(Fe)rt=Fe;else if($)if(fe.parent)if(We){var Qe=(fe.x1>We?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("<br>")}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;r<t.length;r++)v(t[r],A,M)}}}),c5=Ze({"src/traces/treemap/partition.js"(Z,q){"use strict";var v=J_(),x=u5();q.exports=function(e,t,r){var i=r.flipX,a=r.flipY,n=r.packing==="dice-slice",o=r.pad[a?"bottom":"top"],s=r.pad[i?"right":"left"],c=r.pad[i?"left":"right"],h=r.pad[a?"top":"bottom"],m;n&&(m=s,s=o,o=m,m=c,c=h,h=m);var d=v.treemap().tile(A(r.packing,r.squarifyratio)).paddingInner(r.pad.inner).paddingLeft(s).paddingRight(c).paddingTop(o).paddingBottom(h).size(n?[t[1],t[0]]:t)(e);return(n||i||a)&&x(d,t,{swapXY:n,flipX:i,flipY:a}),d};function A(M,e){switch(M){case"squarify":return v.treemapSquarify.ratio(e);case"binary":return v.treemapBinary;case"dice":return v.treemapDice;case"slice":return v.treemapSlice;default:return v.treemapSliceDice}}}}),$3=Ze({"src/traces/treemap/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=ca(),M=$v(),e=wp().resizeText,t=Y3();function r(a){var n=a._fullLayout._treemaplayer.selectAll(".trace");e(a,n,"treemap"),n.each(function(o){var s=v.select(this),c=o[0],h=c.trace;s.style("opacity",h.opacity),s.selectAll("path.surface").each(function(m){v.select(this).call(i,m,h,a,{hovered:!1})})})}function i(a,n,o,s,c){var h=(c||{}).hovered,m=n.data.data,d=m.i,T,l,_=m.color,w=M.isHierarchyRoot(n),S=1;if(h)T=o._hovered.marker.line.color,l=o._hovered.marker.line.width;else if(w&&_===o.root.color)S=100,T="rgba(0,0,0,0)",l=0;else if(T=A.castOption(o,d,"marker.line.color")||x.defaultLine,l=A.castOption(o,d,"marker.line.width")||0,!o._hasColorscale&&!n.onPathbar){var E=o.marker.depthfade;if(E){var g=x.combine(x.addOpacity(o._backgroundColor,.75),_),b;if(E===!0){var p=M.getMaxDepth(o);isFinite(p)?M.isLeaf(n)?b=0:b=o._maxVisibleLayers-(n.data.depth-o._entryDepth):b=n.data.height+1}else b=n.data.depth-o._entryDepth,o._atRootLevel||b++;if(b>0)for(var u=0;u<b;u++){var y=.5*u/b;_=x.combine(x.addOpacity(g,y),_)}}}a.call(t,n,o,s,_).style("stroke-width",l).call(x.stroke,T).style("opacity",S)}q.exports={style:r,styleOne:i}}}),TN=Ze({"src/traces/treemap/draw_ancestors.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=fu(),e=c5(),t=$3().styleOne,r=p0(),i=$v(),a=dx(),n=!0;q.exports=function(s,c,h,m,d){var T=d.barDifY,l=d.width,_=d.height,w=d.viewX,S=d.viewY,E=d.pathSlice,g=d.toMoveInsideSlice,b=d.strTransform,p=d.hasTransition,u=d.handleSlicesExit,y=d.makeUpdateSliceInterpolator,f=d.makeUpdateTextInterpolator,P={},L=s._context.staticPlot,z=s._fullLayout,F=c[0],B=F.trace,O=F.hierarchy,I=l/B._entryDepth,N=i.listPath(h.data,"id"),U=e(O.copy(),[l,_],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();U=U.filter(function(Q){var ue=N.indexOf(Q.data.id);return ue===-1?!1:(Q.x0=I*ue,Q.x1=I*(ue+1),Q.y0=T,Q.y1=T+_,Q.onPathbar=!0,!0)}),U.reverse(),m=m.data(U,i.getPtId),m.enter().append("g").classed("pathbar",!0),u(m,n,P,[l,_],E),m.order();var W=m;p&&(W=W.transition().each("end",function(){var Q=v.select(this);i.setSliceCursor(Q,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),W.each(function(Q){Q._x0=w(Q.x0),Q._x1=w(Q.x1),Q._y0=S(Q.y0),Q._y1=S(Q.y1),Q._hoverX=w(Q.x1-Math.min(l,_)/2),Q._hoverY=S(Q.y1-_/2);var ue=v.select(this),se=x.ensureSingle(ue,"path","surface",function(J){J.style("pointer-events",L?"none":"all")});p?se.transition().attrTween("d",function(J){var X=y(J,n,P,[l,_]);return function(oe){return E(X(oe))}}):se.attr("d",E),ue.call(a,h,s,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(i.setSliceCursor,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:s._transitioning}),se.call(t,Q,B,s,{hovered:!1}),Q._text=(i.getPtLabel(Q)||"").split("<br>").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<z},B=_._size,O=S.domain,I=B.w*(O.x[1]-O.x[0]),N=B.h*(O.y[1]-O.y[0]),U=I,W=S.pathbar.thickness,Q=S.marker.line.width+n.gapWithPathbar,ue=S.pathbar.visible?S.pathbar.side.indexOf("bottom")>-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<Tt&&Tt<Ue&&(Ke=Tt)):(Tt=Ke+(g?Me:Me.t),Ke<Tt&&Tt<Ue&&(Ue=Tt))}var Ot=r(bt,Be,Ke,Ue,Ee,{isHorizontal:!1,constrained:!0,angle:0,anchor:Ce,leftToRight:at});return Ot.fontSize=Ir.fontSize,Ot.targetX=re(Ot.targetX),Ot.targetY=ce(Ot.targetY),isNaN(Ot.targetX)||isNaN(Ot.targetY)?{}:(bt!==Be&&Ke!==Ue&&a(S.type,Ot,_),{scale:Ot.scale,rotate:Ot.rotate,textX:Ot.textX,textY:Ot.textY,anchorX:Ot.anchorX,anchorY:Ot.anchorY,targetX:Ot.targetX,targetY:Ot.targetY})},kt=function(wr,Ir){for(var bt,Be=0,Ke=wr;!bt&&Be<z;)Be++,Ke=Ke.parent,Ke?bt=oe(Ke,Ir):Be=z;return bt||{}},qt=function(wr,Ir,bt,Be){var Ke=oe(wr,Ir),Ue;if(Ir)Ue=se;else{var Ee=oe(p,Ir);Ee?Ue=he(wr,Ee,Be):Ue={}}return x(Ke,Ue)},Zt=function(wr,Ir,bt,Be,Ke){var Ue=oe(wr,Ir),Ee;if(Ue)Ee=Ue;else if(Ir)Ee=se;else if(H)if(wr.parent){var Ve=X||bt;Ve&&!Ir?Ee=he(wr,Ve,Be):(Ee={},M.extendFlat(Ee,kt(wr,Ir)))}else Ee=M.extendFlat({},wr),g&&(Ke.orientation==="h"?Ke.flipX?Ee.x0=wr.x1:Ee.x1=0:Ke.flipY?Ee.y0=wr.y1:Ee.y1=0);else Ee={};return x(Ee,{x0:wr.x0,x1:wr.x1,y0:wr.y0,y1:wr.y1})},Sr=function(wr,Ir,bt,Be){var Ke=oe(wr,Ir),Ue={},Ee=ne(wr,Ir,bt,Be);M.extendFlat(Ue,{transform:Lt({x0:Ee.x0,x1:Ee.x1,y0:Ee.y0,y1:Ee.y1,textBB:wr.textBB,_text:wr._text},{isHeader:A.isHeader(wr,S)})}),Ke?Ue=Ke:wr.parent&&M.extendFlat(Ue,kt(wr,Ir));var Ve=wr.transform;return wr.x0!==wr.x1&&wr.y0!==wr.y1&&a(S.type,Ve,_),x(Ue,{transform:{scale:Ve.scale,rotate:Ve.rotate,textX:Ve.textX,textY:Ve.textY,anchorX:Ve.anchorX,anchorY:Ve.anchorY,targetX:Ve.targetX,targetY:Ve.targetY}})},xr=function(wr,Ir,bt,Be,Ke){var Ue=Be[0],Ee=Be[1];L?wr.exit().transition().each(function(){var Ve=v.select(this),Ce=Ve.select("path.surface");Ce.transition().attrTween("d",function(Pe){var at=qt(Pe,Ir,bt,[Ue,Ee]);return function(yt){return Ke(at(yt))}});var Te=Ve.select("g.slicetext");Te.attr("opacity",0)}).remove():wr.exit().remove()},jr=function(wr){var Ir=wr.transform;return wr.x0!==wr.x1&&wr.y0!==wr.y1&&a(S.type,Ir,_),M.getTextTransform({textX:Ir.textX,textY:Ir.textY,anchorX:Ir.anchorX,anchorY:Ir.anchorY,targetX:Ir.targetX,targetY:Ir.targetY,scale:Ir.scale,rotate:Ir.rotate})};L&&(y.each(function(wr){$[s(wr)]={x0:wr.x0,x1:wr.x1,y0:wr.y0,y1:wr.y1},wr.transform&&($[s(wr)].transform={textX:wr.transform.textX,textY:wr.transform.textY,anchorX:wr.transform.anchorX,anchorY:wr.transform.anchorY,targetX:wr.transform.targetX,targetY:wr.transform.targetY,scale:wr.transform.scale,rotate:wr.transform.rotate})}),f.each(function(wr){J[s(wr)]={x0:wr.x0,x1:wr.x1,y0:wr.y0,y1:wr.y1},wr.transform&&(J[s(wr)].transform={textX:wr.transform.textX,textY:wr.transform.textY,anchorX:wr.transform.anchorX,anchorY:wr.transform.anchorY,targetX:wr.transform.targetX,targetY:wr.transform.targetY,scale:wr.transform.scale,rotate:wr.transform.rotate}),!H&&A.isEntry(wr)&&(H=wr)})),X=l(h,m,p,f,{width:I,height:N,viewX:re,viewY:ce,pathSlice:Qe,toMoveInsideSlice:Lt,prevEntry:H,makeUpdateSliceInterpolator:Zt,makeUpdateTextInterpolator:Sr,handleSlicesExit:xr,hasTransition:L,strTransform:jr}),S.pathbar.visible?o(h,m,p,y,{barDifY:ue,width:U,height:W,viewX:ze,viewY:Re,pathSlice:ut,toMoveInsideSlice:Lt,makeUpdateSliceInterpolator:Zt,makeUpdateTextInterpolator:Sr,handleSlicesExit:xr,hasTransition:L,strTransform:jr}):y.remove()}}}),f5=Ze({"src/traces/treemap/draw.js"(Z,q){"use strict";var v=Oi(),x=$v(),A=wp(),M=A.clearMinTextSize,e=Nd().resizeText,t=AN();q.exports=function(i,a,n,o,s){var c=s.type,h=s.drawDescendants,m=i._fullLayout,d=m["_"+c+"layer"],T,l,_=!n;if(M(c,m),T=d.selectAll("g.trace."+c).data(a,function(S){return S[0].trace.uid}),T.enter().append("g").classed("trace",!0).classed(c,!0),T.order(),!m.uniformtext.mode&&x.hasTransition(n)){o&&(l=o());var w=v.transition().duration(n.duration).ease(n.easing).each("end",function(){l&&l()}).each("interrupt",function(){l&&l()});w.each(function(){d.selectAll("g.trace").each(function(S){t(i,S,this,n,h)})})}else T.each(function(S){t(i,S,this,n,h)}),m.uniformtext.mode&&e(i,d.selectAll(".trace"),c);_&&T.exit().remove()}}}),SN=Ze({"src/traces/treemap/draw_descendants.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=as(),M=fu(),e=c5(),t=$3().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=!U&&!O.marker.pad.t||U&&!O.marker.pad.b,Q=e(m,[l,_],{packing:O.tiling.packing,squarifyratio:O.tiling.squarifyratio,flipX:O.tiling.flip.indexOf("x")>-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("<br>")===-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<N.length;U++)I=N[U],ue=Math.min(ue,I[1]),se=Math.max(se,I[1]);for(U=0;U<N.length;U++)N[U][1]-=(se+ue)/2;var he=N[N.length-1][0],H=b.r,$=(se-ue)/2,J=H/he,X=H/$*u;for(b.r=X*$,U=0;U<N.length;U++)N[U][0]*=J,N[U][1]*=X;I=N[0];var oe=[-I[0],I[1]],ne=[I[0],I[1]],j=0;for(U=g.length-1;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;Pe<Te.length;Pe++){var at=Te[Pe];at.enumerable=at.enumerable||!1,at.configurable=!0,"value"in at&&(at.writable=!0),Object.defineProperty(Ce,s(at.key),at)}}function o(Ce,Te,Pe){return Te&&n(Ce.prototype,Te),Pe&&n(Ce,Pe),Object.defineProperty(Ce,"prototype",{writable:!1}),Ce}function s(Ce){var Te=c(Ce,"string");return S(Te)=="symbol"?Te:Te+""}function c(Ce,Te){if(S(Ce)!="object"||!Ce)return Ce;var Pe=Ce[Symbol.toPrimitive];if(Pe!==void 0){var at=Pe.call(Ce,Te||"default");if(S(at)!="object")return at;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Te==="string"?String:Number)(Ce)}function h(Ce,Te,Pe){return Te=l(Te),m(Ce,T()?Reflect.construct(Te,Pe||[],l(Ce).constructor):Te.apply(Ce,Pe))}function m(Ce,Te){if(Te&&(S(Te)=="object"||typeof Te=="function"))return Te;if(Te!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(Ce)}function d(Ce){if(Ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ce}function T(){try{var Ce=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T=function(){return!!Ce})()}function l(Ce){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Te){return Te.__proto__||Object.getPrototypeOf(Te)},l(Ce)}function _(Ce,Te){if(typeof Te!="function"&&Te!==null)throw new TypeError("Super expression must either be null or a function");Ce.prototype=Object.create(Te&&Te.prototype,{constructor:{value:Ce,writable:!0,configurable:!0}}),Object.defineProperty(Ce,"prototype",{writable:!1}),Te&&w(Ce,Te)}function w(Ce,Te){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Pe,at){return Pe.__proto__=at,Pe},w(Ce,Te)}function S(Ce){"@babel/helpers - typeof";return S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Te){return typeof Te}:function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},S(Ce)}var E=r(7507),g=r(3778),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=f,i=Q,t.IS=50;var p=2147483647;i=p,f.TYPED_ARRAY_SUPPORT=u(),!f.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 u(){try{var Ce=new Uint8Array(1),Te={foo:function(){return 42}};return Object.setPrototypeOf(Te,Uint8Array.prototype),Object.setPrototypeOf(Ce,Te),Ce.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function y(Ce){if(Ce>p)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<Te;at+=1)Pe[at]=Ce[at]&255;return Pe}function I(Ce){if(Be(Ce,Uint8Array)){var Te=new Uint8Array(Ce);return N(Te.buffer,Te.byteOffset,Te.byteLength)}return O(Ce)}function N(Ce,Te,Pe){if(Te<0||Ce.byteLength<Te)throw new RangeError('"offset" is outside of buffer bounds');if(Ce.byteLength<Te+(Pe||0))throw new RangeError('"length" is outside of buffer bounds');var at;return Te===void 0&&Pe===void 0?at=new Uint8Array(Ce):Pe===void 0?at=new Uint8Array(Ce,Te):at=new Uint8Array(Ce,Te,Pe),Object.setPrototypeOf(at,f.prototype),at}function U(Ce){if(f.isBuffer(Ce)){var Te=W(Ce.length)|0,Pe=y(Te);return Pe.length===0||Ce.copy(Pe,0,0,Te),Pe}if(Ce.length!==void 0)return typeof Ce.length!="number"||Ke(Ce.length)?y(0):O(Ce);if(Ce.type==="Buffer"&&Array.isArray(Ce.data))return O(Ce.data)}function W(Ce){if(Ce>=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);Tt<Ot;++Tt)if(Te[Tt]!==Pe[Tt]){at=Te[Tt],yt=Pe[Tt];break}return at<yt?-1:yt<at?1:0},f.isEncoding=function(Te){switch(String(Te).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(Te,Pe){if(!Array.isArray(Te))throw new TypeError('"list" argument must be an Array of Buffers');if(Te.length===0)return f.alloc(0);var at;if(Pe===void 0)for(Pe=0,at=0;at<Te.length;++at)Pe+=Te[at].length;var yt=f.allocUnsafe(Pe),Tt=0;for(at=0;at<Te.length;++at){var Ot=Te[at];if(Be(Ot,Uint8Array))Tt+Ot.length>yt.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;Pe<Te;Pe+=2)he(this,Pe,Pe+1);return this},f.prototype.swap32=function(){var Te=this.length;if(Te%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Pe=0;Pe<Te;Pe+=4)he(this,Pe,Pe+3),he(this,Pe+1,Pe+2);return this},f.prototype.swap64=function(){var Te=this.length;if(Te%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Pe=0;Pe<Te;Pe+=8)he(this,Pe,Pe+7),he(this,Pe+1,Pe+6),he(this,Pe+2,Pe+5),he(this,Pe+3,Pe+4);return this},f.prototype.toString=function(){var Te=this.length;return Te===0?"":arguments.length===0?re(this,0,Te):se.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(Te){if(!f.isBuffer(Te))throw new TypeError("Argument must be a Buffer");return this===Te?!0:f.compare(this,Te)===0},f.prototype.inspect=function(){var Te="",Pe=t.IS;return Te=this.toString("hex",0,Pe).replace(/(.{2})/g,"$1 ").trim(),this.length>Pe&&(Te+=" ... "),"<Buffer "+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;la<rr;++la)if(Qt[la]!==Tr[la]){Ot=Qt[la],Gt=Tr[la];break}return Ot<Gt?-1:Gt<Ot?1:0};function H(Ce,Te,Pe,at,yt){if(Ce.length===0)return-1;if(typeof Pe=="string"?(at=Pe,Pe=0):Pe>2147483647?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;Qt<Ot;Qt++)if(rr(Ce,Qt)===rr(Te,Tr===-1?0:Qt-Tr)){if(Tr===-1&&(Tr=Qt),Qt-Tr+1===Gt)return Tr*Tt}else Tr!==-1&&(Qt-=Qt-Tr),Tr=-1}else for(Pe+Gt>Ot&&(Pe=Ot-Gt),Qt=Pe;Qt>=0;Qt--){for(var la=!0,Ua=0;Ua<Gt;Ua++)if(rr(Ce,Qt+Ua)!==rr(Te,Ua)){la=!1;break}if(la)return Qt}return-1}f.prototype.includes=function(Te,Pe,at){return this.indexOf(Te,Pe,at)!==-1},f.prototype.indexOf=function(Te,Pe,at){return H(this,Te,Pe,at,!0)},f.prototype.lastIndexOf=function(Te,Pe,at){return H(this,Te,Pe,at,!1)};function J(Ce,Te,Pe,at){Pe=Number(Pe)||0;var yt=Ce.length-Pe;at?(at=Number(at),at>yt&&(at=yt)):at=yt;var Tt=Te.length;at>Tt/2&&(at=Tt/2);var Ot;for(Ot=0;Ot<at;++Ot){var Gt=parseInt(Te.substr(Ot*2,2),16);if(Ke(Gt))return Ot;Ce[Pe+Ot]=Gt}return Ot}function X(Ce,Te,Pe,at){return bt(xr(Te,Ce.length-Pe),Ce,Pe,at)}function oe(Ce,Te,Pe,at){return bt(jr(Te),Ce,Pe,at)}function ne(Ce,Te,Pe,at){return bt(Ir(Te),Ce,Pe,at)}function j(Ce,Te,Pe,at){return bt(wr(Te,Ce.length-Pe),Ce,Pe,at)}f.prototype.write=function(Te,Pe,at,yt){if(Pe===void 0)yt="utf8",at=this.length,Pe=0;else if(at===void 0&&typeof Pe=="string")yt=Pe,at=this.length,Pe=0;else if(isFinite(Pe))Pe=Pe>>>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;yt<Pe;){var Tt=Ce[yt],Ot=null,Gt=Tt>239?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;at<Te;)Pe+=String.fromCharCode.apply(String,Ce.slice(at,at+=ce));return Pe}function Ae(Ce,Te,Pe){var at="";Pe=Math.min(Ce.length,Pe);for(var yt=Te;yt<Pe;++yt)at+=String.fromCharCode(Ce[yt]&127);return at}function ze(Ce,Te,Pe){var at="";Pe=Math.min(Ce.length,Pe);for(var yt=Te;yt<Pe;++yt)at+=String.fromCharCode(Ce[yt]);return at}function Re(Ce,Te,Pe){var at=Ce.length;(!Te||Te<0)&&(Te=0),(!Pe||Pe<0||Pe>at)&&(Pe=at);for(var yt="",Tt=Te;Tt<Pe;++Tt)yt+=Ue[Ce[Tt]];return yt}function We(Ce,Te,Pe){for(var at=Ce.slice(Te,Pe),yt="",Tt=0;Tt<at.length-1;Tt+=2)yt+=String.fromCharCode(at[Tt]+at[Tt+1]*256);return yt}f.prototype.slice=function(Te,Pe){var at=this.length;Te=~~Te,Pe=Pe===void 0?at:~~Pe,Te<0?(Te+=at,Te<0&&(Te=0)):Te>at&&(Te=at),Pe<0?(Pe+=at,Pe<0&&(Pe=0)):Pe>at&&(Pe=at),Pe<Te&&(Pe=Te);var yt=this.subarray(Te,Pe);return Object.setPrototypeOf(yt,f.prototype),yt};function it(Ce,Te,Pe){if(Ce%1!==0||Ce<0)throw new RangeError("offset is not uint");if(Ce+Te>Pe)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<Pe&&(Tt*=256);)yt+=this[Te+Ot]*Tt;return yt},f.prototype.readUintBE=f.prototype.readUIntBE=function(Te,Pe,at){Te=Te>>>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)<<BigInt(32))}),f.prototype.readBigUInt64BE=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*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)<<BigInt(32))+BigInt(Tt)}),f.prototype.readIntLE=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<Pe&&(Tt*=256);)yt+=this[Te+Ot]*Tt;return Tt*=128,yt>=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)<<BigInt(32))+BigInt(Pe+this[++Te]*Math.pow(2,8)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,24))}),f.prototype.readBigInt64BE=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<<24)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,8)+this[++Te];return(BigInt(yt)<<BigInt(32))+BigInt(this[++Te]*Math.pow(2,24)+this[++Te]*Math.pow(2,16)+this[++Te]*Math.pow(2,8)+at)}),f.prototype.readFloatLE=function(Te,Pe){return Te=Te>>>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||Te<Tt)throw new RangeError('"value" argument is out of bounds');if(Pe+at>Ce.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<at&&(Ot*=256);)this[Pe+Gt]=Te/Ot&255;return Pe+at},f.prototype.writeUintBE=f.prototype.writeUIntBE=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=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<at&&(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.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<at&&(yt=at),yt===at||Te.length===0||this.length===0)return 0;if(Pe<0)throw new RangeError("targetStart out of bounds");if(at<0||at>=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<yt-at&&(yt=Te.length-Pe+at);var Tt=yt-at;return this===Te&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Pe,at,yt):Uint8Array.prototype.set.call(Te,this.subarray(at,yt),Pe),Tt},f.prototype.fill=function(Te,Pe,at,yt){if(typeof Te=="string"){if(typeof Pe=="string"?(yt=Pe,Pe=0,at=this.length):typeof at=="string"&&(yt=at,at=this.length),yt!==void 0&&typeof yt!="string")throw new TypeError("encoding must be a string");if(typeof yt=="string"&&!f.isEncoding(yt))throw new TypeError("Unknown encoding: "+yt);if(Te.length===1){var Tt=Te.charCodeAt(0);(yt==="utf8"&&Tt<128||yt==="latin1")&&(Te=Tt)}}else typeof Te=="number"?Te=Te&255:typeof Te=="boolean"&&(Te=Number(Te));if(Pe<0||this.length<Pe||this.length<at)throw new RangeError("Out of range index");if(at<=Pe)return this;Pe=Pe>>>0,at=at===void 0?this.length:at>>>0,Te||(Te=0);var Ot;if(typeof Te=="number")for(Ot=Pe;Ot<at;++Ot)this[Ot]=Te;else{var Gt=f.isBuffer(Te)?Te:f.from(Te,yt),rr=Gt.length;if(rr===0)throw new TypeError('The value "'+Te+'" is invalid for argument "value"');for(Ot=0;Ot<at-Pe;++Ot)this[Ot+Pe]=Gt[Ot%rr]}return this};var Fe={};function rt(Ce,Te,Pe){Fe[Ce]=function(at){function yt(){var Tt;return a(this,yt),Tt=h(this,yt),Object.defineProperty(Tt,"message",{value:Te.apply(Tt,arguments),writable:!0,configurable:!0}),Tt.name="".concat(Tt.name," [").concat(Ce,"]"),Tt.stack,delete Tt.name,Tt}return _(yt,at),o(yt,[{key:"code",get:function(){return Ce},set:function(Ot){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ot,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(Ce,"]: ").concat(this.message)}}])}(Pe)}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(Ce){return Ce?"".concat(Ce," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(Ce,Te){return'The "'.concat(Ce,'" argument must be of type number. Received type ').concat(S(Te))},TypeError),rt("ERR_OUT_OF_RANGE",function(Ce,Te,Pe){var at='The value of "'.concat(Ce,'" is out of range.'),yt=Pe;return Number.isInteger(Pe)&&Math.abs(Pe)>Math.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||Ce<Te){var Ot=typeof Te=="bigint"?"n":"",Gt;throw Tt>3?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;Ot<at;++Ot){if(Pe=Ce.charCodeAt(Ot),Pe>55295&&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<Ce.length;++Pe)Te.push(Ce.charCodeAt(Pe)&255);return Te}function wr(Ce,Te){for(var Pe,at,yt,Tt=[],Ot=0;Ot<Ce.length&&!((Te-=2)<0);++Ot)Pe=Ce.charCodeAt(Ot),at=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<at&&!(yt+Pe>=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<m.length;++d)m[d].flush(h)},s.idle=function(h){for(var m=this._controllerList,d=0;d<m.length;++d)m[d].idle(h)},s.lookAt=function(h,m,d,T){for(var l=this._controllerList,_=0;_<l.length;++_)l[_].lookAt(h,m,d,T)},s.rotate=function(h,m,d,T){for(var l=this._controllerList,_=0;_<l.length;++_)l[_].rotate(h,m,d,T)},s.pan=function(h,m,d,T){for(var l=this._controllerList,_=0;_<l.length;++_)l[_].pan(h,m,d,T)},s.translate=function(h,m,d,T){for(var l=this._controllerList,_=0;_<l.length;++_)l[_].translate(h,m,d,T)},s.setMatrix=function(h,m){for(var d=this._controllerList,T=0;T<d.length;++T)d[T].setMatrix(h,m)},s.setDistanceLimits=function(h,m){for(var d=this._controllerList,T=0;T<d.length;++T)d[T].setDistanceLimits(h,m)},s.setDistance=function(h,m){for(var d=this._controllerList,T=0;T<d.length;++T)d[T].setDistance(h,m)},s.recalcMatrix=function(h){this._active.recalcMatrix(h)},s.getDistance=function(h){return this._active.getDistance(h)},s.getDistanceLimits=function(h){return this._active.getDistanceLimits(h)},s.lastT=function(){return this._active.lastT()},s.setMode=function(h){if(h!==this._mode){var m=this._controllerNames.indexOf(h);if(!(m<0)){var d=this._active,T=this._controllerList[m],l=Math.max(d.lastT(),T.lastT());d.recalcMatrix(l),T.setMatrix(l,d.computedMatrix),this._active=T,this._mode=h,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}}},s.getMode=function(){return this._mode};function c(h){h=h||{};var m=h.eye||[0,0,1],d=h.center||[0,0,0],T=h.up||[0,1,0],l=h.distanceLimits||[0,1/0],_=h.mode||"turntable",w=i(),S=a(),E=n();return w.setDistanceLimits(l[0],l[1]),w.lookAt(0,m,d,T),S.setDistanceLimits(l[0],l[1]),S.lookAt(0,m,d,T),E.setDistanceLimits(l[0],l[1]),E.lookAt(0,m,d,T),new o({turntable:w,orbit:S,matrix:E},_)}},7169:function(e,t,r){"use strict";var i=typeof WeakMap>"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;h<o.length;++h)c[h]=o[h];for(var h=0;h<=o.length;++h){for(var m=o.length;m<=s;++m){for(var d=new Array(s),T=0;T<s;++T)d[T]=Math.pow(m+1-h,T);c[m]=d}var l=i.apply(void 0,c);if(l)return!0}return!1}function n(o){var s=o.length;if(s===0)return[];if(s===1)return[0];for(var c=o[0].length,h=[o[0]],m=[0],d=1;d<s;++d){if(h.push(o[d]),!a(h,c)){h.pop();continue}if(m.push(d),m.length===c+1)return m}return m}},5995:function(e,t,r){"use strict";e.exports=n;var i=r(7642),a=r(6037);function n(o,s){return i(s).filter(function(c){for(var h=new Array(c.length),m=0;m<c.length;++m)h[m]=s[c[m]];return a(h)*o<1})}},3502:function(e,t,r){e.exports=n;var i=r(5995),a=r(9127);function n(o,s){return a(i(o,s))}},6468:function(e){e.exports=function(r){return atob(r)}},2642:function(e,t,r){"use strict";e.exports=n;var i=r(727);function a(o){for(var s=0,c=0;c<o.length;++c)s+=o[c];return s}function n(o,s){for(var c=s.length,h=new Array(c+1),m=0;m<c;++m){for(var d=new Array(c+1),T=0;T<=c;++T)d[T]=o[T][m];h[m]=d}h[c]=new Array(c+1);for(var m=0;m<=c;++m)h[c][m]=1;for(var l=new Array(c+1),m=0;m<c;++m)l[m]=s[m];l[c]=1;var _=i(h,l),w=a(_[c+1]);w===0&&(w=1);for(var S=new Array(c+1),m=0;m<=c;++m)S[m]=a(_[m])/w;return S}},7507:function(e,t){"use strict";t.byteLength=h,t.toByteArray=d,t.fromByteArray=_;for(var r=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=n.length;o<s;++o)r[o]=n[o],i[n.charCodeAt(o)]=o;i[45]=62,i[95]=63;function c(w){var S=w.length;if(S%4>0)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<y;f+=4)S=i[w.charCodeAt(f)]<<18|i[w.charCodeAt(f+1)]<<12|i[w.charCodeAt(f+2)]<<6|i[w.charCodeAt(f+3)],p[u++]=S>>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;p<E;p+=3)g=(w[p]<<16&16711680)+(w[p+1]<<8&65280)+(w[p+2]&255),b.push(T(g));return b.join("")}function _(w){for(var S,E=w.length,g=E%3,b=[],p=16383,u=0,y=E-g;u<y;u+=p)b.push(l(w,u,u+p>y?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;h<o;h++){var m=s[h];c+=m*Math.pow(67108864,h)}return i(n)*c}},4025:function(e,t,r){"use strict";var i=r(2361),a=r(8828).countTrailingZeros;e.exports=n;function n(o){var s=a(i.lo(o));if(s<32)return s;var c=a(i.hi(o));return c>20?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<<r-1,t.sign=function(n){return(n>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)&-(n<o)},t.max=function(n,o){return n^(n^o)&-(n<o)},t.isPow2=function(n){return!(n&n-1)&&!!n},t.log2=function(n){var o,s;return o=(n>65535)<<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<<h&255}})(a),t.reverse=function(n){return a[n&255]<<24|a[n>>>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<I.length&&(N===16?this._parseHex(I,W,U):(this._parseBase(I,N,W),U==="le"&&this._initArray(this.toArray(),N,U)))},s.prototype._initNumber=function(I,N,U){I<0&&(this.negative=1,I=-I),I<67108864?(this.words=[I&67108863],this.length=1):I<4503599627370496?(this.words=[I&67108863,I/67108864&67108863],this.length=2):(n(I<9007199254740992),this.words=[I&67108863,I/67108864&67108863,1],this.length=3),U==="le"&&this._initArray(this.toArray(),N,U)},s.prototype._initArray=function(I,N,U){if(n(typeof I.length=="number"),I.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(I.length/3),this.words=new Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Q,ue,se=0;if(U==="be")for(W=I.length-1,Q=0;W>=0;W-=3)ue=I[W]|I[W-1]<<8|I[W-2]<<16,this.words[Q]|=ue<<se&67108863,this.words[Q+1]=ue>>>26-se&67108863,se+=24,se>=26&&(se-=26,Q++);else if(U==="le")for(W=0,Q=0;W<I.length;W+=3)ue=I[W]|I[W+1]<<8|I[W+2]<<16,this.words[Q]|=ue<<se&67108863,this.words[Q+1]=ue>>>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<this.length;W++)this.words[W]=0;var Q=0,ue=0,se;if(U==="be")for(W=I.length-1;W>=N;W-=2)se=m(I,N,W)<<Q,this.words[ue]|=se&67108863,Q>=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<I.length;W+=2)se=m(I,N,W)<<Q,this.words[ue]|=se&67108863,Q>=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<Q;ue++){var se=O.charCodeAt(ue)-48;W*=U,se>=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;$<he;$+=W)H=d(I,$,$+W,N),this.imuln(Q),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H);if(se!==0){var J=1;for(H=d(I,$,I.length,N),$=0;$<se;$++)J*=N;this.imuln(J),this.words[0]+H<67108864?this.words[0]+=H:this._iaddn(H)}this.strip()},s.prototype.copy=function(I){I.words=new Array(this.length);for(var N=0;N<this.length;N++)I.words[N]=this.words[N];I.length=this.length,I.negative=this.negative,I.red=this.red},s.prototype.clone=function(){var I=new s(null);return this.copy(I),I},s.prototype._expand=function(I){for(;this.length<I;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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<this.length;ue++){var se=this.words[ue],he=((se<<W|Q)&16777215).toString(16);Q=se>>>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<Q;H++)se[H]=0}else{for(H=0;H<Q-W;H++)se[H]=0;for(H=0;!$.isZero();H++)he=$.andln(255),$.iushrn(8),se[Q-H-1]=he}return se},Math.clz32?s.prototype._countBits=function(I){return 32-Math.clz32(I)}:s.prototype._countBits=function(I){var N=I,U=0;return N>=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<I.length;N++){var U=N/26|0,W=N%26;I[N]=(O.words[U]&1<<W)>>>W}return I}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,N=0;N<this.length;N++){var U=this._zeroBits(this.words[N]);if(I+=U,U!==26)break}return I},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(I){return this.negative!==0?this.abs().inotn(I).iaddn(1):this.clone()},s.prototype.fromTwos=function(I){return this.testn(I-1)?this.notn(I).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(I){for(;this.length<I.length;)this.words[this.length++]=0;for(var N=0;N<I.length;N++)this.words[N]=this.words[N]|I.words[N];return this.strip()},s.prototype.ior=function(I){return n((this.negative|I.negative)===0),this.iuor(I)},s.prototype.or=function(I){return this.length>I.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;U<N.length;U++)this.words[U]=this.words[U]&I.words[U];return this.length=N.length,this.strip()},s.prototype.iand=function(I){return n((this.negative|I.negative)===0),this.iuand(I)},s.prototype.and=function(I){return this.length>I.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;W<U.length;W++)this.words[W]=N.words[W]^U.words[W];if(this!==N)for(;W<N.length;W++)this.words[W]=N.words[W];return this.length=N.length,this.strip()},s.prototype.ixor=function(I){return n((this.negative|I.negative)===0),this.iuxor(I)},s.prototype.xor=function(I){return this.length>I.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;W<N;W++)this.words[W]=~this.words[W]&67108863;return U>0&&(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<<W:this.words[U]=this.words[U]&~(1<<W),this.strip()},s.prototype.iadd=function(I){var N;if(this.negative!==0&&I.negative===0)return this.negative=0,N=this.isub(I),this.negative^=1,this._normSign();if(this.negative===0&&I.negative!==0)return I.negative=0,N=this.isub(I),I.negative=1,N._normSign();var U,W;this.length>I.length?(U=this,W=I):(U=I,W=this);for(var Q=0,ue=0;ue<W.length;ue++)N=(U.words[ue]|0)+(W.words[ue]|0)+Q,this.words[ue]=N&67108863,Q=N>>>26;for(;Q!==0&&ue<U.length;ue++)N=(U.words[ue]|0)+Q,this.words[ue]=N&67108863,Q=N>>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;ue<U.length;ue++)this.words[ue]=U.words[ue];return this},s.prototype.add=function(I){var N;return I.negative!==0&&this.negative===0?(I.negative=0,N=this.sub(I),I.negative^=1,N):I.negative===0&&this.negative!==0?(this.negative=0,N=I.sub(this),this.negative=1,N):this.length>I.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<Q.length;se++)N=(W.words[se]|0)-(Q.words[se]|0)+ue,ue=N>>26,this.words[se]=N&67108863;for(;ue!==0&&se<W.length;se++)N=(W.words[se]|0)+ue,ue=N>>26,this.words[se]=N&67108863;if(ue===0&&se<W.length&&W!==this)for(;se<W.length;se++)this.words[se]=W.words[se];return this.length=Math.max(this.length,se),W!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(I){return this.clone().isub(I)};function S(O,I,N){N.negative=I.negative^O.negative;var U=O.length+I.length|0;N.length=U,U=U-1|0;var W=O.words[0]|0,Q=I.words[0]|0,ue=W*Q,se=ue&67108863,he=ue/67108864|0;N.words[0]=se;for(var H=1;H<U;H++){for(var $=he>>>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<N.length-1;Q++){var ue=W;W=0;for(var se=U&67108863,he=Math.min(Q,I.length-1),H=Math.max(0,Q-O.length+1);H<=he;H++){var $=Q-H,J=O.words[$]|0,X=I.words[H]|0,oe=J*X,ne=oe&67108863;ue=ue+(oe/67108864|0)|0,ne=ne+se|0,se=ne&67108863,ue=ue+(ne>>>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<I;W++)N[W]=this.revBin(W,U,I);return N},p.prototype.revBin=function(I,N,U){if(I===0||I===U-1)return I;for(var W=0,Q=0;Q<N;Q++)W|=(I&1)<<N-Q-1,I>>=1;return W},p.prototype.permute=function(I,N,U,W,Q,ue){for(var se=0;se<ue;se++)W[se]=N[I[se]],Q[se]=U[I[se]]},p.prototype.transform=function(I,N,U,W,Q,ue){this.permute(ue,I,N,U,W,Q);for(var se=1;se<Q;se<<=1)for(var he=se<<1,H=Math.cos(2*Math.PI/he),$=Math.sin(2*Math.PI/he),J=0;J<Q;J+=he)for(var X=H,oe=$,ne=0;ne<se;ne++){var j=U[J+ne],ee=W[J+ne],re=U[J+ne+se],ce=W[J+ne+se],be=X*re-oe*ce;ce=X*ce+oe*re,re=be,U[J+ne]=j+re,W[J+ne]=ee+ce,U[J+ne+se]=j-re,W[J+ne+se]=ee-ce,ne!==he&&(be=H*X-$*oe,oe=H*oe+$*X,X=be)}},p.prototype.guessLen13b=function(I,N){var U=Math.max(N,I)|1,W=U&1,Q=0;for(U=U/2|0;U;U=U>>>1)Q++;return 1<<Q+1+W},p.prototype.conjugate=function(I,N,U){if(!(U<=1))for(var W=0;W<U/2;W++){var Q=I[W];I[W]=I[U-W-1],I[U-W-1]=Q,Q=N[W],N[W]=-N[U-W-1],N[U-W-1]=-Q}},p.prototype.normalize13b=function(I,N){for(var U=0,W=0;W<N/2;W++){var Q=Math.round(I[2*W+1]/N)*8192+Math.round(I[2*W]/N)+U;I[W]=Q&67108863,Q<67108864?U=0:U=Q/67108864|0}return I},p.prototype.convert13b=function(I,N,U,W){for(var Q=0,ue=0;ue<N;ue++)Q=Q+(I[ue]|0),U[2*ue]=Q&8191,Q=Q>>>13,U[2*ue+1]=Q&8191,Q=Q>>>13;for(ue=2*N;ue<W;++ue)U[ue]=0;n(Q===0),n((Q&-8192)===0)},p.prototype.stub=function(I){for(var N=new Array(I),U=0;U<I;U++)N[U]=0;return N},p.prototype.mulp=function(I,N,U){var W=2*this.guessLen13b(I.length,N.length),Q=this.makeRBT(W),ue=this.stub(W),se=new Array(W),he=new Array(W),H=new Array(W),$=new Array(W),J=new Array(W),X=new Array(W),oe=U.words;oe.length=W,this.convert13b(I.words,I.length,se,W),this.convert13b(N.words,N.length,$,W),this.transform(se,ue,he,H,W,Q),this.transform($,ue,J,X,W,Q);for(var ne=0;ne<W;ne++){var j=he[ne]*J[ne]-H[ne]*X[ne];H[ne]=he[ne]*X[ne]+H[ne]*J[ne],he[ne]=j}return this.conjugate(he,H,W),this.transform(he,H,oe,ue,W,Q),this.conjugate(oe,ue,W),this.normalize13b(oe,W),U.negative=I.negative^N.negative,U.length=I.length+N.length,U.strip()},s.prototype.mul=function(I){var N=new s(null);return N.words=new Array(this.length+I.length),this.mulTo(I,N)},s.prototype.mulf=function(I){var N=new s(null);return N.words=new Array(this.length+I.length),b(this,I,N)},s.prototype.imul=function(I){return this.clone().mulTo(I,this)},s.prototype.imuln=function(I){n(typeof I=="number"),n(I<67108864);for(var N=0,U=0;U<this.length;U++){var W=(this.words[U]|0)*I,Q=(W&67108863)+(N&67108863);N>>=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<N.length&&N[W]===0;W++,U=U.sqr());if(++W<N.length)for(var Q=U.sqr();W<N.length;W++,Q=Q.sqr())N[W]!==0&&(U=U.mul(Q));return U},s.prototype.iushln=function(I){n(typeof I=="number"&&I>=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<this.length;Q++){var se=this.words[Q]&W,he=(this.words[Q]|0)-se<<N;this.words[Q]=he|ue,ue=se>>>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<U;Q++)this.words[Q]=0;this.length+=U}return this.strip()},s.prototype.ishln=function(I){return n(this.negative===0),this.iushln(I)},s.prototype.iushrn=function(I,N,U){n(typeof I=="number"&&I>=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<<Q,he=U;if(W-=ue,W=Math.max(0,W),he){for(var H=0;H<ue;H++)he.words[H]=this.words[H];he.length=ue}if(ue!==0)if(this.length>ue)for(this.length-=ue,H=0;H<this.length;H++)this.words[H]=this.words[H+ue];else this.words[0]=0,this.length=1;var $=0;for(H=this.length-1;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<<N;if(this.length<=U)return!1;var Q=this.words[U];return!!(Q&W)},s.prototype.imaskn=function(I){n(typeof I=="number"&&I>=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<<N;this.words[this.length-1]&=W}return this.strip()},s.prototype.maskn=function(I){return this.clone().imaskn(I)},s.prototype.iaddn=function(I){return n(typeof I=="number"),n(I<67108864),I<0?this.isubn(-I):this.negative!==0?this.length===1&&(this.words[0]|0)<I?(this.words[0]=I-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(I),this.negative=1,this):this._iaddn(I)},s.prototype._iaddn=function(I){this.words[0]+=I;for(var N=0;N<this.length&&this.words[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<this.length&&this.words[N]<0;N++)this.words[N]+=67108864,this.words[N+1]-=1;return this.strip()},s.prototype.addn=function(I){return this.clone().iaddn(I)},s.prototype.subn=function(I){return this.clone().isubn(I)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(I,N,U){var W=I.length+U,Q;this._expand(W);var ue,se=0;for(Q=0;Q<I.length;Q++){ue=(this.words[Q+U]|0)+se;var he=(I.words[Q]|0)*N;ue-=he&67108863,se=(ue>>26)-(he/67108864|0),this.words[Q+U]=ue&67108863}for(;Q<this.length-U;Q++)ue=(this.words[Q+U]|0)+se,se=ue>>26,this.words[Q+U]=ue&67108863;if(se===0)return this.strip();for(n(se===-1),se=0,Q=0;Q<this.length;Q++)ue=-(this.words[Q]|0)+se,se=ue>>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;$<H.length;$++)H.words[$]=0}var J=W.clone()._ishlnsubmul(Q,1,he);J.negative===0&&(W=J,H&&(H.words[he]=1));for(var X=he-1;X>=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<<N;if(this.length<=U)return this._expand(U+1),this.words[U]|=W,this;for(var Q=W,ue=U;Q!==0&&ue<this.length;ue++){var se=this.words[ue]|0;se+=Q,Q=se>>>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:W<I?-1:1}return this.negative!==0?-U|0:U},s.prototype.cmp=function(I){if(this.negative!==0&&I.negative===0)return-1;if(this.negative===0&&I.negative!==0)return 1;var N=this.ucmp(I);return this.negative!==0?-N|0:N},s.prototype.ucmp=function(I){if(this.length>I.length)return 1;if(this.length<I.length)return-1;for(var N=0,U=this.length-1;U>=0;U--){var W=this.words[U]|0,Q=I.words[U]|0;if(W!==Q){W<Q?N=-1:W>Q&&(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=U<this.n?-1:N.ucmp(this.p);return W===0?(N.words[0]=0,N.length=1):W>0?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<W;Q++)N.words[Q]=I.words[Q];if(N.length=W,I.length<=9){I.words[0]=0,I.length=1;return}var ue=I.words[9];for(N.words[N.length++]=ue&U,Q=10;Q<I.length;Q++){var se=I.words[Q]|0;I.words[Q-10]=(se&U)<<4|ue>>>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<I.length;U++){var W=I.words[U]|0;N+=W*977,I.words[U]=N&67108863,N=W*64+(N/67108864|0)}return I.words[I.length-1]===0&&(I.length--,I.words[I.length-1]===0&&I.length--),I};function P(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(P,y);function L(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(L,y);function z(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(z,y),z.prototype.imulK=function(I){for(var N=0,U=0;U<I.length;U++){var W=(I.words[U]|0)*19+N,Q=W&67108863;W>>>=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<oe);var ee=this.pow($,new s(1).iushln(oe-j-1));J=J.redMul(ee),$=ee.redSqr(),X=X.redMul($),oe=j}return J},F.prototype.invm=function(I){var N=I._invmp(this.m);return N.negative!==0?(N.negative=0,this.imod(N).redNeg()):this.imod(N)},F.prototype.pow=function(I,N){if(N.isZero())return new s(1).toRed(this);if(N.cmpn(1)===0)return I.clone();var U=4,W=new Array(1<<U);W[0]=new s(1).toRed(this),W[1]=I;for(var Q=2;Q<W.length;Q++)W[Q]=this.mul(W[Q-1],I);var ue=W[0],se=0,he=0,H=N.bitLength()%26;for(H===0&&(H=26),Q=N.length-1;Q>=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<o;++i)s+=r[i].length;var c=new Array(s),h=0;for(i=0;i<o;++i){var m=r[i],d=m.length;for(a=0;a<d;++a){var T=c[h++]=new Array(d-1),l=0;for(n=0;n<d;++n)n!==a&&(T[l++]=m[n]);if(a&1){var _=T[1];T[1]=T[0],T[0]=_}}}return c}},6867:function(e,t,r){"use strict";e.exports=l;var i=r(1888),a=r(855),n=r(7150);function o(_,w){for(var S=0;S<_;++S)if(!(w[S]<=w[S+_]))return!0;return!1}function s(_,w,S,E){for(var g=0,b=0,p=0,u=_.length;p<u;++p){var y=_[p];if(!o(w,y)){for(var f=0;f<2*w;++f)S[g++]=y[f];E[b++]=p}}return b}function c(_,w,S,E){var g=_.length,b=w.length;if(!(g<=0||b<=0)){var p=_[0].length>>>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;p<T;++p,u+=b){var y=l[h+u],f=l[h+u+c],P=_[p];e:for(var L=w,z=b*w;L<S;++L,z+=b){var F=E[h+z],B=E[h+z+c],O=g[L];if(!(B<y||f<F)){for(var I=h+1;I<c;++I){var N=l[I+u],U=l[I+c+u],W=E[I+z],Q=E[I+c+z];if(U<W||Q<N)continue e}var ue=m(P,O);if(ue!==void 0)return ue}}}}function o(c,h,m,d,T,l,_,w,S,E,g){for(var b=2*c,p=w,u=b*w;p<S;++p,u+=b){var y=E[h+u],f=E[h+u+c],P=g[p];e:for(var L=d,z=b*d;L<T;++L,z+=b){var F=l[h+z],B=l[h+z+c],O=_[L];if(!(f<F||B<y)){for(var I=h+1;I<c;++I){var N=l[I+z],U=l[I+c+z],W=E[I+u],Q=E[I+c+u];if(U<W||Q<N)continue e}var ue=m(O,P);if(ue!==void 0)return ue}}}}function s(c,h,m,d,T,l,_,w,S,E,g){return T-d>S-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;F<g;++F,B+=u){var O=b[d+B],I=p[F];if(!(O<=P||L<O)){for(var N=d+1;N<m;++N){var U=w[N+f],W=w[N+m+f],Q=b[N+B],ue=b[N+m+B];if(W<Q||ue<U)continue e}var se=T(I,z);if(se!==void 0)return se}}}}function o(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;F<g;++F,B+=u){var O=b[d+B],I=p[F];if(!(O<P||L<O)){for(var N=d+1;N<m;++N){var U=w[N+f],W=w[N+m+f],Q=b[N+B],ue=b[N+m+B];if(W<Q||ue<U)continue e}var se=T(z,I);if(se!==void 0)return se}}}}function s(m,d,T,l,_,w,S,E,g,b,p){for(var u=2*m,y=E,f=u*E;y<g;++y,f+=u){var P=b[d+f],L=p[y];e:for(var z=l,F=u*l;z<_;++z,F+=u){var B=w[d+F],O=w[d+F+m],I=S[z];if(!(P<=B||O<P)){for(var N=d+1;N<m;++N){var U=w[N+F],W=w[N+m+F],Q=b[N+f],ue=b[N+m+f];if(W<Q||ue<U)continue e}var se=T(L,I);if(se!==void 0)return se}}}}function c(m,d,T,l,_,w,S,E,g,b,p){for(var u=2*m,y=E,f=u*E;y<g;++y,f+=u){var P=b[d+f],L=p[y];e:for(var z=l,F=u*l;z<_;++z,F+=u){var B=w[d+F],O=w[d+F+m],I=S[z];if(!(P<B||O<P)){for(var N=d+1;N<m;++N){var U=w[N+F],W=w[N+m+F],Q=b[N+f],ue=b[N+m+f];if(W<Q||ue<U)continue e}var se=T(I,L);if(se!==void 0)return se}}}}function h(m,d,T,l,_,w,S,E,g,b,p,u){return w-_>b-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("lo<p0"),E=m("hi<=p0"),g=m("lo<=p0&&p0<=hi"),b=m("lo<p0&&p0<=hi"),p=6,u=2,y=1024,f=i.mallocInt32(y),P=i.mallocDouble(y);function L(I,N){var U=8*a.log2(N+1)*(I+1)|0,W=a.nextPow2(p*U);f.length<W&&(i.free(f),f=i.mallocInt32(W));var Q=a.nextPow2(u*U);P.length<Q&&(i.free(P),P=i.mallocDouble(Q))}function z(I,N,U,W,Q,ue,se,he,H){var $=p*I;f[$]=N,f[$+1]=U,f[$+2]=W,f[$+3]=Q,f[$+4]=ue,f[$+5]=se;var J=u*I;P[J]=he,P[J+1]=H}function F(I,N,U,W,Q,ue,se,he,H,$,J){var X=2*I,oe=H*X,ne=$[oe+N];e:for(var j=Q,ee=Q*X;j<ue;++j,ee+=X){var re=se[ee+N],ce=se[ee+N+I];if(!(ne<re||ce<ne)&&!(W&&ne===re)){for(var be=he[j],Ae=N+1;Ae<I;++Ae){var re=se[ee+Ae],ce=se[ee+Ae+I],ze=$[oe+Ae],Re=$[oe+Ae+I];if(ce<ze||Re<re)continue e}var We;if(W?We=U(J,be):We=U(be,J),We!==void 0)return We}}}function B(I,N,U,W,Q,ue,se,he,H,$){var J=2*I,X=he*J,oe=H[X+N];e:for(var ne=W,j=W*J;ne<Q;++ne,j+=J){var ee=se[ne];if(ee!==$){var re=ue[j+N],ce=ue[j+N+I];if(!(oe<re||ce<oe)){for(var be=N+1;be<I;++be){var re=ue[j+be],ce=ue[j+be+I],Ae=H[X+be],ze=H[X+be+I];if(ce<Ae||ze<re)continue e}var Re=U(ee,$);if(Re!==void 0)return Re}}}}function O(I,N,U,W,Q,ue,se,he,H){L(I,W+se);var $=0,J=2*I,X;for(z($++,0,0,W,0,se,U?16:0,-1/0,1/0),U||z($++,0,0,se,0,W,1,-1/0,1/0);$>0;){$-=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)<l){if(X=c.scanComplete(I,ne,N,j,ee,ot,tt,re,ce,ut,Me),X!==void 0)return X;continue}}else if(I*Math.min(_e,fe)<d){if(X=o(I,ne,N,We,j,ee,ot,tt,re,ce,ut,Me),X!==void 0)return X;continue}else if(I*_e*fe<T){if(X=c.scanBipartite(I,ne,N,We,j,ee,ot,tt,re,ce,ut,Me),X!==void 0)return X;continue}var Fe=_(I,ne,j,ee,ot,tt,ze,Re);if(j<Fe)if(I*(Fe-j)<d){if(X=s(I,ne+1,N,j,Fe,ot,tt,re,ce,ut,Me),X!==void 0)return X}else if(ne===I-2){if(We?X=c.sweepBipartite(I,N,re,ce,ut,Me,j,Fe,ot,tt):X=c.sweepBipartite(I,N,j,Fe,ot,tt,re,ce,ut,Me),X!==void 0)return X}else z($++,ne+1,j,Fe,re,ce,We,-1/0,1/0),z($++,ne+1,re,ce,j,Fe,We^1,-1/0,1/0);if(Fe<ee){var rt=h(I,ne,re,ce,ut,Me),st=ut[J*rt+ne],Qe=w(I,ne,rt,ce,ut,Me,st);if(Qe<ce&&z($++,ne,Fe,ee,Qe,ce,(We|4)+(it?16:0),st,Re),re<rt&&z($++,ne,Fe,ee,re,rt,(We|2)+(it?16:0),ze,st),rt+1===Qe){if(it?X=B(I,ne,N,Fe,ee,ot,tt,rt,ut,Me[rt]):X=F(I,ne,N,We,Fe,ee,ot,tt,rt,ut,Me[rt]),X!==void 0)return X}else if(rt<Qe){var Lt;if(it){if(Lt=g(I,ne,Fe,ee,ot,tt,st),Fe<Lt){var kt=w(I,ne,Fe,Lt,ot,tt,st);if(ne===I-2){if(Fe<kt&&(X=c.sweepComplete(I,N,Fe,kt,ot,tt,rt,Qe,ut,Me),X!==void 0)||kt<Lt&&(X=c.sweepBipartite(I,N,kt,Lt,ot,tt,rt,Qe,ut,Me),X!==void 0))return X}else Fe<kt&&z($++,ne+1,Fe,kt,rt,Qe,16,-1/0,1/0),kt<Lt&&(z($++,ne+1,kt,Lt,rt,Qe,0,-1/0,1/0),z($++,ne+1,rt,Qe,kt,Lt,1,-1/0,1/0))}}else We?Lt=b(I,ne,Fe,ee,ot,tt,st):Lt=g(I,ne,Fe,ee,ot,tt,st),Fe<Lt&&(ne===I-2?We?X=c.sweepBipartite(I,N,rt,Qe,ut,Me,Fe,Lt,ot,tt):X=c.sweepBipartite(I,N,Fe,Lt,ot,tt,rt,Qe,ut,Me):(z($++,ne+1,Fe,Lt,rt,Qe,We,-1/0,1/0),z($++,ne+1,rt,Qe,Fe,Lt,We^1,-1/0,1/0)))}}}}}},3545:function(e,t,r){"use strict";e.exports=s;var i=r(8105),a=i("lo<p0"),n=8;function o(c,h,m,d,T,l){for(var _=2*c,w=_*(m+1)+h,S=m+1;S<d;++S,w+=_)for(var E=T[w],g=S,b=_*(S-1);g>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];_<w;){if(w-_<n){o(c,h,_,w,T,l),b=T[E*S+h];break}var p=w-_,u=Math.random()*p+_|0,y=T[E*u+h],f=Math.random()*p+_|0,P=T[E*f+h],L=Math.random()*p+_|0,z=T[E*L+h];y<=P?z>=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<E;++F,++O,++I){var B=T[O];T[O]=T[I],T[I]=B}var N=l[w-1];l[w-1]=l[g],l[g]=N,g=a(c,h,_,w-1,T,l,b);for(var O=E*(w-1),I=E*g,F=0;F<E;++F,++O,++I){var B=T[O];T[O]=T[I],T[I]=B}var N=l[w-1];if(l[w-1]=l[g],l[g]=N,S<g){for(w=g-1;_<w&&T[E*(w-1)+h]===b;)w-=1;w+=1}else if(g<S)for(_=g+1;_<w&&T[E*_+h]===b;)_+=1;else break}return a(c,h,m,S,T,l,T[E*S+h])}},8105:function(e){"use strict";e.exports=r;var t={"lo===p0":i,"lo<p0":a,"lo<=p0":n,"hi<=p0":o,"lo<p0&&p0<=hi":c,"lo<=p0&&p0<=hi":s,"!(lo>=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(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 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(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 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(p<S)break;if(p===S&&u<E)break;l[b]=p,l[b+1]=u,b-=2}l[b]=S,l[b+1]=E}}function a(d,T,l){d*=2,T*=2;var _=l[d],w=l[d+1];l[d]=l[T],l[d+1]=l[T+1],l[T]=_,l[T+1]=w}function n(d,T,l){d*=2,T*=2,l[d]=l[T],l[d+1]=l[T+1]}function o(d,T,l,_){d*=2,T*=2,l*=2;var w=_[d],S=_[d+1];_[d]=_[T],_[d+1]=_[T+1],_[T]=_[l],_[T+1]=_[l+1],_[l]=w,_[l+1]=S}function s(d,T,l,_,w){d*=2,T*=2,w[d]=w[T],w[T]=l,w[d+1]=w[T+1],w[T+1]=_}function c(d,T,l){d*=2,T*=2;var _=l[d],w=l[T];return _<w?!1:_===w?l[d+1]>l[T+1]:!0}function h(d,T,l,_){d*=2;var w=_[d];return w<T?!0:w===T?_[d+1]<l:!1}function m(d,T,l){var _=(T-d+1)/6|0,w=d+_,S=T-_,E=d+T>>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<oe)break;continue}s(d,L-1,B,O,l),s(T,z+1,I,N,l),L-2-d<=t?i(d,L-2,l):m(d,L-2,l),T-(z+2)<=t?i(z+2,T,l):m(z+2,T,l),z-L<=t?i(L,z,l):m(L,z,l)}},855:function(e,t,r){"use strict";e.exports={init:w,sweepBipartite:g,sweepComplete:b,scanBipartite:p,scanComplete:u};var i=r(1888),a=r(8828),n=r(4192),o=1<<28,s=1024,c=i.mallocInt32(s),h=i.mallocInt32(s),m=i.mallocInt32(s),d=i.mallocInt32(s),T=i.mallocInt32(s),l=i.mallocInt32(s),_=i.mallocDouble(s*8);function w(y){var f=a.nextPow2(y);c.length<f&&(i.free(c),c=i.mallocInt32(f)),h.length<f&&(i.free(h),h=i.mallocInt32(f)),m.length<f&&(i.free(m),m=i.mallocInt32(f)),d.length<f&&(i.free(d),d=i.mallocInt32(f)),T.length<f&&(i.free(T),T=i.mallocInt32(f)),l.length<f&&(i.free(l),l=i.mallocInt32(f));var P=8*f;_.length<P&&(i.free(_),_=i.mallocDouble(P))}function S(y,f,P,L){var z=f[L],F=y[P-1];y[z]=F,f[F]=z}function E(y,f,P,L){y[P]=L,f[L]=P}function g(y,f,P,L,z,F,B,O,I,N){for(var U=0,W=2*y,Q=y-1,ue=W-1,se=P;se<L;++se){var he=F[se],H=W*se;_[U++]=z[H+Q],_[U++]=-(he+1),_[U++]=z[H+ue],_[U++]=he}for(var se=B;se<O;++se){var he=N[se]+o,$=W*se;_[U++]=I[$+Q],_[U++]=-he,_[U++]=I[$+ue],_[U++]=he}var J=U>>>1;n(_,J);for(var X=0,oe=0,se=0;se<J;++se){var ne=_[2*se+1]|0;if(ne>=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<X;++j){var ee=f(c[j],ne);if(ee!==void 0)return ee}E(m,d,oe++,ne)}else{ne=-ne-1|0;for(var j=0;j<oe;++j){var ee=f(ne,m[j]);if(ee!==void 0)return ee}E(c,h,X++,ne)}}}function b(y,f,P,L,z,F,B,O,I,N){for(var U=0,W=2*y,Q=y-1,ue=W-1,se=P;se<L;++se){var he=F[se]+1<<1,H=W*se;_[U++]=z[H+Q],_[U++]=-he,_[U++]=z[H+ue],_[U++]=he}for(var se=B;se<O;++se){var he=N[se]+1<<1,$=W*se;_[U++]=I[$+Q],_[U++]=-he|1,_[U++]=I[$+ue],_[U++]=he|1}var J=U>>>1;n(_,J);for(var X=0,oe=0,ne=0,se=0;se<J;++se){var j=_[2*se+1]|0,ee=j&1;if(se<J-1&&j>>1===_[2*se+3]>>1&&(ee=2,se+=1),j<0){for(var re=-(j>>1)-1,ce=0;ce<ne;++ce){var be=f(T[ce],re);if(be!==void 0)return be}if(ee!==0)for(var ce=0;ce<X;++ce){var be=f(c[ce],re);if(be!==void 0)return be}if(ee!==1)for(var ce=0;ce<oe;++ce){var be=f(m[ce],re);if(be!==void 0)return be}ee===0?E(c,h,X++,re):ee===1?E(m,d,oe++,re):ee===2&&E(T,l,ne++,re)}else{var re=(j>>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<F;++J){var X=J+H,oe=ue*J;_[Q++]=B[oe+se],_[Q++]=-X,_[Q++]=B[oe+he],_[Q++]=X}for(var J=I;J<N;++J){var X=J+$,ne=ue*J;_[Q++]=U[ne+se],_[Q++]=-X}var j=Q>>>1;n(_,j);for(var ee=0,J=0;J<j;++J){var re=_[2*J+1]|0;if(re<0){var X=-re,ce=!1;if(X>=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<ee;++We){var it=c[We],ot=ue*it;if(!(Re<B[ot+f+1]||B[ot+f+1+y]<ze)){for(var tt=f+2;tt<y;++tt)if(U[Ae+tt+y]<B[ot+tt]||B[ot+tt+y]<U[Ae+tt])continue e;var ut=O[it],Me;if(L?Me=P(be,ut):Me=P(ut,be),Me!==void 0)return Me}}}}else S(c,h,ee--,re-H)}}function u(y,f,P,L,z,F,B,O,I,N,U){for(var W=0,Q=2*y,ue=f,se=f+y,he=L;he<z;++he){var H=he+o,$=Q*he;_[W++]=F[$+ue],_[W++]=-H,_[W++]=F[$+se],_[W++]=H}for(var he=O;he<I;++he){var H=he+1,J=Q*he;_[W++]=N[J+ue],_[W++]=-H}var X=W>>>1;n(_,X);for(var oe=0,he=0;he<X;++he){var ne=_[2*he+1]|0;if(ne<0){var H=-ne;if(H>=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<oe;++be){var Ae=c[be],ze=B[Ae];if(ze===j)break;var Re=Q*Ae;if(!(ce<F[Re+f+1]||F[Re+f+1+y]<re)){for(var We=f+2;We<y;++We)if(N[ee+We+y]<F[Re+We]||F[Re+We+y]<N[ee+We])continue e;var it=P(ze,j);if(it!==void 0)return it}}}}else{for(var H=ne-o,be=oe-1;be>=0;--be)if(c[be]===H){for(var We=be+1;We<oe;++We)c[We-1]=c[We];break}--oe}}}},2538:function(e,t,r){"use strict";var i=r(8902),a=r(5542),n=r(2272),o=r(5023);e.exports=d;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function c(T,l){return T[0]-l[0]||T[1]-l[1]}function h(T){return T.map(s).sort(c)}function m(T,l,_){return l in T?T[l]:_}function d(T,l,_){Array.isArray(l)?(_=_||{},l=l||[]):(_=l||{},l=[]);var w=!!m(_,"delaunay",!0),S=!!m(_,"interior",!0),E=!!m(_,"exterior",!0),g=!!m(_,"infinity",!1);if(!S&&!E||T.length===0)return[];var b=i(T,l);if(w||S!==E||g){for(var p=a(T.length,h(l)),u=0;u<b.length;++u){var y=b[u];p.addTriangle(y[0],y[1],y[2])}return w&&n(T,p),E?S?g?o(p,0,g):p.cells():o(p,1,g):o(p,-1)}else return b}},2272:function(e,t,r){"use strict";var i=r(2646)[4],a=r(2478);e.exports=o;function n(s,c,h,m,d,T){var l=c.opposite(m,d);if(!(l<0)){if(d<m){var _=m;m=d,d=_,_=T,T=l,l=_}c.isConstraint(m,d)||i(s[m],s[d],s[T],s[l])<0&&h.push(m,d)}}function o(s,c){for(var h=[],m=s.length,d=c.stars,T=0;T<m;++T)for(var l=d[T],_=1;_<l.length;_+=2){var w=l[_];if(!(w<T)&&!c.isConstraint(T,w)){for(var S=l[_-1],E=-1,g=1;g<l.length;g+=2)if(l[g-1]===w){E=l[g];break}E<0||i(s[T],s[w],s[S],s[E])<0&&h.push(T,w)}}for(;h.length>0;){for(var w=h.pop(),T=h.pop(),S=-1,E=-1,l=d[T],b=1;b<l.length;b+=2){var p=l[b-1],u=l[b];p===w?E=u:u===w&&(S=p)}S<0||E<0||i(s[T],s[w],s[S],s[E])>=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 T<l?T<d&&(_=T,w=l,S=d):l<d&&(_=l,w=d,S=T),_<0?-1:(m[0]=_,m[1]=w,m[2]=S,i.eq(this.cells,m,o))}}();function s(m,d){for(var T=m.cells(),l=T.length,_=0;_<l;++_){var w=T[_],S=w[0],E=w[1],g=w[2];E<g?E<S&&(w[0]=E,w[1]=g,w[2]=S):g<S&&(w[0]=g,w[1]=S,w[2]=E)}T.sort(o);for(var b=new Array(l),_=0;_<b.length;++_)b[_]=0;var p=[],u=[],y=new Array(3*l),f=new Array(3*l),P=null;d&&(P=[]);for(var L=new a(T,y,f,b,p,u,P),_=0;_<l;++_)for(var w=T[_],z=0;z<3;++z){var S=w[z],E=w[(z+1)%3],F=y[3*_+z]=L.locate(E,S,m.opposite(E,S)),B=f[3*_+z]=m.isConstraint(S,E);F<0&&(B?u.push(_):(p.push(_),b[_]=1),d&&P.push([E,S,-1]))}return L}function c(m,d,T){for(var l=0,_=0;_<m.length;++_)d[_]===T&&(m[l++]=m[_]);return m.length=l,m}function h(m,d,T){var l=s(m,T);if(d===0)return T?l.cells.concat(l.boundary):l.cells;for(var _=1,w=l.active,S=l.next,E=l.flags,g=l.cells,b=l.constraint,p=l.neighbor;w.length>0||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;P<f;++P){for(var L=g[P],z=L.lowerIds,B=z.length;B>1&&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]<g.a[0]?b=a(E.a,E.b,g.a):b=a(g.b,g.a,E.a),b||(g.b[0]<E.b[0]?b=a(E.a,E.b,g.b):b=a(g.b,g.a,E.b),b||E.idx-g.idx)}function _(E,g,b){var p=i.le(E,b,l),u=E[p],y=u.upperIds,f=y[y.length-1];u.upperIds=[f],E.splice(p+1,0,new c(b.a,b.b,b.idx,[f],y))}function w(E,g,b){var p=b.a;b.a=b.b,b.b=p;var u=i.eq(E,b,l),y=E[u],f=E[u-1];f.upperIds=y.upperIds,E.splice(u,1)}function S(E,g){for(var b=E.length,p=g.length,u=[],y=0;y<b;++y)u.push(new h(E[y],null,n,y));for(var y=0;y<p;++y){var f=g[y],P=E[f[0]],L=E[f[1]];P[0]<L[0]?u.push(new h(P,L,s,y),new h(L,P,o,y)):P[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<O;++y){var I=u[y],N=I.type;N===n?T(B,F,E,I.a,I.idx):N===s?_(F,E,I):w(F,E,I)}return B}},5542:function(e,t,r){"use strict";var i=r(2478);e.exports=s;function a(c,h){this.stars=c,this.edges=h}var n=a.prototype;function o(c,h,m){for(var d=1,T=c.length;d<T;d+=2)if(c[d-1]===h&&c[d]===m){c[d-1]=c[T-2],c[d]=c[T-1],c.length=T-2;return}}n.isConstraint=function(){var c=[0,0];function h(m,d){return m[0]-d[0]||m[1]-d[1]}return function(m,d){return c[0]=Math.min(m,d),c[1]=Math.max(m,d),i.eq(this.edges,c,h)>=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<T;d+=2)if(m[d]===c)return m[d-1];return-1},n.flip=function(c,h){var m=this.opposite(c,h),d=this.opposite(h,c);this.removeTriangle(c,h,m),this.removeTriangle(h,c,d),this.addTriangle(c,d,m),this.addTriangle(h,m,d)},n.edges=function(){for(var c=this.stars,h=[],m=0,d=c.length;m<d;++m)for(var T=c[m],l=0,_=T.length;l<_;l+=2)h.push([T[l],T[l+1]]);return h},n.cells=function(){for(var c=this.stars,h=[],m=0,d=c.length;m<d;++m)for(var T=c[m],l=0,_=T.length;l<_;l+=2){var w=T[l],S=T[l+1];m<Math.min(w,S)&&h.push([m,w,S])}return h};function s(c,h){for(var m=new Array(c),d=0;d<c;++d)m[d]=[];return new a(m,h)}},2419:function(e){"use strict";e.exports=t;function t(r){for(var i=1,a=1;a<r.length;++a)for(var n=0;n<a;++n)if(r[a]<r[n])i=-i;else if(r[n]===r[a])return 0;return i}},3628:function(e,t,r){"use strict";var i=r(1338),a=r(727);function n(c,h){for(var m=0,d=c.length,T=0;T<d;++T)m+=c[T]*h[T];return m}function o(c){var h=c.length;if(h===0)return[];var m=c[0].length,d=i([c.length+1,c.length+1],1),T=i([c.length+1],1);d[h][h]=0;for(var l=0;l<h;++l){for(var _=0;_<=l;++_)d[_][l]=d[l][_]=2*n(c[l],c[_]);T[l]=n(c[l],c[l])}for(var w=a(d,T),S=0,E=w[h+1],l=0;l<E.length;++l)S+=E[l];for(var g=new Array(h),l=0;l<h;++l){for(var E=w[l],b=0,_=0;_<E.length;++_)b+=E[_];g[l]=b/S}return g}function s(c){if(c.length===0)return[];for(var h=c[0].length,m=i([h]),d=o(c),T=0;T<c.length;++T)for(var l=0;l<h;++l)m[l]+=c[T][l]*d[T];return m}s.barycenetric=o,e.exports=s},6037:function(e,t,r){e.exports=a;var i=r(3628);function a(n){for(var o=i(n),s=0,c=0;c<n.length;++c)for(var h=n[c],m=0;m<o.length;++m)s+=Math.pow(h[m]-o[m],2);return Math.sqrt(s/n.length)}},332:function(e,t,r){"use strict";e.exports=P;var i=r(1755),a=r(6867),n=r(1125),o=r(7842),s=r(1318),c=r(946),h=r(5838),m=r(1278),d=r(3637);function T(L){var z=c(L);return[m(z,-1/0),m(z,1/0)]}function l(L,z){for(var F=new Array(z.length),B=0;B<z.length;++B){var O=z[B],I=L[O[0]],N=L[O[1]];F[B]=[m(Math.min(I[0],N[0]),-1/0),m(Math.min(I[1],N[1]),-1/0),m(Math.max(I[0],N[0]),1/0),m(Math.max(I[1],N[1]),1/0)]}return F}function _(L){for(var z=new Array(L.length),F=0;F<L.length;++F){var B=L[F];z[F]=[m(B[0],-1/0),m(B[1],-1/0),m(B[0],1/0),m(B[1],1/0)]}return z}function w(L,z,F){var B=[];return a(F,function(O,I){var N=z[O],U=z[I];if(!(N[0]===U[0]||N[0]===U[1]||N[1]===U[0]||N[1]===U[1])){var W=L[N[0]],Q=L[N[1]],ue=L[U[0]],se=L[U[1]];n(W,Q,ue,se)&&B.push([O,I])}}),B}function S(L,z,F,B){var O=[];return a(F,B,function(I,N){var U=z[I];if(!(U[0]===N||U[1]===N)){var W=L[N],Q=L[U[0]],ue=L[U[1]];n(Q,ue,W,W)&&O.push([I,N])}}),O}function E(L,z,F,B,O){var I,N,U=L.map(function(Ae){return[o(Ae[0]),o(Ae[1])]});for(I=0;I<F.length;++I){var W=F[I];N=W[0];var Q=W[1],ue=z[N],se=z[Q],he=d(h(L[ue[0]]),h(L[ue[1]]),h(L[se[0]]),h(L[se[1]]));if(he){var H=L.length;L.push([c(he[0]),c(he[1])]),U.push(he),B.push([N,H],[Q,H])}}for(B.sort(function(Ae,ze){if(Ae[0]!==ze[0])return Ae[0]-ze[0];var Re=U[Ae[1]],We=U[ze[1]];return s(Re[0],We[0])||s(Re[1],We[1])}),I=B.length-1;I>=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;N<z.length;++N){var U=z[N],W=T(U[0]),Q=T(U[1]);I.push([m(W[0],-1/0),m(Q[0],-1/0),m(W[1],1/0),m(Q[1],1/0)])}a(I,function($,J){O.link($,J)});for(var ue=!0,se=new Array(B),N=0;N<B;++N){var he=O.find(N);he!==N&&(ue=!1,L[he]=[Math.min(L[N][0],L[he][0]),Math.min(L[N][1],L[he][1])])}if(ue)return null;for(var H=0,N=0;N<B;++N){var he=O.find(N);he===N?(se[N]=H,L[H++]=L[N]):se[N]=-1}L.length=H;for(var N=0;N<B;++N)se[N]<0&&(se[N]=se[O.find(N)]);return se}function b(L,z){return L[0]-z[0]||L[1]-z[1]}function p(L,z){var F=L[0]-z[0]||L[1]-z[1];return F||(L[2]<z[2]?-1:L[2]>z[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var B=0;B<L.length;++B){var O=L[B],I=z[O[0]],N=z[O[1]];O[0]=Math.min(I,N),O[1]=Math.max(I,N)}else for(var B=0;B<L.length;++B){var O=L[B],I=O[0],N=O[1];O[0]=Math.min(I,N),O[1]=Math.max(I,N)}F?L.sort(p):L.sort(b);for(var U=1,B=1;B<L.length;++B){var W=L[B-1],Q=L[B];Q[0]===W[0]&&Q[1]===W[1]&&(!F||Q[2]===W[2])||(L[U++]=Q)}L.length=U}}function y(L,z,F){var B=g(L,[],_(L));return u(z,B,F),!!B}function f(L,z,F){var B=l(L,z),O=w(L,z,B),I=_(L),N=S(L,z,B,I),U=E(L,z,O,N,F),W=g(L,U,I);return u(z,W,F),W?!0:O.length>0||N.length>0}function P(L,z,F){var B;if(F){B=z;for(var O=new Array(z.length),I=0;I<z.length;++I){var N=z[I];O[I]=[N[0],N[1],F[I]]}z=O}for(var U=y(L,z,!!F);f(L,z,!!F);)U=!0;if(F&&U){B.length=0,F.length=0;for(var I=0;I<z.length;++I){var N=z[I];B.push([N[0],N[1]]),F.push(N[2])}}return U}},3637:function(e,t,r){"use strict";e.exports=d;var i=r(6504),a=r(8697),n=r(5572),o=r(7721),s=r(544),c=r(2653),h=r(8987);function m(T,l){return n(i(T[0],l[1]),i(T[1],l[0]))}function d(T,l,_,w){var S=s(l,T),E=s(w,_),g=m(S,E);if(o(g)===0)return null;var b=s(T,_),p=m(E,b),u=a(p,g),y=h(S,u),f=c(T,y);return f}},3642:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,r){"use strict";var i=r(3642),a=r(395);e.exports=n;function n(h){var m,d,T,l,_,w,S,E,u,g,b;if(h||(h={}),E=(h.nshades||72)-1,S=h.format||"hex",w=h.colormap,w||(w="jet"),typeof w=="string"){if(w=w.toLowerCase(),!i[w])throw Error(w+" not a supported colorscale");_=i[w]}else if(Array.isArray(w))_=w.slice();else throw Error("unsupported colormap option",w);if(_.length>E+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<m.length-1;++b){l=m[b+1]-m[b],d=p[b],T=p[b+1];for(var y=0;y<l;y++){var f=y/l;u.push([Math.round(a(d[0],T[0],f)),Math.round(a(d[1],T[1],f)),Math.round(a(d[2],T[2],f)),a(d[3],T[3],f)])}}return u.push(_[_.length-1].rgb.concat(g[1])),S==="hex"?u=u.map(s):S==="rgbaString"?u=u.map(c):S==="float"&&(u=u.map(o)),u}function o(h){return[h[0]/255,h[1]/255,h[2]/255,h[3]]}function s(h){for(var m,d="#",T=0;T<3;++T)m=h[T],m=m.toString(16),d+=("00"+m).substr(m.length);return d}function c(h){return"rgba("+h.join(",")+")"}},3140:function(e,t,r){"use strict";e.exports=h;var i=r(3250),a=r(8572),n=r(9362),o=r(5382),s=r(8210);function c(m,d,T){var l=n(m[0],-d[0]),_=n(m[1],-d[1]),w=n(T[0],-d[0]),S=n(T[1],-d[1]),E=s(o(l,w),o(_,S));return E[E.length-1]>=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;y<o;++y)if(s=p[y]-u[y],s)return s;return 0}}},3788:function(e,t,r){"use strict";var i=r(8507),a=r(2419);e.exports=n;function n(o,s){return i(o,s)||a(o)-a(s)}},7352:function(e,t,r){"use strict";var i=r(5721),a=r(4750),n=r(2690);e.exports=o;function o(s){var c=s.length;if(c===0)return[];if(c===1)return[[0]];var h=s[0].length;return h===0?[]:h===1?i(s):h===2?a(s):n(s,h)}},5721:function(e){"use strict";e.exports=t;function t(r){for(var i=0,a=0,n=1;n<r.length;++n)r[n][0]<r[i][0]&&(i=n),r[n][0]>r[a][0]&&(a=n);return i<a?[[i],[a]]:i>a?[[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<s;++m){var d=o[m];c[m]=[h,d],h=d}return c}},2690:function(e,t,r){"use strict";e.exports=s;var i=r(8954),a=r(3952);function n(c,h){for(var m=c.length,d=new Array(m),T=0;T<h.length;++T)d[T]=c[h[T]];for(var l=h.length,T=0;T<m;++T)h.indexOf(T)<0&&(d[l++]=c[T]);return d}function o(c,h){for(var m=c.length,d=h.length,T=0;T<m;++T)for(var l=c[T],_=0;_<l.length;++_){var w=l[_];if(w<d)l[_]=h[w];else{w=w-d;for(var S=0;S<d;++S)w>=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;_<l;++_){var w=T[_]-d[_];if(w)return w}return 0}function s(h,m,d){if(h===1)return d?[[-1,0]]:[];var T=m.map(function(E,g){return[E[0],g]});T.sort(function(E,g){return E[0]-g[0]});for(var l=new Array(h-1),_=1;_<h;++_){var w=T[_-1],S=T[_];l[_-1]=[w[1],S[1]]}return d&&l.push([-1,l[0][1]],[l[h-1][1],-1]),l}function c(h,m){var d=h.length;if(d===0)return[];var T=h[0].length;if(T<1)return[];if(T===1)return s(d,h,m);for(var l=new Array(d),_=1,w=0;w<d;++w){for(var S=h[w],E=new Array(T+1),g=0,b=0;b<T;++b){var p=S[b];E[b]=p,g+=p*p}E[T]=g,l[w]=new n(E,w),_=Math.max(g,_)}a(l,o),d=l.length;for(var u=new Array(d+T+1),y=new Array(d+T+1),f=(T+1)*(T+1)*_,P=new Array(T+1),w=0;w<=T;++w)P[w]=0;P[T]=f,u[0]=P.slice(),y[0]=-1;for(var w=0;w<=T;++w){var E=P.slice();E[w]=1,u[w+1]=E,y[w+1]=-1}for(var w=0;w<d;++w){var L=l[w];u[w+T+1]=L.point,y[w+T+1]=L.index}var z=i(u,!1);if(m?z=z.filter(function(F){for(var B=0,O=0;O<=T;++O){var I=y[F[O]];if(I<0&&++B>=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<z.length;++w){var L=z[w],E=L[0];L[0]=L[1],L[1]=E}return z}},2361:function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),i=new Uint32Array(r.buffer);if(r[0]=1,t=!0,i[1]===1072693248){let _=function(E,g){return i[0]=E,i[1]=g,r[0]},w=function(E){return r[0]=E,i[0]},S=function(E){return r[0]=E,i[1]};var a=_,n=w,o=S;e.exports=function(g){return r[0]=g,[i[0],i[1]]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}else if(i[0]===1072693248){let _=function(E,g){return i[1]=E,i[0]=g,r[0]},w=function(E){return r[0]=E,i[1]},S=function(E){return r[0]=E,i[0]};var s=_,c=w,h=S;e.exports=function(g){return r[0]=g,[i[1],i[0]]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}else t=!1}if(!t){let _=function(E,g){return l.writeUInt32LE(E,0,!0),l.writeUInt32LE(g,4,!0),l.readDoubleLE(0,!0)},w=function(E){return l.writeDoubleLE(E,0,!0),l.readUInt32LE(0,!0)},S=function(E){return l.writeDoubleLE(E,0,!0),l.readUInt32LE(4,!0)};var m=_,d=w,T=S,l=new Buffer(8);e.exports=function(g){return l.writeDoubleLE(g,0,!0),[l.readUInt32LE(0,!0),l.readUInt32LE(4,!0)]},e.exports.pack=_,e.exports.lo=w,e.exports.hi=S}e.exports.sign=function(_){return e.exports.hi(_)>>>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<s;++h)c[h]=n;else for(h=0;h<s;++h)c[h]=t(a,n,o+1);return c}function r(a,n){var o,s;for(o=new Array(a),s=0;s<a;++s)o[s]=n;return o}function i(a,n){switch(typeof n>"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<s;++c){var h=n[c];o=Math.max(o,h[0],h[1])}o=(o|0)+1}o=o|0;for(var m=new Array(o),c=0;c<o;++c)m[c]=[];for(var c=0;c<s;++c){var h=n[c];m[h[0]].push(h[1]),m[h[1]].push(h[0])}for(var d=0;d<o;++d)i(m[d],function(T,l){return T-l});return m}},5033:function(e){"use strict";e.exports=t;function t(r,i,a){var n=i||0,o=a||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[n*r[12]+r[8],n*r[13]+r[9],n*r[14]+r[10],n*r[15]+r[11]],[o*r[12]-r[8],o*r[13]-r[9],o*r[14]-r[10],o*r[15]-r[11]]]}},9215:function(e,t,r){"use strict";e.exports=h;var i=r(4769),a=r(2478);function n(m,d,T){return Math.min(d,Math.max(m,T))}function o(m,d,T){this.dimension=m.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l<this.dimension;++l)this.bounds[0][l]=-1/0,this.bounds[1][l]=1/0;this._state=m.slice().reverse(),this._velocity=d.slice().reverse(),this._time=[T],this._scratch=[m.slice(),m.slice(),m.slice(),m.slice(),m.slice()]}var s=o.prototype;s.flush=function(m){var d=a.gt(this._time,m)-1;d<=0||(this._time.splice(0,d),this._state.splice(0,d*this.dimension),this._velocity.splice(0,d*this.dimension))},s.curve=function(m){var d=this._time,T=d.length,l=a.le(d,m),_=this._scratch[0],w=this._state,S=this._velocity,E=this.dimension,g=this.bounds;if(l<0)for(var b=E-1,p=0;p<E;++p,--b)_[p]=w[b];else if(l>=T-1)for(var b=w.length-1,u=m-d[T-1],p=0;p<E;++p,--b)_[p]=w[b]+u*S[b];else{for(var b=E*(l+1)-1,y=d[l],f=d[l+1],P=f-y||1,L=this._scratch[1],z=this._scratch[2],F=this._scratch[3],B=this._scratch[4],O=!0,p=0;p<E;++p,--b)L[p]=w[b],F[p]=S[b]*P,z[p]=w[b+E],B[p]=S[b+E]*P,O=O&&L[p]===z[p]&&F[p]===B[p]&&F[p]===0;if(O)for(var p=0;p<E;++p)_[p]=L[p];else i(L,F,z,B,(m-y)/P,_)}for(var I=g[0],N=g[1],p=0;p<E;++p)_[p]=n(I[p],N[p],_[p]);return _},s.dcurve=function(m){var d=this._time,T=d.length,l=a.le(d,m),_=this._scratch[0],w=this._state,S=this._velocity,E=this.dimension;if(l>=T-1)for(var g=w.length-1,b=m-d[T-1],p=0;p<E;++p,--g)_[p]=S[g];else{for(var g=E*(l+1)-1,u=d[l],y=d[l+1],f=y-u||1,P=this._scratch[1],L=this._scratch[2],z=this._scratch[3],F=this._scratch[4],B=!0,p=0;p<E;++p,--g)P[p]=w[g],z[p]=S[g]*f,L[p]=w[g+E],F[p]=S[g+E]*f,B=B&&P[p]===L[p]&&z[p]===F[p]&&z[p]===0;if(B)for(var p=0;p<E;++p)_[p]=0;else{i.derivative(P,z,L,F,(m-u)/f,_);for(var p=0;p<E;++p)_[p]/=f}}return _},s.lastT=function(){var m=this._time;return m[m.length-1]},s.stable=function(){for(var m=this._velocity,d=m.length,T=this.dimension-1;T>=0;--T)if(m[--d])return!1;return!0},s.jump=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];this._time.push(d,m);for(var b=0;b<2;++b)for(var p=0;p<T;++p)l.push(l[w++]),_.push(0);this._time.push(m);for(var p=T;p>0;--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(!(m<d||arguments.length!==T+1)){var l=this._state,_=this._velocity,w=l.length-this.dimension,S=m-d,E=this.bounds,g=E[0],b=E[1],p=S>1e-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(!(m<this.lastT()||arguments.length!==d+1)){var T=this._state,l=this._velocity,_=this.bounds,w=_[0],S=_[1];this._time.push(m);for(var E=d;E>0;--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<d)){var T=this.dimension,l=this._state,_=this._velocity,w=l.length-T,S=this.bounds,E=S[0],g=S[1],b=m-d;this._time.push(m);for(var p=T-1;p>=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<m;++T)d[T]=0;return d}function h(m,d,T){switch(arguments.length){case 0:return new o([0],[0],0);case 1:if(typeof m=="number"){var l=c(m);return new o(l,l,0)}else return new o(m,c(m.length),0);case 2:if(typeof d=="number"){var l=c(m.length);return new o(m,l,+d)}else T=0;case 3:if(m.length!==d.length)throw new Error("state and velocity lengths must match");return new o(m,d,T)}}},3840:function(e){"use strict";e.exports=E;var t=0,r=1;function i(g,b,p,u,y,f){this._color=g,this.key=b,this.value=p,this.left=u,this.right=y,this._count=f}function a(g){return new i(g._color,g.key,g.value,g.left,g.right,g._count)}function n(g,b){return new i(g,b.key,b.value,b.left,b.right,b._count)}function o(g){g._count=1+(g.left?g.left._count:0)+(g.right?g.right._count:0)}function s(g,b){this._compare=g,this.root=b}var c=s.prototype;Object.defineProperty(c,"keys",{get:function(){var g=[];return this.forEach(function(b,p){g.push(b)}),g}}),Object.defineProperty(c,"values",{get:function(){var g=[];return this.forEach(function(b,p){g.push(p)}),g}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(g,b){for(var p=this._compare,u=this.root,y=[],f=[];u;){var P=p(g,u.key);y.push(u),f.push(P),P<=0?u=u.left:u=u.right}y.push(new i(t,g,b,null,null,1));for(var L=y.length-2;L>=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.left._count){b=b.left;continue}g-=b.left._count}if(!g)return new T(this,p);if(g-=1,b.right){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+1<g.length?g[f+1]=b:g.push(b),f=f+2}}else{if(u=p.left,u.left&&u.left._color===t){if(u=p.left=a(u),y=u.left=a(u.left),p.left=u.right,u.right=p,u.left=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.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<g.length?g[f+1]=b:g.push(b),f=f+2}}}}l.remove=function(){var g=this._stack;if(g.length===0)return this.tree;var b=new Array(g.length),p=g[g.length-1];b[b.length-1]=new i(p._color,p.key,p.value,p.left,p.right,p._count);for(var u=g.length-2;u>=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;u<b.length;++u)b[u]._count--;return new s(this.tree._compare,b[0])}else if(p.left||p.right){p.left?_(p,p.left):p.right&&_(p,p.right),p._color=r;for(var u=0;u<b.length-1;++u)b[u]._count--;return new s(this.tree._compare,b[0])}else{if(b.length===1)return new s(this.tree._compare,null);for(var u=0;u<b.length;++u)b[u]._count--;var L=b[b.length-2];w(b),L.left===p?L.left=null:L.right=null}return new s(this.tree._compare,b[0])},Object.defineProperty(l,"key",{get:function(){if(this._stack.length>0)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 g<b?-1:g>b?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<<se&&(he=W,H=N,$=Q,J=U),he[se]=B[0][se],H[se]=B[1][se],I[se]>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;p<l.length;++p)if(b=n.positive(b,l[p]),b.length<3)return 0;for(var u=b[0],y=u[0]/u[3],f=u[1]/u[3],P=0,p=1;p+1<b.length;++p){var L=b[p],z=b[p+1],F=L[0]/L[3],B=L[1]/L[3],O=z[0]/z[3],I=z[1]/z[3],N=F-y,U=B-f,W=O-y,Q=I-f;P+=Math.abs(N*Q-U*W)}return P}var w=[1,1,1],S=[0,0,0],E={cubeEdges:w,axis:S};function g(b,p,u,y,f){a(s,p,b),a(s,u,s);for(var P=0,L=0;L<2;++L){m[2]=y[L][2];for(var z=0;z<2;++z){m[1]=y[z][1];for(var F=0;F<2;++F)m[0]=y[F][0],T(c[P],m,s),P+=1}}for(var B=-1,L=0;L<8;++L){for(var O=c[L][3],I=0;I<3;++I)h[L][I]=c[L][I]/O;f&&(h[L][2]*=-1),O<0&&(B<0||h[L][2]<h[B][2])&&(B=L)}if(B<0){B=0;for(var N=0;N<3;++N){for(var U=(N+2)%3,W=(N+1)%3,Q=-1,ue=-1,se=0;se<2;++se){var he=se<<N,H=he+(se<<U)+(1-se<<W),$=he+(1-se<<U)+(se<<W);o(h[he],h[H],h[$],d)<0||(se?Q=1:ue=1)}if(Q<0||ue<0){ue>Q&&(B|=1<<N);continue}for(var se=0;se<2;++se){var he=se<<N,H=he+(se<<U)+(1-se<<W),$=he+(1-se<<U)+(se<<W),J=_([c[he],c[H],c[$],c[he+(1<<U)+(1<<W)]]);se?Q=J:ue=J}if(ue>Q){B|=1<<N;continue}}}for(var X=7^B,oe=-1,L=0;L<8;++L)L===B||L===X||(oe<0||h[oe][1]>h[L][1])&&(oe=L);for(var ne=-1,L=0;L<3;++L){var j=oe^1<<L;if(!(j===B||j===X)){ne<0&&(ne=j);var W=h[j];W[0]<h[ne][0]&&(ne=j)}}for(var ee=-1,L=0;L<3;++L){var j=oe^1<<L;if(!(j===B||j===X||j===ne)){ee<0&&(ee=j);var W=h[j];W[0]>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<<N?be[N]=-1:be[N]=1;return E}},501:function(e,t,r){"use strict";e.exports=w;var i=r(2762),a=r(8116),n=r(1879).n,o=[0,0,0],s=[0,0,0],c=[0,0,0],h=[0,0,0],m=[1,1];function d(S){return S[0]=S[1]=S[2]=0,S}function T(S,E){return S[0]=E[0],S[1]=E[1],S[2]=E[2],S}function l(S,E,g,b,p,u,y,f){this.gl=S,this.vertBuffer=E,this.vao=g,this.shader=b,this.tickCount=p,this.tickOffset=u,this.gridCount=y,this.gridOffset=f}var _=l.prototype;_.bind=function(S,E,g){this.shader.bind(),this.shader.uniforms.model=S,this.shader.uniforms.view=E,this.shader.uniforms.projection=g,m[0]=this.gl.drawingBufferWidth,m[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=m,this.vao.bind()},_.unbind=function(){this.vao.unbind()},_.drawAxisLine=function(S,E,g,b,p){var u=d(s);this.shader.uniforms.majorAxis=s,u[S]=E[1][S]-E[0][S],this.shader.uniforms.minorAxis=u;var y=T(h,g);y[S]+=E[0][S],this.shader.uniforms.offset=y,this.shader.uniforms.lineWidth=p,this.shader.uniforms.color=b;var f=d(c);f[(S+2)%3]=1,this.shader.uniforms.screenAxis=f,this.vao.draw(this.gl.TRIANGLES,6);var f=d(c);f[(S+1)%3]=1,this.shader.uniforms.screenAxis=f,this.vao.draw(this.gl.TRIANGLES,6)},_.drawAxisTicks=function(S,E,g,b,p){if(this.tickCount[S]){var u=d(o);u[S]=1,this.shader.uniforms.majorAxis=u,this.shader.uniforms.offset=E,this.shader.uniforms.minorAxis=g,this.shader.uniforms.color=b,this.shader.uniforms.lineWidth=p;var y=d(c);y[S]=1,this.shader.uniforms.screenAxis=y,this.vao.draw(this.gl.TRIANGLES,this.tickCount[S],this.tickOffset[S])}},_.drawGrid=function(S,E,g,b,p,u){if(this.gridCount[S]){var y=d(s);y[E]=g[1][E]-g[0][E],this.shader.uniforms.minorAxis=y;var f=T(h,b);f[E]+=g[0][E],this.shader.uniforms.offset=f;var P=d(o);P[S]=1,this.shader.uniforms.majorAxis=P;var L=d(c);L[S]=1,this.shader.uniforms.screenAxis=L,this.shader.uniforms.lineWidth=u,this.shader.uniforms.color=p,this.vao.draw(this.gl.TRIANGLES,this.gridCount[S],this.gridOffset[S])}},_.drawZero=function(S,E,g,b,p,u){var y=d(s);this.shader.uniforms.majorAxis=y,y[S]=g[1][S]-g[0][S],this.shader.uniforms.minorAxis=y;var f=T(h,b);f[S]+=g[0][S],this.shader.uniforms.offset=f;var P=d(c);P[E]=1,this.shader.uniforms.screenAxis=P,this.shader.uniforms.lineWidth=u,this.shader.uniforms.color=p,this.vao.draw(this.gl.TRIANGLES,6)},_.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()};function w(S,E,g){var b=[],p=[0,0,0],u=[0,0,0],y=[0,0,0],f=[0,0,0];b.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var P=0;P<3;++P){for(var F=b.length/3|0,L=0;L<g[P].length;++L){var z=+g[P][L].x;b.push(z,0,1,z,1,1,z,0,-1,z,0,-1,z,1,1,z,1,-1)}var O=b.length/3|0;p[P]=F,u[P]=O-F;for(var F=b.length/3|0,B=0;B<g[P].length;++B){var z=+g[P][B].x;b.push(z,0,1,z,1,1,z,0,-1,z,0,-1,z,1,1,z,1,-1)}var O=b.length/3|0;y[P]=F,f[P]=O-F}var I=i(S,new Float32Array(b)),N=a(S,[{buffer:I,type:S.FLOAT,size:3,stride:0,offset:0}]),U=n(S);return U.attributes.position.location=0,new l(S,I,N,U,u,p,f,y)}},1879:function(e,t,r){"use strict";var i=r(3236),a=r(9405),n=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 offset, majorAxis, minorAxis, screenAxis;
|
||
uniform float lineWidth;
|
||
uniform vec2 screenShape;
|
||
|
||
vec3 project(vec3 p) {
|
||
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
||
return pp.xyz / max(pp.w, 0.0001);
|
||
}
|
||
|
||
void main() {
|
||
vec3 major = position.x * majorAxis;
|
||
vec3 minor = position.y * minorAxis;
|
||
|
||
vec3 vPosition = major + minor + offset;
|
||
vec3 pPosition = project(vPosition);
|
||
vec3 offset = project(vPosition + screenAxis * position.z);
|
||
|
||
vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;
|
||
|
||
gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);
|
||
}
|
||
`]),o=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform vec4 color;
|
||
void main() {
|
||
gl_FragColor = color;
|
||
}`]);t.n=function(d){return a(d,n,o,null,[{name:"position",type:"vec3"}])};var s=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 offset, axis, alignDir, alignOpt;
|
||
uniform float scale, angle, pixelScale;
|
||
uniform vec2 resolution;
|
||
|
||
vec3 project(vec3 p) {
|
||
vec4 pp = projection * (view * (model * vec4(p, 1.0)));
|
||
return pp.xyz / max(pp.w, 0.0001);
|
||
}
|
||
|
||
float computeViewAngle(vec3 a, vec3 b) {
|
||
vec3 A = project(a);
|
||
vec3 B = project(b);
|
||
|
||
return atan(
|
||
(B.y - A.y) * resolution.y,
|
||
(B.x - A.x) * resolution.x
|
||
);
|
||
}
|
||
|
||
const float PI = 3.141592;
|
||
const float TWO_PI = 2.0 * PI;
|
||
const float HALF_PI = 0.5 * PI;
|
||
const float ONE_AND_HALF_PI = 1.5 * PI;
|
||
|
||
int option = int(floor(alignOpt.x + 0.001));
|
||
float hv_ratio = alignOpt.y;
|
||
bool enableAlign = (alignOpt.z != 0.0);
|
||
|
||
float mod_angle(float a) {
|
||
return mod(a, PI);
|
||
}
|
||
|
||
float positive_angle(float a) {
|
||
return mod_angle((a < 0.0) ?
|
||
a + TWO_PI :
|
||
a
|
||
);
|
||
}
|
||
|
||
float look_upwards(float a) {
|
||
float b = positive_angle(a);
|
||
return ((b > 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<j;++ne)for(var ee=oe[ne],re=2;re>=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<g[B].length;++O)if(g[B][O].text){var I={family:g[B][O].font||b[B].family,style:b[B].fontStyle||b[B].style,weight:b[B].fontWeight||b[B].weight,variant:b[B].fontVariant||b[B].variant};u(g[B][O].x,g[B][O].text,I,g[B][O].fontSize||12,z,F)}f[B]=(p.length/h|0)-y[B]}this.buffer.update(p),this.tickOffset=y,this.tickCount=f,this.labelOffset=P,this.labelCount=L},d.drawTicks=function(w,S,E,g,b,p,u,y){this.tickCount[w]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=b,this.shader.uniforms.angle=E,this.shader.uniforms.scale=S,this.shader.uniforms.offset=g,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=y,this.vao.draw(this.gl.TRIANGLES,this.tickCount[w],this.tickOffset[w]))},d.drawLabel=function(w,S,E,g,b,p,u,y){this.labelCount[w]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=b,this.shader.uniforms.angle=E,this.shader.uniforms.scale=S,this.shader.uniforms.offset=g,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=y,this.vao.draw(this.gl.TRIANGLES,this.labelCount[w],this.labelOffset[w]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(w,S){try{return n(w,S)}catch(E){return console.warn('error vectorizing text:"'+w+'" error:',E),{cells:[],positions:[]}}}function _(w,S,E,g,b,p){var u=i(w),y=a(w,[{buffer:u,size:3}]),f=o(w);f.attributes.position.location=0;var P=new m(w,f,u,y);return P.update(S,E,g,b,p),P}},6444:function(e,t){"use strict";t.create=i,t.equal=a;function r(n,o){var s=n+"",c=s.indexOf("."),h=0;c>=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<h;)S="0"+S;return w+"."+S}else return w}function i(n,o){for(var s=[],c=0;c<3;++c){for(var h=[],m=.5*(n[0][c]+n[1][c]),d=0;d*o[c]<=n[1][c];++d)h.push({x:d*o[c],text:r(o[c],d)});for(var d=-1;d*o[c]>=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;c<n[s].length;++c){var h=n[s][c],m=o[s][c];if(h.x!==m.x||h.text!==m.text||h.font!==m.font||h.fontColor!==m.fontColor||h.fontSize!==m.fontSize||h.dx!==m.dx||h.dy!==m.dy)return!1}}return!0}},5445:function(e,t,r){"use strict";e.exports=E;var i=r(5033),a=r(5202),n=r(6429),o=r(6760),s=r(5665),c=r(5352),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=new Float32Array(16);function d(g,b,p){this.lo=g,this.hi=b,this.pixelsPerDataUnit=p}var T=[0,0,0,1],l=[0,0,0,1];function _(g,b,p,u,y){for(var f=0;f<3;++f){for(var P=T,L=l,z=0;z<3;++z)L[z]=P[z]=p[z];L[3]=P[3]=1,L[f]+=1,c(L,L,b),L[3]<0&&(g[f]=1/0),P[f]-=1,c(P,P,b),P[3]<0&&(g[f]=1/0);var F=(P[0]/P[3]-L[0]/L[3])*u,B=(P[1]/P[3]-L[1]/L[3])*y;g[f]=.25*Math.sqrt(F*F+B*B)}return g}var w=[new d(1/0,-1/0,1/0),new d(1/0,-1/0,1/0),new d(1/0,-1/0,1/0)],S=[0,0,0];function E(g,b,p,u,B){var f=b.model||h,P=b.view||h,L=b.projection||h,z=b._ortho||!1,F=g.bounds,B=B||n(f,P,L,F,z),O=B.axis;o(m,P,f),o(m,L,m);for(var I=w,N=0;N<3;++N)I[N].lo=1/0,I[N].hi=-1/0,I[N].pixelsPerDataUnit=1/0;var U=i(s(m,m));s(m,m);for(var W=0;W<3;++W){var Q=(W+1)%3,ue=(W+2)%3,se=S;e:for(var N=0;N<2;++N){var he=[];if(O[W]<0!=!!N){se[W]=F[N][W];for(var H=0;H<2;++H){se[Q]=F[H^N][Q];for(var $=0;$<2;++$)se[ue]=F[$^H^N][ue],he.push(se.slice())}for(var J=z?5:4,H=J;H===J;++H){if(he.length===0)continue e;he=a.positive(he,U[H])}for(var H=0;H<he.length;++H)for(var ue=he[H],X=_(S,m,ue,p,u),$=0;$<3;++$)I[$].lo=Math.min(I[$].lo,ue[$]),I[$].hi=Math.max(I[$].hi,ue[$]),$!==W&&(I[$].pixelsPerDataUnit=Math.min(I[$].pixelsPerDataUnit,Math.abs(X[$])))}}}return I}},2762:function(e,t,r){"use strict";var i=r(1888),a=r(5298),n=r(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,_,w,S,E){this.gl=l,this.type=_,this.handle=w,this.length=S,this.usage=E}var c=s.prototype;c.bind=function(){this.gl.bindBuffer(this.type,this.handle)},c.unbind=function(){this.gl.bindBuffer(this.type,null)},c.dispose=function(){this.gl.deleteBuffer(this.handle)};function h(l,_,w,S,E,g){var b=E.length*E.BYTES_PER_ELEMENT;if(g<0)return l.bufferData(_,E,S),b;if(b+g>w)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<S;++E)w[E]=l[E];return w}function d(l,_){for(var w=1,S=_.length-1;S>=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;f<s.length;f++){var P=s[f];d=Math.min(P[0],d),T=Math.max(P[0],T),l=Math.min(P[1],l),_=Math.max(P[1],_),w=Math.min(P[2],w),S=Math.max(P[2],S);var L=c[f];if(i.length(L)>m&&(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<s.length;f++)for(var P=s[f],U=P[0],W=P[1],Q=P[2],ue=b[f],se=i.length(ue)*O,he=0,H=8;he<H;he++){h.positions.push([U,W,Q,N++]),h.positions.push([U,W,Q,N++]),h.positions.push([U,W,Q,N++]),h.positions.push([U,W,Q,N++]),h.positions.push([U,W,Q,N++]),h.positions.push([U,W,Q,N++]),h.vectors.push(ue),h.vectors.push(ue),h.vectors.push(ue),h.vectors.push(ue),h.vectors.push(ue),h.vectors.push(ue),h.vertexIntensity.push(se,se,se),h.vertexIntensity.push(se,se,se);var $=h.positions.length;h.cells.push([$-6,$-5,$-4],[$-3,$-2,$-1])}return h};var a=r(614);e.exports.createMesh=r(9060),e.exports.createConeMesh=function(n,o){return e.exports.createMesh(n,o,{shaders:a,traceType:"cone"})}},9060:function(e,t,r){"use strict";var i=r(9405),a=r(2762),n=r(8116),o=r(7766),s=r(6760),c=r(7608),h=r(9618),m=r(6729),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(b,p,u,y,f,P,L,z,F,B,O){this.gl=b,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=p,this.dirty=!0,this.triShader=u,this.pickShader=y,this.trianglePositions=f,this.triangleVectors=P,this.triangleColors=z,this.triangleUVs=F,this.triangleIds=L,this.triangleVAO=B,this.triangleCount=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.traceType=O,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=d,this._view=d,this._projection=d,this._resolution=[1,1]}var l=T.prototype;l.isOpaque=function(){return this.opacity>=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;y<p;++y)u[y]=b[y][2];return u}l.update=function(b){b=b||{};var p=this.gl;this.dirty=!0,"lightPosition"in b&&(this.lightPosition=b.lightPosition),"opacity"in b&&(this.opacity=b.opacity),"ambient"in b&&(this.ambientLight=b.ambient),"diffuse"in b&&(this.diffuseLight=b.diffuse),"specular"in b&&(this.specularLight=b.specular),"roughness"in b&&(this.roughness=b.roughness),"fresnel"in b&&(this.fresnel=b.fresnel),b.tubeScale!==void 0&&(this.tubeScale=b.tubeScale),b.vectorScale!==void 0&&(this.vectorScale=b.vectorScale),b.coneScale!==void 0&&(this.coneScale=b.coneScale),b.coneOffset!==void 0&&(this.coneOffset=b.coneOffset),b.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=p.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=p.LINEAR,this.texture.setPixels(_(b.colormap)),this.texture.generateMipmap());var u=b.cells,y=b.positions,f=b.vectors;if(!(!y||!u||!f)){var P=[],L=[],z=[],F=[],B=[];this.cells=u,this.positions=y,this.vectors=f;var O=b.meshColor||[1,1,1,1],I=b.vertexIntensity,N=1/0,U=-1/0;if(I)if(b.vertexIntensityBounds)N=+b.vertexIntensityBounds[0],U=+b.vertexIntensityBounds[1];else for(var W=0;W<I.length;++W){var Q=I[W];N=Math.min(N,Q),U=Math.max(U,Q)}else for(var W=0;W<y.length;++W){var Q=y[W][2];N=Math.min(N,Q),U=Math.max(U,Q)}I?this.intensity=I:this.intensity=w(y),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var W=0;W<y.length;++W)for(var ue=y[W],se=0;se<3;++se)isNaN(ue[se])||!isFinite(ue[se])||(this.bounds[0][se]=Math.min(this.bounds[0][se],ue[se]),this.bounds[1][se]=Math.max(this.bounds[1][se],ue[se]));var he=0;e:for(var W=0;W<u.length;++W){var H=u[W];switch(H.length){case 3:for(var se=0;se<3;++se)for(var $=H[se],ue=y[$],J=0;J<3;++J)if(isNaN(ue[J])||!isFinite(ue[J]))continue e;for(var se=0;se<3;++se){var $=H[2-se],ue=y[$];P.push(ue[0],ue[1],ue[2],ue[3]);var X=f[$];L.push(X[0],X[1],X[2],X[3]||0);var oe=O;oe.length===3?z.push(oe[0],oe[1],oe[2],1):z.push(oe[0],oe[1],oe[2],oe[3]);var ne;I?ne=[(I[$]-N)/(U-N),0]:ne=[(ue[2]-N)/(U-N),0],F.push(ne[0],ne[1]),B.push(W)}he+=1;break;default:break}}this.triangleCount=he,this.trianglePositions.update(P),this.triangleVectors.update(L),this.triangleColors.update(z),this.triangleUVs.update(F),this.triangleIds.update(new Uint32Array(B))}},l.drawTransparent=l.draw=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]);var z={model:u,view:y,projection:f,inverseModel:d.slice(),clipBounds:P,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};z.inverseModel=c(z.inverseModel,z.model),p.disable(p.CULL_FACE),this.texture.bind(0);var F=new Array(16);s(F,z.view,z.model),s(F,z.projection,F),c(F,F);for(var L=0;L<3;++L)z.eyePosition[L]=F[12+L]/F[15];for(var B=F[15],L=0;L<3;++L)B+=this.lightPosition[L]*F[4*L+3];for(var L=0;L<3;++L){for(var O=F[12+L],I=0;I<3;++I)O+=F[4*I+L]*this.lightPosition[I];z.lightPosition[L]=O/B}if(this.triangleCount>0){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;g<E.length;++g){var b=E[g];l.push(_[0],_[1],_[2],w[0],w[1],w[2],w[3],b[0],b[1],b[2])}return E.length}c.update=function(l){l=l||{},"lineWidth"in l&&(this.lineWidth=l.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in l&&(this.capSize=l.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in l&&(this.opacity=+l.opacity,this.opacity<1&&(this.hasAlpha=!0));var _=l.color||[[0,0,0],[0,0,0],[0,0,0]],w=l.position,S=l.error;if(Array.isArray(_[0])||(_=[_,_,_]),w&&S){var E=[],g=w.length,b=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var p=0;p<3;++p){this.lineOffset[p]=b;e:for(var u=0;u<g;++u){for(var y=w[u],f=0;f<3;++f)if(isNaN(y[f])||!isFinite(y[f]))continue e;var P=S[u],L=_[p];if(Array.isArray(L[0])&&(L=_[u]),L.length===3?L=[L[0],L[1],L[2],1]:L.length===4&&(L=[L[0],L[1],L[2],L[3]],!this.hasAlpha&&L[3]<1&&(this.hasAlpha=!0)),!(isNaN(P[0][p])||isNaN(P[1][p]))){if(P[0][p]<0){var z=y.slice();z[p]+=P[0][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)}if(P[1][p]>0){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;L<f;++L)P[L]=p.COLOR_ATTACHMENT0+L;for(var L=f;L<y;++L)P[L]=p.NONE;a[f]=P}}function T(p){switch(p){case n:throw new Error("gl-fbo: Framebuffer unsupported");case o:throw new Error("gl-fbo: Framebuffer incomplete attachment");case s:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case c:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function l(p,u,y,f,P,L){if(!f)return null;var z=i(p,u,y,P,f);return z.magFilter=p.NEAREST,z.minFilter=p.NEAREST,z.mipSamples=1,z.bind(),p.framebufferTexture2D(p.FRAMEBUFFER,L,p.TEXTURE_2D,z.handle,0),z}function _(p,u,y,f,P){var L=p.createRenderbuffer();return p.bindRenderbuffer(p.RENDERBUFFER,L),p.renderbufferStorage(p.RENDERBUFFER,f,u,y),p.framebufferRenderbuffer(p.FRAMEBUFFER,P,p.RENDERBUFFER,L),L}function w(p){var u=h(p.gl),y=p.gl,f=p.handle=y.createFramebuffer(),P=p._shape[0],L=p._shape[1],z=p.color.length,F=p._ext,B=p._useStencil,O=p._useDepth,I=p._colorType;y.bindFramebuffer(y.FRAMEBUFFER,f);for(var N=0;N<z;++N)p.color[N]=l(y,P,L,I,y.RGBA,y.COLOR_ATTACHMENT0+N);z===0?(p._color_rb=_(y,P,L,y.RGBA4,y.COLOR_ATTACHMENT0),F&&F.drawBuffersWEBGL(a[0])):z>1&&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;N<p.color.length;++N)p.color[N].dispose(),p.color[N]=null;p._color_rb&&(y.deleteRenderbuffer(p._color_rb),p._color_rb=null),m(y,u),T(W)}m(y,u)}function S(p,u,y,f,P,L,z,F){this.gl=p,this._shape=[u|0,y|0],this._destroyed=!1,this._ext=F,this.color=new Array(P);for(var B=0;B<P;++B)this.color[B]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=f,this._useDepth=L,this._useStencil=z;var O=this,I=[u|0,y|0];Object.defineProperties(I,{0:{get:function(){return O._shape[0]},set:function(N){return O.width=N}},1:{get:function(){return O._shape[1]},set:function(N){return O.height=N}}}),this._shapeVector=I,w(this)}var E=S.prototype;function g(p,u,y){if(p._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(!(p._shape[0]===u&&p._shape[1]===y)){var f=p.gl,P=f.getParameter(f.MAX_RENDERBUFFER_SIZE);if(u<0||u>P||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;z<p.color.length;++z)p.color[z].shape=p._shape;p._color_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,p._color_rb),f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,p._shape[0],p._shape[1])),p.depth&&(p.depth.shape=p._shape),p._depth_rb&&(f.bindRenderbuffer(f.RENDERBUFFER,p._depth_rb),p._useDepth&&p._useStencil?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,p._shape[0],p._shape[1]):p._useDepth?f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,p._shape[0],p._shape[1]):p._useStencil&&f.renderbufferStorage(f.RENDERBUFFER,f.STENCIL_INDEX,p._shape[0],p._shape[1])),f.bindFramebuffer(f.FRAMEBUFFER,p.handle);var F=f.checkFramebufferStatus(f.FRAMEBUFFER);F!==f.FRAMEBUFFER_COMPLETE&&(p.dispose(),m(f,L),T(F)),m(f,L)}}Object.defineProperties(E,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(p){if(Array.isArray(p)||(p=[p|0,p|0]),p.length!==2)throw new Error("gl-fbo: Shape vector must be length 2");var u=p[0]|0,y=p[1]|0;return g(this,u,y),[u,y]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(p){return p=p|0,g(this,p,this._shape[1]),p},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(p){return p=p|0,g(this,this._shape[0],p),p},enumerable:!1}}),E.bind=function(){if(!this._destroyed){var p=this.gl;p.bindFramebuffer(p.FRAMEBUFFER,this.handle),p.viewport(0,0,this._shape[0],this._shape[1])}},E.dispose=function(){if(!this._destroyed){this._destroyed=!0;var p=this.gl;p.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(p.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var u=0;u<this.color.length;++u)this.color[u].dispose(),this.color[u]=null;this._color_rb&&(p.deleteRenderbuffer(this._color_rb),this._color_rb=null)}};function b(p,u,y,f){n||(n=p.FRAMEBUFFER_UNSUPPORTED,o=p.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,s=p.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,c=p.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var P=p.getExtension("WEBGL_draw_buffers");if(!a&&P&&d(p,P),Array.isArray(u)&&(f=y,y=u[1]|0,u=u[0]|0),typeof u!="number")throw new Error("gl-fbo: Missing shape parameter");var L=p.getParameter(p.MAX_RENDERBUFFER_SIZE);if(u<0||u>L||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<w.length;E++){var g=w[E];if(!(g===""||g==="\0")){var b=parseInt(g.split(":")[2]);if(isNaN(b))throw new Error(i("Could not parse error: %s",g));S[b]=g}}for(var p=o(h).split(`
|
||
`),E=0;E<p.length;E++)if(!(!S[E+3]&&!S[E+2]&&!S[E+1])){var u=p[E];if(l+=u+`
|
||
`,S[E+1]){var y=S[E+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),l+=i(`^^^ %s
|
||
|
||
`,y)}}return{long:l.trim(),short:_.trim()}}},7319:function(e,t,r){var i=r(3236),a=r(9405),n=i([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, nextPosition;
|
||
attribute float arcLength, lineWidth;
|
||
attribute vec4 color;
|
||
|
||
uniform vec2 screenShape;
|
||
uniform float pixelRatio;
|
||
uniform mat4 model, view, projection;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec3 worldPosition;
|
||
varying float pixelArcLength;
|
||
|
||
vec4 project(vec3 p) {
|
||
return projection * (view * (model * vec4(p, 1.0)));
|
||
}
|
||
|
||
void main() {
|
||
vec4 startPoint = project(position);
|
||
vec4 endPoint = project(nextPosition);
|
||
|
||
vec2 A = startPoint.xy / startPoint.w;
|
||
vec2 B = endPoint.xy / endPoint.w;
|
||
|
||
float clipAngle = atan(
|
||
(B.y - A.y) * screenShape.y,
|
||
(B.x - A.x) * screenShape.x
|
||
);
|
||
|
||
vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(
|
||
sin(clipAngle),
|
||
-cos(clipAngle)
|
||
) / screenShape;
|
||
|
||
gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);
|
||
|
||
worldPosition = position;
|
||
pixelArcLength = arcLength;
|
||
fragColor = color;
|
||
}
|
||
`]),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 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;y<N.length;++y){var ue=N[y-1],se=N[y];for(z.push(B),F.push(ue.slice()),f=0;f<3;++f){if(isNaN(ue[f])||isNaN(se[f])||!isFinite(ue[f])||!isFinite(se[f])){if(!P&&L.length>0){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;y<ne.length;++y)ne[y]=ne[y-1]+ne[y];var j=m(new Array(256*4),[256,1,4]);for(y=0;y<256;++y){for(f=0;f<4;++f)j.set(y,0,f,0);h.le(ne,ne[ne.length-1]*y/255)&1?j.set(y,0,0,0):j.set(y,0,0,255)}this.texture.setPixels(j)}},b.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},b.pick=function(u){if(!u||u.id!==this.pickId)return null;var y=c(u.value[0],u.value[1],u.value[2],0),f=h.le(this.arcLength,y);if(f<0)return null;if(f===this.arcLength.length-1)return new E(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),f);for(var P=this.points[f],L=this.points[Math.min(f+1,this.points.length-1)],z=(y-this.arcLength[f])/(this.arcLength[f+1]-this.arcLength[f]),F=1-z,B=[0,0,0],O=0;O<3;++O)B[O]=F*P[O]+z*L[O];var I=Math.min(z<.5?f:f+1,this.points.length-1);return new E(y,B,I,this.points[I])};function p(u){var y=u.gl||u.scene&&u.scene.gl,f=T(y);f.attributes.position.location=0,f.attributes.nextPosition.location=1,f.attributes.arcLength.location=2,f.attributes.lineWidth.location=3,f.attributes.color.location=4;var P=l(y);P.attributes.position.location=0,P.attributes.nextPosition.location=1,P.attributes.arcLength.location=2,P.attributes.lineWidth.location=3,P.attributes.color.location=4;for(var L=i(y),z=a(y,[{buffer:L,size:3,offset:0,stride:48},{buffer:L,size:3,offset:12,stride:48},{buffer:L,size:1,offset:24,stride:48},{buffer:L,size:1,offset:28,stride:48},{buffer:L,size:4,offset:32,stride:48}]),F=m(new Array(256*4),[256,1,4]),B=0;B<1024;++B)F.data[B]=255;var O=n(y,F);O.wrap=y.REPEAT;var I=new g(y,f,P,L,z,O);return I.update(u),I}},1903:function(e){e.exports=t;function t(r){var i=new Float32Array(16);return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}},6864:function(e){e.exports=t;function t(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},9921:function(e){e.exports=t;function t(r){var i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],c=r[5],h=r[6],m=r[7],d=r[8],T=r[9],l=r[10],_=r[11],w=r[12],S=r[13],E=r[14],g=r[15],b=i*c-a*s,p=i*h-n*s,u=i*m-o*s,y=a*h-n*c,f=a*m-o*c,P=n*m-o*h,L=d*S-T*w,z=d*E-l*w,F=d*g-_*w,B=T*E-l*S,O=T*g-_*S,I=l*g-_*E;return b*I-p*O+u*B+y*F-f*z+P*L}},7399: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,h=n+n,m=o+o,d=a*c,T=n*c,l=n*h,_=o*c,w=o*h,S=o*m,E=s*c,g=s*h,b=s*m;return r[0]=1-l-S,r[1]=T+b,r[2]=_-g,r[3]=0,r[4]=T-b,r[5]=1-d-S,r[6]=w+E,r[7]=0,r[8]=_+g,r[9]=w-E,r[10]=1-d-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},6743:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=i[3],h=n+n,m=o+o,d=s+s,T=n*h,l=n*m,_=n*d,w=o*m,S=o*d,E=s*d,g=c*h,b=c*m,p=c*d;return r[0]=1-(w+E),r[1]=l+p,r[2]=_-b,r[3]=0,r[4]=l-p,r[5]=1-(T+E),r[6]=S+g,r[7]=0,r[8]=_+b,r[9]=S-g,r[10]=1-(T+w),r[11]=0,r[12]=a[0],r[13]=a[1],r[14]=a[2],r[15]=1,r}},7894:function(e){e.exports=t;function t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}},7608:function(e){e.exports=t;function t(r,i){var a=i[0],n=i[1],o=i[2],s=i[3],c=i[4],h=i[5],m=i[6],d=i[7],T=i[8],l=i[9],_=i[10],w=i[11],S=i[12],E=i[13],g=i[14],b=i[15],p=a*h-n*c,u=a*m-o*c,y=a*d-s*c,f=n*m-o*h,P=n*d-s*h,L=o*d-s*m,z=T*E-l*S,F=T*g-_*S,B=T*b-w*S,O=l*g-_*E,I=l*b-w*E,N=_*b-w*g,U=p*N-u*I+y*O+f*B-P*F+L*z;return U?(U=1/U,r[0]=(h*N-m*I+d*O)*U,r[1]=(o*I-n*N-s*O)*U,r[2]=(E*L-g*P+b*f)*U,r[3]=(_*P-l*L-w*f)*U,r[4]=(m*B-c*N-d*F)*U,r[5]=(a*N-o*B+s*F)*U,r[6]=(g*y-S*L-b*u)*U,r[7]=(T*L-_*y+w*u)*U,r[8]=(c*I-h*B+d*z)*U,r[9]=(n*B-a*I-s*z)*U,r[10]=(S*P-E*y+b*p)*U,r[11]=(l*y-T*P-w*p)*U,r[12]=(h*F-c*O-m*z)*U,r[13]=(a*O-n*F+o*z)*U,r[14]=(E*u-S*f-g*p)*U,r[15]=(T*f-l*u+_*p)*U,r):null}},6582:function(e,t,r){var i=r(7894);e.exports=a;function a(n,o,s,c){var h,m,d,T,l,_,w,S,E,g,b=o[0],p=o[1],u=o[2],y=c[0],f=c[1],P=c[2],L=s[0],z=s[1],F=s[2];return Math.abs(b-L)<1e-6&&Math.abs(p-z)<1e-6&&Math.abs(u-F)<1e-6?i(n):(w=b-L,S=p-z,E=u-F,g=1/Math.sqrt(w*w+S*S+E*E),w*=g,S*=g,E*=g,h=f*E-P*S,m=P*w-y*E,d=y*S-f*w,g=Math.sqrt(h*h+m*m+d*d),g?(g=1/g,h*=g,m*=g,d*=g):(h=0,m=0,d=0),T=S*d-E*m,l=E*h-w*d,_=w*m-S*h,g=Math.sqrt(T*T+l*l+_*_),g?(g=1/g,T*=g,l*=g,_*=g):(T=0,l=0,_=0),n[0]=h,n[1]=T,n[2]=w,n[3]=0,n[4]=m,n[5]=l,n[6]=S,n[7]=0,n[8]=d,n[9]=_,n[10]=E,n[11]=0,n[12]=-(h*b+m*p+d*u),n[13]=-(T*b+l*p+_*u),n[14]=-(w*b+S*p+E*u),n[15]=1,n)}},6760:function(e){e.exports=t;function t(r,i,a){var n=i[0],o=i[1],s=i[2],c=i[3],h=i[4],m=i[5],d=i[6],T=i[7],l=i[8],_=i[9],w=i[10],S=i[11],E=i[12],g=i[13],b=i[14],p=i[15],u=a[0],y=a[1],f=a[2],P=a[3];return r[0]=u*n+y*h+f*l+P*E,r[1]=u*o+y*m+f*_+P*g,r[2]=u*s+y*d+f*w+P*b,r[3]=u*c+y*T+f*S+P*p,u=a[4],y=a[5],f=a[6],P=a[7],r[4]=u*n+y*h+f*l+P*E,r[5]=u*o+y*m+f*_+P*g,r[6]=u*s+y*d+f*w+P*b,r[7]=u*c+y*T+f*S+P*p,u=a[8],y=a[9],f=a[10],P=a[11],r[8]=u*n+y*h+f*l+P*E,r[9]=u*o+y*m+f*_+P*g,r[10]=u*s+y*d+f*w+P*b,r[11]=u*c+y*T+f*S+P*p,u=a[12],y=a[13],f=a[14],P=a[15],r[12]=u*n+y*h+f*l+P*E,r[13]=u*o+y*m+f*_+P*g,r[14]=u*s+y*d+f*w+P*b,r[15]=u*c+y*T+f*S+P*p,r}},4040:function(e){e.exports=t;function t(r,i,a,n,o,s,c){var h=1/(i-a),m=1/(n-o),d=1/(s-c);return r[0]=-2*h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*m,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*d,r[11]=0,r[12]=(i+a)*h,r[13]=(o+n)*m,r[14]=(c+s)*d,r[15]=1,r}},4772:function(e){e.exports=t;function t(r,i,a,n,o){var s=1/Math.tan(i/2),c=1/(n-o);return r[0]=s/a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(o+n)*c,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*o*n*c,r[15]=0,r}},6079:function(e){e.exports=t;function t(r,i,a,n){var o=n[0],s=n[1],c=n[2],h=Math.sqrt(o*o+s*s+c*c),m,d,T,l,_,w,S,E,g,b,p,u,y,f,P,L,z,F,B,O,I,N,U,W;return Math.abs(h)<1e-6?null:(h=1/h,o*=h,s*=h,c*=h,m=Math.sin(a),d=Math.cos(a),T=1-d,l=i[0],_=i[1],w=i[2],S=i[3],E=i[4],g=i[5],b=i[6],p=i[7],u=i[8],y=i[9],f=i[10],P=i[11],L=o*o*T+d,z=s*o*T+c*m,F=c*o*T-s*m,B=o*s*T-c*m,O=s*s*T+d,I=c*s*T+o*m,N=o*c*T+s*m,U=s*c*T-o*m,W=c*c*T+d,r[0]=l*L+E*z+u*F,r[1]=_*L+g*z+y*F,r[2]=w*L+b*z+f*F,r[3]=S*L+p*z+P*F,r[4]=l*B+E*O+u*I,r[5]=_*B+g*O+y*I,r[6]=w*B+b*O+f*I,r[7]=S*B+p*O+P*I,r[8]=l*N+E*U+u*W,r[9]=_*N+g*U+y*W,r[10]=w*N+b*U+f*W,r[11]=S*N+p*U+P*W,i!==r&&(r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r)}},5567:function(e){e.exports=t;function t(r,i,a){var n=Math.sin(a),o=Math.cos(a),s=i[4],c=i[5],h=i[6],m=i[7],d=i[8],T=i[9],l=i[10],_=i[11];return i!==r&&(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[4]=s*o+d*n,r[5]=c*o+T*n,r[6]=h*o+l*n,r[7]=m*o+_*n,r[8]=d*o-s*n,r[9]=T*o-c*n,r[10]=l*o-h*n,r[11]=_*o-m*n,r}},2408:function(e){e.exports=t;function t(r,i,a){var n=Math.sin(a),o=Math.cos(a),s=i[0],c=i[1],h=i[2],m=i[3],d=i[8],T=i[9],l=i[10],_=i[11];return i!==r&&(r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*o-d*n,r[1]=c*o-T*n,r[2]=h*o-l*n,r[3]=m*o-_*n,r[8]=s*n+d*o,r[9]=c*n+T*o,r[10]=h*n+l*o,r[11]=m*n+_*o,r}},7089:function(e){e.exports=t;function t(r,i,a){var n=Math.sin(a),o=Math.cos(a),s=i[0],c=i[1],h=i[2],m=i[3],d=i[4],T=i[5],l=i[6],_=i[7];return i!==r&&(r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15]),r[0]=s*o+d*n,r[1]=c*o+T*n,r[2]=h*o+l*n,r[3]=m*o+_*n,r[4]=d*o-s*n,r[5]=T*o-c*n,r[6]=l*o-h*n,r[7]=_*o-m*n,r}},2504:function(e){e.exports=t;function t(r,i,a){var n=a[0],o=a[1],s=a[2];return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=i[3]*n,r[4]=i[4]*o,r[5]=i[5]*o,r[6]=i[6]*o,r[7]=i[7]*o,r[8]=i[8]*s,r[9]=i[9]*s,r[10]=i[10]*s,r[11]=i[11]*s,r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],r}},7656:function(e){e.exports=t;function t(r,i,a){var n=a[0],o=a[1],s=a[2],c,h,m,d,T,l,_,w,S,E,g,b;return i===r?(r[12]=i[0]*n+i[4]*o+i[8]*s+i[12],r[13]=i[1]*n+i[5]*o+i[9]*s+i[13],r[14]=i[2]*n+i[6]*o+i[10]*s+i[14],r[15]=i[3]*n+i[7]*o+i[11]*s+i[15]):(c=i[0],h=i[1],m=i[2],d=i[3],T=i[4],l=i[5],_=i[6],w=i[7],S=i[8],E=i[9],g=i[10],b=i[11],r[0]=c,r[1]=h,r[2]=m,r[3]=d,r[4]=T,r[5]=l,r[6]=_,r[7]=w,r[8]=S,r[9]=E,r[10]=g,r[11]=b,r[12]=c*n+T*o+S*s+i[12],r[13]=h*n+l*o+E*s+i[13],r[14]=m*n+_*o+g*s+i[14],r[15]=d*n+w*o+b*s+i[15]),r}},5665:function(e){e.exports=t;function t(r,i){if(r===i){var a=i[1],n=i[2],o=i[3],s=i[6],c=i[7],h=i[11];r[1]=i[4],r[2]=i[8],r[3]=i[12],r[4]=a,r[6]=i[9],r[7]=i[13],r[8]=n,r[9]=s,r[11]=i[14],r[12]=o,r[13]=c,r[14]=h}else r[0]=i[0],r[1]=i[4],r[2]=i[8],r[3]=i[12],r[4]=i[1],r[5]=i[5],r[6]=i[9],r[7]=i[13],r[8]=i[2],r[9]=i[6],r[10]=i[10],r[11]=i[14],r[12]=i[3],r[13]=i[7],r[14]=i[11],r[15]=i[15];return r}},7626:function(e,t,r){"use strict";var i=r(2642),a=r(9346);e.exports=h;function n(m,d){for(var T=[0,0,0,0],l=0;l<4;++l)for(var _=0;_<4;++_)T[_]+=m[4*l+_]*d[l];return T}function o(m,d,T,l,_){for(var w=n(l,n(T,n(d,[m[0],m[1],m[2],1]))),S=0;S<3;++S)w[S]/=w[3];return[.5*_[0]*(1+w[0]),.5*_[1]*(1-w[1])]}function s(m,d){if(m.length===2){for(var T=0,l=0,_=0;_<2;++_)T+=Math.pow(d[_]-m[0][_],2),l+=Math.pow(d[_]-m[1][_],2);return T=Math.sqrt(T),l=Math.sqrt(l),T+l<1e-6?[1,0]:[l/(T+l),T/(l+T)]}else if(m.length===3){var w=[0,0];return a(m[0],m[1],m[2],d,w),i(m,w)}return[]}function c(m,d){for(var T=[0,0,0],l=0;l<m.length;++l)for(var _=m[l],w=d[l],S=0;S<3;++S)T[S]+=w*_[S];return T}function h(m,d,T,l,_,w){if(m.length===1)return[0,m[0].slice()];for(var S=new Array(m.length),E=0;E<m.length;++E)S[E]=o(m[E],T,l,_,w);for(var g=0,b=1/0,E=0;E<S.length;++E){for(var p=0,u=0;u<2;++u)p+=Math.pow(S[E][u]-d[u],2);p<b&&(b=p,g=E)}for(var y=s(S,d),f=0,E=0;E<3;++E){if(y[E]<-.001||y[E]>1.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;$<H.length;++$){if(H.length<2)return 1;if(H[$][0]===he)return H[$][1];if(H[$][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;J<H;++J)$[J]=he[J][2];return $}z.highlight=function(he){if(!he||!this.contourEnable){this.contourCount=0;return}for(var H=_(this.cells,this.intensity,he.intensity),$=H.cells,J=H.vertexIds,X=H.vertexWeights,oe=$.length,ne=w.mallocFloat32(2*3*oe),j=0,ee=0;ee<oe;++ee)for(var re=$[ee],ce=0;ce<2;++ce){var be=re[0];re.length===2&&(be=re[ce]);for(var Ae=J[be][0],ze=J[be][1],Re=X[be],We=1-Re,it=this.positions[Ae],ot=this.positions[ze],tt=0;tt<3;++tt)ne[j++]=Re*it[tt]+We*ot[tt]}this.contourCount=j/3|0,this.contourPositions.update(ne.subarray(0,j)),w.free(ne)},z.update=function(he){he=he||{};var H=this.gl;this.dirty=!0,"contourEnable"in he&&(this.contourEnable=he.contourEnable),"contourColor"in he&&(this.contourColor=he.contourColor),"lineWidth"in he&&(this.lineWidth=he.lineWidth),"lightPosition"in he&&(this.lightPosition=he.lightPosition),this.hasAlpha=!1,"opacity"in he&&(this.opacity=he.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in he&&(this.opacityscale=he.opacityscale,this.hasAlpha=!0),"ambient"in he&&(this.ambientLight=he.ambient),"diffuse"in he&&(this.diffuseLight=he.diffuse),"specular"in he&&(this.specularLight=he.specular),"roughness"in he&&(this.roughness=he.roughness),"fresnel"in he&&(this.fresnel=he.fresnel),he.texture?(this.texture.dispose(),this.texture=c(H,he.texture)):he.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=H.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=H.LINEAR,this.texture.setPixels(B(he.colormap,this.opacityscale)),this.texture.generateMipmap());var $=he.cells,J=he.positions;if(!(!J||!$)){var X=[],oe=[],ne=[],j=[],ee=[],re=[],ce=[],be=[],Ae=[],ze=[],Re=[],We=[],it=[],ot=[];this.cells=$,this.positions=J;var tt=he.vertexNormals,ut=he.cellNormals,Me=he.vertexNormalsEpsilon===void 0?i:he.vertexNormalsEpsilon,_e=he.faceNormalsEpsilon===void 0?a:he.faceNormalsEpsilon;he.useFacetNormals&&!ut&&(ut=h.faceNormals($,J,_e)),!ut&&!tt&&(tt=h.vertexNormals($,J,Me));var fe=he.vertexColors,Fe=he.cellColors,rt=he.meshColor||[1,1,1,1],st=he.vertexUVs,Qe=he.vertexIntensity,Lt=he.cellUVs,kt=he.cellIntensity,qt=1/0,Zt=-1/0;if(!st&&!Lt)if(Qe)if(he.vertexIntensityBounds)qt=+he.vertexIntensityBounds[0],Zt=+he.vertexIntensityBounds[1];else for(var Sr=0;Sr<Qe.length;++Sr){var xr=Qe[Sr];qt=Math.min(qt,xr),Zt=Math.max(Zt,xr)}else if(kt)if(he.cellIntensityBounds)qt=+he.cellIntensityBounds[0],Zt=+he.cellIntensityBounds[1];else for(var Sr=0;Sr<kt.length;++Sr){var xr=kt[Sr];qt=Math.min(qt,xr),Zt=Math.max(Zt,xr)}else for(var Sr=0;Sr<J.length;++Sr){var xr=J[Sr][2];qt=Math.min(qt,xr),Zt=Math.max(Zt,xr)}Qe?this.intensity=Qe:kt?this.intensity=kt:this.intensity=O(J),this.pickVertex=!(kt||Fe);var jr=he.pointSizes,wr=he.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var Sr=0;Sr<J.length;++Sr)for(var Ir=J[Sr],bt=0;bt<3;++bt)isNaN(Ir[bt])||!isFinite(Ir[bt])||(this.bounds[0][bt]=Math.min(this.bounds[0][bt],Ir[bt]),this.bounds[1][bt]=Math.max(this.bounds[1][bt],Ir[bt]));var Be=0,Ke=0,Ue=0;e:for(var Sr=0;Sr<$.length;++Sr){var Ee=$[Sr];switch(Ee.length){case 1:for(var Ve=Ee[0],Ir=J[Ve],bt=0;bt<3;++bt)if(isNaN(Ir[bt])||!isFinite(Ir[bt]))continue e;ze.push(Ir[0],Ir[1],Ir[2]);var Ce;fe?Ce=fe[Ve]:Fe?Ce=Fe[Sr]:Ce=rt,this.opacityscale&&Qe?oe.push(Ce[0],Ce[1],Ce[2],this.opacity*F((Qe[Ve]-qt)/(Zt-qt),this.opacityscale)):Ce.length===3?Re.push(Ce[0],Ce[1],Ce[2],this.opacity):(Re.push(Ce[0],Ce[1],Ce[2],Ce[3]*this.opacity),Ce[3]<1&&(this.hasAlpha=!0));var Te;st?Te=st[Ve]:Qe?Te=[(Qe[Ve]-qt)/(Zt-qt),0]:Lt?Te=Lt[Sr]:kt?Te=[(kt[Sr]-qt)/(Zt-qt),0]:Te=[(Ir[2]-qt)/(Zt-qt),0],We.push(Te[0],Te[1]),jr?it.push(jr[Ve]):it.push(wr),ot.push(Sr),Ue+=1;break;case 2:for(var bt=0;bt<2;++bt)for(var Ve=Ee[bt],Ir=J[Ve],Pe=0;Pe<3;++Pe)if(isNaN(Ir[Pe])||!isFinite(Ir[Pe]))continue e;for(var bt=0;bt<2;++bt){var Ve=Ee[bt],Ir=J[Ve];re.push(Ir[0],Ir[1],Ir[2]);var Ce;fe?Ce=fe[Ve]:Fe?Ce=Fe[Sr]:Ce=rt,this.opacityscale&&Qe?oe.push(Ce[0],Ce[1],Ce[2],this.opacity*F((Qe[Ve]-qt)/(Zt-qt),this.opacityscale)):Ce.length===3?ce.push(Ce[0],Ce[1],Ce[2],this.opacity):(ce.push(Ce[0],Ce[1],Ce[2],Ce[3]*this.opacity),Ce[3]<1&&(this.hasAlpha=!0));var Te;st?Te=st[Ve]:Qe?Te=[(Qe[Ve]-qt)/(Zt-qt),0]:Lt?Te=Lt[Sr]:kt?Te=[(kt[Sr]-qt)/(Zt-qt),0]:Te=[(Ir[2]-qt)/(Zt-qt),0],be.push(Te[0],Te[1]),Ae.push(Sr)}Ke+=1;break;case 3:for(var bt=0;bt<3;++bt)for(var Ve=Ee[bt],Ir=J[Ve],Pe=0;Pe<3;++Pe)if(isNaN(Ir[Pe])||!isFinite(Ir[Pe]))continue e;for(var bt=0;bt<3;++bt){var Ve=Ee[2-bt],Ir=J[Ve];X.push(Ir[0],Ir[1],Ir[2]);var Ce;fe?Ce=fe[Ve]:Fe?Ce=Fe[Sr]:Ce=rt,Ce?this.opacityscale&&Qe?oe.push(Ce[0],Ce[1],Ce[2],this.opacity*F((Qe[Ve]-qt)/(Zt-qt),this.opacityscale)):Ce.length===3?oe.push(Ce[0],Ce[1],Ce[2],this.opacity):(oe.push(Ce[0],Ce[1],Ce[2],Ce[3]*this.opacity),Ce[3]<1&&(this.hasAlpha=!0)):oe.push(.5,.5,.5,1);var Te;st?Te=st[Ve]:Qe?Te=[(Qe[Ve]-qt)/(Zt-qt),0]:Lt?Te=Lt[Sr]:kt?Te=[(kt[Sr]-qt)/(Zt-qt),0]:Te=[(Ir[2]-qt)/(Zt-qt),0],j.push(Te[0],Te[1]);var at;tt?at=tt[Ve]:at=ut[Sr],ne.push(at[0],at[1],at[2]),ee.push(Sr)}Be+=1;break;default:break}}this.pointCount=Ue,this.edgeCount=Ke,this.triangleCount=Be,this.pointPositions.update(ze),this.pointColors.update(Re),this.pointUVs.update(We),this.pointSizes.update(it),this.pointIds.update(new Uint32Array(ot)),this.edgePositions.update(re),this.edgeColors.update(ce),this.edgeUVs.update(be),this.edgeIds.update(new Uint32Array(Ae)),this.trianglePositions.update(X),this.triangleColors.update(oe),this.triangleUVs.update(j),this.triangleNormals.update(ne),this.triangleIds.update(new Uint32Array(ee))}},z.drawTransparent=z.draw=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]);var j={model:$,view:J,projection:X,inverseModel:P.slice(),clipBounds:oe,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};j.inverseModel=d(j.inverseModel,j.model),H.disable(H.CULL_FACE),this.texture.bind(0);var ee=new Array(16);m(ee,j.view,j.model),m(ee,j.projection,ee),d(ee,ee);for(var ne=0;ne<3;++ne)j.eyePosition[ne]=ee[12+ne]/ee[15];for(var re=ee[15],ne=0;ne<3;++ne)re+=this.lightPosition[ne]*ee[4*ne+3];for(var ne=0;ne<3;++ne){for(var ce=ee[12+ne],be=0;be<3;++be)ce+=ee[4*be+ne]*this.lightPosition[be];j.lightPosition[ne]=ce/re}if(this.triangleCount>0){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;_e<Me;++_e)he[_e]=0;e:for(var _e=0;_e<ut;++_e){var fe=ue[_e],Fe=fe.pickSlots;if(!Fe){se[_e]=-1;continue}for(var rt=0;rt<Me;++rt)if(he[rt]+Fe<255){se[_e]=rt,fe.setPickBase(he[rt]+1),he[rt]+=Fe;continue e}var st=s(P,j);se[_e]=Me,H.push(st),he.push(Fe),fe.setPickBase(1),Me+=1}for(;Me>0&&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;ut<ue.length;++ut)ue[ut].dispose();F.dispose();for(var ut=0;ut<H.length;++ut)H[ut].dispose();B.dispose(),P=null,U=null,Q=null,ue=[]}},re._mouseRotating=!1,re._prevButtons=0,re.enableMouseListeners=function(){re.mouseListener=m(y,function(ut,Me,_e){if(!re._stopped){var fe=H.length,Fe=ue.length,rt=z.object;z.distance=1/0,z.mouse[0]=Me,z.mouse[1]=_e,z.object=null,z.screen=null,z.dataCoordinate=z.dataPosition=null;var st=!1;if(ut&&re._prevButtons)re._mouseRotating=!0;else{re._mouseRotating&&(ne=!0),re._mouseRotating=!1;for(var Qe=0;Qe<fe;++Qe){var Lt=H[Qe].query(Me,ce[1]-_e-1,re.pickRadius);if(Lt){if(Lt.distance>z.distance)continue;for(var kt=0;kt<Fe;++kt){var qt=ue[kt];if(se[kt]===Qe){var Zt=qt.pick(Lt);Zt&&(z.buttons=ut,z.screen=Lt.coord,z.distance=Lt.distance,z.object=qt,z.index=Zt.distance,z.dataPosition=Zt.position,z.dataCoordinate=Zt.dataCoordinate,z.data=Zt,st=!0)}}}}}rt&&rt!==z.object&&(rt.highlight&&rt.highlight(null),$=!0),z.object&&(z.object.highlight&&z.object.highlight(z.data),$=!0),st=st||z.object!==rt,st&&re.onselect&&re.onselect(z),ut&1&&!(re._prevButtons&1)&&re.onclick&&re.onclick(z),re._prevButtons=ut}})};function ze(){if(re.contextLost)return!0;P.isContextLost()&&(re.contextLost=!0,re.mouseListener.enabled=!1,re.selection.object=null,re.oncontextloss&&re.oncontextloss())}y.addEventListener("webglcontextlost",ze);function Re(){if(!ze()){P.colorMask(!0,!0,!0,!0),P.depthMask(!0),P.disable(P.BLEND),P.enable(P.DEPTH_TEST),P.depthFunc(P.LEQUAL);for(var ut=ue.length,Me=H.length,_e=0;_e<Me;++_e){var fe=H[_e];fe.shape=ce,fe.begin();for(var Fe=0;Fe<ut;++Fe)if(se[Fe]===_e){var rt=ue[Fe];rt.drawPick&&(rt.pixelRatio=1,rt.drawPick(oe))}fe.end()}}}var We=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],it=[We[0].slice(),We[1].slice()];function ot(){if(!ze()){be();var ut=re.camera.tick();oe.view=re.camera.matrix,$=$||ut,ne=ne||ut,U.pixelRatio=re.pixelRatio,Q.pixelRatio=re.pixelRatio;var Me=ue.length,_e=We[0],fe=We[1];_e[0]=_e[1]=_e[2]=1/0,fe[0]=fe[1]=fe[2]=-1/0;for(var Fe=0;Fe<Me;++Fe){var rt=ue[Fe];rt.pixelRatio=re.pixelRatio,rt.axes=re.axes,$=$||!!rt.dirty,ne=ne||!!rt.dirty;var st=rt.bounds;if(st)for(var Qe=st[0],Lt=st[1],kt=0;kt<3;++kt)_e[kt]=Math.min(_e[kt],Qe[kt]),fe[kt]=Math.max(fe[kt],Lt[kt])}var qt=re.bounds;if(re.autoBounds)for(var kt=0;kt<3;++kt){if(fe[kt]<_e[kt])_e[kt]=-1,fe[kt]=1;else{_e[kt]===fe[kt]&&(_e[kt]-=1,fe[kt]+=1);var Zt=.05*(fe[kt]-_e[kt]);_e[kt]=_e[kt]-Zt,fe[kt]=fe[kt]+Zt}qt[0][kt]=_e[kt],qt[1][kt]=fe[kt]}for(var Sr=!1,kt=0;kt<3;++kt)Sr=Sr||it[0][kt]!==qt[0][kt]||it[1][kt]!==qt[1][kt],it[0][kt]=qt[0][kt],it[1][kt]=qt[1][kt];if(ne=ne||Sr,$=$||Sr,!!$){if(Sr){for(var xr=[0,0,0],Fe=0;Fe<3;++Fe)xr[Fe]=E((qt[1][Fe]-qt[0][Fe])/10);U.autoTicks?U.update({bounds:qt,tickSpacing:xr}):U.update({bounds:qt})}var jr=P.drawingBufferWidth,wr=P.drawingBufferHeight;j[0]=jr,j[1]=wr,ce[0]=Math.max(jr/re.pixelRatio,1)|0,ce[1]=Math.max(wr/re.pixelRatio,1)|0,p(re,O);for(var Fe=0;Fe<Me;++Fe){var rt=ue[Fe];rt.axesBounds=qt,re.clipToBounds&&(rt.clipBounds=qt)}z.object&&(re.snapToData?Q.position=z.dataCoordinate:Q.position=z.dataPosition,Q.bounds=qt),ne&&(ne=!1,Re()),re.axesPixels=n(re.axes,oe,jr,wr),re.onrender&&re.onrender(),P.bindFramebuffer(P.FRAMEBUFFER,null),P.viewport(0,0,jr,wr),re.clearRGBA(),P.depthMask(!0),P.colorMask(!0,!0,!0,!0),P.enable(P.DEPTH_TEST),P.depthFunc(P.LEQUAL),P.disable(P.BLEND),P.disable(P.CULL_FACE);var Ir=!1;U.enable&&(Ir=Ir||U.isTransparent(),U.draw(oe)),Q.axes=U,z.object&&Q.draw(oe),P.disable(P.CULL_FACE);for(var Fe=0;Fe<Me;++Fe){var rt=ue[Fe];rt.axes=U,rt.pixelRatio=re.pixelRatio,rt.isOpaque&&rt.isOpaque()&&rt.draw(oe),rt.isTransparent&&rt.isTransparent()&&(Ir=!0)}if(Ir){F.shape=j,F.bind(),P.clear(P.DEPTH_BUFFER_BIT),P.colorMask(!1,!1,!1,!1),P.depthMask(!0),P.depthFunc(P.LESS),U.enable&&U.isTransparent()&&U.drawTransparent(oe);for(var Fe=0;Fe<Me;++Fe){var rt=ue[Fe];rt.isOpaque&&rt.isOpaque()&&rt.draw(oe)}P.enable(P.BLEND),P.blendEquation(P.FUNC_ADD),P.blendFunc(P.ONE,P.ONE_MINUS_SRC_ALPHA),P.colorMask(!0,!0,!0,!0),P.depthMask(!1),P.clearColor(0,0,0,0),P.clear(P.COLOR_BUFFER_BIT),U.isTransparent()&&U.drawTransparent(oe);for(var Fe=0;Fe<Me;++Fe){var rt=ue[Fe];rt.isTransparent&&rt.isTransparent()&&rt.drawTransparent(oe)}P.bindFramebuffer(P.FRAMEBUFFER,null),P.blendFunc(P.ONE,P.ONE_MINUS_SRC_ALPHA),P.disable(P.DEPTH_TEST),B.bind(),F.color[0].bind(0),B.uniforms.accumBuffer=0,h(P),P.disable(P.BLEND)}$=!1;for(var Fe=0;Fe<Me;++Fe)ue[Fe].dirty=!1}}}function tt(){re._stopped||re.contextLost||(ot(),requestAnimationFrame(tt))}return re.enableMouseListeners(),tt(),re.redraw=function(){re._stopped||($=!0,ot())},re}function p(u,y){var f=u.bounds,P=u.cameraParams,L=P.projection,z=P.model,F=u.gl.drawingBufferWidth,B=u.gl.drawingBufferHeight,O=u.zNear,I=u.zFar,N=u.fovy,U=F/B;y?(T(L,-U,U,-1,1,O,I),P._ortho=!0):(d(L,N,U,O,I),P._ortho=!1);for(var W=0;W<16;++W)z[W]=0;z[15]=1;for(var Q=0,W=0;W<3;++W)Q=Math.max(Q,f[1][W]-f[0][W]);for(var W=0;W<3;++W)u.autoScale?z[5*W]=u.aspect[W]/(f[1][W]-f[0][W]):z[5*W]=1/Q,u.autoCenter&&(z[12+W]=-z[5*W]*.5*(f[0][W]+f[1][W]))}},783:function(e){e.exports=t;function t(r,i,a,n){var o=i[0],s=i[1],c=i[2],h=i[3],m=a[0],d=a[1],T=a[2],l=a[3],_,w,S,E,g;return w=o*m+s*d+c*T+h*l,w<0&&(w=-w,m=-m,d=-d,T=-T,l=-l),1-w>1e-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;_<T.positions.length;++_)for(w=0;w<T.positions[_].length;++w)T.positions[_][w]/=c;for(_=0;_<l.positions.length;++_)for(w=0;w<l.positions[_].length;++w)l.positions[_][w]/=c}var S=[[1/0,1/0],[-1/0,-1/0]],E=l.positions.length;for(_=0;_<E;++_){var g=l.positions[_];for(w=0;w<2;++w)S[0][w]=Math.min(S[0][w],g[w]),S[1][w]=Math.max(S[1][w],g[w])}return m[o]=[T,l,S]}},1283:function(e,t,r){var i=r(9405),a=r(3236),n=a([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
bool outOfRange(float a, float b, float p) {
|
||
return ((p > max(a, b)) ||
|
||
(p < min(a, b)));
|
||
}
|
||
|
||
bool outOfRange(vec2 a, vec2 b, vec2 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y));
|
||
}
|
||
|
||
bool outOfRange(vec3 a, vec3 b, vec3 p) {
|
||
return (outOfRange(a.x, b.x, p.x) ||
|
||
outOfRange(a.y, b.y, p.y) ||
|
||
outOfRange(a.z, b.z, p.z));
|
||
}
|
||
|
||
bool outOfRange(vec4 a, vec4 b, vec4 p) {
|
||
return outOfRange(a.xyz, b.xyz, p.xyz);
|
||
}
|
||
|
||
attribute vec3 position;
|
||
attribute vec4 color;
|
||
attribute vec2 glyph;
|
||
attribute vec4 id;
|
||
|
||
uniform 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)?oe<X.length?ee=X[oe]:ee=void 0:ee=X,ee=m(ee);var re=!0;i(ee)&&(ee="\u25BC",re=!1),ne||(ne={});var ce=ne.family;w(ce)&&(ce=ce[oe]),ce||(ce="normal");var be=ne.weight;w(be)&&(be=be[oe]),be||(be="normal");var Ae=ne.style;w(Ae)&&(Ae=Ae[oe]),Ae||(Ae="normal");var ze=ne.variant;w(ze)&&(ze=ze[oe]),ze||(ze="normal");var Re=h(ee,{family:ce,weight:be,style:Ae,variant:ze},j),Re=h(ee,ne,j);return{mesh:Re[0],lines:Re[1],bounds:Re[2],visible:re}}u.update=function(X){if(X=X||{},"perspective"in X&&(this.useOrtho=!X.perspective),"orthographic"in X&&(this.useOrtho=!!X.orthographic),"lineWidth"in X&&(this.lineWidth=X.lineWidth),"project"in X)if(w(X.project))this.axesProject=X.project;else{var oe=!!X.project;this.axesProject=[oe,oe,oe]}if("projectScale"in X)if(w(X.projectScale))this.projectScale=X.projectScale.slice();else{var ne=+X.projectScale;this.projectScale=[ne,ne,ne]}if(this.projectHasAlpha=!1,"projectOpacity"in X){if(w(X.projectOpacity))this.projectOpacity=X.projectOpacity.slice();else{var ne=+X.projectOpacity;this.projectOpacity=[ne,ne,ne]}for(var j=0;j<3;++j)this.projectOpacity[j]=b(this.projectOpacity[j]),this.projectOpacity[j]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in X&&(this.opacity=b(X.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ee=X.position,re={family:X.font||"normal",style:X.fontStyle||"normal",weight:X.fontWeight||"normal",variant:X.fontVariant||"normal"},ce=X.alignment||[0,0],be,Ae;if(ce.length===2)be=ce[0],Ae=ce[1];else{be=[],Ae=[];for(var j=0;j<ce.length;++j)be[j]=ce[j][0],Ae[j]=ce[j][1]}var ze=[1/0,1/0,1/0],Re=[-1/0,-1/0,-1/0],We=X.glyph,it=X.color,ot=X.size,tt=X.angle,ut=X.lineColor,Me=-1,_e=0,fe=0,Fe=0;if(ee.length){Fe=ee.length;e:for(var j=0;j<Fe;++j){for(var rt=ee[j],st=0;st<3;++st)if(isNaN(rt[st])||!isFinite(rt[st]))continue e;var Qe=$(We,j,re,this.pixelRatio),Lt=Qe.mesh,kt=Qe.lines,qt=Qe.bounds;_e+=Lt.cells.length*3,fe+=kt.edges.length*2}}var Zt=_e+fe,Sr=o.mallocFloat(3*Zt),xr=o.mallocFloat(4*Zt),jr=o.mallocFloat(2*Zt),wr=o.mallocUint32(Zt);if(Zt>0){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;j<Fe;++j){Me+=1;for(var rt=ee[j],st=0;st<3;++st){if(isNaN(rt[st])||!isFinite(rt[st]))continue e;Re[st]=Math.max(Re[st],rt[st]),ze[st]=Math.min(ze[st],rt[st])}var Qe=$(We,j,re,this.pixelRatio),Lt=Qe.mesh,kt=Qe.lines,qt=Qe.bounds,Ve=Qe.visible;if(!Ve)Be=[1,1,1,0];else if(w(it)){var Ce;if(Ue?j<it.length?Ce=it[j]:Ce=[0,0,0,0]:Ce=it,Ce.length===3){for(var st=0;st<3;++st)Be[st]=Ce[st];Be[3]=1}else if(Ce.length===4){for(var st=0;st<4;++st)Be[st]=Ce[st];!this.hasAlpha&&Ce[3]<1&&(this.hasAlpha=!0)}}else Be[0]=Be[1]=Be[2]=0,Be[3]=1;if(!Ve)Ke=[1,1,1,0];else if(w(ut)){var Ce;if(Ee?j<ut.length?Ce=ut[j]:Ce=[0,0,0,0]:Ce=ut,Ce.length===3){for(var st=0;st<3;++st)Ke[st]=Ce[st];Ke[st]=1}else if(Ce.length===4){for(var st=0;st<4;++st)Ke[st]=Ce[st];!this.hasAlpha&&Ce[3]<1&&(this.hasAlpha=!0)}}else Ke[0]=Ke[1]=Ke[2]=0,Ke[3]=1;var Te=.5;Ve?w(ot)?j<ot.length?Te=+ot[j]:Te=12:ot?Te=+ot:this.useOrtho&&(Te=12):Te=0;var Pe=0;w(tt)?j<tt.length?Pe=+tt[j]:Pe=0:tt&&(Pe=+tt);for(var at=Math.cos(Pe),yt=Math.sin(Pe),rt=ee[j],st=0;st<3;++st)Re[st]=Math.max(Re[st],rt[st]),ze[st]=Math.min(ze[st],rt[st]);var Tt=be,Ot=Ae,Tt=0;w(be)?j<be.length?Tt=be[j]:Tt=0:be&&(Tt=be);var Ot=0;w(Ae)?j<Ae.length?Ot=Ae[j]:Ot=0:Ae&&(Ot=Ae),Tt*=Tt>0?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;st<Ua.length;++st)for(var rr=Ua[st],Qt=0;Qt<3;++Qt){for(var Tr=0;Tr<3;++Tr)Sr[3*Ir+Tr]=rt[Tr];for(var Tr=0;Tr<4;++Tr)xr[4*Ir+Tr]=Be[Tr];wr[Ir]=Me;var la=Ba[rr[Qt]];jr[2*Ir]=Te*(at*la[0]-yt*la[1]+Gt[0]),jr[2*Ir+1]=Te*(yt*la[0]+at*la[1]+Gt[1]),Ir+=1}for(var Ua=kt.edges,Ba=kt.positions,st=0;st<Ua.length;++st)for(var rr=Ua[st],Qt=0;Qt<2;++Qt){for(var Tr=0;Tr<3;++Tr)Sr[3*bt+Tr]=rt[Tr];for(var Tr=0;Tr<4;++Tr)xr[4*bt+Tr]=Ke[Tr];wr[bt]=Me;var la=Ba[rr[Qt]];jr[2*bt]=Te*(at*la[0]-yt*la[1]+Gt[0]),jr[2*bt+1]=Te*(yt*la[0]+at*la[1]+Gt[1]),bt+=1}}}this.bounds=[ze,Re],this.points=ee,this.pointCount=ee.length,this.vertexCount=_e,this.lineVertexCount=fe,this.pointBuffer.update(Sr),this.colorBuffer.update(xr),this.glyphBuffer.update(jr),this.idBuffer.update(wr),o.free(Sr),o.free(xr),o.free(jr),o.free(wr)},u.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()};function J(X){var oe=X.gl,ne=c.createPerspective(oe),j=c.createOrtho(oe),ee=c.createProject(oe),re=c.createPickPerspective(oe),ce=c.createPickOrtho(oe),be=c.createPickProject(oe),Ae=a(oe),ze=a(oe),Re=a(oe),We=a(oe),it=n(oe,[{buffer:Ae,size:3,type:oe.FLOAT},{buffer:ze,size:4,type:oe.FLOAT},{buffer:Re,size:2,type:oe.FLOAT},{buffer:We,size:4,type:oe.UNSIGNED_BYTE,normalized:!0}]),ot=new p(oe,ne,j,ee,Ae,ze,Re,We,it,re,ce,be);return ot.update(X),ot}},3589:function(e,t,r){"use strict";e.exports=d;var i=r(2260),a=r(1888),n=r(9618),o=r(8828).nextPow2,s=function(T,l,_){for(var w=1e8,S=-1,E=-1,g=T.shape[0],b=T.shape[1],p=0;p<g;p++)for(var u=0;u<b;u++){var y=T.get(p,u,0),f=T.get(p,u,1),P=T.get(p,u,2),L=T.get(p,u,3);if(y<255||f<255||P<255||L<255){var z=l-p,F=_-u,B=z*z+F*F;B<w&&(w=B,S=p,E=u)}}return[S,E,w]};function c(T,l,_,w,S){this.coord=[T,l],this.id=_,this.value=w,this.distance=S}function h(T,l,_){this.gl=T,this.fbo=l,this.buffer=_,this._readTimeout=null;var w=this;this._readCallback=function(){w.gl&&(l.bind(),T.readPixels(0,0,l.shape[0],l.shape[1],T.RGBA,T.UNSIGNED_BYTE,w.buffer),w._readTimeout=null)}}var m=h.prototype;Object.defineProperty(m,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(T){if(this.gl){this.fbo.shape=T;var l=this.fbo.shape[0],_=this.fbo.shape[1];if(_*l*4>this.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)<y[2])return null;var L=u.get(f,P,0),z=u.get(f,P,1),F=u.get(f,P,2),B=u.get(f,P,3);return new c(f+S|0,P+g|0,L,[z,F,B],Math.sqrt(y[2]))},m.dispose=function(){this.gl&&(this.fbo.dispose(),a.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))};function d(T,l){var _=l[0],w=l[1],S={},E=i(T,_,w,S),g=a.mallocUint8(_*w*4);return new h(T,E,g)}},9405:function(e,t,r){"use strict";var i=r(3327),a=r(8731),n=r(216),o=r(5091),s=r(2145),c=r(8866);function h(l){this.gl=l,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var m=h.prototype;m.bind=function(){this.program||this._relink();var l,_=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),w=this.gl.lastAttribCount;if(_>w)for(l=w;l<_;l++)this.gl.enableVertexAttribArray(l);else if(w>_)for(l=_;l<w;l++)this.gl.disableVertexAttribArray(l);this.gl.lastAttribCount=_,this.gl.useProgram(this.program)},m.dispose=function(){for(var l=this.gl.lastAttribCount,_=0;_<l;_++)this.gl.disableVertexAttribArray(_);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null};function d(l,_){return l.name<_.name?-1:1}m.update=function(l,_,w,S){if(!_||arguments.length===1){var E=l;l=E.vertex,_=E.fragment,w=E.uniforms,S=E.attributes}var g=this,b=g.gl,p=g._vref;g._vref=o.shader(b,b.VERTEX_SHADER,l),p&&p.dispose(),g.vertShader=g._vref.shader;var u=this._fref;if(g._fref=o.shader(b,b.FRAGMENT_SHADER,_),u&&u.dispose(),g.fragShader=g._fref.shader,!w||!S){var y=b.createProgram();if(b.attachShader(y,g.fragShader),b.attachShader(y,g.vertShader),b.linkProgram(y),!b.getProgramParameter(y,b.LINK_STATUS)){var f=b.getProgramInfoLog(y);throw new c(f,"Error linking program:"+f)}w=w||s.uniforms(b,y),S=S||s.attributes(b,y),b.deleteProgram(y)}S=S.slice(),S.sort(d);var P=[],L=[],z=[],F;for(F=0;F<S.length;++F){var B=S[F];if(B.type.indexOf("mat")>=0){for(var O=B.type.charAt(B.type.length-1)|0,I=new Array(O),N=0;N<O;++N)I[N]=z.length,L.push(B.name+"["+N+"]"),typeof B.location=="number"?z.push(B.location+N):Array.isArray(B.location)&&B.location.length===O&&typeof B.location[N]=="number"?z.push(B.location[N]|0):z.push(-1);P.push({name:B.name,type:B.type,locations:I})}else P.push({name:B.name,type:B.type,locations:[z.length]}),L.push(B.name),typeof B.location=="number"?z.push(B.location|0):z.push(-1)}var U=0;for(F=0;F<z.length;++F)if(z[F]<0){for(;z.indexOf(U)>=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<w.length;++ue)W[ue]=b.getUniformLocation(g.program,w[ue].name)}Q(),g._relink=Q,g.types={uniforms:n(w),attributes:n(S)},g.attributes=a(b,g,P,z),Object.defineProperty(g,"uniforms",i(b,g,w,W))};function T(l,_,w,S,E){var g=new h(l);return g.update(_,w,S,E),g}e.exports=T},8866:function(e){function t(r,i,a){this.shortMessage=i||"",this.longMessage=a||"",this.rawError=r||"",this.message="gl-shader: "+(i||r||"")+(a?`
|
||
`+a:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t},8731:function(e,t,r){"use strict";e.exports=h;var i=r(8866);function a(m,d,T,l,_,w){this._gl=m,this._wrapper=d,this._index=T,this._locations=l,this._dimension=_,this._constFunc=w}var n=a.prototype;n.pointer=function(d,T,l,_){var w=this,S=w._gl,E=w._locations[w._index];S.vertexAttribPointer(E,w._dimension,d||S.FLOAT,!!T,l||0,_||0),S.enableVertexAttribArray(E)},n.set=function(m,d,T,l){return this._constFunc(this._locations[this._index],m,d,T,l)},Object.defineProperty(n,"location",{get:function(){return this._locations[this._index]},set:function(m){return m!==this._locations[this._index]&&(this._locations[this._index]=m|0,this._wrapper.program=null),m|0}});var o=[function(m,d,T){return T.length===void 0?m.vertexAttrib1f(d,T):m.vertexAttrib1fv(d,T)},function(m,d,T,l){return T.length===void 0?m.vertexAttrib2f(d,T,l):m.vertexAttrib2fv(d,T)},function(m,d,T,l,_){return T.length===void 0?m.vertexAttrib3f(d,T,l,_):m.vertexAttrib3fv(d,T)},function(m,d,T,l,_,w){return T.length===void 0?m.vertexAttrib4f(d,T,l,_,w):m.vertexAttrib4fv(d,T)}];function s(m,d,T,l,_,w,S){var E=o[_],g=new a(m,d,T,l,_,E);Object.defineProperty(w,S,{set:function(b){return m.disableVertexAttribArray(l[T]),E(m,l[T],b),b},get:function(){return g},enumerable:!0})}function c(m,d,T,l,_,w,S){for(var E=new Array(_),g=new Array(_),b=0;b<_;++b)s(m,d,T[b],l,_,E,b),g[b]=E[b];Object.defineProperty(E,"location",{set:function(y){if(Array.isArray(y))for(var f=0;f<_;++f)g[f].location=y[f];else for(var f=0;f<_;++f)g[f].location=y+f;return y},get:function(){for(var y=new Array(_),f=0;f<_;++f)y[f]=l[T[f]];return y},enumerable:!0}),E.pointer=function(y,f,P,L){y=y||m.FLOAT,f=!!f,P=P||_*_,L=L||0;for(var z=0;z<_;++z){var F=l[T[z]];m.vertexAttribPointer(F,_,y,f,P,L+z*_),m.enableVertexAttribArray(F)}};var p=new Array(_),u=m["vertexAttrib"+_+"fv"];Object.defineProperty(w,S,{set:function(y){for(var f=0;f<_;++f){var P=l[T[f]];if(m.disableVertexAttribArray(P),Array.isArray(y[0]))u.call(m,P,y[f]);else{for(var L=0;L<_;++L)p[L]=y[_*f+L];u.call(m,P,p)}}return y},get:function(){return E},enumerable:!0})}function h(m,d,T,l){for(var _={},w=0,S=T.length;w<S;++w){var E=T[w],g=E.name,b=E.type,p=E.locations;switch(b){case"bool":case"int":case"float":s(m,d,p[0],l,1,_,g);break;default:if(b.indexOf("vec")>=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;d<c;++d)m[d]=h;return m}function s(c,h,m,d){function T(b){return function(p,u,y){return p.getUniform(u.program,y[b])}}function l(b){return function(u){for(var y=_("",b),f=0;f<y.length;++f){var P=y[f],L=P[0],z=P[1];if(d[z]){var F=u;if(typeof L=="string"&&(L.indexOf(".")===0||L.indexOf("[")===0)){var B=L;if(L.indexOf(".")===0&&(B=L.slice(1)),B.indexOf("]")===B.length-1){var O=B.indexOf("["),I=B.slice(0,O),N=B.slice(O+1,B.length-1);F=I?u[I][N]:u[N]}else F=u[B]}var U=m[z].type,W;switch(U){case"bool":case"int":case"sampler2D":case"samplerCube":c.uniform1i(d[z],F);break;case"float":c.uniform1f(d[z],F);break;default:var Q=U.indexOf("vec");if(0<=Q&&Q<=1&&U.length===4+Q){if(W=U.charCodeAt(U.length-1)-48,W<2||W>4)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;u<b.length;++u)S(p,u,b[u])}else{p={};for(var y in b)S(p,y,b[y])}return p}var g=i(m,!0);return{get:n(E(g)),set:l(g),enumerable:!0,configurable:!0}}},216:function(e){"use strict";e.exports=t;function t(r,i){for(var a={},n=0;n<r.length;++n)for(var o=r[n].name,s=o.split("."),c=a,h=0;h<s.length;++h){var m=s[h].split("[");if(m.length>1){m[0]in c||(c[m[0]]=[]),c=c[m[0]];for(var d=1;d<m.length;++d){var T=parseInt(m[d]);d<m.length-1||h<s.length-1?(T in c||(d<m.length-1?c[T]=[]:c[T]={}),c=c[T]):i?c[T]=n:c[T]=r[n].type}}else h<s.length-1?(m[0]in c||(c[m[0]]={}),c=c[m[0]]):i?c[m[0]]=n:c[m[0]]=r[n].type}return a}},2145:function(e,t){"use strict";t.uniforms=n,t.attributes=o;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},i=null;function a(s,c){if(!i){var h=Object.keys(r);i={};for(var m=0;m<h.length;++m){var d=h[m];i[s[d]]=r[d]}}return i[c]}function n(s,c){for(var h=s.getProgramParameter(c,s.ACTIVE_UNIFORMS),m=[],d=0;d<h;++d){var T=s.getActiveUniform(c,d);if(T){var l=a(s,T.type);if(T.size>1)for(var _=0;_<T.size;++_)m.push({name:T.name.replace("[0]","["+_+"]"),type:l});else m.push({name:T.name,type:l})}}return m}function o(s,c){for(var h=s.getProgramParameter(c,s.ACTIVE_ATTRIBUTES),m=[],d=0;d<h;++d){var T=s.getActiveAttrib(c,d);T&&m.push({name:T.name,type:a(s,T.type)})}return m}},5091:function(e,t,r){"use strict";t.shader=_,t.program=w;var i=r(8866),a=r(2992),n=typeof WeakMap>"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<p;++b){var u=S.programs[g[b]];u&&(delete S.programs[b],E.deleteProgram(u))}E.deleteShader(this.shader),delete S.shaders[this.type===E.FRAGMENT_SHADER|0][this.src]}};function h(S){this.gl=S,this.shaders=[{},{}],this.programs={}}var m=h.prototype;function d(S,E,g){var b=S.createShader(E);if(S.shaderSource(b,g),S.compileShader(b),!S.getShaderParameter(b,S.COMPILE_STATUS)){var p=S.getShaderInfoLog(b);try{var u=a(p,g,E)}catch(y){throw console.warn("Failed to format compiler error: "+y),new i(p,`Error compiling shader:
|
||
`+p)}throw new i(p,u.short,u.long)}return b}m.getShaderReference=function(S,E){var g=this.gl,b=this.shaders[S===g.FRAGMENT_SHADER|0],p=b[E];if(!p||!g.isShader(p.shader)){var u=d(g,S,E);p=b[E]=new c(s++,E,S,u,[],1,this)}else p.count+=1;return p};function T(S,E,g,b,p){var u=S.createProgram();S.attachShader(u,E),S.attachShader(u,g);for(var y=0;y<b.length;++y)S.bindAttribLocation(u,p[y],b[y]);if(S.linkProgram(u),!S.getProgramParameter(u,S.LINK_STATUS)){var f=S.getProgramInfoLog(u);throw new i(f,"Error linking program: "+f)}return u}m.getProgram=function(S,E,g,b){var p=[S.id,E.id,g.join(":"),b.join(":")].join("@"),u=this.programs[p];return(!u||!this.gl.isProgram(u))&&(this.programs[p]=u=T(this.gl,S.shader,E.shader,g,b),S.programs.push(p),E.programs.push(p)),u};function l(S){var E=o.get(S);return E||(E=new h(S),o.set(S,E)),E}function _(S,E,g){return l(S).getShaderReference(E,g)}function w(S,E,g,b,p){return l(S).getProgram(E,g,b,p)}},1493:function(e,t,r){"use strict";var i=r(3236),a=r(9405),n=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
|
||
attribute vec3 position, color;
|
||
attribute float weight;
|
||
|
||
uniform mat4 model, view, projection;
|
||
uniform vec3 coordinates[3];
|
||
uniform vec4 colors[3];
|
||
uniform vec2 screenShape;
|
||
uniform float lineWidth;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
vec3 vertexPosition = mix(coordinates[0],
|
||
mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));
|
||
|
||
vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));
|
||
vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;
|
||
vec2 delta = weight * clipOffset * screenShape;
|
||
vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;
|
||
|
||
gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);
|
||
fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];
|
||
}
|
||
`]),o=i([`precision mediump float;
|
||
#define GLSLIFY 1
|
||
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
gl_FragColor = fragColor;
|
||
}`]);e.exports=function(s){return a(s,n,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(e,t,r){"use strict";var i=r(2762),a=r(8116),n=r(1493);e.exports=T;var 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.buffer=_,this.vao=w,this.shader=S,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var c=s.prototype,h=[0,0,0],m=[0,0,0],d=[0,0];c.isTransparent=function(){return!1},c.drawTransparent=function(l){},c.draw=function(l){var _=this.gl,w=this.vao,S=this.shader;w.bind(),S.bind();var E=l.model||o,g=l.view||o,b=l.projection||o,p;this.axes&&(p=this.axes.lastCubeProps.axis);for(var u=h,y=m,f=0;f<3;++f)p&&p[f]<0?(u[f]=this.bounds[0][f],y[f]=this.bounds[1][f]):(u[f]=this.bounds[1][f],y[f]=this.bounds[0][f]);d[0]=_.drawingBufferWidth,d[1]=_.drawingBufferHeight,S.uniforms.model=E,S.uniforms.view=g,S.uniforms.projection=b,S.uniforms.coordinates=[this.position,u,y],S.uniforms.colors=this.colors,S.uniforms.screenShape=d;for(var f=0;f<3;++f)S.uniforms.lineWidth=this.lineWidth[f]*this.pixelRatio,this.enabled[f]&&(w.draw(_.TRIANGLES,6,6*f),this.drawSides[f]&&w.draw(_.TRIANGLES,12,18+12*f));w.unbind()},c.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},c.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,_){var w=[];function S(u,y,f,P,L,z){var F=[u,y,f,0,0,0,1];F[P+3]=1,F[P]=L,w.push.apply(w,F),F[6]=-1,w.push.apply(w,F),F[P]=z,w.push.apply(w,F),w.push.apply(w,F),F[6]=1,w.push.apply(w,F),F[P]=L,w.push.apply(w,F)}S(0,0,0,0,0,1),S(0,0,0,1,0,1),S(0,0,0,2,0,1),S(1,0,0,1,-1,1),S(1,0,0,2,-1,1),S(0,1,0,0,-1,1),S(0,1,0,2,-1,1),S(0,0,1,0,-1,1),S(0,0,1,1,-1,1);var E=i(l,w),g=a(l,[{type:l.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:E,size:1,offset:24,stride:28}]),b=n(l);b.attributes.position.location=0,b.attributes.color.location=1,b.attributes.weight.location=2;var p=new s(l,E,g,b);return p.update(_),p}},6740: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 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;Q<p.length;Q++){var ue=p[Q],se=u[Q],he=y[Q];E===0&&(he=g*.05),I=i.length(se)/b,N=a.create(),i.copy(N,se),N[3]=he;for(var H=0;H<W;H++)F[H]=[ue[0],ue[1],ue[2],H];if(z.length>0)for(var H=0;H<W;H++){var $=(H+1)%W;f.push(z[H],F[H],F[$],F[$],z[$],z[H]),L.push(U,N,N,N,U,U),B.push(O,I,I,I,O,O);var J=f.length;P.push([J-6,J-5,J-4],[J-3,J-2,J-1])}var X=z;z=F,F=X;var oe=U;U=N,N=oe;var ne=O;O=I,I=ne}return{positions:f,cells:P,vectors:L,vertexIntensity:B}},s=function(S,E,g,b){for(var p=0,u=0;u<S.length;u++)for(var y=S[u].velocities,f=0;f<y.length;f++)p=Math.max(p,i.length(y[f]));for(var P=S.map(function(Q){return o(Q,g,b,p)}),L=[],z=[],F=[],B=[],u=0;u<P.length;u++){var O=P[u],I=L.length;L=L.concat(O.positions),F=F.concat(O.vectors),B=B.concat(O.vertexIntensity);for(var f=0;f<O.cells.length;f++){var N=O.cells[f],U=[];z.push(U);for(var W=0;W<N.length;W++)U.push(N[W]+I)}}return{positions:L,cells:z,vectors:F,vertexIntensity:B,colormap:E}},c=function(S,E){var g=S.length,b;for(b=0;b<g;b++){var p=S[b];if(p===E)return b;if(p>E)return b-1}return b},h=function(S,E,g){return S<E?E:S>g?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;b<g;b++){var p=Math.abs(S[b]-S[b-1]);p<E&&(E=p)}return E},l=function(S){for(var E=[],g=[],b=[],p={},u={},y={},f=S.length,P=0;P<f;P++){var L=S[P],z=L[0],F=L[1],B=L[2];p[z]||(E.push(z),p[z]=!0),u[F]||(g.push(F),u[F]=!0),y[B]||(b.push(B),y[B]=!0)}var O=T(E),I=T(g),N=T(b),U=Math.min(O,I,N);return isFinite(U)?U:1};e.exports=function(S,E){var g=S.startingPositions,b=S.maxLength||1e3,p=S.tubeSize||1,u=S.absoluteTubeSize,y=S.gridFill||"+x+y+z",f={};y.indexOf("-x")!==-1&&(f.reversedX=!0),y.indexOf("-y")!==-1&&(f.reversedY=!0),y.indexOf("-z")!==-1&&(f.reversedZ=!0),f.filled=n.indexOf(y.replace(/-/g,"").replace(/\+/g,""));var P=S.getVelocity||function(it){return m(it,S,f)},L=S.getDivergence||function(it,ot){var tt=i.create(),ut=1e-4;i.add(tt,it,[ut,0,0]);var Me=P(tt);i.subtract(Me,Me,ot),i.scale(Me,Me,1/ut),i.add(tt,it,[0,ut,0]);var _e=P(tt);i.subtract(_e,_e,ot),i.scale(_e,_e,1/ut),i.add(tt,it,[0,0,ut]);var fe=P(tt);return i.subtract(fe,fe,ot),i.scale(fe,fe,1/ut),i.add(tt,Me,_e),i.add(tt,tt,fe),tt},z=[],F=E[0][0],B=E[0][1],O=E[0][2],I=E[1][0],N=E[1][1],U=E[1][2],W=function(it){var ot=it[0],tt=it[1],ut=it[2];return!(ot<F||ot>I||tt<B||tt>N||ut<O||ut>U)},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;Ae<b*100&&oe.length<b&&W(X);){Ae++;var ze=i.clone(j),Re=i.squaredLength(ze);if(Re===0)break;if(Re>se&&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;ee<j.length;++ee){if(j.length<2)return 1;if(j[ee][0]===ne)return j[ee][1];if(j[ee][0]>ne&&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<this.contourLevels[ce].length;++Ae)Ae===this.highlightLevel[ce]?(ot.uniforms.contourColor=this.highlightColor[ce],ot.uniforms.contourTint=this.highlightTint[ce]):(Ae===0||Ae-1===this.highlightLevel[ce])&&(ot.uniforms.contourColor=this.contourColor[ce],ot.uniforms.contourTint=this.contourTint[ce]),this._contourCounts[ce][Ae]&&(ot.uniforms.height=this.contourLevels[ce][Ae],tt.draw(ee.LINES,this._contourCounts[ce][Ae],this._contourOffsets[ce][Ae]));for(ce=0;ce<3;++ce)for(ot.uniforms.model=it.projections[ce],ot.uniforms.clipBounds=it.clipBounds[ce],Ae=0;Ae<3;++Ae)if(this.contourProject[ce][Ae]){ot.uniforms.permutation=L[Ae],ee.lineWidth(this.contourWidth[Ae]*this.pixelRatio);for(var ut=0;ut<this.contourLevels[Ae].length;++ut)ut===this.highlightLevel[Ae]?(ot.uniforms.contourColor=this.highlightColor[Ae],ot.uniforms.contourTint=this.highlightTint[Ae]):(ut===0||ut-1===this.highlightLevel[Ae])&&(ot.uniforms.contourColor=this.contourColor[Ae],ot.uniforms.contourTint=this.contourTint[Ae]),this._contourCounts[Ae][ut]&&(ot.uniforms.height=this.contourLevels[Ae][ut],tt.draw(ee.LINES,this._contourCounts[Ae][ut],this._contourOffsets[Ae][ut]))}for(tt.unbind(),tt=this._dynamicVAO,tt.bind(),ce=0;ce<3;++ce)if(this._dynamicCounts[ce]!==0)for(ot.uniforms.model=re.model,ot.uniforms.clipBounds=re.clipBounds,ot.uniforms.permutation=L[ce],ee.lineWidth(this.dynamicWidth[ce]*this.pixelRatio),ot.uniforms.contourColor=this.dynamicColor[ce],ot.uniforms.contourTint=this.dynamicTint[ce],ot.uniforms.height=this.dynamicLevel[ce],tt.draw(ee.LINES,this._dynamicCounts[ce],this._dynamicOffsets[ce]),Ae=0;Ae<3;++Ae)this.contourProject[Ae][ce]&&(ot.uniforms.model=it.projections[Ae],ot.uniforms.clipBounds=it.clipBounds[Ae],tt.draw(ee.LINES,this._dynamicCounts[ce],this._dynamicOffsets[ce]));tt.unbind()}}O.draw=function(ne){return he.call(this,ne,!1)},O.drawTransparent=function(ne){return he.call(this,ne,!0)};var H={model:f,view:f,projection:f,inverseModel:f,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};O.drawPick=function(ne){ne=ne||{};var j=this.gl;j.disable(j.CULL_FACE);var ee=H;ee.model=ne.model||f,ee.view=ne.view||f,ee.projection=ne.projection||f,ee.shape=this._field[2].shape,ee.pickId=this.pickId/255,ee.lowerBound=this.bounds[0],ee.upperBound=this.bounds[1],ee.objectOffset=this.objectOffset,ee.permutation=se;for(var re=0;re<2;++re)for(var ce=ee.clipBounds[re],be=0;be<3;++be)ce[be]=Math.min(Math.max(this.clipBounds[re][be],-1e8),1e8);var Ae=W(ee,this);if(Ae.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=ee,this._vao.bind(),this._vao.draw(j.TRIANGLES,this._vertexCount),re=0;re<3;++re)this.surfaceProject[re]&&(this._pickShader.uniforms.model=Ae.projections[re],this._pickShader.uniforms.clipBounds=Ae.clipBounds[re],this._vao.draw(j.TRIANGLES,this._vertexCount));this._vao.unbind()}if(Ae.showContour){var ze=this._contourPickShader;ze.bind(),ze.uniforms=ee;var Re=this._contourVAO;for(Re.bind(),be=0;be<3;++be)for(j.lineWidth(this.contourWidth[be]*this.pixelRatio),ze.uniforms.permutation=L[be],re=0;re<this.contourLevels[be].length;++re)this._contourCounts[be][re]&&(ze.uniforms.height=this.contourLevels[be][re],Re.draw(j.LINES,this._contourCounts[be][re],this._contourOffsets[be][re]));for(re=0;re<3;++re)for(ze.uniforms.model=Ae.projections[re],ze.uniforms.clipBounds=Ae.clipBounds[re],be=0;be<3;++be)if(this.contourProject[re][be]){ze.uniforms.permutation=L[be],j.lineWidth(this.contourWidth[be]*this.pixelRatio);for(var We=0;We<this.contourLevels[be].length;++We)this._contourCounts[be][We]&&(ze.uniforms.height=this.contourLevels[be][We],Re.draw(j.LINES,this._contourCounts[be][We],this._contourOffsets[be][We]))}Re.unbind()}},O.pick=function(ne){if(!ne||ne.id!==this.pickId)return null;var j=this._field[2].shape,ee=this._pickResult,re=j[0]*(ne.value[0]+(ne.value[2]>>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]<this.contourLevels[st].length-1){var Qe=this.contourLevels[st][rt[st]],Lt=this.contourLevels[st][rt[st]+1];Math.abs(Qe-We[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;tt<ce[0];++tt)this._field[0].set(tt+1,0,tt);for(this._field[0].set(ce[0]+1,0,ce[0]-1),this._field[1].set(0,0,0),tt=0;tt<ce[1];++tt)this._field[1].set(0,tt+1,tt);this._field[1].set(0,ce[1]+1,ce[1]-1)}var ut=this._field,Me=d(s.mallocFloat(ut[2].size*3*2),[3,ce[0]+2,ce[1]+2,2]);for(be=0;be<3;++be)S(Me.pick(be),ut[be],"mirror");var _e=d(s.mallocFloat(ut[2].size*3),[ce[0]+2,ce[1]+2,3]);for(be=0;be<ce[0]+2;++be)for(tt=0;tt<ce[1]+2;++tt){var fe=Me.get(0,be,tt,0),Fe=Me.get(0,be,tt,1),rt=Me.get(1,be,tt,0),st=Me.get(1,be,tt,1),Qe=Me.get(2,be,tt,0),Lt=Me.get(2,be,tt,1),kt=rt*Lt-st*Qe,qt=Qe*Fe-Lt*fe,Zt=fe*st-Fe*rt,Sr=Math.sqrt(kt*kt+qt*qt+Zt*Zt);Sr<1e-8?(Sr=Math.max(Math.abs(kt),Math.abs(qt),Math.abs(Zt)),Sr<1e-8?(Zt=1,qt=kt=0,Sr=1):Sr=1/Sr):Sr=1/Math.sqrt(Sr),_e.set(be,tt,0,kt*Sr),_e.set(be,tt,1,qt*Sr),_e.set(be,tt,2,Zt*Sr)}s.free(Me.data);var xr=[1/0,1/0,1/0],jr=[-1/0,-1/0,-1/0],wr=1/0,Ir=-1/0,bt=(ce[0]-1)*(ce[1]-1)*6,Be=s.mallocFloat(i.nextPow2(10*bt)),Ke=0,Ue=0;for(be=0;be<ce[0]-1;++be)e:for(tt=0;tt<ce[1]-1;++tt){for(var Ee=0;Ee<2;++Ee)for(var Ve=0;Ve<2;++Ve)for(var Ce=0;Ce<3;++Ce){var Te=this._field[Ce].get(1+be+Ee,1+tt+Ve);if(isNaN(Te)||!isFinite(Te))continue e}for(Ce=0;Ce<6;++Ce){var Pe=be+P[Ce][0],at=tt+P[Ce][1],yt=this._field[0].get(Pe+1,at+1),Tt=this._field[1].get(Pe+1,at+1);Te=this._field[2].get(Pe+1,at+1),kt=_e.get(Pe+1,at+1,0),qt=_e.get(Pe+1,at+1,1),Zt=_e.get(Pe+1,at+1,2),ne.intensity&&(Ot=ne.intensity.get(Pe,at));var Ot=ne.intensity?ne.intensity.get(Pe,at):Te+this.objectOffset[2];Be[Ke++]=Pe,Be[Ke++]=at,Be[Ke++]=yt,Be[Ke++]=Tt,Be[Ke++]=Te,Be[Ke++]=0,Be[Ke++]=Ot,Be[Ke++]=kt,Be[Ke++]=qt,Be[Ke++]=Zt,xr[0]=Math.min(xr[0],yt+this.objectOffset[0]),xr[1]=Math.min(xr[1],Tt+this.objectOffset[1]),xr[2]=Math.min(xr[2],Te+this.objectOffset[2]),wr=Math.min(wr,Ot),jr[0]=Math.max(jr[0],yt+this.objectOffset[0]),jr[1]=Math.max(jr[1],Tt+this.objectOffset[1]),jr[2]=Math.max(jr[2],Te+this.objectOffset[2]),Ir=Math.max(Ir,Ot),Ue+=1}}for(ne.intensityBounds&&(wr=+ne.intensityBounds[0],Ir=+ne.intensityBounds[1]),be=6;be<Ke;be+=10)Be[be]=(Be[be]-wr)/(Ir-wr);this._vertexCount=Ue,this._coordinateBuffer.update(Be.subarray(0,Ke)),s.freeFloat(Be),s.free(_e.data),this.bounds=[xr,jr],this.intensity=ne.intensity||this._field[2],(this.intensityBounds[0]!==wr||this.intensityBounds[1]!==Ir)&&(ee=!0),this.intensityBounds=[wr,Ir]}if("levels"in ne){var Gt=ne.levels;for(Array.isArray(Gt[0])?Gt=Gt.slice():Gt=[[],[],Gt],be=0;be<3;++be)Gt[be]=Gt[be].slice(),Gt[be].sort(function(yn,xt){return yn-xt});for(be=0;be<3;++be)for(tt=0;tt<Gt[be].length;++tt)Gt[be][tt]-=this.objectOffset[be];e:for(be=0;be<3;++be){if(Gt[be].length!==this.contourLevels[be].length){ee=!0;break}for(tt=0;tt<Gt[be].length;++tt)if(Gt[be][tt]!==this.contourLevels[be][tt]){ee=!0;break e}}this.contourLevels=Gt}if(ee){ut=this._field,ce=this.shape;for(var rr=[],Qt=0;Qt<3;++Qt){var Tr=this.contourLevels[Qt],la=[],Ua=[],Ba=[0,0,0];for(be=0;be<Tr.length;++be){var Ra=T(this._field[Qt],Tr[be]);la.push(rr.length/5|0),Ue=0;e:for(tt=0;tt<Ra.cells.length;++tt){var Qa=Ra.cells[tt];for(Ce=0;Ce<2;++Ce){var za=Ra.positions[Qa[Ce]],en=za[0],kn=Math.floor(en)|0,Jt=en-kn,Nt=za[1],Kt=Math.floor(Nt)|0,Wt=Nt-Kt,Pr=!1;t:for(var ta=0;ta<3;++ta){Ba[ta]=0;var ma=(Qt+ta+1)%3;for(Ee=0;Ee<2;++Ee){var ra=Ee?Jt:1-Jt;for(Pe=Math.min(Math.max(kn+Ee,0),ce[0])|0,Ve=0;Ve<2;++Ve){var Ia=Ve?Wt:1-Wt;if(at=Math.min(Math.max(Kt+Ve,0),ce[1])|0,ta<2?Te=this._field[ma].get(Pe,at):Te=(this.intensity.get(Pe,at)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(Te)||isNaN(Te)){Pr=!0;break t}var Ha=ra*Ia;Ba[ta]+=Ha*Te}}}if(!Pr)rr.push(Ba[0],Ba[1],za[0],za[1],Ba[2]),Ue+=1;else{if(Ce>0){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;be<rr.length;++be)nn[be]=rr[be];this._contourBuffer.update(nn),s.freeFloat(nn)}},O.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var ne=0;ne<3;++ne)s.freeFloat(this._field[ne].data)},O.highlight=function(ne){var j;if(!ne){this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],this.highlightLevel=[-1,-1,-1];return}for(j=0;j<3;++j)this.enableHighlight[j]?this.highlightLevel[j]=ne.level[j]:this.highlightLevel[j]=-1;var ee;for(this.snapToData?ee=ne.dataCoordinate:ee=ne.position,j=0;j<3;++j)ee[j]-=this.objectOffset[j];if(!((!this.enableDynamic[0]||ee[0]===this.dynamicLevel[0])&&(!this.enableDynamic[1]||ee[1]===this.dynamicLevel[1])&&(!this.enableDynamic[2]||ee[2]===this.dynamicLevel[2]))){for(var re=0,ce=this.shape,be=s.mallocFloat(12*ce[0]*ce[1]),Ae=0;Ae<3;++Ae){if(!this.enableDynamic[Ae]){this.dynamicLevel[Ae]=NaN,this._dynamicCounts[Ae]=0;continue}this.dynamicLevel[Ae]=ee[Ae];var ze=(Ae+1)%3,Re=(Ae+2)%3,We=this._field[Ae],it=this._field[ze],ot=this._field[Re],tt=T(We,ee[Ae]),ut=tt.cells,Me=tt.positions;for(this._dynamicOffsets[Ae]=re,j=0;j<ut.length;++j)for(var _e=ut[j],fe=0;fe<2;++fe){var Fe=Me[_e[fe]],rt=+Fe[0],st=rt|0,Qe=Math.min(st+1,ce[0])|0,Lt=rt-st,kt=1-Lt,qt=+Fe[1],Zt=qt|0,Sr=Math.min(Zt+1,ce[1])|0,xr=qt-Zt,jr=1-xr,wr=kt*jr,Ir=kt*xr,bt=Lt*jr,Be=Lt*xr,Ke=wr*it.get(st,Zt)+Ir*it.get(st,Sr)+bt*it.get(Qe,Zt)+Be*it.get(Qe,Sr),Ue=wr*ot.get(st,Zt)+Ir*ot.get(st,Sr)+bt*ot.get(Qe,Zt)+Be*ot.get(Qe,Sr);if(isNaN(Ke)||isNaN(Ue)){fe&&(re-=1);break}be[2*re+0]=Ke,be[2*re+1]=Ue,re+=1}this._dynamicCounts[Ae]=re-this._dynamicOffsets[Ae]}this._dynamicBuffer.update(be.subarray(0,2*re)),s.freeFloat(be)}};function oe(ne){var j=ne.gl,ee=g(j),re=p(j),ce=b(j),be=u(j),Ae=a(j),ze=n(j,[{buffer:Ae,size:4,stride:y,offset:0},{buffer:Ae,size:3,stride:y,offset:16},{buffer:Ae,size:3,stride:y,offset:28}]),Re=a(j),We=n(j,[{buffer:Re,size:4,stride:20,offset:0},{buffer:Re,size:1,stride:20,offset:16}]),it=a(j),ot=n(j,[{buffer:it,size:2,type:j.FLOAT}]),tt=o(j,1,F,j.RGBA,j.UNSIGNED_BYTE);tt.minFilter=j.LINEAR,tt.magFilter=j.LINEAR;var ut=new B(j,[0,0],[[0,0,0],[0,0,0]],ee,re,Ae,ze,tt,ce,be,Re,We,it,ot,[0,0,0]),Me={levels:[[],[],[]]};for(var _e in ne)Me[_e]=ne[_e];return Me.colormap=Me.colormap||"jet",ut.update(Me),ut}},7766:function(e,t,r){"use strict";var i=r(9618),a=r(5298),n=r(1888);e.exports=u;var o=null,s=null,c=null;function h(y){o=[y.LINEAR,y.NEAREST_MIPMAP_LINEAR,y.LINEAR_MIPMAP_NEAREST,y.LINEAR_MIPMAP_NEAREST],s=[y.NEAREST,y.LINEAR,y.NEAREST_MIPMAP_NEAREST,y.NEAREST_MIPMAP_LINEAR,y.LINEAR_MIPMAP_NEAREST,y.LINEAR_MIPMAP_LINEAR],c=[y.REPEAT,y.CLAMP_TO_EDGE,y.MIRRORED_REPEAT]}function m(y){return typeof HTMLCanvasElement<"u"&&y instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&y instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&y instanceof HTMLVideoElement||typeof ImageData<"u"&&y instanceof ImageData}var d=function(y,f){a.muls(y,f,255)};function T(y,f,P){var L=y.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(f<0||f>z||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;o<a.length;++o){var s=a[o];if(s.buffer){var c=s.buffer,h=s.size||4,m=s.type||r.FLOAT,d=!!s.normalized,T=s.stride||0,l=s.offset||0;c.bind(),r.enableVertexAttribArray(o),r.vertexAttribPointer(o,h,m,d,T,l)}else{if(typeof s=="number")r.vertexAttrib1f(o,s);else if(s.length===1)r.vertexAttrib1f(o,s[0]);else if(s.length===2)r.vertexAttrib2f(o,s[0],s[1]);else if(s.length===3)r.vertexAttrib3f(o,s[0],s[1],s[2]);else if(s.length===4)r.vertexAttrib4f(o,s[0],s[1],s[2],s[3]);else throw new Error("gl-vao: Invalid vertex attribute");r.disableVertexAttribArray(o)}}for(;o<n;++o)r.disableVertexAttribArray(o)}else{r.bindBuffer(r.ARRAY_BUFFER,null);for(var o=0;o<n;++o)r.disableVertexAttribArray(o)}}e.exports=t},870:function(e,t,r){"use strict";var i=r(1433);function a(o){this.gl=o,this._elements=null,this._attributes=null,this._elementsType=o.UNSIGNED_SHORT}a.prototype.bind=function(){i(this.gl,this._elements,this._attributes)},a.prototype.update=function(o,s,c){this._elements=s,this._attributes=o,this._elementsType=c||this.gl.UNSIGNED_SHORT},a.prototype.dispose=function(){},a.prototype.unbind=function(){},a.prototype.draw=function(o,s,c){c=c||0;var h=this.gl;this._elements?h.drawElements(o,s,this._elementsType,c):h.drawArrays(o,c,s)};function n(o){return new a(o)}e.exports=n},7518:function(e,t,r){"use strict";var i=r(1433);function a(s,c,h,m,d,T){this.location=s,this.dimension=c,this.a=h,this.b=m,this.c=d,this.d=T}a.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function n(s,c,h){this.gl=s,this._ext=c,this.handle=h,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}n.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s<this._attribs.length;++s)this._attribs[s].bind(this.gl)},n.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},n.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},n.prototype.update=function(s,c,h){if(this.bind(),i(this.gl,c,s),this.unbind(),this._attribs.length=0,s)for(var m=0;m<s.length;++m){var d=s[m];typeof d=="number"?this._attribs.push(new a(m,1,d)):Array.isArray(d)&&this._attribs.push(new a(m,d.length,d[0],d[1],d[2],d[3]))}this._useElements=!!c,this._elementsType=h||this.gl.UNSIGNED_SHORT},n.prototype.draw=function(s,c,h){h=h||0;var m=this.gl;this._useElements?m.drawElements(s,c,this._elementsType,h):m.drawArrays(s,h,c)};function o(s,c){return new n(s,c,c.createVertexArrayOES())}e.exports=o},8116:function(e,t,r){"use strict";var i=r(7518),a=r(870);function n(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function o(s,c,h,m){var d=s.createVertexArray?new n(s):s.getExtension("OES_vertex_array_object"),T;return d?T=i(s,d):T=a(s),T.update(c,h,m),T}e.exports=o},5632: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}},8192:function(e,t,r){e.exports=o;var i=r(2825),a=r(3536),n=r(244);function o(s,c){var h=i(s[0],s[1],s[2]),m=i(c[0],c[1],c[2]);a(h,h),a(m,m);var d=n(h,m);return d>1?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;d<T;d+=o)i[0]=n[d],i[1]=n[d+1],i[2]=n[d+2],h(i,i,m),n[d]=i[0],n[d+1]=i[1],n[d+2]=i[2];return n}},2825:function(e){e.exports=t;function t(r,i,a){var n=new Float32Array(3);return n[0]=r,n[1]=i,n[2]=a,n}},2931:function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811: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}},868:function(e,t,r){e.exports=r(1387)},1387:function(e){e.exports=t;function t(r){var i=r[0],a=r[1],n=r[2];return Math.sqrt(i*i+a*a+n*n)}},6658:function(e){e.exports=t;function t(r,i,a,n){var o=i[0],s=i[1],c=i[2];return r[0]=o+n*(a[0]-o),r[1]=s+n*(a[1]-s),r[2]=c+n*(a[2]-c),r}},7417: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}},8107: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}},4505:function(e,t,r){e.exports=r(5847)},5847: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}},5093:function(e){e.exports=t;function t(r,i){return r[0]=-i[0],r[1]=-i[1],r[2]=-i[2],r}},3536:function(e){e.exports=t;function t(r,i){var a=i[0],n=i[1],o=i[2],s=a*a+n*n+o*o;return s>0&&(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;c<s.length;c++){var h=s[c];if(h.type==="preprocessor"){var m=h.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(m&&m[2]){var d=m[1],T=m[2];return(d?a(T):T).trim()}}}}},5874:function(e,t,r){e.exports=f;var i=r(620),a=r(7827),n=r(6852),o=r(7932),s=r(3508),c=999,h=9999,m=0,d=1,T=2,l=3,_=4,w=5,S=6,E=7,g=8,b=9,p=10,u=11,y=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function f(P){var L=0,z=0,F=c,B,O,I=[],N=[],U=0,W=0,Q=1,ue=0,se=0,he=!1,H=!1,$="",J;P=P||{};var X=n,oe=i;P.version==="300 es"&&(X=s,oe=o);for(var ne={},j={},L=0;L<X.length;L++)ne[X[L]]=!0;for(var L=0;L<oe.length;L++)j[oe[L]]=!0;return function(fe){return N=[],fe!==null?re(fe):ce()};function ee(fe){fe.length&&N.push({type:y[F],data:fe,position:se,line:Q,column:ue})}function re(fe){L=0,fe.toString&&(fe=fe.toString()),$+=fe.replace(/\r\n/g,`
|
||
`),J=$.length;for(var Fe;B=$[L],L<J;){switch(Fe=L,F){case m:L=We();break;case d:L=Re();break;case T:L=ze();break;case l:L=it();break;case _:L=ut();break;case u:L=tt();break;case w:L=Me();break;case h:L=_e();break;case b:L=Ae();break;case c:L=be();break}if(Fe!==L)switch($[Fe]){case`
|
||
`:ue=0,++Q;break;default:++ue;break}}return z+=L,$=$.slice(L),N}function ce(fe){return I.length&&ee(I.join("")),F=p,ee("(eof)"),N}function be(){return I=I.length?[]:I,O==="/"&&B==="*"?(se=z+L-1,F=m,O=B,L+1):O==="/"&&B==="/"?(se=z+L-1,F=d,O=B,L+1):B==="#"?(F=T,se=z+L,L):/\s/.test(B)?(F=b,se=z+L,L):(he=/\d/.test(B),H=/[^\w_]/.test(B),se=z+L,F=he?_:H?l:h,L)}function Ae(){return/[^\s]/g.test(B)?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function ze(){return(B==="\r"||B===`
|
||
`)&&O!=="\\"?(ee(I.join("")),F=c,L):(I.push(B),O=B,L+1)}function Re(){return ze()}function We(){return B==="/"&&O==="*"?(I.push(B),ee(I.join("")),F=c,L+1):(I.push(B),O=B,L+1)}function it(){if(O==="."&&/\d/.test(B))return F=w,L;if(O==="/"&&B==="*")return F=m,L;if(O==="/"&&B==="/")return F=d,L;if(B==="."&&I.length){for(;ot(I););return F=w,L}if(B===";"||B===")"||B==="("){if(I.length)for(;ot(I););return ee(B),F=c,L+1}var fe=I.length===2&&B!=="=";if(/[\w_\d\s]/.test(B)||fe){for(;ot(I););return F=c,L}return I.push(B),O=B,L+1}function ot(fe){var Fe=0,rt,st;do{if(rt=a.indexOf(fe.slice(0,fe.length+Fe).join("")),st=a[rt],rt===-1){if(Fe--+fe.length>0)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<t.length-1;a++)i.push(t[a],r[a]||"");return i.push(t[a]),i.join("")}},7520:function(e,t,r){"use strict";var i=r(9507);function a(){var n=!1;try{var o=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,o),window.removeEventListener("test",null,o)}catch{n=!1}return n}e.exports=i&&a()},3778:function(e,t){t.read=function(r,i,a,n,o){var s,c,h=o*8-n-1,m=(1<<h)-1,d=m>>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<<d)-1,l=T>>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<<o|h,d+=o;d>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<f.length;F+=2){var ne=f[F],j=f[F+1],ee=ne.index,re=j.index;ee<0||re<0||(ne.cell.adjacent[ne.index]=j.cell,j.cell.adjacent[j.index]=ne.cell)}},T.insert=function(_,w){var S=this.vertices;S.push(_);var E=this.walk(_,w);if(E){for(var g=this.dimension,b=this.tuple,p=0;p<=g;++p){var u=E.vertices[p];u<0?b[p]=_:b[p]=S[u]}var y=this.orient(b);y<0||y===0&&(E=this.handleBoundaryDegeneracy(E,_),!E)||this.addPeaks(_,E)}},T.boundary=function(){for(var _=this.dimension,w=[],S=this.simplices,E=S.length,g=0;g<E;++g){var b=S[g];if(b.boundary){for(var p=new Array(_),u=b.vertices,y=0,f=0,P=0;P<=_;++P)u[P]>=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;u<S;++u)U.insert(_[u],W);return U.boundary()}},3352:function(e,t,r){"use strict";var i=r(2478),a=0,n=1,o=2;e.exports=y;function s(f,P,L,z,F){this.mid=f,this.left=P,this.right=L,this.leftPoints=z,this.rightPoints=F,this.count=(P?P.count:0)+(L?L.count:0)+z.length}var c=s.prototype;function h(f,P){f.mid=P.mid,f.left=P.left,f.right=P.right,f.leftPoints=P.leftPoints,f.rightPoints=P.rightPoints,f.count=P.count}function m(f,P){var L=b(P);f.mid=L.mid,f.left=L.left,f.right=L.right,f.leftPoints=L.leftPoints,f.rightPoints=L.rightPoints,f.count=L.count}function d(f,P){var L=f.intervals([]);L.push(P),m(f,L)}function T(f,P){var L=f.intervals([]),z=L.indexOf(P);return z<0?a:(L.splice(z,1),m(f,L),n)}c.intervals=function(f){return f.push.apply(f,this.leftPoints),this.left&&this.left.intervals(f),this.right&&this.right.intervals(f),f},c.insert=function(f){var P=this.count-this.leftPoints.length;if(this.count+=1,f[1]<this.mid)this.left?4*(this.left.count+1)>3*(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]<this.mid){if(!this.left)return a;var L=this.right?this.right.count:0;if(4*L>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<this.leftPoints.length&&this.leftPoints[I][0]===f[0];++I)if(this.leftPoints[I]===f){this.count-=1,this.leftPoints.splice(I,1);for(var z=i.ge(this.rightPoints,f,g);z<this.rightPoints.length&&this.rightPoints[z][1]===f[1];++z)if(this.rightPoints[z]===f)return this.rightPoints.splice(z,1),n}return a}};function l(f,P,L){for(var z=0;z<f.length&&f[z][0]<=P;++z){var F=L(f[z]);if(F)return F}}function _(f,P,L){for(var z=f.length-1;z>=0&&f[z][1]>=P;--z){var F=L(f[z]);if(F)return F}}function w(f,P){for(var L=0;L<f.length;++L){var z=P(f[L]);if(z)return z}}c.queryPoint=function(f,P){if(f<this.mid){if(this.left){var L=this.left.queryPoint(f,P);if(L)return L}return l(this.leftPoints,f,P)}else if(f>this.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(f<this.mid&&this.left){var z=this.left.queryInterval(f,P,L);if(z)return z}if(P>this.mid&&this.right){var z=this.right.queryInterval(f,P,L);if(z)return z}return P<this.mid?l(this.leftPoints,P,L):f>this.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<f.length;++L)P.push(f[L][0],f[L][1]);P.sort(S);for(var z=P[P.length>>1],F=[],B=[],O=[],L=0;L<f.length;++L){var I=f[L];I[1]<z?F.push(I):z<I[0]?B.push(I):O.push(I)}var N=O,U=O.slice();return N.sort(E),U.sort(g),new s(z,b(F),b(B),N,U)}function p(f){this.root=f}var u=p.prototype;u.insert=function(f){this.root?this.root.insert(f):this.root=new s(f[0],null,null,[f],[f])},u.remove=function(f){if(this.root){var P=this.root.remove(f);return P===o&&(this.root=null),P!==a}return!1},u.queryPoint=function(f,P){if(this.root)return this.root.queryPoint(f,P)},u.queryInterval=function(f,P,L){if(f<=P&&this.root)return this.root.queryInterval(f,P,L)},Object.defineProperty(u,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(u,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function y(f){return!f||f.length===0?new p(null):new p(b(f))}},9507:function(e){e.exports=!0},7163:function(e){e.exports=function(i){return i!=null&&(t(i)||r(i)||!!i._isBuffer)};function t(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function r(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&t(i.slice(0,0))}},5219:function(e){"use strict";e.exports=function(t){for(var r=t.length,i,a=0;a<r;a++)if(i=t.charCodeAt(a),(i<9||i>13)&&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(!(g<this.lastT())){for(var b=this._components,p=b.length-16,u=0;u<16;++u)b.push(b[p++]);this._time.push(g)}},w.flush=function(g){var b=i.gt(this._time,g)-2;b<0||(this._time.splice(0,b),this._components.splice(0,16*b))},w.lastT=function(){return this._time[this._time.length-1]},w.lookAt=function(g,b,p,u){this.recalcMatrix(g),b=b||this.computedEye,p=p||l,u=u||this.computedUp,this.setMatrix(g,h(this.computedMatrix,b,p,u));for(var y=0,f=0;f<3;++f)y+=Math.pow(p[f]-b[f],2);y=Math.log(Math.sqrt(y)),this.computedRadius[0]=y},w.rotate=function(g,b,p,u){this.recalcMatrix(g);var y=this.computedInverse;b&&s(y,y,b),p&&o(y,y,p),u&&c(y,y,u),this.setMatrix(g,n(this.computedMatrix,y))};var S=[0,0,0];w.pan=function(g,b,p,u){S[0]=-(b||0),S[1]=-(p||0),S[2]=-(u||0),this.recalcMatrix(g);var y=this.computedInverse;m(y,y,S),this.setMatrix(g,n(y,y))},w.translate=function(g,b,p,u){S[0]=b||0,S[1]=p||0,S[2]=u||0,this.recalcMatrix(g);var y=this.computedMatrix;m(y,y,S),this.setMatrix(g,y)},w.setMatrix=function(g,b){if(!(g<this.lastT())){this._time.push(g);for(var p=0;p<16;++p)this._components.push(b[p])}},w.setDistance=function(g,b){this.computedRadius[0]=b},w.setDistanceLimits=function(g,b){var p=this._limits;p[0]=g,p[1]=b},w.getDistanceLimits=function(g){var b=this._limits;return g?(g[0]=b[0],g[1]=b[1],g):b};function E(g){g=g||{};var b=g.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return new _(b)}},3090:function(e,t,r){"use strict";e.exports=a;var i=r(3250)[3];function a(n){var o=n.length;if(o<3){for(var _=new Array(o),s=0;s<o;++s)_[s]=s;return o===2&&n[0][0]===n[1][0]&&n[0][1]===n[1][1]?[0]:_}for(var c=new Array(o),s=0;s<o;++s)c[s]=s;c.sort(function(g,b){var p=n[g][0]-n[b][0];return p||n[g][1]-n[b][1]});for(var h=[c[0],c[1]],m=[c[0],c[1]],s=2;s<o;++s){for(var d=c[s],T=n[d],l=h.length;l>1&&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;s<S;++s)_[w++]=h[s];for(var E=m.length-2;E>0;--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<<s-1}else if("button"in o){var s=o.button;if(s===1)return 4;if(s===2)return 2;if(s>=0)return 1<<s}}return 0}t.buttons=r;function i(o){return o.target||o.srcElement||window}t.element=i;function a(o){if(typeof o=="object"){if("offsetX"in o)return o.offsetX;var s=i(o),c=s.getBoundingClientRect();return o.clientX-c.left}return 0}t.x=a;function n(o){if(typeof o=="object"){if("offsetY"in o)return o.offsetY;var s=i(o),c=s.getBoundingClientRect();return o.clientY-c.top}return 0}t.y=n},8512:function(e,t,r){"use strict";var i=r(665);e.exports=a;function a(n,o,s){typeof n=="function"&&(s=!!o,o=n,n=window);var c=i("ex",n),h=function(m){s&&m.preventDefault();var d=m.deltaX||0,T=m.deltaY||0,l=m.deltaZ||0,_=m.deltaMode,w=1;switch(_){case 1:w=c;break;case 2:w=window.innerHeight;break}if(d*=w,T*=w,l*=w,d||T||l)return o(d,T,l,m)};return n.addEventListener("wheel",h),h}},2640:function(e,t,r){"use strict";var i=r(1888);e.exports=o;var a={"false,0,1":function(c,h,m,d,T){return function(_,w,S,E){var g=_.shape[0]|0,b=_.shape[1]|0,p=_.data,u=_.offset|0,y=_.stride[0]|0,f=_.stride[1]|0,P=u,L,z=-y|0,F=0,B=-f|0,O=0,I=-y-f|0,N=0,U=y|0,W=f-y*g|0,Q=0,ue=0,se=0,he=2*g|0,H=d(he),$=d(he),J=0,X=0,oe=-1,ne=-1,j=0,ee=-g|0,re=g|0,ce=0,be=-g-1|0,Ae=g-1|0,ze=0,Re=0,We=0;for(Q=0;Q<g;++Q)H[J++]=m(p[P],w,S,E),P+=U;if(P+=W,b>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;Q<g;++Q)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!==j&&h($[J+oe],Re,N,F,ze,j,w,S,E)),J+=1,P+=U;for(P+=W,J=0,We=oe,oe=ne,ne=We,We=ee,ee=re,re=We,We=be,be=Ae,Ae=We,ue=2;ue<b;++ue){if(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++,ze!==ce&&h($[J+ee],Re,O,N,ce,ze,w,S,E)),J+=1,P+=U,Q=2;Q<g;++Q)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),ze!==j&&h($[J+oe],Re,N,F,ze,j,w,S,E)),J+=1,P+=U;ue&1&&(J=0),We=oe,oe=ne,ne=We,We=ee,ee=re,re=We,We=be,be=Ae,Ae=We,P+=W}}T($),T(H)}},"false,1,0":function(c,h,m,d,T){return function(_,w,S,E){var g=_.shape[0]|0,b=_.shape[1]|0,p=_.data,u=_.offset|0,y=_.stride[0]|0,f=_.stride[1]|0,P=u,L,z=-y|0,F=0,B=-f|0,O=0,I=-y-f|0,N=0,U=f|0,W=y-f*b|0,Q=0,ue=0,se=0,he=2*b|0,H=d(he),$=d(he),J=0,X=0,oe=-1,ne=-1,j=0,ee=-b|0,re=b|0,ce=0,be=-b-1|0,Ae=b-1|0,ze=0,Re=0,We=0;for(ue=0;ue<b;++ue)H[J++]=m(p[P],w,S,E),P+=U;if(P+=W,g>0){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;ue<b;++ue)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!==j&&h($[J+oe],Re,O,N,j,ze,w,S,E)),J+=1,P+=U;for(P+=W,J=0,We=ee,ee=re,re=We,We=oe,oe=ne,ne=We,We=be,be=Ae,Ae=We,Q=2;Q<g;++Q){if(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++,ze!==ce&&h($[J+ee],Re,N,F,ze,ce,w,S,E)),J+=1,P+=U,ue=2;ue<b;++ue)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!==j&&h($[J+oe],Re,O,N,j,ze,w,S,E),ze!==ce&&h($[J+ee],Re,N,F,ze,ce,w,S,E)),J+=1,P+=U;Q&1&&(J=0),We=ee,ee=re,re=We,We=oe,oe=ne,ne=We,We=be,be=Ae,Ae=We,P+=W}}T($),T(H)}}};function n(s,c,h,m,d,T){var l=[T,d].join(","),_=a[l];return _(s,c,h,i.mallocUint32,i.freeUint32)}function o(s){function c(w){throw new Error("ndarray-extract-contour: "+w)}typeof s!="object"&&c("Must specify arguments");var h=s.order;Array.isArray(h)||c("Must specify order");var m=s.arrayArguments||1;m<1&&c("Must have at least one array argument");var d=s.scalarArguments||0;d<0&&c("Scalar arg count must be > 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;_<m;++_)T.indexOf(_)>=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;f<u;++f)g[p]=0,p+=P},fdTemplate1:function(E,g,b,p,u,y,f){var P=E[0],L=b[0],z=y[0],F=-1*L,B=L;p|=0,f|=0;var O=0,I=L,N=z;for(O=0;O<P;++O)u[f]=.5*(g[p+F]-g[p+B]),p+=I,f+=N},fdTemplate2:function(E,g,b,p,u,y,f,P,L,z){var F=E[0],B=E[1],O=b[0],I=b[1],N=y[0],U=y[1],W=L[0],Q=L[1],ue=-1*O,se=O,he=-1*I,H=I;p|=0,f|=0,z|=0;var $=0,J=0,X=I,oe=O-B*I,ne=U,j=N-B*U,ee=Q,re=W-B*Q;for(J=0;J<F;++J){for($=0;$<B;++$)u[f]=.5*(g[p+ue]-g[p+se]),P[z]=.5*(g[p+he]-g[p+H]),p+=X,f+=ne,z+=ee;p+=oe,f+=j,z+=re}}},n={cdiff:function(E){var g={};return function(p,u,y){var f=p.dtype,P=p.order,L=u.dtype,z=u.order,F=y.dtype,B=y.order,O=[f,P.join(),L,z.join(),F,B.join()].join(),I=g[O];return I||(g[O]=I=E([f,P,L,z,F,B])),I(p.shape.slice(0),p.data,p.stride,p.offset|0,u.data,u.stride,u.offset|0,y.data,y.stride,y.offset|0)}},zero:function(E){var g={};return function(p){var u=p.dtype,y=p.order,f=[u,y.join()].join(),P=g[f];return P||(g[f]=P=E([u,y])),P(p.shape.slice(0),p.data,p.stride,p.offset|0)}},fdTemplate1:function(E){var g={};return function(p,u){var y=p.dtype,f=p.order,P=u.dtype,L=u.order,z=[y,f.join(),P,L.join()].join(),F=g[z];return F||(g[z]=F=E([y,f,P,L])),F(p.shape.slice(0),p.data,p.stride,p.offset|0,u.data,u.stride,u.offset|0)}},fdTemplate2:function(E){var g={};return function(p,u,y){var f=p.dtype,P=p.order,L=u.dtype,z=u.order,F=y.dtype,B=y.order,O=[f,P.join(),L,z.join(),F,B.join()].join(),I=g[O];return I||(g[O]=I=E([f,P,L,z,F,B])),I(p.shape.slice(0),p.data,p.stride,p.offset|0,u.data,u.stride,u.offset|0,y.data,y.stride,y.offset|0)}}};function o(E){var g=n[E.funcName];return g(s.bind(void 0,E))}function s(E){return a[E.funcName]}function c(E){return o({funcName:E.funcName})}var h={},m={},d={body:"",args:[],thisVars:[],localVars:[]},T=c({funcName:"cdiff"}),l=c({funcName:"zero"});function _(E){return E in h?h[E]:h[E]=c({funcName:"fdTemplate"+E})}function w(E,g,b,p){return function(u,y){var f=y.shape.slice();return f[0]>2&&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&&c<o.shape[0],d=0<=c+1&&c+1<o.shape[0],T=m?+o.get(c):0,l=d?+o.get(c+1):0;return(1-h)*T+h*l}function r(o,s,c){var h=Math.floor(s),m=s-h,d=0<=h&&h<o.shape[0],T=0<=h+1&&h+1<o.shape[0],l=Math.floor(c),_=c-l,w=0<=l&&l<o.shape[1],S=0<=l+1&&l+1<o.shape[1],E=d&&w?o.get(h,l):0,g=d&&S?o.get(h,l+1):0,b=T&&w?o.get(h+1,l):0,p=T&&S?o.get(h+1,l+1):0;return(1-_)*((1-m)*E+m*b)+_*((1-m)*g+m*p)}function i(o,s,c,h){var m=Math.floor(s),d=s-m,T=0<=m&&m<o.shape[0],l=0<=m+1&&m+1<o.shape[0],_=Math.floor(c),w=c-_,S=0<=_&&_<o.shape[1],E=0<=_+1&&_+1<o.shape[1],g=Math.floor(h),b=h-g,p=0<=g&&g<o.shape[2],u=0<=g+1&&g+1<o.shape[2],y=T&&S&&p?o.get(m,_,g):0,f=T&&E&&p?o.get(m,_+1,g):0,P=l&&S&&p?o.get(m+1,_,g):0,L=l&&E&&p?o.get(m+1,_+1,g):0,z=T&&S&&u?o.get(m,_,g+1):0,F=T&&E&&u?o.get(m,_+1,g+1):0,B=l&&S&&u?o.get(m+1,_,g+1):0,O=l&&E&&u?o.get(m+1,_+1,g+1):0;return(1-b)*((1-w)*((1-d)*y+d*P)+w*((1-d)*f+d*L))+b*((1-w)*((1-d)*z+d*B)+w*((1-d)*F+d*O))}function a(o){var s=o.shape.length|0,c=new Array(s),h=new Array(s),m=new Array(s),d=new Array(s),T,l;for(T=0;T<s;++T)l=+arguments[T+1],c[T]=Math.floor(l),h[T]=l-c[T],m[T]=0<=c[T]&&c[T]<o.shape[T],d[T]=0<=c[T]+1&&c[T]+1<o.shape[T];var _=0,w,S,E;e:for(T=0;T<1<<s;++T){for(S=1,E=o.offset,w=0;w<s;++w)if(T&1<<w){if(!d[w])continue e;S*=h[w],E+=o.stride[w]*(c[w]+1)}else{if(!m[w])continue e;S*=1-h[w],E+=o.stride[w]*c[w]}_+=S*o.data[E]}return _}function n(o,s,c,h){switch(o.shape.length){case 0:return 0;case 1:return t(o,s);case 2:return r(o,s,c);case 3:return i(o,s,c,h);default:return a.apply(void 0,arguments)}}e.exports=n,e.exports.d1=t,e.exports.d2=r,e.exports.d3=i},5298:function(e,t){"use strict";var r={"float64,2,1,0":function(){return function(m,d,T,l,_){var w=m[0],S=m[1],E=m[2],g=T[0],b=T[1],p=T[2];l|=0;var u=0,y=0,f=0,P=p,L=b-E*p,z=g-S*b;for(f=0;f<w;++f){for(y=0;y<S;++y){for(u=0;u<E;++u)d[l]/=_,l+=P;l+=L}l+=z}}},"uint8,2,0,1,float64,2,1,0":function(){return function(m,d,T,l,_,w,S,E){var g=m[0],b=m[1],p=m[2],u=T[0],y=T[1],f=T[2],P=w[0],L=w[1],z=w[2];l|=0,S|=0;for(var F=l,B=S,O=m[0]|0;O>0;){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;W<b;++W){for(U=0;U<g;++U){for(N=0;N<p;++N)d[l]=_[S]*E,l+=Q,S+=he;l+=ue,S+=H}l+=se,S+=$}}}}},"float32,1,0,float32,1,0":function(){return function(m,d,T,l,_,w,S){var E=m[0],g=m[1],b=T[0],p=T[1],u=w[0],y=w[1];l|=0,S|=0;var f=0,P=0,L=p,z=b-g*p,F=y,B=u-g*y;for(P=0;P<E;++P){for(f=0;f<g;++f)d[l]=_[S],l+=L,S+=F;l+=z,S+=B}}},"float32,1,0,float32,0,1":function(){return function(m,d,T,l,_,w,S){var E=m[0],g=m[1],b=T[0],p=T[1],u=w[0],y=w[1];l|=0,S|=0;for(var f=l,P=S,L=m[1]|0;L>0;){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;B<E;++B){for(F=0;F<g;++F)d[l]=_[S],l+=O,S+=N;l+=I,S+=U}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(m,d,T,l,_,w,S){var E=m[0],g=m[1],b=m[2],p=T[0],u=T[1],y=T[2],f=w[0],P=w[1],L=w[2];l|=0,S|=0;for(var z=l,F=S,B=m[2]|0;B>0;){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<g;++W){for(U=0;U<E;++U){for(N=0;N<b;++N)d[l]=_[S],l+=Q,S+=he;l+=ue,S+=H}l+=se,S+=$}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(m,d,T,l,_,w,S){var E=m[0],g=m[1],b=m[2],p=T[0],u=T[1],y=T[2],f=w[0],P=w[1],L=w[2];l|=0,S|=0;var z=0,F=0,B=0,O=y,I=p-b*y,N=u-E*p,U=L,W=f-b*L,Q=P-E*f;for(B=0;B<g;++B){for(F=0;F<E;++F){for(z=0;z<b;++z)d[l]=_[S],l+=O,S+=U;l+=I,S+=W}l+=N,S+=Q}}}};function i(h,m){var d=m.join(","),T=r[d];return T()}var a=i,n={mul:function(h){var m={};return function(T,l,_){var w=T.dtype,S=T.order,E=l.dtype,g=l.order,b=_.dtype,p=_.order,u=[w,S.join(),E,g.join(),b,p.join()].join(),y=m[u];return y||(m[u]=y=h([w,S,E,g,b,p])),y(T.shape.slice(0),T.data,T.stride,T.offset|0,l.data,l.stride,l.offset|0,_.data,_.stride,_.offset|0)}},muls:function(h){var m={};return function(T,l,_){var w=T.dtype,S=T.order,E=l.dtype,g=l.order,b=[w,S.join(),E,g.join()].join(),p=m[b];return p||(m[b]=p=h([w,S,E,g])),p(T.shape.slice(0),T.data,T.stride,T.offset|0,l.data,l.stride,l.offset|0,_)}},mulseq:function(h){var m={};return function(T,l){var _=T.dtype,w=T.order,S=[_,w.join()].join(),E=m[S];return E||(m[S]=E=h([_,w])),E(T.shape.slice(0),T.data,T.stride,T.offset|0,l)}},div:function(h){var m={};return function(T,l,_){var w=T.dtype,S=T.order,E=l.dtype,g=l.order,b=_.dtype,p=_.order,u=[w,S.join(),E,g.join(),b,p.join()].join(),y=m[u];return y||(m[u]=y=h([w,S,E,g,b,p])),y(T.shape.slice(0),T.data,T.stride,T.offset|0,l.data,l.stride,l.offset|0,_.data,_.stride,_.offset|0)}},divs:function(h){var m={};return function(T,l,_){var w=T.dtype,S=T.order,E=l.dtype,g=l.order,b=[w,S.join(),E,g.join()].join(),p=m[b];return p||(m[b]=p=h([w,S,E,g])),p(T.shape.slice(0),T.data,T.stride,T.offset|0,l.data,l.stride,l.offset|0,_)}},divseq:function(h){var m={};return function(T,l){var _=T.dtype,w=T.order,S=[_,w.join()].join(),E=m[S];return E||(m[S]=E=h([_,w])),E(T.shape.slice(0),T.data,T.stride,T.offset|0,l)}},assign:function(h){var m={};return function(T,l){var _=T.dtype,w=T.order,S=l.dtype,E=l.order,g=[_,w.join(),S,E.join()].join(),b=m[g];return b||(m[g]=b=h([_,w,S,E])),b(T.shape.slice(0),T.data,T.stride,T.offset|0,l.data,l.stride,l.offset|0)}}};function o(h){var m=n[h.funcName];return m(a.bind(void 0,h))}function s(h){return o({funcName:h.funcName})}var c={mul:"*",div:"/"};(function(){for(var h in c)t[h]=s({funcName:h}),t[h+"s"]=s({funcName:h+"s"}),t[h+"seq"]=s({funcName:h+"seq"})})(),t.assign=s({funcName:"assign"})},9994:function(e,t,r){"use strict";var i=r(9618),a=r(8277);e.exports=function(o,s){for(var c=[],h=o,m=1;Array.isArray(h);)c.push(h.length),m*=h.length,h=h[0];return c.length===0?i():(s||(s=i(new Float64Array(m),c)),a(s,o),s)}},8277:function(e){"use strict";function t(){return function(s,c,h,m,d){var T=s[0],l=s[1],_=s[2],w=h[0],S=h[1],E=h[2],g=[0,0,0];m|=0;var b=0,p=0,u=0,y=E,f=S-_*E,P=w-l*S;for(u=0;u<T;++u){for(p=0;p<l;++p){for(b=0;b<_;++b){{var L=d,z;for(z=0;z<g.length-1;++z)L=L[g[z]];c[m]=L[g[g.length-1]]}m+=y,++g[2]}m+=f,g[2]-=_,++g[1]}m+=P,g[1]-=l,++g[0]}}}function r(){return t()}var i=r;function a(s){var c={};return function(m,d){var T=m.dtype,l=m.order,_=[T,l.join()].join(),w=c[_];return w||(c[_]=w=s([T,l])),w(m.shape.slice(0),m.data,m.stride,m.offset|0,d)}}function n(s){return a(i.bind(void 0,s))}function o(s){return n({funcName:s.funcName})}e.exports=o({funcName:"convert"})},7640:function(e,t,r){"use strict";var i=r(1888);function a(d){switch(d){case"uint32":return[i.mallocUint32,i.freeUint32];default:return null}}var n={"uint32,1,0":function(d,T){return function(_,w,S,E,g,b,p,u,y,f,P){var L,z,F,B=_*g+E,O,I=d(u),N,U,W,Q;for(L=_+1;L<=w;++L){for(z=L,B+=g,F=B,N=0,U=B,O=0;O<u;++O)I[N++]=S[U],U+=y;e:for(;z-- >_;){N=0,U=F-g;t:for(O=0;O<u;++O){if(W=S[U],Q=I[N],W<Q)break e;if(W>Q)break t;U+=f,N+=P}for(N=F,U=F-g,O=0;O<u;++O)S[N]=S[U],N+=y,U+=y;F-=g}for(N=F,U=0,O=0;O<u;++O)S[N]=I[U++],N+=y}T(I)}}};function o(d,T){var l=a(T),_=[T,d].join(","),w=n[_];return l?w(l[0],l[1]):w()}var s={"uint32,1,0":function(d,T,l){return function _(w,S,E,g,b,p,u,y,f,P,L){var z=(S-w+1)/6|0,F=w+z,B=S-z,O=w+S>>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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We){if(re=it+Zt,ce=ot+Zt,Re=E[re]-E[ce],Re>0){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;We<y;++We)re=it+Zt,ce=ot+Zt,be=tt+Zt,rt=ut+Zt,st=Me+Zt,Qe=_e+Zt,Lt=fe+Zt,kt=Fe+Zt,xr[qt]=E[ce],jr[qt]=E[rt],$=$&&xr[qt]===jr[qt],oe=E[re],ne=E[be],j=E[st],E[Qe]=oe,E[Lt]=ne,E[kt]=j,++qt,Zt+=f;for(it=b*I,ot=b*w,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,E[re]=E[ce],Zt+=f;for(it=b*N,ot=b*S,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,E[re]=E[ce],Zt+=f;if($)for(ee=he;ee<=H;++ee){re=g+ee*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-xr[qt],Re!==0)break e;qt+=L,re+=P}if(Re!==0)if(Re<0){if(ee!==he)for(it=b*ee,ot=b*he,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;++he}else for(;;){re=g+H*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-xr[qt],Re!==0)break e;qt+=L,re+=P}if(Re>0)H--;else if(Re<0){for(it=b*ee,ot=b*he,tt=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,be=tt+Zt,J=E[re],E[re]=E[ce],E[ce]=E[be],E[be]=J,Zt+=f;++he,--H;break}else{for(it=b*ee,ot=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;--H;break}}}else for(ee=he;ee<=H;++ee){re=g+ee*b,qt=0;e:for(We=0;We<y;++We){if(Ae=E[re]-xr[qt],Ae!==0)break e;qt+=L,re+=P}if(Ae<0){if(ee!==he)for(it=b*ee,ot=b*he,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;++he}else{re=g+ee*b,qt=0;e:for(We=0;We<y;++We){if(ze=E[re]-jr[qt],ze!==0)break e;qt+=L,re+=P}if(ze>0)for(;;){re=g+H*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-jr[qt],Re!==0)break e;qt+=L,re+=P}if(Re>0){if(--H<ee)break;continue}else{re=g+H*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-xr[qt],Re!==0)break e;qt+=L,re+=P}if(Re<0){for(it=b*ee,ot=b*he,tt=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,be=tt+Zt,J=E[re],E[re]=E[ce],E[ce]=E[be],E[be]=J,Zt+=f;++he,--H}else{for(it=b*ee,ot=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;--H}break}}}}for(it=b*w,ot=b*(he-1),qt=0,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,E[re]=E[ce],E[ce]=xr[qt],++qt,Zt+=f;for(it=b*S,ot=b*(H+1),qt=0,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,E[re]=E[ce],E[ce]=jr[qt],++qt,Zt+=f;if(he-2-w<=32?d(w,he-2,E,g,b,p,u,y,f,P,L):_(w,he-2,E,g,b,p,u,y,f,P,L),S-(H+2)<=32?d(H+2,S,E,g,b,p,u,y,f,P,L):_(H+2,S,E,g,b,p,u,y,f,P,L),$){l(xr),l(jr);return}if(he<F&&H>B){e:for(;;){for(re=g+he*b,qt=0,Zt=g,We=0;We<y;++We){if(E[re]!==xr[qt])break e;++qt,re+=f}++he}e:for(;;){for(re=g+H*b,qt=0,Zt=g,We=0;We<y;++We){if(E[re]!==jr[qt])break e;++qt,re+=f}--H}for(ee=he;ee<=H;++ee){re=g+ee*b,qt=0;e:for(We=0;We<y;++We){if(Ae=E[re]-xr[qt],Ae!==0)break e;qt+=L,re+=P}if(Ae===0){if(ee!==he)for(it=b*ee,ot=b*he,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;++he}else{re=g+ee*b,qt=0;e:for(We=0;We<y;++We){if(ze=E[re]-jr[qt],ze!==0)break e;qt+=L,re+=P}if(ze===0)for(;;){re=g+H*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-jr[qt],Re!==0)break e;qt+=L,re+=P}if(Re===0){if(--H<ee)break;continue}else{re=g+H*b,qt=0;e:for(We=0;We<y;++We){if(Re=E[re]-xr[qt],Re!==0)break e;qt+=L,re+=P}if(Re<0){for(it=b*ee,ot=b*he,tt=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,be=tt+Zt,J=E[re],E[re]=E[ce],E[ce]=E[be],E[be]=J,Zt+=f;++he,--H}else{for(it=b*ee,ot=b*H,Zt=g,We=0;We<y;++We)re=it+Zt,ce=ot+Zt,J=E[re],E[re]=E[ce],E[ce]=J,Zt+=f;--H}break}}}}}l(xr),l(jr),H-he<=32?d(he,H,E,g,b,p,u,y,f,P,L):_(he,H,E,g,b,p,u,y,f,P,L)}}};function c(d,T,l){var _=a(T),w=[T,d].join(","),S=s[w];return d.length>1&&_?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;_<l.length;++_)l[_]=[Math.abs(T[_]),_];l.sort(n);var w=new Array(l.length);for(_=0;_<w.length;++_)w[_]=l[_][1];return w}var s={T:function(T){function l(w){this.data=w}var _=l.prototype;return _.dtype=T,_.index=function(){return-1},_.size=0,_.dimension=-1,_.shape=_.stride=_.order=[],_.lo=_.hi=_.transpose=_.step=function(){return new l(this.data)},_.get=_.set=function(){},_.pick=function(){return null},function(S){return new l(S)}},0:function(T,l){function _(S,E){this.data=S,this.offset=E}var w=_.prototype;return w.dtype=T,w.index=function(){return this.offset},w.dimension=0,w.size=1,w.shape=w.stride=w.order=[],w.lo=w.hi=w.transpose=w.step=function(){return new _(this.data,this.offset)},w.pick=function(){return l(this.data)},w.valueOf=w.get=function(){return T==="generic"?this.data.get(this.offset):this.data[this.offset]},w.set=function(E){return T==="generic"?this.data.set(this.offset,E):this.data[this.offset]=E},function(E,g,b,p){return new _(E,p)}},1:function(T,l,_){function w(E,g,b,p){this.data=E,this.shape=[g],this.stride=[b],this.offset=p|0}var S=w.prototype;return S.dtype=T,S.dimension=1,Object.defineProperty(S,"size",{get:function(){return this.shape[0]}}),S.order=[0],S.set=function(g,b){return T==="generic"?this.data.set(this.offset+this.stride[0]*g,b):this.data[this.offset+this.stride[0]*g]=b},S.get=function(g){return T==="generic"?this.data.get(this.offset+this.stride[0]*g):this.data[this.offset+this.stride[0]*g]},S.index=function(g){return this.offset+this.stride[0]*g},S.hi=function(g){return new w(this.data,typeof g!="number"||g<0?this.shape[0]:g|0,this.stride[0],this.offset)},S.lo=function(g){var b=this.offset,p=0,u=this.shape[0],y=this.stride[0];return typeof g=="number"&&g>=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<S;++E)_[E]<0&&(w-=(l[E]-1)*_[E])}for(var b=h(T),p=m[b];p.length<=S+1;)p.push(c(b,p.length-1));var u=p[S+1];return u(T,l,_,w)}e.exports=d},1278:function(e,t,r){"use strict";var i=r(2361),a=Math.pow(2,-1074),n=-1>>>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;m<s;++m)c[m]=[0,0,0];for(var m=0;m<a.length;++m)for(var d=a[m],T=0,l=d[d.length-1],_=d[0],w=0;w<d.length;++w){T=l,l=_,_=d[(w+1)%d.length];for(var S=n[T],E=n[l],g=n[_],b=new Array(3),p=0,u=new Array(3),y=0,f=0;f<3;++f)b[f]=S[f]-E[f],p+=b[f]*b[f],u[f]=g[f]-E[f],y+=u[f]*u[f];if(p*y>h)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;m<s;++m){for(var P=c[m],B=0,f=0;f<3;++f)B+=P[f]*P[f];if(B>h)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;m<s;++m){for(var d=a[m],T=new Array(3),l=0;l<3;++l)T[l]=n[d[l]];for(var _=new Array(3),w=new Array(3),l=0;l<3;++l)_[l]=T[1][l]-T[0][l],w[l]=T[2][l]-T[0][l];for(var S=new Array(3),E=0,l=0;l<3;++l){var g=(l+1)%3,b=(l+2)%3;S[l]=_[g]*w[b]-_[b]*w[g],E+=S[l]*S[l]}E>h?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;m<s;++m)h[0][m]=[],h[1][m]=[];for(var m=0;m<c;++m){var d=n[m];h[0][d[0]].push(d),h[1][d[1]].push(d)}for(var T=[],m=0;m<s;++m)h[0][m].length+h[1][m].length===0&&T.push([m]);function l(u,y){var f=h[y][u[y]];f.splice(f.indexOf(u),1)}function _(u,y,f){for(var P,L,z,F=0;F<2;++F)if(h[F][y].length>0){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;I<O.length;++I){var N=O[I],U=N[B^1],W=i(o[u],o[y],o[L],o[U]);W>0&&(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;m<s;++m)for(var E=0;E<2;++E){for(var g=[];h[E][m].length>0;){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;d<o.length;++d){var T=s[d].length;h[d]=T,c[d]=!0,T<=1&&m.push(d)}for(;m.length>0;){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;d<o.length;++d)if(c[d]){var l=E.length;S[d]=l,E.push(o[d])}else S[d]=-1;for(var g=[],d=0;d<n.length;++d){var b=n[d];c[b[0]]&&c[b[1]]&&g.push([S[b[0]],S[b[1]]])}return[g,E]}},2095:function(e,t,r){"use strict";e.exports=T;var i=r(3134),a=r(3088),n=r(5085),o=r(5250),s=r(8210),c=r(1682),h=r(5609);function m(l,_){for(var w=new Array(l),S=0;S<l;++S)w[S]=_;return w}function d(l){for(var _=new Array(l),w=0;w<l;++w)_[w]=[];return _}function T(l,_){var ee=h(l,_);l=ee[0],_=ee[1];for(var w=_.length,S=l.length,E=i(l,_.length),g=0;g<w;++g)if(E[g].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var b=a(l,_);function p(We){for(var it=We.length,ot=[0],tt=0;tt<it;++tt){var ut=_[We[tt]],Me=_[We[(tt+1)%it]],_e=o(-ut[0],ut[1]),fe=o(-ut[0],Me[1]),Fe=o(Me[0],ut[1]),rt=o(Me[0],Me[1]);ot=s(ot,s(s(_e,fe),s(Fe,rt)))}return ot[ot.length-1]>0}b=b.filter(p);for(var u=b.length,y=new Array(u),f=new Array(u),g=0;g<u;++g){y[g]=g;var P=new Array(u),L=b[g].map(function(it){return _[it]}),z=n([L]),F=0;e:for(var B=0;B<u;++B)if(P[B]=0,g!==B){for(var O=b[B],I=O.length,N=0;N<I;++N){var U=z(_[O[N]]);if(U!==0){U<0&&(P[B]=1,F+=1);continue e}}P[B]=1,F+=1}f[g]=[F,g,P]}f.sort(function(We,it){return it[0]-We[0]});for(var g=0;g<u;++g)for(var P=f[g],W=P[1],Q=P[2],B=0;B<u;++B)Q[B]&&(y[B]=W);for(var ue=d(u),g=0;g<u;++g)ue[g].push(y[g]),ue[y[g]].push(g);for(var se={},he=m(w,!1),g=0;g<u;++g)for(var O=b[g],I=O.length,B=0;B<I;++B){var H=O[B],$=O[(B+1)%I],J=Math.min(H,$)+":"+Math.max(H,$);if(J in se){var X=se[J];ue[X].push(g),ue[g].push(X),he[H]=he[$]=!0}else se[J]=g}function oe(We){for(var it=We.length,ot=0;ot<it;++ot)if(!he[We[ot]])return!1;return!0}for(var ne=[],j=m(u,-1),g=0;g<u;++g)y[g]===g&&!oe(b[g])?(ne.push(g),j[g]=0):j[g]=-1;for(var ee=[];ne.length>0;){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<be;++g){var Re=ce[g];if(!(j[Re]>=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;E<w.length;++E){var g=w[E],b=g[0][0],p=g[0][1],u=g[1][1],y=[Math.min(p,u),Math.max(p,u)];b in S?S[b].push(y):S[b]=[y]}for(var f={},P=Object.keys(S),E=0;E<P.length;++E){var L=S[P[E]];f[P[E]]=n(L)}return c(f)}function m(w,S){return function(E){var g=o.le(S,E[0]);if(g<0)return 1;var b=w[g];if(!b)if(g>0&&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]<u[1][0])if(y<0)b=b.left;else if(y>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<S;++p)for(var u=w[p],y=u.length,f=y-1,P=0;P<y;f=P++){var L=u[f],z=u[P];L[0]===z[0]?g.push([L,z]):E.push([L,z])}if(E.length===0)return g.length===0?d:T(h(g));var F=a(E),B=m(F.slabs,F.coordinates);return g.length===0?B:l(h(g),B)}},9346:function(e){"use strict";var t=new Float64Array(4),r=new Float64Array(4),i=new Float64Array(4);function a(n,o,s,c,h){t.length<c.length&&(t=new Float64Array(c.length),r=new Float64Array(c.length),i=new Float64Array(c.length));for(var m=0;m<c.length;++m)t[m]=n[m]-c[m],r[m]=o[m]-n[m],i[m]=s[m]-n[m];for(var d=0,T=0,l=0,_=0,w=0,S=0,m=0;m<c.length;++m){var E=r[m],g=i[m],b=t[m];d+=E*E,T+=E*g,l+=g*g,_+=b*E,w+=b*g,S+=b*b}var p=Math.abs(d*l-T*T),u=T*w-l*_,y=T*_-d*w,f;if(u+y<=p)if(u<0)y<0&&_<0?(y=0,-_>=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;m<c.length;++m)h[m]=O*n[m]+u*o[m]+y*s[m];return f<0?0:f}e.exports=a},8648:function(e,t,r){e.exports=r(783)},2653:function(e,t,r){"use strict";var i=r(3865);e.exports=a;function a(n,o){for(var s=n.length,c=new Array(s),h=0;h<s;++h)c[h]=i(n[h],o[h]);return c}},5838:function(e,t,r){"use strict";e.exports=a;var i=r(7842);function a(n){for(var o=new Array(n.length),s=0;s<n.length;++s)o[s]=i(n[s]);return o}},8987:function(e,t,r){"use strict";var i=r(7842),a=r(6504);e.exports=n;function n(o,s){for(var c=i(s),h=o.length,m=new Array(h),d=0;d<h;++d)m[d]=a(o[d],c);return m}},544:function(e,t,r){"use strict";var i=r(5572);e.exports=a;function a(n,o){for(var s=n.length,c=new Array(s),h=0;h<s;++h)c[h]=i(n[h],o[h]);return c}},5771:function(e,t,r){"use strict";var i=r(8507),a=r(3788),n=r(2419);e.exports=o;function o(s){s.sort(a);for(var c=s.length,h=0,m=0;m<c;++m){var d=s[m],T=n(d);if(T!==0){if(h>0){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;o<i;++o){var s=r[o],c=a;a=s+c;var h=a-s,m=c-h;m&&(r[d++]=m)}return r[d++]=a,r.length=d,r}},2962:function(e,t,r){"use strict";var i=r(5250),a=r(8210),n=r(3012),o=r(7004),s=6;function c(S,E,g,b){return function(u){return b(S(g(u[0][0],u[1][1]),g(-u[0][1],u[1][0])))}}function h(S,E,g,b){return function(u){return b(S(E(S(g(u[1][1],u[2][2]),g(-u[1][2],u[2][1])),u[0][0]),S(E(S(g(u[1][0],u[2][2]),g(-u[1][2],u[2][0])),-u[0][1]),E(S(g(u[1][0],u[2][1]),g(-u[1][1],u[2][0])),u[0][2]))))}}function m(S,E,g,b){return function(u){return b(S(S(E(S(E(S(g(u[2][2],u[3][3]),g(-u[2][3],u[3][2])),u[1][1]),S(E(S(g(u[2][1],u[3][3]),g(-u[2][3],u[3][1])),-u[1][2]),E(S(g(u[2][1],u[3][2]),g(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),E(S(E(S(g(u[2][2],u[3][3]),g(-u[2][3],u[3][2])),u[1][0]),S(E(S(g(u[2][0],u[3][3]),g(-u[2][3],u[3][0])),-u[1][2]),E(S(g(u[2][0],u[3][2]),g(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),S(E(S(E(S(g(u[2][1],u[3][3]),g(-u[2][3],u[3][1])),u[1][0]),S(E(S(g(u[2][0],u[3][3]),g(-u[2][3],u[3][0])),-u[1][1]),E(S(g(u[2][0],u[3][1]),g(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),E(S(E(S(g(u[2][1],u[3][2]),g(-u[2][2],u[3][1])),u[1][0]),S(E(S(g(u[2][0],u[3][2]),g(-u[2][2],u[3][0])),-u[1][1]),E(S(g(u[2][0],u[3][1]),g(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function d(S,E,g,b){return function(u){return b(S(S(E(S(S(E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][2]),S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),-u[2][3]),E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][1]),S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),-u[2][3]),E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),S(E(S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),u[2][1]),S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),-u[2][2]),E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),E(S(E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][1]),S(E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),-u[2][2]),E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),E(S(S(E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][2]),S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),-u[2][3]),E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][3]),E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),S(E(S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][2]),E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),E(S(E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][0]),S(E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),-u[2][2]),E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),S(E(S(S(E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][1]),S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),-u[2][3]),E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),E(S(E(S(g(u[3][3],u[4][4]),g(-u[3][4],u[4][3])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][3]),E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),S(E(S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),E(S(E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),S(E(S(S(E(S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),u[2][1]),S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),-u[2][2]),E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),E(S(E(S(g(u[3][2],u[4][4]),g(-u[3][4],u[4][2])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][2]),E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),S(E(S(E(S(g(u[3][1],u[4][4]),g(-u[3][4],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][4]),g(-u[3][4],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),E(S(E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),E(S(S(E(S(E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][1]),S(E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),-u[2][2]),E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),E(S(E(S(g(u[3][2],u[4][3]),g(-u[3][3],u[4][2])),u[2][0]),S(E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),-u[2][2]),E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),S(E(S(E(S(g(u[3][1],u[4][3]),g(-u[3][3],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][3]),g(-u[3][3],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),E(S(E(S(g(u[3][1],u[4][2]),g(-u[3][2],u[4][1])),u[2][0]),S(E(S(g(u[3][0],u[4][2]),g(-u[3][2],u[4][0])),-u[2][1]),E(S(g(u[3][0],u[4][1]),g(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function T(S){var E=S===2?c:S===3?h:S===4?m:S===5?d:void 0;return E(a,n,i,o)}var l=[function(){return[0]},function(E){return[E[0][0]]}];function _(S,E,g,b,p,u,y,f){return function(L){switch(L.length){case 0:return S(L);case 1:return E(L);case 2:return g(L);case 3:return b(L);case 4:return p(L);case 5:return u(L)}var z=y[L.length];return z||(z=y[L.length]=f(L.length)),z(L)}}function w(){for(;l.length<s;)l.push(T(l.length));e.exports=_.apply(void 0,l.concat([l,T]));for(var S=0;S<l.length;++S)e.exports[S]=l[S]}w()},1944:function(e,t,r){"use strict";var i=r(5250),a=r(8210);e.exports=n;function n(o,s){for(var c=i(o[0],s[0]),h=1;h<o.length;++h)c=a(c,i(o[h],s[h]));return c}},2646:function(e,t,r){"use strict";var i=r(5250),a=r(8210),n=r(8545),o=r(3012),s=6;function c(p){var u=p===3?T:p===4?l:p===5?_:w;return u(a,n,i,o)}function h(){return 0}function m(){return 0}function d(){return 0}function T(p,u,y,f){function P(L,z,F){var B=y(L[0],L[0]),O=f(B,z[0]),I=f(B,F[0]),N=y(z[0],z[0]),U=f(N,L[0]),W=f(N,F[0]),Q=y(F[0],F[0]),ue=f(Q,L[0]),se=f(Q,z[0]),he=p(u(se,W),u(U,O)),H=u(ue,I),$=u(he,H);return $[$.length-1]}return P}function l(p,u,y,f){function P(L,z,F,B){var O=p(y(L[0],L[0]),y(L[1],L[1])),I=f(O,z[0]),N=f(O,F[0]),U=f(O,B[0]),W=p(y(z[0],z[0]),y(z[1],z[1])),Q=f(W,L[0]),ue=f(W,F[0]),se=f(W,B[0]),he=p(y(F[0],F[0]),y(F[1],F[1])),H=f(he,L[0]),$=f(he,z[0]),J=f(he,B[0]),X=p(y(B[0],B[0]),y(B[1],B[1])),oe=f(X,L[0]),ne=f(X,z[0]),j=f(X,F[0]),ee=p(p(f(u(j,J),z[1]),p(f(u(ne,se),-F[1]),f(u($,ue),B[1]))),p(f(u(ne,se),L[1]),p(f(u(oe,U),-z[1]),f(u(Q,I),B[1])))),re=p(p(f(u(j,J),L[1]),p(f(u(oe,U),-F[1]),f(u(H,N),B[1]))),p(f(u($,ue),L[1]),p(f(u(H,N),-z[1]),f(u(Q,I),F[1])))),ce=u(ee,re);return ce[ce.length-1]}return P}function _(p,u,y,f){function P(L,z,F,B,O){var I=p(y(L[0],L[0]),p(y(L[1],L[1]),y(L[2],L[2]))),N=f(I,z[0]),U=f(I,F[0]),W=f(I,B[0]),Q=f(I,O[0]),ue=p(y(z[0],z[0]),p(y(z[1],z[1]),y(z[2],z[2]))),se=f(ue,L[0]),he=f(ue,F[0]),H=f(ue,B[0]),$=f(ue,O[0]),J=p(y(F[0],F[0]),p(y(F[1],F[1]),y(F[2],F[2]))),X=f(J,L[0]),oe=f(J,z[0]),ne=f(J,B[0]),j=f(J,O[0]),ee=p(y(B[0],B[0]),p(y(B[1],B[1]),y(B[2],B[2]))),re=f(ee,L[0]),ce=f(ee,z[0]),be=f(ee,F[0]),Ae=f(ee,O[0]),ze=p(y(O[0],O[0]),p(y(O[1],O[1]),y(O[2],O[2]))),Re=f(ze,L[0]),We=f(ze,z[0]),it=f(ze,F[0]),ot=f(ze,B[0]),tt=p(p(p(f(p(f(u(ot,Ae),F[1]),p(f(u(it,j),-B[1]),f(u(be,ne),O[1]))),z[2]),p(f(p(f(u(ot,Ae),z[1]),p(f(u(We,$),-B[1]),f(u(ce,H),O[1]))),-F[2]),f(p(f(u(it,j),z[1]),p(f(u(We,$),-F[1]),f(u(oe,he),O[1]))),B[2]))),p(f(p(f(u(be,ne),z[1]),p(f(u(ce,H),-F[1]),f(u(oe,he),B[1]))),-O[2]),p(f(p(f(u(ot,Ae),z[1]),p(f(u(We,$),-B[1]),f(u(ce,H),O[1]))),L[2]),f(p(f(u(ot,Ae),L[1]),p(f(u(Re,Q),-B[1]),f(u(re,W),O[1]))),-z[2])))),p(p(f(p(f(u(We,$),L[1]),p(f(u(Re,Q),-z[1]),f(u(se,N),O[1]))),B[2]),p(f(p(f(u(ce,H),L[1]),p(f(u(re,W),-z[1]),f(u(se,N),B[1]))),-O[2]),f(p(f(u(be,ne),z[1]),p(f(u(ce,H),-F[1]),f(u(oe,he),B[1]))),L[2]))),p(f(p(f(u(be,ne),L[1]),p(f(u(re,W),-F[1]),f(u(X,U),B[1]))),-z[2]),p(f(p(f(u(ce,H),L[1]),p(f(u(re,W),-z[1]),f(u(se,N),B[1]))),F[2]),f(p(f(u(oe,he),L[1]),p(f(u(X,U),-z[1]),f(u(se,N),F[1]))),-B[2]))))),ut=p(p(p(f(p(f(u(ot,Ae),F[1]),p(f(u(it,j),-B[1]),f(u(be,ne),O[1]))),L[2]),f(p(f(u(ot,Ae),L[1]),p(f(u(Re,Q),-B[1]),f(u(re,W),O[1]))),-F[2])),p(f(p(f(u(it,j),L[1]),p(f(u(Re,Q),-F[1]),f(u(X,U),O[1]))),B[2]),f(p(f(u(be,ne),L[1]),p(f(u(re,W),-F[1]),f(u(X,U),B[1]))),-O[2]))),p(p(f(p(f(u(it,j),z[1]),p(f(u(We,$),-F[1]),f(u(oe,he),O[1]))),L[2]),f(p(f(u(it,j),L[1]),p(f(u(Re,Q),-F[1]),f(u(X,U),O[1]))),-z[2])),p(f(p(f(u(We,$),L[1]),p(f(u(Re,Q),-z[1]),f(u(se,N),O[1]))),F[2]),f(p(f(u(oe,he),L[1]),p(f(u(X,U),-z[1]),f(u(se,N),F[1]))),-O[2])))),Me=u(tt,ut);return Me[Me.length-1]}return P}function w(p,u,y,f){function P(L,z,F,B,O,I){var N=p(p(y(L[0],L[0]),y(L[1],L[1])),p(y(L[2],L[2]),y(L[3],L[3]))),U=f(N,z[0]),W=f(N,F[0]),Q=f(N,B[0]),ue=f(N,O[0]),se=f(N,I[0]),he=p(p(y(z[0],z[0]),y(z[1],z[1])),p(y(z[2],z[2]),y(z[3],z[3]))),H=f(he,L[0]),$=f(he,F[0]),J=f(he,B[0]),X=f(he,O[0]),oe=f(he,I[0]),ne=p(p(y(F[0],F[0]),y(F[1],F[1])),p(y(F[2],F[2]),y(F[3],F[3]))),j=f(ne,L[0]),ee=f(ne,z[0]),re=f(ne,B[0]),ce=f(ne,O[0]),be=f(ne,I[0]),Ae=p(p(y(B[0],B[0]),y(B[1],B[1])),p(y(B[2],B[2]),y(B[3],B[3]))),ze=f(Ae,L[0]),Re=f(Ae,z[0]),We=f(Ae,F[0]),it=f(Ae,O[0]),ot=f(Ae,I[0]),tt=p(p(y(O[0],O[0]),y(O[1],O[1])),p(y(O[2],O[2]),y(O[3],O[3]))),ut=f(tt,L[0]),Me=f(tt,z[0]),_e=f(tt,F[0]),fe=f(tt,B[0]),Fe=f(tt,I[0]),rt=p(p(y(I[0],I[0]),y(I[1],I[1])),p(y(I[2],I[2]),y(I[3],I[3]))),st=f(rt,L[0]),Qe=f(rt,z[0]),Lt=f(rt,F[0]),kt=f(rt,B[0]),qt=f(rt,O[0]),Zt=p(p(p(f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),F[2]),f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),-B[2])),p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),O[2]),f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),-I[2]))),z[3]),p(f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),z[2]),f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),-B[2])),p(f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),O[2]),f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),-I[2]))),-F[3]),f(p(p(f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),z[2]),f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),-F[2])),p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),O[2]),f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),-I[2]))),B[3]))),p(p(f(p(p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),z[2]),f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),-F[2])),p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),B[2]),f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),-I[2]))),-O[3]),f(p(p(f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),z[2]),f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),-F[2])),p(f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),B[2]),f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),-O[2]))),I[3])),p(f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),z[2]),f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),-B[2])),p(f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),O[2]),f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),-I[2]))),L[3]),f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-B[2])),p(f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),O[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-I[2]))),-z[3])))),p(p(p(f(p(p(f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),O[2]),f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),-I[2]))),B[3]),f(p(p(f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),L[2]),f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),B[2]),f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),-I[2]))),-O[3])),p(f(p(p(f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),L[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-z[2])),p(f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),B[2]),f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),-O[2]))),I[3]),f(p(p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),z[2]),f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),-F[2])),p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),B[2]),f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),-I[2]))),L[3]))),p(p(f(p(p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),L[2]),f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),-F[2])),p(f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),B[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-I[2]))),-z[3]),f(p(p(f(p(f(u(kt,ot),z[1]),p(f(u(Qe,oe),-B[1]),f(u(Re,J),I[1]))),L[2]),f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),B[2]),f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),-I[2]))),F[3])),p(f(p(p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),L[2]),f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-I[2]))),-B[3]),f(p(p(f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),L[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-z[2])),p(f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-B[2]))),I[3]))))),Sr=p(p(p(f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),F[2]),f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),-B[2])),p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),O[2]),f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),-I[2]))),L[3]),p(f(p(p(f(p(f(u(qt,Fe),B[1]),p(f(u(kt,ot),-O[1]),f(u(fe,it),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-B[2])),p(f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),O[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-I[2]))),-F[3]),f(p(p(f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-F[2])),p(f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),O[2]),f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),-I[2]))),B[3]))),p(p(f(p(p(f(p(f(u(kt,ot),F[1]),p(f(u(Lt,be),-B[1]),f(u(We,re),I[1]))),L[2]),f(p(f(u(kt,ot),L[1]),p(f(u(st,se),-B[1]),f(u(ze,Q),I[1]))),-F[2])),p(f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),B[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-I[2]))),-O[3]),f(p(p(f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),L[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-F[2])),p(f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),B[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-O[2]))),I[3])),p(f(p(p(f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),z[2]),f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),-F[2])),p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),O[2]),f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),-I[2]))),L[3]),f(p(p(f(p(f(u(qt,Fe),F[1]),p(f(u(Lt,be),-O[1]),f(u(_e,ce),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-F[2])),p(f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),O[2]),f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),-I[2]))),-z[3])))),p(p(p(f(p(p(f(p(f(u(qt,Fe),z[1]),p(f(u(Qe,oe),-O[1]),f(u(Me,X),I[1]))),L[2]),f(p(f(u(qt,Fe),L[1]),p(f(u(st,se),-O[1]),f(u(ut,ue),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),O[2]),f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),-I[2]))),F[3]),f(p(p(f(p(f(u(Lt,be),z[1]),p(f(u(Qe,oe),-F[1]),f(u(ee,$),I[1]))),L[2]),f(p(f(u(Lt,be),L[1]),p(f(u(st,se),-F[1]),f(u(j,W),I[1]))),-z[2])),p(f(p(f(u(Qe,oe),L[1]),p(f(u(st,se),-z[1]),f(u(H,U),I[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-I[2]))),-O[3])),p(f(p(p(f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),L[2]),f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),-z[2])),p(f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-O[2]))),I[3]),f(p(p(f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),z[2]),f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),-F[2])),p(f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),B[2]),f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),-O[2]))),L[3]))),p(p(f(p(p(f(p(f(u(fe,it),F[1]),p(f(u(_e,ce),-B[1]),f(u(We,re),O[1]))),L[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-F[2])),p(f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),B[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-O[2]))),-z[3]),f(p(p(f(p(f(u(fe,it),z[1]),p(f(u(Me,X),-B[1]),f(u(Re,J),O[1]))),L[2]),f(p(f(u(fe,it),L[1]),p(f(u(ut,ue),-B[1]),f(u(ze,Q),O[1]))),-z[2])),p(f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),B[2]),f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),-O[2]))),F[3])),p(f(p(p(f(p(f(u(_e,ce),z[1]),p(f(u(Me,X),-F[1]),f(u(ee,$),O[1]))),L[2]),f(p(f(u(_e,ce),L[1]),p(f(u(ut,ue),-F[1]),f(u(j,W),O[1]))),-z[2])),p(f(p(f(u(Me,X),L[1]),p(f(u(ut,ue),-z[1]),f(u(H,U),O[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-O[2]))),-B[3]),f(p(p(f(p(f(u(We,re),z[1]),p(f(u(Re,J),-F[1]),f(u(ee,$),B[1]))),L[2]),f(p(f(u(We,re),L[1]),p(f(u(ze,Q),-F[1]),f(u(j,W),B[1]))),-z[2])),p(f(p(f(u(Re,J),L[1]),p(f(u(ze,Q),-z[1]),f(u(H,U),B[1]))),F[2]),f(p(f(u(ee,$),L[1]),p(f(u(j,W),-z[1]),f(u(H,U),F[1]))),-B[2]))),O[3]))))),xr=u(Zt,Sr);return xr[xr.length-1]}return P}var S=[h,m,d];function E(p){var u=S[p.length];return u||(u=S[p.length]=c(p.length)),u.apply(void 0,p)}function g(p,u,y,f,P,L,z,F){function B(O,I,N,U,W,Q){switch(arguments.length){case 0:case 1:return 0;case 2:return f(O,I);case 3:return P(O,I,N);case 4:return L(O,I,N,U);case 5:return z(O,I,N,U,W);case 6:return F(O,I,N,U,W,Q)}for(var ue=new Array(arguments.length),se=0;se<arguments.length;++se)ue[se]=arguments[se];return p(ue)}return B}function b(){for(;S.length<=s;)S.push(c(S.length));e.exports=g.apply(void 0,[E].concat(S));for(var p=0;p<=s;++p)e.exports[p]=S[p]}b()},727:function(e,t,r){"use strict";var i=r(2962),a=6;function n(S){var E=S===2?c:S===3?h:S===4?m:S===5?d:T;return S<6?E(i[S]):E(i)}function o(){return[[0]]}function s(S,E){return[[E[0]],[S[0][0]]]}function c(S){return function(g,b){return[S([[+b[0],+g[0][1]],[+b[1],+g[1][1]]]),S([[+g[0][0],+b[0]],[+g[1][0],+b[1]]]),S(g)]}}function h(S){return function(g,b){return[S([[+b[0],+g[0][1],+g[0][2]],[+b[1],+g[1][1],+g[1][2]],[+b[2],+g[2][1],+g[2][2]]]),S([[+g[0][0],+b[0],+g[0][2]],[+g[1][0],+b[1],+g[1][2]],[+g[2][0],+b[2],+g[2][2]]]),S([[+g[0][0],+g[0][1],+b[0]],[+g[1][0],+g[1][1],+b[1]],[+g[2][0],+g[2][1],+b[2]]]),S(g)]}}function m(S){return function(g,b){return[S([[+b[0],+g[0][1],+g[0][2],+g[0][3]],[+b[1],+g[1][1],+g[1][2],+g[1][3]],[+b[2],+g[2][1],+g[2][2],+g[2][3]],[+b[3],+g[3][1],+g[3][2],+g[3][3]]]),S([[+g[0][0],+b[0],+g[0][2],+g[0][3]],[+g[1][0],+b[1],+g[1][2],+g[1][3]],[+g[2][0],+b[2],+g[2][2],+g[2][3]],[+g[3][0],+b[3],+g[3][2],+g[3][3]]]),S([[+g[0][0],+g[0][1],+b[0],+g[0][3]],[+g[1][0],+g[1][1],+b[1],+g[1][3]],[+g[2][0],+g[2][1],+b[2],+g[2][3]],[+g[3][0],+g[3][1],+b[3],+g[3][3]]]),S([[+g[0][0],+g[0][1],+g[0][2],+b[0]],[+g[1][0],+g[1][1],+g[1][2],+b[1]],[+g[2][0],+g[2][1],+g[2][2],+b[2]],[+g[3][0],+g[3][1],+g[3][2],+b[3]]]),S(g)]}}function d(S){return function(g,b){return[S([[+b[0],+g[0][1],+g[0][2],+g[0][3],+g[0][4]],[+b[1],+g[1][1],+g[1][2],+g[1][3],+g[1][4]],[+b[2],+g[2][1],+g[2][2],+g[2][3],+g[2][4]],[+b[3],+g[3][1],+g[3][2],+g[3][3],+g[3][4]],[+b[4],+g[4][1],+g[4][2],+g[4][3],+g[4][4]]]),S([[+g[0][0],+b[0],+g[0][2],+g[0][3],+g[0][4]],[+g[1][0],+b[1],+g[1][2],+g[1][3],+g[1][4]],[+g[2][0],+b[2],+g[2][2],+g[2][3],+g[2][4]],[+g[3][0],+b[3],+g[3][2],+g[3][3],+g[3][4]],[+g[4][0],+b[4],+g[4][2],+g[4][3],+g[4][4]]]),S([[+g[0][0],+g[0][1],+b[0],+g[0][3],+g[0][4]],[+g[1][0],+g[1][1],+b[1],+g[1][3],+g[1][4]],[+g[2][0],+g[2][1],+b[2],+g[2][3],+g[2][4]],[+g[3][0],+g[3][1],+b[3],+g[3][3],+g[3][4]],[+g[4][0],+g[4][1],+b[4],+g[4][3],+g[4][4]]]),S([[+g[0][0],+g[0][1],+g[0][2],+b[0],+g[0][4]],[+g[1][0],+g[1][1],+g[1][2],+b[1],+g[1][4]],[+g[2][0],+g[2][1],+g[2][2],+b[2],+g[2][4]],[+g[3][0],+g[3][1],+g[3][2],+b[3],+g[3][4]],[+g[4][0],+g[4][1],+g[4][2],+b[4],+g[4][4]]]),S([[+g[0][0],+g[0][1],+g[0][2],+g[0][3],+b[0]],[+g[1][0],+g[1][1],+g[1][2],+g[1][3],+b[1]],[+g[2][0],+g[2][1],+g[2][2],+g[2][3],+b[2]],[+g[3][0],+g[3][1],+g[3][2],+g[3][3],+b[3]],[+g[4][0],+g[4][1],+g[4][2],+g[4][3],+b[4]]]),S(g)]}}function T(S){return function(g,b){return[S([[+b[0],+g[0][1],+g[0][2],+g[0][3],+g[0][4],+g[0][5]],[+b[1],+g[1][1],+g[1][2],+g[1][3],+g[1][4],+g[1][5]],[+b[2],+g[2][1],+g[2][2],+g[2][3],+g[2][4],+g[2][5]],[+b[3],+g[3][1],+g[3][2],+g[3][3],+g[3][4],+g[3][5]],[+b[4],+g[4][1],+g[4][2],+g[4][3],+g[4][4],+g[4][5]],[+b[5],+g[5][1],+g[5][2],+g[5][3],+g[5][4],+g[5][5]]]),S([[+g[0][0],+b[0],+g[0][2],+g[0][3],+g[0][4],+g[0][5]],[+g[1][0],+b[1],+g[1][2],+g[1][3],+g[1][4],+g[1][5]],[+g[2][0],+b[2],+g[2][2],+g[2][3],+g[2][4],+g[2][5]],[+g[3][0],+b[3],+g[3][2],+g[3][3],+g[3][4],+g[3][5]],[+g[4][0],+b[4],+g[4][2],+g[4][3],+g[4][4],+g[4][5]],[+g[5][0],+b[5],+g[5][2],+g[5][3],+g[5][4],+g[5][5]]]),S([[+g[0][0],+g[0][1],+b[0],+g[0][3],+g[0][4],+g[0][5]],[+g[1][0],+g[1][1],+b[1],+g[1][3],+g[1][4],+g[1][5]],[+g[2][0],+g[2][1],+b[2],+g[2][3],+g[2][4],+g[2][5]],[+g[3][0],+g[3][1],+b[3],+g[3][3],+g[3][4],+g[3][5]],[+g[4][0],+g[4][1],+b[4],+g[4][3],+g[4][4],+g[4][5]],[+g[5][0],+g[5][1],+b[5],+g[5][3],+g[5][4],+g[5][5]]]),S([[+g[0][0],+g[0][1],+g[0][2],+b[0],+g[0][4],+g[0][5]],[+g[1][0],+g[1][1],+g[1][2],+b[1],+g[1][4],+g[1][5]],[+g[2][0],+g[2][1],+g[2][2],+b[2],+g[2][4],+g[2][5]],[+g[3][0],+g[3][1],+g[3][2],+b[3],+g[3][4],+g[3][5]],[+g[4][0],+g[4][1],+g[4][2],+b[4],+g[4][4],+g[4][5]],[+g[5][0],+g[5][1],+g[5][2],+b[5],+g[5][4],+g[5][5]]]),S([[+g[0][0],+g[0][1],+g[0][2],+g[0][3],+b[0],+g[0][5]],[+g[1][0],+g[1][1],+g[1][2],+g[1][3],+b[1],+g[1][5]],[+g[2][0],+g[2][1],+g[2][2],+g[2][3],+b[2],+g[2][5]],[+g[3][0],+g[3][1],+g[3][2],+g[3][3],+b[3],+g[3][5]],[+g[4][0],+g[4][1],+g[4][2],+g[4][3],+b[4],+g[4][5]],[+g[5][0],+g[5][1],+g[5][2],+g[5][3],+b[5],+g[5][5]]]),S([[+g[0][0],+g[0][1],+g[0][2],+g[0][3],+g[0][4],+b[0]],[+g[1][0],+g[1][1],+g[1][2],+g[1][3],+g[1][4],+b[1]],[+g[2][0],+g[2][1],+g[2][2],+g[2][3],+g[2][4],+b[2]],[+g[3][0],+g[3][1],+g[3][2],+g[3][3],+g[3][4],+b[3]],[+g[4][0],+g[4][1],+g[4][2],+g[4][3],+g[4][4],+b[4]],[+g[5][0],+g[5][1],+g[5][2],+g[5][3],+g[5][4],+b[5]]]),S(g)]}}var l=[o,s];function _(S,E,g,b,p,u,y,f){return function(L,z){switch(L.length){case 0:return S(L,z);case 1:return E(L,z);case 2:return g(L,z);case 3:return b(L,z);case 4:return p(L,z);case 5:return u(L,z)}var F=y[L.length];return F||(F=y[L.length]=f(L.length)),F(L,z)}}function w(){for(;l.length<a;)l.push(n(l.length));e.exports=_.apply(void 0,l.concat([l,n]));for(var S=0;S<a;++S)e.exports[S]=l[S]}w()},3250:function(e,t,r){"use strict";var i=r(5250),a=r(8210),n=r(3012),o=r(8545),s=5,c=11102230246251565e-32,h=(3+16*c)*c,m=(7+56*c)*c;function d(u,y,f,P){return function(z,F,B){var O=u(u(y(F[1],B[0]),y(-B[1],F[0])),u(y(z[1],F[0]),y(-F[1],z[0]))),I=u(y(z[1],B[0]),y(-B[1],z[0])),N=P(O,I);return N[N.length-1]}}function T(u,y,f,P){return function(z,F,B,O){var I=u(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),F[2]),u(f(u(y(F[1],O[0]),y(-O[1],F[0])),-B[2]),f(u(y(F[1],B[0]),y(-B[1],F[0])),O[2]))),u(f(u(y(F[1],O[0]),y(-O[1],F[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),O[2])))),N=u(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-B[2]),f(u(y(z[1],B[0]),y(-B[1],z[0])),O[2]))),u(f(u(y(F[1],B[0]),y(-B[1],F[0])),z[2]),u(f(u(y(z[1],B[0]),y(-B[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),B[2])))),U=P(I,N);return U[U.length-1]}}function l(u,y,f,P){return function(z,F,B,O,I){var N=u(u(u(f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),B[2]),u(f(u(y(B[1],I[0]),y(-I[1],B[0])),-O[2]),f(u(y(B[1],O[0]),y(-O[1],B[0])),I[2]))),F[3]),u(f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),F[2]),u(f(u(y(F[1],I[0]),y(-I[1],F[0])),-O[2]),f(u(y(F[1],O[0]),y(-O[1],F[0])),I[2]))),-B[3]),f(u(f(u(y(B[1],I[0]),y(-I[1],B[0])),F[2]),u(f(u(y(F[1],I[0]),y(-I[1],F[0])),-B[2]),f(u(y(F[1],B[0]),y(-B[1],F[0])),I[2]))),O[3]))),u(f(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),F[2]),u(f(u(y(F[1],O[0]),y(-O[1],F[0])),-B[2]),f(u(y(F[1],B[0]),y(-B[1],F[0])),O[2]))),-I[3]),u(f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),F[2]),u(f(u(y(F[1],I[0]),y(-I[1],F[0])),-O[2]),f(u(y(F[1],O[0]),y(-O[1],F[0])),I[2]))),z[3]),f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-O[2]),f(u(y(z[1],O[0]),y(-O[1],z[0])),I[2]))),-F[3])))),u(u(f(u(f(u(y(F[1],I[0]),y(-I[1],F[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),I[2]))),O[3]),u(f(u(f(u(y(F[1],O[0]),y(-O[1],F[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),O[2]))),-I[3]),f(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),F[2]),u(f(u(y(F[1],O[0]),y(-O[1],F[0])),-B[2]),f(u(y(F[1],B[0]),y(-B[1],F[0])),O[2]))),z[3]))),u(f(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-B[2]),f(u(y(z[1],B[0]),y(-B[1],z[0])),O[2]))),-F[3]),u(f(u(f(u(y(F[1],O[0]),y(-O[1],F[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),O[2]))),B[3]),f(u(f(u(y(F[1],B[0]),y(-B[1],F[0])),z[2]),u(f(u(y(z[1],B[0]),y(-B[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),B[2]))),-O[3]))))),U=u(u(u(f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),B[2]),u(f(u(y(B[1],I[0]),y(-I[1],B[0])),-O[2]),f(u(y(B[1],O[0]),y(-O[1],B[0])),I[2]))),z[3]),f(u(f(u(y(O[1],I[0]),y(-I[1],O[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-O[2]),f(u(y(z[1],O[0]),y(-O[1],z[0])),I[2]))),-B[3])),u(f(u(f(u(y(B[1],I[0]),y(-I[1],B[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-B[2]),f(u(y(z[1],B[0]),y(-B[1],z[0])),I[2]))),O[3]),f(u(f(u(y(B[1],O[0]),y(-O[1],B[0])),z[2]),u(f(u(y(z[1],O[0]),y(-O[1],z[0])),-B[2]),f(u(y(z[1],B[0]),y(-B[1],z[0])),O[2]))),-I[3]))),u(u(f(u(f(u(y(B[1],I[0]),y(-I[1],B[0])),F[2]),u(f(u(y(F[1],I[0]),y(-I[1],F[0])),-B[2]),f(u(y(F[1],B[0]),y(-B[1],F[0])),I[2]))),z[3]),f(u(f(u(y(B[1],I[0]),y(-I[1],B[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-B[2]),f(u(y(z[1],B[0]),y(-B[1],z[0])),I[2]))),-F[3])),u(f(u(f(u(y(F[1],I[0]),y(-I[1],F[0])),z[2]),u(f(u(y(z[1],I[0]),y(-I[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),I[2]))),B[3]),f(u(f(u(y(F[1],B[0]),y(-B[1],F[0])),z[2]),u(f(u(y(z[1],B[0]),y(-B[1],z[0])),-F[2]),f(u(y(z[1],F[0]),y(-F[1],z[0])),B[2]))),-I[3])))),W=P(N,U);return W[W.length-1]}}function _(u){var y=u===3?d:u===4?T:l;return y(a,i,n,o)}var w=_(3),S=_(4),E=[function(){return 0},function(){return 0},function(y,f){return f[0]-y[0]},function(y,f,P){var L=(y[1]-P[1])*(f[0]-P[0]),z=(y[0]-P[0])*(f[1]-P[1]),F=L-z,B;if(L>0){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;ue<arguments.length;++ue)Q[ue]=arguments[ue];return u(Q)}}function p(){for(;E.length<=s;)E.push(_(E.length));e.exports=b.apply(void 0,[g].concat(E));for(var u=0;u<=s;++u)e.exports[u]=E[u]}p()},5382:function(e,t,r){"use strict";var i=r(8210),a=r(3012);e.exports=n;function n(o,s){if(o.length===1)return a(s,o[0]);if(s.length===1)return a(o,s[0]);if(o.length===0||s.length===0)return[0];var c=[0];if(o.length<s.length)for(var h=0;h<o.length;++h)c=i(c,a(s,o[h]));else for(var h=0;h<s.length;++h)c=i(c,a(o,s[h]));return c}},3012:function(e,t,r){"use strict";var i=r(5250),a=r(9362);e.exports=n;function n(o,s){var c=o.length;if(c===1){var h=i(o[0],s);return h[0]?h:[h[1]]}var m=new Array(2*c),d=[.1,.1],T=[.1,.1],l=0;i(o[0],s,d),d[0]&&(m[l++]=d[0]);for(var _=1;_<c;++_){i(o[_],s,T);var w=d[1];a(w,T[0],d),d[0]&&(m[l++]=d[0]);var S=T[1],E=d[1],g=S+E,b=g-S,p=E-b;d[1]=g,p&&(m[l++]=p)}return d[1]&&(m[l++]=d[1]),l===0&&(m[l++]=0),m.length=l,m}},1125:function(e,t,r){"use strict";e.exports=n;var i=r(3250)[3];function a(o,s,c,h){for(var m=0;m<2;++m){var d=o[m],T=s[m],l=Math.min(d,T),_=Math.max(d,T),w=c[m],S=h[m],E=Math.min(w,S),g=Math.max(w,S);if(g<l||_<E)return!1}return!0}function n(o,s,c,h){var m=i(o,c,h),d=i(s,c,h);if(m>0&&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;_<S?(g=l,m+=1,m<n&&(l=i[m],_=T(l))):(g=w,d+=1,d<o&&(w=-a[d],S=T(w))),m<n&&_<S||d>=o?(E=l,m+=1,m<n&&(l=i[m],_=T(l))):(E=w,d+=1,d<o&&(w=-a[d],S=T(w)));for(var b=E+g,p=b-E,u=g-p,y=u,f=b,P,L,z,F,B;m<n&&d<o;)_<S?(E=l,m+=1,m<n&&(l=i[m],_=T(l))):(E=w,d+=1,d<o&&(w=-a[d],S=T(w))),g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P;for(;m<n;)E=l,g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P,m+=1,m<n&&(l=i[m]);for(;d<o;)E=w,g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P,d+=1,d<o&&(w=-a[d]);return y&&(c[h++]=y),f&&(c[h++]=f),h||(c[h++]=0),c.length=h,c}},8210: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;_<S?(g=l,m+=1,m<n&&(l=i[m],_=T(l))):(g=w,d+=1,d<o&&(w=a[d],S=T(w))),m<n&&_<S||d>=o?(E=l,m+=1,m<n&&(l=i[m],_=T(l))):(E=w,d+=1,d<o&&(w=a[d],S=T(w)));for(var b=E+g,p=b-E,u=g-p,y=u,f=b,P,L,z,F,B;m<n&&d<o;)_<S?(E=l,m+=1,m<n&&(l=i[m],_=T(l))):(E=w,d+=1,d<o&&(w=a[d],S=T(w))),g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P;for(;m<n;)E=l,g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P,m+=1,m<n&&(l=i[m]);for(;d<o;)E=w,g=y,b=E+g,p=b-E,u=g-p,u&&(c[h++]=u),P=f+b,L=P-f,z=P-L,F=b-L,B=f-z,y=B+F,f=P,d+=1,d<o&&(w=a[d]);return y&&(c[h++]=y),f&&(c[h++]=f),h||(c[h++]=0),c.length=h,c}},9127:function(e,t,r){"use strict";e.exports=n;var i=r(6204),a=r(5771);function n(o){return a(i(o))}},7765:function(e,t,r){"use strict";e.exports=l;var i=r(9618),a=r(1888),n=r(446),o=r(1570);function s(_){for(var w=_.length,S=0,E=0;E<w;++E)S=Math.max(S,_[E].length)|0;return S-1}function c(_,w){for(var S=_.length,E=a.mallocUint8(S),g=0;g<S;++g)E[g]=_[g]<w|0;return E}function h(_,w){for(var S=_.length,E=w*(w+1)/2*S|0,g=a.mallocUint32(E*2),b=0,p=0;p<S;++p)for(var u=_[p],w=u.length,y=0;y<w;++y)for(var f=0;f<y;++f){var P=u[f],L=u[y];g[b++]=Math.min(P,L)|0,g[b++]=Math.max(P,L)|0}var z=b/2|0;n(i(g,[z,2]));for(var F=2,p=2;p<b;p+=2)g[p-2]===g[p]&&g[p-1]===g[p+1]||(g[F++]=g[p],g[F++]=g[p+1]);return i(g,[F/2|0,2])}function m(_,w,S,E){for(var g=_.data,b=_.shape[0],p=a.mallocDouble(b),u=0,y=0;y<b;++y){var f=g[2*y],P=g[2*y+1];if(S[f]!==S[P]){var L=w[f],z=w[P];g[2*u]=f,g[2*u+1]=P,p[u++]=(z-E)/(z-L)}}return _.shape[0]=u,i(p,[u])}function d(_,w){var S=a.mallocInt32(w*2),E=_.shape[0],g=_.data;S[0]=0;for(var b=0,p=0;p<E;++p){var u=g[2*p];if(u!==b){for(S[2*b+1]=p;++b<u;)S[2*b]=p,S[2*b+1]=p;S[2*b]=p}}for(S[2*b+1]=E;++b<w;)S[2*b]=S[2*b+1]=E;return S}function T(_){for(var w=_.shape[0]|0,S=_.data,E=new Array(w),g=0;g<w;++g)E[g]=[S[2*g],S[2*g+1]];return E}function l(_,w,S,E){S=S||0,typeof E>"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<l;){var _=T+l>>1,w=s[2*_+1];if(w===d)return _;d<w?l=_:T=_+1}return T}function n(o,s,c,h){for(var m=o.length,d=[],T=0;T<m;++T)var l=o[T],_=l.length;return d}return n},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<l;){var _=T+l>>1,w=s[2*_+1];if(w===d)return _;d<w?l=_:T=_+1}return T}function n(o,s,c,h){for(var m=o.length,d=[],T=0;T<m;++T){var l=o[T],_=l.length;if(_===2){var w=(h[l[0]]<<0)+(h[l[1]]<<1);if(w===0||w===3)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[1])]);break;case 2:d.push([a(c,s,l[1],l[0])]);break;case 3:break}}}return d}return n},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<l;){var _=T+l>>1,w=s[2*_+1];if(w===d)return _;d<w?l=_:T=_+1}return T}function n(o,s,c,h){for(var m=o.length,d=[],T=0;T<m;++T){var l=o[T],_=l.length;if(_===3){var w=(h[l[0]]<<0)+(h[l[1]]<<1)+(h[l[2]]<<2);if(w===0||w===7)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[2]),a(c,s,l[0],l[1])]);break;case 2:d.push([a(c,s,l[1],l[0]),a(c,s,l[1],l[2])]);break;case 3:d.push([a(c,s,l[0],l[2]),a(c,s,l[1],l[2])]);break;case 4:d.push([a(c,s,l[2],l[1]),a(c,s,l[2],l[0])]);break;case 5:d.push([a(c,s,l[2],l[1]),a(c,s,l[0],l[1])]);break;case 6:d.push([a(c,s,l[1],l[0]),a(c,s,l[2],l[0])]);break;case 7:break}}else if(_===2){var w=(h[l[0]]<<0)+(h[l[1]]<<1);if(w===0||w===3)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[1])]);break;case 2:d.push([a(c,s,l[1],l[0])]);break;case 3:break}}}return d}return n},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<l;){var _=T+l>>1,w=s[2*_+1];if(w===d)return _;d<w?l=_:T=_+1}return T}function n(o,s,c,h){for(var m=o.length,d=[],T=0;T<m;++T){var l=o[T],_=l.length;if(_===4){var w=(h[l[0]]<<0)+(h[l[1]]<<1)+(h[l[2]]<<2)+(h[l[3]]<<3);if(w===0||w===15)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[1]),a(c,s,l[0],l[2]),a(c,s,l[0],l[3])]);break;case 2:d.push([a(c,s,l[1],l[2]),a(c,s,l[1],l[0]),a(c,s,l[1],l[3])]);break;case 3:d.push([a(c,s,l[1],l[2]),a(c,s,l[0],l[2]),a(c,s,l[0],l[3])],[a(c,s,l[1],l[3]),a(c,s,l[1],l[2]),a(c,s,l[0],l[3])]);break;case 4:d.push([a(c,s,l[2],l[0]),a(c,s,l[2],l[1]),a(c,s,l[2],l[3])]);break;case 5:d.push([a(c,s,l[0],l[1]),a(c,s,l[2],l[1]),a(c,s,l[0],l[3])],[a(c,s,l[2],l[1]),a(c,s,l[2],l[3]),a(c,s,l[0],l[3])]);break;case 6:d.push([a(c,s,l[2],l[0]),a(c,s,l[1],l[0]),a(c,s,l[1],l[3])],[a(c,s,l[2],l[3]),a(c,s,l[2],l[0]),a(c,s,l[1],l[3])]);break;case 7:d.push([a(c,s,l[0],l[3]),a(c,s,l[1],l[3]),a(c,s,l[2],l[3])]);break;case 8:d.push([a(c,s,l[3],l[1]),a(c,s,l[3],l[0]),a(c,s,l[3],l[2])]);break;case 9:d.push([a(c,s,l[3],l[1]),a(c,s,l[0],l[1]),a(c,s,l[0],l[2])],[a(c,s,l[3],l[2]),a(c,s,l[3],l[1]),a(c,s,l[0],l[2])]);break;case 10:d.push([a(c,s,l[1],l[0]),a(c,s,l[3],l[0]),a(c,s,l[1],l[2])],[a(c,s,l[3],l[0]),a(c,s,l[3],l[2]),a(c,s,l[1],l[2])]);break;case 11:d.push([a(c,s,l[1],l[2]),a(c,s,l[0],l[2]),a(c,s,l[3],l[2])]);break;case 12:d.push([a(c,s,l[3],l[0]),a(c,s,l[2],l[0]),a(c,s,l[2],l[1])],[a(c,s,l[3],l[1]),a(c,s,l[3],l[0]),a(c,s,l[2],l[1])]);break;case 13:d.push([a(c,s,l[0],l[1]),a(c,s,l[2],l[1]),a(c,s,l[3],l[1])]);break;case 14:d.push([a(c,s,l[2],l[0]),a(c,s,l[1],l[0]),a(c,s,l[3],l[0])]);break;case 15:break}}else if(_===3){var w=(h[l[0]]<<0)+(h[l[1]]<<1)+(h[l[2]]<<2);if(w===0||w===7)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[2]),a(c,s,l[0],l[1])]);break;case 2:d.push([a(c,s,l[1],l[0]),a(c,s,l[1],l[2])]);break;case 3:d.push([a(c,s,l[0],l[2]),a(c,s,l[1],l[2])]);break;case 4:d.push([a(c,s,l[2],l[1]),a(c,s,l[2],l[0])]);break;case 5:d.push([a(c,s,l[2],l[1]),a(c,s,l[0],l[1])]);break;case 6:d.push([a(c,s,l[1],l[0]),a(c,s,l[2],l[0])]);break;case 7:break}}else if(_===2){var w=(h[l[0]]<<0)+(h[l[1]]<<1);if(w===0||w===3)continue;switch(w){case 0:break;case 1:d.push([a(c,s,l[0],l[1])]);break;case 2:d.push([a(c,s,l[1],l[0])]);break;case 3:break}}}return d}return n}];function r(i){return t[i]()}},6803:function(e,t,r){"use strict";var i,a=r(8828),n=r(1755);function o(y){for(var f=0,P=Math.max,L=0,z=y.length;L<z;++L)f=P(f,y[L].length);return f-1}i=o;function s(y){for(var f=-1,P=Math.max,L=0,z=y.length;L<z;++L)for(var F=y[L],B=0,O=F.length;B<O;++B)f=P(f,F[B]);return f+1}i=s;function c(y){for(var f=new Array(y.length),P=0,L=y.length;P<L;++P)f[P]=y[P].slice(0);return f}i=c;function h(y,f){var P=y.length,L=y.length-f.length,z=Math.min;if(L)return L;switch(P){case 0:return 0;case 1:return y[0]-f[0];case 2:var N=y[0]+y[1]-f[0]-f[1];return N||z(y[0],y[1])-z(f[0],f[1]);case 3:var F=y[0]+y[1],B=f[0]+f[1];if(N=F+y[2]-(B+f[2]),N)return N;var O=z(y[0],y[1]),I=z(f[0],f[1]),N=z(O,y[2])-z(I,f[2]);return N||z(O+y[2],F)-z(I+f[2],B);default:var U=y.slice(0);U.sort();var W=f.slice(0);W.sort();for(var Q=0;Q<P;++Q)if(L=U[Q]-W[Q],L)return L;return 0}}t.Fw=h;function m(y,f){return h(y[0],f[0])}function d(y,f){if(f){for(var P=y.length,L=new Array(P),z=0;z<P;++z)L[z]=[y[z],f[z]];L.sort(m);for(var z=0;z<P;++z)y[z]=L[z][0],f[z]=L[z][1];return y}else return y.sort(h),y}i=d;function T(y){if(y.length===0)return[];for(var f=1,P=y.length,L=1;L<P;++L){var z=y[L];if(h(z,y[L-1])){if(L===f){f++;continue}y[f++]=z}}return y.length=f,y}i=T;function l(y,f){for(var P=0,L=y.length-1,z=-1;P<=L;){var F=P+L>>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<z;++L)P[L]=[];for(var F=[],L=0,B=f.length;L<B;++L)for(var O=f[L],I=O.length,N=1,U=1<<I;N<U;++N){F.length=a.popCount(N);for(var W=0,Q=0;Q<I;++Q)N&1<<Q&&(F[W++]=O[Q]);var ue=l(y,F);if(!(ue<0))for(;P[ue++].push(L),!(ue>=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<f;++L)P[L]=[];for(var L=0,z=y.length;L<z;++L)for(var F=y[L],B=0,O=F.length;B<O;++B)P[F[B]].push(L);return P}i=w;function S(y){for(var f=[],P=0,L=y.length;P<L;++P)for(var z=y[P],F=z.length|0,B=1,O=1<<F;B<O;++B){for(var I=[],N=0;N<F;++N)B>>>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<<f+1)-1,z=0;z<y.length;++z)for(var F=y[z],B=L;B<1<<F.length;B=a.nextCombination(B)){for(var O=new Array(f+1),I=0,N=0;N<F.length;++N)B&1<<N&&(O[I++]=F[N]);P.push(O)}return d(P)}i=E;function g(y){for(var f=[],P=0,L=y.length;P<L;++P)for(var z=y[P],F=0,B=z.length;F<B;++F){for(var O=new Array(z.length-1),I=0,N=0;I<B;++I)I!==F&&(O[N++]=z[I]);f.push(O)}return d(f)}i=g;function b(y,f){for(var P=new n(f),L=0;L<y.length;++L)for(var z=y[L],F=0;F<z.length;++F)for(var B=F+1;B<z.length;++B)P.link(z[F],z[B]);for(var O=[],I=P.ranks,L=0;L<I.length;++L)I[L]=-1;for(var L=0;L<y.length;++L){var N=P.find(y[L][0]);I[N]<0?(I[N]=O.length,O.push([y[L].slice(0)])):O[I[N]].push(y[L].slice(0))}return O}function p(y){for(var f=T(d(E(y,0))),P=new n(f.length),L=0;L<y.length;++L)for(var z=y[L],F=0;F<z.length;++F)for(var B=l(f,[z[F]]),O=F+1;O<z.length;++O)P.link(B,l(f,[z[O]]));for(var I=[],N=P.ranks,L=0;L<N.length;++L)N[L]=-1;for(var L=0;L<y.length;++L){var U=P.find(l(f,[y[L][0]]));N[U]<0?(N[U]=I.length,I.push([y[L].slice(0)])):I[N[U]].push(y[L].slice(0))}return I}function u(y,f){return f?b(y,f):p(y)}i=u},3105:function(e,t){"use strict";"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<<r-1,t.sign=function(n){return(n>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)&-(n<o)},t.max=function(n,o){return n^(n^o)&-(n<o)},t.isPow2=function(n){return!(n&n-1)&&!!n},t.log2=function(n){var o,s;return o=(n>65535)<<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<<h&255}})(a),t.reverse=function(n){return a[n&255]<<24|a[n>>>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<L;++P)y=f(y,u[P].length);return y-1}t.dimension=n;function o(u){for(var y=-1,f=Math.max,P=0,L=u.length;P<L;++P)for(var z=u[P],F=0,B=z.length;F<B;++F)y=f(y,z[F]);return y+1}t.countVertices=o;function s(u){for(var y=new Array(u.length),f=0,P=u.length;f<P;++f)y[f]=u[f].slice(0);return y}t.cloneCells=s;function c(u,y){var f=u.length,P=u.length-y.length,L=Math.min;if(P)return P;switch(f){case 0:return 0;case 1:return u[0]-y[0];case 2:var I=u[0]+u[1]-y[0]-y[1];return I||L(u[0],u[1])-L(y[0],y[1]);case 3:var z=u[0]+u[1],F=y[0]+y[1];if(I=z+u[2]-(F+y[2]),I)return I;var B=L(u[0],u[1]),O=L(y[0],y[1]),I=L(B,u[2])-L(O,y[2]);return I||L(B+u[2],z)-L(O+y[2],F);default:var N=u.slice(0);N.sort();var U=y.slice(0);U.sort();for(var W=0;W<f;++W)if(P=N[W]-U[W],P)return P;return 0}}t.compareCells=c;function h(u,y){return c(u[0],y[0])}function m(u,y){if(y){for(var f=u.length,P=new Array(f),L=0;L<f;++L)P[L]=[u[L],y[L]];P.sort(h);for(var L=0;L<f;++L)u[L]=P[L][0],y[L]=P[L][1];return u}else return u.sort(c),u}t.normalize=m;function d(u){if(u.length===0)return[];for(var y=1,f=u.length,P=1;P<f;++P){var L=u[P];if(c(L,u[P-1])){if(P===y){y++;continue}u[y++]=L}}return u.length=y,u}t.unique=d;function T(u,y){for(var f=0,P=u.length-1,L=-1;f<=P;){var z=f+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<L;++P)f[P]=[];for(var z=[],P=0,F=y.length;P<F;++P)for(var B=y[P],O=B.length,I=1,N=1<<O;I<N;++I){z.length=i.popCount(I);for(var U=0,W=0;W<O;++W)I&1<<W&&(z[U++]=B[W]);var Q=T(u,z);if(!(Q<0))for(;f[Q++].push(P),!(Q>=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<y;++P)f[P]=[];for(var P=0,L=u.length;P<L;++P)for(var z=u[P],F=0,B=z.length;F<B;++F)f[z[F]].push(P);return f}t.dual=_;function w(u){for(var y=[],f=0,P=u.length;f<P;++f)for(var L=u[f],z=L.length|0,F=1,B=1<<z;F<B;++F){for(var O=[],I=0;I<z;++I)F>>>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<<y+1)-1,L=0;L<u.length;++L)for(var z=u[L],F=P;F<1<<z.length;F=i.nextCombination(F)){for(var B=new Array(y+1),O=0,I=0;I<z.length;++I)F&1<<I&&(B[O++]=z[I]);f.push(B)}return m(f)}t.skeleton=S;function E(u){for(var y=[],f=0,P=u.length;f<P;++f)for(var L=u[f],z=0,F=L.length;z<F;++z){for(var B=new Array(L.length-1),O=0,I=0;O<F;++O)O!==z&&(B[I++]=L[O]);y.push(B)}return m(y)}t.boundary=E;function g(u,y){for(var f=new a(y),P=0;P<u.length;++P)for(var L=u[P],z=0;z<L.length;++z)for(var F=z+1;F<L.length;++F)f.link(L[z],L[F]);for(var B=[],O=f.ranks,P=0;P<O.length;++P)O[P]=-1;for(var P=0;P<u.length;++P){var I=f.find(u[P][0]);O[I]<0?(O[I]=B.length,B.push([u[P].slice(0)])):B[O[I]].push(u[P].slice(0))}return B}function b(u){for(var y=d(m(S(u,0))),f=new a(y.length),P=0;P<u.length;++P)for(var L=u[P],z=0;z<L.length;++z)for(var F=T(y,[L[z]]),B=z+1;B<L.length;++B)f.link(F,T(y,[L[B]]));for(var O=[],I=f.ranks,P=0;P<I.length;++P)I[P]=-1;for(var P=0;P<u.length;++P){var N=f.find(T(y,[u[P][0]]));I[N]<0?(I[N]=O.length,O.push([u[P].slice(0)])):O[I[N]].push(u[P].slice(0))}return O}function p(u,y){return y?g(u,y):b(u)}t.connectedComponents=p},4623:function(e){"use strict";"use restrict";e.exports=t;function t(r){this.roots=new Array(r),this.ranks=new Array(r);for(var i=0;i<r;++i)this.roots[i]=i,this.ranks[i]=0}t.prototype.length=function(){return this.roots.length},t.prototype.makeSet=function(){var r=this.roots.length;return this.roots.push(r),this.ranks.push(0),r},t.prototype.find=function(r){for(var i=this.roots;i[r]!==r;){var a=i[r];i[r]=i[a],r=a}return r},t.prototype.link=function(r,i){var a=this.find(r),n=this.find(i);if(a!==n){var o=this.ranks,s=this.roots,c=o[a],h=o[n];c<h?s[a]=n:h<c?s[n]=a:(s[n]=a,++o[a])}}},5878:function(e,t,r){"use strict";e.exports=o;var i=r(3250),a=r(2014);function n(s,c,h){var m=Math.abs(i(s,c,h)),d=Math.sqrt(Math.pow(c[0]-h[0],2)+Math.pow(c[1]-h[1],2));return m/d}function o(s,c,h){for(var m=c.length,d=s.length,T=new Array(m),l=new Array(m),_=new Array(m),w=new Array(m),S=0;S<m;++S)T[S]=l[S]=-1,_[S]=1/0,w[S]=!1;for(var S=0;S<d;++S){var E=s[S];if(E.length!==2)throw new Error("Input must be a graph");var g=E[1],b=E[0];l[b]!==-1?l[b]=-2:l[b]=g,T[g]!==-1?T[g]=-2:T[g]=b}function p(H){if(w[H])return 1/0;var $=T[H],J=l[H];return $<0||J<0?1/0:n(c[H],c[$],c[J])}function u(H,$){var J=O[H],X=O[$];O[H]=X,O[$]=J,I[J]=$,I[X]=H}function y(H){return _[O[H]]}function f(H){return H&1?H-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(X<U){var j=y(X);j<J&&(ne=X,J=j)}if(oe<U){var ee=y(oe);ee<J&&(ne=oe)}if(ne===H)return H;u(H,ne),H=ne}}function L(H){for(var $=y(H);H>0;){var J=f(H);if(J>=0){var X=y(J);if($<X){u(H,J),H=J;continue}}return H}}function z(){if(U>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<m;++S){var N=_[S]=p(S);N<1/0?(I[S]=O.length,O.push(S)):I[S]=-1}for(var U=O.length,S=U>>1;S>=0;--S)P(S);for(;;){var W=z();if(W<0||_[W]>h)break;B(W)}for(var Q=[],S=0;S<m;++S)w[S]||(I[S]=Q.length,Q.push(c[S].slice()));var ue=Q.length;function se(H,$){if(H[$]<0)return $;var J=$,X=$;do{var oe=H[X];if(!w[X]||oe<0||oe===X||(X=oe,oe=H[X],!w[X]||oe<0||oe===X))break;X=oe,J=H[J]}while(J!==X);for(var ne=$;ne!==X;ne=H[ne])H[ne]=X;return X}var he=[];return s.forEach(function(H){var $=se(T,H[0]),J=se(l,H[1]);if($>=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[0],h=s[1];else 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 d<T?d-T:m>l?m-l:d-l}var _,w;o[0][1]<o[1][1]?(_=o[0],w=o[1]):(_=o[1],w=o[0]);var S=i(h,c,_);return S||(S=i(h,c,w),S)?S:w-h}function n(o,s){var c,h;if(s[0][0]<s[1][0])c=s[0],h=s[1];else if(s[0][0]>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[0],d=o[1];else 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]<E[1][0]?(g=E[0],b=E[1]):(g=E[1],b=E[0]);var p=n(g,b,w);if(p<0)_=_.left;else if(p>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){var f=u[y];if(_[1]===f.y){if(f.closed)return f.index;for(;y<u.length-1&&u[y+1].y===_[1];)if(y=y+1,f=u[y],f.closed)return f.index;if(f.y===_[1]&&!f.start){if(y=y+1,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;g<w;++g){var b=_[g],p=b[0][0]<b[1][0];E[2*g]=new T(b[0][0],b,p,g),E[2*g+1]=new T(b[1][0],b,!p,g)}E.sort(function(O,I){var N=O.x-I.x;return N||(N=O.create-I.create,N)?N:Math.min(O.segment[0][1],O.segment[1][1])-Math.min(I.segment[0][1],I.segment[1][1])});for(var u=a(o),y=[],f=[],P=[],L=-1/0,g=0;g<S;){for(var z=E[g].x,F=[];g<S;){var B=E[g];if(B.x!==z)break;g+=1,B.segment[0][0]===B.x&&B.segment[1][0]===B.x?B.create&&(B.segment[0][1]<B.segment[1][1]?(F.push(new d(B.segment[0][1],B.index,!0,!0)),F.push(new d(B.segment[1][1],B.index,!1,!1))):(F.push(new d(B.segment[1][1],B.index,!0,!1)),F.push(new d(B.segment[0][1],B.index,!1,!0)))):B.create?u=u.insert(B.segment,B.index):u=u.remove(B.segment)}y.push(u.root),f.push(z),P.push(F)}return new s(y,f,P)}},5202:function(e,t,r){"use strict";var i=r(1944),a=r(8210);e.exports=s,e.exports.positive=c,e.exports.negative=h;function n(m,d){var T=a(i(m,d),[d[d.length-1]]);return T[T.length-1]}function o(m,d,T,l){var _=l-d,w=-d/_;w<0?w=0:w>1&&(w=1);for(var S=1-w,E=m.length,g=new Array(E),b=0;b<E;++b)g[b]=w*m[b]+S*T[b];return g}function s(m,d){for(var T=[],l=[],_=n(m[m.length-1],d),w=m[m.length-1],S=m[0],E=0;E<m.length;++E,w=S){S=m[E];var g=n(S,d);if(_<0&&g>0||_>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;S<m.length;++S,_=w){w=m[S];var E=n(w,d);(l<0&&E>0||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;S<m.length;++S,_=w){w=m[S];var E=n(w,d);(l<0&&E>0||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<l;S++)if(typeof m[S]=="string")w+=m[S];else if(typeof m[S]=="object"){if(g=m[S],g.keys)for(_=d[T],E=0;E<g.keys.length;E++){if(_==null)throw new Error(n('[sprintf] Cannot access property "%s" of undefined value "%s"',g.keys[E],g.keys[E-1]));_=_[g.keys[E]]}else g.param_no?_=d[g.param_no]:_=d[T++];if(a.not_type.test(g.type)&&a.not_primitive.test(g.type)&&_ instanceof Function&&(_=_()),a.numeric_arg.test(g.type)&&typeof _!="number"&&isNaN(_))throw new TypeError(n("[sprintf] expecting number but found %T",_));switch(a.number.test(g.type)&&(y=_>=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;S<l;++S)_[S]=[T[S]],w[S]=[S];return{positions:_,cells:w}}var c={};function h(m,_){if(m.dimension<=0)return{positions:[],cells:[]};if(m.dimension===1)return s(m,_);var T=m.order.join()+"-"+m.dtype,l=c[T],_=+_||0;return l||(l=c[T]=o(m.order,m.dtype)),l(m,_)}},665:function(e,t,r){"use strict";var i=r(3202);e.exports=s;var a=96;function n(c,h){var m=i(getComputedStyle(c).getPropertyValue(h));return m[0]*s(m[1],c)}function o(c,h){var m=document.createElement("div");m.style["font-size"]="128"+c,h.appendChild(m);var d=n(m,"font-size")/128;return h.removeChild(m),d}function s(c,h){switch(h=h||document.body,c=(c||"px").trim().toLowerCase(),(h===window||h===document)&&(h=document.body),c){case"%":return h.clientHeight/100;case"ch":case"ex":return o(c,h);case"em":return n(h,"font-size");case"rem":return n(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 a;case"cm":return a/2.54;case"mm":return a/25.4;case"pt":return a/72;case"pc":return a/6}return 1}},7261:function(e,t,r){"use strict";e.exports=w;var i=r(9215),a=r(7608),n=r(6079),o=r(5911),s=r(3536),c=r(244);function h(S,E,g){return Math.sqrt(Math.pow(S,2)+Math.pow(E,2)+Math.pow(g,2))}function m(S){return Math.min(1,Math.max(-1,S))}function d(S){var E=Math.abs(S[0]),g=Math.abs(S[1]),b=Math.abs(S[2]),p=[0,0,0];E>Math.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);re<ce&&(j+=2*Math.PI),be<ce&&(j-=2*Math.PI),this.angle.jump(this.angle.lastT(),j,ee),this.angle.set(S,oe,X)}}}};function w(S){S=S||{};var E=S.center||[0,0,0],g=S.up||[0,1,0],b=S.right||d(g),p=S.radius||1,u=S.theta||0,y=S.phi||0;if(E=[].slice.call(E,0,3),g=[].slice.call(g,0,3),s(g,g),b=[].slice.call(b,0,3),s(b,b),"eye"in S){var f=S.eye,P=[f[0]-E[0],f[1]-E[1],f[2]-E[2]];o(b,P,g),h(b[0],b[1],b[2])<1e-6?b=d(g):s(b,b),p=h(P[0],P[1],P[2]);var L=c(g,P)/p,z=c(b,P)/p;y=Math.acos(L),u=Math.acos(z)}return p=Math.log(p),new T(S.zoomMin,S.zoomMax,E,g,b,p,u,y)}},5250:function(e){"use strict";e.exports=r;var t=+(Math.pow(2,27)+1);function r(i,a,n){var o=i*a,s=t*i,c=s-i,h=s-c,m=i-h,d=t*a,T=d-a,l=d-T,_=a-l,w=o-h*l,S=w-m*l,E=S-h*_,g=m*_-E;return n?(n[0]=g,n[1]=o,n):[g,o]}},9362:function(e){"use strict";e.exports=t;function t(r,i,a){var n=r+i,o=n-r,s=n-o,c=i-o,h=r-s;return a?(a[0]=h+c,a[1]=n,a):[h+c,n]}},1888:function(e,t,r){"use strict";var i=r(8828),a=r(1338),n=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:a([32,0]),UINT16:a([32,0]),UINT32:a([32,0]),BIGUINT64:a([32,0]),INT8:a([32,0]),INT16:a([32,0]),INT32:a([32,0]),BIGINT64:a([32,0]),FLOAT:a([32,0]),DOUBLE:a([32,0]),DATA:a([32,0]),UINT8C:a([32,0]),BUFFER:a([32,0])});var o=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",c=typeof BigInt64Array<"u",h=r.g.__TYPEDARRAY_POOL;h.UINT8C||(h.UINT8C=a([32,0])),h.BIGUINT64||(h.BIGUINT64=a([32,0])),h.BIGINT64||(h.BIGINT64=a([32,0])),h.BUFFER||(h.BUFFER=a([32,0]));var m=h.DATA,d=h.BUFFER;t.free=function(O){if(n.isBuffer(O))d[i.log2(O.length)].push(O);else{if(Object.prototype.toString.call(O)!=="[object ArrayBuffer]"&&(O=O.buffer),!O)return;var I=O.length||O.byteLength,N=i.log2(I)|0;m[N].push(O)}};function T(B){if(B){var O=B.length||B.byteLength,I=i.log2(O);m[I].push(B)}}function l(B){T(B.buffer)}t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=l,t.freeArrayBuffer=T,t.freeBuffer=function(O){d[i.log2(O.length)].push(O)},t.malloc=function(O,I){if(I===void 0||I==="arraybuffer")return _(O);switch(I){case"uint8":return w(O);case"uint16":return S(O);case"uint32":return E(O);case"int8":return g(O);case"int16":return b(O);case"int32":return p(O);case"float":case"float32":return u(O);case"double":case"float64":return y(O);case"uint8_clamped":return f(O);case"bigint64":return L(O);case"biguint64":return P(O);case"buffer":return F(O);case"data":case"dataview":return z(O);default:return null}return null};function _(O){var O=i.nextPow2(O),I=i.log2(O),N=m[I];return N.length>0?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<i;++a)this.roots[a]=a,this.ranks[a]=0}var r=t.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var i=this.roots.length;return this.roots.push(i),this.ranks.push(0),i},r.find=function(i){for(var a=i,n=this.roots;n[i]!==i;)i=n[i];for(;n[a]!==i;){var o=n[a];n[a]=i,a=o}return i},r.link=function(i,a){var n=this.find(i),o=this.find(a);if(n!==o){var s=this.ranks,c=this.roots,h=s[n],m=s[o];h<m?c[n]=o:m<h?c[o]=n:(c[o]=n,++s[n])}}},1682:function(e){"use strict";function t(a,n){for(var o=1,s=a.length,c=a[0],h=a[0],m=1;m<s;++m)if(h=c,c=a[m],n(c,h)){if(m===o){o++;continue}a[o++]=c}return a.length=o,a}function r(a){for(var n=1,o=a.length,s=a[0],c=a[0],h=1;h<o;++h,c=s)if(c=s,s=a[h],s!==c){if(h===n){n++;continue}a[n++]=s}return a.length=n,a}function i(a,n,o){return a.length===0?a:n?(o||a.sort(n),t(a,n)):(o||a.sort(),r(a))}e.exports=i},4359:function(e,t,r){"use strict";e.exports=o;var i=r(7718),a=null,n=null;typeof document<"u"&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,n=a.getContext("2d"));function o(s,c){return(typeof c!="object"||c===null)&&(c={}),i(s,c.canvas||a,c.context||n,c)}},7718:function(e,t,r){e.exports=L,e.exports.processPixels=P;var i=r(3711),a=r(9618),n=r(5878),o=r(332),s=r(2538),c=r(2095),h="b",m="b|",d="i",T="i|",l="sup",_="+",w="+1",S="sub",E="-",g="-1";function b(z,F,B,O){for(var I="<"+z+">",N="</"+z+">",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+W;++he)if(he<ue+U||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<W;++Q)for(var ue=z[Q],se=0;se<2;++se)N[se]=Math.min(N[se],ue[se])|0,U[se]=Math.max(U[se],ue[se])|0;var he=0;switch(O){case"center":he=-.5*(N[0]+U[0]);break;case"right":case"end":he=-U[0];break;case"left":case"start":he=-N[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+O+"'")}var H=0;switch(I){case"hanging":case"top":H=-N[1];break;case"middle":H=-.5*(N[1]+U[1]);break;case"alphabetic":case"ideographic":H=-3*B;break;case"bottom":H=-U[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+I+"'")}var $=1/B;return"lineHeight"in F?$*=+F.lineHeight:"width"in F?$=F.width/(U[0]-N[0]):"height"in F&&($=F.height/(U[1]-N[1])),z.map(function(J){return[$*(J[0]+he),$*(J[1]+H)]})}function u(z,F,B,O,I,N){B=B.replace(/\n/g,""),N.breaklines===!0?B=B.replace(/\<br\>/g,`
|
||
`):B=B.replace(/\<br\>/g," ");var U="",W=[];for(j=0;j<B.length;++j)W[j]=U;N.bolds===!0&&(W=b(h,m,B,W)),N.italics===!0&&(W=b(d,T,B,W)),N.superscripts===!0&&(W=b(l,w,B,W)),N.subscripts===!0&&(W=b(S,g,B,W));var Q=[],ue="";for(j=0;j<B.length;++j)W[j]!==null&&(ue+=B[j],Q.push(W[j]));var se=ue.split(`
|
||
`),he=se.length,H=Math.round(I*O),$=O,J=O*2,X=0,oe=he*H+J;z.height<oe&&(z.height=oe),F.fillStyle="#000",F.fillRect(0,0,z.width,z.height),F.fillStyle="#fff";var ne,j,ee,re,ce,be=0,Ae="";function ze(){if(Ae!==""){var fe=F.measureText(Ae).width;F.fillText(Ae,$+ee,J+re),ee+=fe}}function Re(){return""+Math.round(ce)+"px "}function We(fe,Fe){var rt=""+F.font;if(N.subscripts===!0){var st=fe.indexOf(E),Qe=Fe.indexOf(E),Lt=st>-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;ne<he;++ne){var it=se[ne]+`
|
||
`;for(ee=0,re=ne*H,ce=O,Ae="",j=0;j<it.length;++j){var ot=j+be<Q.length?Q[j+be]:Q[Q.length-1];U===ot?Ae+=it[j]:(ze(),Ae=it[j],ot!==void 0&&(We(U,ot),U=ot))}ze(),be+=it.length;var tt=Math.round(ee+2*$)|0;X<tt&&(X=tt)}var ut=X,Me=J+H*he,_e=a(F.getImageData(0,0,ut,Me).data,[Me,ut,4]);return _e.pick(-1,-1,0).transpose(1,0)}function y(z,F){var B=i(z,128);return F?n(B.cells,B.positions,.25):{edges:B.cells,positions:B.positions}}function f(z,F,B,O){var I=y(z,O),N=p(I.positions,F,B),U=I.edges,W=F.orientation==="ccw";if(o(N,U),F.polygons||F.polygon||F.polyline){for(var Q=c(U,N),ue=new Array(Q.length),se=0;se<Q.length;++se){for(var he=Q[se],H=new Array(he.length),$=0;$<he.length;++$){for(var J=he[$],X=new Array(J.length),oe=0;oe<J.length;++oe)X[oe]=N[J[oe]].slice();W&&X.reverse(),H[$]=X}ue[se]=H}return ue}else return F.triangles||F.triangulate||F.triangle?{cells:s(N,U,{delaunay:!1,exterior:!1,interior:!0}),positions:N}:{edges:U,positions:N}}function P(z,F,B){try{return f(z,F,B,!0)}catch{}try{return f(z,F,B,!1)}catch{}return F.polygons||F.polyline||F.polygon?[]:F.triangles||F.triangulate||F.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function L(z,F,B,O){var I=64,N=1.25,U={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};O&&(O.size&&O.size>0&&(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<l;++E){{var b=c[m]-T,p=c[m+S]-T;b>=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 A<M?x<A?A:x>M?M:x:x<M?M:x>A?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;y<d;y++)p=g(T,y),u=b(m,y),S[y]=a(p,u);else S=a(A(T),m);return S}function c(h){var m=M.extractOpts(h),d=m.colorscale;return m.reversescale&&(d=M.flipScale(m.colorscale)),d.map(function(T){var l=T[0],_=x(T[1]),w=_.toRgb();return{index:l,rgb:[w.r,w.g,w.b,w.a]}})}q.exports={formatColor:s,parseColorScale:c}}}),x5=Ze({"src/constants/gl3d_dashes.js"(Z,q){"use strict";q.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}}),eT=Ze({"src/constants/gl3d_markers.js"(Z,q){"use strict";q.exports={circle:"\u25CF","circle-open":"\u25CB",square:"\u25A0","square-open":"\u25A1",diamond:"\u25C6","diamond-open":"\u25C7",cross:"+",x:"\u274C"}}}),WN=Ze({"src/traces/scatter3d/calc_errors.js"(Z,q){"use strict";var v=oo();function x(e,t,r,i){if(!t||!t.visible)return null;for(var a=v.getComponentMethod("errorbars","makeComputeError")(t),n=new Array(e.length),o=0;o<e.length;o++){var s=a(+e[o],o);if(i.type==="log"){var c=i.c2l(e[o]),h=e[o]-s[0],m=e[o]+s[1];if(n[o]=[(i.c2l(h,!0)-c)*r,(i.c2l(m,!0)-c)*r],h>0){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<e.length;t++)if(e[t])return e[t].length;return 0}function M(e,t,r){var i=[x(e.x,e.error_x,t[0],r.xaxis),x(e.y,e.error_y,t[1],r.yaxis),x(e.z,e.error_z,t[2],r.zaxis)],a=A(i);if(a===0)return null;for(var n=new Array(a),o=0;o<a;o++){for(var s=[[0,0,0],[0,0,0]],c=0;c<3;c++)if(i[c])for(var h=0;h<2;h++)s[h][c]=i[c][o][h];n[o]=s}return n}q.exports=M}}),XN=Ze({"src/traces/scatter3d/convert.js"(Z,q){"use strict";var v=Yh().gl_line3d,x=Yh().gl_scatter3d,A=Yh().gl_error3d,M=Yh().gl_mesh3d,e=Yh().delaunay_triangulate,t=ca(),r=Qv(),i=em().formatColor,a=r1(),n=x5(),o=eT(),s=Wo(),c=Qp().appendArrayPointValue,h=WN();function m(P,L){this.scene=P,this.uid=L,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var d=m.prototype;d.handlePick=function(P){if(P.object&&(P.object===this.linePlot||P.object===this.delaunayMesh||P.object===this.textMarkers||P.object===this.scatterPlot)){var L=P.index=P.data.index;return P.object.highlight&&P.object.highlight(null),this.scatterPlot&&(P.object=this.scatterPlot,this.scatterPlot.highlight(P.data)),P.textLabel="",this.textLabels&&(t.isArrayOrTypedArray(this.textLabels)?(this.textLabels[L]||this.textLabels[L]===0)&&(P.textLabel=this.textLabels[L]):P.textLabel=this.textLabels),P.traceCoordinate=[this.data.x[L],this.data.y[L],this.data.z[L]],!0}};function T(P,L,z){var F=(z+1)%3,B=(z+2)%3,O=[],I=[],N;for(N=0;N<P.length;++N){var U=P[N];isNaN(U[F])||!isFinite(U[F])||isNaN(U[B])||!isFinite(U[B])||(O.push([U[F],U[B]]),I.push(N))}var W=e(O);for(N=0;N<W.length;++N)for(var Q=W[N],ue=0;ue<Q.length;++ue)Q[ue]=I[Q[ue]];return{positions:P,cells:W,meshColor:L}}function l(P){for(var L=[0,0,0],z=[[0,0,0],[0,0,0],[0,0,0]],F=[1,1,1],B=0;B<3;B++){var O=P[B];O&&O.copy_zstyle!==!1&&P[2].visible!==!1&&(O=P[2]),!(!O||!O.visible)&&(L[B]=O.width/2,z[B]=r(O.color),F[B]=O.thickness)}return{capSize:L,color:z,lineWidth:F}}function _(P){return P==null?0:P.indexOf("left")>-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<P.length;B++)F[B]=[L,z],P[B]&&(F[B][0]=_(P[B]),F[B][1]=w(P[B]));else F[0]=_(P),F[1]=w(P);return F}function E(P,L){return L(P*4)}function g(P){return o[P]}function b(P,L,z,F,B){var O=null;if(t.isArrayOrTypedArray(P)){O=[];for(var I=0;I<L;I++)P[I]===void 0?O[I]=F:O[I]=z(P[I],B)}else O=z(P,t.identity);return O}function p(P,L){var z=[],F=P.fullSceneLayout,B=P.dataScale,O=F.xaxis,I=F.yaxis,N=F.zaxis,U=L.marker,W=L.line,Q=L.x||[],ue=L.y||[],se=L.z||[],he=Q.length,H=L.xcalendar,$=L.ycalendar,J=L.zcalendar,X,oe,ne,j,ee,re;for(ee=0;ee<he;ee++)X=O.d2l(Q[ee],0,H)*B[0],oe=I.d2l(ue[ee],0,$)*B[1],ne=N.d2l(se[ee],0,J)*B[2],z[ee]=[X,oe,ne];if(Array.isArray(L.text))re=L.text;else if(t.isTypedArray(L.text))re=Array.from(L.text);else if(L.text!==void 0)for(re=new Array(he),ee=0;ee<he;ee++)re[ee]=L.text;function ce(st,Qe){var Lt=F[st];return s.tickText(Lt,Lt.d2l(Qe),!0).text}var be=L.texttemplate;if(be){var Ae=P.fullLayout,ze=Ae._d3locale,Re=Array.isArray(be),We=Re?Math.min(be.length,he):he,it=Re?function(st){return be[st]}:function(){return be};for(re=new Array(We),ee=0;ee<We;ee++){var ot={x:Q[ee],y:ue[ee],z:se[ee]},tt={xLabel:ce("xaxis",Q[ee]),yLabel:ce("yaxis",ue[ee]),zLabel:ce("zaxis",se[ee])},ut={};c(ut,L,ee);var Me=L._meta||{};re[ee]=t.texttemplateString(it(ee),tt,ze,ut,ot,Me)}}if(j={position:z,mode:L.mode,text:re},"line"in L&&(j.lineColor=i(W,1,he),j.lineWidth=W.width,j.lineDashes=W.dash),"marker"in L){var _e=a(L);j.scatterColor=i(U,1,he),j.scatterSize=b(U.size,he,E,20,_e),j.scatterMarker=b(U.symbol,he,g,"\u25CF"),j.scatterLineWidth=U.line.width,j.scatterLineColor=i(U.line,1,he),j.scatterAngle=0}"textposition"in L&&(j.textOffset=S(L.textposition),j.textColor=i(L.textfont,1,he),j.textSize=b(L.textfont.size,he,t.identity,12),j.textFontFamily=L.textfont.family,j.textFontWeight=L.textfont.weight,j.textFontStyle=L.textfont.style,j.textFontVariant=L.textfont.variant,j.textAngle=0);var fe=["x","y","z"];for(j.project=[!1,!1,!1],j.projectScale=[1,1,1],j.projectOpacity=[1,1,1],ee=0;ee<3;++ee){var Fe=L.projection[fe[ee]];(j.project[ee]=Fe.show)&&(j.projectOpacity[ee]=Fe.opacity,j.projectScale[ee]=Fe.scale)}j.errorBounds=h(L,B,F);var rt=l([L.error_x,L.error_y,L.error_z]);return j.errorColor=rt.color,j.errorLineWidth=rt.lineWidth,j.errorCapSize=rt.capSize,j.delaunayAxis=L.surfaceaxis,j.delaunayColor=r(L.surfacecolor),j}function u(P){if(t.isArrayOrTypedArray(P)){var L=P[0];return t.isArrayOrTypedArray(L)&&(P=L),"rgb("+P.slice(0,3).map(function(z){return Math.round(z*255)})+")"}return null}function y(P){return t.isArrayOrTypedArray(P)?P.length===4&&typeof P[0]=="number"?u(P):P.map(u):null}d.update=function(P){var L=this.scene.glplot.gl,z,F,B,O,I=n.solid;this.data=P;var N=p(this.scene,P);"mode"in N&&(this.mode=N.mode),"lineDashes"in N&&N.lineDashes in n&&(I=n[N.lineDashes]),this.color=y(N.scatterColor)||y(N.lineColor),this.dataPoints=N.position,z={gl:this.scene.glplot.gl,position:N.position,color:N.lineColor,lineWidth:N.lineWidth||1,dashes:I[0],dashScale:I[1],opacity:P.opacity,connectGaps:P.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(z):(this.linePlot=v(z),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var U=P.opacity;if(P.marker&&P.marker.opacity!==void 0&&(U*=P.marker.opacity),F={gl:this.scene.glplot.gl,position:N.position,color:N.scatterColor,size:N.scatterSize,glyph:N.scatterMarker,opacity:U,orthographic:!0,lineWidth:N.scatterLineWidth,lineColor:N.scatterLineColor,project:N.project,projectScale:N.projectScale,projectOpacity:N.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(F):(this.scatterPlot=x(F),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),O={gl:this.scene.glplot.gl,position:N.position,glyph:N.text,color:N.textColor,size:N.textSize,angle:N.textAngle,alignment:N.textOffset,font:N.textFontFamily,fontWeight:N.textFontWeight,fontStyle:N.textFontStyle,fontVariant:N.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:P.opacity},this.textLabels=P.hovertext||P.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(O):(this.textMarkers=x(O),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),B={gl:this.scene.glplot.gl,position:N.position,color:N.errorColor,error:N.errorBounds,lineWidth:N.errorLineWidth,capSize:N.errorCapSize,opacity:P.opacity},this.errorBars?N.errorBounds?this.errorBars.update(B):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):N.errorBounds&&(this.errorBars=A(B),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),N.delaunayAxis>=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<r.length;i++)if(t=M.getContext(r[i],e),t)return t}catch{t=null}return t||null}}}),JN=Ze({"node_modules/webgl-context/index.js"(Z,q){var v=KN();q.exports=function(A){return v("webgl",A)}}}),w5=Ze({"src/lib/show_no_webgl_msg.js"(Z,q){"use strict";var v=Yi(),x=function(){};q.exports=function(M){for(var e in M)typeof M[e]=="function"&&(M[e]=x);M.destroy=function(){M.container.parentNode.removeChild(M.container)};var t=document.createElement("div");t.className="no-webgl",t.style.cursor="pointer",t.style.fontSize="24px",t.style.color=v.defaults[0],t.style.position="absolute",t.style.left=t.style.top="0px",t.style.width=t.style.height="100%",t.style["background-color"]=v.lightLine,t.style["z-index"]=30;var r=document.createElement("p");return r.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",r.style.position="relative",r.style.top="50%",r.style.left="50%",r.style.height="30%",r.style.width="50%",r.style.margin="-15% 0 0 -25%",t.appendChild(r),M.container.appendChild(t),M.container.style.background="#FFFFFF",M.container.onclick=function(){window.open("https://get.webgl.org")},!1}}}),$N=Ze({"src/plots/gl3d/layout/convert.js"(Z,q){"use strict";var v=Qv(),x=ca(),A=["xaxis","yaxis","zaxis"];function M(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],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=[10,10,10],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=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var e=M.prototype;e.merge=function(r,i){for(var a=this,n=0;n<3;++n){var o=i[A[n]];if(!o.visible){a.tickEnable[n]=!1,a.labelEnable[n]=!1,a.lineEnable[n]=!1,a.lineTickEnable[n]=!1,a.gridEnable[n]=!1,a.zeroEnable[n]=!1,a.backgroundEnable[n]=!1;continue}a.labels[n]=r._meta?x.templateString(o.title.text,r._meta):o.title.text,"font"in o.title&&(o.title.font.color&&(a.labelColor[n]=v(o.title.font.color)),o.title.font.family&&(a.labelFont[n]=o.title.font.family),o.title.font.size&&(a.labelSize[n]=o.title.font.size),o.title.font.weight&&(a.labelFontWeight[n]=o.title.font.weight),o.title.font.style&&(a.labelFontStyle[n]=o.title.font.style),o.title.font.variant&&(a.labelFontVariant[n]=o.title.font.variant)),"showline"in o&&(a.lineEnable[n]=o.showline),"linecolor"in o&&(a.lineColor[n]=v(o.linecolor)),"linewidth"in o&&(a.lineWidth[n]=o.linewidth),"showgrid"in o&&(a.gridEnable[n]=o.showgrid),"gridcolor"in o&&(a.gridColor[n]=v(o.gridcolor)),"gridwidth"in o&&(a.gridWidth[n]=o.gridwidth),o.type==="log"?a.zeroEnable[n]=!1:"zeroline"in o&&(a.zeroEnable[n]=o.zeroline),"zerolinecolor"in o&&(a.zeroLineColor[n]=v(o.zerolinecolor)),"zerolinewidth"in o&&(a.zeroLineWidth[n]=o.zerolinewidth),"ticks"in o&&o.ticks?a.lineTickEnable[n]=!0:a.lineTickEnable[n]=!1,"ticklen"in o&&(a.lineTickLength[n]=a._defaultLineTickLength[n]=o.ticklen),"tickcolor"in o&&(a.lineTickColor[n]=v(o.tickcolor)),"tickwidth"in o&&(a.lineTickWidth[n]=o.tickwidth),"tickangle"in o&&(a.tickAngle[n]=o.tickangle==="auto"?-3600:Math.PI*-o.tickangle/180),"showticklabels"in o&&(a.tickEnable[n]=o.showticklabels),"tickfont"in o&&(o.tickfont.color&&(a.tickColor[n]=v(o.tickfont.color)),o.tickfont.family&&(a.tickFont[n]=o.tickfont.family),o.tickfont.size&&(a.tickSize[n]=o.tickfont.size),o.tickfont.weight&&(a.tickFontWeight[n]=o.tickfont.weight),o.tickfont.style&&(a.tickFontStyle[n]=o.tickfont.style),o.tickfont.variant&&(a.tickFontVariant[n]=o.tickfont.variant)),"mirror"in o?["ticks","all","allticks"].indexOf(o.mirror)!==-1?(a.lineTickMirror[n]=!0,a.lineMirror[n]=!0):o.mirror===!0?(a.lineTickMirror[n]=!1,a.lineMirror[n]=!0):(a.lineTickMirror[n]=!1,a.lineMirror[n]=!1):a.lineMirror[n]=!1,"showbackground"in o&&o.showbackground!==!1?(a.backgroundEnable[n]=!0,a.backgroundColor[n]=v(o.backgroundcolor)):a.backgroundEnable[n]=!1}};function t(r,i){var a=new M;return a.merge(r,i),a}q.exports=t}}),QN=Ze({"src/plots/gl3d/layout/spikes.js"(Z,q){"use strict";var v=Qv(),x=["xaxis","yaxis","zaxis"];function A(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var M=A.prototype;M.merge=function(t){for(var r=0;r<3;++r){var i=t[x[r]];if(!i.visible){this.enabled[r]=!1,this.drawSides[r]=!1;continue}this.enabled[r]=i.showspikes,this.colors[r]=v(i.spikecolor),this.drawSides[r]=i.spikesides,this.lineWidth[r]=i.spikethickness}};function e(t){var r=new A;return r.merge(t),r}q.exports=e}}),eU=Ze({"src/plots/gl3d/layout/tick_marks.js"(Z,q){"use strict";q.exports=t;var v=Wo(),x=ca(),A=["xaxis","yaxis","zaxis"],M=[0,0,0];function e(r){for(var i=new Array(3),a=0;a<3;++a){for(var n=r[a],o=new Array(n.length),s=0;s<n.length;++s)o[s]=n[s].x;i[a]=o}return i}function t(r){for(var i=r.axesOptions,a=r.glplot.axesPixels,n=r.fullSceneLayout,o=[[],[],[]],s=0;s<3;++s){var c=n[A[s]];if(c._length=(a[s].hi-a[s].lo)*a[s].pixelsPerDataUnit/r.dataScale[s],Math.abs(c._length)===1/0||isNaN(c._length))o[s]=[];else{c._input_range=c.range.slice(),c.range[0]=a[s].lo/r.dataScale[s],c.range[1]=a[s].hi/r.dataScale[s],c._m=1/(r.dataScale[s]*a[s].pixelsPerDataUnit),c.range[0]===c.range[1]&&(c.range[0]-=1,c.range[1]+=1);var h=c.tickmode;if(c.tickmode==="auto"){c.tickmode="linear";var m=c.nticks||x.constrain(c._length/40,4,9);v.autoTicks(c,Math.abs(c.range[1]-c.range[0])/m)}for(var d=v.calcTicks(c,{msUTC:!0}),T=0;T<d.length;++T)d[T].x=d[T].x*r.dataScale[s],c.type==="date"&&(d[T].text=d[T].text.replace(/\<br\>/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<ue.length;++H)B=z.traces[ue[H]],B.data.hoverinfo!=="skip"&&B.handlePick(he)&&(se=B),B.setContourLevels&&B.setContourLevels();function $(We,it,ot){var tt=z.fullSceneLayout[We+"axis"];return tt.type!=="log"&&(it=tt.d2l(it)),a.hoverLabelText(tt,it,ot)}if(se!==null){var J=c(z.glplot.cameraParams,he.dataCoordinate);B=se.data;var X=F._fullData[B.index],oe=he.index,ne={xLabel:$("x",he.traceCoordinate[0],B.xhoverformat),yLabel:$("y",he.traceCoordinate[1],B.yhoverformat),zLabel:$("z",he.traceCoordinate[2],B.zhoverformat)},j=n.castHoverinfo(X,z.fullLayout,oe),ee=(j||"").split("+"),re=j&&j==="all";!X.hovertemplate&&!re&&(ee.indexOf("x")===-1&&(ne.xLabel=void 0),ee.indexOf("y")===-1&&(ne.yLabel=void 0),ee.indexOf("z")===-1&&(ne.zLabel=void 0),ee.indexOf("text")===-1&&(he.textLabel=void 0),ee.indexOf("name")===-1&&(se.name=void 0));var ce,be=[];B.type==="cone"||B.type==="streamtube"?(ne.uLabel=$("x",he.traceCoordinate[3],B.uhoverformat),(re||ee.indexOf("u")!==-1)&&be.push("u: "+ne.uLabel),ne.vLabel=$("y",he.traceCoordinate[4],B.vhoverformat),(re||ee.indexOf("v")!==-1)&&be.push("v: "+ne.vLabel),ne.wLabel=$("z",he.traceCoordinate[5],B.whoverformat),(re||ee.indexOf("w")!==-1)&&be.push("w: "+ne.wLabel),ne.normLabel=he.traceCoordinate[6].toPrecision(3),(re||ee.indexOf("norm")!==-1)&&be.push("norm: "+ne.normLabel),B.type==="streamtube"&&(ne.divergenceLabel=he.traceCoordinate[7].toPrecision(3),(re||ee.indexOf("divergence")!==-1)&&be.push("divergence: "+ne.divergenceLabel)),he.textLabel&&be.push(he.textLabel),ce=be.join("<br>")):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("<br>")):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;$<Q[H].length;++$)he=W.d2l(Q[H][$],0,ue),!isNaN(he)&&isFinite(he)&&(B[0][I]=Math.min(B[0][I],he),B[1][I]=Math.max(B[1][I],he));else he=W.d2l(Q[H],0,ue),!isNaN(he)&&isFinite(he)&&(B[0][I]=Math.min(B[0][I],he),B[1][I]=Math.max(B[1][I],he))}}function u(z,F){for(var B=z.fullSceneLayout,O=B.annotations||[],I=0;I<3;I++)for(var N=b[I],U=N.charAt(0),W=B[N],Q=0;Q<O.length;Q++){var ue=O[Q];if(ue.visible){var se=W.r2l(ue[U]);!isNaN(se)&&isFinite(se)&&(F[0][I]=Math.min(F[0][I],se),F[1][I]=Math.max(F[1][I],se))}}}E.plot=function(z,F,B){var O=this;if(O.plotArgs=[z,F,B],!O.glplot.contextLost){var I,N,U,W,Q,ue,se=F[O.id],he=B[O.id];O.fullLayout=F,O.fullSceneLayout=se,O.axesOptions.merge(F,se),O.spikeOptions.merge(se),O.setViewport(se),O.updateFx(se.dragmode,se.hovermode),O.camera.enableWheel=O.graphDiv._context._scrollZoom.gl3d,O.glplot.setClearColor(o(se.bgcolor)),O.setConvert(Q),z?Array.isArray(z)||(z=[z]):z=[];var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(U=0;U<z.length;++U)I=z[U],!(I.visible!==!0||I._length===0)&&p(this,I,H);u(this,H);var $=[1,1,1];for(W=0;W<3;++W)H[1][W]===H[0][W]?$[W]=1:$[W]=1/(H[1][W]-H[0][W]);for(O.dataScale=$,O.convertAnnotations(this),U=0;U<z.length;++U)I=z[U],!(I.visible!==!0||I._length===0)&&(N=O.traces[I.uid],N?N.data.type===I.type?N.update(I):(N.dispose(),N=I._module.plot(this,I),O.traces[I.uid]=N):(N=I._module.plot(this,I),O.traces[I.uid]=N),N.name=I.name);var J=Object.keys(O.traces);e:for(U=0;U<J.length;++U){for(W=0;W<z.length;++W)if(z[W].uid===J[U]&&z[W].visible===!0&&z[W]._length!==0)continue e;N=O.traces[J[U]],N.dispose(),delete O.traces[J[U]]}O.glplot.objects.sort(function(Qe,Lt){return Qe._trace.data.index-Lt._trace.data.index});var X=[[0,0,0],[0,0,0]],oe=[],ne={};for(U=0;U<3;++U){Q=se[b[U]],ue=Q.type,ue in ne?(ne[ue].acc*=$[U],ne[ue].count+=1):ne[ue]={acc:$[U],count:1};var j;if(Q.autorange){X[0][U]=1/0,X[1][U]=-1/0;var ee=O.glplot.objects,re=O.fullSceneLayout.annotations||[],ce=Q._name.charAt(0);for(W=0;W<ee.length;W++){var be=ee[W],Ae=be.bounds,ze=be._trace.data._pad||0;be.constructor.name==="ErrorBars"&&Q._lowerLogErrorBound?X[0][U]=Math.min(X[0][U],Q._lowerLogErrorBound):X[0][U]=Math.min(X[0][U],Ae[0][U]/$[U]-ze),X[1][U]=Math.max(X[1][U],Ae[1][U]/$[U]+ze)}for(W=0;W<re.length;W++){var Re=re[W];if(Re.visible){var We=Q.r2l(Re[ce]);X[0][U]=Math.min(X[0][U],We),X[1][U]=Math.max(X[1][U],We)}}if("rangemode"in Q&&Q.rangemode==="tozero"&&(X[0][U]=Math.min(X[0][U],0),X[1][U]=Math.max(X[1][U],0)),X[0][U]>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;O<I;++O,--I)for(var N=0;N<F;++N)for(var U=0;U<4;++U){var W=4*(F*O+N)+U,Q=4*(F*I+N)+U,ue=z[W];z[W]=z[Q],z[Q]=ue}}function L(z,F,B){for(var O=0;O<B;++O)for(var I=0;I<F;++I){var N=4*(F*O+I),U=z[N+3];if(U>0)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;d<r.length;d++){var T=r[d];c=n[T]||{},h=A.newContainer(o,T),h._id=T[0]+s.scene,h._name=T,e(c,h,m,s),t(c,h,m,{font:s.font,letter:T[0],data:s.data,showGrid:!0,noAutotickangles:!0,noMinorloglabels:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,noUnifiedhovertitle:!0,bgColor:s.bgColor,calendar:s.calendar},s.fullLayout),m("gridcolor",v(h.color,s.bgColor,i).toRgbString()),m("title.text",T[0]),h.setScale=x.noop,m("showspikes")&&(m("spikesides"),m("spikethickness"),m("spikecolor",h.color)),m("showaxeslabels"),m("showbackground")&&m("backgroundcolor")}}}}),nU=Ze({"src/plots/gl3d/layout/defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=oo(),M=ng(),e=aU(),t=A5(),r=Hh().getSubplotData,i="gl3d";q.exports=function(o,s,c){var h=s._basePlotModules.length>1;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<d.length;T++)s("camera."+d[T]+".x"),s("camera."+d[T]+".y"),s("camera."+d[T]+".z");s("camera.projection.type");var l=!!s("aspectratio.x")&&!!s("aspectratio.y")&&!!s("aspectratio.z"),_=l?"manual":"auto",w=s("aspectmode",_);l||(n.aspectratio=o.aspectratio={x:1,y:1,z:1},w==="manual"&&(o.aspectmode="auto"),n.aspectmode=o.aspectmode);var S=r(c.fullData,i,c.id);e(n,o,{font:c.font,scene:c.id,data:S,bgColor:m,calendar:c.calendar,autotypenumbersDflt:c.autotypenumbersDflt,fullLayout:c.fullLayout}),A.getComponentMethod("annotations3d","handleDefaults")(n,o,c);var E=c.getDfltFromLayout("dragmode");if(E!==!1&&!E)if(E="orbit",n.camera&&n.camera.up){var g=n.camera.up.x,b=n.camera.up.y,p=n.camera.up.z;p!==0&&(!g||!b||!p||p/Math.sqrt(g*g+b*b+p*p)>.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;c<s.length;c++){var h=s[c],m=A(o,t,h),d=n[h],T=d.camera,l=d._scene;l||(l=new x({id:h,graphDiv:a,container:a.querySelector(".gl-container"),staticPlot:a._context.staticPlot,plotGlPixelRatio:a._context.plotGlPixelRatio,camera:T},n),d._scene=l),l.viewInitial||(l.viewInitial={up:{x:T.up.x,y:T.up.y,z:T.up.z},eye:{x:T.eye.x,y:T.eye.y,z:T.eye.z},center:{x:T.center.x,y:T.center.y,z:T.center.z}}),l.plot(m,n,a.layout)}},Z.clean=function(i,a,n,o){for(var s=o._subplots[t]||[],c=0;c<s.length;c++){var h=s[c];!a[h]&&o[h]._scene&&(o[h]._scene.destroy(),o._infolayer&&o._infolayer.selectAll(".annotation-"+h).remove())}},Z.toSVG=function(i){for(var a=i._fullLayout,n=a._subplots[t],o=a._size,s=0;s<n.length;s++){var c=a[n[s]],h=c.domain,m=c._scene,d=m.toImage("png"),T=a._glimages.append("svg:image");T.attr({xmlns:e.svg,"xlink:href":d,x:o.l+o.w*h.x[0],y:o.t+o.h*(1-h.y[1]),width:o.w*(h.x[1]-h.x[0]),height:o.h*(h.y[1]-h.y[0]),preserveAspectRatio:"none"}),m.destroy()}},Z.cleanId=function(a){if(a.match(/^scene[0-9]*$/)){var n=a.substr(5);return n==="1"&&(n=""),r+n}},Z.updateFx=function(i){for(var a=i._fullLayout,n=a._subplots[t],o=0;o<n.length;o++){var s=a[n[o]]._scene;s.updateFx(a.dragmode,a.hovermode)}}}}),iU=Ze({"src/traces/scatter3d/index.js"(Z,q){"use strict";q.exports={plot:XN(),attributes:b5(),markerSymbols:eT(),supplyDefaults:ZN(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:YN(),moduleType:"trace",name:"scatter3d",basePlotModule:pg(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}}),oU=Ze({"lib/scatter3d.js"(Z,q){"use strict";q.exports=iU()}}),mx=Ze({"src/traces/surface/attributes.js"(Z,q){"use strict";var v=Yi(),x=Mu(),A=Qc().axisHoverFormat,M=Cs().hovertemplateAttrs,e=eu(),t=rs().extendFlat,r=pc().overrideAll;function i(o){return{valType:"boolean",dflt:!1}}function a(o){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:i("x"),y:i("y"),z:i("z")},color:{valType:"color",dflt:v.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:v.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var n=q.exports=r(t({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:M(),xhoverformat:A("x"),yhoverformat:A("y"),zhoverformat:A("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},x("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:a("x"),y:a("y"),z:a("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:t({},e.hoverinfo),showlegend:t({},e.showlegend,{dflt:!1})}),"calc","nested");n.x.editType=n.y.editType=n.z.editType="calc+clearAxisTypes"}}),S5=Ze({"src/traces/surface/defaults.js"(Z,q){"use strict";var v=oo(),x=ca(),A=gh(),M=mx(),e=.1;function t(n,o){for(var s=[],c=32,h=0;h<c;h++){var m=h/(c-1),d=o+(1-o)*(1-Math.pow(Math.sin(n*m*Math.PI),2));s.push([m,Math.max(0,Math.min(1,d))])}return s}function r(n){var o=0;if(!Array.isArray(n)||n.length<2||!n[0]||!n[n.length-1]||+n[0][0]!=0||+n[n.length-1][0]!=1)return!1;for(var s=0;s<n.length;s++){var c=n[s];if(c.length!==2||+c[0]<o)return!1;o=+c[0]}return!0}function i(n,o,s,c){var h,m;function d(u,y){return x.coerce(n,o,M,u,y)}var T=d("x"),l=d("y"),_=d("z");if(!_||!_.length||T&&T.length<1||l&&l.length<1){o.visible=!1;return}o._xlength=Array.isArray(T)&&x.isArrayOrTypedArray(T[0])?_.length:_[0].length,o._ylength=_.length;var w=v.getComponentMethod("calendars","handleTraceDefaults");w(n,o,["x","y","z"],c),d("text"),d("hovertext"),d("hovertemplate"),d("xhoverformat"),d("yhoverformat"),d("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach(function(u){d(u)});var S=d("surfacecolor"),E=["x","y","z"];for(h=0;h<3;++h){var g="contours."+E[h],b=d(g+".show"),p=d(g+".highlight");if(b||p)for(m=0;m<3;++m)d(g+".project."+E[m]);b&&(d(g+".color"),d(g+".width"),d(g+".usecolormap")),p&&(d(g+".highlightcolor"),d(g+".highlightwidth")),d(g+".start"),d(g+".end"),d(g+".size")}A(n,o,c,d,{prefix:"",cLetter:"c"}),a(n,o,c,d),o._length=null}function a(n,o,s,c){var h=c("opacityscale");h==="max"?o.opacityscale=[[0,e],[1,1]]:h==="min"?o.opacityscale=[[0,1],[1,e]]:h==="extremes"?o.opacityscale=t(1,e):r(h)||(o.opacityscale=void 0)}q.exports={supplyDefaults:i,opacityscaleDefaults:a}}}),sU=Ze({"src/traces/surface/calc.js"(Z,q){"use strict";var v=jp();q.exports=function(A,M){M.surfacecolor?v(A,M,{vals:M.surfacecolor,containerStr:"",cLetter:"c"}):v(A,M,{vals:M.z,containerStr:"",cLetter:"c"})}}}),lU=Ze({"src/traces/surface/convert.js"(Z,q){"use strict";var v=Yh().gl_surface3d,x=Yh().ndarray,A=Yh().ndarray_linear_interpolate.d2,M=K2(),e=J2(),t=ca().isArrayOrTypedArray,r=em().parseColorScale,i=Qv(),a=rc().extractOpts;function n(y,f,P){this.scene=y,this.uid=P,this.surface=f,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var o=n.prototype;o.getXat=function(y,f,P,L){var z=t(this.data.x)?t(this.data.x[0])?this.data.x[f][y]:this.data.x[y]:y;return P===void 0?z:L.d2l(z,0,P)},o.getYat=function(y,f,P,L){var z=t(this.data.y)?t(this.data.y[0])?this.data.y[f][y]:this.data.y[f]:f;return P===void 0?z:L.d2l(z,0,P)},o.getZat=function(y,f,P,L){var z=this.data.z[f][y];return z===null&&this.data.connectgaps&&this.data._interpolatedZ&&(z=this.data._interpolatedZ[f][y]),P===void 0?z:L.d2l(z,0,P)},o.handlePick=function(y){if(y.object===this.surface){var f=(y.data.index[0]-1)/this.dataScaleX-1,P=(y.data.index[1]-1)/this.dataScaleY-1,L=Math.max(Math.min(Math.round(f),this.data.z[0].length-1),0),z=Math.max(Math.min(Math.round(P),this.data._ylength-1),0);y.index=[L,z],y.traceCoordinate=[this.getXat(L,z),this.getYat(L,z),this.getZat(L,z)],y.dataCoordinate=[this.getXat(L,z,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(L,z,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(L,z,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var F=0;F<3;F++){var B=y.dataCoordinate[F];B!=null&&(y.dataCoordinate[F]*=this.scene.dataScale[F])}var O=this.data.hovertext||this.data.text;return t(O)&&O[z]&&O[z][L]!==void 0?y.textLabel=O[z][L]:O?y.textLabel=O:y.textLabel="",y.data.dataCoordinate=y.dataCoordinate.slice(),this.surface.highlight(y.data),this.scene.glplot.spikes.position=y.dataCoordinate,!0}};function s(y){var f=y[0].rgb,P=y[y.length-1].rgb;return f[0]===P[0]&&f[1]===P[1]&&f[2]===P[2]&&f[3]===P[3]}var c=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function h(y,f){if(y<f)return 0;for(var P=0;Math.floor(y%f)===0;)y/=f,P++;return P}function m(y){for(var f=[],P=0;P<c.length;P++){var L=c[P];f.push(h(y,L))}return f}function d(y){for(var f=m(y),P=y,L=0;L<c.length;L++)if(f[L]>0){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;F<c.length;F++)z*=Math.pow(c[F],Math.max(P[F],L[F]));return z}}function l(y){if(y.length!==0){for(var f=1,P=0;P<y.length;P++)f=T(f,y[P]);return f}}o.calcXnums=function(y){var f,P=[];for(f=1;f<y;f++){var L=this.getXat(f-1,0),z=this.getXat(f,0);z!==L&&L!==void 0&&L!==null&&z!==void 0&&z!==null?P[f-1]=Math.abs(z-L):P[f-1]=0}var F=0;for(f=1;f<y;f++)F+=P[f-1];for(f=1;f<y;f++)P[f-1]===0?P[f-1]=1:P[f-1]=Math.round(F/P[f-1]);return P},o.calcYnums=function(y){var f,P=[];for(f=1;f<y;f++){var L=this.getYat(0,f-1),z=this.getYat(0,f);z!==L&&L!==void 0&&L!==null&&z!==void 0&&z!==null?P[f-1]=Math.abs(z-L):P[f-1]=0}var F=0;for(f=1;f<y;f++)F+=P[f-1];for(f=1;f<y;f++)P[f-1]===0?P[f-1]=1:P[f-1]=Math.round(F/P[f-1]);return P};var _=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],w=_[9],S=_[13];o.estimateScale=function(y,f){for(var P=f===0?this.calcXnums(y):this.calcYnums(y),L=1+l(P);L<w;)L*=2;for(;L>S;)L--,L/=d(L),L++,L<w&&(L=S);var z=Math.round(L/y);return z>1?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;O<F;O++)for(var I=0;I<B;I++)P(z,[O,I],L),y.set(O,I,A(f,z[0],z[1]));return y}o.refineCoords=function(y){for(var f=this.dataScaleX,P=this.dataScaleY,L=y[0].shape[0],z=y[0].shape[1],F=Math.floor(y[0].shape[0]*f+1)|0,B=Math.floor(y[0].shape[1]*P+1)|0,O=1+L+1,I=1+z+1,N=x(new Float32Array(O*I),[O,I]),U=[1/f,0,0,0,1/P,0,0,0,1],W=0;W<y.length;++W){this.surface.padField(N,y[W]);var Q=x(new Float32Array(F*B),[F,B]);g(Q,N,U),y[W]=Q}};function p(y,f){for(var P=!1,L=0;L<y.length;L++)if(f===y[L]){P=!0;break}P===!1&&y.push(f)}o.setContourLevels=function(){var y=[[],[],[]],f=[!1,!1,!1],P=!1,L,z,F;for(L=0;L<3;++L)if(this.showContour[L]&&(P=!0,this.contourSize[L]>0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(f[L]=!0,z=this.contourStart[L];z<this.contourEnd[L];z+=this.contourSize[L])F=z*this.scene.dataScale[L],p(y[L],F);if(P){var B=[[],[],[]];for(L=0;L<3;++L)this.showContour[L]&&(B[L]=f[L]?y[L]:this.scene.contourLevels[L]);this.surface.update({levels:B})}},o.update=function(y){var f=this.scene,P=f.fullSceneLayout,L=this.surface,z=r(y),F=f.dataScale,B=y.z[0].length,O=y._ylength,I=f.contourLevels;this.data=y;var N,U,W,Q,ue=[];for(N=0;N<3;N++)for(ue[N]=[],U=0;U<B;U++)ue[N][U]=[];for(U=0;U<B;U++)for(W=0;W<O;W++)ue[0][U][W]=this.getXat(U,W,y.xcalendar,P.xaxis),ue[1][U][W]=this.getYat(U,W,y.ycalendar,P.yaxis),ue[2][U][W]=this.getZat(U,W,y.zcalendar,P.zaxis);if(y.connectgaps)for(y._emptypoints=e(ue[2]),M(ue[2],y._emptypoints),y._interpolatedZ=[],U=0;U<B;U++)for(y._interpolatedZ[U]=[],W=0;W<O;W++)y._interpolatedZ[U][W]=ue[2][U][W];for(N=0;N<3;N++)for(U=0;U<B;U++)for(W=0;W<O;W++)Q=ue[N][U][W],Q==null?ue[N][U][W]=NaN:Q=ue[N][U][W]*=F[N];for(N=0;N<3;N++)for(U=0;U<B;U++)for(W=0;W<O;W++)Q=ue[N][U][W],Q!=null&&(this.minValues[N]>Q&&(this.minValues[N]=Q),this.maxValues[N]<Q&&(this.maxValues[N]=Q));for(N=0;N<3;N++)this.objectOffset[N]=.5*(this.minValues[N]+this.maxValues[N]);for(N=0;N<3;N++)for(U=0;U<B;U++)for(W=0;W<O;W++)Q=ue[N][U][W],Q!=null&&(ue[N][U][W]-=this.objectOffset[N]);var se=[x(new Float32Array(B*O),[B,O]),x(new Float32Array(B*O),[B,O]),x(new Float32Array(B*O),[B,O])];for(N=0;N<3;N++)for(U=0;U<B;U++)for(W=0;W<O;W++)se[N].set(U,W,ue[N][U][W]);ue=[];var he={colormap:z,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!y.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:y.opacityscale,opacity:y.opacity},H=a(y);if(he.intensityBounds=[H.min,H.max],y.surfacecolor){var $=x(new Float32Array(B*O),[B,O]);for(U=0;U<B;U++)for(W=0;W<O;W++)$.set(U,W,y.surfacecolor[W][U]);se.push($)}else he.intensityBounds[0]*=F[2],he.intensityBounds[1]*=F[2];(S<se[0].shape[0]||S<se[0].shape[1])&&(this.refineData=!1),this.refineData===!0&&(this.dataScaleX=this.estimateScale(se[0].shape[0],0),this.dataScaleY=this.estimateScale(se[0].shape[1],1),(this.dataScaleX!==1||this.dataScaleY!==1)&&this.refineCoords(se)),y.surfacecolor&&(he.intensity=se.pop());var J=[!0,!0,!0],X=["x","y","z"];for(N=0;N<3;++N){var oe=y.contours[X[N]];J[N]=oe.highlight,he.showContour[N]=oe.show||oe.highlight,he.showContour[N]&&(he.contourProject[N]=[oe.project.x,oe.project.y,oe.project.z],oe.show?(this.showContour[N]=!0,he.levels[N]=I[N],L.highlightColor[N]=he.contourColor[N]=i(oe.color),oe.usecolormap?L.highlightTint[N]=he.contourTint[N]=0:L.highlightTint[N]=he.contourTint[N]=1,he.contourWidth[N]=oe.width,this.contourStart[N]=oe.start,this.contourEnd[N]=oe.end,this.contourSize[N]=oe.size):(this.showContour[N]=!1,this.contourStart[N]=null,this.contourEnd[N]=null,this.contourSize[N]=0),oe.highlight&&(he.dynamicColor[N]=i(oe.highlightcolor),he.dynamicWidth[N]=oe.highlightwidth))}s(z)&&(he.vertexColor=!0),he.objectOffset=this.objectOffset,he.coords=se,L.update(he),L.visible=y.visible,L.enableDynamic=J,L.enableHighlight=J,L.snapToData=!0,"lighting"in y&&(L.ambientLight=y.lighting.ambient,L.diffuseLight=y.lighting.diffuse,L.specularLight=y.lighting.specular,L.roughness=y.lighting.roughness,L.fresnel=y.lighting.fresnel),"lightposition"in y&&(L.lightPosition=[y.lightposition.x,y.lightposition.y,y.lightposition.z])},o.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()};function u(y,f){var P=y.glplot.gl,L=v({gl:P}),z=new n(y,L,f.uid);return L._trace=z,z.update(f),y.glplot.add(L),z}q.exports=u}}),uU=Ze({"src/traces/surface/index.js"(Z,q){"use strict";q.exports={attributes:mx(),supplyDefaults:S5().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:sU(),plot:lU(),moduleType:"trace",name:"surface",basePlotModule:pg(),categories:["gl3d","2dMap","showLegend"],meta:{}}}}),cU=Ze({"lib/surface.js"(Z,q){"use strict";q.exports=uU()}}),M1=Ze({"src/traces/mesh3d/attributes.js"(Z,q){"use strict";var v=Mu(),x=Qc().axisHoverFormat,A=Cs().hovertemplateAttrs,M=mx(),e=eu(),t=rs().extendFlat;q.exports=t({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"}),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},v("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:M.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:t({},M.contours.x.show,{}),color:M.contours.x.color,width:M.contours.x.width,editType:"calc"},lightposition:{x:t({},M.lightposition.x,{dflt:1e5}),y:t({},M.lightposition.y,{dflt:1e5}),z:t({},M.lightposition.z,{dflt:0}),editType:"calc"},lighting:t({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},M.lighting),hoverinfo:t({},e.hoverinfo,{editType:"calc"}),showlegend:t({},e.showlegend,{dflt:!1})})}}),tT=Ze({"src/traces/isosurface/attributes.js"(Z,q){"use strict";var v=Mu(),x=Qc().axisHoverFormat,A=Cs().hovertemplateAttrs,M=M1(),e=eu(),t=rs().extendFlat,r=pc().overrideAll;function i(o){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function a(o){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var n=q.exports=r(t({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:i("x"),y:i("y"),z:i("z")},caps:{x:a("x"),y:a("y"),z:a("z")},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:A(),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),valuehoverformat:x("value",1),showlegend:t({},e.showlegend,{dflt:!1})},v("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:M.opacity,lightposition:M.lightposition,lighting:M.lighting,flatshading:M.flatshading,contour:M.contour,hoverinfo:t({},e.hoverinfo)}),"calc","nested");n.flatshading.dflt=!0,n.lighting.facenormalsepsilon.dflt=0,n.x.editType=n.y.editType=n.z.editType=n.value.editType="calc+clearAxisTypes"}}),M5=Ze({"src/traces/isosurface/defaults.js"(Z,q){"use strict";var v=ca(),x=oo(),A=tT(),M=gh();function e(r,i,a,n){function o(s,c){return v.coerce(r,i,A,s,c)}t(r,i,a,n,o)}function t(r,i,a,n,o){var s=o("isomin"),c=o("isomax");c!=null&&s!==void 0&&s!==null&&s>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;d<i._len;d++){var T=i._u[d],l=i._v[d],_=i._w[d],w=Math.sqrt(T*T+l*l+_*_);h=Math.max(h,w),m=Math.min(m,w)}for(x(r,i,{vals:[m,h],containerStr:"",cLetter:"c"}),d=0;d<n;d++){var S=o[d];a.xMax=Math.max(a.xMax,S),a.xMin=Math.min(a.xMin,S);var E=s[d];a.yMax=Math.max(a.yMax,E),a.yMin=Math.min(a.yMin,E);var g=c[d];a.zMax=Math.max(a.zMax,g),a.zMin=Math.min(a.zMin,g)}i._slen=n,i._normMax=h,i._xbnds=[a.xMin,a.xMax],i._ybnds=[a.yMin,a.yMax],i._zbnds=[a.zMin,a.zMax]}function M(r){var i=r._x,a=r._y,n=r._z,o=r._len,s,c,h,m=-1/0,d=1/0,T=-1/0,l=1/0,_=-1/0,w=1/0,S="",E,g,b,p,u,y,f,P,L;for(o&&(p=i[0],y=a[0],P=n[0]),o>1&&(u=i[o-1],f=a[o-1],L=n[o-1]),s=0;s<o;s++)m=Math.max(m,i[s]),d=Math.min(d,i[s]),T=Math.max(T,a[s]),l=Math.min(l,a[s]),_=Math.max(_,n[s]),w=Math.min(w,n[s]),!E&&i[s]!==p&&(E=!0,S+="x"),!g&&a[s]!==y&&(g=!0,S+="y"),!b&&n[s]!==P&&(b=!0,S+="z");E||(S+="x"),g||(S+="y"),b||(S+="z");var z=e(r._x),F=e(r._y),B=e(r._z);S=S.replace("x",(p>u?"-":"+")+"x"),S=S.replace("y",(y>f?"-":"+")+"y"),S=S.replace("z",(P>L?"-":"+")+"z");var O=function(){o=0,z=[],F=[],B=[]};(!o||o<z.length*F.length*B.length)&&O();var I=function(be){return be==="x"?i:be==="y"?a:n},N=function(be){return be==="x"?z:be==="y"?F:B},U=function(be){return be[o-1]<be[0]?-1:1},W=I(S[1]),Q=I(S[3]),ue=I(S[5]),se=N(S[1]).length,he=N(S[3]).length,H=N(S[5]).length,$=!1,J=function(be,Ae,ze){return se*(he*be+Ae)+ze},X=U(I(S[1])),oe=U(I(S[3])),ne=U(I(S[5]));for(s=0;s<H-1;s++){for(c=0;c<he-1;c++){for(h=0;h<se-1;h++){var j=J(s,c,h),ee=J(s,c,h+1),re=J(s,c+1,h),ce=J(s+1,c,h);if((!(W[j]*X<W[ee]*X)||!(Q[j]*oe<Q[re]*oe)||!(ue[j]*ne<ue[ce]*ne))&&($=!0),$)break}if($)break}if($)break}return $&&(v.warn("Encountered arbitrary coordinates! Unable to input data grid."),O()),{xMin:d,yMin:l,zMin:w,xMax:m,yMax:T,zMax:_,Xs:z,Ys:F,Zs:B,len:o,fill:S}}function e(r){return v.distinctVals(r).vals}function t(r,i){if(i===void 0&&(i=r.length),v.isTypedArray(r))return r.subarray(0,i);for(var a=[],n=0;n<i;n++)a[n]=+r[n];return a}q.exports={calc:A,filter:t,processGrid:M}}}),E5=Ze({"src/traces/isosurface/calc.js"(Z,q){"use strict";var v=jp(),x=rT().processGrid,A=rT().filter;q.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=A(t.x,t._len),t._y=A(t.y,t._len),t._z=A(t.z,t._len),t._value=A(t.value,t._len);var r=x(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;for(var i=1/0,a=-1/0,n=0;n<t._len;n++){var o=t._value[n];i=Math.min(i,o),a=Math.max(a,o)}t._minValues=i,t._maxValues=a,t._vMin=t.isomin===void 0||t.isomin===null?i:t.isomin,t._vMax=t.isomax===void 0||t.isomax===null?a:t.isomax,v(e,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}}),E1=Ze({"src/plots/gl3d/zip3.js"(Z,q){"use strict";q.exports=function(x,A,M,e){e=e||x.length;for(var t=new Array(e),r=0;r<e;r++)t[r]=[x[r],A[r],M[r]];return t}}}),aT=Ze({"src/traces/isosurface/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=function(c,h){for(var m=h.length-1;m>0;m--){var d=Math.min(h[m],h[m-1]),T=Math.max(h[m],h[m-1]);if(T>d&&d<c&&c<=T)return{id:m,distRatio:(T-c)/(T-d)}}return{id:0,distRatio:0}};function i(c,h,m){this.scene=c,this.uid=m,this.mesh=h,this.name="",this.data=null,this.showContour=!1}var a=i.prototype;a.handlePick=function(c){if(c.object===this.mesh){var h=c.data.index,m=this.data._meshX[h],d=this.data._meshY[h],T=this.data._meshZ[h],l=this.data._Ys.length,_=this.data._Zs.length,w=r(m,this.data._Xs).id,S=r(d,this.data._Ys).id,E=r(T,this.data._Zs).id,g=c.index=E+_*S+_*l*w;c.traceCoordinate=[this.data._meshX[g],this.data._meshY[g],this.data._meshZ[g],this.data._value[g]];var b=this.data.hovertext||this.data.text;return A(b)&&b[g]!==void 0?c.textLabel=b[g]:b&&(c.textLabel=b),!0}},a.update=function(c){var h=this.scene,m=h.fullSceneLayout;this.data=o(c);function d(S,E,g,b){return E.map(function(p){return S.d2l(p,0,b)*g})}var T=t(d(m.xaxis,c._meshX,h.dataScale[0],c.xcalendar),d(m.yaxis,c._meshY,h.dataScale[1],c.ycalendar),d(m.zaxis,c._meshZ,h.dataScale[2],c.zcalendar)),l=t(c._meshI,c._meshJ,c._meshK),_={positions:T,cells:l,lightPosition:[c.lightposition.x,c.lightposition.y,c.lightposition.z],ambient:c.lighting.ambient,diffuse:c.lighting.diffuse,specular:c.lighting.specular,roughness:c.lighting.roughness,fresnel:c.lighting.fresnel,vertexNormalsEpsilon:c.lighting.vertexnormalsepsilon,faceNormalsEpsilon:c.lighting.facenormalsepsilon,opacity:c.opacity,contourEnable:c.contour.show,contourColor:M(c.contour.color).slice(0,3),contourWidth:c.contour.width,useFacetNormals:c.flatshading},w=e(c);_.vertexIntensity=c._meshIntensity,_.vertexIntensityBounds=[w.min,w.max],_.colormap=x(c),this.mesh.update(_)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var n=["xyz","xzy","yxz","yzx","zxy","zyx"];function o(c){c._meshI=[],c._meshJ=[],c._meshK=[];var h=c.surface.show,m=c.spaceframe.show,d=c.surface.fill,T=c.spaceframe.fill,l=!1,_=!1,w=0,S,E,g=c._Xs,b=c._Ys,p=c._Zs,u=g.length,y=b.length,f=p.length,P=n.indexOf(c._gridFill.replace(/-/g,"").replace(/\+/g,"")),L=function(bt,Be,Ke){switch(P){case 5:return Ke+f*Be+f*y*bt;case 4:return Ke+f*bt+f*u*Be;case 3:return Be+y*Ke+y*f*bt;case 2:return Be+y*bt+y*u*Ke;case 1:return bt+u*Ke+u*f*Be;default:return bt+u*Be+u*y*Ke}},z=c._minValues,F=c._maxValues,B=c._vMin,O=c._vMax,I,N,U,W;function Q(bt,Be,Ke){for(var Ue=W.length,Ee=E;Ee<Ue;Ee++)if(bt===I[Ee]&&Be===N[Ee]&&Ke===U[Ee])return Ee;return-1}function ue(){E=S}function se(){I=[],N=[],U=[],W=[],S=0,ue()}function he(bt,Be,Ke,Ue){return I.push(bt),N.push(Be),U.push(Ke),W.push(Ue),S++,S-1}function H(bt,Be,Ke){return c._meshI.push(bt),c._meshJ.push(Be),c._meshK.push(Ke),w++,w-1}function $(bt,Be,Ke){for(var Ue=[],Ee=0;Ee<bt.length;Ee++)Ue[Ee]=(bt[Ee]+Be[Ee]+Ke[Ee])/3;return Ue}function J(bt,Be,Ke){for(var Ue=[],Ee=0;Ee<bt.length;Ee++)Ue[Ee]=bt[Ee]*(1-Ke)+Ke*Be[Ee];return Ue}var X;function oe(bt){X=bt}function ne(bt,Be){var Ke=bt[0],Ue=bt[1],Ee=bt[2],Ve=$(Ke,Ue,Ee),Ce=Math.sqrt(1-X),Te=J(Ve,Ke,Ce),Pe=J(Ve,Ue,Ce),at=J(Ve,Ee,Ce),yt=Be[0],Tt=Be[1],Ot=Be[2];return{xyzv:[[Ke,Ue,Pe],[Pe,Te,Ke],[Ue,Ee,at],[at,Pe,Ue],[Ee,Ke,Te],[Te,at,Ee]],abc:[[yt,Tt,-1],[-1,-1,yt],[Tt,Ot,-1],[-1,-1,Tt],[Ot,yt,-1],[-1,-1,Ot]]}}function j(bt,Be){return bt==="all"||bt===null?!0:bt.indexOf(Be)>-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<Ue.length;Ce++){Be=Ue[Ce],Ke=Ee[Ce];for(var Te=[],Pe=0;Pe<3;Pe++){var at=Be[Pe][0],yt=Be[Pe][1],Tt=Be[Pe][2],Ot=Be[Pe][3],Gt=Ke[Pe]>-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];Ee<Ke&&(Ee=Ke),Ee>Ue&&(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):Ve<it?ot(yt,Tt,Ot,B,O,++Ve):!1};if(Te[0]&&Te[1]&&Te[2])return Pe(bt,Be,Ke)||Ce;var at=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(yt){if(Te[yt[0]]&&Te[yt[1]]&&!Te[yt[2]]){var Tt=Be[yt[0]],Ot=Be[yt[1]],Gt=Be[yt[2]],rr=Ae(Gt,Tt,Ue,Ee),Qt=Ae(Gt,Ot,Ue,Ee);Ce=Pe(bt,[Qt,rr,Tt],[-1,-1,Ke[yt[0]]])||Ce,Ce=Pe(bt,[Tt,Ot,Qt],[Ke[yt[0]],Ke[yt[1]],-1])||Ce,at=!0}}),at||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(yt){if(Te[yt[0]]&&!Te[yt[1]]&&!Te[yt[2]]){var Tt=Be[yt[0]],Ot=Be[yt[1]],Gt=Be[yt[2]],rr=Ae(Ot,Tt,Ue,Ee),Qt=Ae(Gt,Tt,Ue,Ee);Ce=Pe(bt,[Qt,rr,Tt],[-1,-1,Ke[yt[0]]])||Ce,at=!0}}),Ce}function tt(bt,Be,Ke,Ue){var Ee=!1,Ve=We(Be),Ce=[ze(Ve[0][3],Ke,Ue),ze(Ve[1][3],Ke,Ue),ze(Ve[2][3],Ke,Ue),ze(Ve[3][3],Ke,Ue)];if(!Ce[0]&&!Ce[1]&&!Ce[2]&&!Ce[3])return Ee;if(Ce[0]&&Ce[1]&&Ce[2]&&Ce[3])return _&&(Ee=be(bt,Ve,Be)||Ee),Ee;var Te=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(Pe){if(Ce[Pe[0]]&&Ce[Pe[1]]&&Ce[Pe[2]]&&!Ce[Pe[3]]){var at=Ve[Pe[0]],yt=Ve[Pe[1]],Tt=Ve[Pe[2]],Ot=Ve[Pe[3]];if(_)Ee=re(bt,[at,yt,Tt],[Be[Pe[0]],Be[Pe[1]],Be[Pe[2]]])||Ee;else{var Gt=Ae(Ot,at,Ke,Ue),rr=Ae(Ot,yt,Ke,Ue),Qt=Ae(Ot,Tt,Ke,Ue);Ee=re(null,[Gt,rr,Qt],[-1,-1,-1])||Ee}Te=!0}}),Te||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(Pe){if(Ce[Pe[0]]&&Ce[Pe[1]]&&!Ce[Pe[2]]&&!Ce[Pe[3]]){var at=Ve[Pe[0]],yt=Ve[Pe[1]],Tt=Ve[Pe[2]],Ot=Ve[Pe[3]],Gt=Ae(Tt,at,Ke,Ue),rr=Ae(Tt,yt,Ke,Ue),Qt=Ae(Ot,yt,Ke,Ue),Tr=Ae(Ot,at,Ke,Ue);_?(Ee=re(bt,[at,Tr,Gt],[Be[Pe[0]],-1,-1])||Ee,Ee=re(bt,[yt,rr,Qt],[Be[Pe[1]],-1,-1])||Ee):Ee=ce(null,[Gt,rr,Qt,Tr],[-1,-1,-1,-1])||Ee,Te=!0}}),Te)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(Pe){if(Ce[Pe[0]]&&!Ce[Pe[1]]&&!Ce[Pe[2]]&&!Ce[Pe[3]]){var at=Ve[Pe[0]],yt=Ve[Pe[1]],Tt=Ve[Pe[2]],Ot=Ve[Pe[3]],Gt=Ae(yt,at,Ke,Ue),rr=Ae(Tt,at,Ke,Ue),Qt=Ae(Ot,at,Ke,Ue);_?(Ee=re(bt,[at,Gt,rr],[Be[Pe[0]],-1,-1])||Ee,Ee=re(bt,[at,rr,Qt],[Be[Pe[0]],-1,-1])||Ee,Ee=re(bt,[at,Qt,Gt],[Be[Pe[0]],-1,-1])||Ee):Ee=re(null,[Gt,rr,Qt],[-1,-1,-1])||Ee,Te=!0}}),Ee}function ut(bt,Be,Ke,Ue,Ee,Ve,Ce,Te,Pe,at,yt){var Tt=!1;return l&&(j(bt,"A")&&(Tt=tt(null,[Be,Ke,Ue,Ve],at,yt)||Tt),j(bt,"B")&&(Tt=tt(null,[Ke,Ue,Ee,Pe],at,yt)||Tt),j(bt,"C")&&(Tt=tt(null,[Ke,Ve,Ce,Pe],at,yt)||Tt),j(bt,"D")&&(Tt=tt(null,[Ue,Ve,Te,Pe],at,yt)||Tt),j(bt,"E")&&(Tt=tt(null,[Ke,Ue,Ve,Pe],at,yt)||Tt)),_&&(Tt=tt(bt,[Ke,Ue,Ve,Pe],at,yt)||Tt),Tt}function Me(bt,Be,Ke,Ue,Ee,Ve,Ce,Te){return[Te[0]===!0?!0:ot(bt,We([Be,Ke,Ue]),[Be,Ke,Ue],Ve,Ce),Te[1]===!0?!0:ot(bt,We([Ue,Ee,Be]),[Ue,Ee,Be],Ve,Ce)]}function _e(bt,Be,Ke,Ue,Ee,Ve,Ce,Te,Pe){return Te?Me(bt,Be,Ke,Ee,Ue,Ve,Ce,Pe):Me(bt,Ke,Ee,Ue,Be,Ve,Ce,Pe)}function fe(bt,Be,Ke,Ue,Ee,Ve,Ce){var Te=!1,Pe,at,yt,Tt,Ot=function(){Te=ot(bt,[Pe,at,yt],[-1,-1,-1],Ee,Ve)||Te,Te=ot(bt,[yt,Tt,Pe],[-1,-1,-1],Ee,Ve)||Te},Gt=Ce[0],rr=Ce[1],Qt=Ce[2];return Gt&&(Pe=J(We([L(Be,Ke-0,Ue-0)])[0],We([L(Be-1,Ke-0,Ue-0)])[0],Gt),at=J(We([L(Be,Ke-0,Ue-1)])[0],We([L(Be-1,Ke-0,Ue-1)])[0],Gt),yt=J(We([L(Be,Ke-1,Ue-1)])[0],We([L(Be-1,Ke-1,Ue-1)])[0],Gt),Tt=J(We([L(Be,Ke-1,Ue-0)])[0],We([L(Be-1,Ke-1,Ue-0)])[0],Gt),Ot()),rr&&(Pe=J(We([L(Be-0,Ke,Ue-0)])[0],We([L(Be-0,Ke-1,Ue-0)])[0],rr),at=J(We([L(Be-0,Ke,Ue-1)])[0],We([L(Be-0,Ke-1,Ue-1)])[0],rr),yt=J(We([L(Be-1,Ke,Ue-1)])[0],We([L(Be-1,Ke-1,Ue-1)])[0],rr),Tt=J(We([L(Be-1,Ke,Ue-0)])[0],We([L(Be-1,Ke-1,Ue-0)])[0],rr),Ot()),Qt&&(Pe=J(We([L(Be-0,Ke-0,Ue)])[0],We([L(Be-0,Ke-0,Ue-1)])[0],Qt),at=J(We([L(Be-0,Ke-1,Ue)])[0],We([L(Be-0,Ke-1,Ue-1)])[0],Qt),yt=J(We([L(Be-1,Ke-1,Ue)])[0],We([L(Be-1,Ke-1,Ue-1)])[0],Qt),Tt=J(We([L(Be-1,Ke-0,Ue)])[0],We([L(Be-1,Ke-0,Ue-1)])[0],Qt),Ot()),Te}function Fe(bt,Be,Ke,Ue,Ee,Ve,Ce,Te,Pe,at,yt,Tt){var Ot=bt;return Tt?(l&&bt==="even"&&(Ot=null),ut(Ot,Be,Ke,Ue,Ee,Ve,Ce,Te,Pe,at,yt)):(l&&bt==="odd"&&(Ot=null),ut(Ot,Pe,Te,Ce,Ve,Ee,Ue,Ke,Be,at,yt))}function rt(bt,Be,Ke,Ue,Ee){for(var Ve=[],Ce=0,Te=0;Te<Be.length;Te++)for(var Pe=Be[Te],at=1;at<f;at++)for(var yt=1;yt<y;yt++)Ve.push(_e(bt,L(Pe,yt-1,at-1),L(Pe,yt-1,at),L(Pe,yt,at-1),L(Pe,yt,at),Ke,Ue,(Pe+yt+at)%2,Ee&&Ee[Ce]?Ee[Ce]:[])),Ce++;return Ve}function st(bt,Be,Ke,Ue,Ee){for(var Ve=[],Ce=0,Te=0;Te<Be.length;Te++)for(var Pe=Be[Te],at=1;at<u;at++)for(var yt=1;yt<f;yt++)Ve.push(_e(bt,L(at-1,Pe,yt-1),L(at,Pe,yt-1),L(at-1,Pe,yt),L(at,Pe,yt),Ke,Ue,(at+Pe+yt)%2,Ee&&Ee[Ce]?Ee[Ce]:[])),Ce++;return Ve}function Qe(bt,Be,Ke,Ue,Ee){for(var Ve=[],Ce=0,Te=0;Te<Be.length;Te++)for(var Pe=Be[Te],at=1;at<y;at++)for(var yt=1;yt<u;yt++)Ve.push(_e(bt,L(yt-1,at-1,Pe),L(yt-1,at,Pe),L(yt,at-1,Pe),L(yt,at,Pe),Ke,Ue,(yt+at+Pe)%2,Ee&&Ee[Ce]?Ee[Ce]:[])),Ce++;return Ve}function Lt(bt,Be,Ke){for(var Ue=1;Ue<f;Ue++)for(var Ee=1;Ee<y;Ee++)for(var Ve=1;Ve<u;Ve++)Fe(bt,L(Ve-1,Ee-1,Ue-1),L(Ve-1,Ee-1,Ue),L(Ve-1,Ee,Ue-1),L(Ve-1,Ee,Ue),L(Ve,Ee-1,Ue-1),L(Ve,Ee-1,Ue),L(Ve,Ee,Ue-1),L(Ve,Ee,Ue),Be,Ke,(Ve+Ee+Ue)%2)}function kt(bt,Be,Ke){_=!0,Lt(bt,Be,Ke),_=!1}function qt(bt,Be,Ke){l=!0,Lt(bt,Be,Ke),l=!1}function Zt(bt,Be,Ke,Ue,Ee,Ve){for(var Ce=[],Te=0,Pe=0;Pe<Be.length;Pe++)for(var at=Be[Pe],yt=1;yt<f;yt++)for(var Tt=1;Tt<y;Tt++)Ce.push(fe(bt,at,Tt,yt,Ke,Ue,Ee[Pe],Ve&&Ve[Te]?Ve[Te]:[])),Te++;return Ce}function Sr(bt,Be,Ke,Ue,Ee,Ve){for(var Ce=[],Te=0,Pe=0;Pe<Be.length;Pe++)for(var at=Be[Pe],yt=1;yt<u;yt++)for(var Tt=1;Tt<f;Tt++)Ce.push(fe(bt,yt,at,Tt,Ke,Ue,Ee[Pe],Ve&&Ve[Te]?Ve[Te]:[])),Te++;return Ce}function xr(bt,Be,Ke,Ue,Ee,Ve){for(var Ce=[],Te=0,Pe=0;Pe<Be.length;Pe++)for(var at=Be[Pe],yt=1;yt<y;yt++)for(var Tt=1;Tt<u;Tt++)Ce.push(fe(bt,Tt,yt,at,Ke,Ue,Ee[Pe],Ve&&Ve[Te]?Ve[Te]:[])),Te++;return Ce}function jr(bt,Be){for(var Ke=[],Ue=bt;Ue<Be;Ue++)Ke.push(Ue);return Ke}function wr(){for(var bt=0;bt<u;bt++)for(var Be=0;Be<y;Be++)for(var Ke=0;Ke<f;Ke++){var Ue=L(bt,Be,Ke);he(c._x[Ue],c._y[Ue],c._z[Ue],c._value[Ue])}}function Ir(){se(),wr();var bt=null;if(m&&T&&(oe(T),kt(bt,B,O)),h&&d){oe(d);for(var Be=c.surface.pattern,Ke=c.surface.count,Ue=0;Ue<Ke;Ue++){var Ee=Ke===1?.5:Ue/(Ke-1),Ve=(1-Ee)*B+Ee*O,Ce=Math.abs(Ve-z),Te=Math.abs(Ve-F),Pe=Ce>Te?[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;Ot<at.length;Ot++){var Gt=0,rr=at[Ot][0],Qt=at[Ot][1],Tr=c.slices[yt];if(Tr.show&&Tr.fill){oe(Tr.fill);var la=[],Ua=[],Ba=[];if(Tr.locations.length)for(var Ra=0;Ra<Tr.locations.length;Ra++){var Qa=r(Tr.locations[Ra],yt==="x"?g:yt==="y"?b:p);Qa.distRatio===0?la.push(Qa.id):Qa.id>0&&(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<w;S++)_[S]=r(l[S]);return _}function c(l,_,w,S){for(var E=[],g=_.length,b=0;b<g;b++)E[b]=l.d2l(_[b],0,S)*w;return E}function h(l){for(var _=[],w=l.length,S=0;S<w;S++)_[S]=Math.round(l[S]);return _}function m(l,_){for(var w=["x","y","z"].indexOf(l),S=[],E=_.length,g=0;g<E;g++)S[g]=[_[g][(w+1)%3],_[g][(w+2)%3]];return x(S)}function d(l,_){for(var w=l.length,S=0;S<w;S++)if(l[S]<=-.5||l[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;o<i;o++){var s=e[o],c=t[o],h=r[o],m=Math.sqrt(s*s+c*c+h*h);a=Math.max(a,m),n=Math.min(n,m)}M._len=i,M._normMax=a,v(A,M,{vals:[n,a],containerStr:"",cLetter:"c"})}}}),AU=Ze({"src/traces/cone/convert.js"(Z,q){"use strict";var v=Yh().gl_cone3d,x=Yh().gl_cone3d.createConeMesh,A=ca().simpleMap,M=em().parseColorScale,e=rc().extractOpts,t=ca().isArrayOrTypedArray,r=E1();function i(m,d){this.scene=m,this.uid=d,this.mesh=null,this.data=null}var a=i.prototype;a.handlePick=function(m){if(m.object===this.mesh){var d=m.index=m.data.index,T=this.data.x[d],l=this.data.y[d],_=this.data.z[d],w=this.data.u[d],S=this.data.v[d],E=this.data.w[d];m.traceCoordinate=[T,l,_,w,S,E,Math.sqrt(w*w+S*S+E*E)];var g=this.data.hovertext||this.data.text;return t(g)&&g[d]!==void 0?m.textLabel=g[d]:g&&(m.textLabel=g),!0}};var n={xaxis:0,yaxis:1,zaxis:2},o={tip:1,tail:0,cm:.25,center:.5},s={tip:1,tail:1,cm:.75,center:.5};function c(m,d){var T=m.fullSceneLayout,l=m.dataScale,_={};function w(p,u){var y=T[u],f=l[n[u]];return A(p,function(P){return y.d2l(P)*f})}_.vectors=r(w(d.u,"xaxis"),w(d.v,"yaxis"),w(d.w,"zaxis"),d._len),_.positions=r(w(d.x,"xaxis"),w(d.y,"yaxis"),w(d.z,"zaxis"),d._len);var S=e(d);_.colormap=M(d),_.vertexIntensityBounds=[S.min/d._normMax,S.max/d._normMax],_.coneOffset=o[d.anchor];var E=d.sizemode;E==="scaled"?_.coneSize=d.sizeref||.5:E==="absolute"?_.coneSize=d.sizeref&&d._normMax?d.sizeref/d._normMax:.5:E==="raw"&&(_.coneSize=d.sizeref),_.coneSizemode=E;var g=v(_),b=d.lightposition;return g.lightPosition=[b.x,b.y,b.z],g.ambient=d.lighting.ambient,g.diffuse=d.lighting.diffuse,g.specular=d.lighting.specular,g.roughness=d.lighting.roughness,g.fresnel=d.lighting.fresnel,g.opacity=d.opacity,d._pad=s[d.anchor]*g.vectorScale*g.coneScale*d._normMax,g}a.update=function(m){this.data=m;var d=c(this.scene,m);this.mesh.update(d)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function h(m,d){var T=m.glplot.gl,l=c(m,d),_=x(T,l),w=new i(m,d.uid);return w.mesh=_,w.data=d,_._trace=w,m.glplot.add(_),w}q.exports=h}}),SU=Ze({"src/traces/cone/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"cone",basePlotModule:pg(),categories:["gl3d","showLegend"],attributes:k5(),supplyDefaults:wU(),colorbar:{min:"cmin",max:"cmax"},calc:TU(),plot:AU(),eventData:function(v,x){return v.norm=x.traceCoordinate[6],v},meta:{}}}}),MU=Ze({"lib/cone.js"(Z,q){"use strict";q.exports=SU()}}),L5=Ze({"src/traces/streamtube/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"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),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","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),q.exports=r}}),EU=Ze({"src/traces/streamtube/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=L5();q.exports=function(e,t,r,i){function a(d,T){return v.coerce(e,t,A,d,T)}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}a("starts.x"),a("starts.y"),a("starts.z"),a("maxdisplayed"),a("sizeref"),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}}}),CU=Ze({"src/traces/streamtube/convert.js"(Z,q){"use strict";var v=Yh().gl_streamtube3d,x=v.createTubeMesh,A=ca(),M=em().parseColorScale,e=rc().extractOpts,t=E1(),r={xaxis:0,yaxis:1,zaxis:2};function i(h,m){this.scene=h,this.uid=m,this.mesh=null,this.data=null}var a=i.prototype;a.handlePick=function(h){var m=this.scene.fullSceneLayout,d=this.scene.dataScale;function T(w,S){var E=m[S],g=d[r[S]];return E.l2c(w)/g}if(h.object===this.mesh){var l=h.data.position,_=h.data.velocity;return h.traceCoordinate=[T(l[0],"xaxis"),T(l[1],"yaxis"),T(l[2],"zaxis"),T(_[0],"xaxis"),T(_[1],"yaxis"),T(_[2],"zaxis"),h.data.intensity*this.data._normMax,h.data.divergence],h.textLabel=this.data.hovertext||this.data.text,!0}};function n(h){var m=h.length,d;return m>2?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;L<u.length;L++)for(var z=0;z<y.length;z++)f[P++]=[u[L],p,y[z]];_.startingPositions=f}_.colormap=M(m),_.tubeSize=m.sizeref,_.maxLength=m.maxdisplayed;var F=w(m._xbnds,"xaxis"),B=w(m._ybnds,"yaxis"),O=w(m._zbnds,"zaxis"),I=o(S),N=o(E),U=o(g),W=[[F[0]-I[0],B[0]-N[0],O[0]-U[0]],[F[1]+I[1],B[1]+N[1],O[1]+U[1]]],Q=v(_,W),ue=e(m);Q.vertexIntensityBounds=[ue.min/m._normMax,ue.max/m._normMax];var se=m.lightposition;return Q.lightPosition=[se.x,se.y,se.z],Q.ambient=m.lighting.ambient,Q.diffuse=m.lighting.diffuse,Q.specular=m.lighting.specular,Q.roughness=m.lighting.roughness,Q.fresnel=m.lighting.fresnel,Q.opacity=m.opacity,m._pad=Q.tubeScale*m.sizeref*2,Q}a.update=function(h){this.data=h;var m=s(this.scene,h);this.mesh.update(m)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function c(h,m){var d=h.glplot.gl,T=s(h,m),l=x(d,T),_=new i(h,m.uid);return _.mesh=l,_.data=m,l._trace=_,h.glplot.add(l),_}q.exports=c}}),kU=Ze({"src/traces/streamtube/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"streamtube",basePlotModule:pg(),categories:["gl3d","showLegend"],attributes:L5(),supplyDefaults:EU(),colorbar:{min:"cmin",max:"cmax"},calc:rT().calc,plot:CU(),eventData:function(v,x){return v.tubex=v.x,v.tubey=v.y,v.tubez=v.z,v.tubeu=x.traceCoordinate[3],v.tubev=x.traceCoordinate[4],v.tubew=x.traceCoordinate[5],v.norm=x.traceCoordinate[6],v.divergence=x.traceCoordinate[7],delete v.x,delete v.y,delete v.z,v},meta:{}}}}),LU=Ze({"lib/streamtube.js"(Z,q){"use strict";q.exports=kU()}}),d0=Ze({"src/traces/scattergeo/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=pc().overrideAll,n=M.marker,o=M.line,s=n.line,c=["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" ");q.exports=a({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:i({},M.mode,{dflt:"markers"}),text:i({},M.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:i({},M.hovertext,{}),textfont:M.textfont,textposition:M.textposition,line:{color:o.color,width:o.width,dash:r},connectgaps:M.connectgaps,marker:i({symbol:n.symbol,opacity:n.opacity,angle:n.angle,angleref:i({},n.angleref,{values:["previous","up","north"]}),standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,colorbar:n.colorbar,line:i({width:s.width},t("marker.line")),gradient:n.gradient},t("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:A(),selected:M.selected,unselected:M.unselected,hoverinfo:i({},e.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:v()},"calc","nested")}}),PU=Ze({"src/traces/scattergeo/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=md(),M=Dd(),e=zd(),t=ev(),r=d0();q.exports=function(a,n,o,s){function c(S,E){return v.coerce(a,n,r,S,E)}var h=c("locations"),m;if(h&&h.length){var d=c("geojson"),T;(typeof d=="string"&&d!==""||v.isPlainObject(d))&&(T="geojson-id");var l=c("locationmode",T);l==="geojson-id"&&c("featureidkey"),m=h.length}else{var _=c("lon")||[],w=c("lat")||[];m=Math.min(_.length,w.length)}if(!m){n.visible=!1;return}n._length=m,c("text"),c("hovertext"),c("hovertemplate"),c("mode"),x.hasMarkers(n)&&A(a,n,o,s,c,{gradient:!0}),x.hasLines(n)&&(M(a,n,o,s,c),c("connectgaps")),x.hasText(n)&&(c("texttemplate"),e(a,n,s,c)),c("fill"),n.fill!=="none"&&t(a,n,o,c),v.coerceSelectionMarkerOpacity(n,c)}}}),IU=Ze({"src/traces/scattergeo/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r=e[M.geo]._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}}}),nT=Ze({"src/traces/scattergeo/calc.js"(Z,q){"use strict";var v=is(),x=Vs().BADNUM,A=Fd(),M=Av(),e=Od(),t=ca().isArrayOrTypedArray,r=ca()._;function i(a){return a&&typeof a=="string"}q.exports=function(n,o){var s=t(o.locations),c=s?o.locations.length:o._length,h=new Array(c),m;o.geojson?m=function(S){return i(S)||v(S)}:m=i;for(var d=0;d<c;d++){var T=h[d]={};if(s){var l=o.locations[d];T.loc=m(l)?l:null}else{var _=o.lon[d],w=o.lat[d];v(_)&&v(w)?T.lonlat=[+_,+w]:T.lonlat=[x,x]}}return M(h,o),A(n,o),e(h,o),c&&(h[0].t={labels:{lat:r(n,"lat:")+" ",lon:r(n,"lon:")+" "}}),h}}}),gx=Ze({"src/plots/geo/constants.js"(Z){"use strict";Z.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},Z.axesNames=["lonaxis","lataxis"],Z.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},Z.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},Z.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},Z.clipPad=.001,Z.precision=.1,Z.landColor="#F0DC82",Z.waterColor="#3399FF",Z.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},Z.sphereSVG={type:"Sphere"},Z.fillLayers={ocean:1,land:1,lakes:1},Z.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},Z.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],Z.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],Z.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}}),P5=Ze({"node_modules/topojson-client/dist/topojson-client.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z):(v=v||self,x(v.topojson=v.topojson||{}))})(Z,function(v){"use strict";function x(w){return w}function A(w){if(w==null)return x;var S,E,g=w.scale[0],b=w.scale[1],p=w.translate[0],u=w.translate[1];return function(y,f){f||(S=E=0);var P=2,L=y.length,z=new Array(L);for(z[0]=(S+=y[0])*g+p,z[1]=(E+=y[1])*b+u;P<L;)z[P]=y[P],++P;return z}}function M(w){var S=A(w.transform),E,g=1/0,b=g,p=-g,u=-g;function y(P){P=S(P),P[0]<g&&(g=P[0]),P[0]>p&&(p=P[0]),P[1]<b&&(b=P[1]),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;++L<z;)F=S(P[L],L),F[0]<g&&(g=F[0]),F[0]>p&&(p=F[0]),F[1]<b&&(b=F[1]),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;B<O;++B)z.push(E(F[B],B));L<0&&e(z,O)}function p(L){return E(L)}function u(L){for(var z=[],F=0,B=L.length;F<B;++F)b(L[F],z);return z.length<2&&z.push(z[0]),z}function y(L){for(var z=u(L);z.length<4;)z.push(z[0]);return z}function f(L){return L.map(y)}function P(L){var z=L.type,F;switch(z){case"GeometryCollection":return{type:z,geometries:L.geometries.map(P)};case"Point":F=p(L.coordinates);break;case"MultiPoint":F=L.coordinates.map(p);break;case"LineString":F=u(L.arcs);break;case"MultiLineString":F=L.arcs.map(u);break;case"Polygon":F=f(L.arcs);break;case"MultiPolygon":F=L.arcs.map(f);break;default:return null}return{type:z,coordinates:F}}return P(S)}function a(w,S){var E={},g={},b={},p=[],u=-1;S.forEach(function(P,L){var z=w.arcs[P<0?~P:P],F;z.length<3&&!z[1][0]&&!z[1][1]&&(F=S[++u],S[u]=P,S[L]=F)}),S.forEach(function(P){var L=y(P),z=L[0],F=L[1],B,O;if(B=b[z])if(delete b[B.end],B.push(P),B.end=F,O=g[F]){delete g[O.start];var I=O===B?B:B.concat(O);g[I.start=B.start]=b[I.end=O.end]=I}else g[B.start]=b[B.end]=B;else if(B=g[F])if(delete g[B.start],B.unshift(P),B.start=z,O=b[z]){delete b[O.end];var N=O===B?B:O.concat(B);g[N.start=O.start]=b[N.end=B.end]=N}else g[B.start]=b[B.end]=B;else B=[P],g[B.start=z]=b[B.end=F]=B});function y(P){var L=w.arcs[P<0?~P:P],z=L[0],F;return w.transform?(F=[0,0],L.forEach(function(B){F[0]+=B[0],F[1]+=B[1]})):F=L[L.length-1],P<0?[F,z]:[z,F]}function f(P,L){for(var z in P){var F=P[z];delete L[F.start],delete F.start,delete F.end,F.forEach(function(B){E[B<0?~B:B]=1}),p.push(F)}}return f(b,g),f(g,b),S.forEach(function(P){E[P<0?~P:P]||p.push([P])}),p}function n(w){return i(w,o.apply(this,arguments))}function o(w,S,E){var g,b,p;if(arguments.length>1)g=s(w,S,E);else for(b=0,g=new Array(p=w.arcs.length);b<p;++b)g[b]=b;return{type:"MultiLineString",arcs:a(w,g)}}function s(w,S,E){var g=[],b=[],p;function u(z){var F=z<0?~z:z;(b[F]||(b[F]=[])).push({i:z,g:p})}function y(z){z.forEach(u)}function f(z){z.forEach(y)}function P(z){z.forEach(f)}function L(z){switch(p=z,z.type){case"GeometryCollection":z.geometries.forEach(L);break;case"LineString":y(z.arcs);break;case"MultiLineString":case"Polygon":f(z.arcs);break;case"MultiPolygon":P(z.arcs);break}}return L(S),b.forEach(E==null?function(z){g.push(z[0].i)}:function(z){E(z[0].g,z[z.length-1].g)&&g.push(z[0].i)}),g}function c(w){for(var S=-1,E=w.length,g,b=w[E-1],p=0;++S<E;)g=b,b=w[S],p+=g[0]*b[1]-g[1]*b[0];return Math.abs(p)}function h(w){return i(w,m.apply(this,arguments))}function m(w,S){var E={},g=[],b=[];S.forEach(p);function p(f){switch(f.type){case"GeometryCollection":f.geometries.forEach(p);break;case"Polygon":u(f.arcs);break;case"MultiPolygon":f.arcs.forEach(u);break}}function u(f){f.forEach(function(P){P.forEach(function(L){(E[L=L<0?~L:L]||(E[L]=[])).push(f)})}),g.push(f)}function y(f){return c(i(w,{type:"Polygon",arcs:[f]}).coordinates[0])}return g.forEach(function(f){if(!f._){var P=[],L=[f];for(f._=1,b.push(P);f=L.pop();)P.push(f),f.forEach(function(z){z.forEach(function(F){E[F<0?~F:F].forEach(function(B){B._||(B._=1,L.push(B))})})})}}),g.forEach(function(f){delete f._}),{type:"MultiPolygon",arcs:b.map(function(f){var P=[],L;if(f.forEach(function(I){I.forEach(function(N){N.forEach(function(U){E[U<0?~U:U].length<2&&P.push(U)})})}),P=a(w,P),(L=P.length)>1)for(var z=1,F=y(P[0]),B,O;z<L;++z)(B=y(P[z]))>F&&(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<g;){var b=E+g>>>1;w[b]<S?E=b+1:g=b}return E}function T(w){var S={},E=w.map(function(){return[]});function g(I,N){I.forEach(function(U){U<0&&(U=~U);var W=S[U];W?W.push(N):S[U]=[N]})}function b(I,N){I.forEach(function(U){g(U,N)})}function p(I,N){I.type==="GeometryCollection"?I.geometries.forEach(function(U){p(U,N)}):I.type in u&&u[I.type](I.arcs,N)}var u={LineString:g,MultiLineString:b,Polygon:b,MultiPolygon:function(I,N){I.forEach(function(U){b(U,N)})}};w.forEach(p);for(var y in S)for(var f=S[y],P=f.length,L=0;L<P;++L)for(var z=L+1;z<P;++z){var F=f[L],B=f[z],O;(O=E[F])[y=d(O,B)]!==B&&O.splice(y,0,B),(O=E[B])[y=d(O,F)]!==F&&O.splice(y,0,F)}return E}function l(w){if(w==null)return x;var S,E,g=w.scale[0],b=w.scale[1],p=w.translate[0],u=w.translate[1];return function(y,f){f||(S=E=0);var P=2,L=y.length,z=new Array(L),F=Math.round((y[0]-p)/g),B=Math.round((y[1]-u)/b);for(z[0]=F-S,S=F,z[1]=B-E,E=B;P<L;)z[P]=y[P],++P;return z}}function _(w,S){if(w.transform)throw new Error("already quantized");if(!S||!S.scale){if(!((u=Math.floor(S))>=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);++N<W;)((Q=y(I[N],N))[0]||Q[1])&&(ue[U++]=Q);return U===1&&(ue[U++]=[0,0]),ue.length=U,ue}for(P in L)z[P]=B(L[P]);return{type:"Topology",bbox:f,transform:S,objects:z,arcs:w.arcs.map(O)}}v.bbox=M,v.feature=t,v.merge=h,v.mergeArcs=m,v.mesh=n,v.meshArcs=o,v.neighbors=T,v.quantize=_,v.transform=A,v.untransform=l,Object.defineProperty(v,"__esModule",{value:!0})})}}),iT=Ze({"src/lib/topojson_utils.js"(Z,q){"use strict";var v=q.exports={},x=gx().locationmodeToLayer,A=P5().feature;v.getTopojsonName=function(M){return[M.scope.replace(/ /g,"-"),"_",M.resolution.toString(),"m"].join("")},v.getTopojsonPath=function(M,e){return M+=M.endsWith("/")?"":"/",`${M}${e}.json`},v.getTopojsonFeatures=function(M,e){var t=x[M.locationmode],r=e.objects[t];return A(e,r).features}}}),dg=Ze({"src/lib/geojson_utils.js"(Z){"use strict";var q=Vs().BADNUM;Z.calcTraceToLineCoords=function(v){for(var x=v[0].trace,A=x.connectgaps,M=[],e=[],t=0;t<v.length;t++){var r=v[t],i=r.lonlat;i[0]!==q?e.push(i):!A&&e.length>0&&(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;A<v.length;A++)x[A]=[v[A]];return{type:"MultiPolygon",coordinates:x}},Z.makeBlank=function(){return{type:"Point",coordinates:[]}}}}),RU=Ze({"node_modules/country-regex/index.js"(Z,q){q.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xE7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xE9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xE9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xE3)o.?tom(e|\xE9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}}),oT=Ze({"node_modules/@turf/helpers/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=63710088e-1,v={centimeters:q*100,centimetres:q*100,degrees:360/(2*Math.PI),feet:q*3.28084,inches:q*39.37,kilometers:q/1e3,kilometres:q/1e3,meters:q,metres:q,miles:q/1609.344,millimeters:q*1e3,millimetres:q*1e3,nauticalmiles:q/1852,radians:1,yards:q*1.0936},x={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function A(L,z,F={}){let B={type:"Feature"};return(F.id===0||F.id)&&(B.id=F.id),F.bbox&&(B.bbox=F.bbox),B.properties=z||{},B.geometry=L,B}function M(L,z,F={}){switch(L){case"Point":return e(z).geometry;case"LineString":return a(z).geometry;case"Polygon":return r(z).geometry;case"MultiPoint":return c(z).geometry;case"MultiLineString":return s(z).geometry;case"MultiPolygon":return h(z).geometry;default:throw new Error(L+" is invalid")}}function e(L,z,F={}){if(!L)throw new Error("coordinates is required");if(!Array.isArray(L))throw new Error("coordinates must be an Array");if(L.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!u(L[0])||!u(L[1]))throw new Error("coordinates must contain numbers");return A({type:"Point",coordinates:L},z,F)}function t(L,z,F={}){return o(L.map(B=>e(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;I<O[O.length-1].length;I++)if(O[O.length-1][I]!==O[0][I])throw new Error("First and last Position are not equivalent.")}return A({type:"Polygon",coordinates:L},z,F)}function i(L,z,F={}){return o(L.map(B=>r(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;I<O;I++){y=F?l.features[I].geometry:B?l.geometry:l,L=y?y.type==="GeometryCollection":!1,p=L?y.geometries.length:1;for(var N=0;N<p;N++){var U=0,W=0;if(b=L?y.geometries[N]:y,b!==null){u=b.coordinates;var Q=b.type;switch(f=w&&(Q==="Polygon"||Q==="MultiPolygon")?1:0,Q){case null:break;case"Point":if(_(u,P,I,U,W)===!1)return!1;P++,U++;break;case"LineString":case"MultiPoint":for(S=0;S<u.length;S++){if(_(u[S],P,I,U,W)===!1)return!1;P++,Q==="MultiPoint"&&U++}Q==="LineString"&&U++;break;case"Polygon":case"MultiLineString":for(S=0;S<u.length;S++){for(E=0;E<u[S].length-f;E++){if(_(u[S][E],P,I,U,W)===!1)return!1;P++}Q==="MultiLineString"&&U++,Q==="Polygon"&&W++}Q==="Polygon"&&U++;break;case"MultiPolygon":for(S=0;S<u.length;S++){for(W=0,E=0;E<u[S].length;E++){for(g=0;g<u[S][E].length-f;g++){if(_(u[S][E][g],P,I,U,W)===!1)return!1;P++}W++}U++}break;case"GeometryCollection":for(S=0;S<b.geometries.length;S++)if(v(b.geometries[S],_,w)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function x(l,_,w,S){var E=w;return v(l,function(g,b,p,u,y){b===0&&w===void 0?E=g:E=_(E,g,b,p,u,y)},S),E}function A(l,_){var w;switch(l.type){case"FeatureCollection":for(w=0;w<l.features.length&&_(l.features[w].properties,w)!==!1;w++);break;case"Feature":_(l.properties,0);break}}function M(l,_,w){var S=w;return A(l,function(E,g){g===0&&w===void 0?S=E:S=_(S,E,g)}),S}function e(l,_){if(l.type==="Feature")_(l,0);else if(l.type==="FeatureCollection")for(var w=0;w<l.features.length&&_(l.features[w],w)!==!1;w++);}function t(l,_,w){var S=w;return e(l,function(E,g){g===0&&w===void 0?S=E:S=_(S,E,g)}),S}function r(l){var _=[];return v(l,function(w){_.push(w)}),_}function i(l,_){var w,S,E,g,b,p,u,y,f,P,L=0,z=l.type==="FeatureCollection",F=l.type==="Feature",B=z?l.features.length:1;for(w=0;w<B;w++){for(p=z?l.features[w].geometry:F?l.geometry:l,y=z?l.features[w].properties:F?l.properties:{},f=z?l.features[w].bbox:F?l.bbox:void 0,P=z?l.features[w].id:F?l.id:void 0,u=p?p.type==="GeometryCollection":!1,b=u?p.geometries.length:1,E=0;E<b;E++){if(g=u?p.geometries[E]:p,g===null){if(_(null,L,y,f,P)===!1)return!1;continue}switch(g.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(_(g,L,y,f,P)===!1)return!1;break}case"GeometryCollection":{for(S=0;S<g.geometries.length;S++)if(_(g.geometries[S],L,y,f,P)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}L++}}function a(l,_,w){var S=w;return i(l,function(E,g,b,p,u){g===0&&w===void 0?S=E:S=_(S,E,g,b,p,u)}),S}function n(l,_){i(l,function(w,S,E,g,b){var p=w===null?null:w.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return _(q.feature.call(void 0,w,E,{bbox:g,id:b}),S,0)===!1?!1:void 0}var u;switch(p){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var y=0;y<w.coordinates.length;y++){var f=w.coordinates[y],P={type:u,coordinates:f};if(_(q.feature.call(void 0,P,E),S,y)===!1)return!1}})}function o(l,_,w){var S=w;return n(l,function(E,g,b){g===0&&b===0&&w===void 0?S=E:S=_(S,E,g,b)}),S}function s(l,_){n(l,function(w,S,E){var g=0;if(w.geometry){var b=w.geometry.type;if(!(b==="Point"||b==="MultiPoint")){var p,u=0,y=0,f=0;if(v(w,function(P,L,z,F,B){if(p===void 0||S>u||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;p<b.length;p++)if(_(q.lineString.call(void 0,b[p],w.properties),S,E,p)===!1)return!1;break}}})}function m(l,_,w){var S=w;return h(l,function(E,g,b,p){g===0&&w===void 0?S=E:S=_(S,E,g,b,p)}),S}function d(l,_){if(_=_||{},!q.isObject.call(void 0,_))throw new Error("options is invalid");var w=_.featureIndex||0,S=_.multiFeatureIndex||0,E=_.geometryIndex||0,g=_.segmentIndex||0,b=_.properties,p;switch(l.type){case"FeatureCollection":w<0&&(w=l.features.length+w),b=b||l.features[w].properties,p=l.features[w].geometry;break;case"Feature":b=b||l.properties,p=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=l;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var u=p.coordinates;switch(p.type){case"Point":case"MultiPoint":return null;case"LineString":return g<0&&(g=u.length+g-1),q.lineString.call(void 0,[u[g],u[g+1]],b,_);case"Polygon":return E<0&&(E=u.length+E),g<0&&(g=u[E].length+g-1),q.lineString.call(void 0,[u[E][g],u[E][g+1]],b,_);case"MultiLineString":return S<0&&(S=u.length+S),g<0&&(g=u[S].length+g-1),q.lineString.call(void 0,[u[S][g],u[S][g+1]],b,_);case"MultiPolygon":return S<0&&(S=u.length+S),E<0&&(E=u[S].length+E),g<0&&(g=u[S][E].length-g-1),q.lineString.call(void 0,[u[S][E][g],u[S][E][g+1]],b,_)}throw new Error("geojson is invalid")}function T(l,_){if(_=_||{},!q.isObject.call(void 0,_))throw new Error("options is invalid");var w=_.featureIndex||0,S=_.multiFeatureIndex||0,E=_.geometryIndex||0,g=_.coordIndex||0,b=_.properties,p;switch(l.type){case"FeatureCollection":w<0&&(w=l.features.length+w),b=b||l.features[w].properties,p=l.features[w].geometry;break;case"Feature":b=b||l.properties,p=l.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":p=l;break;default:throw new Error("geojson is invalid")}if(p===null)return null;var u=p.coordinates;switch(p.type){case"Point":return q.point.call(void 0,u,b,_);case"MultiPoint":return S<0&&(S=u.length+S),q.point.call(void 0,u[S],b,_);case"LineString":return g<0&&(g=u.length+g),q.point.call(void 0,u[g],b,_);case"Polygon":return E<0&&(E=u.length+E),g<0&&(g=u[E].length+g),q.point.call(void 0,u[E][g],b,_);case"MultiLineString":return S<0&&(S=u.length+S),g<0&&(g=u[S].length+g),q.point.call(void 0,u[S][g],b,_);case"MultiPolygon":return S<0&&(S=u.length+S),E<0&&(E=u[S].length+E),g<0&&(g=u[S][E].length-g),q.point.call(void 0,u[S][E][g],b,_)}throw new Error("geojson is invalid")}Z.coordAll=r,Z.coordEach=v,Z.coordReduce=x,Z.featureEach=e,Z.featureReduce=t,Z.findPoint=T,Z.findSegment=d,Z.flattenEach=n,Z.flattenReduce=o,Z.geomEach=i,Z.geomReduce=a,Z.lineEach=h,Z.lineReduce=m,Z.propEach=A,Z.propReduce=M,Z.segmentEach=s,Z.segmentReduce=c}}),DU=Ze({"node_modules/@turf/area/dist/cjs/index.cjs"(Z){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var q=oT(),v=sT();function x(a){return v.geomReduce.call(void 0,a,(n,o)=>n+A(o),0)}function A(a){let n=0,o;switch(a.type){case"Polygon":return M(a.coordinates);case"MultiPolygon":for(o=0;o<a.coordinates.length;o++)n+=M(a.coordinates[o]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function M(a){let n=0;if(a&&a.length>0){n+=Math.abs(r(a[0]));for(let o=1;o<a.length;o++)n-=Math.abs(r(a[o]))}return n}var e=q.earthRadius*q.earthRadius/2,t=Math.PI/180;function r(a){let n=a.length-1;if(n<=2)return 0;let o=0,s=0;for(;s<n;){let c=a[s],h=a[s+1===n?0:s+1],m=a[s+2>=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]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}var x=v;Z.bbox=v,Z.default=x}}),vg=Ze({"src/lib/geo_location_utils.js"(Z,q){"use strict";var v=Oi(),x=RU(),{area:A}=DU(),{centroid:M}=zU(),{bbox:e}=FU(),t=S_(),r=Ym(),i=Xv(),a=b_(),n=P_(),o=Object.keys(x),s={"ISO-3":t,"USA-states":t,"country names":c};function c(S){for(var E=0;E<o.length;E++){var g=o[E],b=new RegExp(x[g]);if(b.test(S.trim().toLowerCase()))return g}return r.log("Unrecognized country name: "+S+"."),!1}function h(S,E,g){if(!E||typeof E!="string")return!1;var b=s[S](E),p,u,y;if(b){if(S==="USA-states")for(p=[],y=0;y<g.length;y++)u=g[y],u.properties&&u.properties.gu&&u.properties.gu==="USA"&&p.push(u);else p=g;for(y=0;y<p.length;y++)if(u=p[y],u.id===b)return u;r.log(["Location with id",b,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}function m(S){var E=S.geometry,g=E.coordinates,b=S.id,p=[],u,y,f,P;function L(z){for(var F=0;F<z.length-1;F++)if(z[F][0]>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;P<z.length;P++)F[P]=[z[P][0]<0?z[P][0]+360:z[P][0],z[P][1]];p.push(n.tester(F))}:b==="ATA"?u=function(z){var F=L(z);if(F===null)return p.push(n.tester(z));var B=new Array(z.length+1),O=0;for(P=0;P<z.length;P++)P>F?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;y<g.length;y++)for(f=0;f<g[y].length;f++)u(g[y][f]);break;case"Polygon":for(y=0;y<g.length;y++)u(g[y]);break}return p}function d(S){var E=S.geojson,g=window.PlotlyGeoAssets||{},b=typeof E=="string"?g[E]:E;return i(b)?b:(r.error("Oops ... something went wrong when fetching "+E),!1)}function T(S){var E=S[0].trace,g=d(E);if(!g)return!1;var b={},p=[],u;for(u=0;u<E._length;u++){var y=S[u];(y.loc||y.loc===0)&&(b[y.loc]=y)}function f(z){var F=a(z,E.featureidkey||"id").get(),B=b[F];if(B){var O=z.geometry;if(O.type==="Polygon"||O.type==="MultiPolygon"){var I={type:"Feature",id:F,geometry:O,properties:{}};I.geometry.coordinates.length>0?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;u<P.length;u++)f(P[u]);break;case"Feature":f(g);break;default:return r.warn(["Invalid GeoJSON type",(g.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var L in b)r.log(["Location *"+L+"*","does not have a matching feature with id-key","*"+E.featureidkey+"*."].join(" "));return p}function l(S){var E=S.geometry,g;if(E.type==="MultiPolygon")for(var b=E.coordinates,p=0,u=0;u<b.length;u++){var y={type:"Polygon",coordinates:b[u]},f=A(y);f>p&&(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<S.length;u++){var y=S[u][0].trace,f=y.geojson;typeof f=="string"&&(E[f]?E[f]==="pending"&&g.push(p(f)):(E[f]="pending",g.push(b(f))))}return g}function w(S){return e(S)}q.exports={locationToFeature:h,feature2polygons:m,getTraceGeojson:d,extractTraceFeature:T,fetchTraceGeoData:_,computeBbox:w}}}),I5=Ze({"src/traces/scattergeo/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=Yi(),M=ed(),e=M.stylePoints,t=M.styleText;q.exports=function(a,n){n&&r(a,n)};function r(i,a){var n=a[0].trace,o=a[0].node3;o.style("opacity",a[0].trace.opacity),e(o,n,i),t(o,n,i),o.selectAll("path.js-line").style("fill","none").each(function(s){var c=v.select(this),h=s.trace,m=h.line||{};c.call(A.stroke,m.color).call(x.dashLine,m.dash||"",m.width||0),h.fill!=="none"&&c.call(A.fill,h.fillcolor)})}}}),R5=Ze({"src/traces/scattergeo/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=iT().getTopojsonFeatures,M=dg(),e=vg(),t=Yd().findExtremes,r=Vs().BADNUM,i=Bd().calcMarkerSize,a=Fu(),n=I5(),o=["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" "),s=!0;function c(m,d,T){s&&(s=!1,x.warn(o));var l=d.layers.frontplot.select(".scatterlayer"),_=x.makeTraceGroups(l,T,"trace scattergeo");function w(S,E){S.lonlat[0]===r&&v.select(E).remove()}_.selectAll("*").remove(),_.each(function(S){var E=v.select(this),g=S[0].trace;if(a.hasLines(g)||g.fill!=="none"){var b=M.calcTraceToLineCoords(S),p=g.fill!=="none"?M.makePolygon(b):M.makeLine(b);E.selectAll("path.js-line").data([{geojson:p,trace:g}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}a.hasMarkers(g)&&E.selectAll("path.point").data(x.identity).enter().append("path").classed("point",!0).each(function(u){w(u,this)}),a.hasText(g)&&E.selectAll("g").data(x.identity).enter().append("g").append("text").each(function(u){w(u,this)}),n(m,S)})}function h(m,d){var T=m[0].trace,l=d[T.geo],_=l._subplot,w=T._length,S,E;if(x.isArrayOrTypedArray(T.locations)){var g=T.locationmode,b=g==="geojson-id"?e.extractTraceFeature(m):A(T,_.topojson);for(S=0;S<w;S++){E=m[S];var p=g==="geojson-id"?E.fOut:e.locationToFeature(g,E.loc,b);E.lonlat=p?p.properties.ct:[r,r]}}var u={padded:!0},y,f;if(l.fitbounds==="geojson"&&T.locationmode==="geojson-id"){var P=e.computeBbox(e.getTraceGeojson(T));y=[P[0],P[2]],f=[P[1],P[3]]}else{for(y=new Array(w),f=new Array(w),S=0;S<w;S++)E=m[S],y[S]=E.lonlat[0],f[S]=E.lonlat[1];u.ppad=i(T,w)}T._extremes.lon=t(l.lonaxis._ax,y,u),T._extremes.lat=t(l.lataxis._ax,f,u)}q.exports={calcGeoJSON:h,plot:c}}}),OU=Ze({"src/traces/scattergeo/hover.js"(Z,q){"use strict";var v=ef(),x=Vs().BADNUM,A=l1(),M=ca().fillText,e=d0();q.exports=function(i,a,n){var o=i.cd,s=o[0].trace,c=i.xa,h=i.ya,m=i.subplot,d=m.projection.isLonLatOverEdges,T=m.project;function l(p){var u=p.lonlat;if(u[0]===x||d(u))return 1/0;var y=T(u),f=T([a,n]),P=Math.abs(y[0]-f[0]),L=Math.abs(y[1]-f[1]),z=Math.max(3,p.mrc||0);return Math.max(Math.sqrt(P*P+L*L)-z,1-3/z)}if(v.getClosest(o,l,i),i.index!==!1){var _=o[i.index],w=_.lonlat,S=[c.c2p(w),h.c2p(w)],E=_.mrc||1;i.x0=S[0]-E,i.x1=S[0]+E,i.y0=S[1]-E,i.y1=S[1]+E,i.loc=_.loc,i.lon=w[0],i.lat=w[1];var g={};g[s.geo]={_subplot:m};var b=s._module.formatLabels(_,s,g);return i.lonLabel=b.lonLabel,i.latLabel=b.latLabel,i.color=A(s,_),i.extraText=t(s,_,i,o[0].t.labels),i.hovertemplate=s.hovertemplate,[i]}};function t(r,i,a,n){if(r.hovertemplate)return;var o=i.hi||r.hoverinfo,s=o==="all"?e.hoverinfo.flags:o.split("+"),c=s.indexOf("location")!==-1&&Array.isArray(r.locations),h=s.indexOf("lon")!==-1,m=s.indexOf("lat")!==-1,d=s.indexOf("text")!==-1,T=[];function l(_){return _+"\xB0"}return c?T.push(i.loc):h&&m?T.push("("+l(a.latLabel)+", "+l(a.lonLabel)+")"):h?T.push(n.lon+l(a.lonLabel)):m&&T.push(n.lat+l(a.latLabel)),d&&M(i,r,T),T.join("<br>")}}}),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;m<t.length;m++)t[m].selected=0;else for(m=0;m<t.length;m++)o=t[m],s=o.lonlat,s[0]!==x&&(c=r.c2p(s),h=i.c2p(s),e.contains([c,h],null,m,M)?(a.push({pointNumber:m,lon:s[0],lat:s[1]}),o.selected=1):o.selected=0);return a}}}),yx=Ze({"node_modules/d3-array/dist/d3-array.js"(Z,q){(function(v,x){x(typeof Z=="object"&&typeof q<"u"?Z:v.d3=v.d3||{})})(Z,function(v){"use strict";function x(J,X){return J<X?-1:J>X?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<j;){var ee=ne+j>>>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<j;){var ee=ne+j>>>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);oe<ne;)ee[oe]=X(j,j=J[++oe]);return ee}function a(J,X){return[J,X]}function n(J,X,oe){var ne=J.length,j=X.length,ee=new Array(ne*j),re,ce,be,Ae;for(oe==null&&(oe=a),re=be=0;re<ne;++re)for(Ae=J[re],ce=0;ce<j;++ce,++be)ee[be]=oe(Ae,X[ce]);return ee}function o(J,X){return X<J?-1:X>J?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(;++j<oe;)isNaN(re=s(J[j]))||(ce=re-ee,ee+=ce/++ne,be+=ce*(re-ee));else for(;++j<oe;)isNaN(re=s(X(J[j],j,J)))||(ce=re-ee,ee+=ce/++ne,be+=ce*(re-ee));if(ne>1)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<oe;)if((j=J[ne])!=null&&j>=j)for(ee=re=j;++ne<oe;)(j=J[ne])!=null&&(ee>j&&(ee=j),re<j&&(re=j))}else for(;++ne<oe;)if((j=X(J[ne],ne,J))!=null&&j>=j)for(ee=re=j;++ne<oe;)(j=X(J[ne],ne,J))!=null&&(ee>j&&(ee=j),re<j&&(re=j));return[ee,re]}var d=Array.prototype,T=d.slice,l=d.map;function _(J){return function(){return J}}function w(J){return J}function S(J,X,oe){J=+J,X=+X,oe=(j=arguments.length)<2?(X=J,J=0,1):j<3?1:+oe;for(var ne=-1,j=Math.max(0,Math.ceil((X-J)/oe))|0,ee=new Array(j);++ne<j;)ee[ne]=J+ne*oe;return ee}var E=Math.sqrt(50),g=Math.sqrt(10),b=Math.sqrt(2);function p(J,X,oe){var ne,j=-1,ee,re,ce;if(X=+X,J=+J,oe=+oe,J===X&&oe>0)return[J];if((ne=X<J)&&(ee=J,J=X,X=ee),(ce=u(J,X,oe))===0||!isFinite(ce))return[];if(ce>0)for(J=Math.ceil(J/ce),X=Math.floor(X/ce),re=new Array(ee=Math.ceil(X-J+1));++j<ee;)re[j]=(J+j)*ce;else for(J=Math.floor(J*ce),X=Math.ceil(X*ce),re=new Array(ee=Math.ceil(J-X+1));++j<ee;)re[j]=(J-j)/ce;return ne&&re.reverse(),re}function u(J,X,oe){var ne=(X-J)/Math.max(0,oe),j=Math.floor(Math.log(ne)/Math.LN10),ee=ne/Math.pow(10,j);return 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),X<J?-j:j}function f(J){return Math.ceil(Math.log(J.length)/Math.LN2)+1}function P(){var J=w,X=m,oe=f;function ne(j){var ee,re=j.length,ce,be=new Array(re);for(ee=0;ee<re;++ee)be[ee]=J(j[ee],ee,j);var Ae=X(be),ze=Ae[0],Re=Ae[1],We=oe(be,ze,Re);Array.isArray(We)||(We=y(ze,Re,We),We=S(Math.ceil(ze/We)*We,Re,We));for(var it=We.length;We[0]<=ze;)We.shift(),--it;for(;We[it-1]>Re;)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<it?We[ee]:Re;for(ee=0;ee<re;++ee)ce=be[ee],ze<=ce&&ce<=Re&&ot[t(We,ce,0,it)].push(j[ee]);return ot}return ne.value=function(j){return arguments.length?(J=typeof j=="function"?j:_(j),ne):J},ne.domain=function(j){return arguments.length?(X=typeof j=="function"?j:_([j[0],j[1]]),ne):X},ne.thresholds=function(j){return arguments.length?(oe=typeof j=="function"?j:Array.isArray(j)?_(T.call(j)):_(j),ne):oe},ne}function L(J,X,oe){if(oe==null&&(oe=s),!!(ne=J.length)){if((X=+X)<=0||ne<2)return+oe(J[0],0,J);if(X>=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<oe;)if((j=J[ne])!=null&&j>=j)for(ee=j;++ne<oe;)(j=J[ne])!=null&&j>ee&&(ee=j)}else for(;++ne<oe;)if((j=X(J[ne],ne,J))!=null&&j>=j)for(ee=j;++ne<oe;)(j=X(J[ne],ne,J))!=null&&j>ee&&(ee=j);return ee}function O(J,X){var oe=J.length,ne=oe,j=-1,ee,re=0;if(X==null)for(;++j<oe;)isNaN(ee=s(J[j]))?--ne:re+=ee;else for(;++j<oe;)isNaN(ee=s(X(J[j],j,J)))?--ne:re+=ee;if(ne)return re/ne}function I(J,X){var oe=J.length,ne=-1,j,ee=[];if(X==null)for(;++ne<oe;)isNaN(j=s(J[ne]))||ee.push(j);else for(;++ne<oe;)isNaN(j=s(X(J[ne],ne,J)))||ee.push(j);return L(ee.sort(x),.5)}function N(J){for(var X=J.length,oe,ne=-1,j=0,ee,re;++ne<X;)j+=J[ne].length;for(ee=new Array(j);--X>=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<oe;)if((j=J[ne])!=null&&j>=j)for(ee=j;++ne<oe;)(j=J[ne])!=null&&ee>j&&(ee=j)}else for(;++ne<oe;)if((j=X(J[ne],ne,J))!=null&&j>=j)for(ee=j;++ne<oe;)(j=X(J[ne],ne,J))!=null&&ee>j&&(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);++ne<oe;)(X(ee=J[ne],re)<0||X(re,re)!==0)&&(re=ee,j=ne);if(X(re,re)===0)return j}}function ue(J,X,oe){for(var ne=(oe??J.length)-(X=X==null?0:+X),j,ee;ne;)ee=Math.random()*ne--|0,j=J[ne+X],J[ne+X]=J[ee+X],J[ee+X]=j;return J}function se(J,X){var oe=J.length,ne=-1,j,ee=0;if(X==null)for(;++ne<oe;)(j=+J[ne])&&(ee+=j);else for(;++ne<oe;)(j=+X(J[ne],ne,J))&&(ee+=j);return ee}function he(J){if(!(ee=J.length))return[];for(var X=-1,oe=U(J,H),ne=new Array(oe);++X<oe;)for(var j=-1,ee,re=ne[X]=new Array(ee);++j<ee;)re[j]=J[j][X];return ne}function H(J){return J.length}function $(){return he(arguments)}v.bisect=t,v.bisectRight=t,v.bisectLeft=r,v.ascending=x,v.bisector=A,v.cross=n,v.descending=o,v.deviation=h,v.extent=m,v.histogram=P,v.thresholdFreedmanDiaconis=z,v.thresholdScott=F,v.thresholdSturges=f,v.max=B,v.mean=O,v.median=I,v.merge=N,v.min=U,v.pairs=i,v.permute=W,v.quantile=L,v.range=S,v.scan=Q,v.shuffle=ue,v.sum=se,v.ticks=p,v.tickIncrement=u,v.tickStep=y,v.transpose=he,v.variance=c,v.zip=$,Object.defineProperty(v,"__esModule",{value:!0})})}}),D5=Ze({"node_modules/d3-geo/dist/d3-geo.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,yx()):(v=v||self,x(v.d3=v.d3||{},v.d3))})(Z,function(v,x){"use strict";function A(){return new M}function M(){this.reset()}M.prototype={constructor:M,reset:function(){this.s=this.t=0},add:function(er){t(e,er,this.t),t(this,e.s,this.s),this.s?this.t+=e.t:this.s=e.t},valueOf:function(){return this.s}};var e=new M;function t(er,yr,ia){var $r=er.s=yr+ia,La=$r-yr,pn=$r-La;er.t=yr-pn+(ia-La)}var r=1e-6,i=1e-12,a=Math.PI,n=a/2,o=a/4,s=a*2,c=180/a,h=a/180,m=Math.abs,d=Math.atan,T=Math.atan2,l=Math.cos,_=Math.ceil,w=Math.exp,S=Math.log,E=Math.pow,g=Math.sin,b=Math.sign||function(er){return er>0?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<La;)z(ia[$r].geometry,yr)}},B={Sphere:function(er,yr){yr.sphere()},Point:function(er,yr){er=er.coordinates,yr.point(er[0],er[1],er[2])},MultiPoint:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)er=ia[$r],yr.point(er[0],er[1],er[2])},LineString:function(er,yr){O(er.coordinates,yr,0)},MultiLineString:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)O(ia[$r],yr,0)},Polygon:function(er,yr){I(er.coordinates,yr)},MultiPolygon:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)I(ia[$r],yr)},GeometryCollection:function(er,yr){for(var ia=er.geometries,$r=-1,La=ia.length;++$r<La;)z(ia[$r],yr)}};function O(er,yr,ia){var $r=-1,La=er.length-ia,pn;for(yr.lineStart();++$r<La;)pn=er[$r],yr.point(pn[0],pn[1],pn[2]);yr.lineEnd()}function I(er,yr){var ia=-1,$r=er.length;for(yr.polygonStart();++ia<$r;)O(er[ia],yr,1);yr.polygonEnd()}function N(er,yr){er&&F.hasOwnProperty(er.type)?F[er.type](er,yr):z(er,yr)}var U=A(),W=A(),Q,ue,se,he,H,$={point:L,lineStart:L,lineEnd:L,polygonStart:function(){U.reset(),$.lineStart=J,$.lineEnd=X},polygonEnd:function(){var er=+U;W.add(er<0?s+er:er),this.lineStart=this.lineEnd=this.point=L},sphere:function(){W.add(s)}};function J(){$.point=oe}function X(){ne(Q,ue)}function oe(er,yr){$.point=ne,Q=er,ue=yr,er*=h,yr*=h,se=er,he=l(yr=yr/2+o),H=g(yr)}function ne(er,yr){er*=h,yr*=h,yr=yr/2+o;var ia=er-se,$r=ia>=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]),yr<it&&(it=yr),yr>tt&&(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*ut<ri&&ri<Yn*er)?(di=pn[1]*c,di>tt&&(tt=di)):(ri=(ri+360)%360-180,Dn^(Yn*ut<ri&&ri<Yn*er)?(di=-pn[1]*c,di<it&&(it=di)):(yr<it&&(it=yr),yr>tt&&(tt=yr))),Dn?er<ut?wr(We,er)>wr(We,ot)&&(ot=er):wr(er,ot)>wr(We,ot)&&(We=er):ot>=We?(er<We&&(We=er),er>ot&&(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]);yr<it&&(it=yr),yr>tt&&(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]:yr<er[0]||er[1]<yr}function Be(er){var yr,ia,$r,La,pn,In,Yn;if(tt=ot=-(We=it=1/0),rt=[],N(er,Qe),ia=rt.length){for(rt.sort(Ir),yr=1,$r=rt[0],pn=[$r];yr<ia;++yr)La=rt[yr],bt($r,La[0])||bt($r,La[1])?(wr($r[0],La[1])>wr($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 La<i&&(yr=Te,ia=Pe,$r=at,Ue<r&&(yr=Ee,ia=Ve,$r=Ce),La=yr*yr+ia*ia+$r*$r,La<i)?[NaN,NaN]:[T(ia,yr)*c,f($r/p(La))*c]}function ta(er){return function(){return er}}function ma(er,yr){function ia($r,La){return $r=er($r,La),yr($r[0],$r[1])}return er.invert&&yr.invert&&(ia.invert=function($r,La){return $r=yr.invert($r,La),$r&&er.invert($r[0],$r[1])}),ia}function ra(er,yr){return[m(er)>a?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?La<pn:La>pn)&&(La+=$r*s));for(var di,Dn=La;$r>0?Dn>pn:Dn<pn;Dn-=ri)di=ee([In,-Yn*l(Dn),-Yn*g(Dn)]),er.point(di[0],di[1])}}function ct(er,yr){yr=re(yr),yr[0]-=er,Re(yr);var ia=y(-yr[1]);return((-yr[2]<0?-ia:ia)+s-r)%s}function Nr(){var er=ta([0,0]),yr=ta(90),ia=ta(6),$r,La,pn={point:In};function In(ri,di){$r.push(ri=La(ri,di)),ri[0]*=c,ri[1]*=c}function Yn(){var ri=er.apply(this,arguments),di=yr.apply(this,arguments)*h,Dn=ia.apply(this,arguments)*h;return $r=[],La=Ia(-ri[0]*h,-ri[1]*h,0).invert,xt(pn,di,Dn,1),ri={type:"Polygon",coordinates:[$r]},$r=La=null,ri}return Yn.center=function(ri){return arguments.length?(er=typeof ri=="function"?ri:ta([+ri[0],+ri[1]]),Yn):er},Yn.radius=function(ri){return arguments.length?(yr=typeof ri=="function"?ri:ta(+ri),Yn):yr},Yn.precision=function(ri){return arguments.length?(ia=typeof ri=="function"?ri:ta(+ri),Yn):ia},Yn}function Or(){var er=[],yr;return{point:function(ia,$r,La){yr.push([ia,$r,La])},lineStart:function(){er.push(yr=[])},lineEnd:L,rejoin:function(){er.length>1&&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])<r&&m(er[1]-yr[1])<r}function Lr(er,yr,ia,$r){this.x=er,this.z=yr,this.o=ia,this.e=$r,this.v=!1,this.n=this.p=null}function Gr(er,yr,ia,$r,La){var pn=[],In=[],Yn,ri;if(er.forEach(function(Mi){if(!((Ki=Mi.length-1)<=0)){var Ki,ao=Mi[0],Ji=Mi[Ki],co;if(Rr(ao,Ji)){if(!ao[2]&&!Ji[2]){for(La.lineStart(),Yn=0;Yn<Ki;++Yn)La.point((ao=Mi[Yn])[0],ao[1]);La.lineEnd();return}Ji[0]+=2*r}pn.push(co=new Lr(ao,Mi,null,!0)),In.push(co.o=new Lr(ao,null,co,!1)),pn.push(co=new Lr(Ji,Mi,null,!1)),In.push(co.o=new Lr(Ji,null,co,!0))}}),!!pn.length){for(In.sort(yr),Kr(pn),Kr(In),Yn=0,ri=In.length;Yn<ri;++Yn)In[Yn].e=ia=!ia;for(var di=pn[0],Dn,On;;){for(var qn=di,xn=!0;qn.v;)if((qn=qn.n)===di)return;Dn=qn.z,La.lineStart();do{if(qn.v=qn.o.v=!0,qn.e){if(xn)for(Yn=0,ri=Dn.length;Yn<ri;++Yn)La.point((On=Dn[Yn])[0],On[1]);else $r(qn.x,qn.n.x,1,La);qn=qn.n}else{if(xn)for(Dn=qn.p.z,Yn=Dn.length-1;Yn>=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<yr;)$r.n=La=er[ia],La.p=$r,$r=La;$r.n=La=er[0],La.p=$r}}var Ur=A();function aa(er){return m(er[0])<=a?er[0]:b(er[0])*((m(er[0])+a)%s-a)}function da(er,yr){var ia=aa(yr),$r=yr[1],La=g($r),pn=[g(ia),-l(ia),0],In=0,Yn=0;Ur.reset(),La===1?$r=n+r:La===-1&&($r=-n-r);for(var ri=0,di=er.length;ri<di;++ri)if(On=(Dn=er[ri]).length)for(var Dn,On,qn=Dn[On-1],xn=aa(qn),Mi=qn[1]/2+o,Ki=g(Mi),ao=l(Mi),Ji=0;Ji<On;++Ji,xn=wi,Ki=xo,ao=Qo,qn=co){var co=Dn[Ji],wi=aa(co),ui=co[1]/2+o,xo=g(ui),Qo=l(ui),xs=wi-xn,Qs=xs>=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||In<r&&Ur<-r)^Yn&1}function fa(er,yr,ia,$r){return function(La){var pn=yr(La),In=Or(),Yn=yr(In),ri=!1,di,Dn,On,qn={point:xn,lineStart:Ki,lineEnd:ao,polygonStart:function(){qn.point=Ji,qn.lineStart=co,qn.lineEnd=wi,Dn=[],di=[]},polygonEnd:function(){qn.point=xn,qn.lineStart=Ki,qn.lineEnd=ao,Dn=x.merge(Dn);var ui=da(di,$r);Dn.length?(ri||(La.polygonStart(),ri=!0),Gr(Dn,dr,ui,ia,La)):ui&&(ri||(La.polygonStart(),ri=!0),La.lineStart(),ia(null,null,1,La),La.lineEnd()),ri&&(La.polygonEnd(),ri=!1),Dn=di=null},sphere:function(){La.polygonStart(),La.lineStart(),ia(null,null,1,La),La.lineEnd(),La.polygonEnd()}};function xn(ui,xo){er(ui,xo)&&La.point(ui,xo)}function Mi(ui,xo){pn.point(ui,xo)}function Ki(){qn.point=Mi,pn.lineStart()}function ao(){qn.point=xn,pn.lineEnd()}function Ji(ui,xo){On.push([ui,xo]),Yn.point(ui,xo)}function co(){Yn.lineStart(),On=[]}function wi(){Ji(On[0][0],On[0][1]),Yn.lineEnd();var ui=Yn.clean(),xo=In.result(),Qo,xs=xo.length,Qs,Rs,Ks;if(On.pop(),di.push(On),On=null,!!xs){if(ui&1){if(Rs=xo[0],(Qs=Rs.length-1)>0){for(ri||(La.polygonStart(),ri=!0),La.lineStart(),Qo=0;Qo<Qs;++Qo)La.point((Ks=Rs[Qo])[0],Ks[1]);La.lineEnd()}return}xs>1&&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)<r?(er.point(yr,ia=(ia+In)/2>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&&(yr-=$r*r),m(pn-Yn)<r&&(pn-=Yn*r),ia=Ca(yr,ia,pn,In),er.point($r,ia),er.lineEnd(),er.lineStart(),er.point(Yn,ia),La=0),er.point(yr=pn,ia=In),$r=Yn},lineEnd:function(){er.lineEnd(),yr=ia=NaN},clean:function(){return 2-La}}}function Ca(er,yr,ia,$r){var La,pn,In=g(er-ia);return m(In)>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]<yr[0]?a:-a;La=ia*pn/2,$r.point(-pn,La),$r.point(0,La),$r.point(pn,La)}else $r.point(yr[0],yr[1])}function Ya(er){var yr=l(er),ia=6*h,$r=yr>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;Io<Ui&&(ou=Ui,Ui=Io,Io=ou);var Iu=Io-Ui,Zu=m(Iu-a)<r,Lc=Zu||Iu<r;if(!Zu&&Ls<Xs&&(ou=Xs,Xs=Ls,Ls=ou),Lc?Zu?Xs+Ls>0^sl[1]<(m(sl[0]-Ui)<r?Xs:Ls):Xs<=sl[1]&&sl[1]<=Ls:Iu>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(Mi<Dn)return;Mi<On&&(On=Mi)}else if(qn>0){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(Mi<Dn)return;Mi<On&&(On=Mi)}if(Mi=$r-Yn,!(!xn&&Mi>0)){if(Mi/=xn,xn<0){if(Mi<Dn)return;Mi<On&&(On=Mi)}else if(xn>0){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(Mi<Dn)return;Mi<On&&(On=Mi)}return Dn>0&&(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)<r?Dn>0?0:3:m(di[0]-ia)<r?Dn>0?2:1:m(di[1]-yr)<r?Dn>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<Xs;++Io)for(var Ls=xn[Io],ou=1,Iu=Ls.length,Zu=Ls[0],Lc,yu,Pc=Zu[0],wu=Zu[1];ou<Iu;++ou)Lc=Pc,yu=wu,Zu=Ls[ou],Pc=Zu[0],wu=Zu[1],yu<=$r?wu>$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;++$r<La;)if(Oo(ia[$r].geometry,yr))return!0;return!1}},Vo={Sphere:function(){return!0},Point:function(er,yr){return lo(er.coordinates,yr)},MultiPoint:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)if(lo(ia[$r],yr))return!0;return!1},LineString:function(er,yr){return Co(er.coordinates,yr)},MultiLineString:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)if(Co(ia[$r],yr))return!0;return!1},Polygon:function(er,yr){return os(er.coordinates,yr)},MultiPolygon:function(er,yr){for(var ia=er.coordinates,$r=-1,La=ia.length;++$r<La;)if(os(ia[$r],yr))return!0;return!1},GeometryCollection:function(er,yr){for(var ia=er.geometries,$r=-1,La=ia.length;++$r<La;)if(Oo(ia[$r],yr))return!0;return!1}};function Oo(er,yr){return er&&Vo.hasOwnProperty(er.type)?Vo[er.type](er,yr):!1}function lo(er,yr){return qi(er,yr)===0}function Co(er,yr){for(var ia,$r,La,pn=0,In=er.length;pn<In;pn++){if($r=qi(er[pn],yr),$r===0||pn>0&&(La=qi(er[pn],er[pn-1]),La>0&&ia<=La&&$r<=La&&(ia+$r-La)*(1-Math.pow((ia-$r)/La,2))<i*La))return!0;ia=$r}return!1}function os(er,yr){return!!da(er.map(Ys),Os(yr))}function Ys(er){return er=er.map(Os),er.pop(),er}function Os(er){return[er[0]*h,er[1]*h]}function Yo(er,yr){return(er&&To.hasOwnProperty(er.type)?To[er.type]:Oo)(er,yr)}function jn(er,yr,ia){var $r=x.range(er,yr-r,ia).concat(yr);return function(La){return $r.map(function(pn){return[La,pn]})}}function Ci(er,yr,ia){var $r=x.range(er,yr-r,ia).concat(yr);return function(La){return $r.map(function(pn){return[pn,La]})}}function tl(){var er,yr,ia,$r,La,pn,In,Yn,ri=10,di=ri,Dn=90,On=360,qn,xn,Mi,Ki,ao=2.5;function Ji(){return{type:"MultiLineString",coordinates:co()}}function co(){return x.range(_($r/Dn)*Dn,ia,Dn).map(Mi).concat(x.range(_(Yn/On)*On,In,On).map(Ki)).concat(x.range(_(yr/ri)*ri,er,ri).filter(function(wi){return m(wi%Dn)>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){er<fl&&(fl=er),er>zl&&(zl=er),yr<xu&&(xu=yr),yr>Ns&&(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)<r||m(pn-On)<r?(pn+On)/2:T(xo,ui),Ks=er(Rs,Qs),ys=Ks[0],Fl=Ks[1],yl=ys-$r,sl=Fl-La,Ui=co*yl-Ji*sl;(Ui*Ui/wi>yr||m((Ji*yl+co*sl)/wi-.5)>.3||In*qn+Yn*xn+ri*Mi<Cf)&&(ia($r,La,pn,In,Yn,ri,ys,Fl,Rs,ui/=xs,xo/=xs,Qo,Ki,ao),ao.point(ys,Fl),ia(ys,Fl,Rs,ui,xo,Qo,di,Dn,On,qn,xn,Mi,Ki,ao))}}return function($r){var La,pn,In,Yn,ri,di,Dn,On,qn,xn,Mi,Ki,ao={point:Ji,lineStart:co,lineEnd:ui,polygonStart:function(){$r.polygonStart(),ao.lineStart=xo},polygonEnd:function(){$r.polygonEnd(),ao.lineStart=co}};function Ji(Qs,Rs){Qs=er(Qs,Rs),$r.point(Qs[0],Qs[1])}function co(){On=NaN,ao.point=wi,$r.lineStart()}function wi(Qs,Rs){var Ks=re([Qs,Rs]),ys=er(Qs,Rs);ia(On,qn,Dn,xn,Mi,Ki,On=ys[0],qn=ys[1],Dn=Qs,xn=Ks[0],Mi=Ks[1],Ki=Ks[2],Gs,$r),$r.point(On,qn)}function ui(){ao.point=Ji,$r.lineEnd()}function xo(){co(),ao.point=Qo,ao.lineEnd=xs}function Qo(Qs,Rs){wi(La=Qs,Rs),pn=On,In=qn,Yn=xn,ri=Mi,di=Ki,ao.point=wi}function xs(){ia(On,qn,Dn,xn,Mi,Ki,pn,In,La,Yn,ri,di,Gs,$r),ao.lineEnd=ui,ui()}return ao}}var Kf=Gu({point:function(er,yr){this.stream.point(er*h,yr*h)}});function ku(er){return Gu({point:function(yr,ia){var $r=er(yr,ia);return this.stream.point($r[0],$r[1])}})}function Nf(er,yr,ia,$r,La){function pn(In,Yn){return In*=$r,Yn*=La,[yr+er*In,ia-er*Yn]}return pn.invert=function(In,Yn){return[(In-yr)/er*$r,(ia-Yn)/er*La]},pn}function ml(er,yr,ia,$r,La,pn){var In=l(pn),Yn=g(pn),ri=In*er,di=Yn*er,Dn=In/er,On=Yn/er,qn=(Yn*ia-In*yr)/er,xn=(Yn*yr+In*ia)/er;function Mi(Ki,ao){return Ki*=$r,ao*=La,[ri*Ki-di*ao+yr,ia-di*Ki-ri*ao]}return Mi.invert=function(Ki,ao){return[$r*(Dn*Ki-On*ao+qn),La*(xn-On*Ki-Dn*ao)]},Mi}function Lu(er){return Ac(function(){return er})()}function Ac(er){var yr,ia=150,$r=480,La=250,pn=0,In=0,Yn=0,ri=0,di=0,Dn,On=0,qn=1,xn=1,Mi=null,Ki=kr,ao=null,Ji,co,wi,ui=$s,xo=.5,Qo,xs,Qs,Rs,Ks;function ys(Ui){return Qs(Ui[0]*h,Ui[1]*h)}function Fl(Ui){return Ui=Qs.invert(Ui[0],Ui[1]),Ui&&[Ui[0]*c,Ui[1]*c]}ys.stream=function(Ui){return Rs&&Ks===Ui?Rs:Rs=Kf(ku(Dn)(Ki(Qo(ui(Ks=Ui)))))},ys.preclip=function(Ui){return arguments.length?(Ki=Ui,Mi=void 0,sl()):Ki},ys.postclip=function(Ui){return arguments.length?(ui=Ui,ao=Ji=co=wi=null,sl()):ui},ys.clipAngle=function(Ui){return arguments.length?(Ki=+Ui?Ya(Mi=Ui*h):(Mi=null,kr),sl()):Mi*c},ys.clipExtent=function(Ui){return arguments.length?(ui=Ui==null?(ao=Ji=co=wi=null,$s):Pn(ao=+Ui[0][0],Ji=+Ui[0][1],co=+Ui[1][0],wi=+Ui[1][1]),sl()):ao==null?null:[[ao,Ji],[co,wi]]},ys.scale=function(Ui){return arguments.length?(ia=+Ui,yl()):ia},ys.translate=function(Ui){return arguments.length?($r=+Ui[0],La=+Ui[1],yl()):[$r,La]},ys.center=function(Ui){return arguments.length?(pn=Ui[0]%360*h,In=Ui[1]%360*h,yl()):[pn*c,In*c]},ys.rotate=function(Ui){return arguments.length?(Yn=Ui[0]%360*h,ri=Ui[1]%360*h,di=Ui.length>2?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)<r)return dc(er);var La=1+ia*(2*$r-ia),pn=p(La)/$r;function In(Yn,ri){var di=p(La-2*$r*g(ri))/$r;return[di*g(Yn*=$r),pn-di*l(Yn)]}return In.invert=function(Yn,ri){var di=pn-ri,Dn=T(Yn,m(di))*b(di);return di*$r<0&&(Dn-=a*b(Yn)*b(di)),[Dn/$r,f((La-(Yn*Yn+di*di)*$r*$r)/(2*$r))]},In}function bu(){return il(vu).scale(155.424).center([0,33.6442])}function Ml(){return bu().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Uf(er){var yr=er.length;return{point:function(ia,$r){for(var La=-1;++La<yr;)er[La].point(ia,$r)},sphere:function(){for(var ia=-1;++ia<yr;)er[ia].sphere()},lineStart:function(){for(var ia=-1;++ia<yr;)er[ia].lineStart()},lineEnd:function(){for(var ia=-1;++ia<yr;)er[ia].lineEnd()},polygonStart:function(){for(var ia=-1;++ia<yr;)er[ia].polygonStart()},polygonEnd:function(){for(var ia=-1;++ia<yr;)er[ia].polygonEnd()}}}function Jf(){var er,yr,ia=Ml(),$r,La=bu().rotate([154,0]).center([-2,58.5]).parallels([55,65]),pn,In=bu().rotate([157,0]).center([-3,19.9]).parallels([8,18]),Yn,ri,di={point:function(qn,xn){ri=[qn,xn]}};function Dn(qn){var xn=qn[0],Mi=qn[1];return ri=null,$r.point(xn,Mi),ri||(pn.point(xn,Mi),ri)||(Yn.point(xn,Mi),ri)}Dn.invert=function(qn){var xn=ia.scale(),Mi=ia.translate(),Ki=(qn[0]-Mi[0])/xn,ao=(qn[1]-Mi[1])/xn;return(ao>=.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)return ol;function pn(In,Yn){var ri=La-Yn,di=$r*In;return[ri*g(di),La-ri*l(di)]}return pn.invert=function(In,Yn){var ri=La-Yn,di=T(In,m(ri))*b(ri);return ri*$r<0&&(di-=a*b(In)*b(ri)),[di/$r,La-b($r)*p(In*In+ri*ri)]},pn}function kf(){return il(Pu).scale(131.154).center([0,13.9389])}var hl=1.340264,sf=-.081106,Mc=893e-6,Hu=.003796,mf=p(3)/2,Wu=12;function Zc(er,yr){var ia=f(mf*g(yr)),$r=ia*ia,La=$r*$r*$r;return[er*l(ia)/(mf*(hl+3*sf*$r+La*(7*Mc+9*Hu*$r))),ia*(hl+sf*$r+La*(Mc+Hu*$r))]}Zc.invert=function(er,yr){for(var ia=yr,$r=ia*ia,La=$r*$r*$r,pn=0,In,Yn,ri;pn<Wu&&(Yn=ia*(hl+sf*$r+La*(Mc+Hu*$r))-yr,ri=hl+3*sf*$r+La*(7*Mc+9*Hu*$r),ia-=In=Yn/ri,$r=ia*ia,La=$r*$r*$r,!(m(In)<i));++pn);return[mf*er*(hl+3*sf*$r+La*(7*Mc+9*Hu*$r))/l(ia),f(g(ia)/mf)]};function Lf(){return Lu(Zc).scale(177.158)}function ru(er,yr){var ia=l(yr),$r=l(er)*ia;return[ia*g(er)/$r,g(yr)/$r]}ru.invert=Sc(d);function jf(){return Lu(ru).scale(144.049).clipAngle(60)}function Xu(){var er=1,yr=0,ia=0,$r=1,La=1,pn=0,In,Yn,ri=null,di,Dn,On,qn=1,xn=1,Mi=Gu({point:function(ui,xo){var Qo=wi([ui,xo]);this.stream.point(Qo[0],Qo[1])}}),Ki=$s,ao,Ji;function co(){return qn=er*$r,xn=er*La,ao=Ji=null,wi}function wi(ui){var xo=ui[0]*qn,Qo=ui[1]*xn;if(pn){var xs=Qo*In-xo*Yn;xo=xo*In+Qo*Yn,Qo=xs}return[xo+yr,Qo+ia]}return wi.invert=function(ui){var xo=ui[0]-yr,Qo=ui[1]-ia;if(pn){var xs=Qo*In+xo*Yn;xo=xo*In-Qo*Yn,Qo=xs}return[xo/qn,Qo/xn]},wi.stream=function(ui){return ao&&Ji===ui?ao:ao=Mi(Ki(Ji=ui))},wi.postclip=function(ui){return arguments.length?(Ki=ui,ri=di=Dn=On=null,co()):Ki},wi.clipExtent=function(ui){return arguments.length?(Ki=ui==null?(ri=di=Dn=On=null,$s):Pn(ri=+ui[0][0],di=+ui[0][1],Dn=+ui[1][0],On=+ui[1][1]),co()):ri==null?null:[[ri,di],[Dn,On]]},wi.scale=function(ui){return arguments.length?(er=+ui,co()):er},wi.translate=function(ui){return arguments.length?(yr=+ui[0],ia=+ui[1],co()):[yr,ia]},wi.angle=function(ui){return arguments.length?(pn=ui%360*h,Yn=g(pn),In=l(pn),co()):pn*c},wi.reflectX=function(ui){return arguments.length?($r=ui?-1:1,co()):$r<0},wi.reflectY=function(ui){return arguments.length?(La=ui?-1:1,co()):La<0},wi.fitExtent=function(ui,xo){return Hc(wi,ui,xo)},wi.fitSize=function(ui,xo){return Jl(wi,ui,xo)},wi.fitWidth=function(ui,xo){return Uc(wi,ui,xo)},wi.fitHeight=function(ui,xo){return Tc(wi,ui,xo)},wi}function Ec(er,yr){var ia=yr*yr,$r=ia*ia;return[er*(.8707-.131979*ia+$r*(-.013791+$r*(.003971*ia-.001529*$r))),yr*(1.007226+ia*(.015085+$r*(-.044475+.028874*ia-.005916*$r)))]}Ec.invert=function(er,yr){var ia=yr,$r=25,La;do{var pn=ia*ia,In=pn*pn;ia-=La=(ia*(1.007226+pn*(.015085+In*(-.044475+.028874*pn-.005916*In)))-yr)/(1.007226+pn*(.015085*3+In*(-.044475*7+.028874*9*pn-.005916*11*In)))}while(m(La)>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<E?[He,n(T(E+Je/2))]:[He*r(lt)*(2*b-1/d(lt)),m(Je)*(2*b*(lt-E)-n(T(lt/2)))]}ne.invert=function(He,Je){if((wt=M(Je))<oe)return[He,2*e(i(Je))-S];var lt=E,dt=25,Ct,wt;do{var Dt=r(lt/2),ur=T(lt/2);lt-=Ct=(X*(lt-E)-n(ur)-wt)/(X-Dt*Dt/(2*ur))}while(M(Ct)>_&&--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;Qr<He;++Qr,Oa-=ga,vn-=Sa)Br.point(t(Dt*r(vn),wt)*y,L(Dt*d(vn))*y),Oa<-90?(Br.point(-90,-180-Oa-Ct),Br.point(-90,-180-Oa+Ct)):(Br.point(90,Oa+Ct),Br.point(90,Oa-Ct));Br.lineEnd(),Br.polygonEnd()},Er},lt.scale(87.8076).center([0,17.1875]).clipAngle(180-.001)}function ce(He,Je){if(arguments.length<2&&(Je=He),Je===1)return x.geoAzimuthalEqualAreaRaw;if(Je===1/0)return be;function lt(dt,Ct){var wt=x.geoAzimuthalEqualAreaRaw(dt/Je,Ct);return wt[0]*=He,wt}return lt.invert=function(dt,Ct){var wt=x.geoAzimuthalEqualAreaRaw.invert(dt/He,Ct);return wt[0]*=Je,wt},lt}function be(He,Je){return[He*r(Je)/r(Je/=2),2*d(Je)]}be.invert=function(He,Je){var lt=2*L(Je/2);return[He*r(lt/2)/r(lt),lt]};function Ae(){var He=2,Je=x.geoProjectionMutator(ce),lt=Je(He);return lt.coefficient=function(dt){return arguments.length?Je(He=+dt):He},lt.scale(169.529)}function ze(He,Je,lt){var dt=100,Ct,wt,Dt;lt=lt===void 0?0:+lt,Je=+Je;do wt=He(lt),Dt=He(lt+l),wt===Dt&&(Dt=wt+l),lt-=Ct=-1*l*(wt-Je)/(wt-Dt);while(dt-- >0&&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;Br<Je;Br++){var Qr=He(wt,Dt),ga=Qr[0]-dt,Sa=Qr[1]-Ct;if(M(ga)<lt&&M(Sa)<lt)break;var Oa=ga*ga+Sa*Sa;if(Oa>ur){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)<lt&&M(Er)<lt)break}return[wt,Dt]}}function We(){var He=ce(1.68,2),Je=1.4,lt=12;function dt(Ct,wt){if(Ct+wt<-Je){var Dt=(Ct-wt+1.6)*(Ct+wt+Je)/8;Ct+=Dt,wt-=.8*Dt*d(wt+w/2)}var ur=He(Ct,wt),mr=(1-r(Ct*wt))/lt;return ur[1]<0&&(ur[0]*=1+mr),ur[1]>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)<l?[0,dt]:Ct&&[lt,dt]};function ta(){return x.geoProjection(Pr).scale(62.5271)}var ma=r(35*f);function ra(He,Je){var lt=T(Je/2);return[He*ma*F(1-lt*lt),(1+ma)*lt]}ra.invert=function(He,Je){var lt=Je/(1+ma);return[He&&He/(ma*F(1-lt*lt)),2*e(lt)]};function Ia(){return x.geoProjection(ra).scale(137.152)}function Ha(He,Je){var lt=Je/2,dt=r(lt);return[2*He/p*r(Je)*dt*dt,p*T(lt)]}Ha.invert=function(He,Je){var lt=e(Je/p),dt=r(lt),Ct=2*lt;return[He*p/2/(r(Ct)*dt*dt),Ct]};function rn(){return x.geoProjection(Ha).scale(135.264)}function nn(He){var Je=1-He,lt=wt(w,0)[0]-wt(-w,0)[0],dt=wt(0,S)[1]-wt(0,-S)[1],Ct=F(2*dt/lt);function wt(mr,Er){var Br=r(Er),Qr=d(Er);return[Br/(Je+He*Br)*mr,Je*Er+He*Qr]}function Dt(mr,Er){var Br=wt(mr,Er);return[Br[0]*Ct,Br[1]/Ct]}function ur(mr){return Dt(0,mr)[1]}return Dt.invert=function(mr,Er){var Br=ze(ur,Er),Qr=mr/Ct*(He+Je/r(Br));return[Qr,Br]},Dt}function yn(){var He=.5,Je=x.geoProjectionMutator(nn),lt=Je(He);return lt.alpha=function(dt){return arguments.length?Je(He=+dt):He},lt.scale(168.725)}function xt(He){return[He[0]/2,L(T(He[1]/2*f))*y]}function ct(He){return[He[0]*2,2*e(d(He[1]*f))*y]}function Nr(He){He==null&&(He=x.geoOrthographic);var Je=He(),lt=x.geoEquirectangular().scale(y).precision(0).clipAngle(null).translate([0,0]);function dt(wt){return Je(xt(wt))}Je.invert&&(dt.invert=function(wt){return ct(Je.invert(wt))}),dt.stream=function(wt){var Dt=Je.stream(wt),ur=lt.stream({point:function(mr,Er){Dt.point(mr/2,L(T(-Er/2*f))*y)},lineStart:function(){Dt.lineStart()},lineEnd:function(){Dt.lineEnd()},polygonStart:function(){Dt.polygonStart()},polygonEnd:function(){Dt.polygonEnd()}});return ur.sphere=Dt.sphere,ur};function Ct(wt){dt[wt]=function(){return arguments.length?(Je[wt].apply(Je,arguments),dt):Je[wt]()}}return dt.rotate=function(wt){return arguments.length?(lt.rotate(wt),dt):lt.rotate()},dt.center=function(wt){return arguments.length?(Je.center(xt(wt)),dt):ct(Je.center())},Ct("angle"),Ct("clipAngle"),Ct("clipExtent"),Ct("fitExtent"),Ct("fitHeight"),Ct("fitSize"),Ct("fitWidth"),Ct("scale"),Ct("translate"),Ct("precision"),dt.scale(249.5)}function Or(He,Je){var lt=2*w/Je,dt=He*He;function Ct(wt,Dt){var ur=x.geoAzimuthalEquidistantRaw(wt,Dt),mr=ur[0],Er=ur[1],Br=mr*mr+Er*Er;if(Br>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),mr<S&&(Er-=Xn*(mr-S));var Bi=d(Sa),Ao=r(Sa);ur[0]=mr*Ao-Er*Bi,ur[1]=mr*Bi+Er*Ao}return ur}return Ct.invert=function(wt,Dt){var ur=wt*wt+Dt*Dt;if(ur>dt){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=wt<S?1/0:0,Xn=10;;){var Hn=He*d(Oa),oi=He*r(Oa),Ti=d(oi),Wi=S-oi,Bi=(Hn-Oa*Ti)/Wi,Ao=Rr(Oa,Bi);if(M(vn)<_||!--Xn)break;Oa-=vn=(Oa*Sa-Bi*ga-Dt)/(Sa-ga*2*(Wi*(oi+Oa*Hn*r(oi)-Ti)-Hn*(Hn-Oa*Ti))/(Wi*Wi))}mr=He+Lr(Ao,oi,wt)*(w-He)/Lr(Ao,oi,w),Er=Br+Oa,wt=mr*r(Er),Dt=mr*d(Er)}return x.geoAzimuthalEquidistantRaw.invert(wt,Dt)},Ct}function Rr(He,Je){return function(lt){var dt=He*r(lt);return lt<S&&(dt-=Je),F(1+dt*dt)}}function Lr(He,Je,lt){for(var dt=50,Ct=(lt-Je)/dt,wt=He(Je)+He(lt),Dt=1,ur=Je;Dt<dt;++Dt)wt+=2*He(ur+=Ct);return wt*.5*Ct}function Gr(){var He=6,Je=30*f,lt=r(Je),dt=d(Je),Ct=x.geoProjectionMutator(Or),wt=Ct(Je,He),Dt=wt.stream,ur=.01,mr=-r(ur*f),Er=d(ur*f);return wt.radius=function(Br){return arguments.length?(lt=r(Je=Br*f),dt=d(Je),Ct(Je,He)):Je*y},wt.lobes=function(Br){return arguments.length?Ct(Je,He=+Br):He},wt.stream=function(Br){var Qr=wt.rotate(),ga=Dt(Br),Sa=(wt.rotate([0,0]),Dt(Br));return wt.rotate(Qr),ga.sphere=function(){Sa.polygonStart(),Sa.lineStart();for(var Oa=0,vn=2*w/He,Xn=0;Oa<He;++Oa,Xn-=vn)Sa.point(t(Er*r(Xn),mr)*y,L(Er*d(Xn))*y),Sa.point(t(dt*r(Xn-vn/2),lt)*y,L(dt*d(Xn-vn/2))*y);Sa.lineEnd(),Sa.polygonEnd()},ga},wt.rotate([90,-40]).scale(91.7095).clipAngle(180-.001)}function Kr(He,Je,lt,dt,Ct,wt,Dt,ur){arguments.length<8&&(ur=0);function mr(Er,Br){if(!Br)return[He*Er/w,0];var Qr=Br*Br,ga=He+Qr*(Je+Qr*(lt+Qr*dt)),Sa=Br*(Ct-1+Qr*(wt-ur+Qr*Dt)),Oa=(ga*ga+Sa*Sa)/(2*Sa),vn=Er*L(ga/Oa)/w;return[Oa*d(vn),Br*(1+Qr*ur)+Oa*(1-r(vn))]}return mr.invert=function(Er,Br){var Qr=w*Er/He,ga=Br,Sa,Oa,vn=50;do{var Xn=ga*ga,Hn=He+Xn*(Je+Xn*(lt+Xn*dt)),oi=ga*(Ct-1+Xn*(wt-ur+Xn*Dt)),Ti=Hn*Hn+oi*oi,Wi=2*oi,Bi=Ti/Wi,Ao=Bi*Bi,ss=L(Hn/Bi)/w,So=Qr*ss,Ko=Hn*Hn,hs=(2*Je+Xn*(4*lt+Xn*6*dt))*ga,ll=Ct+Xn*(3*wt+Xn*5*Dt),Js=2*(Hn*hs+oi*(ll-1)),es=2*(ll-1),ts=(Js*Wi-Ti*es)/(Wi*Wi),Pl=r(So),$l=d(So),Ru=Bi*Pl,hu=Bi*$l,wl=Qr/w*(1/F(1-Ko/Ao))*(hs*Bi-Hn*ts)/Ao,su=hu-Er,uc=ga*(1+Xn*ur)+Bi-Ru-Br,Vl=ts*$l+Ru*wl,ql=Ru*ss,de=1+ts-(ts*Pl-hu*wl),De=hu*ss,et=Vl*De-de*ql;if(!et)break;Qr-=Sa=(uc*Vl-su*de)/et,ga-=Oa=(su*De-uc*ql)/et}while((M(Sa)>l||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<w/4&&He>.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<l)return wt=d(He),dt=r(He),lt=Je*(He-wt*dt)/4,[wt-lt*dt,dt+lt*wt,1-Je*wt*wt/2,He-lt];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<Er;)Dt.point((Qr=mr[Br])[0],Qr[1]);for(Dt.lineEnd(),mr=wt.radius(90+ur)().coordinates[0],Er=mr.length-1,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)<ur?Xn+Wi:(Hn=Je+Qr*.5,oi=Is(He,Je,Hn,dt,ga,Ct,Oa,ur*.5,mr,Er+1,Br),isNaN(oi)?(Br.nanEncountered=!0,NaN):(Ti=Is(He,Hn,lt,Ct,Sa,wt,vn,ur*.5,mr,Er+1,Br),isNaN(Ti)?(Br.nanEncountered=!0,NaN):oi+Ti))}function rl(He,Je,lt,dt,Ct){var wt={maxDepthCount:0,nanEncountered:!1};dt===void 0&&(dt=1e-8),Ct===void 0&&(Ct=20);var Dt=He(Je),ur=He(.5*(Je+lt)),mr=He(lt),Er=(Dt+4*ur+mr)*(lt-Je)/6,Br=Is(He,Je,lt,Dt,ur,mr,Er,dt,Ct,1,wt);return Br}function Si(He,Je,lt){function dt(Sa){return He+(1-He)*c(1-c(Sa,Je),1/Je)}function Ct(Sa){return rl(dt,0,Sa,1e-4)}for(var wt=1/Ct(1),Dt=1e3,ur=(1+1e-8)*wt,mr=[],Er=0;Er<=Dt;Er++)mr.push(Ct(Er/Dt)*ur);function Br(Sa){var Oa=0,vn=Dt,Xn=Dt>>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])<l&&M(He[1]-Je[1])<l}function As(He,Je){for(var lt=-1,dt=He.length,Ct=He[0],wt,Dt,ur,mr=[];++lt<dt;){wt=He[lt],Dt=(wt[0]-Ct[0])/Je,ur=(wt[1]-Ct[1])/Je;for(var Er=0;Er<Je;++Er)mr.push([Ct[0]+Er*Dt,Ct[1]+Er*ur]);Ct=wt}return mr.push(wt),mr}function al(He){var Je=[],lt,dt,Ct,wt,Dt,ur,mr,Er=He[0].length;for(mr=0;mr<Er;++mr)lt=He[0][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,Ct+l],[dt+l,wt-l],[Dt-l,wt-l],[Dt-l,ur+l]],30));for(mr=He[1].length-1;mr>=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;ga<Sa&&mr>Qr[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;ga<Sa;++ga){var Oa=Br[ga];if(Oa[0][0]<=mr&&mr<Oa[1][0]&&Oa[0][1]<=Er&&Er<Oa[1][1]){var vn=He.invert(mr-He(Qr[ga][1][0],0)[0],Er);return vn[0]+=Qr[ga][1][0],ro(wt(vn[0],vn[1]),[mr,Er])?vn:null}}});var Dt=x.geoProjection(wt),ur=Dt.stream;return Dt.stream=function(mr){var Er=Dt.rotate(),Br=ur(mr),Qr=(Dt.rotate([0,0]),ur(mr));return Dt.rotate(Er),Br.sphere=function(){x.geoStream(dt,Qr)},Br},Dt.lobes=function(mr){return arguments.length?(dt=al(mr),Je=mr.map(function(Er){return Er.map(function(Br){return[[Br[0][0]*f,Br[0][1]*f],[Br[1][0]*f,Br[1][1]*f],[Br[2][0]*f,Br[2][1]*f]]})}),Ct=Je.map(function(Er){return Er.map(function(Br){var Qr=He(Br[0][0],Br[0][1])[0],ga=He(Br[2][0],Br[2][1])[0],Sa=He(Br[1][0],Br[0][1])[1],Oa=He(Br[1][0],Br[1][1])[1],vn;return Sa>Oa&&(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)<l)return[0,dt<0?-2:2];var Ct=d(dt),wt=c((1+Ct)/(1-Ct),He/2),Dt=.5*(wt+1/wt)+r(lt*=He);return[2*d(lt)/Dt,(wt-1/wt)/Dt]}return Je.invert=function(lt,dt){var Ct=M(dt);if(M(Ct-2)<l)return lt?null:[0,m(dt)*S];if(Ct>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;dt<Ll?wt*=dt/Ll:Ct+=6*z(Ll/dt);for(var Dt=0;Dt<25;Dt++){var ur=d(wt),mr=F(r(wt)),Er=d(wt/2),Br=r(wt/2),Qr=d(Ct/6),ga=r(Ct/6),Sa=.5*Ct*(1+mr)-lt,Oa=wt/(Br*ga)-dt,vn=mr?-.25*Ct*ur/mr:0,Xn=.5*(1+mr),Hn=(1+.5*wt*Er/Br)/(Br*ga),oi=wt/Br*(Qr/6)/(ga*ga),Ti=vn*oi-Hn*Xn,Wi=(Sa*oi-Oa*Xn)/Ti,Bi=(Oa*vn-Sa*Hn)/Ti;if(wt-=Wi,Ct-=Bi,M(Wi)<l&&M(Bi)<l)break}return[He<0?-Ct:Ct,Je<0?-wt:wt]};function Ou(){return x.geoProjection(nc).scale(97.2672)}function nl(He,Je){var lt=He*He,dt=Je*Je;return[He*(.975534+dt*(-.119161+lt*-.0143059+dt*-.0547009)),Je*(1.00384+lt*(.0802894+dt*-.02855+lt*199025e-9)+dt*(.0998909+dt*-.0491032))]}nl.invert=function(He,Je){var lt=m(He)*w,dt=Je/2,Ct=50;do{var wt=lt*lt,Dt=dt*dt,ur=lt*dt,mr=lt*(.975534+Dt*(-.119161+wt*-.0143059+Dt*-.0547009))-He,Er=dt*(1.00384+wt*(.0802894+Dt*-.02855+wt*199025e-9)+Dt*(.0998909+Dt*-.0491032))-Je,Br=.975534-Dt*(.119161+3*wt*.0143059+Dt*.0547009),Qr=-ur*(2*.119161+4*.0547009*Dt+2*.0143059*wt),ga=ur*(2*.0802894+4*199025e-9*wt+2*-.02855*Dt),Sa=1.00384+wt*(.0802894+199025e-9*wt)+Dt*(3*(.0998909-.02855*wt)-5*.0491032*Dt),Oa=Qr*ga-Sa*Br,vn=(Er*Qr-mr*Sa)/Oa,Xn=(mr*ga-Er*Br)/Oa;lt-=vn,dt-=Xn}while((M(vn)>l||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)<l?Ct*Je:M(ur=E+wt/2)<l||M(M(ur)-S)<l?0:Ct*Dt/n(T(ur)/lt);return[ur,Dt]}return dt.invert=function(Ct,wt){var Dt,ur=wt+He;return[M(wt)<l?Ct/Je:M(Dt=E+ur/2)<l||M(M(Dt)-S)<l?0:Ct*n(T(Dt)/lt)/wt,ur]},dt}function Nl(){return st(ic).parallel(40).scale(158.837)}function Vu(He,Je){return[He,1.25*n(T(E+.4*Je))]}Vu.invert=function(He,Je){return[He,2.5*e(i(.8*Je))-.625*w]};function cl(){return x.geoProjection(Vu).scale(108.318)}function yh(He){var Je=He.length-1;function lt(dt,Ct){for(var wt=r(Ct),Dt=2/(1+wt*r(dt)),ur=Dt*wt*d(dt),mr=Dt*d(Ct),Er=Je,Br=He[Er],Qr=Br[0],ga=Br[1],Sa;--Er>=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)<l));Ct++);return[He*(1+2*r(dt)/r(dt/2))/(3*b),2*F(3)*d(dt/2)/F(2+b)]}Ff.invert=function(He,Je){var lt=Je*F(2+b)/(2*F(3)),dt=2*L(lt);return[3*b*He/(1+2*r(dt)/r(dt/2)),L((lt+d(dt))/(1+g))]};function Of(){return x.geoProjection(Ff).scale(188.209)}function Gu(He,Je){for(var lt=F(6/(4+w)),dt=(1+w/4)*d(Je),Ct=Je/2,wt=0,Dt;wt<25&&(Ct-=Dt=(Ct/2+d(Ct)-dt)/(.5+r(Ct)),!(M(Dt)<l));wt++);return[lt*(.5+r(Ct))*He/1.5,lt*Ct]}Gu.invert=function(He,Je){var lt=F(6/(4+w)),dt=Je/lt;return M(M(dt)-S)<l&&(dt=dt<0?-S:S),[1.5*He/(lt*(.5+r(dt))),L((dt/2+d(dt))/(1+w/4))]};function Ef(){return x.geoProjection(Gu).scale(166.518)}function oc(He,Je){var lt=Je*Je,dt=lt*lt,Ct=lt*dt;return[He*(.84719-.13063*lt+Ct*Ct*(-.04515+.05494*lt-.02326*dt+.00331*Ct)),Je*(1.01183+dt*dt*(-.02625+.01926*lt-.00396*dt))]}oc.invert=function(He,Je){var lt=Je,dt=25,Ct,wt,Dt,ur;do wt=lt*lt,Dt=wt*wt,lt-=Ct=(lt*(1.01183+Dt*Dt*(-.02625+.01926*wt-.00396*Dt))-Je)/(1.01183+Dt*Dt*(9*-.02625+11*.01926*wt+13*-.00396*Dt));while(M(Ct)>_&&--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)return[He,0];var lt=T(Je),dt=He*d(Je);return[d(dt)/lt,Je+(1-r(dt))/lt]}bu.invert=function(He,Je){if(M(Je)<l)return[He,0];var lt=He*He+Je*Je,dt=Je*.5,Ct=10,wt;do{var Dt=T(dt),ur=1/r(dt),mr=lt-2*Je*dt+dt*dt;dt-=wt=(Dt*mr+2*(dt-Je))/(2+mr*ur*ur+2*(dt-Je)*Dt)}while(M(wt)>l&&--Ct>0);return Dt=T(dt),[(M(Je)<M(dt+1/Dt)?L(He*Dt):m(Je)*m(He)*(z(M(He*Dt))+S))/d(dt),dt]};function Ml(){return x.geoProjection(bu).scale(103.74)}function Uf(He,Je){var lt=Sc(He[1],He[0]),dt=Sc(Je[1],Je[0]),Ct=Lh(lt,dt),wt=vc(lt)/vc(dt);return Bu([1,0,He[0][0],0,1,He[0][1]],Bu([wt,0,0,0,wt,0],Bu([r(Ct),d(Ct),0,-d(Ct),r(Ct),0],[1,0,-Je[0][0],0,1,-Je[0][1]])))}function Jf(He){var Je=1/(He[0]*He[4]-He[1]*He[3]);return[Je*He[4],-Je*He[1],Je*(He[1]*He[5]-He[2]*He[4]),-Je*He[3],Je*He[0],Je*(He[2]*He[3]-He[0]*He[5])]}function Bu(He,Je){return[He[0]*Je[0]+He[1]*Je[3],He[0]*Je[1]+He[1]*Je[4],He[0]*Je[2]+He[1]*Je[5]+He[2],He[3]*Je[0]+He[4]*Je[3],He[3]*Je[1]+He[4]*Je[4],He[3]*Je[2]+He[4]*Je[5]+He[5]]}function Sc(He,Je){return[He[0]-Je[0],He[1]-Je[1]]}function vc(He){return F(He[0]*He[0]+He[1]*He[1])}function Lh(He,Je){return t(He[0]*Je[1]-He[1]*Je[0],He[0]*Je[0]+He[1]*Je[1])}function nf(He,Je,lt){dt(He,{transform:null});function dt(Er,Br){if(Er.edges=tu(Er.face),Br.face){var Qr=Er.shared=of(Er.face,Br.face),ga=Uf(Qr.map(Br.project),Qr.map(Er.project));Er.transform=Br.transform?Bu(Br.transform,ga):ga;for(var Sa=Br.edges,Oa=0,vn=Sa.length;Oa<vn;++Oa)Nu(Qr[0],Sa[Oa][1])&&Nu(Qr[1],Sa[Oa][0])&&(Sa[Oa]=Er),Nu(Qr[0],Sa[Oa][0])&&Nu(Qr[1],Sa[Oa][1])&&(Sa[Oa]=Er);for(Sa=Er.edges,Oa=0,vn=Sa.length;Oa<vn;++Oa)Nu(Qr[0],Sa[Oa][0])&&Nu(Qr[1],Sa[Oa][1])&&(Sa[Oa]=Br),Nu(Qr[0],Sa[Oa][1])&&Nu(Qr[1],Sa[Oa][0])&&(Sa[Oa]=Br)}else Er.transform=Br.transform;return Er.children&&Er.children.forEach(function(Xn){dt(Xn,Er)}),Er}function Ct(Er,Br){var Qr=Je(Er,Br),ga=Qr.project([Er*y,Br*y]),Sa;return(Sa=Qr.transform)?[Sa[0]*ga[0]+Sa[1]*ga[1]+Sa[2],-(Sa[3]*ga[0]+Sa[4]*ga[1]+Sa[5])]:(ga[1]=-ga[1],ga)}Xc(He)&&(Ct.invert=function(Er,Br){var Qr=wt(He,[Er,-Br]);return Qr&&(Qr[0]*=f,Qr[1]*=f,Qr)});function wt(Er,Br){var Qr=Er.project.invert,ga=Er.transform,Sa=Br;if(ga&&(ga=Jf(ga),Sa=[ga[0]*Sa[0]+ga[1]*Sa[1]+ga[2],ga[3]*Sa[0]+ga[4]*Sa[1]+ga[5]]),Qr&&Er===Dt(Oa=Qr(Sa)))return Oa;for(var Oa,vn=Er.children,Xn=0,Hn=vn&&vn.length;Xn<Hn;++Xn)if(Oa=wt(vn[Xn],Br))return Oa}function Dt(Er){return Je(Er[0]*f,Er[1]*f)}var ur=x.geoProjection(Ct),mr=ur.stream;return ur.stream=function(Er){var Br=ur.rotate(),Qr=mr(Er),ga=(ur.rotate([0,0]),mr(Er));return ur.rotate(Br),Qr.sphere=function(){ga.polygonStart(),ga.lineStart(),df(ga,He),ga.lineEnd(),ga.polygonEnd()},Qr},ur.angle(lt==null?-30:lt*y)}function df(He,Je,lt){var dt,Ct=Je.edges,wt=Ct.length,Dt,ur={type:"MultiPoint",coordinates:Je.face},mr=Je.face.filter(function(vn){return M(vn[1])!==90}),Er=x.geoBounds({type:"MultiPoint",coordinates:mr}),Br=!1,Qr=-1,ga=Er[1][0]-Er[0][0],Sa=ga===180||ga===360?[(Er[0][0]+Er[1][0])/2,(Er[0][1]+Er[1][1])/2]:x.geoCentroid(ur);if(lt)for(;++Qr<wt&&Ct[Qr]!==lt;);++Qr;for(var Oa=0;Oa<wt;++Oa)Dt=Ct[(Oa+Qr)%wt],Array.isArray(Dt)?(Br||(He.point((dt=x.geoInterpolate(Dt[0],Sa)(l))[0],dt[1]),Br=!0),He.point((dt=x.geoInterpolate(Dt[1],Sa)(l))[0],dt[1])):(Br=!1,Dt!==lt&&df(He,Dt,Je))}function Nu(He,Je){return He&&Je&&He[0]===Je[0]&&He[1]===Je[1]}function of(He,Je){for(var lt,dt,Ct=He.length,wt=null,Dt=0;Dt<Ct;++Dt){lt=He[Dt];for(var ur=Je.length;--ur>=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;Ct<Je;++Ct)lt.push([dt,dt=He[Ct]]);return lt}function Xc(He){return He.project.invert||He.children&&He.children.some(Xc)}var uh=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],vf=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(He){return He.map(function(Je){return uh[Je]})});function ol(He){He=He||function(lt){var dt=x.geoCentroid({type:"MultiPoint",coordinates:lt});return x.geoGnomonic().scale(1).translate([0,0]).rotate([-dt[0],-dt[1]])};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:lt<w/2?dt<0?3:1:dt<0?7:5]}).angle(-30).scale(101.858).center([0,45])}var mu=2/F(3);function Pu(He,Je){var lt=Ve(He,Je);return[lt[0]*mu,lt[1]]}Pu.invert=function(He,Je){return Ve.invert(He/mu,Je)};function kf(He){He=He||function(lt){var dt=x.geoCentroid({type:"MultiPoint",coordinates:lt});return x.geoProjection(Pu).translate([0,0]).scale(1).rotate(dt[1]>0?[-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:lt<w/2?dt<0?3:1:dt<0?7:5]}).angle(-30).scale(121.906).center([0,48.5904])}function hl(He){He=He||function(Dt){var ur=Dt.length===6?x.geoCentroid({type:"MultiPoint",coordinates:Dt}):Dt[0];return x.geoGnomonic().scale(1).translate([0,0]).rotate([-ur[0],-ur[1]])};var Je=vf.map(function(Dt){for(var ur=Dt.map(mf),mr=ur.length,Er=ur[mr-1],Br,Qr=[],ga=0;ga<mr;++ga)Br=ur[ga],Qr.push(Hu([Er[0]*.9486832980505138+Br[0]*.31622776601683794,Er[1]*.9486832980505138+Br[1]*.31622776601683794,Er[2]*.9486832980505138+Br[2]*.31622776601683794]),Hu([Br[0]*.9486832980505138+Er[0]*.31622776601683794,Br[1]*.9486832980505138+Er[1]*.31622776601683794,Br[2]*.9486832980505138+Er[2]*.31622776601683794])),Er=Br;return Qr}),lt=[],dt=[-1,0,0,1,0,1,4,5];Je.forEach(function(Dt,ur){for(var mr=vf[ur],Er=mr.length,Br=lt[ur]=[],Qr=0;Qr<Er;++Qr)Je.push([mr[Qr],Dt[(Qr*2+2)%(2*Er)],Dt[(Qr*2+1)%(2*Er)]]),dt.push(ur),Br.push(Mc(mf(Dt[(Qr*2+2)%(2*Er)]),mf(Dt[(Qr*2+1)%(2*Er)])))});var Ct=Je.map(function(Dt){return{project:He(Dt),face:Dt}});dt.forEach(function(Dt,ur){var mr=Ct[Dt];mr&&(mr.children||(mr.children=[])).push(Ct[ur])});function wt(Dt,ur){var mr=r(ur),Er=[mr*r(Dt),mr*d(Dt),d(ur)],Br=Dt<-w/2?ur<0?6:4:Dt<0?ur<0?2:0:Dt<w/2?ur<0?3:1:ur<0?7:5,Qr=lt[Br];return Ct[sf(Qr[0],Er)<0?8+3*Br:sf(Qr[1],Er)<0?8+3*Br+1:sf(Qr[2],Er)<0?8+3*Br+2:Br]}return nf(Ct[0],wt).angle(-30).scale(110.625).center([0,45])}function sf(He,Je){for(var lt=0,dt=He.length,Ct=0;lt<dt;++lt)Ct+=He[lt]*Je[lt];return Ct}function Mc(He,Je){return[He[1]*Je[2]-He[2]*Je[1],He[2]*Je[0]-He[0]*Je[2],He[0]*Je[1]-He[1]*Je[0]]}function Hu(He){return[t(He[1],He[0])*y,L(o(-1,s(1,He[2])))*y]}function mf(He){var Je=He[0]*f,lt=He[1]*f,dt=r(lt);return[dt*r(Je),dt*d(Je),d(lt)]}function Wu(){}function Zc(He){if((lt=He.length)<4)return!1;for(var Je=0,lt,dt=He[lt-1][1]*He[0][0]-He[lt-1][0]*He[0][1];++Je<lt;)dt+=He[Je-1][1]*He[Je][0]-He[Je-1][0]*He[Je][1];return dt<=0}function Lf(He,Je){for(var lt=Je[0],dt=Je[1],Ct=!1,wt=0,Dt=He.length,ur=Dt-1;wt<Dt;ur=wt++){var mr=He[wt],Er=mr[0],Br=mr[1],Qr=He[ur],ga=Qr[0],Sa=Qr[1];Br>dt^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)<S,Dt=He(wt?dt: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);Qr<Br;)ga[Qr]=Er[Qr],++Qr;return ga}function dt(Er){return Er.map(lt)}function Ct(Er){for(var Br=lt(Er[0]),Qr=[Br],ga=1;ga<Er.length;ga++){var Sa=lt(Er[ga]);(Sa.length>2||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)return[Je?2*e(Je*dt/2)/Je:dt,0];var wt=dt*dt+Ct*Ct,Dt=0,ur=10,mr;do{var Er=T(Dt),Br=1/r(Dt),Qr=wt-2*Ct*Dt+Dt*Dt;Dt-=mr=(Er*Qr+2*(Dt-Ct))/(2+Qr*Br*Br+2*(Dt-Ct)*Er)}while(M(mr)>l&&--ur>0);var ga=dt*(Er=T(Dt)),Sa=T(M(Ct)<M(Dt+1/Er)?L(ga)*.5:z(ga)*.5+w/4)/d(Dt);return[Je?2*e(Je*Sa)/Je:2*Sa,Dt]},lt}function La(){return st($r).scale(131.215)}var pn=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];pn.forEach(function(He){He[1]*=1.0144});function In(He,Je){var lt=s(18,M(Je)*36/w),dt=a(lt),Ct=lt-dt,wt=(Qr=pn[dt])[0],Dt=Qr[1],ur=(Qr=pn[++dt])[0],mr=Qr[1],Er=(Qr=pn[s(19,++dt)])[0],Br=Qr[1],Qr;return[He*(ur+Ct*(Er-wt)/2+Ct*Ct*(Er-2*ur+wt)/2),(Je>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<Ct;++dt){var wt=He[dt].slice();lt.push({index:-1,polygon:Je,ring:wt});for(var Dt=0,ur=wt.length;Dt<ur;++Dt){var mr=wt[Dt],Er=mr[0],Br=mr[1];if(Er<=Mi||Er>=ao||Br<=co||Br>=ui){wt[Dt]=Qs(mr);for(var Qr=Dt+1;Qr<ur;++Qr){var ga=wt[Qr],Sa=ga[0],Oa=ga[1];if(Sa>Mi&&Sa<ao&&Oa>co&&Oa<ui)break}if(Qr===Dt+1)continue;if(Dt){var vn={index:-1,polygon:Je,ring:wt.slice(0,Dt+1)};vn.ring[vn.ring.length-1]=xs(Br),lt[lt.length-1]=vn}else lt.pop();if(Qr>=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;Je<lt;++Je){if(wt=He[Je],Dt=wt.ring[0],mr=wt.ring[wt.ring.length-1],Dt[0]===mr[0]&&Dt[1]===mr[1]){wt.polygon.push(wt.ring),He[Je]=null;continue}wt.index=Je,dt[Dt]=Ct[mr]=wt}for(Je=0;Je<lt;++Je)if(wt=He[Je],wt){if(Dt=wt.ring[0],mr=wt.ring[wt.ring.length-1],ur=Ct[Dt],Er=dt[mr],delete dt[Dt],delete Ct[mr],Dt[0]===mr[0]&&Dt[1]===mr[1]){wt.polygon.push(wt.ring);continue}ur?(delete Ct[Dt],delete dt[ur.ring[0]],ur.ring.pop(),He[ur.index]=null,wt={index:-1,polygon:ur.polygon,ring:ur.ring.concat(wt.ring)},ur===Er?wt.polygon.push(wt.ring):(wt.index=lt++,He.push(dt[wt.ring[0]]=Ct[wt.ring[wt.ring.length-1]]=wt))):Er?(delete dt[mr],delete Ct[Er.ring[Er.ring.length-1]],wt.ring.pop(),wt={index:lt++,polygon:Er.polygon,ring:wt.ring.concat(Er.ring)},He[Er.index]=null,He.push(dt[wt.ring[0]]=Ct[wt.ring[wt.ring.length-1]]=wt)):(wt.ring.push(wt.ring[0]),wt.polygon.push(wt.ring))}}function Fl(He){var Je={type:"Feature",geometry:yl(He.geometry)};return He.id!=null&&(Je.id=He.id),He.bbox!=null&&(Je.bbox=He.bbox),He.properties!=null&&(Je.properties=He.properties),Je}function yl(He){if(He==null)return He;var Je,lt,dt,Ct;switch(He.type){case"GeometryCollection":Je={type:"GeometryCollection",geometries:He.geometries.map(yl)};break;case"Point":Je={type:"Point",coordinates:Qs(He.coordinates)};break;case"MultiPoint":case"LineString":Je={type:He.type,coordinates:Rs(He.coordinates)};break;case"MultiLineString":Je={type:"MultiLineString",coordinates:He.coordinates.map(Rs)};break;case"Polygon":{var wt=[];Ks(He.coordinates,wt,lt=[]),ys(lt),Je={type:"Polygon",coordinates:wt};break}case"MultiPolygon":{lt=[],dt=-1,Ct=He.coordinates.length;for(var Dt=new Array(Ct);++dt<Ct;)Ks(He.coordinates[dt],Dt[dt]=[],lt);ys(lt),Je={type:"MultiPolygon",coordinates:Dt.filter(xo)};break}default:return He}return He.bbox!=null&&(Je.bbox=He.bbox),Je}function sl(He){if(He==null)return He;switch(He.type){case"Feature":return Fl(He);case"FeatureCollection":{var Je={type:"FeatureCollection",features:He.features.map(Fl)};return He.bbox!=null&&(Je.bbox=He.bbox),Je}default:return yl(He)}}function Ui(He,Je){var lt=T(Je/2),dt=d(E*lt);return[He*(.74482-.34588*dt*dt),1.70711*lt]}Ui.invert=function(He,Je){var lt=Je/1.70711,dt=d(E*lt);return[He/(.74482-.34588*dt*dt),2*e(lt)]};function Io(){return x.geoProjection(Ui).scale(146.153)}function Xs(He,Je,lt){var dt=x.geoInterpolate(Je,lt),Ct=dt(.5),wt=x.geoRotation([-Ct[0],-Ct[1]])(Je),Dt=dt.distance/2,ur=-L(d(wt[1]*f)/d(Dt)),mr=[-Ct[0],-Ct[1],-(wt[0]>0?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)return[He,0];var lt=M(Je/S),dt=L(lt);if(M(He)<l||M(M(Je)-S)<l)return[0,m(Je)*w*T(dt/2)];var Ct=r(dt),wt=M(w/He-He/w)/2,Dt=wt*wt,ur=Ct/(lt+Ct-1),mr=ur*(2/lt-1),Er=mr*mr,Br=Er+Dt,Qr=ur-Er,ga=Dt+ur;return[m(He)*w*(wt*Qr+F(Dt*Qr*Qr-Br*(ur*ur-Er)))/Br,m(Je)*w*(mr*ga-wt*F((Dt+1)*Br-ga*ga))/Br]}Pc.invert=function(He,Je){if(M(Je)<l)return[He,0];if(M(He)<l)return[0,S*d(2*e(Je/w))];var lt=(He/=w)*He,dt=(Je/=w)*Je,Ct=lt+dt,wt=Ct*Ct,Dt=-M(Je)*(1+Ct),ur=Dt-2*dt+lt,mr=-2*Dt+1+2*dt+wt,Er=dt/mr+(2*ur*ur*ur/(mr*mr*mr)-9*Dt*ur/(mr*mr))/27,Br=(Dt-ur*ur/(3*mr))/mr,Qr=2*F(-Br/3),ga=z(3*Er/(Br*Qr))/3;return[w*(Ct-1+F(1+2*(lt-dt)+wt))/(2*He),m(Je)*w*(-Qr*r(ga+w/3)-ur/(3*mr))]};function wu(){return x.geoProjection(Pc).scale(79.4183)}function gc(He,Je){if(M(Je)<l)return[He,0];var lt=M(Je/S),dt=L(lt);if(M(He)<l||M(M(Je)-S)<l)return[0,m(Je)*w*T(dt/2)];var Ct=r(dt),wt=M(w/He-He/w)/2,Dt=wt*wt,ur=Ct*(F(1+Dt)-wt*Ct)/(1+Dt*lt*lt);return[m(He)*w*ur,m(Je)*w*F(1-ur*(2*wt+ur))]}gc.invert=function(He,Je){if(!He)return[0,S*d(2*e(Je/w))];var lt=M(He/w),dt=(1-lt*lt-(Je/=w)*Je)/(2*lt),Ct=dt*dt,wt=F(Ct+1);return[m(He)*w*(wt-dt),m(Je)*S*d(2*t(F((1-2*dt*lt)*(dt+wt)-lt),F(wt+dt+lt)))]};function fo(){return x.geoProjection(gc).scale(79.4183)}function zo(He,Je){if(M(Je)<l)return[He,0];var lt=Je/S,dt=L(lt);if(M(He)<l||M(M(Je)-S)<l)return[0,w*T(dt/2)];var Ct=(w/He-He/w)/2,wt=lt/(1+r(dt));return[w*(m(He)*F(Ct*Ct+1-wt*wt)-Ct),w*wt]}zo.invert=function(He,Je){if(!Je)return[He,0];var lt=Je/w,dt=(w*w*(1-lt*lt)-He*He)/(2*w*He);return[He?w*(m(He)*F(dt*dt+1)-dt):0,S*d(2*e(lt))]};function Ic(){return x.geoProjection(zo).scale(79.4183)}function lc(He,Je){if(!Je)return[He,0];var lt=M(Je);if(!He||lt===S)return[0,Je];var dt=lt/S,Ct=dt*dt,wt=(8*dt-Ct*(Ct+2)-5)/(2*Ct*(dt-1)),Dt=wt*wt,ur=dt*wt,mr=Ct+Dt+2*ur,Er=dt+3*wt,Br=He/S,Qr=Br+1/Br,ga=m(M(He)-S)*F(Qr*Qr-4),Sa=ga*ga,Oa=mr*(Ct+Dt*Sa-1)+(1-Ct)*(Ct*(Er*Er+4*Dt)+12*ur*Dt+4*Dt*Dt),vn=(ga*(mr+Dt-1)+2*F(Oa))/(4*mr+Sa);return[m(He)*S*vn,m(Je)*S*F(1+ga*M(vn)-vn*vn)]}lc.invert=function(He,Je){var lt;if(!He||!Je)return[He,Je];Je/=w;var dt=m(He)*He/S,Ct=(dt*dt-1+4*Je*Je)/M(dt),wt=Ct*Ct,Dt=2*Je,ur=50;do{var mr=Dt*Dt,Er=(8*Dt-mr*(mr+2)-5)/(2*mr*(Dt-1)),Br=(3*Dt-mr*Dt-10)/(2*mr*Dt),Qr=Er*Er,ga=Dt*Er,Sa=Dt+Er,Oa=Sa*Sa,vn=Dt+3*Er,Xn=Oa*(mr+Qr*wt-1)+(1-mr)*(mr*(vn*vn+4*Qr)+Qr*(12*ga+4*Qr)),Hn=-2*Sa*(4*ga*Qr+(1-4*mr+3*mr*mr)*(1+Br)+Qr*(-6+14*mr-wt+(-8+8*mr-2*wt)*Br)+ga*(-8+12*mr+(-10+10*mr-wt)*Br)),oi=F(Xn),Ti=Ct*(Oa+Qr-1)+2*oi-dt*(4*Oa+wt),Wi=Ct*(2*Er*Br+2*Sa*(1+Br))+Hn/oi-8*Sa*(Ct*(-1+Qr+Oa)+2*oi)*(1+Br)/(wt+4*Oa);Dt-=lt=Ti/Wi}while(lt>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;L<z;++L)P+=y[L]*f[L];return P}function p(y,f){return[y[1]*f[2]-y[2]*f[1],y[2]*f[0]-y[0]*f[2],y[0]*f[1]-y[1]*f[0]]}function u(y){for(var f=0,P=arguments.length,L=[];++f<P;)L.push(arguments[f]);var z=v.dispatch.apply(null,L);return z.of=function(F,B){return function(O){var I;try{I=O.sourceEvent=v.event,O.target=y,v.event=O,z[O.type].apply(F,B)}finally{v.event=I}}},z}}}),VU=Ze({"src/plots/geo/geo.js"(Z,q){"use strict";var v=Oi(),x=D5(),A=x.geoPath,M=x.geoDistance,e=UU(),t=oo(),r=ca(),i=r.strTranslate,a=Yi(),n=as(),o=ef(),s=xc(),c=Wo(),h=Yd().getAutoRange,m=bp(),d=Tf().prepSelect,T=Tf().clearOutline,l=Tf().selectOnClick,_=jU(),w=gx(),S=vg(),E=iT(),g=P5().feature;function b(P){this.id=P.id,this.graphDiv=P.graphDiv,this.container=P.container,this.topojsonURL=P.topojsonURL,this.isStatic=P.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var p=b.prototype;q.exports=function(L){return new b(L)},p.plot=function(P,L,z,F){var B=this;if(F)return B.update(P,L,!0);B._geoCalcData=P,B._fullLayout=L;var O=L[this.id],I=[],N=!1;for(var U in w.layerNameToAdjective)if(U!=="frame"&&O["show"+U]){N=!0;break}for(var W=!1,Q=0;Q<P.length;Q++){var ue=P[0][0].trace;ue._geo=B,ue.locationmode&&(N=!0);var se=ue.marker;if(se){var he=se.angle,H=se.angleref;(he||H==="north"||H==="previous")&&(W=!0)}}if(this._hasMarkerAngles=W,N){var $=E.getTopojsonName(O);(B.topojson===null||$!==B.topojsonName)&&(B.topojsonName=$,PlotlyGeoAssets.topojson[B.topojsonName]===void 0&&I.push(B.fetchTopojson()))}I=I.concat(S.fetchTraceGeoData(P)),z.push(new Promise(function(J,X){Promise.all(I).then(function(){B.topojson=PlotlyGeoAssets.topojson[B.topojsonName],B.update(P,L),J()}).catch(X)}))},p.fetchTopojson=function(){var P=this,L=E.getTopojsonPath(P.topojsonURL,P.topojsonName);return new Promise(function(z,F){v.json(L,function(B,O){if(B)return B.status===404?F(new Error(["plotly.js could not find topojson file at",L+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):F(new Error(["unexpected error while fetching topojson file at",L].join(" ")));PlotlyGeoAssets.topojson[P.topojsonName]=O,z()})})},p.update=function(P,L,z){var F=L[this.id];this.hasChoropleth=!1;for(var B=0;B<P.length;B++){var O=P[B],I=O[0].trace;I.type==="choropleth"&&(this.hasChoropleth=!0),I.visible===!0&&I._length>0&&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;W<N.length;W++){var Q=N[W];typeof O[Q]!="function"&&(O[Q]=U)}return O.isLonLatOverEdges=function(ue){if(O(ue)===null)return!0;if(I){var se=O.rotate(),he=M(ue,[-se[0],-se[1]]),H=I*Math.PI/180;return he>H}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;H<se;H++)for(var $=ue[H].x,J=he[H]=[],X=U[0];X<U[1]+B;X+=B)J.push(W($,X));return{type:"MultiLineString",coordinates:he}}function f(P,L){var z=w.clipPad,F=P[0]+z,B=P[1]-z,O=L[0]+z,I=L[1]-z;F>0&&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;u<t.length;u++){var y=t[u],f=[30,10][u],P;if(_)P=d[y+"Range"];else{var L=M[y+"Span"],z=(L[T]||L["*"])/2,F=n("projection.rotation."+y.substr(0,3),d.projRotate[u]);P=[F-z,F+z]}var B=n(y+".range",P);n(y+".tick0"),n(y+".dtick",f),p=n(y+".showgrid",b?void 0:!1),p&&(n(y+".gridcolor"),n(y+".gridwidth"),n(y+".griddash")),a[y]._ax={type:"linear",_id:y.slice(0,3),_traceIndices:c,setScale:v.identity,c2l:v.identity,r2l:v.identity,autorange:!0,range:B.slice(),_m:1,_input:{}}}var O=a.lonaxis.range,I=a.lataxis.range,N=O[0],U=O[1];N>0&&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<c.length;h++){var m=c[h],d=v(s,M,m),T=o[m],l=T._subplot;l||(l=A({id:m,graphDiv:n,container:o._geolayer.node(),topojsonURL:n._context.topojsonURL,staticPlot:n._context.staticPlot}),o[m]._subplot=l),l.plot(d,o,n._promises)}}function i(n,o,s,c){for(var h=c._subplots[M]||[],m=0;m<h.length;m++){var d=h[m],T=c[d]._subplot;!o[d]&&T&&(T.framework.remove(),T.clipDef.remove())}}function a(n){for(var o=n._fullLayout,s=o._subplots[M],c=0;c<s.length;c++){var h=o[s[c]],m=h._subplot;m.updateFx(o,h)}}q.exports={attr:M,name:M,idRoot:M,idRegex:e,attrRegex:e,attributes:t,layoutAttributes:z5(),supplyLayoutDefaults:qU(),plot:r,updateFx:a,clean:i}}}),GU=Ze({"src/traces/scattergeo/index.js"(Z,q){"use strict";q.exports={attributes:d0(),supplyDefaults:PU(),colorbar:hp(),formatLabels:IU(),calc:nT(),calcGeoJSON:R5().calcGeoJSON,plot:R5().plot,style:I5(),styleOnSelect:ed().styleOnSelect,hoverPoints:OU(),eventData:BU(),selectPoints:NU(),moduleType:"trace",name:"scattergeo",basePlotModule:F5(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}}),HU=Ze({"lib/scattergeo.js"(Z,q){"use strict";q.exports=GU()}}),C1=Ze({"src/traces/choropleth/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=d0(),A=Mu(),M=eu(),e=oh().defaultLine,t=rs().extendFlat,r=x.marker.line;q.exports=t({locations:{valType:"data_array",editType:"calc"},locationmode:x.locationmode,z:{valType:"data_array",editType:"calc"},geojson:t({},x.geojson,{}),featureidkey:x.featureidkey,text:t({},x.text,{}),hovertext:t({},x.hovertext,{}),marker:{line:{color:t({},r.color,{dflt:e}),width:t({},r.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:x.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:x.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:t({},M.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:v(),showlegend:t({},M.showlegend,{dflt:!1})},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),WU=Ze({"src/traces/choropleth/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=C1();q.exports=function(e,t,r,i){function a(d,T){return v.coerce(e,t,A,d,T)}var n=a("locations"),o=a("z");if(!(n&&n.length&&v.isArrayOrTypedArray(o)&&o.length)){t.visible=!1;return}t._length=Math.min(n.length,o.length);var s=a("geojson"),c;(typeof s=="string"&&s!==""||v.isPlainObject(s))&&(c="geojson-id");var h=a("locationmode",c);h==="geojson-id"&&a("featureidkey"),a("text"),a("hovertext"),a("hovertemplate");var m=a("marker.line.width");m&&a("marker.line.color"),a("marker.opacity"),x(e,t,i,a,{prefix:"",cLetter:"z"}),v.coerceSelectionMarkerOpacity(t,a)}}}),lT=Ze({"src/traces/choropleth/calc.js"(Z,q){"use strict";var v=is(),x=Vs().BADNUM,A=jp(),M=Av(),e=Od();function t(r){return r&&typeof r=="string"}q.exports=function(i,a){var n=a._length,o=new Array(n),s;a.geojson?s=function(T){return t(T)||v(T)}:s=t;for(var c=0;c<n;c++){var h=o[c]={},m=a.locations[c],d=a.z[c];s(m)&&v(d)?(h.loc=m,h.z=d):(h.loc=null,h.z=x),h.index=c}return M(o,a),A(i,a,{vals:a.z,containerStr:"",cLetter:"z"}),e(o,a),o}}}),uT=Ze({"src/traces/choropleth/style.js"(Z,q){"use strict";var v=Oi(),x=Yi(),A=as(),M=rc();function e(i,a){a&&t(i,a)}function t(i,a){var n=a[0].trace,o=a[0].node3,s=o.selectAll(".choroplethlocation"),c=n.marker||{},h=c.line||{},m=M.makeColorScaleFuncFromTrace(n);s.each(function(d){v.select(this).attr("fill",m(d.z)).call(x.stroke,d.mlc||h.color).call(A.dashLine,"",d.mlw||h.width||0).style("opacity",c.opacity)}),A.selectedPointStyle(s,n)}function r(i,a){var n=a[0].node3,o=a[0].trace;o.selectedpoints?A.selectedPointStyle(n.selectAll(".choroplethlocation"),o):t(i,a)}q.exports={style:e,styleOnSelect:r}}}),O5=Ze({"src/traces/choropleth/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=vg(),M=iT().getTopojsonFeatures,e=Yd().findExtremes,t=uT().style,r=["The library used by the *country names* `locationmode` option is changing in an upcoming version.","Country names in existing plots may not work in the new version."].join(" "),i=!0;function a(o,s,c){i&&(i=!1,x.warn(r));var h=s.layers.backplot.select(".choroplethlayer");x.makeTraceGroups(h,c,"trace choropleth").each(function(m){var d=v.select(this),T=d.selectAll("path.choroplethlocation").data(x.identity);T.enter().append("path").classed("choroplethlocation",!0),T.exit().remove(),t(o,m)})}function n(o,s){for(var c=o[0].trace,h=s[c.geo],m=h._subplot,d=c.locationmode,T=c._length,l=d==="geojson-id"?A.extractTraceFeature(o):M(c,m.topojson),_=[],w=[],S=0;S<T;S++){var E=o[S],g=d==="geojson-id"?E.fOut:A.locationToFeature(d,E.loc,l);if(g){E.geojson=g,E.ct=g.properties.ct,E._polygons=A.feature2polygons(g);var b=A.computeBbox(g);_.push(b[0],b[2]),w.push(b[1],b[3])}else E.geojson=null}if(h.fitbounds==="geojson"&&d==="geojson-id"){var p=A.computeBbox(A.getTraceGeojson(c));_=[p[0],p[2]],w=[p[1],p[3]]}var u={padded:!0};c._extremes.lon=e(h.lonaxis._ax,_,u),c._extremes.lat=e(h.lataxis._ax,w,u)}q.exports={calcGeoJSON:n,plot:a}}}),cT=Ze({"src/traces/choropleth/hover.js"(Z,q){"use strict";var v=Wo(),x=C1(),A=ca().fillText;q.exports=function(t,r,i){var a=t.cd,n=a[0].trace,o=t.subplot,s,c,h,m,d=[r,i],T=[r+360,i];for(c=0;c<a.length;c++)if(s=a[c],m=!1,s._polygons){for(h=0;h<s._polygons.length;h++)s._polygons[h].contains(d)&&(m=!m),s._polygons[h].contains(T)&&(m=!m);if(m)break}if(!(!m||!s))return t.x0=t.x1=t.xa.c2p(s.ct),t.y0=t.y1=t.ya.c2p(s.ct),t.index=s.index,t.location=s.loc,t.z=s.z,t.zLabel=v.tickText(o.mockAxis,o.mockAxis.c2l(s.z),"hover").text,t.hovertemplate=s.hovertemplate,M(t,n,s),[t]};function M(e,t,r){if(!t.hovertemplate){var i=r.hi||t.hoverinfo,a=String(r.loc),n=i==="all"?x.hoverinfo.flags:i.split("+"),o=n.indexOf("name")!==-1,s=n.indexOf("location")!==-1,c=n.indexOf("z")!==-1,h=n.indexOf("text")!==-1,m=!o&&s,d=[];m?e.nameOverride=a:(o&&(e.nameOverride=t.name),s&&d.push(a)),c&&d.push(e.zLabel),h&&A(r,t,d),e.extraText=d.join("<br>")}}}}),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<M.length;i++)M[i].selected=0;else for(i=0;i<M.length;i++)a=M[i],n=a.ct,n&&(o=e.c2p(n),s=t.c2p(n),A.contains([o,s],null,i,x)?(r.push({pointNumber:i,lon:n[0],lat:n[1]}),a.selected=1):a.selected=0);return r}}}),XU=Ze({"src/traces/choropleth/index.js"(Z,q){"use strict";q.exports={attributes:C1(),supplyDefaults:WU(),colorbar:ag(),calc:lT(),calcGeoJSON:O5().calcGeoJSON,plot:O5().plot,style:uT().style,styleOnSelect:uT().styleOnSelect,hoverPoints:cT(),eventData:fT(),selectPoints:hT(),moduleType:"trace",name:"choropleth",basePlotModule:F5(),categories:["geo","noOpacity","showLegend"],meta:{}}}}),ZU=Ze({"lib/choropleth.js"(Z,q){"use strict";q.exports=XU()}}),pT=Ze({"src/traces/scattergl/hover.js"(Z,q){"use strict";var v=oo(),x=ca(),A=l1();function M(t,r,i,a){var n=t.cd,o=n[0].t,s=n[0].trace,c=t.xa,h=t.ya,m=o.x,d=o.y,T=c.c2p(r),l=h.c2p(i),_=t.distance,w;if(o.tree){var S=c.p2c(T-_),E=c.p2c(T+_),g=h.p2c(l-_),b=h.p2c(l+_);a==="x"?w=o.tree.range(Math.min(S,E),Math.min(h._rl[0],h._rl[1]),Math.max(S,E),Math.max(h._rl[0],h._rl[1])):w=o.tree.range(Math.min(S,E),Math.min(g,b),Math.max(S,E),Math.max(g,b))}else w=o.ids;var p,u,y,f,P,L,z,F,B,O=_;if(a==="x"){var I=!!s.xperiodalignment,N=!!s.yperiodalignment;for(P=0;P<w.length;P++){if(p=w[P],y=m[p],L=Math.abs(c.c2p(y)-T),I){var U=c.c2p(s._xStarts[p]),W=c.c2p(s._xEnds[p]);L=T>=Math.min(U,W)&&T<=Math.max(U,W)?0:1/0}if(L<O){if(O=L,f=d[p],z=h.c2p(f)-l,N){var Q=h.c2p(s._yStarts[p]),ue=h.c2p(s._yEnds[p]);z=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),F<O&&(O=B=F,u=p);return t.index=u,t.distance=O,t.dxy=B,u===void 0?[t]:[e(t,m,d,s)]}function e(t,r,i,a){var n=t.xa,o=t.ya,s=t.distance,c=t.dxy,h=t.index,m={pointNumber:h,x:r[h],y:i[h]};m.tx=x.isArrayOrTypedArray(a.text)?a.text[h]:a.text,m.htx=Array.isArray(a.hovertext)?a.hovertext[h]:a.hovertext,m.data=Array.isArray(a.customdata)?a.customdata[h]:a.customdata,m.tp=Array.isArray(a.textposition)?a.textposition[h]:a.textposition;var d=a.textfont;d&&(m.ts=x.isArrayOrTypedArray(d.size)?d.size[h]:d.size,m.tc=x.isArrayOrTypedArray(d.color)?d.color[h]:d.color,m.tf=Array.isArray(d.family)?d.family[h]:d.family,m.tw=Array.isArray(d.weight)?d.weight[h]:d.weight,m.ty=Array.isArray(d.style)?d.style[h]:d.style,m.tv=Array.isArray(d.variant)?d.variant[h]:d.variant);var T=a.marker;T&&(m.ms=x.isArrayOrTypedArray(T.size)?T.size[h]:T.size,m.mo=x.isArrayOrTypedArray(T.opacity)?T.opacity[h]:T.opacity,m.mx=x.isArrayOrTypedArray(T.symbol)?T.symbol[h]:T.symbol,m.ma=x.isArrayOrTypedArray(T.angle)?T.angle[h]:T.angle,m.mc=x.isArrayOrTypedArray(T.color)?T.color[h]:T.color);var l=T&&T.line;l&&(m.mlc=Array.isArray(l.color)?l.color[h]:l.color,m.mlw=x.isArrayOrTypedArray(l.width)?l.width[h]:l.width);var _=T&&T.gradient;_&&_.type!=="none"&&(m.mgt=Array.isArray(_.type)?_.type[h]:_.type,m.mgc=Array.isArray(_.color)?_.color[h]:_.color);var w=n.c2p(m.x,!0),S=o.c2p(m.y,!0),E=m.mrc||1,g=a.hoverlabel;g&&(m.hbg=Array.isArray(g.bgcolor)?g.bgcolor[h]:g.bgcolor,m.hbc=Array.isArray(g.bordercolor)?g.bordercolor[h]:g.bordercolor,m.hts=x.isArrayOrTypedArray(g.font.size)?g.font.size[h]:g.font.size,m.htc=Array.isArray(g.font.color)?g.font.color[h]:g.font.color,m.htf=Array.isArray(g.font.family)?g.font.family[h]:g.font.family,m.hnl=x.isArrayOrTypedArray(g.namelength)?g.namelength[h]:g.namelength);var b=a.hoverinfo;b&&(m.hi=Array.isArray(b)?b[h]:b);var p=a.hovertemplate;p&&(m.ht=Array.isArray(p)?p[h]:p);var u={};u[t.index]=m;var y=a._origX,f=a._origY,P=x.extendFlat({},t,{color:A(a,m),x0:w-E,x1:w+E,xLabelVal:y?y[h]:m.x,y0:S-E,y1:S+E,yLabelVal:f?f[h]:m.y,cd:u,distance:s,spikeDistance:c,hovertemplate:m.ht});return m.htx?P.text=m.htx:m.tx?P.text=m.tx:a.text&&(P.text=a.text),x.fillText(m,a,P),v.getComponentMethod("errorbars","hoverInfo")(m,a,P),P}q.exports={hoverPoints:M,calcHover:e}}}),mg=Ze({"src/traces/scattergl/constants.js"(Z,q){"use strict";var v=20;q.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:v,SYMBOL_STROKE:v/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}}),_x=Ze({"src/traces/scattergl/attributes.js"(Z,q){"use strict";var v=eu(),x=tc(),A=$d(),M=tf(),e=Qc().axisHoverFormat,t=Mu(),r=Km(),i=rs().extendFlat,a=pc().overrideAll,n=mg().DASHES,o=M.line,s=M.marker,c=s.line,h=q.exports=a({x:M.x,x0:M.x0,dx:M.dx,y:M.y,y0:M.y0,dy:M.dy,xperiod:M.xperiod,yperiod:M.yperiod,xperiod0:M.xperiod0,yperiod0:M.yperiod0,xperiodalignment:M.xperiodalignment,yperiodalignment:M.yperiodalignment,xhoverformat:e("x"),yhoverformat:e("y"),text:M.text,hovertext:M.hovertext,textposition:M.textposition,textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:o.color,width:o.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:r(n),dflt:"solid"}},marker:i({},t("marker"),{symbol:s.symbol,angle:s.angle,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,opacity:s.opacity,colorbar:s.colorbar,line:i({},t("marker.line"),{width:c.width})}),connectgaps:M.connectgaps,fill:i({},M.fill,{dflt:"none"}),fillcolor:A(),selected:{marker:M.selected.marker,textfont:M.selected.textfont},unselected:{marker:M.unselected.marker,textfont:M.unselected.textfont},opacity:v.opacity},"calc","nested");h.x.editType=h.y.editType=h.x0.editType=h.y0.editType="calc+clearAxisTypes",h.hovertemplate=M.hovertemplate,h.texttemplate=M.texttemplate}}),dT=Ze({"src/traces/scattergl/helpers.js"(Z){"use strict";var q=mg();Z.isOpenSymbol=function(v){return typeof v=="string"?q.OPEN_RE.test(v):v%200>100},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<e.PTS_LINESONLY?"lines+markers":"lines";l("text"),l("hovertext"),l("hovertemplate"),l("mode",E),t.hasMarkers(m)&&(a(h,m,d,T,l,{noAngleRef:!0,noStandOff:!0}),l("marker.line.width",_||w?1:0)),t.hasLines(m)&&(l("connectgaps"),n(h,m,d,T,l),l("line.shape")),t.hasText(m)&&(l("texttemplate"),s(h,m,T,l,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var g=(m.line||{}).color,b=(m.marker||{}).color;l("fill"),m.fill!=="none"&&o(h,m,d,l);var p=x.getComponentMethod("errorbars","supplyDefaults");p(h,m,g||b||d,{axis:"y"}),p(h,m,g||b||d,{axis:"x",inherit:"y"}),v.coerceSelectionMarkerOpacity(m,l)}}}),KU=Ze({"src/traces/scattergl/format_labels.js"(Z,q){"use strict";var v=P2();q.exports=function(A,M,e){var t=A.i;return"x"in A||(A.x=M._x[t]),"y"in A||(A.y=M._y[t]),v(A,M,e)}}}),JU=Ze({"node_modules/binary-search-bounds/search-bounds.js"(Z,q){"use strict";function v(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 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;a<e.length;a++)n[e[a]]=!0;e=n}for(i in e)e[i]=x(e[i]);var o={};for(i in e){var s=e[i];if(Array.isArray(s))for(a=0;a<s.length;a++){var c=s[a];if(t&&(o[c]=!0),c in M){if(r[i]=M[c],t)for(var h=a;h<s.length;h++)o[s[h]]=!0;break}}else i in M&&(e[i]&&(r[i]=M[i]),t&&(o[i]=!0))}if(t)for(i in M)o[i]||(r[i]=M[i]);return r};var v={};function x(A){return v[A]?v[A]:(typeof A=="string"&&(A=v[A]=A.split(/\s*,\s*|\s+/)),A)}}}),k1=Ze({"node_modules/parse-rect/index.js"(Z,q){"use strict";var v=Ev();q.exports=x;function x(A){var M;return arguments.length>1&&(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;e<A;e++){for(var t=-1/0,r=1/0,i=e,a=x.length;i<a;i+=A)x[i]>t&&(t=x[i]),x[i]<r&&(r=x[i]);M[e]=r,M[A+e]=t}return M}}}),$U=Ze({"node_modules/defined/index.js"(Z,q){q.exports=function(){for(var v=0;v<arguments.length;v++)if(arguments[v]!==void 0)return arguments[v]}}}),m0=Ze({"node_modules/flatten-vertex-data/index.js"(Z,q){var v=Q3();q.exports=x;function x(A,M,e){if(!A)throw new TypeError("must specify data as first parameter");if(e=+(e||0)|0,Array.isArray(A)&&A[0]&&typeof A[0][0]=="number"){var t=A[0].length,r=A.length*t,i,a,n,o;(!M||typeof M=="string")&&(M=new(v(M||"float32"))(r+e));var s=M.length-e;if(r!==s)throw new Error("source length "+r+" ("+t+"x"+A.length+") does not match destination length "+s);for(i=0,n=e;i<A.length;i++)for(a=0;a<t;a++)M[n++]=A[i][a]===null?NaN:A[i][a]}else if(!M||typeof M=="string"){var c=v(M||"float32");if(Array.isArray(A)||M==="array")for(M=new c(A.length+e),i=0,n=e,o=M.length;n<o;n++,i++)M[n]=A[i]===null?NaN:A[i];else e===0?M=new c(A):(M=new c(A.length+e),M.set(A,e))}else M.set(A,e);return M}}}),QU=Ze({"node_modules/is-obj/index.js"(Z,q){"use strict";q.exports=function(v){var x=typeof v;return v!==null&&(x==="object"||x==="function")}}}),ej=Ze({"node_modules/math-log2/index.js"(Z,q){"use strict";q.exports=Math.log2||function(v){return Math.log(v)*Math.LOG2E}}}),tj=Ze({"node_modules/@plotly/point-cluster/quad.js"(Z,q){"use strict";var v=JU(),x=vx(),A=k1(),M=v0(),e=Ev(),t=$U(),r=m0(),i=QU(),a=Q3(),n=ej(),o=1073741824;q.exports=function(h,m){m||(m={}),h=r(h,"float64"),m=e(m,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let d=t(m.maxDepth,255),T=t(m.bounds,M(h,2));T[0]===T[2]&&T[2]++,T[1]===T[3]&&T[3]++;let l=s(h,T),_=h.length>>>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;L<S.length;L++){let z=S[L];if(w.set)w.set(z,p);else for(let B=0,O=z.length;B<O;B++)w[B+p]=z[B];let F=p+S[L].length;b[L]=[p,F],p=F}return w.range=y,w;function u(L,z,F,B,O,I){if(!B.length)return null;let N=S[O]||(S[O]=[]),U=g[O]||(g[O]=[]),W=E[O]||(E[O]=[]),Q=N.length;if(O++,O>d||I>o){for(let oe=0;oe<B.length;oe++)N.push(B[oe]),U.push(I),W.push(null,null,null,null);return Q}if(N.push(B[0]),U.push(I),B.length<=1)return W.push(null,null,null,null),Q;let ue=F*.5,se=L+ue,he=z+ue,H=[],$=[],J=[],X=[];for(let oe=1,ne=B.length;oe<ne;oe++){let j=B[oe],ee=l[j*2],re=l[j*2+1];ee<se?re<he?H.push(j):$.push(j):re<he?J.push(j):X.push(j)}return I<<=2,W.push(u(L,z,ue,H,O,I),u(L,he,ue,$,O,I+1),u(se,z,ue,J,O,I+2),u(se,he,ue,X,O,I+3)),Q}function y(...L){let z;if(i(L[L.length-1])){let J=L.pop();!L.length&&(J.x!=null||J.l!=null||J.left!=null)&&(L=[J],z={}),z=e(J,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else z={};L.length||(L=T);let F=A(...L),[B,O,I,N]=[Math.min(F.x,F.x+F.width),Math.min(F.y,F.y+F.height),Math.max(F.x,F.x+F.width),Math.max(F.y,F.y+F.height)],[U,W,Q,ue]=s([B,O,I,N],T),se=t(z.level,S.length);if(z.d!=null){let J;typeof z.d=="number"?J=[z.d,z.d]:z.d.length&&(J=z.d),se=Math.min(Math.max(Math.ceil(-n(Math.abs(J[0])/(T[2]-T[0]))),Math.ceil(-n(Math.abs(J[1])/(T[3]-T[1])))),se)}if(se=Math.min(se,S.length),z.lod)return f(U,W,Q,ue,se);let he=[];H(0,0,1,0,0,1);function H(J,X,oe,ne,j,ee){if(j===null||ee===null)return;let re=J+oe,ce=X+oe;if(U>re||W>ce||Q<J||ue<X||ne>=se||j===ee)return;let be=S[ne];ee===void 0&&(ee=be.length);for(let Me=j;Me<ee;Me++){let _e=be[Me],fe=h[_e*2],Fe=h[_e*2+1];fe>=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;N<O;N++){let U=g[N],W=b[N][0],Q=P(L,z,N),ue=P(F,B,N),se=v.ge(U,Q),he=v.gt(U,ue,se,U.length-1);I[N]=[se+W,he+W]}return I}function P(L,z,F){let B=1,O=.5,I=.5,N=.5;for(let U=0;U<F;U++)B<<=2,B+=L<O?z<I?0:1:z<I?2:3,N*=.5,O+=L<O?-N:N,I+=z<I?-N:N;return B}};function s(c,h){let[m,d,T,l]=h,_=1/(T-m),w=1/(l-d),S=new Array(c.length);for(let E=0,g=c.length/2;E<g;E++)S[2*E]=x((c[2*E]-m)*_,0,1),S[2*E+1]=x((c[2*E+1]-d)*w,0,1);return S}}}),vT=Ze({"node_modules/@plotly/point-cluster/index.js"(Z,q){"use strict";q.exports=tj()}}),B5=Ze({"node_modules/abs-svg-path/index.js"(Z,q){q.exports=v;function v(x){var A=0,M=0,e=0,t=0;return x.map(function(r){r=r.slice();var i=r[0],a=i.toUpperCase();if(i!=a)switch(r[0]=a,i){case"a":r[6]+=e,r[7]+=t;break;case"v":r[1]+=t;break;case"h":r[1]+=e;break;default:for(var n=1;n<r.length;)r[n++]+=e,r[n++]+=t}switch(a){case"Z":e=A,t=M;break;case"H":e=r[1];break;case"V":t=r[1];break;case"M":e=A=r[1],t=M=r[2];break;default:e=r[r.length-2],t=r[r.length-1]}return r})}}}),rj=Ze({"node_modules/svg-arc-to-cubic-bezier/cjs/index.js"(Z,q){"use strict";Object.defineProperty(Z,"__esModule",{value:!0});var v=function(){function i(a,n){var o=[],s=!0,c=!1,h=void 0;try{for(var m=a[Symbol.iterator](),d;!(s=(d=m.next()).done)&&(o.push(d.value),!(n&&o.length===n));s=!0);}catch(T){c=!0,h=T}finally{try{!s&&m.return&&m.return()}finally{if(c)throw h}}return o}return function(a,n){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a))return i(a,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),x=Math.PI*2,A=function(a,n,o,s,c,h,m){var d=a.x,T=a.y;d*=n,T*=o;var l=s*d-c*T,_=c*d+s*T;return{x:l+h,y:_+m}},M=function(a,n){var o=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),s=Math.cos(a),c=Math.sin(a),h=Math.cos(a+n),m=Math.sin(a+n);return[{x:s-c*o,y:c+s*o},{x:h+m*o,y:m-h*o},{x:h,y:m}]},e=function(a,n,o,s){var c=a*s-n*o<0?-1:1,h=a*o+n*s;return h>1&&(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;N<I;N++)E.push(M(F,B)),F+=B;return E.map(function(U){var W=A(U[0],h,m,b,g,L,z),Q=W.x,ue=W.y,se=A(U[1],h,m,b,g,L,z),he=se.x,H=se.y,$=A(U[2],h,m,b,g,L,z),J=$.x,X=$.y;return{x1:Q,y1:ue,x2:he,y2:H,x:J,y:X}})};Z.default=r,q.exports=Z.default}}),aj=Ze({"node_modules/svg-path-bounds/node_modules/normalize-svg-path/index.js"(Z,q){"use strict";q.exports=x;var v=rj();function x(e){for(var t,r=[],i=0,a=0,n=0,o=0,s=null,c=null,h=0,m=0,d=0,T=e.length;d<T;d++){var l=e[d],_=l[0];switch(_){case"M":n=l[1],o=l[2];break;case"A":var w=v({px:h,py:m,cx:l[6],cy:l[7],rx:l[1],ry:l[2],xAxisRotation:l[3],largeArcFlag:l[4],sweepFlag:l[5]});if(!w.length)continue;for(var S=0,E;S<w.length;S++)E=w[S],l=["C",E.x1,E.y1,E.x2,E.y2,E.x,E.y],S<w.length-1&&r.push(l);break;case"S":var g=h,b=m;(t=="C"||t=="S")&&(g+=g-i,b+=b-a),l=["C",g,b,l[1],l[2],l[3],l[4]];break;case"T":t=="Q"||t=="T"?(s=h*2-s,c=m*2-c):(s=h,c=m),l=M(h,m,s,c,l[1],l[2]);break;case"Q":s=l[1],c=l[2],l=M(h,m,l[1],l[2],l[3],l[4]);break;case"L":l=A(h,m,l[1],l[2]);break;case"H":l=A(h,m,l[1],m);break;case"V":l=A(h,m,h,l[1]);break;case"Z":l=A(h,m,n,o);break}t=_,h=l[l.length-2],m=l[l.length-1],l.length>4?(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;a<n;a++)for(var o=r[a].slice(1),s=0;s<o.length;s+=2)o[s+0]<i[0]&&(i[0]=o[s+0]),o[s+1]<i[1]&&(i[1]=o[s+1]),o[s+0]>i[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;w<S;w++){var E=a[w],g=E[0];switch(g){case"M":h=E[1],m=E[2];break;case"A":E=t(l,_,E[1],E[2],i(E[3]),E[4],E[5],E[6],E[7]),E.unshift("C"),E.length>7&&(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=a<u?v-f:f,P=d<u?v-P:P,f<0&&(f=v*2+f),P<0&&(P=v*2+P),m&&f>P&&(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;W<U.length;){var Q=r(U[W],U[W+1],c);U[W++]=Q.x,U[W++]=Q.y}return U}function r(a,n,o){return{x:a*Math.cos(o)-n*Math.sin(o),y:a*Math.sin(o)+n*Math.cos(o)}}function i(a){return a*(v/180)}}}),oj=Ze({"node_modules/draw-svg-path/index.js"(Z,q){var v=B5(),x=ij(),A={M:"moveTo",C:"bezierCurveTo"};q.exports=function(M,e){M.beginPath(),x(v(e)).forEach(function(t){var r=t[0],i=t.slice(1);M[A[r]].apply(M,i)}),M.closePath()}}}),sj=Ze({"node_modules/bitmap-sdf/index.js"(Z,q){"use strict";var v=vx();q.exports=A;var x=1e20;function A(t,r){r||(r={});var i=r.cutoff==null?.25:r.cutoff,a=r.radius==null?8:r.radius,n=r.channel||0,o,s,c,h,m,d,T,l,_,w,S;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!r.width||!r.height)throw Error("For raw data width and height should be provided by options");o=r.width,s=r.height,h=t,r.stride?d=r.stride:d=Math.floor(t.length/o/s)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(l=t,T=l.getContext("2d"),o=l.width,s=l.height,_=T.getImageData(0,0,o,s),h=_.data,d=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(l=t.canvas,T=t,o=l.width,s=l.height,_=T.getImageData(0,0,o,s),h=_.data,d=4):window.ImageData&&t instanceof window.ImageData&&(_=t,o=t.width,s=t.height,h=_.data,d=4);if(c=Math.max(o,s),window.Uint8ClampedArray&&h instanceof window.Uint8ClampedArray||window.Uint8Array&&h instanceof window.Uint8Array)for(m=h,h=Array(o*s),w=0,S=m.length;w<S;w++)h[w]=m[w*d+n]/255;else if(d!==1)throw Error("Raw data can have only 1 value per pixel");var E=Array(o*s),g=Array(o*s),b=Array(c),p=Array(c),u=Array(c+1),y=Array(c);for(w=0,S=o*s;w<S;w++){var f=h[w];E[w]=f===1?0:f===0?x:Math.pow(Math.max(0,.5-f),2),g[w]=f===1?x:f===0?0:Math.pow(Math.max(0,f-.5),2)}M(E,o,s,b,p,y,u),M(g,o,s,b,p,y,u);var P=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(w=0,S=o*s;w<S;w++)P[w]=v(1-((E[w]-g[w])/a+i),0,1);return P}function M(t,r,i,a,n,o,s){for(var c=0;c<r;c++){for(var h=0;h<i;h++)a[h]=t[h*r+c];for(e(a,n,o,s,i),h=0;h<i;h++)t[h*r+c]=n[h]}for(h=0;h<i;h++){for(c=0;c<r;c++)a[c]=t[h*r+c];for(e(a,n,o,s,r),c=0;c<r;c++)t[h*r+c]=Math.sqrt(n[c])}}function e(t,r,i,a,n){i[0]=0,a[0]=-x,a[1]=+x;for(var o=1,s=0;o<n;o++){for(var c=(t[o]+o*o-(t[i[s]]+i[s]*i[s]))/(2*o-2*i[s]);c<=a[s];)s--,c=(t[o]+o*o-(t[i[s]]+i[s]*i[s]))/(2*o-2*i[s]);s++,i[s]=o,a[s]=c,a[s+1]=+x}for(o=0,s=0;o<n;o++){for(;a[s+1]<o;)s++;r[o]=(o-i[s])*(o-i[s])+t[i[s]]}}}}),lj=Ze({"node_modules/svg-path-sdf/index.js"(Z,q){"use strict";var v=nj(),x=M_(),A=oj(),M=N5(),e=sj(),t=document.createElement("canvas"),r=t.getContext("2d");q.exports=i;function i(o,s){if(!M(o))throw Error("Argument should be valid svg path string");s||(s={});var c,h;s.shape?(c=s.shape[0],h=s.shape[1]):(c=t.width=s.w||s.width||200,h=t.height=s.h||s.height||200);var m=Math.min(c,h),d=s.stroke||0,T=s.viewbox||s.viewBox||v(o),l=[c/(T[2]-T[0]),h/(T[3]-T[1])],_=Math.min(l[0]||0,l[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,c,h),r.fillStyle="white",d&&(typeof d!="number"&&(d=1),d>0?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;I<W.length;I++)N.markerUnsel.opacity[I]=h*W[I]}if(n.hasLines(O)){N.line={overlay:!0,thickness:O.line.width*U,color:O.line.color,opacity:O.opacity};var Q=(c.DASHES[O.line.dash]||[1]).slice();for(I=0;I<Q.length;++I)Q[I]*=O.line.width*U;N.line.dashes=Q}return O.error_x&&O.error_x.visible&&(N.errorX=g(O,O.error_x,U)),O.error_y&&O.error_y.visible&&(N.errorY=g(O,O.error_y,U)),O.fill&&O.fill!=="none"&&(N.fill={closed:!0,fill:O.fillcolor,thickness:0}),N}function l(B,O){var I=B._fullLayout,N=O._length,U=O.textfont,W=O.textposition,Q=t(W)?W:[W],ue=U.color,se=U.size,he=U.family,H=U.weight,$=U.style,J=U.variant,X={},oe,ne=B._context.plotGlPixelRatio,j=O.texttemplate;if(j){X.text=[];var ee=I._d3locale,re=Array.isArray(j),ce=re?Math.min(j.length,N):N,be=re?function(tt){return j[tt]}:function(){return j};for(oe=0;oe<ce;oe++){var Ae={i:oe},ze=O._module.formatLabels(Ae,O,I),Re={};d(Re,O,oe);var We=O._meta||{};X.text.push(e.texttemplateString(be(oe),ze,ee,Re,Ae,We))}}else t(O.text)&&O.text.length<N?X.text=O.text.slice():X.text=O.text;if(t(X.text))for(oe=X.text.length;oe<N;oe++)X.text[oe]="";for(X.opacity=O.opacity,X.font={},X.align=[],X.baseline=[],oe=0;oe<Q.length;oe++){var it=Q[oe].split(/\s+/);switch(it[1]){case"left":X.align.push("right");break;case"right":X.align.push("left");break;default:X.align.push(it[1])}switch(it[0]){case"top":X.baseline.push("bottom");break;case"bottom":X.baseline.push("top");break;default:X.baseline.push(it[0])}}if(t(ue))for(X.color=new Array(N),oe=0;oe<N;oe++)X.color[oe]=ue[oe];else X.color=ue;if(t(se)||Array.isArray(he)||t(H)||Array.isArray($)||Array.isArray(J))for(X.font=new Array(N),oe=0;oe<N;oe++){var ot=X.font[oe]={};ot.size=(e.isTypedArray(se)?se[oe]:t(se)?v(se[oe])?se[oe]:0:se)*ne,ot.family=Array.isArray(he)?he[oe]:he,ot.weight=_(t(H)?H[oe]:H),ot.style=Array.isArray($)?$[oe]:$,ot.variant=Array.isArray(J)?J[oe]:J}else X.font={size:se*ne,family:he,weight:_(H),style:$,variant:J};return X}function _(B){return B<=1e3?B>500?"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;W<I;W++)ee[W]=re}if(!t(j[0])){var ce=j;for(j=Array(I),W=0;W<I;W++)j[W]=ce}if(!t(oe)){var be=oe;for(oe=Array(I),W=0;W<I;W++)oe[W]=be}if(!t(ne)){var Ae=ne;for(ne=Array(I),W=0;W<I;W++)ne[W]=Ae}for(U.symbols=oe,U.angles=ne,U.colors=j,U.borderColors=ee,W=0;W<I;W++)Q&&(X=s.isOpenSymbol(N.symbol[W])),X&&(ee[W]=j[W].slice(),j[W]=j[W].slice(),j[W][3]=0);for(U.opacity=O.opacity,U.markers=new Array(I),W=0;W<I;W++)U.markers[W]=P({mx:U.symbols[W],ma:U.angles[W]},O)}else X?(U.color=A(N.color,"uint8"),U.color[3]=0,U.borderColor=A(N.color,"uint8")):(U.color=A(N.color,"uint8"),U.borderColor=A(N.line.color,"uint8")),U.opacity=O.opacity*N.opacity,U.marker=P({mx:N.symbol,ma:N.angle},O);var ze=1,Re=o(O,ze),We;if($||J){var it=U.sizes=new Array(I),ot=U.borderSizes=new Array(I),tt=0,ut;if($){for(W=0;W<I;W++)it[W]=Re(N.size[W]),tt+=it[W];ut=tt/I}else for(We=Re(N.size),W=0;W<I;W++)it[W]=We;if(J)for(W=0;W<I;W++)ot[W]=N.line.width[W];else for(We=N.line.width,W=0;W<I;W++)ot[W]=We;U.sizeAvg=ut}else U.size=Re(N&&N.size||10),U.borderSizes=Re(N.line.width);return U}function S(B,O,I){var N=O.marker,U={};return I&&(I.marker&&I.marker.symbol?U=w(B,e.extendFlat({},N,I.marker)):I.marker&&(I.marker.size&&(U.size=I.marker.size),I.marker.color&&(U.colors=I.marker.color),I.marker.opacity!==void 0&&(U.opacity=I.marker.opacity))),U}function E(B,O,I){var N={};if(!I)return N;if(I.textfont){var U={opacity:1,text:O.text,texttemplate:O.texttemplate,textposition:O.textposition,textfont:e.extendFlat({},O.textfont)};I.textfont&&e.extendFlat(U.textfont,I.textfont),N=l(B,U)}return N}function g(B,O,I){var N={capSize:O.width*2*I,lineWidth:O.thickness*I,color:O.color};return O.copy_ystyle&&(N=B.error_y),N}var b=c.SYMBOL_SDF_SIZE,p=c.SYMBOL_SIZE,u=c.SYMBOL_STROKE,y={},f=r.symbolFuncs[0](p*.05);function P(B,O){var I=B.mx;if(I==="circle")return null;var N,U,W=r.symbolNumber(I),Q=r.symbolFuncs[W%100],ue=!!r.symbolNoDot[W%100],se=!!r.symbolNoFill[W%100],he=s.isDotSymbol(I);if(B.ma&&(I+="_"+B.ma),y[I])return y[I];var H=r.getMarkerAngle(B,O);return he&&!ue?N=Q(p*1.1,H)+f:N=Q(p,H),U=x(N,{w:b,h:b,viewBox:[-p,-p,p,p],stroke:se?u:-u}),y[I]=U,U||null}function L(B,O,I){var N=I.length,U=N/2,W,Q;if(n.hasLines(O)&&U)if(O.line.shape==="hv"){for(W=[],Q=0;Q<U-1;Q++)isNaN(I[Q*2])||isNaN(I[Q*2+1])?W.push(NaN,NaN,NaN,NaN):(W.push(I[Q*2],I[Q*2+1]),!isNaN(I[Q*2+2])&&!isNaN(I[Q*2+3])?W.push(I[Q*2+2],I[Q*2+1]):W.push(NaN,NaN));W.push(I[N-2],I[N-1])}else if(O.line.shape==="hvh"){for(W=[],Q=0;Q<U-1;Q++)if(isNaN(I[Q*2])||isNaN(I[Q*2+1])||isNaN(I[Q*2+2])||isNaN(I[Q*2+3]))!isNaN(I[Q*2])&&!isNaN(I[Q*2+1])?W.push(I[Q*2],I[Q*2+1]):W.push(NaN,NaN),W.push(NaN,NaN);else{var ue=(I[Q*2]+I[Q*2+2])/2;W.push(I[Q*2],I[Q*2+1],ue,I[Q*2+1],ue,I[Q*2+3])}W.push(I[N-2],I[N-1])}else if(O.line.shape==="vhv"){for(W=[],Q=0;Q<U-1;Q++)if(isNaN(I[Q*2])||isNaN(I[Q*2+1])||isNaN(I[Q*2+2])||isNaN(I[Q*2+3]))!isNaN(I[Q*2])&&!isNaN(I[Q*2+1])?W.push(I[Q*2],I[Q*2+1]):W.push(NaN,NaN),W.push(NaN,NaN);else{var se=(I[Q*2+1]+I[Q*2+3])/2;W.push(I[Q*2],I[Q*2+1],I[Q*2],se,I[Q*2+2],se)}W.push(I[N-2],I[N-1])}else if(O.line.shape==="vh"){for(W=[],Q=0;Q<U-1;Q++)isNaN(I[Q*2])||isNaN(I[Q*2+1])?W.push(NaN,NaN,NaN,NaN):(W.push(I[Q*2],I[Q*2+1]),!isNaN(I[Q*2+2])&&!isNaN(I[Q*2+3])?W.push(I[Q*2],I[Q*2+3]):W.push(NaN,NaN));W.push(I[N-2],I[N-1])}else W=I;var he=!1;for(Q=0;Q<W.length;Q++)if(isNaN(W[Q])){he=!0;break}var H=he||W.length>c.TOO_MANY_POINTS||n.hasMarkers(O)?"rect":"round";if(he&&O.connectgaps){var $=W[0],J=W[1];for(Q=0;Q<W.length;Q+=2)isNaN(W[Q])||isNaN(W[Q+1])?(W[Q]=$,W[Q+1]=J):($=W[Q],J=W[Q+1])}return{join:H,positions:W}}function z(B,O,I,N,U){var W=M.getComponentMethod("errorbars","makeComputeError"),Q=i.getFromId(B,O.xaxis,"x"),ue=i.getFromId(B,O.yaxis,"y"),se=I.length/2,he={};function H($,J){var X=J._id.charAt(0),oe=O["error_"+X];if(oe&&oe.visible&&(J.type==="linear"||J.type==="log")){for(var ne=W(oe),j={x:0,y:1}[X],ee={x:[0,1,2,3],y:[2,3,0,1]}[X],re=new Float64Array(4*se),ce=1/0,be=-1/0,Ae=0,ze=0;Ae<se;Ae++,ze+=4){var Re=$[Ae];if(v(Re)){var We=I[Ae*2+j],it=ne(Re,Ae),ot=it[0],tt=it[1];if(v(ot)&&v(tt)){var ut=Re-ot,Me=Re+tt;re[ze+ee[0]]=We-J.c2l(ut),re[ze+ee[1]]=J.c2l(Me)-We,re[ze+ee[2]]=0,re[ze+ee[3]]=0,ce=Math.min(ce,Re-ot),be=Math.max(be,Re+tt)}}}he[X]={positions:I,errors:re,_bnds:[ce,be]}}}return H(N,Q),H(U,ue),he}function F(B,O,I,N){var U=O._length,W={},Q;if(n.hasMarkers(O)){var ue=I.font,se=I.align,he=I.baseline;for(W.offset=new Array(U),Q=0;Q<U;Q++){var H=N.sizes?N.sizes[Q]:N.size,$=t(ue)?ue[Q].size:ue.size,J=t(se)?se.length>1?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<e.count;o++)e.glText[o].update(a)},e.draw=function(){for(var a=e.count,n=e.fill2d,o=e.error2d,s=e.line2d,c=e.scatter2d,h=e.glText,m=e.select2d,d=e.selectBatch,T=e.unselectBatch,l=0;l<a;l++){if(n&&e.fillOrder[l]&&n.draw(e.fillOrder[l]),s&&e.lineOptions[l]&&s.draw(l),o&&(e.errorXOptions[l]&&o.draw(l),e.errorYOptions[l]&&o.draw(l+a)),c&&e.markerOptions[l])if(T[l].length){var _=v.repeat([],e.count);_[l]=T[l],c.draw(_)}else d[l].length||c.draw(l);h[l]&&e.textOptions[l]&&h[l].render()}m&&m.draw(d),e.dirty=!1},e.destroy=function(){e.fill2d&&e.fill2d.destroy&&e.fill2d.destroy(),e.scatter2d&&e.scatter2d.destroy&&e.scatter2d.destroy(),e.error2d&&e.error2d.destroy&&e.error2d.destroy(),e.line2d&&e.line2d.destroy&&e.line2d.destroy(),e.select2d&&e.select2d.destroy&&e.select2d.destroy(),e.glText&&e.glText.forEach(function(a){a.destroy&&a.destroy()}),e.lineOptions=null,e.fillOptions=null,e.markerOptions=null,e.markerSelectedOptions=null,e.markerUnselectedOptions=null,e.errorXOptions=null,e.errorYOptions=null,e.textOptions=null,e.textSelectedOptions=null,e.textUnselectedOptions=null,e.selectBatch=null,e.unselectBatch=null,M._scene=null}),e.dirty||v.extendFlat(e,t),e}}}),uj=Ze({"src/traces/scattergl/calc.js"(Z,q){"use strict";var v=vT(),x=ca(),A=$c(),M=Yd().findExtremes,e=tv(),t=Bd(),r=t.calcMarkerSize,i=t.calcAxisExpansion,a=t.setFirstScatter,n=Fd(),o=g0(),s=U5(),c=Vs().BADNUM,h=mg().TOO_MANY_POINTS;q.exports=function(l,_){var w=l._fullLayout,S=_._xA=A.getFromId(l,_.xaxis,"x"),E=_._yA=A.getFromId(l,_.yaxis,"y"),g=w._plots[_.xaxis+_.yaxis],b=_._length,p=b>=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;f<b;f++)I[f*2]=B[f]===c?NaN:B[f],I[f*2+1]=O[f]===c?NaN:O[f],N[f]=f;if(S.type==="log")for(f=0;f<u;f+=2)I[f]=S.c2l(I[f]);if(E.type==="log")for(f=1;f<u;f+=2)I[f]=E.c2l(I[f]);p&&S.type!=="log"&&E.type!=="log"?y.tree=v(I):y.ids=N,n(l,_);var U=d(l,g,_,I,B,O),W=s(l,g);a(w,_);var Q;return p?U.marker&&(Q=U.marker.sizeAvg||Math.max(U.marker.size,3)):Q=r(_,b),i(l,_,S,E,B,O,Q),U.errorX&&m(_,S,U.errorX),U.errorY&&m(_,E,U.errorY),U.fill&&!W.fill2d&&(W.fill2d=!0),U.marker&&!W.scatter2d&&(W.scatter2d=!0),U.line&&!W.line2d&&(W.line2d=!0),(U.errorX||U.errorY)&&!W.error2d&&(W.error2d=!0),U.text&&!W.glText&&(W.glText=!0),U.marker&&(U.marker.snap=b),W.lineOptions.push(U.line),W.errorXOptions.push(U.errorX),W.errorYOptions.push(U.errorY),W.fillOptions.push(U.fill),W.markerOptions.push(U.marker),W.markerSelectedOptions.push(U.markerSel),W.markerUnselectedOptions.push(U.markerUnsel),W.textOptions.push(U.text),W.textSelectedOptions.push(U.textSel),W.textUnselectedOptions.push(U.textUnsel),W.selectBatch.push([]),W.unselectBatch.push([]),y._scene=W,y.index=W.count,y.x=B,y.y=O,y.positions=I,W.count++,[{x:!1,y:!1,t:y,trace:_}]};function m(T,l,_){var w=T._extremes[l._id],S=M(l,_._bnds,{padded:!0});w.min=w.min.concat(S.min),w.max=w.max.concat(S.max)}function d(T,l,_,w,S,E){var g=o.style(T,_);if(g.marker&&(g.marker.positions=w),g.line&&w.length>1&&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<o.length;T++)l=o[T],d.color[l]=_||(E?S[l]:S);for(T=0;T<s.length;T++){l=s[T];var g=E?S[l]:S;d.color[l]=w||(_?g:x.addOpacity(g,A))}}a.glText[n].update(d)}q.exports={styleTextSelection:M}}}),V5=Ze({"src/traces/scattergl/select.js"(Z,q){"use strict";var v=Fu(),x=j5().styleTextSelection;q.exports=function(M,e){var t=M.cd,r=M.xaxis,i=M.yaxis,a=[],n=t[0].trace,o=t[0].t,s=n._length,c=o.x,h=o.y,m=o._scene,d=o.index;if(!m)return a;var T=v.hasText(n),l=v.hasMarkers(n),_=!l&&!T;if(n.visible!==!0||_)return a;var w=[],S=[];if(e!==!1&&!e.degenerate)for(var E=0;E<s;E++)e.contains([o.xpx[E],o.ypx[E]],!1,E,M)?(w.push(E),a.push({pointNumber:E,x:r.c2d(c[E]),y:i.c2d(h[E])})):S.push(E);if(l){var g=m.scatter2d;if(!w.length&&!S.length){var b=new Array(m.count);b[d]=m.markerOptions[d],g.update.apply(g,b)}else if(!m.selectBatch[d].length&&!m.unselectBatch[d].length){var p=new Array(m.count);p[d]=m.markerUnselectedOptions[d],g.update.apply(g,p)}}return m.selectBatch[d]=w,m.unselectBatch[d]=S,T&&x(t),a}}}),cj=Ze({"src/traces/scattergl/base_index.js"(Z,q){"use strict";var v=pT();q.exports={moduleType:"trace",name:"scattergl",basePlotModule:Zf(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:_x(),supplyDefaults:YU(),crossTraceDefaults:DS(),colorbar:hp(),formatLabels:KU(),calc:uj(),hoverPoints:v.hoverPoints,selectPoints:V5(),meta:{}}}}),fj=Ze({"node_modules/color-id/index.js"(Z,q){"use strict";var v=vx();q.exports=x,q.exports.to=x,q.exports.from=A;function x(M,e){e==null&&(e=!0);var t=M[0],r=M[1],i=M[2],a=M[3];a==null&&(a=e?1:255),e&&(t*=255,r*=255,i*=255,a*=255),t=v(t,0,255)&255,r=v(r,0,255)&255,i=v(i,0,255)&255,a=v(a,0,255)&255;var n=t*16777216+(r<<16)+(i<<8)+a;return n}function A(M,e){M=+M;var t=M>>>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;o<arguments.length;o++){i=Object(arguments[o]);for(var s in i)x.call(i,s)&&(a[s]=i[s]);if(v){n=v(i);for(var c=0;c<n.length;c++)A.call(i,n[c])&&(a[n[c]]=i[n[c]])}}return a}}}),hj=Ze({"node_modules/glslify/browser.js"(Z,q){q.exports=function(v){typeof v=="string"&&(v=[v]);for(var x=[].slice.call(arguments,1),A=[],M=0;M<v.length-1;M++)A.push(v[M],x[M]||"");return A.push(v[M]),A.join("")}}}),q5=Ze({"node_modules/update-diff/index.js"(Z,q){"use strict";q.exports=function(x,A,M){Array.isArray(M)||(M=[].slice.call(arguments,2));for(var e=0,t=M.length;e<t;e++){var r=M[e];for(var i in r)if(!(A[i]!==void 0&&!Array.isArray(A[i])&&x[i]===A[i])&&i in A){var a;if(r[i]===!0)a=A[i];else{if(r[i]===!1)continue;if(typeof r[i]=="function"&&(a=r[i](A[i],x,A),a===void 0))continue}x[i]=a}}return x}}}),pj=Ze({"node_modules/is-iexplorer/index.js"(Z,q){"use strict";q.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}}),mT=Ze({"node_modules/to-float32/index.js"(Z,q){"use strict";q.exports=A,q.exports.float32=q.exports.float=A,q.exports.fract32=q.exports.fract=x;var v=new Float32Array(1);function x(M,e){if(M.length){if(M instanceof Float32Array)return new Float32Array(M.length);e instanceof Float32Array||(e=A(M));for(var t=0,r=e.length;t<r;t++)e[t]=M[t]-e[t];return e}return A(M-A(M))}function A(M){return M.length?M instanceof Float32Array?M:new Float32Array(M):(v[0]=M,v[0])}}}),G5=Ze({"node_modules/regl-scatter2d/bundle.js"(Z,q){"use strict";function v(y,f){var P=y==null?null:typeof Symbol<"u"&&y[Symbol.iterator]||y["@@iterator"];if(P!=null){var L,z,F,B,O=[],I=!0,N=!1;try{if(F=(P=P.call(y)).next,f===0){if(Object(P)!==P)return;I=!1}else for(;!(I=(L=F.call(P)).done)&&(O.push(L.value),O.length!==f);I=!0);}catch(U){N=!0,z=U}finally{try{if(!I&&P.return!=null&&(B=P.return(),Object(B)!==B))return}finally{if(N)throw z}}return O}}function x(y,f){return e(y)||v(y,f)||r(y,f)||n()}function A(y){return M(y)||t(y)||r(y)||a()}function M(y){if(Array.isArray(y))return i(y)}function e(y){if(Array.isArray(y))return y}function t(y){if(typeof Symbol<"u"&&y[Symbol.iterator]!=null||y["@@iterator"]!=null)return Array.from(y)}function r(y,f){if(y){if(typeof y=="string")return i(y,f);var P=Object.prototype.toString.call(y).slice(8,-1);if(P==="Object"&&y.constructor&&(P=y.constructor.name),P==="Map"||P==="Set")return Array.from(y);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return i(y,f)}}function i(y,f){(f==null||f>y.length)&&(f=y.length);for(var P=0,L=new Array(f);P<f;P++)L[P]=y[P];return L}function a(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=hg(),s=v0(),c=fj(),h=vT(),m=sh(),d=hj(),T=Ev(),l=q5(),_=m0(),w=pj(),S=mT(),E=k1(),g=b;function b(y,f){var P=this;if(!(this instanceof b))return new b(y,f);typeof y=="function"?(f||(f={}),f.regl=y):(f=y,y=null),f&&f.length&&(f.positions=f),y=f.regl;var L=y._gl,z,F=[],B={},O=[],I=[null],N=[null],U=255,W=100;this.tooManyColors=w,z=y.texture({data:new Uint8Array(U*4),width:U,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),m(this,{regl:y,gl:L,groups:O,markerCache:N,markerTextures:I,palette:F,paletteIds:B,paletteTexture:z,maxColors:U,maxSize:W,canvas:L.canvas}),this.update(f);var Q={uniforms:{constPointSize:!!f.constPointSize,opacity:y.prop("opacity"),paletteSize:function(H,$){return[P.tooManyColors?0:U,z.height]},pixelRatio:y.context("pixelRatio"),scale:y.prop("scale"),scaleFract:y.prop("scaleFract"),translate:y.prop("translate"),translateFract:y.prop("translateFract"),markerTexture:y.prop("markerTexture"),paletteTexture:z},attributes:{x:function(H,$){return $.xAttr||{buffer:$.positionBuffer,stride:8,offset:0}},y:function(H,$){return $.yAttr||{buffer:$.positionBuffer,stride:8,offset:4}},xFract:function(H,$){return $.xAttr?{constant:[0,0]}:{buffer:$.positionFractBuffer,stride:8,offset:0}},yFract:function(H,$){return $.yAttr?{constant:[0,0]}:{buffer:$.positionFractBuffer,stride:8,offset:4}},size:function(H,$){return $.size.length?{buffer:$.sizeBuffer,stride:2,offset:0}:{constant:[Math.round($.size*255/P.maxSize)]}},borderSize:function(H,$){return $.borderSize.length?{buffer:$.sizeBuffer,stride:2,offset:1}:{constant:[Math.round($.borderSize*255/P.maxSize)]}},colorId:function(H,$){return $.color.length?{buffer:$.colorBuffer,stride:P.tooManyColors?8:4,offset:0}:{constant:P.tooManyColors?F.slice($.color*4,$.color*4+4):[$.color]}},borderColorId:function(H,$){return $.borderColor.length?{buffer:$.colorBuffer,stride:P.tooManyColors?8:4,offset:P.tooManyColors?4:2}:{constant:P.tooManyColors?F.slice($.borderColor*4,$.borderColor*4+4):[$.borderColor]}},isActive:function(H,$){return $.activation===!0?{constant:[1]}:$.activation?$.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:y.prop("viewport")},viewport:y.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:y.prop("elements"),count:y.prop("count"),offset:y.prop("offset"),primitive:"points"},ue=m({},Q);ue.frag=d([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
uniform float opacity;
|
||
uniform sampler2D markerTexture;
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragWidth, fragBorderColorLevel, fragColorLevel;
|
||
|
||
float smoothStep(float x, float y) {
|
||
return 1.0 / (1.0 + exp(50.0*(x - y)));
|
||
}
|
||
|
||
void main() {
|
||
float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;
|
||
|
||
// max-distance alpha
|
||
if (dist < 0.003) discard;
|
||
|
||
// null-border case
|
||
if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {
|
||
float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);
|
||
gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);
|
||
}
|
||
else {
|
||
float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);
|
||
float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);
|
||
|
||
vec4 color = fragBorderColor;
|
||
color.a *= borderColorAmt;
|
||
color = mix(color, fragColor, colorAmt);
|
||
color.a *= opacity;
|
||
|
||
gl_FragColor = color;
|
||
}
|
||
|
||
}
|
||
`]),ue.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 scale, scaleFract, translate, translateFract, paletteSize;
|
||
uniform sampler2D paletteTexture;
|
||
|
||
const float maxSize = 100.;
|
||
const float borderLevel = .5;
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;
|
||
|
||
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 = 2. * size * pointSizeScale;
|
||
fragPointSize = size * pixelRatio;
|
||
|
||
vec2 pos = (position + translate) * scale
|
||
+ (positionFract + translateFract) * scale
|
||
+ (position + translate) * scaleFract
|
||
+ (positionFract + translateFract) * scaleFract;
|
||
|
||
gl_Position = vec4(pos * 2. - 1., 0., 1.);
|
||
|
||
fragColor = color;
|
||
fragBorderColor = borderColor;
|
||
fragWidth = 1. / gl_PointSize;
|
||
|
||
fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);
|
||
fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);
|
||
}
|
||
`]),this.drawMarker=y(ue);var se=m({},Q);se.frag=d([`precision highp float;
|
||
#define GLSLIFY 1
|
||
|
||
varying vec4 fragColor, fragBorderColor;
|
||
varying float fragBorderRadius, fragWidth;
|
||
|
||
uniform float opacity;
|
||
|
||
float smoothStep(float edge0, float edge1, float x) {
|
||
float t;
|
||
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
|
||
return t * t * (3.0 - 2.0 * t);
|
||
}
|
||
|
||
void main() {
|
||
float radius, alpha = 1.0, delta = fragWidth;
|
||
|
||
radius = length(2.0 * gl_PointCoord.xy - 1.0);
|
||
|
||
if (radius > 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<f;L++)P[L]=arguments[L];var z=this.groups;if(P.length===1&&Array.isArray(P[0])&&(P[0][0]===null||Array.isArray(P[0][0]))&&(P=P[0]),this.regl._refresh(),P.length)for(var F=0;F<P.length;F++)this.drawItem(F,P[F]);else z.forEach(function(B,O){y.drawItem(O)});return this},b.prototype.drawItem=function(y,f){var P=this.groups,L=P[y];if(typeof f=="number"&&(y=f,L=P[f],f=null),!!(L&&L.count&&L.opacity)){L.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,L,f));for(var z=[],F=1;F<L.activation.length;F++)!L.activation[F]||L.activation[F]!==!0&&!L.activation[F].data.length||z.push.apply(z,A(this.getMarkerDrawOptions(F,L,f)));z.length&&this.drawMarker(z)}},b.prototype.getMarkerDrawOptions=function(y,f,P){var L=f.range,z=f.tree,F=f.viewport,B=f.activation,O=f.selectionBuffer,I=f.count,N=this.regl;if(!z)return P?[m({},f,{markerTexture:this.markerTextures[y],activation:B[y],count:P.length,elements:P,offset:0})]:[m({},f,{markerTexture:this.markerTextures[y],activation:B[y],offset:0})];var U=[],W=z.range(L,{lod:!0,px:[(L[2]-L[0])/F.width,(L[3]-L[1])/F.height]});if(P){for(var Q=B[y],ue=Q.data,se=new Uint8Array(I),he=0;he<P.length;he++){var H=P[he];se[H]=ue?ue[H]:1}O.subdata(se)}for(var $=W.length;$--;){var J=x(W[$],2),X=J[0],oe=J[1];U.push(m({},f,{markerTexture:this.markerTextures[y],activation:P?O:B[y],offset:X,count:oe-X}))}return U},b.prototype.update=function(){for(var y=this,f=arguments.length,P=new Array(f),L=0;L<f;L++)P[L]=arguments[L];if(P.length){P.length===1&&Array.isArray(P[0])&&(P=P[0]);var z=this.groups,F=this.gl,B=this.regl,O=this.maxSize,I=this.maxColors,N=this.palette;this.groups=z=P.map(function(U,W){var Q=z[W];if(U===void 0)return Q;U===null?U={positions:null}:typeof U=="function"?U={ondraw:U}:typeof U[0]=="number"&&(U={positions:U}),U=T(U,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"}),U.positions===null&&(U.positions=[]),U.tooManyColors!=null&&(y.tooManyColors=U.tooManyColors),Q||(z[W]=Q={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:B.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:B.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},U=m({},b.defaults,U)),U.positions&&!("marker"in U)&&(U.marker=Q.marker,delete Q.marker),U.marker&&!("positions"in U)&&(U.positions=Q.positions,delete Q.positions);var ue=0,se=0;if(l(Q,U,[{snap:!0,size:function(tt,ut){return tt==null&&(tt=b.defaults.size),ue+=tt&&tt.length?1:0,tt},borderSize:function(tt,ut){return tt==null&&(tt=b.defaults.borderSize),ue+=tt&&tt.length?1:0,tt},opacity:parseFloat,color:function(tt,ut){return tt==null&&(tt=b.defaults.color),tt=y.updateColor(tt),se++,tt},borderColor:function(tt,ut){return tt==null&&(tt=b.defaults.borderColor),tt=y.updateColor(tt),se++,tt},bounds:function(tt,ut,Me){return"range"in Me||(Me.range=null),tt},positions:function(tt,ut,Me){var _e=ut.snap,fe=ut.positionBuffer,Fe=ut.positionFractBuffer,rt=ut.selectionBuffer;if(tt.x||tt.y)return tt.x.length?ut.xAttr={buffer:B.buffer(tt.x),offset:0,stride:4,count:tt.x.length}:ut.xAttr={buffer:tt.x.buffer,offset:tt.x.offset*4||0,stride:(tt.x.stride||1)*4,count:tt.x.count},tt.y.length?ut.yAttr={buffer:B.buffer(tt.y),offset:0,stride:4,count:tt.y.length}:ut.yAttr={buffer:tt.y.buffer,offset:tt.y.offset*4||0,stride:(tt.y.stride||1)*4,count:tt.y.count},ut.count=Math.max(ut.xAttr.count,ut.yAttr.count),tt;tt=_(tt,"float64");var st=ut.count=Math.floor(tt.length/2),Qe=ut.bounds=st?s(tt,2):null;if(!Me.range&&!ut.range&&(delete ut.range,Me.range=Qe),!Me.marker&&!ut.marker&&(delete ut.marker,Me.marker=null),_e&&(_e===!0||st>_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<st;rt++){var Qe=y.addMarker(tt[rt]);Fe[Qe]||(Fe[Qe]=new Uint8Array(ut.count)),Fe[Qe][rt]=1}for(var Lt=0;Lt<Fe.length;Lt++)if(Fe[Lt]){var kt={data:Fe[Lt],type:"uint8",usage:"static"};_e[Lt]?_e[Lt](kt):_e[Lt]=B.buffer(kt),_e[Lt].data=Fe[Lt]}}return tt},range:function(tt,ut,Me){var _e=ut.bounds;if(_e)return tt||(tt=_e),ut.scale=[1/(tt[2]-tt[0]),1/(tt[3]-tt[1])],ut.translate=[-tt[0],-tt[1]],ut.scaleFract=S.fract(ut.scale),ut.translateFract=S.fract(ut.translate),tt},viewport:function(tt){var ut=E(tt||[F.drawingBufferWidth,F.drawingBufferHeight]);return ut}}]),ue){var he=Q,H=he.count,$=he.size,J=he.borderSize,X=he.sizeBuffer,oe=new Uint8Array(H*2);if($.length||J.length)for(var ne=0;ne<H;ne++)oe[ne*2]=Math.round(($[ne]==null?$:$[ne])*255/O),oe[ne*2+1]=Math.round((J[ne]==null?J:J[ne])*255/O);X({data:oe,usage:"dynamic"})}if(se){var j=Q,ee=j.count,re=j.color,ce=j.borderColor,be=j.colorBuffer,Ae;if(y.tooManyColors){if(re.length||ce.length){Ae=new Uint8Array(ee*8);for(var ze=0;ze<ee;ze++){var Re=re[ze];Ae[ze*8]=N[Re*4],Ae[ze*8+1]=N[Re*4+1],Ae[ze*8+2]=N[Re*4+2],Ae[ze*8+3]=N[Re*4+3];var We=ce[ze];Ae[ze*8+4]=N[We*4],Ae[ze*8+5]=N[We*4+1],Ae[ze*8+6]=N[We*4+2],Ae[ze*8+7]=N[We*4+3]}}}else if(re.length||ce.length){Ae=new Uint8Array(ee*4+2);for(var it=0;it<ee;it++)re[it]!=null&&(Ae[it*4]=re[it]%I,Ae[it*4+1]=Math.floor(re[it]/I)),ce[it]!=null&&(Ae[it*4+2]=ce[it]%I,Ae[it*4+3]=Math.floor(ce[it]/I))}be({data:Ae||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return Q})}},b.prototype.addMarker=function(y){var f=this.markerTextures,P=this.regl,L=this.markerCache,z=y==null?0:L.indexOf(y);if(z>=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;B<O;B++)F[B]=y[B]*255}var I=Math.floor(Math.sqrt(F.length));return z=f.length,L.push(y),f.push(P.texture({channels:1,data:F,radius:I,mag:"linear",min:"linear"})),z},b.prototype.updateColor=function(y){var f=this.paletteIds,P=this.palette,L=this.maxColors;Array.isArray(y)||(y=[y]);var z=[];if(typeof y[0]=="number"){var F=[];if(Array.isArray(y))for(var B=0;B<y.length;B+=4)F.push(y.slice(B,B+4));else for(var O=0;O<y.length;O+=4)F.push(y.subarray(O,O+4));y=F}for(var I=0;I<y.length;I++){var N=y[I];N=o(N,"uint8");var U=c(N,!1);if(f[U]==null){var W=P.length;f[U]=Math.floor(W/4),P[W]=N[0],P[W+1]=N[1],P[W+2]=N[2],P[W+3]=N[3]}z[I]=f[U]}return!this.tooManyColors&&P.length>L*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;z<L*f;z++)y.push(0,0,0,0)}P.height<L&&P.resize(f,L),P.subimage({width:Math.min(y.length*.25,f),height:L,data:y},0,0)}},b.prototype.destroy=function(){return this.groups.forEach(function(y){y.sizeBuffer.destroy(),y.positionBuffer.destroy(),y.positionFractBuffer.destroy(),y.colorBuffer.destroy(),y.activation.forEach(function(f){return f&&f.destroy&&f.destroy()}),y.selectionBuffer.destroy(),y.elements&&y.elements.destroy()}),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach(function(y){return y&&y.destroy&&y.destroy()}),this};var p=sh(),u=function(f,P){var L=new g(f,P),z=L.render.bind(L);return p(z,{render:z,update:L.update.bind(L),draw:L.draw.bind(L),destroy:L.destroy.bind(L),regl:L.regl,gl:L.gl,canvas:L.gl.canvas,groups:L.groups,markers:L.markerCache,palette:L.palette}),z};q.exports=u}}),dj=Ze({"node_modules/earcut/src/earcut.js"(Z,q){"use strict";q.exports=v,q.exports.default=v;function v(B,O,I){I=I||2;var N=O&&O.length,U=N?O[0]*I:B.length,W=x(B,0,U,I,!0),Q=[];if(!W||W.next===W.prev)return Q;var ue,se,he,H,$,J,X;if(N&&(W=a(B,O,W,I)),B.length>80*I){ue=he=B[0],se=H=B[1];for(var oe=I;oe<U;oe+=I)$=B[oe],J=B[oe+1],$<ue&&(ue=$),J<se&&(se=J),$>he&&(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<I;W+=N)Q=P(W,B[W],B[W+1],Q);else for(W=I-N;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=U<W?U<Q?U:Q:W<Q?W:Q,$=ue<se?ue<he?ue:he:se<he?se:he,J=U>W?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=ue<se?ue<he?ue:he:se<he?se:he,oe=H<$?H<J?H:J:$<J?$:J,ne=ue>se?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<Q;W++)ue=O[W]*N,se=W<Q-1?O[W+1]*N:B.length,he=x(B,ue,se,N,!1),he===he.next&&(he.steiner=!0),U.push(T(he));for(U.sort(n),W=0;W<U.length;W++)I=o(U[W],I);return I}function n(B,O){return B.x-O.x}function o(B,O){var I=s(B,O);if(!I)return O;var N=f(I,B);return A(N,N.next),A(I,I.next)}function s(B,O){var I=O,N=B.x,U=B.y,W=-1/0,Q;do{if(U<=I.y&&U>=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.next.x?I:I.next,ue===N))return Q}I=I.next}while(I!==O);if(!Q)return null;var se=Q,he=Q.x,H=Q.y,$=1/0,J;I=Q;do N>=I.x&&I.x>=he&&N!==I.x&&l(U<H?N:W,U,he,H,U<H?W:N,U,I.x,I.y)&&(J=Math.abs(U-I.y)/(N-I.x),u(I,B)&&(J<$||J===$&&(I.x>Q.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;O<he&&(ue++,N=N.nextZ,!!N);O++);for(se=he;ue>0||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<I.x||O.x===I.x&&O.y<I.y)&&(I=O),O=O.next;while(O!==B);return I}function l(B,O,I,N,U,W,Q,ue){return(U-Q)*(O-ue)>=(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;ue<se;ue++){var he=O[ue]*I,H=ue<se-1?O[ue+1]*I:B.length;Q-=Math.abs(F(B,he,H,I))}var $=0;for(ue=0;ue<N.length;ue+=3){var J=N[ue]*I,X=N[ue+1]*I,oe=N[ue+2]*I;$+=Math.abs((B[J]-B[oe])*(B[X+1]-B[J+1])-(B[J]-B[X])*(B[oe+1]-B[J+1]))}return Q===0&&$===0?0:Math.abs(($-Q)/Q)};function F(B,O,I,N){for(var U=0,W=O,Q=I-N;W<I;W+=N)U+=(B[Q]-B[W])*(B[W+1]+B[Q+1]),Q=W;return U}v.flatten=function(B){for(var O=B[0][0].length,I={vertices:[],holes:[],dimensions:O},N=0,U=0;U<B.length;U++){for(var W=0;W<B[U].length;W++)for(var Q=0;Q<O;Q++)I.vertices.push(B[U][W][Q]);U>0&&(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<M;t++){var r=e[M+t],i=e[t],a=t,n=A.length;if(r===1/0&&i===-1/0)for(a=t;a<n;a+=M)A[a]=A[a]===r?1:A[a]===i?0:.5;else if(r===1/0)for(a=t;a<n;a+=M)A[a]=A[a]===r?1:0;else if(i===-1/0)for(a=t;a<n;a+=M)A[a]=A[a]===i?0:1;else{var o=r-i;for(a=t;a<n;a+=M)isNaN(A[a])||(A[a]=o===0?.5:(A[a]-i)/o)}}return A}}}),mj=Ze({"node_modules/es6-weak-map/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v,x;if(typeof WeakMap!="function")return!1;try{v=new WeakMap([[x={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(v)!=="[object WeakMap]"||typeof v.set!="function"||v.set({},1)!==v||typeof v.delete!="function"||typeof v.has!="function"||v.get(x)!=="one")}}}),gj=Ze({"node_modules/es5-ext/function/noop.js"(Z,q){"use strict";q.exports=function(){}}}),gg=Ze({"node_modules/es5-ext/object/is-value.js"(Z,q){"use strict";var v=gj()();q.exports=function(x){return x!==v&&x!==null}}}),H5=Ze({"node_modules/es5-ext/object/set-prototype-of/is-implemented.js"(Z,q){"use strict";var v=Object.create,x=Object.getPrototypeOf,A={};q.exports=function(){var M=Object.setPrototypeOf,e=arguments[0]||v;return typeof M!="function"?!1:x(M(e(null),A))===A}}}),W5=Ze({"node_modules/es5-ext/object/is-object.js"(Z,q){"use strict";var v=gg(),x={function:!0,object:!0};q.exports=function(A){return v(A)&&x[typeof A]||!1}}}),tm=Ze({"node_modules/es5-ext/object/valid-value.js"(Z,q){"use strict";var v=gg();q.exports=function(x){if(!v(x))throw new TypeError("Cannot use null or undefined");return x}}}),yj=Ze({"node_modules/es5-ext/object/create.js"(Z,q){"use strict";var v=Object.create,x;H5()()||(x=X5()),q.exports=function(){var A,M,e;return!x||x.level!==1?v:(A={},M={},e={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){if(t==="__proto__"){M[t]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}M[t]=e}),Object.defineProperties(A,M),Object.defineProperty(x,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:A}),function(t,r){return v(t===null?A:t,r)})}()}}),X5=Ze({"node_modules/es5-ext/object/set-prototype-of/shim.js"(Z,q){"use strict";var v=W5(),x=tm(),A=Object.prototype.isPrototypeOf,M=Object.defineProperty,e={configurable:!0,enumerable:!1,writable:!0,value:void 0},t;t=function(r,i){if(x(r),i===null||v(i))return r;throw new TypeError("Prototype must be null or an object")},q.exports=function(r){var i,a;return r?(r.level===2?r.set?(a=r.set,i=function(n,o){return a.call(t(n,o),o),n}):i=function(n,o){return t(n,o).__proto__=o,n}:i=function n(o,s){var c;return t(o,s),c=A.call(n.nullPolyfill,o),c&&delete n.nullPolyfill.__proto__,s===null&&(s=n.nullPolyfill),o.__proto__=s,c&&M(n.nullPolyfill,"__proto__",e),o},Object.defineProperty(i,"level",{configurable:!1,enumerable:!1,writable:!1,value:r.level})):null}(function(){var r=Object.create(null),i={},a,n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{a=n.set,a.call(r,i)}catch{}if(Object.getPrototypeOf(r)===i)return{set:a,level:2}}return r.__proto__=i,Object.getPrototypeOf(r)===i?{level:2}:(r={},r.__proto__=i,Object.getPrototypeOf(r)===i?{level:1}:!1)}()),yj()}}),gT=Ze({"node_modules/es5-ext/object/set-prototype-of/index.js"(Z,q){"use strict";q.exports=H5()()?Object.setPrototypeOf:X5()}}),_j=Ze({"node_modules/es5-ext/object/valid-object.js"(Z,q){"use strict";var v=W5();q.exports=function(x){if(!v(x))throw new TypeError(x+" is not an Object");return x}}}),xj=Ze({"node_modules/es5-ext/string/random-uniq.js"(Z,q){"use strict";var v=Object.create(null),x=Math.random;q.exports=function(){var A;do A=x().toString(36).slice(2);while(v[A]);return A}}}),y0=Ze({"node_modules/type/value/is.js"(Z,q){"use strict";var v=void 0;q.exports=function(x){return x!==v&&x!==null}}}),yT=Ze({"node_modules/type/object/is.js"(Z,q){"use strict";var v=y0(),x={object:!0,function:!0,undefined:!0};q.exports=function(A){return v(A)?hasOwnProperty.call(x,typeof A):!1}}}),bj=Ze({"node_modules/type/prototype/is.js"(Z,q){"use strict";var v=yT();q.exports=function(x){if(!v(x))return!1;try{return x.constructor?x.constructor.prototype===x:!1}catch{return!1}}}}),wj=Ze({"node_modules/type/function/is.js"(Z,q){"use strict";var v=bj();q.exports=function(x){if(typeof x!="function"||!hasOwnProperty.call(x,"length"))return!1;try{if(typeof x.length!="number"||typeof x.call!="function"||typeof x.apply!="function")return!1}catch{return!1}return!v(x)}}}),Z5=Ze({"node_modules/type/plain-function/is.js"(Z,q){"use strict";var v=wj(),x=/^\s*class[\s{/}]/,A=Function.prototype.toString;q.exports=function(M){return!(!v(M)||x.test(A.call(M)))}}}),Tj=Ze({"node_modules/es5-ext/object/assign/is-implemented.js"(Z,q){"use strict";q.exports=function(){var v=Object.assign,x;return typeof v!="function"?!1:(x={foo:"raz"},v(x,{bar:"dwa"},{trzy:"trzy"}),x.foo+x.bar+x.trzy==="razdwatrzy")}}}),Aj=Ze({"node_modules/es5-ext/object/keys/is-implemented.js"(Z,q){"use strict";q.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}}),Sj=Ze({"node_modules/es5-ext/object/keys/shim.js"(Z,q){"use strict";var v=gg(),x=Object.keys;q.exports=function(A){return x(v(A)?Object(A):A)}}}),Mj=Ze({"node_modules/es5-ext/object/keys/index.js"(Z,q){"use strict";q.exports=Aj()()?Object.keys:Sj()}}),Ej=Ze({"node_modules/es5-ext/object/assign/shim.js"(Z,q){"use strict";var v=Mj(),x=tm(),A=Math.max;q.exports=function(M,e){var t,r,i=A(arguments.length,2),a;for(M=Object(x(M)),a=function(n){try{M[n]=e[n]}catch(o){t||(t=o)}},r=1;r<i;++r)e=arguments[r],v(e).forEach(a);if(t!==void 0)throw t;return M}}}),_T=Ze({"node_modules/es5-ext/object/assign/index.js"(Z,q){"use strict";q.exports=Tj()()?Object.assign:Ej()}}),Y5=Ze({"node_modules/es5-ext/object/normalize-options.js"(Z,q){"use strict";var v=gg(),x=Array.prototype.forEach,A=Object.create,M=function(e,t){var r;for(r in e)t[r]=e[r]};q.exports=function(e){var t=A(null);return x.call(arguments,function(r){v(r)&&M(Object(r),t)}),t}}}),Cj=Ze({"node_modules/es5-ext/string/#/contains/is-implemented.js"(Z,q){"use strict";var v="razdwatrzy";q.exports=function(){return typeof v.contains!="function"?!1:v.contains("dwa")===!0&&v.contains("foo")===!1}}}),kj=Ze({"node_modules/es5-ext/string/#/contains/shim.js"(Z,q){"use strict";var v=String.prototype.indexOf;q.exports=function(x){return v.call(this,x,arguments[1])>-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?"<Non-coercible to string value>":(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<w;++T)_[T]=c[T];return _}}_=[]}else d=this;if(!a(c)){if((b=c[v])!==void 0){for(E=e(b).call(c),d&&(_=new d),g=E.next(),T=0;!g.done;)p=h?n.call(h,m,g.value,T):g.value,d?(o.value=p,s(_,T,o)):_[T]=p,g=E.next(),++T;w=T}else if(i(c)){for(w=c.length,d&&(_=new d),T=0,l=0;T<w;++T)p=c[T],T+1<w&&(S=p.charCodeAt(0),S>=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<w;++T)p=h?n.call(h,m,c[T],T):c[T],d?(o.value=p,s(_,T,o)):_[T]=p;return d&&(o.value=null,_.length=w),_}}}),$j=Ze({"node_modules/es5-ext/array/from/index.js"(Z,q){"use strict";q.exports=Gj()()?Array.from:Jj()}}),Qj=Ze({"node_modules/es5-ext/object/copy.js"(Z,q){"use strict";var v=$j(),x=_T(),A=tm();q.exports=function(M){var e=Object(A(M)),t=arguments[1],r=Object(arguments[2]);if(e!==M&&!t)return e;var i={};return t?v(t,function(a){(r.ensure||a in M)&&(i[a]=M[a])}):x(i,M),i}}}),eV=Ze({"node_modules/es5-ext/object/_iterate.js"(Z,q){"use strict";var v=L1(),x=tm(),A=Function.prototype.bind,M=Function.prototype.call,e=Object.keys,t=Object.prototype.propertyIsEnumerable;q.exports=function(r,i){return function(a,n){var o,s=arguments[2],c=arguments[3];return a=Object(x(a)),v(n),o=e(a),c&&o.sort(typeof c=="function"?A.call(c,a):void 0),typeof r!="function"&&(r=o[r]),M.call(r,o,function(h,m){return t.call(a,h)?M.call(n,s,a[h],h,a,m):i})}}}}),tV=Ze({"node_modules/es5-ext/object/for-each.js"(Z,q){"use strict";q.exports=eV()("forEach")}}),rV=Ze({"node_modules/es5-ext/object/map.js"(Z,q){"use strict";var v=L1(),x=tV(),A=Function.prototype.call;q.exports=function(M,e){var t={},r=arguments[2];return v(e),x(M,function(i,a,n,o){t[a]=A.call(e,r,i,a,n,o)}),t}}}),aV=Ze({"node_modules/d/auto-bind.js"(Z,q){"use strict";var v=y0(),x=Vj(),A=qj(),M=Qj(),e=Y5(),t=rV(),r=Function.prototype.bind,i=Object.defineProperty,a=Object.prototype.hasOwnProperty,n;n=function(o,s,c){var h=x(s)&&A(s.value),m;return m=M(s),delete m.writable,delete m.value,m.get=function(){return!c.overwriteDefinition&&a.call(this,o)?h:(s.value=r.call(h,c.resolveContext?c.resolveContext(this):this),i(this,o,s),this[o])},m},q.exports=function(o){var s=e(arguments[1]);return v(s.resolveContext)&&A(s.resolveContext),t(o,function(c,h){return n(h,c,s)})}}}),Q5=Ze({"node_modules/es6-iterator/index.js"(Z,q){"use strict";var v=Bj(),x=_T(),A=L1(),M=tm(),e=rm(),t=aV(),r=yg(),i=Object.defineProperty,a=Object.defineProperties,n;q.exports=n=function(o,s){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");a(this,{__list__:e("w",M(o)),__context__:e("w",s),__nextIndex__:e("w",0)}),s&&(A(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete n.prototype.constructor,a(n.prototype,x({_next:e(function(){var o;if(this.__list__){if(this.__redo__&&(o=this.__redo__.shift(),o!==void 0))return o;if(this.__nextIndex__<this.__list__.length)return this.__nextIndex__++;this._unBind()}}),next:e(function(){return this._createResult(this._next())}),_createResult:e(function(o){return o===void 0?{done:!0,value:void 0}:{done:!1,value:this._resolve(o)}}),_resolve:e(function(o){return this.__list__[o]}),_unBind:e(function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)}),toString:e(function(){return"[object "+(this[r.toStringTag]||"Object")+"]"})},t({_onAdd:e(function(o){if(!(o>=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__<this.__length__)return this.__nextIndex__++;this._unBind()}}),_resolve:x(function(r){var i=this.__list__[r],a;return this.__nextIndex__===this.__length__?i:(a=i.charCodeAt(0),a>=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<d&&(T=i[m],m+1<d&&(l=T.charCodeAt(0),l>=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<e;t++)if(x.call(A,M[t],t,M))return t;return-1}}}),rC=Ze({"node_modules/regl-line2d/index.js"(Z,q){"use strict";var v=hg(),x=v0(),A=sh(),M=Ev(),e=m0(),t=dj(),r=vj(),{float32:i,fract32:a}=mT(),n=tC(),o=k1(),s=fV(),c=`
|
||
precision highp float;
|
||
|
||
attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;
|
||
attribute vec4 color;
|
||
attribute float lineEnd, lineTop;
|
||
|
||
uniform vec2 scale, scaleFract, translate, translateFract;
|
||
uniform float thickness, pixelRatio, id, depth;
|
||
uniform vec4 viewport;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec2 tangent;
|
||
|
||
vec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {
|
||
// the order is important
|
||
return position * scale + translate
|
||
+ positionFract * scale + translateFract
|
||
+ position * scaleFract
|
||
+ positionFract * scaleFract;
|
||
}
|
||
|
||
void main() {
|
||
float lineStart = 1. - lineEnd;
|
||
float lineOffset = lineTop * 2. - 1.;
|
||
|
||
vec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);
|
||
tangent = normalize(diff * scale * viewport.zw);
|
||
vec2 normal = vec2(-tangent.y, tangent.x);
|
||
|
||
vec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart
|
||
+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd
|
||
|
||
+ thickness * normal * .5 * lineOffset / viewport.zw;
|
||
|
||
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
||
|
||
fragColor = color / 255.;
|
||
}
|
||
`,h=`
|
||
precision highp float;
|
||
|
||
uniform float dashLength, pixelRatio, thickness, opacity, id;
|
||
uniform sampler2D dashTexture;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec2 tangent;
|
||
|
||
void main() {
|
||
float alpha = 1.;
|
||
|
||
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;
|
||
}
|
||
`,m=`
|
||
precision highp float;
|
||
|
||
attribute vec2 position, positionFract;
|
||
|
||
uniform vec4 color;
|
||
uniform vec2 scale, scaleFract, translate, translateFract;
|
||
uniform float pixelRatio, id;
|
||
uniform vec4 viewport;
|
||
uniform float opacity;
|
||
|
||
varying vec4 fragColor;
|
||
|
||
const float MAX_LINES = 256.;
|
||
|
||
void main() {
|
||
float depth = (MAX_LINES - 4. - id) / (MAX_LINES);
|
||
|
||
vec2 position = position * scale + translate
|
||
+ positionFract * scale + translateFract
|
||
+ position * scaleFract
|
||
+ positionFract * scaleFract;
|
||
|
||
gl_Position = vec4(position * 2.0 - 1.0, depth, 1);
|
||
|
||
fragColor = color / 255.;
|
||
fragColor.a *= opacity;
|
||
}
|
||
`,d=`
|
||
precision highp float;
|
||
varying vec4 fragColor;
|
||
|
||
void main() {
|
||
gl_FragColor = fragColor;
|
||
}
|
||
`,T=`
|
||
precision highp float;
|
||
|
||
attribute vec2 aCoord, bCoord, nextCoord, prevCoord;
|
||
attribute vec4 aColor, bColor;
|
||
attribute float lineEnd, lineTop;
|
||
|
||
uniform vec2 scale, translate;
|
||
uniform float thickness, pixelRatio, id, depth;
|
||
uniform vec4 viewport;
|
||
uniform float miterLimit, miterMode;
|
||
|
||
varying vec4 fragColor;
|
||
varying vec4 startCutoff, endCutoff;
|
||
varying vec2 tangent;
|
||
varying vec2 startCoord, endCoord;
|
||
varying float enableStartMiter, enableEndMiter;
|
||
|
||
const float REVERSE_THRESHOLD = -.875;
|
||
const float MIN_DIFF = 1e-6;
|
||
|
||
// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead
|
||
// TODO: precalculate dot products, normalize things beforehead etc.
|
||
// TODO: refactor to rectangular algorithm
|
||
|
||
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);
|
||
}
|
||
|
||
bool isNaN( float val ){
|
||
return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;
|
||
}
|
||
|
||
void main() {
|
||
vec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;
|
||
|
||
vec2 adjustedScale;
|
||
adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;
|
||
adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;
|
||
|
||
vec2 scaleRatio = adjustedScale * viewport.zw;
|
||
vec2 normalWidth = thickness / scaleRatio;
|
||
|
||
float lineStart = 1. - lineEnd;
|
||
float lineBot = 1. - lineTop;
|
||
|
||
fragColor = (lineStart * aColor + lineEnd * bColor) / 255.;
|
||
|
||
if (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;
|
||
|
||
if (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);
|
||
if (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);
|
||
|
||
|
||
vec2 prevDiff = aCoord - prevCoord;
|
||
vec2 currDiff = bCoord - aCoord;
|
||
vec2 nextDiff = nextCoord - bCoord;
|
||
|
||
vec2 prevTangent = normalize(prevDiff * scaleRatio);
|
||
vec2 currTangent = normalize(currDiff * scaleRatio);
|
||
vec2 nextTangent = normalize(nextDiff * scaleRatio);
|
||
|
||
vec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);
|
||
vec2 currNormal = vec2(-currTangent.y, currTangent.x);
|
||
vec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);
|
||
|
||
vec2 startJoinDirection = normalize(prevTangent - currTangent);
|
||
vec2 endJoinDirection = normalize(currTangent - nextTangent);
|
||
|
||
// collapsed/unidirectional segment cases
|
||
// FIXME: there should be more elegant solution
|
||
vec2 prevTanDiff = abs(prevTangent - currTangent);
|
||
vec2 nextTanDiff = abs(nextTangent - currTangent);
|
||
if (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {
|
||
startJoinDirection = currNormal;
|
||
}
|
||
if (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {
|
||
endJoinDirection = currNormal;
|
||
}
|
||
if (aCoord == bCoord) {
|
||
endJoinDirection = startJoinDirection;
|
||
currNormal = prevNormal;
|
||
currTangent = prevTangent;
|
||
}
|
||
|
||
tangent = currTangent;
|
||
|
||
//calculate join shifts relative to normals
|
||
float startJoinShift = dot(currNormal, startJoinDirection);
|
||
float endJoinShift = dot(currNormal, endJoinDirection);
|
||
|
||
float startMiterRatio = abs(1. / startJoinShift);
|
||
float endMiterRatio = abs(1. / endJoinShift);
|
||
|
||
vec2 startJoin = startJoinDirection * startMiterRatio;
|
||
vec2 endJoin = endJoinDirection * endMiterRatio;
|
||
|
||
vec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;
|
||
startTopJoin = sign(startJoinShift) * startJoin * .5;
|
||
startBotJoin = -startTopJoin;
|
||
|
||
endTopJoin = sign(endJoinShift) * endJoin * .5;
|
||
endBotJoin = -endTopJoin;
|
||
|
||
vec2 aTopCoord = aCoord + normalWidth * startTopJoin;
|
||
vec2 bTopCoord = bCoord + normalWidth * endTopJoin;
|
||
vec2 aBotCoord = aCoord + normalWidth * startBotJoin;
|
||
vec2 bBotCoord = bCoord + normalWidth * endBotJoin;
|
||
|
||
//miter anti-clipping
|
||
float baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));
|
||
float abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));
|
||
|
||
//prevent close to reverse direction switch
|
||
bool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);
|
||
bool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);
|
||
|
||
if (prevReverse) {
|
||
//make join rectangular
|
||
vec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;
|
||
float normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);
|
||
aBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;
|
||
aTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;
|
||
}
|
||
else if (!nextReverse && baClipping > 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;N<L;N++)P[N*2]=O[N],P[N*2+1]=I[N]}else P=e(b.positions,"float64"),L=u.count=Math.floor(P.length/2);let z=u.bounds=x(P,2);if(u.fill){let O=[],I={},N=0;for(let U=0,W=0,Q=u.count;U<Q;U++){let ue=P[U*2],se=P[U*2+1];isNaN(ue)||isNaN(se)||ue==null||se==null?(ue=P[N*2],se=P[N*2+1],I[U]=N):N=U,O[W++]=ue,O[W++]=se}if(b.splitNull){u.count-1 in I||(I[u.count]=u.count-1);let U=Object.keys(I).map(Number).sort((se,he)=>se-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;se<U.length;se++){let he=O.slice(Q*2,U[se]*2).concat(ue?O.slice(ue*2):[]),H=(u.hole||[]).map(J=>J-ue+(U[se]-Q)),$=t(he,H);$=$.map(J=>J+Q+(J+Q<U[se]?0:ue-U[se])),W.push(...$),Q=U[se]+1}for(let se=0,he=W.length;se<he;se++)I[W[se]]!=null&&(W[se]=I[W[se]]);u.triangles=W}else{let U=t(O,u.hole||[]);for(let W=0,Q=U.length;W<Q;W++)I[U[W]]!=null&&(U[W]=I[U[W]]);u.triangles=U}}let F=new Float64Array(P);r(F,2,z);let B=new Float64Array(L*2+6);u.close?P[0]===P[L*2-2]&&P[1]===P[L*2-1]?(B[0]=F[L*2-4],B[1]=F[L*2-3]):(B[0]=F[L*2-2],B[1]=F[L*2-1]):(B[0]=F[0],B[1]=F[1]),B.set(F,2),u.close?P[0]===P[L*2-2]&&P[1]===P[L*2-1]?(B[L*2+2]=F[2],B[L*2+3]=F[3],u.count-=1):(B[L*2+2]=F[0],B[L*2+3]=F[1],B[L*2+4]=F[2],B[L*2+5]=F[3]):(B[L*2+2]=F[L*2-2],B[L*2+3]=F[L*2-1],B[L*2+4]=F[L*2-2],B[L*2+5]=F[L*2-1]);var y=i(B);u.positionBuffer(y);var f=a(B,y);u.positionFractBuffer(f)}if(b.range?u.range=b.range:u.range||(u.range=u.bounds),(b.range||b.positions)&&u.count){let P=u.bounds,L=P[2]-P[0],z=P[3]-P[1],F=u.range[2]-u.range[0],B=u.range[3]-u.range[1];u.scale=[L/F,z/B],u.translate=[-u.range[0]/F+P[0]/F||0,-u.range[1]/B+P[1]/B||0],u.scaleFract=a(u.scale),u.translateFract=a(u.translate)}if(b.dashes){let P=0,L;if(!b.dashes||b.dashes.length<2)P=1,L=new Uint8Array([255,255,255,255,255,255,255,255]);else{P=0;for(let B=0;B<b.dashes.length;++B)P+=b.dashes[B];L=new Uint8Array(P*_.dashMult);let z=0,F=255;for(let B=0;B<2;B++)for(let O=0;O<b.dashes.length;++O){for(let I=0,N=b.dashes[O]*_.dashMult*.5;I<N;++I)L[z++]=F;F^=255}}u.dashLength=P,u.dashTexture({channels:1,data:L,width:L.length,height:1,mag:"linear",min:"linear"},0,0)}if(b.color){let P=u.count,L=b.color;L||(L="transparent");let z=new Uint8Array(P*4+4);if(!Array.isArray(L)||typeof L[0]=="number"){let F=v(L,"uint8");for(let B=0;B<P+1;B++)z.set(F,B*4)}else{for(let F=0;F<P;F++){let B=v(L[F],"uint8");z.set(B,F*4)}z.set(v(L[0],"uint8"),P*4)}u.colorBuffer({usage:"dynamic",type:"uint8",data:z})}}}),w.length<this.passes.length){for(let b=w.length;b<this.passes.length;b++){let p=this.passes[b];p&&(p.colorBuffer.destroy(),p.positionBuffer.destroy(),p.dashTexture.destroy())}this.passes.length=w.length}let g=[];for(let b=0;b<this.passes.length;b++)this.passes[b]!==null&&g.push(this.passes[b]);return this.passes=g,this},_.prototype.destroy=function(){return this.passes.forEach(w=>{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<U;ue++)I[ue]=Q}if(I.length<U)throw Error("Not enough colors");let W=new Uint8Array(U*4);for(let Q=0;Q<U;Q++){let ue=x(I[Q],"uint8");W.set(ue,Q*4)}return W},range:(I,N,U)=>{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;n<i.length;n++){var o=i[n],s=i[n+1];o[o.length-1]==="\\"&&o[o.length-2]!=="\\"?(a.push(o+M+s),n++):a.push(o)}i=a}for(var n=0;n<i.length;n++)t[0]=i[n],i[n]=v.stringify(t,{flat:!0});return i}}}),mV=Ze({"node_modules/css-font-size-keywords/index.json"(){}}),lC=Ze({"node_modules/css-font/lib/util.js"(Z,q){"use strict";var v=mV();q.exports={isSize:function(A){return/^[\d\.]/.test(A)||A.indexOf("/")!==-1||v.indexOf(A)!==-1}}}}),gV=Ze({"node_modules/css-font/parse.js"(Z,q){"use strict";var v=pV(),x=aC(),A=nC(),M=iC(),e=oC(),t=sC(),r=vV(),i=lC().isSize;q.exports=n;var a=n.cache={};function n(s){if(typeof s!="string")throw new Error("Font argument must be a string.");if(a[s])return a[s];if(s==="")throw new Error("Cannot parse an empty string.");if(A.indexOf(s)!==-1)return a[s]={system:s};for(var c={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},h=r(s,/\s+/),m;m=h.shift();){if(x.indexOf(m)!==-1)return["style","variant","weight","stretch"].forEach(function(T){c[T]=m}),a[s]=c;if(e.indexOf(m)!==-1){c.style=m;continue}if(m==="normal"||m==="small-caps"){c.variant=m;continue}if(t.indexOf(m)!==-1){c.stretch=m;continue}if(M.indexOf(m)!==-1){c.weight=m;continue}if(i(m)){var d=r(m,"/");if(c.size=d[0],d[1]!=null?c.lineHeight=o(d[1]):h[0]==="/"&&(h.shift(),c.lineHeight=o(h.shift())),!h.length)throw new Error("Missing required font-family.");return c.family=r(h.join(" "),/\s*,\s*/).map(v),a[s]=c}throw new Error("Unknown or unsupported font token: "+m)}throw new Error("Missing required font-size.")}function o(s){var c=parseFloat(s);return c.toString()===s?c:s}}}),uC=Ze({"node_modules/css-font/stringify.js"(Z,q){"use strict";var v=Ev(),x=lC().isSize,A=s(aC()),M=s(nC()),e=s(iC()),t=s(oC()),r=s(sC()),i={normal:1,"small-caps":1},a={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},n={style:"normal",variant:"normal",weight:"normal",stretch:"normal",size:"1rem",lineHeight:"normal",family:"serif"};q.exports=function(h){if(h=v(h,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),h.system)return h.system&&o(h.system,M),h.system;if(o(h.style,t),o(h.variant,i),o(h.weight,e),o(h.stretch,r),h.size==null&&(h.size=n.size),typeof h.size=="number"&&(h.size+="px"),!x)throw Error("Bad size value `"+h.size+"`");h.family||(h.family=n.family),Array.isArray(h.family)&&(h.family.length||(h.family=[n.family]),h.family=h.family.map(function(d){return a[d]?d:'"'+d+'"'}).join(", "));var m=[];return m.push(h.style),h.variant!==h.style&&m.push(h.variant),h.weight!==h.variant&&h.weight!==h.style&&m.push(h.weight),h.stretch!==h.weight&&h.stretch!==h.variant&&h.stretch!==h.style&&m.push(h.stretch),m.push(h.size+(h.lineHeight==null||h.lineHeight==="normal"||h.lineHeight+""=="1"?"":"/"+h.lineHeight)),m.push(h.family),m.filter(Boolean).join(" ")};function o(c,h){if(c&&!h[c]&&!A[c])throw Error("Unknown keyword `"+c+"`");return c}function s(c){for(var h={},m=0;m<c.length;m++)h[c[m]]=1;return h}}}),yV=Ze({"node_modules/css-font/index.js"(Z,q){"use strict";q.exports={parse:gV(),stringify:uC()}}}),_V=Ze({"node_modules/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;ua<cr.length;++ua)nt[cr[ua]]=Yt[cr[ua]];return nt},x=0,A=0,M=5,e=6;function t(nt,Yt){this.id=x++,this.type=nt,this.data=Yt}function r(nt){return nt.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(nt){if(nt.length===0)return[];var Yt=nt.charAt(0),cr=nt.charAt(nt.length-1);if(nt.length>1&&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<Aa.length;++wa)xa=xa.concat(i(Aa[wa]));return xa}function a(nt){return"["+i(nt).join("][")+"]"}function n(nt,Yt){return new t(nt,a(Yt+""))}function o(nt){return typeof nt=="function"&&!nt._reglType||nt instanceof t}function s(nt,Yt){if(typeof nt=="function")return new t(A,nt);if(typeof nt=="number"||typeof nt=="boolean")return new t(M,nt);if(Array.isArray(nt))return new t(e,nt.map(function(cr,ua){return s(cr,Yt+"["+ua+"]")}));if(nt instanceof t)return nt}var c={DynamicVariable:t,define:n,isDynamic:o,unbox:s,accessor:a},h={next:typeof requestAnimationFrame=="function"?function(nt){return requestAnimationFrame(nt)}:function(nt){return setTimeout(nt,16)},cancel:typeof cancelAnimationFrame=="function"?function(nt){return cancelAnimationFrame(nt)}:clearTimeout},m=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function d(){var nt={"":0},Yt=[""];return{id:function(cr){var ua=nt[cr];return ua||(ua=nt[cr]=Yt.length,Yt.push(cr),ua)},str:function(cr){return Yt[cr]}}}function T(nt,Yt,cr){var ua=document.createElement("canvas");v(ua.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),nt.appendChild(ua),nt===document.body&&(ua.style.position="absolute",v(nt.style,{margin:0,padding:0}));function Aa(){var Ja=window.innerWidth,Sn=window.innerHeight;if(nt!==document.body){var wn=ua.getBoundingClientRect();Ja=wn.right-wn.left,Sn=wn.bottom-wn.top}ua.width=cr*Ja,ua.height=cr*Sn}var xa;nt!==document.body&&typeof ResizeObserver=="function"?(xa=new ResizeObserver(function(){setTimeout(Aa)}),xa.observe(nt)):window.addEventListener("resize",Aa,!1);function wa(){xa?xa.disconnect():window.removeEventListener("resize",Aa),nt.removeChild(ua)}return Aa(),{canvas:ua,onDestroy:wa}}function l(nt,Yt){function cr(ua){try{return nt.getContext(ua,Yt)}catch{return null}}return cr("webgl")||cr("experimental-webgl")||cr("webgl-experimental")}function _(nt){return typeof nt.nodeName=="string"&&typeof nt.appendChild=="function"&&typeof nt.getBoundingClientRect=="function"}function w(nt){return typeof nt.drawArrays=="function"||typeof nt.drawElements=="function"}function S(nt){return typeof nt=="string"?nt.split():nt}function E(nt){return typeof nt=="string"?document.querySelector(nt):nt}function g(nt){var Yt=nt||{},cr,ua,Aa,xa,wa={},Ja=[],Sn=[],wn=typeof window>"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;Aa<Yt.extensions.length;++Aa){var xa=Yt.extensions[Aa];if(!ua(xa))return Yt.onDestroy(),Yt.onDone('"'+xa+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return Yt.optionalExtensions.forEach(ua),{extensions:cr,restore:function(){Object.keys(cr).forEach(function(wa){if(cr[wa]&&!ua(wa))throw new Error("(regl): error restoring extension "+wa)})}}}function p(nt,Yt){for(var cr=Array(nt),ua=0;ua<nt;++ua)cr[ua]=Yt(ua);return cr}var u=5120,y=5121,f=5122,P=5123,L=5124,z=5125,F=5126;function B(nt){for(var Yt=16;Yt<=1<<28;Yt*=16)if(nt<=Yt)return Yt;return 0}function O(nt){var Yt,cr;return Yt=(nt>65535)<<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;ua<Yt;++ua)cr[ua]=nt[ua]}function Ue(nt,Yt,cr,ua){for(var Aa=0,xa=0;xa<Yt;++xa)for(var wa=nt[xa],Ja=0;Ja<cr;++Ja)ua[Aa++]=wa[Ja]}function Ee(nt,Yt,cr,ua,Aa,xa){for(var wa=xa,Ja=0;Ja<Yt;++Ja)for(var Sn=nt[Ja],wn=0;wn<cr;++wn)for(var hn=Sn[wn],yi=0;yi<ua;++yi)Aa[wa++]=hn[yi]}function Ve(nt,Yt,cr,ua,Aa){for(var xa=1,wa=cr+1;wa<Yt.length;++wa)xa*=Yt[wa];var Ja=Yt[cr];if(Yt.length-cr===4){var Sn=Yt[cr+1],wn=Yt[cr+2],hn=Yt[cr+3];for(wa=0;wa<Ja;++wa)Ee(nt[wa],Sn,wn,hn,ua,Aa),Aa+=xa}else for(wa=0;wa<Ja;++wa)Ve(nt[wa],Yt,cr+1,ua,Aa),Aa+=xa}function Ce(nt,Yt,cr,ua){var Aa=1;if(Yt.length)for(var xa=0;xa<Yt.length;++xa)Aa*=Yt[xa];else Aa=0;var wa=ua||N.allocType(cr,Aa);switch(Yt.length){case 0:break;case 1:Ke(nt,Yt[0],wa);break;case 2:Ue(nt,Yt[0],Yt[1],wa);break;case 3:Ee(nt,Yt[0],Yt[1],Yt[2],wa,0);break;default:Ve(nt,Yt,0,wa,0)}return wa}function Te(nt){for(var Yt=[],cr=nt;cr.length;cr=cr[0])Yt.push(cr.length);return Yt}var Pe={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},at=5120,yt=5122,Tt=5124,Ot=5121,Gt=5123,rr=5125,Qt=5126,Tr=5126,la={int8:at,int16:yt,int32:Tt,uint8:Ot,uint16:Gt,uint32:rr,float:Qt,float32:Tr},Ua=35048,Ba=35040,Ra={dynamic:Ua,stream:Ba,static:35044},Qa=Be.flatten,za=Be.shape,en=35044,kn=35040,Jt=5121,Nt=5126,Kt=[];Kt[5120]=1,Kt[5122]=2,Kt[5124]=4,Kt[5121]=1,Kt[5123]=2,Kt[5125]=4,Kt[5126]=4;function Wt(nt){return Pe[Object.prototype.toString.call(nt)]|0}function Pr(nt,Yt){for(var cr=0;cr<Yt.length;++cr)nt[cr]=Yt[cr]}function ta(nt,Yt,cr,ua,Aa,xa,wa){for(var Ja=0,Sn=0;Sn<cr;++Sn)for(var wn=0;wn<ua;++wn)nt[Ja++]=Yt[Aa*Sn+xa*wn+wa]}function ma(nt,Yt,cr,ua){var Aa=0,xa={};function wa(ea){this.id=Aa++,this.buffer=nt.createBuffer(),this.type=ea,this.usage=en,this.byteLength=0,this.dimension=1,this.dtype=Jt,this.persistentData=null,cr.profile&&(this.stats={size:0})}wa.prototype.bind=function(){nt.bindBuffer(this.type,this.buffer)},wa.prototype.destroy=function(){Bn(this)};var Ja=[];function Sn(ea,Ea){var an=Ja.pop();return an||(an=new wa(ea)),an.bind(),yi(an,Ea,kn,0,1,!1),an}function wn(ea){Ja.push(ea)}function hn(ea,Ea,an){ea.byteLength=Ea.byteLength,nt.bufferData(ea.type,Ea,an)}function yi(ea,Ea,an,gn,Wa,Vn){var Rn;if(ea.usage=an,Array.isArray(Ea)){if(ea.dtype=gn||Nt,Ea.length>0){var hi;if(Array.isArray(Ea[0])){Rn=za(Ea);for(var Za=1,qa=1;qa<Rn.length;++qa)Za*=Rn[qa];ea.dimension=Za,hi=Qa(Ea,Rn,ea.dtype),hn(ea,hi,an),Vn?ea.persistentData=hi:N.freeType(hi)}else if(typeof Ea[0]=="number"){ea.dimension=Wa;var Qn=N.allocType(ea.dtype,Ea.length);Pr(Qn,Ea),hn(ea,Qn,an),Vn?ea.persistentData=Qn:N.freeType(Qn)}else wr(Ea[0])&&(ea.dimension=Ea[0].length,ea.dtype=gn||Wt(Ea[0])||Nt,hi=Qa(Ea,[Ea.length,Ea[0].length],ea.dtype),hn(ea,hi,an),Vn?ea.persistentData=hi:N.freeType(hi))}}else if(wr(Ea))ea.dtype=gn||Wt(Ea),ea.dimension=Wa,hn(ea,Ea,an),Vn&&(ea.persistentData=new Uint8Array(new Uint8Array(Ea.buffer)));else if(Ir(Ea)){Rn=Ea.shape;var Fn=Ea.stride,Mn=Ea.offset,An=0,Jn=0,mi=0,Ii=0;Rn.length===1?(An=Rn[0],Jn=1,mi=Fn[0],Ii=0):Rn.length===2&&(An=Rn[0],Jn=Rn[1],mi=Fn[0],Ii=Fn[1]),ea.dtype=gn||Wt(Ea.data)||Nt,ea.dimension=Jn;var zn=N.allocType(ea.dtype,An*Jn);ta(zn,Ea.data,An,Jn,mi,Ii,Mn),hn(ea,zn,an),Vn?ea.persistentData=zn:N.freeType(zn)}else Ea instanceof ArrayBuffer&&(ea.dtype=Jt,ea.dimension=Wa,hn(ea,Ea,an),Vn&&(ea.persistentData=new Uint8Array(new Uint8Array(Ea))))}function Bn(ea){Yt.bufferCount--,ua(ea);var Ea=ea.buffer;nt.deleteBuffer(Ea),ea.buffer=null,delete xa[ea.id]}function Ln(ea,Ea,an,gn){Yt.bufferCount++;var Wa=new wa(Ea);xa[Wa.id]=Wa;function Vn(Za){var qa=en,Qn=null,Fn=0,Mn=0,An=1;return Array.isArray(Za)||wr(Za)||Ir(Za)||Za instanceof ArrayBuffer?Qn=Za:typeof Za=="number"?Fn=Za|0:Za&&("data"in Za&&(Qn=Za.data),"usage"in Za&&(qa=Ra[Za.usage]),"type"in Za&&(Mn=la[Za.type]),"dimension"in Za&&(An=Za.dimension|0),"length"in Za&&(Fn=Za.length|0)),Wa.bind(),Qn?yi(Wa,Qn,qa,Mn,An,gn):(Fn&&nt.bufferData(Wa.type,Fn,qa),Wa.dtype=Mn||Jt,Wa.usage=qa,Wa.dimension=An,Wa.byteLength=Fn),cr.profile&&(Wa.stats.size=Wa.byteLength*Kt[Wa.dtype]),Vn}function Rn(Za,qa){nt.bufferSubData(Wa.type,qa,Za)}function hi(Za,qa){var Qn=(qa||0)|0,Fn;if(Wa.bind(),wr(Za)||Za instanceof ArrayBuffer)Rn(Za,Qn);else if(Array.isArray(Za)){if(Za.length>0){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<nt.length;++cr)if(isNaN(nt[cr]))Yt[cr]=65535;else if(nt[cr]===1/0)Yt[cr]=31744;else if(nt[cr]===-1/0)Yt[cr]=64512;else{kr[0]=nt[cr];var ua=na[0],Aa=ua>>>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<Ja;++Bn)for(var Ln=0;Ln<wa;++Ln)for(var Va=0;Va<Sn;++Va)hn[yi++]=Yt[cr*Ln+ua*Bn+Aa*Va+xa];Gu(nt,hn)}function oc(nt,Yt,cr,ua,Aa,xa){var wa;if(typeof Qi[nt]<"u"?wa=Qi[nt]:wa=gs[nt]*Ss[Yt],xa&&(wa*=6),Aa){for(var Ja=0,Sn=cr;Sn>=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<Vt.length;++Jr)Dr*=Vt[Jr];var ba=Of(Le,Dr);Be.flatten(mt,Vt,"",ba),Gu(Le,ba),Le.alignment=1,Le.width=lr,Le.height=Xt,Le.channels=or,Le.format=Le.internalformat=vl[or],Le.needsFree=!0}Le.type===Si||Le.type}function Jn(Le,$e,mt){var jt=Le.element,_r=Le.data,Fr=Le.internalformat,hr=Le.format,gt=Le.type,Et=Le.width,Ft=Le.height;Fn(Le),jt?nt.texImage2D($e,mt,hr,hr,gt,jt):Le.compressed?nt.compressedTexImage2D($e,mt,Fr,Et,Ft,0,_r):Le.needsCopy?(ua(),nt.copyTexImage2D($e,mt,hr,Le.xOffset,Le.yOffset,Et,Ft,0)):nt.texImage2D($e,mt,hr,Et,Ft,0,hr,gt,_r||null)}function mi(Le,$e,mt,jt,_r){var Fr=Le.element,hr=Le.data,gt=Le.internalformat,Et=Le.format,Ft=Le.type,nr=Le.width,fr=Le.height;Fn(Le),Fr?nt.texSubImage2D($e,_r,mt,jt,Et,Ft,Fr):Le.compressed?nt.compressedTexSubImage2D($e,_r,mt,jt,gt,nr,fr,hr):Le.needsCopy?(ua(),nt.copyTexSubImage2D($e,_r,mt,jt,Le.xOffset,Le.yOffset,nr,fr)):nt.texSubImage2D($e,_r,mt,jt,nr,fr,Et,Ft,hr)}var Ii=[];function zn(){return Ii.pop()||new Mn}function ii(Le){Le.needsFree&&N.freeType(Le.data),Mn.call(Le),Ii.push(Le)}function Ei(){Za.call(this),this.genMipmaps=!1,this.mipmapHint=Cu,this.mipmask=0,this.images=Array(16)}function Ri(Le,$e,mt){var jt=Le.images[0]=zn();Le.mipmask=1,jt.width=Le.width=$e,jt.height=Le.height=mt,jt.channels=Le.channels=4}function Gi(Le,$e){var mt=null;if(af($e))mt=Le.images[0]=zn(),qa(mt,Le),An(mt,$e),Le.mipmask=1;else if(Qn(Le,$e),Array.isArray($e.mipmap))for(var jt=$e.mipmap,_r=0;_r<jt.length;++_r)mt=Le.images[_r]=zn(),qa(mt,Le),mt.width>>=_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<mt.length;++jt){if(!mt[jt])return;Jn(mt[jt],$e,jt)}}var xl=[];function ho(){var Le=xl.pop()||new Ei;Za.call(Le),Le.mipmask=0;for(var $e=0;$e<16;++$e)Le.images[$e]=null;return Le}function Hl(Le){for(var $e=Le.images,mt=0;mt<$e.length;++mt)$e[mt]&&ii($e[mt]),$e[mt]=null;xl.push(Le)}function fs(){this.minFilter=fl,this.magFilter=fl,this.wrapS=al,this.wrapT=al,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Cu}function Al(Le,$e){if("min"in $e){var mt=$e.min;Le.minFilter=hn[mt],nl.indexOf(Le.minFilter)>=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;mt<pl;++mt){var jt=bl[mt];if(jt){if(jt.bindCount>0)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<pl;++Le)nt.activeTexture(Ou+Le),nt.bindTexture(Da,null),bl[Le]=null;bt(Fs).forEach(ve),xa.cubeCount=0,xa.textureCount=0}wa.profile&&(xa.getTotalTextureSize=function(){var Le=0;return Object.keys(Fs).forEach(function($e){Le+=Fs[$e].stats.size}),Le});function me(){for(var Le=0;Le<pl;++Le){var $e=bl[Le];$e&&($e.bindCount=0,$e.unit=-1,bl[Le]=null)}bt(Fs).forEach(function(mt){mt.texture=nt.createTexture(),nt.bindTexture(mt.target,mt.texture);for(var jt=0;jt<32;++jt)if(mt.mipmask&1<<jt)if(mt.target===Da)nt.texImage2D(Da,jt,mt.internalformat,mt.width>>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<pl;++Le){var $e=bl[Le];$e&&($e.bindCount=0,$e.unit=-1,bl[Le]=null),nt.activeTexture(Ou+Le),nt.bindTexture(Da,null),nt.bindTexture(Zn,null)}}return{create2D:Y,createCube:ye,clear:te,getTexture:function(Le){return null},restore:me,refresh:Ge}}var Jl=36161,Uc=32854,Tc=32855,Gs=36194,Cf=33189,lh=36168,Bf=34041,Wc=35907,Kf=34836,ku=34842,Nf=34843,ml=[];ml[Uc]=2,ml[Tc]=2,ml[Gs]=2,ml[Cf]=2,ml[lh]=1,ml[Bf]=4,ml[Wc]=4,ml[Kf]=16,ml[ku]=8,ml[Nf]=6;function Lu(nt,Yt,cr){return ml[nt]*Yt*cr}var Ac=function(nt,Yt,cr,ua,Aa){var xa={rgba4:Uc,rgb565:Gs,"rgb5 a1":Tc,depth:Cf,stencil:lh,"depth stencil":Bf};Yt.ext_srgb&&(xa.srgba=Wc),Yt.ext_color_buffer_half_float&&(xa.rgba16f=ku,xa.rgb16f=Nf),Yt.webgl_color_buffer_float&&(xa.rgba32f=Kf);var wa=[];Object.keys(xa).forEach(function(Ln){var Va=xa[Ln];wa[Va]=Ln});var Ja=0,Sn={};function wn(Ln){this.id=Ja++,this.refCount=1,this.renderbuffer=Ln,this.format=Uc,this.width=0,this.height=0,Aa.profile&&(this.stats={size:0})}wn.prototype.decRef=function(){--this.refCount<=0&&hn(this)};function hn(Ln){var Va=Ln.renderbuffer;nt.bindRenderbuffer(Jl,null),nt.deleteRenderbuffer(Va),Ln.renderbuffer=null,Ln.refCount=0,delete Sn[Ln.id],ua.renderbufferCount--}function yi(Ln,Va){var ea=new wn(nt.createRenderbuffer());Sn[ea.id]=ea,ua.renderbufferCount++;function Ea(gn,Wa){var Vn=0,Rn=0,hi=Uc;if(typeof gn=="object"&&gn){var Za=gn;if("shape"in Za){var qa=Za.shape;Vn=qa[0]|0,Rn=qa[1]|0}else"radius"in Za&&(Vn=Rn=Za.radius|0),"width"in Za&&(Vn=Za.width|0),"height"in Za&&(Rn=Za.height|0);"format"in Za&&(hi=xa[Za.format])}else typeof gn=="number"?(Vn=gn|0,typeof Wa=="number"?Rn=Wa|0:Rn=Vn):gn||(Vn=Rn=1);if(!(Vn===ea.width&&Rn===ea.height&&hi===ea.format))return Ea.width=ea.width=Vn,Ea.height=ea.height=Rn,ea.format=hi,nt.bindRenderbuffer(Jl,ea.renderbuffer),nt.renderbufferStorage(Jl,hi,Vn,Rn),Aa.profile&&(ea.stats.size=Lu(ea.format,ea.width,ea.height)),Ea.format=wa[ea.format],Ea}function an(gn,Wa){var Vn=gn|0,Rn=Wa|0||Vn;return Vn===ea.width&&Rn===ea.height||(Ea.width=ea.width=Vn,Ea.height=ea.height=Rn,nt.bindRenderbuffer(Jl,ea.renderbuffer),nt.renderbufferStorage(Jl,ea.format,Vn,Rn),Aa.profile&&(ea.stats.size=Lu(ea.format,ea.width,ea.height))),Ea}return Ea(Ln,Va),Ea.resize=an,Ea._reglType="renderbuffer",Ea._renderbuffer=ea,Aa.profile&&(Ea.stats=ea.stats),Ea.destroy=function(){ea.decRef()},Ea}Aa.profile&&(ua.getTotalRenderbufferSize=function(){var Ln=0;return Object.keys(Sn).forEach(function(Va){Ln+=Sn[Va].stats.size}),Ln});function Bn(){bt(Sn).forEach(function(Ln){Ln.renderbuffer=nt.createRenderbuffer(),nt.bindRenderbuffer(Jl,Ln.renderbuffer),nt.renderbufferStorage(Jl,Ln.format,Ln.width,Ln.height)}),nt.bindRenderbuffer(Jl,null)}return{create:yi,clear:function(){bt(Sn).forEach(hn)},restore:Bn}},il=36160,dc=36161,vu=3553,bu=34069,Ml=36064,Uf=36096,Jf=36128,Bu=33306,Sc=36053,vc=36193,Lh=5121,nf=5126,df=6407,Nu=6408,of=[];of[Nu]=4,of[df]=3;var tu=[];tu[Lh]=1,tu[nf]=4,tu[vc]=2;function Xc(nt,Yt,cr,ua,Aa,xa){var wa={cur:null,next:null,dirty:!1,setFBO:null},Ja=["rgba"],Sn=["rgba4","rgb565","rgb5 a1"];Yt.ext_srgb&&Sn.push("srgba"),Yt.ext_color_buffer_half_float&&Sn.push("rgba16f","rgb16f"),Yt.webgl_color_buffer_float&&Sn.push("rgba32f");var wn=["uint8"];Yt.oes_texture_half_float&&wn.push("half float","float16"),Yt.oes_texture_float&&wn.push("float","float32");function hn(Mn,An,Jn){this.target=Mn,this.texture=An,this.renderbuffer=Jn;var mi=0,Ii=0;An?(mi=An.width,Ii=An.height):Jn&&(mi=Jn.width,Ii=Jn.height),this.width=mi,this.height=Ii}function yi(Mn){Mn&&(Mn.texture&&Mn.texture._texture.decRef(),Mn.renderbuffer&&Mn.renderbuffer._renderbuffer.decRef())}function Bn(Mn,An,Jn){if(Mn)if(Mn.texture){var mi=Mn.texture._texture,Ii=Math.max(1,mi.width),zn=Math.max(1,mi.height);mi.refCount+=1}else{var ii=Mn.renderbuffer._renderbuffer;ii.refCount+=1}}function Ln(Mn,An){An&&(An.texture?nt.framebufferTexture2D(il,Mn,An.target,An.texture._texture.texture,0):nt.framebufferRenderbuffer(il,Mn,dc,An.renderbuffer._renderbuffer.renderbuffer))}function Va(Mn){var An=vu,Jn=null,mi=null,Ii=Mn;typeof Mn=="object"&&(Ii=Mn.data,"target"in Mn&&(An=Mn.target|0));var zn=Ii._reglType;return zn==="texture2d"||zn==="textureCube"?Jn=Ii:zn==="renderbuffer"&&(mi=Ii,An=dc),new hn(An,Jn,mi)}function ea(Mn,An,Jn,mi,Ii){if(Jn){var zn=ua.create2D({width:Mn,height:An,format:mi,type:Ii});return zn._texture.refCount=0,new hn(vu,zn,null)}else{var ii=Aa.create({width:Mn,height:An,format:mi});return ii._renderbuffer.refCount=0,new hn(dc,null,ii)}}function Ea(Mn){return Mn&&(Mn.texture||Mn.renderbuffer)}function an(Mn,An,Jn){Mn&&(Mn.texture?Mn.texture.resize(An,Jn):Mn.renderbuffer&&Mn.renderbuffer.resize(An,Jn),Mn.width=An,Mn.height=Jn)}var gn=0,Wa={};function Vn(){this.id=gn++,Wa[this.id]=this,this.framebuffer=nt.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Rn(Mn){Mn.colorAttachments.forEach(yi),yi(Mn.depthAttachment),yi(Mn.stencilAttachment),yi(Mn.depthStencilAttachment)}function hi(Mn){var An=Mn.framebuffer;nt.deleteFramebuffer(An),Mn.framebuffer=null,xa.framebufferCount--,delete Wa[Mn.id]}function Za(Mn){var An;nt.bindFramebuffer(il,Mn.framebuffer);var Jn=Mn.colorAttachments;for(An=0;An<Jn.length;++An)Ln(Ml+An,Jn[An]);for(An=Jn.length;An<cr.maxColorAttachments;++An)nt.framebufferTexture2D(il,Ml+An,vu,null,0);nt.framebufferTexture2D(il,Bu,vu,null,0),nt.framebufferTexture2D(il,Uf,vu,null,0),nt.framebufferTexture2D(il,Jf,vu,null,0),Ln(Uf,Mn.depthAttachment),Ln(Jf,Mn.stencilAttachment),Ln(Bu,Mn.depthStencilAttachment);var mi=nt.checkFramebufferStatus(il);nt.isContextLost(),nt.bindFramebuffer(il,wa.next?wa.next.framebuffer:null),wa.cur=wa.next,nt.getError()}function qa(Mn,An){var Jn=new Vn;xa.framebufferCount++;function mi(zn,ii){var Ei,Ri=0,Gi=0,Ps=!0,xl=!0,ho=null,Hl=!0,fs="rgba",Al="uint8",El=1,Ql=null,Fs=null,pl=null,bl=!1;if(typeof zn=="number")Ri=zn|0,Gi=ii|0||Ri;else if(!zn)Ri=Gi=1;else{var Hi=zn;if("shape"in Hi){var Cl=Hi.shape;Ri=Cl[0],Gi=Cl[1]}else"radius"in Hi&&(Ri=Gi=Hi.radius),"width"in Hi&&(Ri=Hi.width),"height"in Hi&&(Gi=Hi.height);("color"in Hi||"colors"in Hi)&&(ho=Hi.color||Hi.colors,Array.isArray(ho)),ho||("colorCount"in Hi&&(El=Hi.colorCount|0),"colorTexture"in Hi&&(Hl=!!Hi.colorTexture,fs="rgba4"),"colorType"in Hi&&(Al=Hi.colorType,Hl||(Al==="half float"||Al==="float16"?fs="rgba16f":(Al==="float"||Al==="float32")&&(fs="rgba32f"))),"colorFormat"in Hi&&(fs=Hi.colorFormat,Ja.indexOf(fs)>=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;Ei<El;++Ei)Lo[Ei]=ea(Ri,Gi,Hl,fs,Al);Ri=Ri||Lo[0].width,Gi=Gi||Lo[0].height,Ql?ve=Va(Ql):Ps&&!xl&&(ve=ea(Ri,Gi,bl,"depth","uint32")),Fs?Y=Va(Fs):xl&&!Ps&&(Y=ea(Ri,Gi,!1,"stencil","uint8")),pl?ye=Va(pl):!Ql&&!Fs&&xl&&Ps&&(ye=ea(Ri,Gi,bl,"depth stencil","depth stencil"));var te=null;for(Ei=0;Ei<Lo.length;++Ei)if(Bn(Lo[Ei],Ri,Gi),Lo[Ei]&&Lo[Ei].texture){var me=of[Lo[Ei].texture._texture.format]*tu[Lo[Ei].texture._texture.type];te===null&&(te=me)}return Bn(ve,Ri,Gi),Bn(Y,Ri,Gi),Bn(ye,Ri,Gi),Rn(Jn),Jn.width=Ri,Jn.height=Gi,Jn.colorAttachments=Lo,Jn.depthAttachment=ve,Jn.stencilAttachment=Y,Jn.depthStencilAttachment=ye,mi.color=Lo.map(Ea),mi.depth=Ea(ve),mi.stencil=Ea(Y),mi.depthStencil=Ea(ye),mi.width=Jn.width,mi.height=Jn.height,Za(Jn),mi}function Ii(zn,ii){var Ei=Math.max(zn|0,1),Ri=Math.max(ii|0||Ei,1);if(Ei===Jn.width&&Ri===Jn.height)return mi;for(var Gi=Jn.colorAttachments,Ps=0;Ps<Gi.length;++Ps)an(Gi[Ps],Ei,Ri);return an(Jn.depthAttachment,Ei,Ri),an(Jn.stencilAttachment,Ei,Ri),an(Jn.depthStencilAttachment,Ei,Ri),Jn.width=mi.width=Ei,Jn.height=mi.height=Ri,Za(Jn),mi}return mi(Mn,An),v(mi,{resize:Ii,_reglType:"framebuffer",_framebuffer:Jn,destroy:function(){hi(Jn),Rn(Jn)},use:function(zn){wa.setFBO({framebuffer:mi},zn)}})}function Qn(Mn){var An=Array(6);function Jn(Ii){var zn,ii={color:null},Ei=0,Ri=null,Gi="rgba",Ps="uint8",xl=1;if(typeof Ii=="number")Ei=Ii|0;else if(!Ii)Ei=1;else{var ho=Ii;if("shape"in ho){var Hl=ho.shape;Ei=Hl[0]}else"radius"in ho&&(Ei=ho.radius|0),"width"in ho?(Ei=ho.width|0,"height"in ho):"height"in ho&&(Ei=ho.height|0);("color"in ho||"colors"in ho)&&(Ri=ho.color||ho.colors,Array.isArray(Ri)),Ri||("colorCount"in ho&&(xl=ho.colorCount|0),"colorType"in ho&&(Ps=ho.colorType),"colorFormat"in ho&&(Gi=ho.colorFormat)),"depth"in ho&&(ii.depth=ho.depth),"stencil"in ho&&(ii.stencil=ho.stencil),"depthStencil"in ho&&(ii.depthStencil=ho.depthStencil)}var fs;if(Ri)if(Array.isArray(Ri))for(fs=[],zn=0;zn<Ri.length;++zn)fs[zn]=Ri[zn];else fs=[Ri];else{fs=Array(xl);var Al={radius:Ei,format:Gi,type:Ps};for(zn=0;zn<xl;++zn)fs[zn]=ua.createCube(Al)}for(ii.color=Array(fs.length),zn=0;zn<fs.length;++zn){var El=fs[zn];Ei=Ei||El.width,ii.color[zn]={target:bu,data:fs[zn]}}for(zn=0;zn<6;++zn){for(var Ql=0;Ql<fs.length;++Ql)ii.color[Ql].target=bu+zn;zn>0&&(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.length;++zn)Ei[zn].resize(ii);for(zn=0;zn<6;++zn)An[zn].resize(ii);return Jn.width=Jn.height=ii,Jn}return Jn(Mn),v(Jn,{faces:An,resize:mi,_reglType:"framebufferCube",destroy:function(){An.forEach(function(Ii){Ii.destroy()})}})}function Fn(){wa.cur=null,wa.next=null,wa.dirty=!0,bt(Wa).forEach(function(Mn){Mn.framebuffer=nt.createFramebuffer(),Za(Mn)})}return v(wa,{getFramebuffer:function(Mn){if(typeof Mn=="function"&&Mn._reglType==="framebuffer"){var An=Mn._framebuffer;if(An instanceof Vn)return An}return null},create:qa,createCube:Qn,clear:function(){bt(Wa).forEach(hi)},restore:Fn})}var uh=5126,vf=34962,ol=34963;function mu(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=uh,this.offset=0,this.stride=0,this.divisor=0}function Pu(nt,Yt,cr,ua,Aa,xa,wa){for(var Ja=cr.maxAttributes,Sn=new Array(Ja),wn=0;wn<Ja;++wn)Sn[wn]=new mu;var hn=0,yi={},Bn={Record:mu,scope:{},state:Sn,currentVAO:null,targetVAO:null,restore:Va()?Rn:function(){},createVAO:hi,getVAO:Ea,destroyBuffer:Ln,setVAO:Va()?an:gn,clear:Va()?Wa:function(){}};function Ln(Za){for(var qa=0;qa<Sn.length;++qa){var Qn=Sn[qa];Qn.buffer===Za&&(nt.disableVertexAttribArray(qa),Qn.buffer=null)}}function Va(){return Yt.oes_vertex_array_object}function ea(){return Yt.angle_instanced_arrays}function Ea(Za){return typeof Za=="function"&&Za._vao?Za._vao:null}function an(Za){if(Za!==Bn.currentVAO){var qa=Va();Za?qa.bindVertexArrayOES(Za.vao):qa.bindVertexArrayOES(null),Bn.currentVAO=Za}}function gn(Za){if(Za!==Bn.currentVAO){if(Za)Za.bindAttrs();else{for(var qa=ea(),Qn=0;Qn<Sn.length;++Qn){var Fn=Sn[Qn];Fn.buffer?(nt.enableVertexAttribArray(Qn),Fn.buffer.bind(),nt.vertexAttribPointer(Qn,Fn.size,Fn.type,Fn.normalized,Fn.stride,Fn.offfset),qa&&Fn.divisor&&qa.vertexAttribDivisorANGLE(Qn,Fn.divisor)):(nt.disableVertexAttribArray(Qn),nt.vertexAttrib4f(Qn,Fn.x,Fn.y,Fn.z,Fn.w))}wa.elements?nt.bindBuffer(ol,wa.elements.buffer.buffer):nt.bindBuffer(ol,null)}Bn.currentVAO=Za}}function Wa(){bt(yi).forEach(function(Za){Za.destroy()})}function Vn(){this.id=++hn,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var Za=Va();Za?this.vao=Za.createVertexArrayOES():this.vao=null,yi[this.id]=this,this.buffers=[]}Vn.prototype.bindAttrs=function(){for(var Za=ea(),qa=this.attributes,Qn=0;Qn<qa.length;++Qn){var Fn=qa[Qn];Fn.buffer?(nt.enableVertexAttribArray(Qn),nt.bindBuffer(vf,Fn.buffer.buffer),nt.vertexAttribPointer(Qn,Fn.size,Fn.type,Fn.normalized,Fn.stride,Fn.offset),Za&&Fn.divisor&&Za.vertexAttribDivisorANGLE(Qn,Fn.divisor)):(nt.disableVertexAttribArray(Qn),nt.vertexAttrib4f(Qn,Fn.x,Fn.y,Fn.z,Fn.w))}for(var Mn=qa.length;Mn<Ja;++Mn)nt.disableVertexAttribArray(Mn);var An=xa.getElements(this.elements);An?nt.bindBuffer(ol,An.buffer.buffer):nt.bindBuffer(ol,null)},Vn.prototype.refresh=function(){var Za=Va();Za&&(Za.bindVertexArrayOES(this.vao),this.bindAttrs(),Bn.currentVAO=null,Za.bindVertexArrayOES(null))},Vn.prototype.destroy=function(){if(this.vao){var Za=Va();this===Bn.currentVAO&&(Bn.currentVAO=null,Za.bindVertexArrayOES(null)),Za.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),yi[this.id]&&(delete yi[this.id],ua.vaoCount-=1)};function Rn(){var Za=Va();Za&&bt(yi).forEach(function(qa){qa.refresh()})}function hi(Za){var qa=new Vn;ua.vaoCount+=1;function Qn(Fn){var Mn;if(Array.isArray(Fn))Mn=Fn,qa.elements&&qa.ownsElements&&qa.elements.destroy(),qa.elements=null,qa.ownsElements=!1,qa.offset=0,qa.count=0,qa.instances=-1,qa.primitive=4;else{if(Fn.elements){var An=Fn.elements;qa.ownsElements?typeof An=="function"&&An._reglType==="elements"?(qa.elements.destroy(),qa.ownsElements=!1):(qa.elements(An),qa.ownsElements=!1):xa.getElements(Fn.elements)?(qa.elements=Fn.elements,qa.ownsElements=!1):(qa.elements=xa.create(Fn.elements),qa.ownsElements=!0)}else qa.elements=null,qa.ownsElements=!1;Mn=Fn.attributes,qa.offset=0,qa.count=-1,qa.instances=-1,qa.primitive=4,qa.elements&&(qa.count=qa.elements._elements.vertCount,qa.primitive=qa.elements._elements.primType),"offset"in Fn&&(qa.offset=Fn.offset|0),"count"in Fn&&(qa.count=Fn.count|0),"instances"in Fn&&(qa.instances=Fn.instances|0),"primitive"in Fn&&(qa.primitive=xt[Fn.primitive])}var Jn={},mi=qa.attributes;mi.length=Mn.length;for(var Ii=0;Ii<Mn.length;++Ii){var zn=Mn[Ii],ii=mi[Ii]=new mu,Ei=zn.data||zn;if(Array.isArray(Ei)||wr(Ei)||Ir(Ei)){var Ri;qa.buffers[Ii]&&(Ri=qa.buffers[Ii],wr(Ei)&&Ri._buffer.byteLength>=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;Gi<qa.buffers.length;++Gi)!Jn[Gi]&&qa.buffers[Gi]&&(qa.buffers[Gi].destroy(),qa.buffers[Gi]=null);return qa.refresh(),Qn}return Qn.destroy=function(){for(var Fn=0;Fn<qa.buffers.length;++Fn)qa.buffers[Fn]&&qa.buffers[Fn].destroy();qa.buffers.length=0,qa.ownsElements&&(qa.elements.destroy(),qa.elements=null,qa.ownsElements=!1),qa.destroy()},Qn._vao=qa,Qn._reglType="vao",Qn(Za)}return Bn}var kf=35632,hl=35633,sf=35718,Mc=35721;function Hu(nt,Yt,cr,ua){var Aa={},xa={};function wa(ea,Ea,an,gn){this.name=ea,this.id=Ea,this.location=an,this.info=gn}function Ja(ea,Ea){for(var an=0;an<ea.length;++an)if(ea[an].id===Ea.id){ea[an].location=Ea.location;return}ea.push(Ea)}function Sn(ea,Ea,an){var gn=ea===kf?Aa:xa,Wa=gn[Ea];if(!Wa){var Vn=Yt.str(Ea);Wa=nt.createShader(ea),nt.shaderSource(Wa,Vn),nt.compileShader(Wa),gn[Ea]=Wa}return Wa}var wn={},hn=[],yi=0;function Bn(ea,Ea){this.id=yi++,this.fragId=ea,this.vertId=Ea,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ua.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Ln(ea,Ea,an){var gn,Wa,Vn=Sn(kf,ea.fragId),Rn=Sn(hl,ea.vertId),hi=ea.program=nt.createProgram();if(nt.attachShader(hi,Vn),nt.attachShader(hi,Rn),an)for(gn=0;gn<an.length;++gn){var Za=an[gn];nt.bindAttribLocation(hi,Za[0],Za[1])}nt.linkProgram(hi);var qa=nt.getProgramParameter(hi,sf);ua.profile&&(ea.stats.uniformsCount=qa);var Qn=ea.uniforms;for(gn=0;gn<qa;++gn)if(Wa=nt.getActiveUniform(hi,gn),Wa)if(Wa.size>1)for(var Fn=0;Fn<Wa.size;++Fn){var Mn=Wa.name.replace("[0]","["+Fn+"]");Ja(Qn,new wa(Mn,Yt.id(Mn),nt.getUniformLocation(hi,Mn),Wa))}else Ja(Qn,new wa(Wa.name,Yt.id(Wa.name),nt.getUniformLocation(hi,Wa.name),Wa));var An=nt.getProgramParameter(hi,Mc);ua.profile&&(ea.stats.attributesCount=An);var Jn=ea.attributes;for(gn=0;gn<An;++gn)Wa=nt.getActiveAttrib(hi,gn),Wa&&Ja(Jn,new wa(Wa.name,Yt.id(Wa.name),nt.getAttribLocation(hi,Wa.name),Wa))}ua.profile&&(cr.getMaxUniformsCount=function(){var ea=0;return hn.forEach(function(Ea){Ea.stats.uniformsCount>ea&&(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;ea<hn.length;++ea)Ln(hn[ea],null,hn[ea].attributes.map(function(Ea){return[Ea.location,Ea.name]}))}return{clear:function(){var ea=nt.deleteShader.bind(nt);bt(Aa).forEach(ea),Aa={},bt(xa).forEach(ea),xa={},hn.forEach(function(Ea){nt.deleteProgram(Ea.program)}),hn.length=0,wn={},cr.shaderCount=0},program:function(ea,Ea,an,gn){var Wa=wn[Ea];Wa||(Wa=wn[Ea]={});var Vn=Wa[ea];if(Vn&&(Vn.refCount++,!gn))return Vn;var Rn=new Bn(Ea,ea);return cr.shaderCount++,Ln(Rn,an,gn),Vn||(Wa[ea]=Rn),hn.push(Rn),v(Rn,{destroy:function(){if(Rn.refCount--,Rn.refCount<=0){nt.deleteProgram(Rn.program);var hi=hn.indexOf(Rn);hn.splice(hi,1),cr.shaderCount--}Wa[Rn.vertId].refCount<=0&&(nt.deleteShader(xa[Rn.vertId]),delete xa[Rn.vertId],delete wn[Rn.fragId][Rn.vertId]),Object.keys(wn[Rn.fragId]).length||(nt.deleteShader(Aa[Rn.fragId]),delete Aa[Rn.fragId],delete wn[Rn.fragId])}})},restore:Va,shader:Sn,frag:-1,vert:-1}}var mf=6408,Wu=5121,Zc=3333,Lf=5126;function ru(nt,Yt,cr,ua,Aa,xa,wa){function Ja(hn){var yi;Yt.next===null?yi=Wu:yi=Yt.next.colorAttachments[0].texture._texture.type;var Bn=0,Ln=0,Va=ua.framebufferWidth,ea=ua.framebufferHeight,Ea=null;wr(hn)?Ea=hn:hn&&(Bn=hn.x|0,Ln=hn.y|0,Va=(hn.width||ua.framebufferWidth-Bn)|0,ea=(hn.height||ua.framebufferHeight-Ln)|0,Ea=hn.data||null),cr();var an=Va*ea*4;return Ea||(yi===Wu?Ea=new Uint8Array(an):yi===Lf&&(Ea=Ea||new Float32Array(an))),nt.pixelStorei(Zc,4),nt.readPixels(Bn,Ln,Va,ea,mf,yi,Ea),Ea}function Sn(hn){var yi;return Yt.setFBO({framebuffer:hn.framebuffer},function(){yi=Ja(hn)}),yi}function wn(hn){return!hn||!("framebuffer"in hn)?Ja(hn):Sn(hn)}return wn}var jf=0,Xu="";function Ec(nt){return gu(mc(sc(nt)))}function mc(nt){return er(Dn(kc(nt),nt.length*8))}function jl(nt,Yt){var cr=kc(nt);cr.length>16&&(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<nt.length;Aa++)ua=nt.charCodeAt(Aa),cr+=Yt.charAt(ua>>>4&15)+Yt.charAt(ua&15);return cr}function Cc(nt){for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cr="",ua=nt.length,Aa=0;Aa<ua;Aa+=3)for(var xa=nt.charCodeAt(Aa)<<16|(Aa+1<ua?nt.charCodeAt(Aa+1)<<8:0)|(Aa+2<ua?nt.charCodeAt(Aa+2):0),wa=0;wa<4;wa++)Aa*8+wa*6>nt.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;Aa<Sn.length;Aa++)Sn[Aa]=nt.charCodeAt(Aa*2)<<8|nt.charCodeAt(Aa*2+1);for(;Sn.length>0;){for(Ja=Array(),wa=0,Aa=0;Aa<Sn.length;Aa++)wa=(wa<<16)+Sn[Aa],xa=Math.floor(wa/cr),wa-=xa*cr,(Ja.length>0||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<hn;Aa++)wn=Yt[0]+wn;return wn}function sc(nt){for(var Yt="",cr=-1,ua,Aa;++cr<nt.length;)ua=nt.charCodeAt(cr),Aa=cr+1<nt.length?nt.charCodeAt(cr+1):0,55296<=ua&&ua<=56319&&56320<=Aa&&Aa<=57343&&(ua=65536+((ua&1023)<<10)+(Aa&1023),cr++),ua<=127?Yt+=String.fromCharCode(ua):ua<=2047?Yt+=String.fromCharCode(192|ua>>>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<Yt.length;cr++)Yt[cr]=0;for(var cr=0;cr<nt.length*8;cr+=8)Yt[cr>>5]|=(nt.charCodeAt(cr/8)&255)<<24-cr%32;return Yt}function er(nt){for(var Yt="",cr=0;cr<nt.length*32;cr+=8)Yt+=String.fromCharCode(nt[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<nt.length;Bn+=16){for(Aa=cr[0],xa=cr[1],wa=cr[2],Ja=cr[3],Sn=cr[4],wn=cr[5],hn=cr[6],yi=cr[7],Ln=0;Ln<64;Ln++)Ln<16?ua[Ln]=nt[Ln+Bn]:ua[Ln]=On(On(On(ri(ua[Ln-2]),ua[Ln-7]),Yn(ua[Ln-15])),ua[Ln-16]),Va=On(On(On(On(yi,In(Sn)),$r(Sn,wn,hn)),di[Ln]),ua[Ln]),ea=On(pn(Aa),La(Aa,xa,wa)),yi=hn,hn=wn,wn=Sn,Sn=On(Ja,Va),Ja=wa,wa=xa,xa=Aa,Aa=On(Va,ea);cr[0]=On(Aa,cr[0]),cr[1]=On(xa,cr[1]),cr[2]=On(wa,cr[2]),cr[3]=On(Ja,cr[3]),cr[4]=On(Sn,cr[4]),cr[5]=On(wn,cr[5]),cr[6]=On(hn,cr[6]),cr[7]=On(yi,cr[7])}return cr}function On(nt,Yt){var cr=(nt&65535)+(Yt&65535),ua=(nt>>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;an<Aa.length;++an)if(Aa[an]===Va&&!xa[an])return ua[an]}var gn="g"+cr++;return ua.push(gn),Aa.push(Va),xa.push(Ea),gn}function Ja(){var Va=[];function ea(){Va.push.apply(Va,qn(arguments))}var Ea=[];function an(){var gn="v"+cr++;return Ea.push(gn),arguments.length>0&&(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<ea;++gn)an();var Wa=Sn(),Vn=Wa.toString,Rn=yi[Va]=v(Wa,{arg:an,toString:function(){return xn(["function(",Ea.join(),"){",Vn(),"}"])}});return Rn}function Ln(){var Va=['"use strict";',hn,"return {"];Object.keys(yi).forEach(function(gn){Va.push('"',gn,'":',yi[gn].toString(),",")}),Va.push("}");var ea=xn(Va).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),Ea;if(Yt&&(Ea=Ec(ea),Yt[Ea]))return Yt[Ea].apply(null,Aa);var an=Function.apply(null,ua.concat(ea));return Yt&&(Yt[Ea]=an),an.apply(null,Aa)}return{global:hn,link:wa,block:Ja,proc:Bn,scope:Sn,cond:wn,compile:Ln}}var Ki="xyzw".split(""),ao=5121,Ji=1,co=2,wi=0,ui=1,xo=2,Qo=3,xs=4,Qs=5,Rs=6,Ks="dither",ys="blend.enable",Fl="blend.color",yl="blend.equation",sl="blend.func",Ui="depth.enable",Io="depth.func",Xs="depth.range",Ls="depth.mask",ou="colorMask",Iu="cull.enable",Zu="cull.face",Lc="frontFace",yu="lineWidth",Pc="polygonOffset.enable",wu="polygonOffset.offset",gc="sample.alpha",fo="sample.enable",zo="sample.coverage",Ic="stencil.enable",lc="stencil.mask",Yu="stencil.func",Ne="stencil.opFront",R="stencil.opBack",ae="scissor.enable",we="scissor.box",Se="viewport",Oe="profile",pt="framebuffer",At="vert",Bt="frag",$t="elements",br="primitive",Ar="count",Yr="offset",sa="instances",He="vao",Je="Width",lt="Height",dt=pt+Je,Ct=pt+lt,wt=Se+Je,Dt=Se+lt,ur="drawingBuffer",mr=ur+Je,Er=ur+lt,Br=[sl,yl,Yu,Ne,R,zo,Se,we,wu],Qr=34962,ga=34963,Sa=2884,Oa=3042,vn=3024,Xn=2960,Hn=2929,oi=3089,Ti=32823,Wi=32926,Bi=32928,Ao=5126,ss=35664,So=35665,Ko=35666,hs=5124,ll=35667,Js=35668,es=35669,ts=35670,Pl=35671,$l=35672,Ru=35673,hu=35674,wl=35675,su=35676,uc=35678,Vl=35680,ql=4,de=1028,De=1029,et=2304,vt=2305,_t=32775,St=32776,ar=519,zt=7680,gr=0,qr=1,Wr=32774,Ta=513,ya=36160,tn=36064,on={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ma={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":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<cr?-1:1})}function Pa(nt,Yt,cr,ua){this.thisDep=nt,this.contextDep=Yt,this.propDep=cr,this.append=ua}function si(nt){return nt&&!(nt.thisDep||nt.contextDep||nt.propDep)}function ni(nt){return new Pa(!1,!1,!1,nt)}function vi(nt,Yt){var cr=nt.type;if(cr===wi){var ua=nt.data.length;return new Pa(!0,ua>=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<nt.data.length;++Sn){var wn=nt.data[Sn];if(wn.type===ui)Ja=!0;else if(wn.type===xo)wa=!0;else if(wn.type===Qo)xa=!0;else if(wn.type===wi){xa=!0;var hn=wn.data;hn>=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<sr.length;++lr)pr.push([fr[sr[lr]]|0,sr[lr]]);return pr}}return null}function xl(gt,Et,Ft){var nr=gt.static,fr=gt.dynamic;function sr(Vt){if(Vt in nr){var Dr=Yt.id(nr[Vt]),Jr=ni(function(){return Dr});return Jr.id=Dr,Jr}else if(Vt in fr){var ba=fr[Vt];return vi(ba,function(_n,Xa){var ln=_n.invoke(Xa,ba),$n=Xa.def(_n.shared.strings,".id(",ln,")");return $n})}return null}var pr=sr(Bt),lr=sr(At),Xt=null,or;return si(pr)&&si(lr)?(Xt=hn.program(lr.id,pr.id,null,Ft),or=ni(function(Vt,Dr){return Vt.link(Xt)})):or=new Pa(pr&&pr.thisDep||lr&&lr.thisDep,pr&&pr.contextDep||lr&&lr.contextDep,pr&&pr.propDep||lr&&lr.propDep,function(Vt,Dr){var Jr=Vt.shared.shader,ba;pr?ba=pr.append(Vt,Dr):ba=Dr.def(Jr,".",Bt);var _n;lr?_n=lr.append(Vt,Dr):_n=Dr.def(Jr,".",At);var Xa=Jr+".program("+_n+","+ba;return Dr.def(Xa+")")}),{frag:pr,vert:lr,progVar:or,program:Xt}}function ho(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={},sr=!1;function pr(){if(He in Ft){var Nn=Ft[He];return Nn!==null&&wn.getVAO(Nn)===null&&(Nn=wn.createVAO(Nn)),sr=!0,fr.vao=Nn,ni(function(Tn){var En=wn.getVAO(Nn);return En?Tn.link(En):"null"})}else if(He in nr){sr=!0;var dn=nr[He];return vi(dn,function(Tn,En){var Gn=Tn.invoke(En,dn);return En.def(Tn.shared.vao+".getVAO("+Gn+")")})}return null}var lr=pr(),Xt=!1;function or(){if($t in Ft){var Nn=Ft[$t];if(fr.elements=Nn,mn(Nn)){var dn=fr.elements=xa.create(Nn,!0);Nn=xa.getElements(dn),Xt=!0}else Nn&&(Nn=xa.getElements(Nn),Xt=!0);var Tn=ni(function(Gn,ci){if(Nn){var bo=Gn.link(Nn);return Gn.ELEMENTS=bo,bo}return Gn.ELEMENTS=null,null});return Tn.value=Nn,Tn}else if($t in nr){Xt=!0;var En=nr[$t];return vi(En,function(Gn,ci){var bo=Gn.shared,jo=bo.isBufferArgs,ks=bo.elements,Fo=Gn.invoke(ci,En),bs=ci.def("null"),Hs=ci.def(jo,"(",Fo,")"),pu=Gn.cond(Hs).then(bs,"=",ks,".createStream(",Fo,");").else(bs,"=",ks,".getElements(",Fo,");");return ci.entry(pu),ci.exit(Gn.cond(Hs).then(ks,".destroyStream(",bs,");")),Gn.ELEMENTS=bs,bs})}else if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.elements+".getElements("+Gn.shared.vao+".currentVAO.elements):null")});return null}var Vt=or();function Dr(){if(br in Ft){var Nn=Ft[br];return fr.primitive=Nn,ni(function(Tn,En){return xt[Nn]})}else if(br in nr){var dn=nr[br];return vi(dn,function(Tn,En){var Gn=Tn.constants.primTypes,ci=Tn.invoke(En,dn);return En.def(Gn,"[",ci,"]")})}else{if(Xt)return si(Vt)?Vt.value?ni(function(Tn,En){return En.def(Tn.ELEMENTS,".primType")}):ni(function(){return ql}):new Pa(Vt.thisDep,Vt.contextDep,Vt.propDep,function(Tn,En){var Gn=Tn.ELEMENTS;return En.def(Gn,"?",Gn,".primType:",ql)});if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Tn,En){return En.def(Tn.shared.vao+".currentVAO?"+Tn.shared.vao+".currentVAO.primitive:"+ql)})}return null}function Jr(Nn,dn){if(Nn in Ft){var Tn=Ft[Nn]|0;return dn?fr.offset=Tn:fr.instances=Tn,ni(function(Gn,ci){return dn&&(Gn.OFFSET=Tn),Tn})}else if(Nn in nr){var En=nr[Nn];return vi(En,function(Gn,ci){var bo=Gn.invoke(ci,En);return dn&&(Gn.OFFSET=bo),bo})}else if(dn){if(Xt)return ni(function(Gn,ci){return Gn.OFFSET=0,0});if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.vao+".currentVAO.offset:0")})}else if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.vao+".currentVAO.instances:-1")});return null}var ba=Jr(Yr,!0);function _n(){if(Ar in Ft){var Nn=Ft[Ar]|0;return fr.count=Nn,ni(function(){return Nn})}else if(Ar in nr){var dn=nr[Ar];return vi(dn,function(ci,bo){var jo=ci.invoke(bo,dn);return jo})}else if(Xt)if(si(Vt)){if(Vt)return ba?new Pa(ba.thisDep,ba.contextDep,ba.propDep,function(ci,bo){var jo=bo.def(ci.ELEMENTS,".vertCount-",ci.OFFSET);return jo}):ni(function(ci,bo){return bo.def(ci.ELEMENTS,".vertCount")});var Tn=ni(function(){return-1});return Tn}else{var En=new Pa(Vt.thisDep||ba.thisDep,Vt.contextDep||ba.contextDep,Vt.propDep||ba.propDep,function(ci,bo){var jo=ci.ELEMENTS;return ci.OFFSET?bo.def(jo,"?",jo,".vertCount-",ci.OFFSET,":-1"):bo.def(jo,"?",jo,".vertCount:-1")});return En}else if(sr){var Gn=new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(ci,bo){return bo.def(ci.shared.vao,".currentVAO?",ci.shared.vao,".currentVAO.count:-1")});return Gn}return null}var Xa=Dr(),ln=_n(),$n=Jr(sa,!1);return{elements:Vt,primitive:Xa,count:ln,instances:$n,offset:ba,vao:lr,vaoActive:sr,elementsActive:Xt,static:fr}}function Hl(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Za.forEach(function(sr){var pr=Fn(sr);function lr(Xt,or){if(sr in Ft){var Vt=Xt(Ft[sr]);fr[pr]=ni(function(){return Vt})}else if(sr in nr){var Dr=nr[sr];fr[pr]=vi(Dr,function(Jr,ba){return or(Jr,ba,Jr.invoke(ba,Dr))})}}switch(sr){case Iu:case ys:case Ks:case Ic:case Ui:case ae:case Pc:case gc:case fo:case Ls:return lr(function(Xt){return Xt},function(Xt,or,Vt){return Vt});case Io:return lr(function(Xt){return Ma[Xt]},function(Xt,or,Vt){var Dr=Xt.constants.compareFuncs;return or.def(Dr,"[",Vt,"]")});case Xs:return lr(function(Xt){return Xt},function(Xt,or,Vt){var Dr=or.def("+",Vt,"[0]"),Jr=or.def("+",Vt,"[1]");return[Dr,Jr]});case sl:return lr(function(Xt){var or="srcRGB"in Xt?Xt.srcRGB:Xt.src,Vt="srcAlpha"in Xt?Xt.srcAlpha:Xt.src,Dr="dstRGB"in Xt?Xt.dstRGB:Xt.dst,Jr="dstAlpha"in Xt?Xt.dstAlpha:Xt.dst;return[on[or],on[Dr],on[Vt],on[Jr]]},function(Xt,or,Vt){var Dr=Xt.constants.blendFuncs;function Jr(dn,Tn){var En=or.def('"',dn,Tn,'" in ',Vt,"?",Vt,".",dn,Tn,":",Vt,".",dn);return En}var ba=Jr("src","RGB"),_n=Jr("dst","RGB"),Xa=or.def(Dr,"[",ba,"]"),ln=or.def(Dr,"[",Jr("src","Alpha"),"]"),$n=or.def(Dr,"[",_n,"]"),Nn=or.def(Dr,"[",Jr("dst","Alpha"),"]");return[Xa,$n,ln,Nn]});case yl:return lr(function(Xt){if(typeof Xt=="string")return[an[Xt],an[Xt]];if(typeof Xt=="object")return[an[Xt.rgb],an[Xt.alpha]]},function(Xt,or,Vt){var Dr=Xt.constants.blendEquations,Jr=or.def(),ba=or.def(),_n=Xt.cond("typeof ",Vt,'==="string"');return _n.then(Jr,"=",ba,"=",Dr,"[",Vt,"];"),_n.else(Jr,"=",Dr,"[",Vt,".rgb];",ba,"=",Dr,"[",Vt,".alpha];"),or(_n),[Jr,ba]});case Fl:return lr(function(Xt){return p(4,function(or){return+Xt[or]})},function(Xt,or,Vt){return p(4,function(Dr){return or.def("+",Vt,"[",Dr,"]")})});case lc:return lr(function(Xt){return Xt|0},function(Xt,or,Vt){return or.def(Vt,"|0")});case Yu:return lr(function(Xt){var or=Xt.cmp||"keep",Vt=Xt.ref||0,Dr="mask"in Xt?Xt.mask:-1;return[Ma[or],Vt,Dr]},function(Xt,or,Vt){var Dr=Xt.constants.compareFuncs,Jr=or.def('"cmp" in ',Vt,"?",Dr,"[",Vt,".cmp]",":",zt),ba=or.def(Vt,".ref|0"),_n=or.def('"mask" in ',Vt,"?",Vt,".mask|0:-1");return[Jr,ba,_n]});case Ne:case R:return lr(function(Xt){var or=Xt.fail||"keep",Vt=Xt.zfail||"keep",Dr=Xt.zpass||"keep";return[sr===R?De:de,Na[or],Na[Vt],Na[Dr]]},function(Xt,or,Vt){var Dr=Xt.constants.stencilOps;function Jr(ba){return or.def('"',ba,'" in ',Vt,"?",Dr,"[",Vt,".",ba,"]:",zt)}return[sr===R?De:de,Jr("fail"),Jr("zfail"),Jr("zpass")]});case wu:return lr(function(Xt){var or=Xt.factor|0,Vt=Xt.units|0;return[or,Vt]},function(Xt,or,Vt){var Dr=or.def(Vt,".factor|0"),Jr=or.def(Vt,".units|0");return[Dr,Jr]});case Zu:return lr(function(Xt){var or=0;return Xt==="front"?or=de:Xt==="back"&&(or=De),or},function(Xt,or,Vt){return or.def(Vt,'==="front"?',de,":",De)});case yu:return lr(function(Xt){return Xt},function(Xt,or,Vt){return Vt});case Lc:return lr(function(Xt){return Ka[Xt]},function(Xt,or,Vt){return or.def(Vt+'==="cw"?'+et+":"+vt)});case ou:return lr(function(Xt){return Xt.map(function(or){return!!or})},function(Xt,or,Vt){return p(4,function(Dr){return"!!"+Vt+"["+Dr+"]"})});case zo:return lr(function(Xt){var or="value"in Xt?Xt.value:1,Vt=!!Xt.invert;return[or,Vt]},function(Xt,or,Vt){var Dr=or.def('"value" in ',Vt,"?+",Vt,".value:1"),Jr=or.def("!!",Vt,".invert");return[Dr,Jr]})}}),fr}function fs(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Object.keys(Ft).forEach(function(sr){var pr=Ft[sr],lr;if(typeof pr=="number"||typeof pr=="boolean")lr=ni(function(){return pr});else if(typeof pr=="function"){var Xt=pr._reglType;Xt==="texture2d"||Xt==="textureCube"?lr=ni(function(or){return or.link(pr)}):(Xt==="framebuffer"||Xt==="framebufferCube")&&(lr=ni(function(or){return or.link(pr.color[0])}))}else Ya(pr)&&(lr=ni(function(or){var Vt=or.global.def("[",p(pr.length,function(Dr){return pr[Dr]}),"]");return Vt}));lr.value=pr,fr[sr]=lr}),Object.keys(nr).forEach(function(sr){var pr=nr[sr];fr[sr]=vi(pr,function(lr,Xt){return lr.invoke(Xt,pr)})}),fr}function Al(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Object.keys(Ft).forEach(function(sr){var pr=Ft[sr],lr=Yt.id(sr),Xt=new Ea;if(mn(pr))Xt.state=Ji,Xt.buffer=Aa.getBuffer(Aa.create(pr,Qr,!1,!0)),Xt.type=0;else{var or=Aa.getBuffer(pr);if(or)Xt.state=Ji,Xt.buffer=or,Xt.type=0;else if("constant"in pr){var Vt=pr.constant;Xt.buffer="null",Xt.state=co,typeof Vt=="number"?Xt.x=Vt:Ki.forEach(function($n,Nn){Nn<Vt.length&&(Xt[$n]=Vt[Nn])})}else{mn(pr.buffer)?or=Aa.getBuffer(Aa.create(pr.buffer,Qr,!1,!0)):or=Aa.getBuffer(pr.buffer);var Dr=pr.offset|0,Jr=pr.stride|0,ba=pr.size|0,_n=!!pr.normalized,Xa=0;"type"in pr&&(Xa=la[pr.type]);var ln=pr.divisor|0;Xt.buffer=or,Xt.state=Ji,Xt.size=ba,Xt.normalized=_n,Xt.type=Xa||or.dtype,Xt.offset=Dr,Xt.stride=Jr,Xt.divisor=ln}}fr[sr]=ni(function($n,Nn){var dn=$n.attribCache;if(lr in dn)return dn[lr];var Tn={isStream:!1};return Object.keys(Xt).forEach(function(En){Tn[En]=Xt[En]}),Xt.buffer&&(Tn.buffer=$n.link(Xt.buffer),Tn.type=Tn.type||Tn.buffer+".dtype"),dn[lr]=Tn,Tn})}),Object.keys(nr).forEach(function(sr){var pr=nr[sr];function lr(Xt,or){var Vt=Xt.invoke(or,pr),Dr=Xt.shared,Jr=Xt.constants,ba=Dr.isBufferArgs,_n=Dr.buffer,Xa={isStream:or.def(!1)},ln=new Ea;ln.state=Ji,Object.keys(ln).forEach(function(Tn){Xa[Tn]=or.def(""+ln[Tn])});var $n=Xa.buffer,Nn=Xa.type;or("if(",ba,"(",Vt,")){",Xa.isStream,"=true;",$n,"=",_n,".createStream(",Qr,",",Vt,");",Nn,"=",$n,".dtype;","}else{",$n,"=",_n,".getBuffer(",Vt,");","if(",$n,"){",Nn,"=",$n,".dtype;",'}else if("constant" in ',Vt,"){",Xa.state,"=",co,";","if(typeof "+Vt+'.constant === "number"){',Xa[Ki[0]],"=",Vt,".constant;",Ki.slice(1).map(function(Tn){return Xa[Tn]}).join("="),"=0;","}else{",Ki.map(function(Tn,En){return Xa[Tn]+"="+Vt+".constant.length>"+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;or<nr.length;++or){var Vt=nr[or],Dr=Vt.name,Jr=Vt.info.type,ba=Ft.uniforms[Dr],_n=gt.link(Vt),Xa=_n+".location",ln;if(ba){if(!fr(ba))continue;if(si(ba)){var $n=ba.value;if(Jr===uc||Jr===Vl){var Nn=gt.link($n._texture||$n.color[0]._texture);Et(lr,".uniform1i(",Xa,",",Nn+".bind());"),Et.exit(Nn,".unbind();")}else if(Jr===hu||Jr===wl||Jr===su){var dn=gt.global.def("new Float32Array(["+Array.prototype.slice.call($n)+"])"),Tn=2;Jr===wl?Tn=3:Jr===su&&(Tn=4),Et(lr,".uniformMatrix",Tn,"fv(",Xa,",false,",dn,");")}else{switch(Jr){case Ao:Xt="1f";break;case ss:Xt="2f";break;case So:Xt="3f";break;case Ko:Xt="4f";break;case ts:Xt="1i";break;case hs:Xt="1i";break;case Pl:Xt="2i";break;case ll:Xt="2i";break;case $l:Xt="3i";break;case Js:Xt="3i";break;case Ru:Xt="4i";break;case es:Xt="4i";break}Et(lr,".uniform",Xt,"(",Xa,",",Ya($n)?Array.prototype.slice.call($n):$n,");")}continue}else ln=ba.append(gt,Et)}else{if(!fr(Pi))continue;ln=Et.def(pr.uniforms,"[",Yt.id(Dr),"]")}Jr===uc?Et("if(",ln,"&&",ln,'._reglType==="framebuffer"){',ln,"=",ln,".color[0];","}"):Jr===Vl&&Et("if(",ln,"&&",ln,'._reglType==="framebufferCube"){',ln,"=",ln,".color[0];","}");var En=1;switch(Jr){case uc:case Vl:var Gn=Et.def(ln,"._texture");Et(lr,".uniform1i(",Xa,",",Gn,".bind());"),Et.exit(Gn,".unbind();");continue;case hs:case ts:Xt="1i";break;case ll:case Pl:Xt="2i",En=2;break;case Js:case $l:Xt="3i",En=3;break;case es:case Ru:Xt="4i",En=4;break;case Ao:Xt="1f";break;case ss:Xt="2f",En=2;break;case So:Xt="3f",En=3;break;case Ko:Xt="4f",En=4;break;case hu:Xt="Matrix2fv";break;case wl:Xt="Matrix3fv";break;case su:Xt="Matrix4fv";break}if(Xt.charAt(0)==="M"){Et(lr,".uniform",Xt,"(",Xa,",");var ci=Math.pow(Jr-hu+2,2),bo=gt.global.def("new Float32Array(",ci,")");Array.isArray(ln)?Et("false,(",p(ci,function(Hs){return bo+"["+Hs+"]="+ln[Hs]}),",",bo,")"):Et("false,(Array.isArray(",ln,")||",ln," instanceof Float32Array)?",ln,":(",p(ci,function(Hs){return bo+"["+Hs+"]="+ln+"["+Hs+"]"}),",",bo,")"),Et(");")}else if(En>1){for(var jo=[],ks=[],Fo=0;Fo<En;++Fo)Array.isArray(ln)?ks.push(ln[Fo]):ks.push(Et.def(ln+"["+Fo+"]")),sr&&jo.push(Et.def());sr&&Et("if(!",gt.batchId,"||",jo.map(function(Hs,pu){return Hs+"!=="+ks[pu]}).join("||"),"){",jo.map(function(Hs,pu){return Hs+"="+ks[pu]+";"}).join("")),Et(lr,".uniform",Xt,"(",Xa,",",ks.join(","),");"),sr&&Et("}")}else{if(sr){var bs=Et.def();Et("if(!",gt.batchId,"||",bs,"!==",ln,"){",bs,"=",ln,";")}Et(lr,".uniform",Xt,"(",Xa,",",ln,");"),sr&&Et("}")}}}function ye(gt,Et,Ft,nr){var fr=gt.shared,sr=fr.gl,pr=fr.draw,lr=nr.draw;function Xt(){var En=lr.elements,Gn,ci=Et;return En?((En.contextDep&&nr.contextDynamic||En.propDep)&&(ci=Ft),Gn=En.append(gt,ci),lr.elementsActive&&ci("if("+Gn+")"+sr+".bindBuffer("+ga+","+Gn+".buffer.buffer);")):(Gn=ci.def(),ci(Gn,"=",pr,".",$t,";","if(",Gn,"){",sr,".bindBuffer(",ga,",",Gn,".buffer.buffer);}","else if(",fr.vao,".currentVAO){",Gn,"=",gt.shared.elements+".getElements("+fr.vao,".currentVAO.elements);",Vn?"":"if("+Gn+")"+sr+".bindBuffer("+ga+","+Gn+".buffer.buffer);","}")),Gn}function or(){var En=lr.count,Gn,ci=Et;return En?((En.contextDep&&nr.contextDynamic||En.propDep)&&(ci=Ft),Gn=En.append(gt,ci)):Gn=ci.def(pr,".",Ar),Gn}var Vt=Xt();function Dr(En){var Gn=lr[En];return Gn?Gn.contextDep&&nr.contextDynamic||Gn.propDep?Gn.append(gt,Ft):Gn.append(gt,Et):Et.def(pr,".",En)}var Jr=Dr(br),ba=Dr(Yr),_n=or();if(typeof _n=="number"){if(_n===0)return}else Ft("if(",_n,"){"),Ft.exit("}");var Xa,ln;gn&&(Xa=Dr(sa),ln=gt.instancing);var $n=Vt+".type",Nn=lr.elements&&si(lr.elements)&&!lr.vaoActive;function dn(){function En(){Ft(ln,".drawElementsInstancedANGLE(",[Jr,_n,$n,ba+"<<(("+$n+"-"+ao+")>>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<Et.length;++Ft)if(c.isDynamic(gt[Et[Ft]]))return!0;return!1}}function Fr(gt,Et,Ft){var nr=Et.static[Ft];if(!nr||!_r(nr))return;var fr=gt.global,sr=Object.keys(nr),pr=!1,lr=!1,Xt=!1,or=gt.global.def("{}");sr.forEach(function(Dr){var Jr=nr[Dr];if(c.isDynamic(Jr)){typeof Jr=="function"&&(Jr=nr[Dr]=c.unbox(Jr));var ba=vi(Jr,null);pr=pr||ba.thisDep,Xt=Xt||ba.propDep,lr=lr||ba.contextDep}else{switch(fr(or,".",Dr,"="),typeof Jr){case"number":fr(Jr);break;case"string":fr('"',Jr,'"');break;case"object":Array.isArray(Jr)&&fr("[",Jr.join(),"]");break;default:fr(gt.link(Jr));break}fr(";")}});function Vt(Dr,Jr){sr.forEach(function(ba){var _n=nr[ba];if(c.isDynamic(_n)){var Xa=Dr.invoke(Jr,_n);Jr(or,".",ba,"=",Xa,";")}})}Et.dynamic[Ft]=new c.DynamicVariable(xs,{thisDep:pr,contextDep:lr,propDep:Xt,ref:or,append:Vt}),delete Et.static[Ft]}function hr(gt,Et,Ft,nr,fr){var sr=ii();sr.stats=sr.link(fr),Object.keys(Et.static).forEach(function(lr){Fr(sr,Et,lr)}),Br.forEach(function(lr){Fr(sr,gt,lr)});var pr=Ql(gt,Et,Ft,nr,sr);return pr.shader.program&&(pr.shader.program.attributes.sort(function(lr,Xt){return lr.name<Xt.name?-1:1}),pr.shader.program.uniforms.sort(function(lr,Xt){return lr.name<Xt.name?-1:1})),Ge(sr,pr),jt(sr,pr),mt(sr,pr),v(sr.compile(),{destroy:function(){pr.shader.program.destroy()}})}return{next:hi,current:Rn,procs:function(){var gt=ii(),Et=gt.proc("poll"),Ft=gt.proc("refresh"),nr=gt.block();Et(nr),Ft(nr);var fr=gt.shared,sr=fr.gl,pr=fr.next,lr=fr.current;nr(lr,".dirty=false;"),pl(gt,Et),pl(gt,Ft,null,!0);var Xt;gn&&(Xt=gt.link(gn)),cr.oes_vertex_array_object&&Ft(gt.link(cr.oes_vertex_array_object),".bindVertexArrayOES(null);");var or=Ft.def(fr.attributes),Vt=Ft.def(0),Dr=gt.cond(Vt,".buffer");Dr.then(sr,".enableVertexAttribArray(i);",sr,".bindBuffer(",Qr,",",Vt,".buffer.buffer);",sr,".vertexAttribPointer(i,",Vt,".size,",Vt,".type,",Vt,".normalized,",Vt,".stride,",Vt,".offset);").else(sr,".disableVertexAttribArray(i);",sr,".vertexAttrib4f(i,",Vt,".x,",Vt,".y,",Vt,".z,",Vt,".w);",Vt,".buffer=null;");var Jr=gt.link(ua.maxAttributes,{stable:!0});return Ft("for(var i=0;i<",Jr,";++i){",Vt,"=",or,"[i];",Dr,"}"),gn&&Ft("for(var i=0;i<",Jr,";++i){",Xt,".vertexAttribDivisorANGLE(i,",or,"[i].divisor);","}"),Ft(gt.shared.vao,".currentVAO=null;",gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"),Object.keys(qa).forEach(function(ba){var _n=qa[ba],Xa=nr.def(pr,".",ba),ln=gt.block();ln("if(",Xa,"){",sr,".enable(",_n,")}else{",sr,".disable(",_n,")}",lr,".",ba,"=",Xa,";"),Ft(ln),Et("if(",Xa,"!==",lr,".",ba,"){",ln,"}")}),Object.keys(Qn).forEach(function(ba){var _n=Qn[ba],Xa=Rn[ba],ln,$n,Nn=gt.block();if(Nn(sr,".",_n,"("),Ya(Xa)){var dn=Xa.length;ln=gt.global.def(pr,".",ba),$n=gt.global.def(lr,".",ba),Nn(p(dn,function(Tn){return ln+"["+Tn+"]"}),");",p(dn,function(Tn){return $n+"["+Tn+"]="+ln+"["+Tn+"];"}).join("")),Et("if(",p(dn,function(Tn){return ln+"["+Tn+"]!=="+$n+"["+Tn+"]"}).join("||"),"){",Nn,"}")}else ln=nr.def(pr,".",ba),$n=nr.def(lr,".",ba),Nn(ln,");",lr,".",ba,"=",ln,";"),Et("if(",ln,"!==",$n,"){",Nn,"}");Ft(Nn)}),gt.compile()}(),compile:hr}}function eo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var $o=34918,no=34919,Zo=35007,ul=function(nt,Yt){if(!Yt.ext_disjoint_timer_query)return null;var cr=[];function ua(){return cr.pop()||Yt.ext_disjoint_timer_query.createQueryEXT()}function Aa(an){cr.push(an)}var xa=[];function wa(an){var gn=ua();Yt.ext_disjoint_timer_query.beginQueryEXT(Zo,gn),xa.push(gn),Ln(xa.length-1,xa.length,an)}function Ja(){Yt.ext_disjoint_timer_query.endQueryEXT(Zo)}function Sn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var wn=[];function hn(){return wn.pop()||new Sn}function yi(an){wn.push(an)}var Bn=[];function Ln(an,gn,Wa){var Vn=hn();Vn.startQueryIndex=an,Vn.endQueryIndex=gn,Vn.sum=0,Vn.stats=Wa,Bn.push(Vn)}var Va=[],ea=[];function Ea(){var an,gn,Wa=xa.length;if(Wa!==0){ea.length=Math.max(ea.length,Wa+1),Va.length=Math.max(Va.length,Wa+1),Va[0]=0,ea[0]=0;var Vn=0;for(an=0,gn=0;gn<xa.length;++gn){var Rn=xa[gn];Yt.ext_disjoint_timer_query.getQueryObjectEXT(Rn,no)?(Vn+=Yt.ext_disjoint_timer_query.getQueryObjectEXT(Rn,$o),Aa(Rn)):xa[an++]=Rn,Va[gn+1]=Vn,ea[gn+1]=an}for(xa.length=an,an=0,gn=0;gn<Bn.length;++gn){var hi=Bn[gn],Za=hi.startQueryIndex,qa=hi.endQueryIndex;hi.sum+=Va[qa]-Va[Za];var Qn=ea[Za],Fn=ea[qa];Fn===Qn?(hi.stats.gpuTime+=hi.sum/1e6,yi(hi)):(hi.startQueryIndex=Qn,hi.endQueryIndex=Fn,Bn[an++]=hi)}Bn.length=an}}return{beginQuery:wa,endQuery:Ja,pushScopeStats:Ln,update:Ea,getNumPendingQueries:function(){return xa.length},clear:function(){cr.push.apply(cr,xa);for(var an=0;an<cr.length;an++)Yt.ext_disjoint_timer_query.deleteQueryEXT(cr[an]);xa.length=0,cr.length=0},restore:function(){xa.length=0,cr.length=0}}},el=16384,_l=256,gi=1024,vo=34962,cs="webglcontextlost",ps="webglcontextrestored",Tl=1,Gl=2,Tu=3;function Il(nt,Yt){for(var cr=0;cr<nt.length;++cr)if(nt[cr]===Yt)return cr;return-1}function yc(nt){var Yt=g(nt);if(!Yt)return null;var cr=Yt.gl,ua=cr.getContextAttributes(),Aa=cr.isContextLost(),xa=b(cr,Yt);if(!xa)return null;var wa=d(),Ja=eo(),Sn=Yt.cachedCode||{},wn=xa.extensions,hn=ul(cr,wn),yi=m(),Bn=cr.drawingBufferWidth,Ln=cr.drawingBufferHeight,Va={tick:0,time:0,viewportWidth:Bn,viewportHeight:Ln,framebufferWidth:Bn,framebufferHeight:Ln,drawingBufferWidth:Bn,drawingBufferHeight:Ln,pixelRatio:Yt.pixelRatio},ea={},Ea={elements:null,primitive:4,count:-1,offset:0,instances:-1},an=jr(cr,wn),gn=ma(cr,Ja,Yt,Rn),Wa=dr(cr,wn,gn,Ja),Vn=Pu(cr,wn,an,Ja,gn,Wa,Ea);function Rn(te){return Vn.destroyBuffer(te)}var hi=Hu(cr,wa,Ja,Yt),Za=Hc(cr,wn,an,function(){Fn.procs.poll()},Va,Ja,Yt),qa=Ac(cr,wn,an,Ja,Yt),Qn=Xc(cr,wn,an,Za,qa,Ja),Fn=Zi(cr,wa,wn,an,gn,Wa,Za,Qn,ea,Vn,hi,Ea,Va,hn,Sn,Yt),Mn=ru(cr,Qn,Fn.procs.poll,Va,ua,wn,an),An=Fn.next,Jn=cr.canvas,mi=[],Ii=[],zn=[],ii=[Yt.onDestroy],Ei=null;function Ri(){if(mi.length===0){hn&&hn.update(),Ei=null;return}Ei=h.next(Ri),bl();for(var te=mi.length-1;te>=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;Dr<Vt.length;++Dr)if(c.isDynamic(Vt[Dr])){Xt[or]=c.unbox(Vt,or);return}}lr[or]=Vt}),{dynamic:Xt,static:lr}}var Le=Ge(te.context||{},!0),$e=Ge(te.uniforms||{},!0),mt=Ge(te.attributes||{},!1),jt=Ge(me(te),!1),_r={gpuTime:0,cpuTime:0,count:0},Fr=Fn.compile(jt,mt,$e,Le,_r),hr=Fr.draw,gt=Fr.batch,Et=Fr.scope,Ft=[];function nr(sr){for(;Ft.length<sr;)Ft.push(null);return Ft}function fr(sr,pr){var lr;if(typeof sr=="function")return Et.call(this,null,sr,0);if(typeof pr=="function")if(typeof sr=="number")for(lr=0;lr<sr;++lr)Et.call(this,null,pr,lr);else if(Array.isArray(sr))for(lr=0;lr<sr.length;++lr)Et.call(this,sr[lr],pr,lr);else return Et.call(this,sr,pr,0);else if(typeof sr=="number"){if(sr>0)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<Ge.length;++Le)if(Ge[Le]===me){Ge[Le]=Ge[Ge.length-1],Ge.pop();return}}}}function ve(){return Sn}function Y(te){Object.entries(te).forEach(function(me){Sn[me[0]]=me[1]})}var ye=v(fs,{clear:Ql,prop:c.define.bind(null,Tl),context:c.define.bind(null,Gl),this:c.define.bind(null,Tu),draw:fs({}),buffer:function(te){return gn.create(te,vo,!1,!1)},elements:function(te){return Wa.create(te,!1)},texture:Za.create2D,cube:Za.createCube,renderbuffer:qa.create,framebuffer:Qn.create,framebufferCube:Qn.createCube,vao:Vn.createVAO,attributes:ua,frame:Fs,on:Lo,limits:an,hasExtension:function(te){return an.extensions.indexOf(te.toLowerCase())>=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;o<a.length;o++)c.fillText(a[o],h,m),(h+=i[0])>e[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<<q-1,Z.sign=function(A){return(A>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)&-(A<M)},Z.max=function(A,M){return A^(A^M)&-(A<M)},Z.isPow2=function(A){return!(A&A-1)&&!!A},Z.log2=function(A){var M,e;return M=(A>65535)<<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<<r&255}})(x),Z.reverse=function(A){return x[A&255]<<24|x[A>>>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<r;++a)i[a]=e;else for(a=0;a<r;++a)i[a]=v(M,e,t+1);return i}function x(M,e){var t,r;for(t=new Array(M),r=0;r<M;++r)t[r]=e;return t}function A(M,e){switch(typeof e>"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;s<a.length;s++){var c=a[s],h=x.measureText(c[0]).width+x.measureText(c[1]).width,m=x.measureText(c).width;if(Math.abs(h-m)>n*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];n<t[1];n++){var o=String.fromCharCode(n),s=a+o;r.push(s)}return r}}}),EV=Ze({"node_modules/font-measure/index.js"(Z,q){"use strict";q.exports=v,v.canvas=document.createElement("canvas"),v.cache={};function v(o,t){t||(t={}),(typeof o=="string"||Array.isArray(o))&&(t.family=o);var r=Array.isArray(t.family)?t.family.join(", "):t.family;if(!r)throw Error("`family` must be defined");var i=t.size||t.fontSize||t.em||48,a=t.weight||t.fontWeight||"",n=t.style||t.fontStyle||"",o=[n,a,i].join(" ")+"px "+r,s=t.origin||"top";if(v.cache[r]&&i<=v.cache[r].em)return x(v.cache[r],s);var c=t.canvas||v.canvas,h=c.getContext("2d"),m={upper:t.upper!==void 0?t.upper:"H",lower:t.lower!==void 0?t.lower:"x",descent:t.descent!==void 0?t.descent:"p",ascent:t.ascent!==void 0?t.ascent:"h",tittle:t.tittle!==void 0?t.tittle:"i",overshoot:t.overshoot!==void 0?t.overshoot:"O"},d=Math.ceil(i*1.5);c.height=d,c.width=d*.5,h.font=o;var T="H",l={top:0};h.clearRect(0,0,d,d),h.textBaseline="top",h.fillStyle="black",h.fillText(T,0,0);var _=A(h.getImageData(0,0,d,d));h.clearRect(0,0,d,d),h.textBaseline="bottom",h.fillText(T,0,d);var w=A(h.getImageData(0,0,d,d));l.lineHeight=l.bottom=d-w+_,h.clearRect(0,0,d,d),h.textBaseline="alphabetic",h.fillText(T,0,d);var S=A(h.getImageData(0,0,d,d)),E=d-S-1+_;l.baseline=l.alphabetic=E,h.clearRect(0,0,d,d),h.textBaseline="middle",h.fillText(T,0,d*.5);var g=A(h.getImageData(0,0,d,d));l.median=l.middle=d-g-1+_-d*.5,h.clearRect(0,0,d,d),h.textBaseline="hanging",h.fillText(T,0,d*.5);var b=A(h.getImageData(0,0,d,d));l.hanging=d-b-1+_-d*.5,h.clearRect(0,0,d,d),h.textBaseline="ideographic",h.fillText(T,0,d);var p=A(h.getImageData(0,0,d,d));if(l.ideographic=d-p-1+_,m.upper&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.upper,0,0),l.upper=A(h.getImageData(0,0,d,d)),l.capHeight=l.baseline-l.upper),m.lower&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.lower,0,0),l.lower=A(h.getImageData(0,0,d,d)),l.xHeight=l.baseline-l.lower),m.tittle&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.tittle,0,0),l.tittle=A(h.getImageData(0,0,d,d))),m.ascent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.ascent,0,0),l.ascent=A(h.getImageData(0,0,d,d))),m.descent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.descent,0,0),l.descent=M(h.getImageData(0,0,d,d))),m.overshoot){h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(m.overshoot,0,0);var u=M(h.getImageData(0,0,d,d));l.overshoot=u-E}for(var y in l)l[y]/=i;return l.em=i,v.cache[r]=l,x(l,s)}function x(e,t){var r={};typeof t=="string"&&(t=e[t]);for(var i in e)i!=="em"&&(r[i]=e[i]-t);return r}function A(e){for(var t=e.height,r=e.data,i=3;i<r.length;i+=4)if(r[i]!==0)return Math.floor((i-3)*.25/t)}function M(e){for(var t=e.height,r=e.data,i=r.length-1;i>0;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;L<P.length;L++)P[L]=p.text;p.text=P}var z;if(p.text!=null||y){if(this.textOffsets=[0],Array.isArray(p.text)){this.count=p.text[0].length,this.counts=[this.count];for(var F=1;F<p.text.length;F++)this.textOffsets[F]=this.textOffsets[F-1]+p.text[F-1].length,this.count+=p.text[F].length,this.counts.push(p.text[F].length);this.text=p.text.join("")}else this.text=p.text,this.count=this.text.length,this.counts=[this.count];z=[],this.font.forEach(function(fe,Fe){E.atlasContext.font=fe.baseString;for(var rt=u.fontAtlas[Fe],st=0;st<u.text.length;st++){var Qe=u.text.charAt(st);if(rt.ids[Qe]==null&&(rt.ids[Qe]=rt.chars.length,rt.chars.push(Qe),z.push(Qe)),fe.width[Qe]==null&&(fe.width[Qe]=E.atlasContext.measureText(Qe).width/E.baseFontSize,u.kerning)){var Lt=[];for(var kt in fe.width)Lt.push(kt+Qe,Qe+kt);h(fe.kerning,c(fe.family,{pairs:Lt}))}}})}if(p.position)if(p.position.length>2){for(var B=!p.position[0].length,O=i.mallocFloat(this.count*2),I=0,N=0;I<this.counts.length;I++){var U=this.counts[I];if(B)for(var W=0;W<U;W++)O[N++]=p.position[I*2],O[N++]=p.position[I*2+1];else for(var Q=0;Q<U;Q++)O[N++]=p.position[I][0],O[N++]=p.position[I][1]}this.position.call?this.position({type:"float",data:O}):this.position=this.regl.buffer({type:"float",data:O}),i.freeFloat(O)}else this.position.destroy&&this.position.destroy(),this.position={constant:p.position};if(p.text||y){var ue=i.mallocUint8(this.count),se=i.mallocFloat(this.count*2);this.textWidth=[];for(var he=0,H=0;he<this.counts.length;he++){for(var $=this.counts[he],J=this.font[he]||this.font[0],X=this.fontAtlas[he]||this.fontAtlas[0],oe=0;oe<$;oe++){var ne=this.text.charAt(H),j=this.text.charAt(H-1);if(ue[H]=X.ids[ne],se[H*2]=J.width[ne],oe){var ee=se[H*2-2],re=se[H*2],ce=se[H*2-1],be=ce+ee*.5+re*.5;if(this.kerning){var Ae=J.kerning[j+ne];Ae&&(be+=Ae*.001)}se[H*2+1]=be}else se[H*2+1]=se[H*2]*.5;H++}this.textWidth.push(se.length?se[H*2-2]*.5+se[H*2-1]:0)}p.align||(p.align=this.align),this.charBuffer({data:ue,type:"uint8",usage:"stream"}),this.sizeBuffer({data:se,type:"float",usage:"stream"}),i.freeUint8(ue),i.freeFloat(se),z.length&&this.font.forEach(function(fe,Fe){var rt=u.fontAtlas[Fe],st=rt.step,Qe=Math.floor(E.maxAtlasSize/st),Lt=Math.min(Qe,rt.chars.length),kt=Math.ceil(rt.chars.length/Lt),qt=l(Lt*st),Zt=l(kt*st);rt.width=qt,rt.height=Zt,rt.rows=kt,rt.cols=Lt,rt.em&&rt.texture({data:r({canvas:E.atlasCanvas,font:rt.fontString,chars:rt.chars,shape:[qt,Zt],step:[st,st]})})})}if(p.align&&(this.align=p.align,this.alignOffset=this.textWidth.map(function(fe,Fe){var rt=Array.isArray(u.align)?u.align.length>1?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;it<Re;it+=4)ze.set(t(We(it,it+4),"uint8"),it)}else{var ot=p.color.length;ze=i.mallocUint8(ot*4);for(var tt=0;tt<ot;tt++)ze.set(t(p.color[tt]||0,"uint8"),tt*4)}this.color=ze}if(p.position||p.text||p.color||p.baseline||p.align||p.font||p.offset||p.opacity){var ut=this.color.length>4||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;_e<this.batch.length;_e++)this.batch[_e]={count:this.counts.length>1?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;ua<cr.length;++ua)nt[cr[ua]]=Yt[cr[ua]];return nt},x=0,A=0,M=5,e=6;function t(nt,Yt){this.id=x++,this.type=nt,this.data=Yt}function r(nt){return nt.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(nt){if(nt.length===0)return[];var Yt=nt.charAt(0),cr=nt.charAt(nt.length-1);if(nt.length>1&&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<Aa.length;++wa)xa=xa.concat(i(Aa[wa]));return xa}function a(nt){return"["+i(nt).join("][")+"]"}function n(nt,Yt){return new t(nt,a(Yt+""))}function o(nt){return typeof nt=="function"&&!nt._reglType||nt instanceof t}function s(nt,Yt){if(typeof nt=="function")return new t(A,nt);if(typeof nt=="number"||typeof nt=="boolean")return new t(M,nt);if(Array.isArray(nt))return new t(e,nt.map(function(cr,ua){return s(cr,Yt+"["+ua+"]")}));if(nt instanceof t)return nt}var c={DynamicVariable:t,define:n,isDynamic:o,unbox:s,accessor:a},h={next:typeof requestAnimationFrame=="function"?function(nt){return requestAnimationFrame(nt)}:function(nt){return setTimeout(nt,16)},cancel:typeof cancelAnimationFrame=="function"?function(nt){return cancelAnimationFrame(nt)}:clearTimeout},m=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function d(){var nt={"":0},Yt=[""];return{id:function(cr){var ua=nt[cr];return ua||(ua=nt[cr]=Yt.length,Yt.push(cr),ua)},str:function(cr){return Yt[cr]}}}function T(nt,Yt,cr){var ua=document.createElement("canvas");v(ua.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),nt.appendChild(ua),nt===document.body&&(ua.style.position="absolute",v(nt.style,{margin:0,padding:0}));function Aa(){var Ja=window.innerWidth,Sn=window.innerHeight;if(nt!==document.body){var wn=ua.getBoundingClientRect();Ja=wn.right-wn.left,Sn=wn.bottom-wn.top}ua.width=cr*Ja,ua.height=cr*Sn}var xa;nt!==document.body&&typeof ResizeObserver=="function"?(xa=new ResizeObserver(function(){setTimeout(Aa)}),xa.observe(nt)):window.addEventListener("resize",Aa,!1);function wa(){xa?xa.disconnect():window.removeEventListener("resize",Aa),nt.removeChild(ua)}return Aa(),{canvas:ua,onDestroy:wa}}function l(nt,Yt){function cr(ua){try{return nt.getContext(ua,Yt)}catch{return null}}return cr("webgl")||cr("experimental-webgl")||cr("webgl-experimental")}function _(nt){return typeof nt.nodeName=="string"&&typeof nt.appendChild=="function"&&typeof nt.getBoundingClientRect=="function"}function w(nt){return typeof nt.drawArrays=="function"||typeof nt.drawElements=="function"}function S(nt){return typeof nt=="string"?nt.split():nt}function E(nt){return typeof nt=="string"?document.querySelector(nt):nt}function g(nt){var Yt=nt||{},cr,ua,Aa,xa,wa={},Ja=[],Sn=[],wn=typeof window>"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;Aa<Yt.extensions.length;++Aa){var xa=Yt.extensions[Aa];if(!ua(xa))return Yt.onDestroy(),Yt.onDone('"'+xa+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return Yt.optionalExtensions.forEach(ua),{extensions:cr,restore:function(){Object.keys(cr).forEach(function(wa){if(cr[wa]&&!ua(wa))throw new Error("(regl): error restoring extension "+wa)})}}}function p(nt,Yt){for(var cr=Array(nt),ua=0;ua<nt;++ua)cr[ua]=Yt(ua);return cr}var u=5120,y=5121,f=5122,P=5123,L=5124,z=5125,F=5126;function B(nt){for(var Yt=16;Yt<=1<<28;Yt*=16)if(nt<=Yt)return Yt;return 0}function O(nt){var Yt,cr;return Yt=(nt>65535)<<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;ua<Yt;++ua)cr[ua]=nt[ua]}function Ue(nt,Yt,cr,ua){for(var Aa=0,xa=0;xa<Yt;++xa)for(var wa=nt[xa],Ja=0;Ja<cr;++Ja)ua[Aa++]=wa[Ja]}function Ee(nt,Yt,cr,ua,Aa,xa){for(var wa=xa,Ja=0;Ja<Yt;++Ja)for(var Sn=nt[Ja],wn=0;wn<cr;++wn)for(var hn=Sn[wn],yi=0;yi<ua;++yi)Aa[wa++]=hn[yi]}function Ve(nt,Yt,cr,ua,Aa){for(var xa=1,wa=cr+1;wa<Yt.length;++wa)xa*=Yt[wa];var Ja=Yt[cr];if(Yt.length-cr===4){var Sn=Yt[cr+1],wn=Yt[cr+2],hn=Yt[cr+3];for(wa=0;wa<Ja;++wa)Ee(nt[wa],Sn,wn,hn,ua,Aa),Aa+=xa}else for(wa=0;wa<Ja;++wa)Ve(nt[wa],Yt,cr+1,ua,Aa),Aa+=xa}function Ce(nt,Yt,cr,ua){var Aa=1;if(Yt.length)for(var xa=0;xa<Yt.length;++xa)Aa*=Yt[xa];else Aa=0;var wa=ua||N.allocType(cr,Aa);switch(Yt.length){case 0:break;case 1:Ke(nt,Yt[0],wa);break;case 2:Ue(nt,Yt[0],Yt[1],wa);break;case 3:Ee(nt,Yt[0],Yt[1],Yt[2],wa,0);break;default:Ve(nt,Yt,0,wa,0)}return wa}function Te(nt){for(var Yt=[],cr=nt;cr.length;cr=cr[0])Yt.push(cr.length);return Yt}var Pe={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},at=5120,yt=5122,Tt=5124,Ot=5121,Gt=5123,rr=5125,Qt=5126,Tr=5126,la={int8:at,int16:yt,int32:Tt,uint8:Ot,uint16:Gt,uint32:rr,float:Qt,float32:Tr},Ua=35048,Ba=35040,Ra={dynamic:Ua,stream:Ba,static:35044},Qa=Be.flatten,za=Be.shape,en=35044,kn=35040,Jt=5121,Nt=5126,Kt=[];Kt[5120]=1,Kt[5122]=2,Kt[5124]=4,Kt[5121]=1,Kt[5123]=2,Kt[5125]=4,Kt[5126]=4;function Wt(nt){return Pe[Object.prototype.toString.call(nt)]|0}function Pr(nt,Yt){for(var cr=0;cr<Yt.length;++cr)nt[cr]=Yt[cr]}function ta(nt,Yt,cr,ua,Aa,xa,wa){for(var Ja=0,Sn=0;Sn<cr;++Sn)for(var wn=0;wn<ua;++wn)nt[Ja++]=Yt[Aa*Sn+xa*wn+wa]}function ma(nt,Yt,cr,ua){var Aa=0,xa={};function wa(ea){this.id=Aa++,this.buffer=nt.createBuffer(),this.type=ea,this.usage=en,this.byteLength=0,this.dimension=1,this.dtype=Jt,this.persistentData=null,cr.profile&&(this.stats={size:0})}wa.prototype.bind=function(){nt.bindBuffer(this.type,this.buffer)},wa.prototype.destroy=function(){Bn(this)};var Ja=[];function Sn(ea,Ea){var an=Ja.pop();return an||(an=new wa(ea)),an.bind(),yi(an,Ea,kn,0,1,!1),an}function wn(ea){Ja.push(ea)}function hn(ea,Ea,an){ea.byteLength=Ea.byteLength,nt.bufferData(ea.type,Ea,an)}function yi(ea,Ea,an,gn,Wa,Vn){var Rn;if(ea.usage=an,Array.isArray(Ea)){if(ea.dtype=gn||Nt,Ea.length>0){var hi;if(Array.isArray(Ea[0])){Rn=za(Ea);for(var Za=1,qa=1;qa<Rn.length;++qa)Za*=Rn[qa];ea.dimension=Za,hi=Qa(Ea,Rn,ea.dtype),hn(ea,hi,an),Vn?ea.persistentData=hi:N.freeType(hi)}else if(typeof Ea[0]=="number"){ea.dimension=Wa;var Qn=N.allocType(ea.dtype,Ea.length);Pr(Qn,Ea),hn(ea,Qn,an),Vn?ea.persistentData=Qn:N.freeType(Qn)}else wr(Ea[0])&&(ea.dimension=Ea[0].length,ea.dtype=gn||Wt(Ea[0])||Nt,hi=Qa(Ea,[Ea.length,Ea[0].length],ea.dtype),hn(ea,hi,an),Vn?ea.persistentData=hi:N.freeType(hi))}}else if(wr(Ea))ea.dtype=gn||Wt(Ea),ea.dimension=Wa,hn(ea,Ea,an),Vn&&(ea.persistentData=new Uint8Array(new Uint8Array(Ea.buffer)));else if(Ir(Ea)){Rn=Ea.shape;var Fn=Ea.stride,Mn=Ea.offset,An=0,Jn=0,mi=0,Ii=0;Rn.length===1?(An=Rn[0],Jn=1,mi=Fn[0],Ii=0):Rn.length===2&&(An=Rn[0],Jn=Rn[1],mi=Fn[0],Ii=Fn[1]),ea.dtype=gn||Wt(Ea.data)||Nt,ea.dimension=Jn;var zn=N.allocType(ea.dtype,An*Jn);ta(zn,Ea.data,An,Jn,mi,Ii,Mn),hn(ea,zn,an),Vn?ea.persistentData=zn:N.freeType(zn)}else Ea instanceof ArrayBuffer&&(ea.dtype=Jt,ea.dimension=Wa,hn(ea,Ea,an),Vn&&(ea.persistentData=new Uint8Array(new Uint8Array(Ea))))}function Bn(ea){Yt.bufferCount--,ua(ea);var Ea=ea.buffer;nt.deleteBuffer(Ea),ea.buffer=null,delete xa[ea.id]}function Ln(ea,Ea,an,gn){Yt.bufferCount++;var Wa=new wa(Ea);xa[Wa.id]=Wa;function Vn(Za){var qa=en,Qn=null,Fn=0,Mn=0,An=1;return Array.isArray(Za)||wr(Za)||Ir(Za)||Za instanceof ArrayBuffer?Qn=Za:typeof Za=="number"?Fn=Za|0:Za&&("data"in Za&&(Qn=Za.data),"usage"in Za&&(qa=Ra[Za.usage]),"type"in Za&&(Mn=la[Za.type]),"dimension"in Za&&(An=Za.dimension|0),"length"in Za&&(Fn=Za.length|0)),Wa.bind(),Qn?yi(Wa,Qn,qa,Mn,An,gn):(Fn&&nt.bufferData(Wa.type,Fn,qa),Wa.dtype=Mn||Jt,Wa.usage=qa,Wa.dimension=An,Wa.byteLength=Fn),cr.profile&&(Wa.stats.size=Wa.byteLength*Kt[Wa.dtype]),Vn}function Rn(Za,qa){nt.bufferSubData(Wa.type,qa,Za)}function hi(Za,qa){var Qn=(qa||0)|0,Fn;if(Wa.bind(),wr(Za)||Za instanceof ArrayBuffer)Rn(Za,Qn);else if(Array.isArray(Za)){if(Za.length>0){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<nt.length;++cr)if(isNaN(nt[cr]))Yt[cr]=65535;else if(nt[cr]===1/0)Yt[cr]=31744;else if(nt[cr]===-1/0)Yt[cr]=64512;else{kr[0]=nt[cr];var ua=na[0],Aa=ua>>>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<Ja;++Bn)for(var Ln=0;Ln<wa;++Ln)for(var Va=0;Va<Sn;++Va)hn[yi++]=Yt[cr*Ln+ua*Bn+Aa*Va+xa];Gu(nt,hn)}function oc(nt,Yt,cr,ua,Aa,xa){var wa;if(typeof Qi[nt]<"u"?wa=Qi[nt]:wa=gs[nt]*Ss[Yt],xa&&(wa*=6),Aa){for(var Ja=0,Sn=cr;Sn>=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<Vt.length;++Jr)Dr*=Vt[Jr];var ba=Of(Le,Dr);Be.flatten(mt,Vt,"",ba),Gu(Le,ba),Le.alignment=1,Le.width=lr,Le.height=Xt,Le.channels=or,Le.format=Le.internalformat=vl[or],Le.needsFree=!0}Le.type===Si||Le.type}function Jn(Le,$e,mt){var jt=Le.element,_r=Le.data,Fr=Le.internalformat,hr=Le.format,gt=Le.type,Et=Le.width,Ft=Le.height;Fn(Le),jt?nt.texImage2D($e,mt,hr,hr,gt,jt):Le.compressed?nt.compressedTexImage2D($e,mt,Fr,Et,Ft,0,_r):Le.needsCopy?(ua(),nt.copyTexImage2D($e,mt,hr,Le.xOffset,Le.yOffset,Et,Ft,0)):nt.texImage2D($e,mt,hr,Et,Ft,0,hr,gt,_r||null)}function mi(Le,$e,mt,jt,_r){var Fr=Le.element,hr=Le.data,gt=Le.internalformat,Et=Le.format,Ft=Le.type,nr=Le.width,fr=Le.height;Fn(Le),Fr?nt.texSubImage2D($e,_r,mt,jt,Et,Ft,Fr):Le.compressed?nt.compressedTexSubImage2D($e,_r,mt,jt,gt,nr,fr,hr):Le.needsCopy?(ua(),nt.copyTexSubImage2D($e,_r,mt,jt,Le.xOffset,Le.yOffset,nr,fr)):nt.texSubImage2D($e,_r,mt,jt,nr,fr,Et,Ft,hr)}var Ii=[];function zn(){return Ii.pop()||new Mn}function ii(Le){Le.needsFree&&N.freeType(Le.data),Mn.call(Le),Ii.push(Le)}function Ei(){Za.call(this),this.genMipmaps=!1,this.mipmapHint=Cu,this.mipmask=0,this.images=Array(16)}function Ri(Le,$e,mt){var jt=Le.images[0]=zn();Le.mipmask=1,jt.width=Le.width=$e,jt.height=Le.height=mt,jt.channels=Le.channels=4}function Gi(Le,$e){var mt=null;if(af($e))mt=Le.images[0]=zn(),qa(mt,Le),An(mt,$e),Le.mipmask=1;else if(Qn(Le,$e),Array.isArray($e.mipmap))for(var jt=$e.mipmap,_r=0;_r<jt.length;++_r)mt=Le.images[_r]=zn(),qa(mt,Le),mt.width>>=_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<mt.length;++jt){if(!mt[jt])return;Jn(mt[jt],$e,jt)}}var xl=[];function ho(){var Le=xl.pop()||new Ei;Za.call(Le),Le.mipmask=0;for(var $e=0;$e<16;++$e)Le.images[$e]=null;return Le}function Hl(Le){for(var $e=Le.images,mt=0;mt<$e.length;++mt)$e[mt]&&ii($e[mt]),$e[mt]=null;xl.push(Le)}function fs(){this.minFilter=fl,this.magFilter=fl,this.wrapS=al,this.wrapT=al,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=Cu}function Al(Le,$e){if("min"in $e){var mt=$e.min;Le.minFilter=hn[mt],nl.indexOf(Le.minFilter)>=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;mt<pl;++mt){var jt=bl[mt];if(jt){if(jt.bindCount>0)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<pl;++Le)nt.activeTexture(Ou+Le),nt.bindTexture(Da,null),bl[Le]=null;bt(Fs).forEach(ve),xa.cubeCount=0,xa.textureCount=0}wa.profile&&(xa.getTotalTextureSize=function(){var Le=0;return Object.keys(Fs).forEach(function($e){Le+=Fs[$e].stats.size}),Le});function me(){for(var Le=0;Le<pl;++Le){var $e=bl[Le];$e&&($e.bindCount=0,$e.unit=-1,bl[Le]=null)}bt(Fs).forEach(function(mt){mt.texture=nt.createTexture(),nt.bindTexture(mt.target,mt.texture);for(var jt=0;jt<32;++jt)if(mt.mipmask&1<<jt)if(mt.target===Da)nt.texImage2D(Da,jt,mt.internalformat,mt.width>>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<pl;++Le){var $e=bl[Le];$e&&($e.bindCount=0,$e.unit=-1,bl[Le]=null),nt.activeTexture(Ou+Le),nt.bindTexture(Da,null),nt.bindTexture(Zn,null)}}return{create2D:Y,createCube:ye,clear:te,getTexture:function(Le){return null},restore:me,refresh:Ge}}var Jl=36161,Uc=32854,Tc=32855,Gs=36194,Cf=33189,lh=36168,Bf=34041,Wc=35907,Kf=34836,ku=34842,Nf=34843,ml=[];ml[Uc]=2,ml[Tc]=2,ml[Gs]=2,ml[Cf]=2,ml[lh]=1,ml[Bf]=4,ml[Wc]=4,ml[Kf]=16,ml[ku]=8,ml[Nf]=6;function Lu(nt,Yt,cr){return ml[nt]*Yt*cr}var Ac=function(nt,Yt,cr,ua,Aa){var xa={rgba4:Uc,rgb565:Gs,"rgb5 a1":Tc,depth:Cf,stencil:lh,"depth stencil":Bf};Yt.ext_srgb&&(xa.srgba=Wc),Yt.ext_color_buffer_half_float&&(xa.rgba16f=ku,xa.rgb16f=Nf),Yt.webgl_color_buffer_float&&(xa.rgba32f=Kf);var wa=[];Object.keys(xa).forEach(function(Ln){var Va=xa[Ln];wa[Va]=Ln});var Ja=0,Sn={};function wn(Ln){this.id=Ja++,this.refCount=1,this.renderbuffer=Ln,this.format=Uc,this.width=0,this.height=0,Aa.profile&&(this.stats={size:0})}wn.prototype.decRef=function(){--this.refCount<=0&&hn(this)};function hn(Ln){var Va=Ln.renderbuffer;nt.bindRenderbuffer(Jl,null),nt.deleteRenderbuffer(Va),Ln.renderbuffer=null,Ln.refCount=0,delete Sn[Ln.id],ua.renderbufferCount--}function yi(Ln,Va){var ea=new wn(nt.createRenderbuffer());Sn[ea.id]=ea,ua.renderbufferCount++;function Ea(gn,Wa){var Vn=0,Rn=0,hi=Uc;if(typeof gn=="object"&&gn){var Za=gn;if("shape"in Za){var qa=Za.shape;Vn=qa[0]|0,Rn=qa[1]|0}else"radius"in Za&&(Vn=Rn=Za.radius|0),"width"in Za&&(Vn=Za.width|0),"height"in Za&&(Rn=Za.height|0);"format"in Za&&(hi=xa[Za.format])}else typeof gn=="number"?(Vn=gn|0,typeof Wa=="number"?Rn=Wa|0:Rn=Vn):gn||(Vn=Rn=1);if(!(Vn===ea.width&&Rn===ea.height&&hi===ea.format))return Ea.width=ea.width=Vn,Ea.height=ea.height=Rn,ea.format=hi,nt.bindRenderbuffer(Jl,ea.renderbuffer),nt.renderbufferStorage(Jl,hi,Vn,Rn),Aa.profile&&(ea.stats.size=Lu(ea.format,ea.width,ea.height)),Ea.format=wa[ea.format],Ea}function an(gn,Wa){var Vn=gn|0,Rn=Wa|0||Vn;return Vn===ea.width&&Rn===ea.height||(Ea.width=ea.width=Vn,Ea.height=ea.height=Rn,nt.bindRenderbuffer(Jl,ea.renderbuffer),nt.renderbufferStorage(Jl,ea.format,Vn,Rn),Aa.profile&&(ea.stats.size=Lu(ea.format,ea.width,ea.height))),Ea}return Ea(Ln,Va),Ea.resize=an,Ea._reglType="renderbuffer",Ea._renderbuffer=ea,Aa.profile&&(Ea.stats=ea.stats),Ea.destroy=function(){ea.decRef()},Ea}Aa.profile&&(ua.getTotalRenderbufferSize=function(){var Ln=0;return Object.keys(Sn).forEach(function(Va){Ln+=Sn[Va].stats.size}),Ln});function Bn(){bt(Sn).forEach(function(Ln){Ln.renderbuffer=nt.createRenderbuffer(),nt.bindRenderbuffer(Jl,Ln.renderbuffer),nt.renderbufferStorage(Jl,Ln.format,Ln.width,Ln.height)}),nt.bindRenderbuffer(Jl,null)}return{create:yi,clear:function(){bt(Sn).forEach(hn)},restore:Bn}},il=36160,dc=36161,vu=3553,bu=34069,Ml=36064,Uf=36096,Jf=36128,Bu=33306,Sc=36053,vc=36193,Lh=5121,nf=5126,df=6407,Nu=6408,of=[];of[Nu]=4,of[df]=3;var tu=[];tu[Lh]=1,tu[nf]=4,tu[vc]=2;function Xc(nt,Yt,cr,ua,Aa,xa){var wa={cur:null,next:null,dirty:!1,setFBO:null},Ja=["rgba"],Sn=["rgba4","rgb565","rgb5 a1"];Yt.ext_srgb&&Sn.push("srgba"),Yt.ext_color_buffer_half_float&&Sn.push("rgba16f","rgb16f"),Yt.webgl_color_buffer_float&&Sn.push("rgba32f");var wn=["uint8"];Yt.oes_texture_half_float&&wn.push("half float","float16"),Yt.oes_texture_float&&wn.push("float","float32");function hn(Mn,An,Jn){this.target=Mn,this.texture=An,this.renderbuffer=Jn;var mi=0,Ii=0;An?(mi=An.width,Ii=An.height):Jn&&(mi=Jn.width,Ii=Jn.height),this.width=mi,this.height=Ii}function yi(Mn){Mn&&(Mn.texture&&Mn.texture._texture.decRef(),Mn.renderbuffer&&Mn.renderbuffer._renderbuffer.decRef())}function Bn(Mn,An,Jn){if(Mn)if(Mn.texture){var mi=Mn.texture._texture,Ii=Math.max(1,mi.width),zn=Math.max(1,mi.height);mi.refCount+=1}else{var ii=Mn.renderbuffer._renderbuffer;ii.refCount+=1}}function Ln(Mn,An){An&&(An.texture?nt.framebufferTexture2D(il,Mn,An.target,An.texture._texture.texture,0):nt.framebufferRenderbuffer(il,Mn,dc,An.renderbuffer._renderbuffer.renderbuffer))}function Va(Mn){var An=vu,Jn=null,mi=null,Ii=Mn;typeof Mn=="object"&&(Ii=Mn.data,"target"in Mn&&(An=Mn.target|0));var zn=Ii._reglType;return zn==="texture2d"||zn==="textureCube"?Jn=Ii:zn==="renderbuffer"&&(mi=Ii,An=dc),new hn(An,Jn,mi)}function ea(Mn,An,Jn,mi,Ii){if(Jn){var zn=ua.create2D({width:Mn,height:An,format:mi,type:Ii});return zn._texture.refCount=0,new hn(vu,zn,null)}else{var ii=Aa.create({width:Mn,height:An,format:mi});return ii._renderbuffer.refCount=0,new hn(dc,null,ii)}}function Ea(Mn){return Mn&&(Mn.texture||Mn.renderbuffer)}function an(Mn,An,Jn){Mn&&(Mn.texture?Mn.texture.resize(An,Jn):Mn.renderbuffer&&Mn.renderbuffer.resize(An,Jn),Mn.width=An,Mn.height=Jn)}var gn=0,Wa={};function Vn(){this.id=gn++,Wa[this.id]=this,this.framebuffer=nt.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Rn(Mn){Mn.colorAttachments.forEach(yi),yi(Mn.depthAttachment),yi(Mn.stencilAttachment),yi(Mn.depthStencilAttachment)}function hi(Mn){var An=Mn.framebuffer;nt.deleteFramebuffer(An),Mn.framebuffer=null,xa.framebufferCount--,delete Wa[Mn.id]}function Za(Mn){var An;nt.bindFramebuffer(il,Mn.framebuffer);var Jn=Mn.colorAttachments;for(An=0;An<Jn.length;++An)Ln(Ml+An,Jn[An]);for(An=Jn.length;An<cr.maxColorAttachments;++An)nt.framebufferTexture2D(il,Ml+An,vu,null,0);nt.framebufferTexture2D(il,Bu,vu,null,0),nt.framebufferTexture2D(il,Uf,vu,null,0),nt.framebufferTexture2D(il,Jf,vu,null,0),Ln(Uf,Mn.depthAttachment),Ln(Jf,Mn.stencilAttachment),Ln(Bu,Mn.depthStencilAttachment);var mi=nt.checkFramebufferStatus(il);nt.isContextLost(),nt.bindFramebuffer(il,wa.next?wa.next.framebuffer:null),wa.cur=wa.next,nt.getError()}function qa(Mn,An){var Jn=new Vn;xa.framebufferCount++;function mi(zn,ii){var Ei,Ri=0,Gi=0,Ps=!0,xl=!0,ho=null,Hl=!0,fs="rgba",Al="uint8",El=1,Ql=null,Fs=null,pl=null,bl=!1;if(typeof zn=="number")Ri=zn|0,Gi=ii|0||Ri;else if(!zn)Ri=Gi=1;else{var Hi=zn;if("shape"in Hi){var Cl=Hi.shape;Ri=Cl[0],Gi=Cl[1]}else"radius"in Hi&&(Ri=Gi=Hi.radius),"width"in Hi&&(Ri=Hi.width),"height"in Hi&&(Gi=Hi.height);("color"in Hi||"colors"in Hi)&&(ho=Hi.color||Hi.colors,Array.isArray(ho)),ho||("colorCount"in Hi&&(El=Hi.colorCount|0),"colorTexture"in Hi&&(Hl=!!Hi.colorTexture,fs="rgba4"),"colorType"in Hi&&(Al=Hi.colorType,Hl||(Al==="half float"||Al==="float16"?fs="rgba16f":(Al==="float"||Al==="float32")&&(fs="rgba32f"))),"colorFormat"in Hi&&(fs=Hi.colorFormat,Ja.indexOf(fs)>=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;Ei<El;++Ei)Lo[Ei]=ea(Ri,Gi,Hl,fs,Al);Ri=Ri||Lo[0].width,Gi=Gi||Lo[0].height,Ql?ve=Va(Ql):Ps&&!xl&&(ve=ea(Ri,Gi,bl,"depth","uint32")),Fs?Y=Va(Fs):xl&&!Ps&&(Y=ea(Ri,Gi,!1,"stencil","uint8")),pl?ye=Va(pl):!Ql&&!Fs&&xl&&Ps&&(ye=ea(Ri,Gi,bl,"depth stencil","depth stencil"));var te=null;for(Ei=0;Ei<Lo.length;++Ei)if(Bn(Lo[Ei],Ri,Gi),Lo[Ei]&&Lo[Ei].texture){var me=of[Lo[Ei].texture._texture.format]*tu[Lo[Ei].texture._texture.type];te===null&&(te=me)}return Bn(ve,Ri,Gi),Bn(Y,Ri,Gi),Bn(ye,Ri,Gi),Rn(Jn),Jn.width=Ri,Jn.height=Gi,Jn.colorAttachments=Lo,Jn.depthAttachment=ve,Jn.stencilAttachment=Y,Jn.depthStencilAttachment=ye,mi.color=Lo.map(Ea),mi.depth=Ea(ve),mi.stencil=Ea(Y),mi.depthStencil=Ea(ye),mi.width=Jn.width,mi.height=Jn.height,Za(Jn),mi}function Ii(zn,ii){var Ei=Math.max(zn|0,1),Ri=Math.max(ii|0||Ei,1);if(Ei===Jn.width&&Ri===Jn.height)return mi;for(var Gi=Jn.colorAttachments,Ps=0;Ps<Gi.length;++Ps)an(Gi[Ps],Ei,Ri);return an(Jn.depthAttachment,Ei,Ri),an(Jn.stencilAttachment,Ei,Ri),an(Jn.depthStencilAttachment,Ei,Ri),Jn.width=mi.width=Ei,Jn.height=mi.height=Ri,Za(Jn),mi}return mi(Mn,An),v(mi,{resize:Ii,_reglType:"framebuffer",_framebuffer:Jn,destroy:function(){hi(Jn),Rn(Jn)},use:function(zn){wa.setFBO({framebuffer:mi},zn)}})}function Qn(Mn){var An=Array(6);function Jn(Ii){var zn,ii={color:null},Ei=0,Ri=null,Gi="rgba",Ps="uint8",xl=1;if(typeof Ii=="number")Ei=Ii|0;else if(!Ii)Ei=1;else{var ho=Ii;if("shape"in ho){var Hl=ho.shape;Ei=Hl[0]}else"radius"in ho&&(Ei=ho.radius|0),"width"in ho?(Ei=ho.width|0,"height"in ho):"height"in ho&&(Ei=ho.height|0);("color"in ho||"colors"in ho)&&(Ri=ho.color||ho.colors,Array.isArray(Ri)),Ri||("colorCount"in ho&&(xl=ho.colorCount|0),"colorType"in ho&&(Ps=ho.colorType),"colorFormat"in ho&&(Gi=ho.colorFormat)),"depth"in ho&&(ii.depth=ho.depth),"stencil"in ho&&(ii.stencil=ho.stencil),"depthStencil"in ho&&(ii.depthStencil=ho.depthStencil)}var fs;if(Ri)if(Array.isArray(Ri))for(fs=[],zn=0;zn<Ri.length;++zn)fs[zn]=Ri[zn];else fs=[Ri];else{fs=Array(xl);var Al={radius:Ei,format:Gi,type:Ps};for(zn=0;zn<xl;++zn)fs[zn]=ua.createCube(Al)}for(ii.color=Array(fs.length),zn=0;zn<fs.length;++zn){var El=fs[zn];Ei=Ei||El.width,ii.color[zn]={target:bu,data:fs[zn]}}for(zn=0;zn<6;++zn){for(var Ql=0;Ql<fs.length;++Ql)ii.color[Ql].target=bu+zn;zn>0&&(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.length;++zn)Ei[zn].resize(ii);for(zn=0;zn<6;++zn)An[zn].resize(ii);return Jn.width=Jn.height=ii,Jn}return Jn(Mn),v(Jn,{faces:An,resize:mi,_reglType:"framebufferCube",destroy:function(){An.forEach(function(Ii){Ii.destroy()})}})}function Fn(){wa.cur=null,wa.next=null,wa.dirty=!0,bt(Wa).forEach(function(Mn){Mn.framebuffer=nt.createFramebuffer(),Za(Mn)})}return v(wa,{getFramebuffer:function(Mn){if(typeof Mn=="function"&&Mn._reglType==="framebuffer"){var An=Mn._framebuffer;if(An instanceof Vn)return An}return null},create:qa,createCube:Qn,clear:function(){bt(Wa).forEach(hi)},restore:Fn})}var uh=5126,vf=34962,ol=34963;function mu(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=uh,this.offset=0,this.stride=0,this.divisor=0}function Pu(nt,Yt,cr,ua,Aa,xa,wa){for(var Ja=cr.maxAttributes,Sn=new Array(Ja),wn=0;wn<Ja;++wn)Sn[wn]=new mu;var hn=0,yi={},Bn={Record:mu,scope:{},state:Sn,currentVAO:null,targetVAO:null,restore:Va()?Rn:function(){},createVAO:hi,getVAO:Ea,destroyBuffer:Ln,setVAO:Va()?an:gn,clear:Va()?Wa:function(){}};function Ln(Za){for(var qa=0;qa<Sn.length;++qa){var Qn=Sn[qa];Qn.buffer===Za&&(nt.disableVertexAttribArray(qa),Qn.buffer=null)}}function Va(){return Yt.oes_vertex_array_object}function ea(){return Yt.angle_instanced_arrays}function Ea(Za){return typeof Za=="function"&&Za._vao?Za._vao:null}function an(Za){if(Za!==Bn.currentVAO){var qa=Va();Za?qa.bindVertexArrayOES(Za.vao):qa.bindVertexArrayOES(null),Bn.currentVAO=Za}}function gn(Za){if(Za!==Bn.currentVAO){if(Za)Za.bindAttrs();else{for(var qa=ea(),Qn=0;Qn<Sn.length;++Qn){var Fn=Sn[Qn];Fn.buffer?(nt.enableVertexAttribArray(Qn),Fn.buffer.bind(),nt.vertexAttribPointer(Qn,Fn.size,Fn.type,Fn.normalized,Fn.stride,Fn.offfset),qa&&Fn.divisor&&qa.vertexAttribDivisorANGLE(Qn,Fn.divisor)):(nt.disableVertexAttribArray(Qn),nt.vertexAttrib4f(Qn,Fn.x,Fn.y,Fn.z,Fn.w))}wa.elements?nt.bindBuffer(ol,wa.elements.buffer.buffer):nt.bindBuffer(ol,null)}Bn.currentVAO=Za}}function Wa(){bt(yi).forEach(function(Za){Za.destroy()})}function Vn(){this.id=++hn,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var Za=Va();Za?this.vao=Za.createVertexArrayOES():this.vao=null,yi[this.id]=this,this.buffers=[]}Vn.prototype.bindAttrs=function(){for(var Za=ea(),qa=this.attributes,Qn=0;Qn<qa.length;++Qn){var Fn=qa[Qn];Fn.buffer?(nt.enableVertexAttribArray(Qn),nt.bindBuffer(vf,Fn.buffer.buffer),nt.vertexAttribPointer(Qn,Fn.size,Fn.type,Fn.normalized,Fn.stride,Fn.offset),Za&&Fn.divisor&&Za.vertexAttribDivisorANGLE(Qn,Fn.divisor)):(nt.disableVertexAttribArray(Qn),nt.vertexAttrib4f(Qn,Fn.x,Fn.y,Fn.z,Fn.w))}for(var Mn=qa.length;Mn<Ja;++Mn)nt.disableVertexAttribArray(Mn);var An=xa.getElements(this.elements);An?nt.bindBuffer(ol,An.buffer.buffer):nt.bindBuffer(ol,null)},Vn.prototype.refresh=function(){var Za=Va();Za&&(Za.bindVertexArrayOES(this.vao),this.bindAttrs(),Bn.currentVAO=null,Za.bindVertexArrayOES(null))},Vn.prototype.destroy=function(){if(this.vao){var Za=Va();this===Bn.currentVAO&&(Bn.currentVAO=null,Za.bindVertexArrayOES(null)),Za.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),yi[this.id]&&(delete yi[this.id],ua.vaoCount-=1)};function Rn(){var Za=Va();Za&&bt(yi).forEach(function(qa){qa.refresh()})}function hi(Za){var qa=new Vn;ua.vaoCount+=1;function Qn(Fn){var Mn;if(Array.isArray(Fn))Mn=Fn,qa.elements&&qa.ownsElements&&qa.elements.destroy(),qa.elements=null,qa.ownsElements=!1,qa.offset=0,qa.count=0,qa.instances=-1,qa.primitive=4;else{if(Fn.elements){var An=Fn.elements;qa.ownsElements?typeof An=="function"&&An._reglType==="elements"?(qa.elements.destroy(),qa.ownsElements=!1):(qa.elements(An),qa.ownsElements=!1):xa.getElements(Fn.elements)?(qa.elements=Fn.elements,qa.ownsElements=!1):(qa.elements=xa.create(Fn.elements),qa.ownsElements=!0)}else qa.elements=null,qa.ownsElements=!1;Mn=Fn.attributes,qa.offset=0,qa.count=-1,qa.instances=-1,qa.primitive=4,qa.elements&&(qa.count=qa.elements._elements.vertCount,qa.primitive=qa.elements._elements.primType),"offset"in Fn&&(qa.offset=Fn.offset|0),"count"in Fn&&(qa.count=Fn.count|0),"instances"in Fn&&(qa.instances=Fn.instances|0),"primitive"in Fn&&(qa.primitive=xt[Fn.primitive])}var Jn={},mi=qa.attributes;mi.length=Mn.length;for(var Ii=0;Ii<Mn.length;++Ii){var zn=Mn[Ii],ii=mi[Ii]=new mu,Ei=zn.data||zn;if(Array.isArray(Ei)||wr(Ei)||Ir(Ei)){var Ri;qa.buffers[Ii]&&(Ri=qa.buffers[Ii],wr(Ei)&&Ri._buffer.byteLength>=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;Gi<qa.buffers.length;++Gi)!Jn[Gi]&&qa.buffers[Gi]&&(qa.buffers[Gi].destroy(),qa.buffers[Gi]=null);return qa.refresh(),Qn}return Qn.destroy=function(){for(var Fn=0;Fn<qa.buffers.length;++Fn)qa.buffers[Fn]&&qa.buffers[Fn].destroy();qa.buffers.length=0,qa.ownsElements&&(qa.elements.destroy(),qa.elements=null,qa.ownsElements=!1),qa.destroy()},Qn._vao=qa,Qn._reglType="vao",Qn(Za)}return Bn}var kf=35632,hl=35633,sf=35718,Mc=35721;function Hu(nt,Yt,cr,ua){var Aa={},xa={};function wa(ea,Ea,an,gn){this.name=ea,this.id=Ea,this.location=an,this.info=gn}function Ja(ea,Ea){for(var an=0;an<ea.length;++an)if(ea[an].id===Ea.id){ea[an].location=Ea.location;return}ea.push(Ea)}function Sn(ea,Ea,an){var gn=ea===kf?Aa:xa,Wa=gn[Ea];if(!Wa){var Vn=Yt.str(Ea);Wa=nt.createShader(ea),nt.shaderSource(Wa,Vn),nt.compileShader(Wa),gn[Ea]=Wa}return Wa}var wn={},hn=[],yi=0;function Bn(ea,Ea){this.id=yi++,this.fragId=ea,this.vertId=Ea,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,ua.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function Ln(ea,Ea,an){var gn,Wa,Vn=Sn(kf,ea.fragId),Rn=Sn(hl,ea.vertId),hi=ea.program=nt.createProgram();if(nt.attachShader(hi,Vn),nt.attachShader(hi,Rn),an)for(gn=0;gn<an.length;++gn){var Za=an[gn];nt.bindAttribLocation(hi,Za[0],Za[1])}nt.linkProgram(hi);var qa=nt.getProgramParameter(hi,sf);ua.profile&&(ea.stats.uniformsCount=qa);var Qn=ea.uniforms;for(gn=0;gn<qa;++gn)if(Wa=nt.getActiveUniform(hi,gn),Wa)if(Wa.size>1)for(var Fn=0;Fn<Wa.size;++Fn){var Mn=Wa.name.replace("[0]","["+Fn+"]");Ja(Qn,new wa(Mn,Yt.id(Mn),nt.getUniformLocation(hi,Mn),Wa))}else Ja(Qn,new wa(Wa.name,Yt.id(Wa.name),nt.getUniformLocation(hi,Wa.name),Wa));var An=nt.getProgramParameter(hi,Mc);ua.profile&&(ea.stats.attributesCount=An);var Jn=ea.attributes;for(gn=0;gn<An;++gn)Wa=nt.getActiveAttrib(hi,gn),Wa&&Ja(Jn,new wa(Wa.name,Yt.id(Wa.name),nt.getAttribLocation(hi,Wa.name),Wa))}ua.profile&&(cr.getMaxUniformsCount=function(){var ea=0;return hn.forEach(function(Ea){Ea.stats.uniformsCount>ea&&(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;ea<hn.length;++ea)Ln(hn[ea],null,hn[ea].attributes.map(function(Ea){return[Ea.location,Ea.name]}))}return{clear:function(){var ea=nt.deleteShader.bind(nt);bt(Aa).forEach(ea),Aa={},bt(xa).forEach(ea),xa={},hn.forEach(function(Ea){nt.deleteProgram(Ea.program)}),hn.length=0,wn={},cr.shaderCount=0},program:function(ea,Ea,an,gn){var Wa=wn[Ea];Wa||(Wa=wn[Ea]={});var Vn=Wa[ea];if(Vn&&(Vn.refCount++,!gn))return Vn;var Rn=new Bn(Ea,ea);return cr.shaderCount++,Ln(Rn,an,gn),Vn||(Wa[ea]=Rn),hn.push(Rn),v(Rn,{destroy:function(){if(Rn.refCount--,Rn.refCount<=0){nt.deleteProgram(Rn.program);var hi=hn.indexOf(Rn);hn.splice(hi,1),cr.shaderCount--}Wa[Rn.vertId].refCount<=0&&(nt.deleteShader(xa[Rn.vertId]),delete xa[Rn.vertId],delete wn[Rn.fragId][Rn.vertId]),Object.keys(wn[Rn.fragId]).length||(nt.deleteShader(Aa[Rn.fragId]),delete Aa[Rn.fragId],delete wn[Rn.fragId])}})},restore:Va,shader:Sn,frag:-1,vert:-1}}var mf=6408,Wu=5121,Zc=3333,Lf=5126;function ru(nt,Yt,cr,ua,Aa,xa,wa){function Ja(hn){var yi;Yt.next===null?yi=Wu:yi=Yt.next.colorAttachments[0].texture._texture.type;var Bn=0,Ln=0,Va=ua.framebufferWidth,ea=ua.framebufferHeight,Ea=null;wr(hn)?Ea=hn:hn&&(Bn=hn.x|0,Ln=hn.y|0,Va=(hn.width||ua.framebufferWidth-Bn)|0,ea=(hn.height||ua.framebufferHeight-Ln)|0,Ea=hn.data||null),cr();var an=Va*ea*4;return Ea||(yi===Wu?Ea=new Uint8Array(an):yi===Lf&&(Ea=Ea||new Float32Array(an))),nt.pixelStorei(Zc,4),nt.readPixels(Bn,Ln,Va,ea,mf,yi,Ea),Ea}function Sn(hn){var yi;return Yt.setFBO({framebuffer:hn.framebuffer},function(){yi=Ja(hn)}),yi}function wn(hn){return!hn||!("framebuffer"in hn)?Ja(hn):Sn(hn)}return wn}var jf=0,Xu="";function Ec(nt){return gu(mc(sc(nt)))}function mc(nt){return er(Dn(kc(nt),nt.length*8))}function jl(nt,Yt){var cr=kc(nt);cr.length>16&&(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<nt.length;Aa++)ua=nt.charCodeAt(Aa),cr+=Yt.charAt(ua>>>4&15)+Yt.charAt(ua&15);return cr}function Cc(nt){for(var Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cr="",ua=nt.length,Aa=0;Aa<ua;Aa+=3)for(var xa=nt.charCodeAt(Aa)<<16|(Aa+1<ua?nt.charCodeAt(Aa+1)<<8:0)|(Aa+2<ua?nt.charCodeAt(Aa+2):0),wa=0;wa<4;wa++)Aa*8+wa*6>nt.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;Aa<Sn.length;Aa++)Sn[Aa]=nt.charCodeAt(Aa*2)<<8|nt.charCodeAt(Aa*2+1);for(;Sn.length>0;){for(Ja=Array(),wa=0,Aa=0;Aa<Sn.length;Aa++)wa=(wa<<16)+Sn[Aa],xa=Math.floor(wa/cr),wa-=xa*cr,(Ja.length>0||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<hn;Aa++)wn=Yt[0]+wn;return wn}function sc(nt){for(var Yt="",cr=-1,ua,Aa;++cr<nt.length;)ua=nt.charCodeAt(cr),Aa=cr+1<nt.length?nt.charCodeAt(cr+1):0,55296<=ua&&ua<=56319&&56320<=Aa&&Aa<=57343&&(ua=65536+((ua&1023)<<10)+(Aa&1023),cr++),ua<=127?Yt+=String.fromCharCode(ua):ua<=2047?Yt+=String.fromCharCode(192|ua>>>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<Yt.length;cr++)Yt[cr]=0;for(var cr=0;cr<nt.length*8;cr+=8)Yt[cr>>5]|=(nt.charCodeAt(cr/8)&255)<<24-cr%32;return Yt}function er(nt){for(var Yt="",cr=0;cr<nt.length*32;cr+=8)Yt+=String.fromCharCode(nt[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<nt.length;Bn+=16){for(Aa=cr[0],xa=cr[1],wa=cr[2],Ja=cr[3],Sn=cr[4],wn=cr[5],hn=cr[6],yi=cr[7],Ln=0;Ln<64;Ln++)Ln<16?ua[Ln]=nt[Ln+Bn]:ua[Ln]=On(On(On(ri(ua[Ln-2]),ua[Ln-7]),Yn(ua[Ln-15])),ua[Ln-16]),Va=On(On(On(On(yi,In(Sn)),$r(Sn,wn,hn)),di[Ln]),ua[Ln]),ea=On(pn(Aa),La(Aa,xa,wa)),yi=hn,hn=wn,wn=Sn,Sn=On(Ja,Va),Ja=wa,wa=xa,xa=Aa,Aa=On(Va,ea);cr[0]=On(Aa,cr[0]),cr[1]=On(xa,cr[1]),cr[2]=On(wa,cr[2]),cr[3]=On(Ja,cr[3]),cr[4]=On(Sn,cr[4]),cr[5]=On(wn,cr[5]),cr[6]=On(hn,cr[6]),cr[7]=On(yi,cr[7])}return cr}function On(nt,Yt){var cr=(nt&65535)+(Yt&65535),ua=(nt>>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;an<Aa.length;++an)if(Aa[an]===Va&&!xa[an])return ua[an]}var gn="g"+cr++;return ua.push(gn),Aa.push(Va),xa.push(Ea),gn}function Ja(){var Va=[];function ea(){Va.push.apply(Va,qn(arguments))}var Ea=[];function an(){var gn="v"+cr++;return Ea.push(gn),arguments.length>0&&(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<ea;++gn)an();var Wa=Sn(),Vn=Wa.toString,Rn=yi[Va]=v(Wa,{arg:an,toString:function(){return xn(["function(",Ea.join(),"){",Vn(),"}"])}});return Rn}function Ln(){var Va=['"use strict";',hn,"return {"];Object.keys(yi).forEach(function(gn){Va.push('"',gn,'":',yi[gn].toString(),",")}),Va.push("}");var ea=xn(Va).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),Ea;if(Yt&&(Ea=Ec(ea),Yt[Ea]))return Yt[Ea].apply(null,Aa);var an=Function.apply(null,ua.concat(ea));return Yt&&(Yt[Ea]=an),an.apply(null,Aa)}return{global:hn,link:wa,block:Ja,proc:Bn,scope:Sn,cond:wn,compile:Ln}}var Ki="xyzw".split(""),ao=5121,Ji=1,co=2,wi=0,ui=1,xo=2,Qo=3,xs=4,Qs=5,Rs=6,Ks="dither",ys="blend.enable",Fl="blend.color",yl="blend.equation",sl="blend.func",Ui="depth.enable",Io="depth.func",Xs="depth.range",Ls="depth.mask",ou="colorMask",Iu="cull.enable",Zu="cull.face",Lc="frontFace",yu="lineWidth",Pc="polygonOffset.enable",wu="polygonOffset.offset",gc="sample.alpha",fo="sample.enable",zo="sample.coverage",Ic="stencil.enable",lc="stencil.mask",Yu="stencil.func",Ne="stencil.opFront",R="stencil.opBack",ae="scissor.enable",we="scissor.box",Se="viewport",Oe="profile",pt="framebuffer",At="vert",Bt="frag",$t="elements",br="primitive",Ar="count",Yr="offset",sa="instances",He="vao",Je="Width",lt="Height",dt=pt+Je,Ct=pt+lt,wt=Se+Je,Dt=Se+lt,ur="drawingBuffer",mr=ur+Je,Er=ur+lt,Br=[sl,yl,Yu,Ne,R,zo,Se,we,wu],Qr=34962,ga=34963,Sa=2884,Oa=3042,vn=3024,Xn=2960,Hn=2929,oi=3089,Ti=32823,Wi=32926,Bi=32928,Ao=5126,ss=35664,So=35665,Ko=35666,hs=5124,ll=35667,Js=35668,es=35669,ts=35670,Pl=35671,$l=35672,Ru=35673,hu=35674,wl=35675,su=35676,uc=35678,Vl=35680,ql=4,de=1028,De=1029,et=2304,vt=2305,_t=32775,St=32776,ar=519,zt=7680,gr=0,qr=1,Wr=32774,Ta=513,ya=36160,tn=36064,on={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ma={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":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<cr?-1:1})}function Pa(nt,Yt,cr,ua){this.thisDep=nt,this.contextDep=Yt,this.propDep=cr,this.append=ua}function si(nt){return nt&&!(nt.thisDep||nt.contextDep||nt.propDep)}function ni(nt){return new Pa(!1,!1,!1,nt)}function vi(nt,Yt){var cr=nt.type;if(cr===wi){var ua=nt.data.length;return new Pa(!0,ua>=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<nt.data.length;++Sn){var wn=nt.data[Sn];if(wn.type===ui)Ja=!0;else if(wn.type===xo)wa=!0;else if(wn.type===Qo)xa=!0;else if(wn.type===wi){xa=!0;var hn=wn.data;hn>=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<sr.length;++lr)pr.push([fr[sr[lr]]|0,sr[lr]]);return pr}}return null}function xl(gt,Et,Ft){var nr=gt.static,fr=gt.dynamic;function sr(Vt){if(Vt in nr){var Dr=Yt.id(nr[Vt]),Jr=ni(function(){return Dr});return Jr.id=Dr,Jr}else if(Vt in fr){var ba=fr[Vt];return vi(ba,function(_n,Xa){var ln=_n.invoke(Xa,ba),$n=Xa.def(_n.shared.strings,".id(",ln,")");return $n})}return null}var pr=sr(Bt),lr=sr(At),Xt=null,or;return si(pr)&&si(lr)?(Xt=hn.program(lr.id,pr.id,null,Ft),or=ni(function(Vt,Dr){return Vt.link(Xt)})):or=new Pa(pr&&pr.thisDep||lr&&lr.thisDep,pr&&pr.contextDep||lr&&lr.contextDep,pr&&pr.propDep||lr&&lr.propDep,function(Vt,Dr){var Jr=Vt.shared.shader,ba;pr?ba=pr.append(Vt,Dr):ba=Dr.def(Jr,".",Bt);var _n;lr?_n=lr.append(Vt,Dr):_n=Dr.def(Jr,".",At);var Xa=Jr+".program("+_n+","+ba;return Dr.def(Xa+")")}),{frag:pr,vert:lr,progVar:or,program:Xt}}function ho(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={},sr=!1;function pr(){if(He in Ft){var Nn=Ft[He];return Nn!==null&&wn.getVAO(Nn)===null&&(Nn=wn.createVAO(Nn)),sr=!0,fr.vao=Nn,ni(function(Tn){var En=wn.getVAO(Nn);return En?Tn.link(En):"null"})}else if(He in nr){sr=!0;var dn=nr[He];return vi(dn,function(Tn,En){var Gn=Tn.invoke(En,dn);return En.def(Tn.shared.vao+".getVAO("+Gn+")")})}return null}var lr=pr(),Xt=!1;function or(){if($t in Ft){var Nn=Ft[$t];if(fr.elements=Nn,mn(Nn)){var dn=fr.elements=xa.create(Nn,!0);Nn=xa.getElements(dn),Xt=!0}else Nn&&(Nn=xa.getElements(Nn),Xt=!0);var Tn=ni(function(Gn,ci){if(Nn){var bo=Gn.link(Nn);return Gn.ELEMENTS=bo,bo}return Gn.ELEMENTS=null,null});return Tn.value=Nn,Tn}else if($t in nr){Xt=!0;var En=nr[$t];return vi(En,function(Gn,ci){var bo=Gn.shared,jo=bo.isBufferArgs,ks=bo.elements,Fo=Gn.invoke(ci,En),bs=ci.def("null"),Hs=ci.def(jo,"(",Fo,")"),pu=Gn.cond(Hs).then(bs,"=",ks,".createStream(",Fo,");").else(bs,"=",ks,".getElements(",Fo,");");return ci.entry(pu),ci.exit(Gn.cond(Hs).then(ks,".destroyStream(",bs,");")),Gn.ELEMENTS=bs,bs})}else if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.elements+".getElements("+Gn.shared.vao+".currentVAO.elements):null")});return null}var Vt=or();function Dr(){if(br in Ft){var Nn=Ft[br];return fr.primitive=Nn,ni(function(Tn,En){return xt[Nn]})}else if(br in nr){var dn=nr[br];return vi(dn,function(Tn,En){var Gn=Tn.constants.primTypes,ci=Tn.invoke(En,dn);return En.def(Gn,"[",ci,"]")})}else{if(Xt)return si(Vt)?Vt.value?ni(function(Tn,En){return En.def(Tn.ELEMENTS,".primType")}):ni(function(){return ql}):new Pa(Vt.thisDep,Vt.contextDep,Vt.propDep,function(Tn,En){var Gn=Tn.ELEMENTS;return En.def(Gn,"?",Gn,".primType:",ql)});if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Tn,En){return En.def(Tn.shared.vao+".currentVAO?"+Tn.shared.vao+".currentVAO.primitive:"+ql)})}return null}function Jr(Nn,dn){if(Nn in Ft){var Tn=Ft[Nn]|0;return dn?fr.offset=Tn:fr.instances=Tn,ni(function(Gn,ci){return dn&&(Gn.OFFSET=Tn),Tn})}else if(Nn in nr){var En=nr[Nn];return vi(En,function(Gn,ci){var bo=Gn.invoke(ci,En);return dn&&(Gn.OFFSET=bo),bo})}else if(dn){if(Xt)return ni(function(Gn,ci){return Gn.OFFSET=0,0});if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.vao+".currentVAO.offset:0")})}else if(sr)return new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(Gn,ci){return ci.def(Gn.shared.vao+".currentVAO?"+Gn.shared.vao+".currentVAO.instances:-1")});return null}var ba=Jr(Yr,!0);function _n(){if(Ar in Ft){var Nn=Ft[Ar]|0;return fr.count=Nn,ni(function(){return Nn})}else if(Ar in nr){var dn=nr[Ar];return vi(dn,function(ci,bo){var jo=ci.invoke(bo,dn);return jo})}else if(Xt)if(si(Vt)){if(Vt)return ba?new Pa(ba.thisDep,ba.contextDep,ba.propDep,function(ci,bo){var jo=bo.def(ci.ELEMENTS,".vertCount-",ci.OFFSET);return jo}):ni(function(ci,bo){return bo.def(ci.ELEMENTS,".vertCount")});var Tn=ni(function(){return-1});return Tn}else{var En=new Pa(Vt.thisDep||ba.thisDep,Vt.contextDep||ba.contextDep,Vt.propDep||ba.propDep,function(ci,bo){var jo=ci.ELEMENTS;return ci.OFFSET?bo.def(jo,"?",jo,".vertCount-",ci.OFFSET,":-1"):bo.def(jo,"?",jo,".vertCount:-1")});return En}else if(sr){var Gn=new Pa(lr.thisDep,lr.contextDep,lr.propDep,function(ci,bo){return bo.def(ci.shared.vao,".currentVAO?",ci.shared.vao,".currentVAO.count:-1")});return Gn}return null}var Xa=Dr(),ln=_n(),$n=Jr(sa,!1);return{elements:Vt,primitive:Xa,count:ln,instances:$n,offset:ba,vao:lr,vaoActive:sr,elementsActive:Xt,static:fr}}function Hl(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Za.forEach(function(sr){var pr=Fn(sr);function lr(Xt,or){if(sr in Ft){var Vt=Xt(Ft[sr]);fr[pr]=ni(function(){return Vt})}else if(sr in nr){var Dr=nr[sr];fr[pr]=vi(Dr,function(Jr,ba){return or(Jr,ba,Jr.invoke(ba,Dr))})}}switch(sr){case Iu:case ys:case Ks:case Ic:case Ui:case ae:case Pc:case gc:case fo:case Ls:return lr(function(Xt){return Xt},function(Xt,or,Vt){return Vt});case Io:return lr(function(Xt){return Ma[Xt]},function(Xt,or,Vt){var Dr=Xt.constants.compareFuncs;return or.def(Dr,"[",Vt,"]")});case Xs:return lr(function(Xt){return Xt},function(Xt,or,Vt){var Dr=or.def("+",Vt,"[0]"),Jr=or.def("+",Vt,"[1]");return[Dr,Jr]});case sl:return lr(function(Xt){var or="srcRGB"in Xt?Xt.srcRGB:Xt.src,Vt="srcAlpha"in Xt?Xt.srcAlpha:Xt.src,Dr="dstRGB"in Xt?Xt.dstRGB:Xt.dst,Jr="dstAlpha"in Xt?Xt.dstAlpha:Xt.dst;return[on[or],on[Dr],on[Vt],on[Jr]]},function(Xt,or,Vt){var Dr=Xt.constants.blendFuncs;function Jr(dn,Tn){var En=or.def('"',dn,Tn,'" in ',Vt,"?",Vt,".",dn,Tn,":",Vt,".",dn);return En}var ba=Jr("src","RGB"),_n=Jr("dst","RGB"),Xa=or.def(Dr,"[",ba,"]"),ln=or.def(Dr,"[",Jr("src","Alpha"),"]"),$n=or.def(Dr,"[",_n,"]"),Nn=or.def(Dr,"[",Jr("dst","Alpha"),"]");return[Xa,$n,ln,Nn]});case yl:return lr(function(Xt){if(typeof Xt=="string")return[an[Xt],an[Xt]];if(typeof Xt=="object")return[an[Xt.rgb],an[Xt.alpha]]},function(Xt,or,Vt){var Dr=Xt.constants.blendEquations,Jr=or.def(),ba=or.def(),_n=Xt.cond("typeof ",Vt,'==="string"');return _n.then(Jr,"=",ba,"=",Dr,"[",Vt,"];"),_n.else(Jr,"=",Dr,"[",Vt,".rgb];",ba,"=",Dr,"[",Vt,".alpha];"),or(_n),[Jr,ba]});case Fl:return lr(function(Xt){return p(4,function(or){return+Xt[or]})},function(Xt,or,Vt){return p(4,function(Dr){return or.def("+",Vt,"[",Dr,"]")})});case lc:return lr(function(Xt){return Xt|0},function(Xt,or,Vt){return or.def(Vt,"|0")});case Yu:return lr(function(Xt){var or=Xt.cmp||"keep",Vt=Xt.ref||0,Dr="mask"in Xt?Xt.mask:-1;return[Ma[or],Vt,Dr]},function(Xt,or,Vt){var Dr=Xt.constants.compareFuncs,Jr=or.def('"cmp" in ',Vt,"?",Dr,"[",Vt,".cmp]",":",zt),ba=or.def(Vt,".ref|0"),_n=or.def('"mask" in ',Vt,"?",Vt,".mask|0:-1");return[Jr,ba,_n]});case Ne:case R:return lr(function(Xt){var or=Xt.fail||"keep",Vt=Xt.zfail||"keep",Dr=Xt.zpass||"keep";return[sr===R?De:de,Na[or],Na[Vt],Na[Dr]]},function(Xt,or,Vt){var Dr=Xt.constants.stencilOps;function Jr(ba){return or.def('"',ba,'" in ',Vt,"?",Dr,"[",Vt,".",ba,"]:",zt)}return[sr===R?De:de,Jr("fail"),Jr("zfail"),Jr("zpass")]});case wu:return lr(function(Xt){var or=Xt.factor|0,Vt=Xt.units|0;return[or,Vt]},function(Xt,or,Vt){var Dr=or.def(Vt,".factor|0"),Jr=or.def(Vt,".units|0");return[Dr,Jr]});case Zu:return lr(function(Xt){var or=0;return Xt==="front"?or=de:Xt==="back"&&(or=De),or},function(Xt,or,Vt){return or.def(Vt,'==="front"?',de,":",De)});case yu:return lr(function(Xt){return Xt},function(Xt,or,Vt){return Vt});case Lc:return lr(function(Xt){return Ka[Xt]},function(Xt,or,Vt){return or.def(Vt+'==="cw"?'+et+":"+vt)});case ou:return lr(function(Xt){return Xt.map(function(or){return!!or})},function(Xt,or,Vt){return p(4,function(Dr){return"!!"+Vt+"["+Dr+"]"})});case zo:return lr(function(Xt){var or="value"in Xt?Xt.value:1,Vt=!!Xt.invert;return[or,Vt]},function(Xt,or,Vt){var Dr=or.def('"value" in ',Vt,"?+",Vt,".value:1"),Jr=or.def("!!",Vt,".invert");return[Dr,Jr]})}}),fr}function fs(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Object.keys(Ft).forEach(function(sr){var pr=Ft[sr],lr;if(typeof pr=="number"||typeof pr=="boolean")lr=ni(function(){return pr});else if(typeof pr=="function"){var Xt=pr._reglType;Xt==="texture2d"||Xt==="textureCube"?lr=ni(function(or){return or.link(pr)}):(Xt==="framebuffer"||Xt==="framebufferCube")&&(lr=ni(function(or){return or.link(pr.color[0])}))}else Ya(pr)&&(lr=ni(function(or){var Vt=or.global.def("[",p(pr.length,function(Dr){return pr[Dr]}),"]");return Vt}));lr.value=pr,fr[sr]=lr}),Object.keys(nr).forEach(function(sr){var pr=nr[sr];fr[sr]=vi(pr,function(lr,Xt){return lr.invoke(Xt,pr)})}),fr}function Al(gt,Et){var Ft=gt.static,nr=gt.dynamic,fr={};return Object.keys(Ft).forEach(function(sr){var pr=Ft[sr],lr=Yt.id(sr),Xt=new Ea;if(mn(pr))Xt.state=Ji,Xt.buffer=Aa.getBuffer(Aa.create(pr,Qr,!1,!0)),Xt.type=0;else{var or=Aa.getBuffer(pr);if(or)Xt.state=Ji,Xt.buffer=or,Xt.type=0;else if("constant"in pr){var Vt=pr.constant;Xt.buffer="null",Xt.state=co,typeof Vt=="number"?Xt.x=Vt:Ki.forEach(function($n,Nn){Nn<Vt.length&&(Xt[$n]=Vt[Nn])})}else{mn(pr.buffer)?or=Aa.getBuffer(Aa.create(pr.buffer,Qr,!1,!0)):or=Aa.getBuffer(pr.buffer);var Dr=pr.offset|0,Jr=pr.stride|0,ba=pr.size|0,_n=!!pr.normalized,Xa=0;"type"in pr&&(Xa=la[pr.type]);var ln=pr.divisor|0;Xt.buffer=or,Xt.state=Ji,Xt.size=ba,Xt.normalized=_n,Xt.type=Xa||or.dtype,Xt.offset=Dr,Xt.stride=Jr,Xt.divisor=ln}}fr[sr]=ni(function($n,Nn){var dn=$n.attribCache;if(lr in dn)return dn[lr];var Tn={isStream:!1};return Object.keys(Xt).forEach(function(En){Tn[En]=Xt[En]}),Xt.buffer&&(Tn.buffer=$n.link(Xt.buffer),Tn.type=Tn.type||Tn.buffer+".dtype"),dn[lr]=Tn,Tn})}),Object.keys(nr).forEach(function(sr){var pr=nr[sr];function lr(Xt,or){var Vt=Xt.invoke(or,pr),Dr=Xt.shared,Jr=Xt.constants,ba=Dr.isBufferArgs,_n=Dr.buffer,Xa={isStream:or.def(!1)},ln=new Ea;ln.state=Ji,Object.keys(ln).forEach(function(Tn){Xa[Tn]=or.def(""+ln[Tn])});var $n=Xa.buffer,Nn=Xa.type;or("if(",ba,"(",Vt,")){",Xa.isStream,"=true;",$n,"=",_n,".createStream(",Qr,",",Vt,");",Nn,"=",$n,".dtype;","}else{",$n,"=",_n,".getBuffer(",Vt,");","if(",$n,"){",Nn,"=",$n,".dtype;",'}else if("constant" in ',Vt,"){",Xa.state,"=",co,";","if(typeof "+Vt+'.constant === "number"){',Xa[Ki[0]],"=",Vt,".constant;",Ki.slice(1).map(function(Tn){return Xa[Tn]}).join("="),"=0;","}else{",Ki.map(function(Tn,En){return Xa[Tn]+"="+Vt+".constant.length>"+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;or<nr.length;++or){var Vt=nr[or],Dr=Vt.name,Jr=Vt.info.type,ba=Ft.uniforms[Dr],_n=gt.link(Vt),Xa=_n+".location",ln;if(ba){if(!fr(ba))continue;if(si(ba)){var $n=ba.value;if(Jr===uc||Jr===Vl){var Nn=gt.link($n._texture||$n.color[0]._texture);Et(lr,".uniform1i(",Xa,",",Nn+".bind());"),Et.exit(Nn,".unbind();")}else if(Jr===hu||Jr===wl||Jr===su){var dn=gt.global.def("new Float32Array(["+Array.prototype.slice.call($n)+"])"),Tn=2;Jr===wl?Tn=3:Jr===su&&(Tn=4),Et(lr,".uniformMatrix",Tn,"fv(",Xa,",false,",dn,");")}else{switch(Jr){case Ao:Xt="1f";break;case ss:Xt="2f";break;case So:Xt="3f";break;case Ko:Xt="4f";break;case ts:Xt="1i";break;case hs:Xt="1i";break;case Pl:Xt="2i";break;case ll:Xt="2i";break;case $l:Xt="3i";break;case Js:Xt="3i";break;case Ru:Xt="4i";break;case es:Xt="4i";break}Et(lr,".uniform",Xt,"(",Xa,",",Ya($n)?Array.prototype.slice.call($n):$n,");")}continue}else ln=ba.append(gt,Et)}else{if(!fr(Pi))continue;ln=Et.def(pr.uniforms,"[",Yt.id(Dr),"]")}Jr===uc?Et("if(",ln,"&&",ln,'._reglType==="framebuffer"){',ln,"=",ln,".color[0];","}"):Jr===Vl&&Et("if(",ln,"&&",ln,'._reglType==="framebufferCube"){',ln,"=",ln,".color[0];","}");var En=1;switch(Jr){case uc:case Vl:var Gn=Et.def(ln,"._texture");Et(lr,".uniform1i(",Xa,",",Gn,".bind());"),Et.exit(Gn,".unbind();");continue;case hs:case ts:Xt="1i";break;case ll:case Pl:Xt="2i",En=2;break;case Js:case $l:Xt="3i",En=3;break;case es:case Ru:Xt="4i",En=4;break;case Ao:Xt="1f";break;case ss:Xt="2f",En=2;break;case So:Xt="3f",En=3;break;case Ko:Xt="4f",En=4;break;case hu:Xt="Matrix2fv";break;case wl:Xt="Matrix3fv";break;case su:Xt="Matrix4fv";break}if(Xt.charAt(0)==="M"){Et(lr,".uniform",Xt,"(",Xa,",");var ci=Math.pow(Jr-hu+2,2),bo=gt.global.def("new Float32Array(",ci,")");Array.isArray(ln)?Et("false,(",p(ci,function(Hs){return bo+"["+Hs+"]="+ln[Hs]}),",",bo,")"):Et("false,(Array.isArray(",ln,")||",ln," instanceof Float32Array)?",ln,":(",p(ci,function(Hs){return bo+"["+Hs+"]="+ln+"["+Hs+"]"}),",",bo,")"),Et(");")}else if(En>1){for(var jo=[],ks=[],Fo=0;Fo<En;++Fo)Array.isArray(ln)?ks.push(ln[Fo]):ks.push(Et.def(ln+"["+Fo+"]")),sr&&jo.push(Et.def());sr&&Et("if(!",gt.batchId,"||",jo.map(function(Hs,pu){return Hs+"!=="+ks[pu]}).join("||"),"){",jo.map(function(Hs,pu){return Hs+"="+ks[pu]+";"}).join("")),Et(lr,".uniform",Xt,"(",Xa,",",ks.join(","),");"),sr&&Et("}")}else{if(sr){var bs=Et.def();Et("if(!",gt.batchId,"||",bs,"!==",ln,"){",bs,"=",ln,";")}Et(lr,".uniform",Xt,"(",Xa,",",ln,");"),sr&&Et("}")}}}function ye(gt,Et,Ft,nr){var fr=gt.shared,sr=fr.gl,pr=fr.draw,lr=nr.draw;function Xt(){var En=lr.elements,Gn,ci=Et;return En?((En.contextDep&&nr.contextDynamic||En.propDep)&&(ci=Ft),Gn=En.append(gt,ci),lr.elementsActive&&ci("if("+Gn+")"+sr+".bindBuffer("+ga+","+Gn+".buffer.buffer);")):(Gn=ci.def(),ci(Gn,"=",pr,".",$t,";","if(",Gn,"){",sr,".bindBuffer(",ga,",",Gn,".buffer.buffer);}","else if(",fr.vao,".currentVAO){",Gn,"=",gt.shared.elements+".getElements("+fr.vao,".currentVAO.elements);",Vn?"":"if("+Gn+")"+sr+".bindBuffer("+ga+","+Gn+".buffer.buffer);","}")),Gn}function or(){var En=lr.count,Gn,ci=Et;return En?((En.contextDep&&nr.contextDynamic||En.propDep)&&(ci=Ft),Gn=En.append(gt,ci)):Gn=ci.def(pr,".",Ar),Gn}var Vt=Xt();function Dr(En){var Gn=lr[En];return Gn?Gn.contextDep&&nr.contextDynamic||Gn.propDep?Gn.append(gt,Ft):Gn.append(gt,Et):Et.def(pr,".",En)}var Jr=Dr(br),ba=Dr(Yr),_n=or();if(typeof _n=="number"){if(_n===0)return}else Ft("if(",_n,"){"),Ft.exit("}");var Xa,ln;gn&&(Xa=Dr(sa),ln=gt.instancing);var $n=Vt+".type",Nn=lr.elements&&si(lr.elements)&&!lr.vaoActive;function dn(){function En(){Ft(ln,".drawElementsInstancedANGLE(",[Jr,_n,$n,ba+"<<(("+$n+"-"+ao+")>>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<Et.length;++Ft)if(c.isDynamic(gt[Et[Ft]]))return!0;return!1}}function Fr(gt,Et,Ft){var nr=Et.static[Ft];if(!nr||!_r(nr))return;var fr=gt.global,sr=Object.keys(nr),pr=!1,lr=!1,Xt=!1,or=gt.global.def("{}");sr.forEach(function(Dr){var Jr=nr[Dr];if(c.isDynamic(Jr)){typeof Jr=="function"&&(Jr=nr[Dr]=c.unbox(Jr));var ba=vi(Jr,null);pr=pr||ba.thisDep,Xt=Xt||ba.propDep,lr=lr||ba.contextDep}else{switch(fr(or,".",Dr,"="),typeof Jr){case"number":fr(Jr);break;case"string":fr('"',Jr,'"');break;case"object":Array.isArray(Jr)&&fr("[",Jr.join(),"]");break;default:fr(gt.link(Jr));break}fr(";")}});function Vt(Dr,Jr){sr.forEach(function(ba){var _n=nr[ba];if(c.isDynamic(_n)){var Xa=Dr.invoke(Jr,_n);Jr(or,".",ba,"=",Xa,";")}})}Et.dynamic[Ft]=new c.DynamicVariable(xs,{thisDep:pr,contextDep:lr,propDep:Xt,ref:or,append:Vt}),delete Et.static[Ft]}function hr(gt,Et,Ft,nr,fr){var sr=ii();sr.stats=sr.link(fr),Object.keys(Et.static).forEach(function(lr){Fr(sr,Et,lr)}),Br.forEach(function(lr){Fr(sr,gt,lr)});var pr=Ql(gt,Et,Ft,nr,sr);return pr.shader.program&&(pr.shader.program.attributes.sort(function(lr,Xt){return lr.name<Xt.name?-1:1}),pr.shader.program.uniforms.sort(function(lr,Xt){return lr.name<Xt.name?-1:1})),Ge(sr,pr),jt(sr,pr),mt(sr,pr),v(sr.compile(),{destroy:function(){pr.shader.program.destroy()}})}return{next:hi,current:Rn,procs:function(){var gt=ii(),Et=gt.proc("poll"),Ft=gt.proc("refresh"),nr=gt.block();Et(nr),Ft(nr);var fr=gt.shared,sr=fr.gl,pr=fr.next,lr=fr.current;nr(lr,".dirty=false;"),pl(gt,Et),pl(gt,Ft,null,!0);var Xt;gn&&(Xt=gt.link(gn)),cr.oes_vertex_array_object&&Ft(gt.link(cr.oes_vertex_array_object),".bindVertexArrayOES(null);");var or=Ft.def(fr.attributes),Vt=Ft.def(0),Dr=gt.cond(Vt,".buffer");Dr.then(sr,".enableVertexAttribArray(i);",sr,".bindBuffer(",Qr,",",Vt,".buffer.buffer);",sr,".vertexAttribPointer(i,",Vt,".size,",Vt,".type,",Vt,".normalized,",Vt,".stride,",Vt,".offset);").else(sr,".disableVertexAttribArray(i);",sr,".vertexAttrib4f(i,",Vt,".x,",Vt,".y,",Vt,".z,",Vt,".w);",Vt,".buffer=null;");var Jr=gt.link(ua.maxAttributes,{stable:!0});return Ft("for(var i=0;i<",Jr,";++i){",Vt,"=",or,"[i];",Dr,"}"),gn&&Ft("for(var i=0;i<",Jr,";++i){",Xt,".vertexAttribDivisorANGLE(i,",or,"[i].divisor);","}"),Ft(gt.shared.vao,".currentVAO=null;",gt.shared.vao,".setVAO(",gt.shared.vao,".targetVAO);"),Object.keys(qa).forEach(function(ba){var _n=qa[ba],Xa=nr.def(pr,".",ba),ln=gt.block();ln("if(",Xa,"){",sr,".enable(",_n,")}else{",sr,".disable(",_n,")}",lr,".",ba,"=",Xa,";"),Ft(ln),Et("if(",Xa,"!==",lr,".",ba,"){",ln,"}")}),Object.keys(Qn).forEach(function(ba){var _n=Qn[ba],Xa=Rn[ba],ln,$n,Nn=gt.block();if(Nn(sr,".",_n,"("),Ya(Xa)){var dn=Xa.length;ln=gt.global.def(pr,".",ba),$n=gt.global.def(lr,".",ba),Nn(p(dn,function(Tn){return ln+"["+Tn+"]"}),");",p(dn,function(Tn){return $n+"["+Tn+"]="+ln+"["+Tn+"];"}).join("")),Et("if(",p(dn,function(Tn){return ln+"["+Tn+"]!=="+$n+"["+Tn+"]"}).join("||"),"){",Nn,"}")}else ln=nr.def(pr,".",ba),$n=nr.def(lr,".",ba),Nn(ln,");",lr,".",ba,"=",ln,";"),Et("if(",ln,"!==",$n,"){",Nn,"}");Ft(Nn)}),gt.compile()}(),compile:hr}}function eo(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var $o=34918,no=34919,Zo=35007,ul=function(nt,Yt){if(!Yt.ext_disjoint_timer_query)return null;var cr=[];function ua(){return cr.pop()||Yt.ext_disjoint_timer_query.createQueryEXT()}function Aa(an){cr.push(an)}var xa=[];function wa(an){var gn=ua();Yt.ext_disjoint_timer_query.beginQueryEXT(Zo,gn),xa.push(gn),Ln(xa.length-1,xa.length,an)}function Ja(){Yt.ext_disjoint_timer_query.endQueryEXT(Zo)}function Sn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var wn=[];function hn(){return wn.pop()||new Sn}function yi(an){wn.push(an)}var Bn=[];function Ln(an,gn,Wa){var Vn=hn();Vn.startQueryIndex=an,Vn.endQueryIndex=gn,Vn.sum=0,Vn.stats=Wa,Bn.push(Vn)}var Va=[],ea=[];function Ea(){var an,gn,Wa=xa.length;if(Wa!==0){ea.length=Math.max(ea.length,Wa+1),Va.length=Math.max(Va.length,Wa+1),Va[0]=0,ea[0]=0;var Vn=0;for(an=0,gn=0;gn<xa.length;++gn){var Rn=xa[gn];Yt.ext_disjoint_timer_query.getQueryObjectEXT(Rn,no)?(Vn+=Yt.ext_disjoint_timer_query.getQueryObjectEXT(Rn,$o),Aa(Rn)):xa[an++]=Rn,Va[gn+1]=Vn,ea[gn+1]=an}for(xa.length=an,an=0,gn=0;gn<Bn.length;++gn){var hi=Bn[gn],Za=hi.startQueryIndex,qa=hi.endQueryIndex;hi.sum+=Va[qa]-Va[Za];var Qn=ea[Za],Fn=ea[qa];Fn===Qn?(hi.stats.gpuTime+=hi.sum/1e6,yi(hi)):(hi.startQueryIndex=Qn,hi.endQueryIndex=Fn,Bn[an++]=hi)}Bn.length=an}}return{beginQuery:wa,endQuery:Ja,pushScopeStats:Ln,update:Ea,getNumPendingQueries:function(){return xa.length},clear:function(){cr.push.apply(cr,xa);for(var an=0;an<cr.length;an++)Yt.ext_disjoint_timer_query.deleteQueryEXT(cr[an]);xa.length=0,cr.length=0},restore:function(){xa.length=0,cr.length=0}}},el=16384,_l=256,gi=1024,vo=34962,cs="webglcontextlost",ps="webglcontextrestored",Tl=1,Gl=2,Tu=3;function Il(nt,Yt){for(var cr=0;cr<nt.length;++cr)if(nt[cr]===Yt)return cr;return-1}function yc(nt){var Yt=g(nt);if(!Yt)return null;var cr=Yt.gl,ua=cr.getContextAttributes(),Aa=cr.isContextLost(),xa=b(cr,Yt);if(!xa)return null;var wa=d(),Ja=eo(),Sn=Yt.cachedCode||{},wn=xa.extensions,hn=ul(cr,wn),yi=m(),Bn=cr.drawingBufferWidth,Ln=cr.drawingBufferHeight,Va={tick:0,time:0,viewportWidth:Bn,viewportHeight:Ln,framebufferWidth:Bn,framebufferHeight:Ln,drawingBufferWidth:Bn,drawingBufferHeight:Ln,pixelRatio:Yt.pixelRatio},ea={},Ea={elements:null,primitive:4,count:-1,offset:0,instances:-1},an=jr(cr,wn),gn=ma(cr,Ja,Yt,Rn),Wa=dr(cr,wn,gn,Ja),Vn=Pu(cr,wn,an,Ja,gn,Wa,Ea);function Rn(te){return Vn.destroyBuffer(te)}var hi=Hu(cr,wa,Ja,Yt),Za=Hc(cr,wn,an,function(){Fn.procs.poll()},Va,Ja,Yt),qa=Ac(cr,wn,an,Ja,Yt),Qn=Xc(cr,wn,an,Za,qa,Ja),Fn=Zi(cr,wa,wn,an,gn,Wa,Za,Qn,ea,Vn,hi,Ea,Va,hn,Sn,Yt),Mn=ru(cr,Qn,Fn.procs.poll,Va,ua,wn,an),An=Fn.next,Jn=cr.canvas,mi=[],Ii=[],zn=[],ii=[Yt.onDestroy],Ei=null;function Ri(){if(mi.length===0){hn&&hn.update(),Ei=null;return}Ei=h.next(Ri),bl();for(var te=mi.length-1;te>=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;Dr<Vt.length;++Dr)if(c.isDynamic(Vt[Dr])){Xt[or]=c.unbox(Vt,or);return}}lr[or]=Vt}),{dynamic:Xt,static:lr}}var Le=Ge(te.context||{},!0),$e=Ge(te.uniforms||{},!0),mt=Ge(te.attributes||{},!1),jt=Ge(me(te),!1),_r={gpuTime:0,cpuTime:0,count:0},Fr=Fn.compile(jt,mt,$e,Le,_r),hr=Fr.draw,gt=Fr.batch,Et=Fr.scope,Ft=[];function nr(sr){for(;Ft.length<sr;)Ft.push(null);return Ft}function fr(sr,pr){var lr;if(typeof sr=="function")return Et.call(this,null,sr,0);if(typeof pr=="function")if(typeof sr=="number")for(lr=0;lr<sr;++lr)Et.call(this,null,pr,lr);else if(Array.isArray(sr))for(lr=0;lr<sr.length;++lr)Et.call(this,sr[lr],pr,lr);else return Et.call(this,sr,pr,0);else if(typeof sr=="number"){if(sr>0)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<Ge.length;++Le)if(Ge[Le]===me){Ge[Le]=Ge[Ge.length-1],Ge.pop();return}}}}function ve(){return Sn}function Y(te){Object.entries(te).forEach(function(me){Sn[me[0]]=me[1]})}var ye=v(fs,{clear:Ql,prop:c.define.bind(null,Tl),context:c.define.bind(null,Gl),this:c.define.bind(null,Tu),draw:fs({}),buffer:function(te){return gn.create(te,vo,!1,!1)},elements:function(te){return Wa.create(te,!1)},texture:Za.create2D,cube:Za.createCube,renderbuffer:qa.create,framebuffer:Qn.create,framebufferCube:Qn.createCube,vao:Vn.createVAO,attributes:ua,frame:Fs,on:Lo,limits:an,hasExtension:function(te){return an.extensions.indexOf(te.toLowerCase())>=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<p;E++)_.glText[E]=new M(u);if(_.glText){if(p>_.glText.length){var y=p-_.glText.length;for(E=0;E<y;E++)_.glText.push(new M(u))}else if(p<_.glText.length){var f=_.glText.length-p,P=_.glText.splice(p,f);P.forEach(function(j){j.destroy()})}for(E=0;E<p;E++)_.glText[E].update(_.textOptions[E])}if(_.line2d&&(_.line2d.update(_.lineOptions),_.lineOptions=_.lineOptions.map(function(j){if(j&&j.positions){for(var ee=j.positions,re=0;re<ee.length&&(isNaN(ee[re])||isNaN(ee[re+1]));)re+=2;for(var ce=ee.length-2;ce>re&&(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;ut<tt.length&&isNaN(tt[ut+1]);)ut+=2;for(Me=tt.length-2;Me>ut&&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;ut<tt.length&&isNaN(tt[ut]);)ut+=2;for(Me=tt.length-2;Me>ut&&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<tt.length;We+=2)(isNaN(tt[We])||isNaN(tt[We+1]))&&(ot=ot.concat(tt.slice(Re,We)),ot.push(tt[Re],tt[Re+1]),ot.push(null,null),Re=We+2);ot=ot.concat(tt.slice(Re)),Re&&ot.push(tt[Re],tt[Re+1])}else{var _e=be._nexttrace;if(_e){var fe=_.lineOptions[ee+1];if(fe){var Fe=fe.positions;if(be.fill==="tonexty"){for(ot=tt.slice(),ee=Math.floor(Fe.length/2);ee--;){var rt=Fe[ee*2],st=Fe[ee*2+1];isNaN(rt)||isNaN(st)||ot.push(rt,st)}j.fill=_e.fillcolor}}}}if(be._prevtrace&&be._prevtrace.fill==="tonext"){var Qe=_.lineOptions[ee-1].positions,Lt=ot.length/2;Re=Lt;var kt=[Re];for(We=0;We<Qe.length;We+=2)(isNaN(Qe[We])||isNaN(Qe[We+1]))&&(kt.push(We/2+Lt+1),Re=We+2);ot=ot.concat(Qe),j.hole=kt}return j.fillmode=be.fill,j.opacity=be.opacity,j.positions=ot,j}}),_.fill2d.update(_.fillOptions))}var z=l.dragmode,F=t(z),B=l.clickmode.indexOf("select")>-1;for(E=0;E<p;E++){var O=T[E][0],I=O.trace,N=O.t,U=N.index,W=I._length,Q=N.x,ue=N.y;if(I.selectedpoints||F||B){if(F||(F=!0),I.selectedpoints){var se=_.selectBatch[U]=e.selIndices2selPoints(I),he={};for(g=0;g<se.length;g++)he[se[g]]=1;var H=[];for(g=0;g<W;g++)he[g]||H.push(g);_.unselectBatch[U]=H}var $=N.xpx=new Array(W),J=N.ypx=new Array(W);for(g=0;g<W;g++)$[g]=w.c2p(Q[g]),J[g]=S.c2p(ue[g])}else N.xpx=N.ypx=null}if(F){if(_.select2d||(_.select2d=v(l._glcanvas.data()[1].regl)),_.scatter2d){var X=new Array(p);for(E=0;E<p;E++)X[E]=_.selectBatch[E].length||_.unselectBatch[E].length?_.markerUnselectedOptions[E]:{};_.scatter2d.update(X)}_.select2d&&(_.select2d.update(_.markerOptions),_.select2d.update(_.markerSelectedOptions)),_.glText&&T.forEach(function(j){var ee=((j||[])[0]||{}).trace||{};i.hasText(ee)&&n(j)})}else _.scatter2d&&_.scatter2d.update(_.markerOptions);var oe={viewport:s(l,w,S,m._context.plotGlPixelRatio),range:[(w._rl||w.range)[0],(S._rl||S.range)[0],(w._rl||w.range)[1],(S._rl||S.range)[1]]},ne=e.repeat(oe,_.count);_.fill2d&&_.fill2d.update(ne),_.line2d&&_.line2d.update(ne),_.error2d&&_.error2d.update(ne.concat(ne)),_.scatter2d&&_.scatter2d.update(ne),_.select2d&&_.select2d.update(ne),_.glText&&_.glText.forEach(function(j){j.update(oe)})}}};c.reglPrecompiled=o}}),LV=Ze({"src/traces/scattergl/index.js"(Z,q){"use strict";var v=cj();v.plot=hC(),q.exports=v}}),PV=Ze({"lib/scattergl.js"(Z,q){"use strict";q.exports=LV()}}),pC=Ze({"src/traces/splom/attributes.js"(Z,q){"use strict";var v=tf(),x=Mu(),A=Qc().axisHoverFormat,M=Cs().hovertemplateAttrs,e=_x(),t=kh().idRegex,r=Dl().templatedArray,i=rs().extendFlat,a=v.marker,n=a.line,o=i(x("marker.line",{editTypeOverride:"calc"}),{width:i({},n.width,{editType:"calc"}),editType:"calc"}),s=i(x("marker"),{symbol:a.symbol,angle:a.angle,size:i({},a.size,{editType:"markerSize"}),sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,opacity:a.opacity,colorbar:a.colorbar,line:o,editType:"calc"});s.color.editType=s.cmin.editType=s.cmax.editType="style";function c(h){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:t[h],editType:"plot"}}}q.exports={dimensions:r("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:i({},e.text,{}),hovertext:i({},e.hovertext,{}),hovertemplate:M(),xhoverformat:A("x"),yhoverformat:A("y"),marker:s,xaxes:c("x"),yaxes:c("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:e.selected.marker,editType:"calc"},unselected:{marker:e.unselected.marker,editType:"calc"},opacity:e.opacity}}}),bT=Ze({"src/traces/parcoords/merge_length.js"(Z,q){"use strict";q.exports=function(v,x,A,M){M||(M=1/0);var e,t;for(e=0;e<x.length;e++)t=x[e],t.visible&&(M=Math.min(M,t[A].length));for(M===1/0&&(M=0),v._length=M,e=0;e<x.length;e++)t=x[e],t.visible&&(t._length=M);return M}}}),IV=Ze({"src/traces/splom/defaults.js"(Z,q){"use strict";var v=ca(),x=fp(),A=pC(),M=Fu(),e=md(),t=bT(),r=dT().isOpenSymbol;q.exports=function(o,s,c,h){function m(g,b){return v.coerce(o,s,A,g,b)}var d=x(o,s,{name:"dimensions",handleItemDefaults:i}),T=m("diagonal.visible"),l=m("showupperhalf"),_=m("showlowerhalf"),w=t(s,d,"values");if(!w||!T&&!l&&!_){s.visible=!1;return}m("text"),m("hovertext"),m("hovertemplate"),m("xhoverformat"),m("yhoverformat"),e(o,s,c,h,m,{noAngleRef:!0,noStandOff:!0});var S=r(s.marker.symbol),E=M.isBubble(s);m("marker.line.width",S||E?1:0),a(o,s,h,m),v.coerceSelectionMarkerOpacity(s,m)};function i(n,o){function s(h,m){return v.coerce(n,o,A.dimensions,h,m)}s("label");var c=s("values");c&&c.length?s("visible"):o.visible=!1,s("axis.type"),s("axis.matches")}function a(n,o,s,c){var h=o.dimensions,m=h.length,d=o.showupperhalf,T=o.showlowerhalf,l=o.diagonal.visible,_,w,S=new Array(m),E=new Array(m);for(_=0;_<m;_++){var g=_?_+1:"";S[_]="x"+g,E[_]="y"+g}var b=c("xaxes",S),p=c("yaxes",E),u=o._diag=new Array(m);o._xaxes={},o._yaxes={};var y=[],f=[];function P(W,Q,ue,se){if(W){var he=W.charAt(0),H=s._splomAxes[he];if(o["_"+he+"axes"][W]=1,se.push(W),!(W in H)){var $=H[W]={};ue&&($.label=ue.label||"",ue.visible&&ue.axis&&(ue.axis.type&&($.type=ue.axis.type),ue.axis.matches&&($.matches=Q)))}}}var L=!l&&!T,z=!l&&!d;for(o._axesDim={},_=0;_<m;_++){var F=h[_],B=_===0,O=_===m-1,I=B&&L||O&&z?void 0:b[_],N=B&&z||O&&L?void 0:p[_];P(I,N,F,y),P(N,I,F,f),u[_]=[I,N],o._axesDim[I]=_,o._axesDim[N]=_}for(_=0;_<y.length;_++)for(w=0;w<f.length;w++){var U=y[_]+f[w];(_>w&&d||_<w&&T||_===w&&(l||!T||!d))&&(s._splomSubplots[U]=1)}(!T||!l&&d&&T)&&(s._splomGridDflt.xside="bottom",s._splomGridDflt.yside="left")}}}),RV=Ze({"src/traces/splom/scene_update.js"(Z,q){"use strict";var v=ca();q.exports=function(A,M){var e=A._fullLayout,t=M.uid,r=e._splomScenes;r||(r=e._splomScenes={});var i={dirty:!0,selectBatch:[],unselectBatch:[]},a={matrix:!1,selectBatch:[],unselectBatch:[]},n=r[M.uid];return n||(n=r[t]=v.extendFlat({},i,a),n.draw=function(){n.matrix&&n.matrix.draw&&(n.selectBatch.length||n.unselectBatch.length?n.matrix.draw(n.unselectBatch,n.selectBatch):n.matrix.draw()),n.dirty=!1},n.destroy=function(){n.matrix&&n.matrix.destroy&&n.matrix.destroy(),n.matrixOptions=null,n.selectBatch=null,n.unselectBatch=null,n=null}),n.dirty||v.extendFlat(n,i),n}}}),DV=Ze({"src/traces/splom/calc.js"(Z,q){"use strict";var v=ca(),x=$c(),A=Bd().calcMarkerSize,M=Bd().calcAxisExpansion,e=Fd(),t=g0().markerSelection,r=g0().markerStyle,i=RV(),a=Vs().BADNUM,n=mg().TOO_MANY_POINTS;q.exports=function(s,c){var h=c.dimensions,m=c._length,d={},T=d.cdata=[],l=d.data=[],_=c._visibleDims=[],w,S,E,g,b;function p(L,z){for(var F=L.makeCalcdata({v:z.values,vcalendar:c.calendar},"v"),B=0;B<F.length;B++)F[B]=F[B]===a?NaN:F[B];T.push(F),l.push(L.type==="log"?v.simpleMap(F,L.c2l):F)}for(w=0;w<h.length;w++)if(E=h[w],E.visible){if(g=x.getFromId(s,c._diag[w][0]),b=x.getFromId(s,c._diag[w][1]),g&&b&&g.type!==b.type){v.log("Skipping splom dimension "+w+" with conflicting axis types");continue}g?(p(g,E),b&&b.type==="category"&&(b._categories=g._categories.slice())):p(b,E),_.push(w)}e(s,c),v.extendFlat(d,r(s,c));var u=T.length,y=u*m>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<A.length;r++)e=x[A[r]+"Request"+M],t=x[A[r]+"Cancel"+M]||x[A[r]+"CancelRequest"+M];var r;(!e||!t)&&(i=0,a=0,n=[],o=1e3/60,e=function(s){if(n.length===0){var c=v(),h=Math.max(0,o-(c-i));i=h+c,setTimeout(function(){var m=n.slice(0);n.length=0;for(var d=0;d<m.length;d++)if(!m[d].cancelled)try{m[d].callback(i)}catch(T){setTimeout(function(){throw T},0)}},Math.round(h))}return n.push({handle:++a,callback:s,cancelled:!1}),a},t=function(s){for(var c=0;c<n.length;c++)n[c].handle===s&&(n[c].cancelled=!0)});var i,a,n,o;q.exports=function(s){return e.call(x,s)},q.exports.cancel=function(){t.apply(x,arguments)},q.exports.polyfill=function(s){s||(s=x),s.requestAnimationFrame=e,s.cancelAnimationFrame=t}}}),OV=Ze({"node_modules/array-range/index.js"(Z,q){q.exports=function(x,A){var M=typeof x=="number",e=typeof A=="number";M&&!e?(A=x,x=0):!M&&!e&&(x=0,A=0),x=x|0,A=A|0;var t=A-x;if(t<0)throw new Error("array length must be positive");for(var r=new Array(t),i=0,a=x;i<t;i++,a++)r[i]=a;return r}}}),BV=Ze({"node_modules/regl-splom/index.js"(Z,q){"use strict";var v=G5(),x=Ev(),A=v0(),M=FV(),e=OV(),t=k1(),r=m0();q.exports=i;function i(s,c){if(!(this instanceof i))return new i(s,c);this.traces=[],this.passes={},this.regl=s,this.scatter=v(s),this.canvas=this.scatter.canvas}i.prototype.render=function(...s){return s.length&&this.update(...s),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=M(()=>{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;m<s.length;m++)this.updateItem(m,s[m]);this.traces=this.traces.filter(Boolean);let c=[],h=0;for(let m=0;m<this.traces.length;m++){let d=this.traces[m],T=this.traces[m].passes;for(let l=0;l<T.length;l++)c.push(this.passes[T[l]]);d.passOffset=h,h+=d.passes.length}return this.scatter.update(...c),this},i.prototype.updateItem=function(s,c){let{regl:h}=this;if(c===null)return this.traces[s]=null,this;if(!c)return this;let m=x(c,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),d=this.traces[s]||(this.traces[s]={id:s,buffer:h.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:t([h._gl.drawingBufferWidth,h._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(m.color!=null&&(d.color=m.color),m.size!=null&&(d.size=m.size),m.marker!=null&&(d.marker=m.marker),m.borderColor!=null&&(d.borderColor=m.borderColor),m.borderSize!=null&&(d.borderSize=m.borderSize),m.opacity!=null&&(d.opacity=m.opacity),m.viewport&&(d.viewport=t(m.viewport)),m.diagonal!=null&&(d.diagonal=m.diagonal),m.upper!=null&&(d.upper=m.upper),m.lower!=null&&(d.lower=m.lower),m.data){d.buffer(r(m.data)),d.columns=m.data.length,d.count=m.data[0].length,d.bounds=[];for(let y=0;y<d.columns;y++)d.bounds[y]=A(m.data[y],1)}let T;m.range&&(d.range=m.range,T=d.range&&typeof d.range[0]!="number"),m.domain&&(d.domain=m.domain);let l=!1;m.padding!=null&&(Array.isArray(m.padding)&&m.padding.length===d.columns&&typeof m.padding[m.padding.length-1]=="number"?(d.padding=m.padding.map(o),l=!0):d.padding=o(m.padding));let _=d.columns,w=d.count,S=d.viewport.width,E=d.viewport.height,g=d.viewport.x,b=d.viewport.y,p=S/_,u=E/_;d.passes=[];for(let y=0;y<_;y++)for(let f=0;f<_;f++){if(!d.diagonal&&f===y||!d.upper&&y>f||!d.lower&&y<f)continue;let P=a(d.id,y,f),L=this.passes[P]||(this.passes[P]={});if(m.data&&(m.transpose?L.positions={x:{buffer:d.buffer,offset:f,count:w,stride:_},y:{buffer:d.buffer,offset:y,count:w,stride:_}}:L.positions={x:{buffer:d.buffer,offset:f*w,count:w},y:{buffer:d.buffer,offset:y*w,count:w}},L.bounds=n(d.bounds,y,f)),m.domain||m.viewport||m.data){let z=l?n(d.padding,y,f):d.padding;if(d.domain){let[F,B,O,I]=n(d.domain,y,f);L.viewport=[g+F*S+z[0],b+B*E+z[1],g+O*S-z[2],b+I*E-z[3]]}else L.viewport=[g+f*p+p*z[0],b+y*u+u*z[1],g+(f+1)*p-p*z[2],b+(y+1)*u-u*z[3]]}m.color&&(L.color=d.color),m.size&&(L.size=d.size),m.marker&&(L.marker=d.marker),m.borderSize&&(L.borderSize=d.borderSize),m.borderColor&&(L.borderColor=d.borderColor),m.opacity&&(L.opacity=d.opacity),m.range&&(L.range=T?n(d.range,y,f):d.range||L.bounds),d.passes.push(P)}return this},i.prototype.draw=function(...s){if(!s.length)this.scatter.draw();else{let c=[];for(let h=0;h<s.length;h++)if(typeof s[h]=="number"){let{passes:m,passOffset:d}=this.traces[s[h]];c.push(...e(d,d+m.length))}else if(s[h].length){let m=s[h],{passes:d,passOffset:T}=this.traces[h];d=d.map((l,_)=>{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<a.length;n++)e(r,a[n][0])};function e(t,r){var i=t._fullLayout,a=i._size,n=r.trace,o=r.t,s=i._splomScenes[n.uid],c=s.matrixOptions,h=c.cdata,m=i._glcanvas.data()[0].regl,d=i.dragmode,T,l,_,w,S;if(h.length!==0){c.lower=n.showupperhalf,c.upper=n.showlowerhalf,c.diagonal=n.diagonal.visible;var E=n._visibleDims,g=h.length,b=s.viewOpts={};for(b.ranges=new Array(g),b.domains=new Array(g),S=0;S<E.length;S++){_=E[S];var p=b.ranges[S]=new Array(4),u=b.domains[S]=new Array(4);T=A.getFromId(t,n._diag[_][0]),T&&(p[0]=T._rl[0],p[2]=T._rl[1],u[0]=T.domain[0],u[2]=T.domain[1]),l=A.getFromId(t,n._diag[_][1]),l&&(p[1]=l._rl[0],p[3]=l._rl[1],u[1]=l.domain[0],u[3]=l.domain[1])}var y=t._context.plotGlPixelRatio,f=a.l*y,P=a.b*y,L=a.w*y,z=a.h*y;b.viewport=[f,P,L+f,z+P],s.matrix===!0&&(s.matrix=v(m));var F=i.clickmode.indexOf("select")>-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;_<N.length;_++)U[N[_]]=!0;var W=[];for(_=0;_<I;_++)U[_]||W.push(_);s.unselectBatch=W}var Q=o.xpx=new Array(g),ue=o.ypx=new Array(g);for(S=0;S<E.length;S++){if(_=E[S],T=A.getFromId(t,n._diag[_][0]),T)for(Q[S]=new Array(I),w=0;w<I;w++)Q[S][w]=T.c2p(h[S][w]);if(l=A.getFromId(t,n._diag[_][1]),l)for(ue[S]=new Array(I),w=0;w<I;w++)ue[S][w]=l.c2p(h[S][w])}if(s.selectBatch.length||s.unselectBatch.length){var se=x.extendFlat({},c,s.unselectedOptions,b),he=x.extendFlat({},c,s.selectedOptions,b);s.matrix.update(se,he),O=!1}}else o.xpx=o.ypx=null;if(O){var H=x.extendFlat({},c,b);s.matrix.update(H,null)}}}}}),dC=Ze({"src/traces/splom/helpers.js"(Z){"use strict";Z.getDimIndex=function(v,x){for(var A=x._id,M=A.charAt(0),e={x:0,y:1}[M],t=v._visibleDims,r=0;r<t.length;r++){var i=t[r];if(v._diag[i][e]===A)return r}return!1}}}),UV=Ze({"src/traces/splom/hover.js"(Z,q){"use strict";var v=dC(),x=pT().calcHover,A=Wo().getFromId,M=rs().extendFlat;function e(r,i,a,n,o){o||(o={});var s=(n||"").charAt(0)==="x",c=(n||"").charAt(0)==="y",h=t(r,i,a);if((s||c)&&o.hoversubplots==="axis"&&h[0])for(var m=(s?r.xa:r.ya)._subplotsWith,d=o.gd,T=M({},r),l=0;l<m.length;l++){var _=m[l];if(_!==r.xa._id+r.ya._id){c?T.xa=A(d,_,"x"):T.ya=A(d,_,"y");var w=s||c,S=t(T,i,a,w);h=h.concat(S)}}return h}function t(r,i,a,n){var o=r.cd,s=o[0].trace,c=r.scene,h=c.matrixOptions.cdata,m=r.xa,d=r.ya,T=m.c2p(i),l=d.c2p(a),_=r.distance,w=v.getDimIndex(s,m),S=v.getDimIndex(s,d);if(w===!1||S===!1)return[r];for(var E=h[w],g=h[S],b,p,u=_,y=0;y<E.length;y++)if(!(n&&y!==r.index)){var f=E[y],P=g[y],L=m.c2p(f)-T,z=d.c2p(P)-l,F=Math.sqrt(L*L+z*z);(n||F<u)&&(u=p=F,b=y)}return r.index=b,r.distance=u,r.dxy=p,b===void 0?[r]:[x(r,E,g,s)]}q.exports={hoverPoints:e}}}),jV=Ze({"src/traces/splom/select.js"(Z,q){"use strict";var v=ca(),x=v.pushUnique,A=Fu(),M=dC();q.exports=function(t,r){var i=t.cd,a=i[0].trace,n=i[0].t,o=t.scene,s=o.matrixOptions.cdata,c=t.xaxis,h=t.yaxis,m=[];if(!o)return m;var d=!A.hasMarkers(a)&&!A.hasText(a);if(a.visible!==!0||d)return m;var T=M.getDimIndex(a,c),l=M.getDimIndex(a,h);if(T===!1||l===!1)return m;var _=n.xpx[T],w=n.ypx[l],S=s[T],E=s[l],g=(t.scene.selectBatch||[]).slice(),b=[];if(r!==!1&&!r.degenerate)for(var p=0;p<S.length;p++)r.contains([_[p],w[p]],null,p,t)?(m.push({pointNumber:p,x:S[p],y:E[p]}),x(g,p)):g.indexOf(p)!==-1?x(g,p):b.push(p);var u=o.matrixOptions;return!g.length&&!b.length?o.matrix.update(u,null):!o.selectBatch.length&&!o.unselectBatch.length&&o.matrix.update(o.unselectedOptions,v.extendFlat({},u,o.selectedOptions,o.viewOpts)),o.selectBatch=g,o.unselectBatch=b,m}}}),VV=Ze({"src/traces/splom/edit_style.js"(Z,q){"use strict";var v=ca(),x=Fd(),A=g0().markerStyle;q.exports=function(e,t){var r=t.trace,i=e._fullLayout._splomScenes[r.uid];if(i){x(e,r),v.extendFlat(i.matrixOptions,A(e,r));var a=v.extendFlat({},i.matrixOptions,i.viewOpts);i.matrix.update(a,null)}}}}),qV=Ze({"src/traces/splom/base_index.js"(Z,q){"use strict";var v=oo(),x=WS();q.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:pC(),supplyDefaults:IV(),colorbar:hp(),calc:DV(),plot:NV(),hoverPoints:UV().hoverPoints,selectPoints:jV(),editStyle:VV(),meta:{}},v.register(x)}}),GV=Ze({"src/traces/splom/base_plot.js"(Z,q){"use strict";var v=rC(),x=oo(),A=xT(),M=Hh().getModuleCalcData,e=Zf(),t=$c().getFromId,r=Wo().shouldShowZeroLine,i="splom",a={};function n(d){var T=d._fullLayout,l=x.getModule(i),_=M(d.calcdata,l)[0],w=A(d,["ANGLE_instanced_arrays","OES_element_index_uint"],a);w&&(T._hasOnlyLargeSploms&&c(d),l.plot(d,{},_))}function o(d){var T=d.calcdata,l=d._fullLayout;l._hasOnlyLargeSploms&&c(d);for(var _=0;_<T.length;_++){var w=T[_][0],S=w.trace,E=l._splomScenes[S.uid];S.type==="splom"&&E&&E.matrix&&s(d,S,E)}}function s(d,T,l){for(var _=l.matrixOptions.data.length,w=T._visibleDims,S=l.viewOpts.ranges=new Array(_),E=0;E<w.length;E++){var g=w[E],b=S[E]=new Array(4),p=t(d,T._diag[g][0]);p&&(b[0]=p.r2l(p.range[0]),b[2]=p.r2l(p.range[1]));var u=t(d,T._diag[g][1]);u&&(b[1]=u.r2l(u.range[0]),b[3]=u.r2l(u.range[1]))}l.selectBatch.length||l.unselectBatch.length?l.matrix.update({ranges:S},{ranges:S}):l.matrix.update({ranges:S})}function c(d){var T=d._fullLayout,l=T._glcanvas.data()[0].regl,_=T._splomGrid;_||(_=T._splomGrid=v(l)),_.update(h(d))}function h(d){var T=d._context.plotGlPixelRatio,l=d._fullLayout,_=l._size,w=[0,0,l.width*T,l.height*T],S={},E;function g(W,Q,ue,se,he,H){ue*=T,se*=T,he*=T,H*=T;var $=Q[W+"color"],J=Q[W+"width"],X=String($+J);X in S?S[X].data.push(NaN,NaN,ue,se,he,H):S[X]={data:[ue,se,he,H],join:"rect",thickness:J*T,color:$,viewport:w,range:w,overlay:!1}}for(E in l._splomSubplots){var b=l._plots[E],p=b.xaxis,u=b.yaxis,y=p._gridVals,f=u._gridVals,P=p._offset,L=p._length,z=u._length,F=_.b+u.domain[0]*_.h,B=-u._m,O=-B*u.r2l(u.range[0],u.calendar),I,N;if(p.showgrid)for(E=0;E<y.length;E++)I=P+p.l2p(y[E].x),g("grid",p,I,F,I,F+z);if(u.showgrid)for(E=0;E<f.length;E++)N=F+O+B*f[E].x,g("grid",u,P,N,P+L,N);r(d,p,u)&&(I=P+p.l2p(0),g("zeroline",p,I,F,I,F+z)),r(d,u,p)&&(N=F+O+0,g("zeroline",u,P,N,P+L,N))}var U=[];for(E in S)U.push(S[E]);return U}function m(d,T,l,_){var w={},S;if(_._splomScenes){for(S=0;S<d.length;S++){var E=d[S];E.type==="splom"&&(w[E.uid]=1)}for(S=0;S<l.length;S++){var g=l[S];if(!w[g.uid]){var b=_._splomScenes[g.uid];b&&b.destroy&&b.destroy(),_._splomScenes[g.uid]=null,delete _._splomScenes[g.uid]}}}Object.keys(_._splomScenes||{}).length===0&&delete _._splomScenes,_._splomGrid&&!T._hasOnlyLargeSploms&&_._hasOnlyLargeSploms&&(_._splomGrid.destroy(),_._splomGrid=null,delete _._splomGrid),e.clean(d,T,l,_)}q.exports={name:i,attr:e.attr,attrRegex:e.attrRegex,layoutAttributes:e.layoutAttributes,supplyLayoutDefaults:e.supplyLayoutDefaults,drawFramework:e.drawFramework,plot:n,drag:o,updateGrid:c,clean:m,updateFx:e.updateFx,toSVG:e.toSVG,reglPrecompiled:a}}}),HV=Ze({"src/traces/splom/index.js"(Z,q){"use strict";var v=qV();v.basePlotModule=GV(),q.exports=v}}),WV=Ze({"lib/splom.js"(Z,q){"use strict";q.exports=HV()}}),vC=Ze({"src/traces/parcoords/attributes.js"(Z,q){"use strict";var v=Mu(),x=Wh(),A=tc(),M=bc().attributes,e=rs().extendFlat,t=Dl().templatedArray;q.exports={domain:M({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:A({editType:"plot"}),tickfont:A({autoShadowDflt:!0,editType:"plot"}),rangefont:A({editType:"plot"}),dimensions:t("dimension",{label:{valType:"string",editType:"plot"},tickvals:e({},x.tickvals,{editType:"plot"}),ticktext:e({},x.ticktext,{editType:"plot"}),tickformat:e({},x.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:e({editType:"calc"},v("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}}),Tx=Ze({"src/traces/parcoords/constants.js"(Z,q){"use strict";q.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}}),Cv=Ze({"src/lib/gup.js"(Z,q){"use strict";var v=S_();function x(A){return[A]}q.exports={keyFun:function(A){return A.key},repeat:x,descend:v,wrap:x,unwrap:function(A){return A[0]}}}}),mC=Ze({"src/traces/parcoords/axisbrush.js"(Z,q){"use strict";var v=Tx(),x=Oi(),A=Cv().keyFun,M=Cv().repeat,e=ca().sorterAsc,t=ca().strTranslate,r=v.bar.snapRatio;function i(U,W){return U*(1-r)+W*r}var a=v.bar.snapClose;function n(U,W){return U*(1-a)+W*a}function o(U,W,Q,ue){if(s(Q,ue))return Q;var se=U?-1:1,he=0,H=W.length-1;if(se<0){var $=he;he=H,H=$}for(var J=W[he],X=J,oe=he;se*oe<se*H;oe+=se){var ne=oe+se,j=W[ne];if(se*Q<se*n(J,j))return i(J,X);if(se*Q<se*j||ne===H)return i(j,J);X=J,J=j}}function s(U,W){for(var Q=0;Q<W.length;Q++)if(U>=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;$<W.length;$++)ue=W[$],se=ue[1]-ue[0],Q.push(H),Q.push(se),he=$+1,he<W.length&&(H=W[he][0]-ue[1]);return Q.push(U.height),Q}function d(U,W){return U.map(function(Q){return Q.map(function(ue){return Math.max(0,ue*W)}).sort(e)})}function T(U,W){var Q=v.bar.handleHeight;if(!(W>U[1]+Q||W<U[0]-Q))return 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]<X[j][0]-W?ne:j),!isNaN(se)){var re=X[se],ce=T(re,W);ce&&(he.interval=J[se],he.intervalPix=re,he.region=ce)}}if(U.ordinal&&!he.region){var be=U.unitTickvals,Ae=U.unitToPaddedPx.invert(W);for(H=0;H<be.length;H++){var ze=[be[Math.max(H-1,0)]*.25+be[H]*.75,be[Math.min(H+1,be.length-1)]*.25+be[H]*.75];if(Ae>=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]<J[0]&&J.reverse(),se.newExtent=[o(0,J,se.newExtent[0],se.stayingIntervals),o(1,J,se.newExtent[1],se.stayingIntervals)];var X=se.newExtent[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<e;r++)t[r]=.5;return t}}});function YV(Z){var q,v,x,A=[],M=1,e;if(typeof Z=="number")return{space:"rgb",values:[Z>>>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<f&&(u.currentRafs[L]=window.requestAnimationFrame(function(){z(F+1)})),u.drawCompleted=!1)}u.drawCompleted||(n(b),u.drawCompleted=!0),z(0)}function c(b){return Math.max(e,Math.min(1-e,b))}function h(b,p){for(var u=new Array(256),y=0;y<256;y++)u[y]=b(y/255).concat(p);return u}function m(b,p){return(b>>>8*p)%256/255}function d(b,p,u){for(var y=new Array(b*(A+4)),f=0,P=0;P<b;P++){for(var L=0;L<A;L++)y[f++]=L<p.length?p[L].paddedUnitValues[P]:.5;y[f++]=m(P,2),y[f++]=m(P,1),y[f++]=m(P,0),y[f++]=c(u[P])}return y}function T(b,p,u){for(var y=new Array(p*8),f=0,P=0;P<p;P++)for(var L=0;L<2;L++)for(var z=0;z<4;z++){var F=b*4+z,B=u[P*64+F];F===63&&L===0&&(B*=-1),y[f++]=B}return y}function l(b){var p="0"+b;return p.substr(p.length-2)}function _(b){return b<A?"p"+l(b+1)+"_"+l(b+4):"colors"}function w(b,p,u){for(var y=0;y<=A;y+=4)b[_(y)](T(y/4,p,u))}function S(b){for(var p={},u=0;u<=A;u+=4)p[_(u)]=b.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return p}function E(b,p,u,y,f,P,L,z,F,B,O,I,N,U){for(var W=[[],[]],Q=0;Q<64;Q++)W[0][Q]=Q===f?1:0,W[1][Q]=Q===P?1:0;L*=U,z*=U,F*=U,B*=U;var ue=b.lines.canvasOverdrag*U,se=b.domain,he=b.canvasWidth*U,H=b.canvasHeight*U,$=b.pad.l*U,J=b.pad.b*U,X=b.layoutHeight*U,oe=b.layoutWidth*U,ne=b.deselectedLines.color,j=b.deselectedLines.opacity,ee=M.extendFlat({key:O,resolution:[he,H],viewBoxPos:[L+ue,z],viewBoxSize:[F,B],i0:f,i1:P,dim0A:W[0].slice(0,16),dim0B:W[0].slice(16,32),dim0C:W[0].slice(32,48),dim0D:W[0].slice(48,64),dim1A:W[1].slice(0,16),dim1B:W[1].slice(16,32),dim1C:W[1].slice(32,48),dim1D:W[1].slice(48,64),drwLayer:I,contextColor:[ne[0]/255,ne[1]/255,ne[2]/255,j!=="auto"?ne[3]*j:Math.max(1/255,Math.pow(1/b.lines.color.length,1/3))],scissorX:(y===p?0:L+ue)+($-ue)+oe*se.x[0],scissorWidth:(y===u?he-L+ue:F+.5)+(y===p?L+ue:0),scissorY:z+J+X*se.y[0],scissorHeight:B,viewportX:$-ue+oe*se.x[0],viewportY:J+X*se.y[0],viewportWidth:he,viewportHeight:H},N);return ee}function g(b){var p=t-1,u=Math.max(0,Math.floor(b[0]*p),0),y=Math.min(p,Math.ceil(b[1]*p),p);return[Math.min(u,y),Math.max(u,y)]}q.exports=function(b,p){var u=p.context,y=p.pick,f=p.regl,P=f._gl,L=P.getParameter(P.ALIASED_LINE_WIDTH_RANGE),z=Math.max(L[0],Math.min(L[1],p.viewModel.plotGlPixelRatio)),F={currentRafs:{},drawCompleted:!0,clearOnly:!1},B,O,I,N,U=S(f),W,Q=f.texture(a),ue=[];he(p);var se=f({profile:!1,blend:{enable:u,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!u,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:f.prop("scissorX"),y:f.prop("scissorY"),width:f.prop("scissorWidth"),height:f.prop("scissorHeight")}},viewport:{x:f.prop("viewportX"),y:f.prop("viewportY"),width:f.prop("viewportWidth"),height:f.prop("viewportHeight")},dither:!1,vert:v,frag:x,primitive:"lines",lineWidth:z,attributes:U,uniforms:{resolution:f.prop("resolution"),viewBoxPos:f.prop("viewBoxPos"),viewBoxSize:f.prop("viewBoxSize"),dim0A:f.prop("dim0A"),dim1A:f.prop("dim1A"),dim0B:f.prop("dim0B"),dim1B:f.prop("dim1B"),dim0C:f.prop("dim0C"),dim1C:f.prop("dim1C"),dim0D:f.prop("dim0D"),dim1D:f.prop("dim1D"),loA:f.prop("loA"),hiA:f.prop("hiA"),loB:f.prop("loB"),hiB:f.prop("hiB"),loC:f.prop("loC"),hiC:f.prop("hiC"),loD:f.prop("loD"),hiD:f.prop("hiD"),palette:Q,contextColor:f.prop("contextColor"),maskTexture:f.prop("maskTexture"),drwLayer:f.prop("drwLayer"),maskHeight:f.prop("maskHeight")},offset:f.prop("offset"),count:f.prop("count")});function he(ne){B=ne.model,O=ne.viewModel,I=O.dimensions.slice(),N=I[0]?I[0].values.length:0;var j=B.lines,ee=y?j.color.map(function(ce,be){return be/j.color.length}):j.color,re=d(N,I,ee);w(U,N,re),!u&&!y&&(Q=f.texture(M.extendFlat({data:h(B.unitToColor,255)},a)))}function H(ne){var j,ee,re,ce=[[],[]];for(re=0;re<64;re++){var be=!ne&&re<I.length?I[re].brush.filter.getBounds():[-1/0,1/0];ce[0][re]=be[0],ce[1][re]=be[1]}var Ae=t*8,ze=new Array(Ae);for(j=0;j<Ae;j++)ze[j]=255;if(!ne)for(j=0;j<I.length;j++){var Re=j%8,We=(j-Re)/8,it=Math.pow(2,Re),ot=I[j],tt=ot.brush.filter.get();if(!(tt.length<2)){var ut=g(tt[0])[1];for(ee=1;ee<tt.length;ee++){var Me=g(tt[ee]);for(re=ut+1;re<Me[0];re++)ze[re*8+We]&=~it;ut=Math.max(ut,Me[1])}}}var _e={shape:[8,t],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:ze};return W?W(_e):W=f.texture(_e),{maskTexture:W,maskHeight:t,loA:ce[0].slice(0,16),loB:ce[0].slice(16,32),loC:ce[0].slice(32,48),loD:ce[0].slice(48,64),hiA:ce[1].slice(0,16),hiB:ce[1].slice(16,32),hiC:ce[1].slice(32,48),hiD:ce[1].slice(48,64)}}function $(ne,j,ee){var re=ne.length,ce,be,Ae,ze=1/0,Re=-1/0;for(ce=0;ce<re;ce++)ne[ce].dim0.canvasX<ze&&(ze=ne[ce].dim0.canvasX,be=ce),ne[ce].dim1.canvasX>Re&&(Re=ne[ce].dim1.canvasX,Ae=ce);re===0&&o(f,0,0,B.canvasWidth,B.canvasHeight);var We=H(u);for(ce=0;ce<re;ce++){var it=ne[ce],ot=it.dim0.crossfilterDimensionIndex,tt=it.dim1.crossfilterDimensionIndex,ut=it.canvasX,Me=it.canvasY,_e=ut+it.panelSizeX,fe=it.plotGlPixelRatio;if(j||!ue[ot]||ue[ot][0]!==ut||ue[ot][1]!==_e){ue[ot]=[ut,_e];var Fe=E(B,be,Ae,ce,ot,tt,ut,Me,it.panelSizeX,it.panelSizeY,it.dim0.crossfilterDimensionIndex,u?0:y?2:1,We,fe);F.clearOnly=ee;var rt=j?B.lines.blockLineCount:N;s(f,se,F,rt,N,Fe)}}}function J(ne,j){return f.read({x:ne,y:j,width:1,height:1,data:i}),i}function X(ne,j,ee,re){var ce=new Uint8Array(4*ee*re);return f.read({x:ne,y:j,width:ee,height:re,data:ce}),ce}function oe(){b.style["pointer-events"]="none",Q.destroy(),W&&W.destroy();for(var ne in U)U[ne].destroy()}return{render:$,readPixel:J,readPixels:X,destroy:oe,update:he}}}}),tq=Ze({"src/traces/parcoords/parcoords.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=x.isArrayOrTypedArray,M=x.numberFormat,e=(QV(),ih(_C)).default,t=Wo(),r=x.strRotate,i=x.strTranslate,a=fu(),n=as(),o=rc(),s=Cv(),c=s.keyFun,h=s.repeat,m=s.unwrap,d=xC(),T=Tx(),l=mC(),_=eq();function w(ue,se,he){return x.aggNums(ue,null,se,he)}function S(ue,se){return g(w(Math.min,ue,se),w(Math.max,ue,se))}function E(ue){var se=ue.range;return se?g(se[0],se[1]):S(ue.values,ue._length)}function g(ue,se){return(isNaN(ue)||!isFinite(ue))&&(ue=0),(isNaN(se)||!isFinite(se))&&(se=0),ue===se&&(ue===0?(ue-=1,se+=1):(ue*=.9,se*=1.1)),[ue,se]}function b(ue,se){return se?function(he,H){var $=se[H];return $??ue(he)}:ue}function p(ue,se,he,H,$){var J=E(he);return H?v.scale.ordinal().domain(H.map(b(M(he.tickformat),$))).range(H.map(function(X){var oe=(X-J[0])/(J[1]-J[0]);return ue-se+oe*(2*se-ue)})):v.scale.linear().domain(J).range([ue-se,se])}function u(ue,se){return v.scale.linear().range([se,ue-se])}function y(ue,se){return v.scale.linear().domain(E(ue)).range([se,1-se])}function f(ue){if(ue.tickvals){var se=E(ue);return v.scale.ordinal().domain(ue.tickvals).range(ue.tickvals.map(function(he){return(he-se[0])/(se[1]-se[0])}))}}function P(ue){var se=ue.map(function(J){return J[0]}),he=ue.map(function(J){var X=e(J[1]);return v.rgb("rgb("+X[0]+","+X[1]+","+X[2]+")")}),H=function(J){return function(X){return X[J]}},$="rgb".split("").map(function(J){return v.scale.linear().clamp(!0).domain(se).range(he.map(H(J)))});return function(J){return $.map(function(X){return X(J)})}}function L(ue){return ue.dimensions.some(function(se){return se.brush.filterSpecified})}function z(ue,se,he){var H=m(se),$=H.trace,J=d.convertTypedArray(H.lineColor),X=$.line,oe={color:e($.unselected.line.color),opacity:$.unselected.line.opacity},ne=o.extractOpts(X),j=ne.reversescale?o.flipScale(H.cscale):H.cscale,ee=$.domain,re=$.dimensions,ce=ue.width,be=$.labelangle,Ae=$.labelside,ze=$.labelfont,Re=$.tickfont,We=$.rangefont,it=x.extendDeepNoArrays({},X,{color:J.map(v.scale.linear().domain(E({values:J,range:[ne.min,ne.max],_length:$._length}))),blockLineCount:T.blockLineCount,canvasOverdrag:T.overdrag*T.canvasPixelRatio}),ot=Math.floor(ce*(ee.x[1]-ee.x[0])),tt=Math.floor(ue.height*(ee.y[1]-ee.y[0])),ut=ue.margin||{l:80,r:80,t:100,b:80},Me=ot,_e=tt;return{key:he,colCount:re.filter(d.isVisible).length,dimensions:re,tickDistance:T.tickDistance,unitToColor:P(j),lines:it,deselectedLines:oe,labelAngle:be,labelSide:Ae,labelFont:ze,tickFont:Re,rangeFont:We,layoutWidth:ce,layoutHeight:ue.height,domain:ee,translateX:ee.x[0]*ce,translateY:ue.height-ee.y[1]*ue.height,pad:ut,canvasWidth:Me*T.canvasPixelRatio+2*it.canvasOverdrag,canvasHeight:_e*T.canvasPixelRatio,width:Me,height:_e,canvasPixelRatio:T.canvasPixelRatio}}function F(ue,se,he){var H=he.width,$=he.height,J=he.dimensions,X=he.canvasPixelRatio,oe=function(ce){return H*ce/Math.max(1,he.colCount-1)},ne=T.verticalPadding/$,j=u($,T.verticalPadding),ee={key:he.key,xScale:oe,model:he,inBrushDrag:!1},re={};return ee.dimensions=J.filter(d.isVisible).map(function(ce,be){var Ae=y(ce,ne),ze=re[ce.label];re[ce.label]=(ze||0)+1;var Re=ce.label+(ze?"__"+ze:""),We=ce.constraintrange,it=We&&We.length;it&&!A(We[0])&&(We=[We]);var ot=it?We.map(function(Lt){return Lt.map(Ae)}):[[-1/0,1/0]],tt=function(){var Lt=ee;Lt.focusLayer&&Lt.focusLayer.render(Lt.panels,!0);var kt=L(Lt);!ue.contextShown()&&kt?(Lt.contextLayer&&Lt.contextLayer.render(Lt.panels,!0),ue.contextShown(!0)):ue.contextShown()&&!kt&&(Lt.contextLayer&&Lt.contextLayer.render(Lt.panels,!0,!0),ue.contextShown(!1))},ut=ce.values;ut.length>ce._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<Me.length;rt++)if(Me[rt]<Me[rt-1]){for(var st=Me.map(fe).sort(Fe),Qe=0;Qe<Me.length;Qe++)Me[Qe]=st[Qe].val,_e[Qe]=st[Qe].text;break}}else Me=void 0;return ut=d.convertTypedArray(ut),{key:Re,label:ce.label,tickFormat:ce.tickformat,tickvals:Me,ticktext:_e,ordinal:d.isOrdinal(ce),multiselect:ce.multiselect,xIndex:be,crossfilterDimensionIndex:be,visibleIndex:ce._index,height:$,values:ut,paddedUnitValues:ut.map(Ae),unitTickvals:Me&&Me.map(Ae),xScale:oe,x:oe(be),canvasX:oe(be)*X,unitToPaddedPx:j,domainScale:p($,T.verticalPadding,ce,Me,_e),ordinalScale:f(ce),parent:ee,model:he,brush:l.makeBrush(ue,it,ot,function(){ue.linePickActive(!1)},tt,function(Lt){if(ee.focusLayer.render(ee.panels,!0),ee.pickLayer&&ee.pickLayer.render(ee.panels,!0),ue.linePickActive(!0),se&&se.filterChanged){var kt=Ae.invert,qt=Lt.map(function(Zt){return Zt.map(kt).sort(x.sorterAsc)}).sort(function(Zt,Sr){return Zt[0]-Sr[0]});se.filterChanged(ee.key,ce._index,qt)}})}}),ee}function B(ue){ue.classed(T.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(){var ue=!0,se=!1;return{linePickActive:function(he){return arguments.length?ue=!!he:ue},contextShown:function(he){return arguments.length?se=!!he:se}}}function I(ue,se){var he=se==="top"?1:-1,H=ue*Math.PI/180,$=Math.sin(H),J=Math.cos(H);return{dir:he,dx:$,dy:J,degrees:ue}}function N(ue,se,he){for(var H=se.panels||(se.panels=[]),$=ue.data(),J=0;J<$.length-1;J++){var X=H[J]||(H[J]={}),oe=$[J],ne=$[J+1];X.dim0=oe,X.dim1=ne,X.canvasX=oe.canvasX,X.panelSizeX=ne.canvasX-oe.canvasX,X.panelSizeY=se.model.canvasHeight,X.y=0,X.canvasY=0,X.plotGlPixelRatio=he}}function U(ue){for(var se=0;se<ue.length;se++)for(var he=0;he<ue[se].length;he++)for(var H=ue[se][he].trace,$=H.dimensions,J=0;J<$.length;J++){var X=$[J].values,oe=$[J]._ax;oe&&(oe.range?oe.range=g(oe.range[0],oe.range[1]):oe.range=S(X,H._length),oe.dtick||(oe.dtick=.01*(Math.abs(oe.range[1]-oe.range[0])||1)),oe.tickformat=$[J].tickformat,t.calcTicks(oe),oe.cleanRange())}}function W(ue,se){return t.tickText(ue._ax,se,!1).text}function Q(ue,se){if(ue.ordinal)return"";var he=ue.domainScale.domain(),H=he[se?he.length-1:0];return W(ue.model.dimensions[ue.visibleIndex],H)}q.exports=function(se,he,H,$){var J=se._context.staticPlot,X=se._fullLayout,oe=X._toppaper,ne=X._glcontainer,j=se._context.plotGlPixelRatio,ee=se._fullLayout.paper_bgcolor;U(he);var re=O(),ce=he.filter(function(Qe){return m(Qe).trace.visible}).map(z.bind(0,H)).map(F.bind(0,re,$));ne.each(function(Qe,Lt){return x.extendFlat(Qe,ce[Lt])});var be=ne.selectAll(".gl-canvas").each(function(Qe){Qe.viewModel=ce[0],Qe.viewModel.plotGlPixelRatio=j,Qe.viewModel.paperColor=ee,Qe.model=Qe.viewModel?Qe.viewModel.model:null}),Ae=null,ze=be.filter(function(Qe){return Qe.pick});ze.style("pointer-events",J?"none":"auto").on("mousemove",function(Qe){if(re.linePickActive()&&Qe.lineLayer&&$&&$.hover){var Lt=v.event,kt=this.width,qt=this.height,Zt=v.mouse(this),Sr=Zt[0],xr=Zt[1];if(Sr<0||xr<0||Sr>=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<P;F++){var O=[];for(B=0;B<z.length;B++)O.push(z[B][F]);b=g[F%g.length],p+=b;var I=f(F),N=O+"-"+I.rawColor;L[N]===void 0&&(L[N]=s(O,I.color,I.rawColor)),c(L[N],F,b)}var U=S.map(function(H,$){return a($,H._index,H._displayindex,H.label,p)});for(F=0;F<P;F++)for(b=g[F%g.length],B=0;B<U.length;B++){var W=U[B].containerInd,Q=E[B].inds[F],ue=U[B].categories;if(ue[Q]===void 0){var se=w.dimensions[W]._categoryarray[Q],he=w.dimensions[W]._ticktext[Q];ue[Q]=n(B,Q,se,he)}o(ue[Q],F,b)}return v(i(U,L,p))};function i(l,_,w){var S=l.map(function(E){return E.categories.length}).reduce(function(E,g){return Math.max(E,g)});return{dimensions:l,paths:_,trace:void 0,maxCats:S,count:w}}function a(l,_,w,S,E){return{dimensionInd:l,containerInd:_,displayInd:w,dimensionLabel:S,count:E,categories:[],dragX:null}}function n(l,_,w,S){return{dimensionInd:l,categoryInd:_,categoryValue:w,displayInd:_,categoryLabel:S,valueInds:[],count:0,dragY:null}}function o(l,_,w){l.valueInds.push(_),l.count+=w}function s(l,_,w){return{categoryInds:l,color:_,rawColor:w,valueInds:[],count:0}}function c(l,_,w){l.valueInds.push(_),l.count+=w}function h(l,_){_==null?_=[]:_=_.map(function(y){return y});var w={},S={},E=[];_.forEach(function(y,f){w[y]=0,S[y]=f});for(var g=0;g<l.length;g++){var b=l[g],p;w[b]===void 0?(w[b]=1,p=_.push(b)-1,S[b]=p):(w[b]++,p=S[b]),E.push(p)}var u=_.map(function(y){return w[y]});return{uniqueValues:_,uniqueCounts:u,inds:E}}function m(l){var _=l.map(function(S){return S.displayindex}),w;if(T(_))for(w=0;w<l.length;w++)l[w]._displayindex=l[w].displayindex;else for(w=0;w<l.length;w++)l[w]._displayindex=w}function d(l,_){l._categoryarray=_.uniqueValues,l.ticktext===null||l.ticktext===void 0?l._ticktext=[]:l._ticktext=l.ticktext.slice();for(var w=l._ticktext.length;w<_.uniqueValues.length;w++)l._ticktext.push(_.uniqueValues[w])}function T(l){for(var _=new Array(l.length),w=0;w<l.length;w++){if(l[w]<0||l[w]>=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<oe.model.rawColor?-1:0}function h(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){e.raiseToTop(this),w(v.select(this));var oe=d(X),ne=T(X);if(X.parcatsViewModel.graphDiv.emit("plotly_hover",{points:oe,event:v.event,constraints:ne}),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var j=v.mouse(this)[0],ee=X.parcatsViewModel.graphDiv,re=X.parcatsViewModel.trace,ce=ee._fullLayout,be=ce._paperdiv.node().getBoundingClientRect(),Ae=X.parcatsViewModel.graphDiv.getBoundingClientRect(),ze,Re,We;for(We=0;We<X.leftXs.length-1;We++)if(X.leftXs[We]+X.dimWidths[We]-2<=j&&j<=X.leftXs[We+1]+2){var it=X.parcatsViewModel.dimensions[We],ot=X.parcatsViewModel.dimensions[We+1];ze=(it.x+it.width+ot.x)/2,Re=(X.topYs[We]+X.topYs[We+1]+X.height)/2;break}var tt=X.parcatsViewModel.x+ze,ut=X.parcatsViewModel.y+Re,Me=i.mostReadable(X.model.color,["black","white"]),_e=X.model.count,fe=_e/X.parcatsViewModel.model.count,Fe={countLabel:_e,probabilityLabel:fe.toFixed(3)},rt=[];X.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&rt.push(["Count:",Fe.countLabel].join(" ")),X.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&rt.push(["P:",Fe.probabilityLabel].join(" "));var st=rt.join("<br>"),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:Qe<tt?"right":"left",hovertemplate:(re.line||{}).hovertemplate,hovertemplateLabels:Fe,eventData:[{data:re._input,fullData:re,count:_e,probability:fe}]},{container:ce._hoverlayer.node(),outerContainer:ce._paper.node(),gd:ee})}}}function m(X){if(!X.parcatsViewModel.dragDimension&&(_(v.select(this)),M.loneUnhover(X.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),X.parcatsViewModel.pathSelection.sort(c),X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1)){var oe=d(X),ne=T(X);X.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:oe,event:v.event,constraints:ne})}}function d(X){for(var oe=[],ne=W(X.parcatsViewModel),j=0;j<X.model.valueInds.length;j++){var ee=X.model.valueInds[j];oe.push({curveNumber:ne,pointNumber:ee})}return oe}function T(X){for(var oe={},ne=X.parcatsViewModel.model.dimensions,j=0;j<ne.length;j++){var ee=ne[j],re=ee.categories[X.model.categoryInds[j]];oe[ee.containerInd]=re.categoryValue}return X.model.rawColor!==void 0&&(oe.color=X.model.rawColor),oe}function l(X){if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var oe=d(X),ne=T(X);X.parcatsViewModel.graphDiv.emit("plotly_click",{points:oe,event:v.event,constraints:ne})}}function _(X){X.attr("fill",function(oe){return oe.model.color}).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function w(X){X.attr("fill-opacity",.8).attr("stroke",function(oe){return i.mostReadable(oe.model.color,["black","white"])}).attr("stroke-width",.3)}function S(X){X.select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}function E(X){X.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function g(X){X.attr("stroke","black").attr("stroke-width",1.5)}function b(X){X.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function p(X){var oe=X.parcatsViewModel.pathSelection,ne=X.categoryViewModel.model.dimensionInd,j=X.categoryViewModel.model.categoryInd;return oe.filter(function(ee){return ee.model.categoryInds[ne]===j&&ee.model.color===X.color})}function u(X){var oe=v.select(X.parentNode).selectAll("rect.bandrect");oe.each(function(ne){var j=p(ne);w(j),j.each(function(){e.raiseToTop(this)})}),S(v.select(X.parentNode))}function y(X){var oe=v.select(X).datum(),ne=p(oe);w(ne),ne.each(function(){e.raiseToTop(this)}),v.select(X.parentNode).selectAll("rect.bandrect").filter(function(j){return j.color===oe.color}).each(function(){e.raiseToTop(this),g(v.select(this))})}function f(X,oe,ne){var j=v.select(X).datum(),ee=j.categoryViewModel.model,re=j.parcatsViewModel.graphDiv,ce=v.select(X.parentNode).selectAll("rect.bandrect"),be=[];ce.each(function(ze){var Re=p(ze);Re.each(function(We){Array.prototype.push.apply(be,d(We))})});var Ae={};Ae[ee.dimensionInd]=ee.categoryValue,re.emit(oe,{points:be,event:ne,constraints:Ae})}function P(X,oe,ne){var j=v.select(X).datum(),ee=j.categoryViewModel.model,re=j.parcatsViewModel.graphDiv,ce=p(j),be=[];ce.each(function(ze){Array.prototype.push.apply(be,d(ze))});var Ae={};Ae[ee.dimensionInd]=ee.categoryValue,j.rawColor!==void 0&&(Ae.color=j.rawColor),re.emit(oe,{points:be,event:ne,constraints:Ae})}function L(X,oe,ne){X._fullLayout._calcInverseTransform(X);var j=X._fullLayout._invScaleX,ee=X._fullLayout._invScaleY,re=v.select(ne.parentNode).select("rect.catrect"),ce=re.node().getBoundingClientRect(),be=re.datum(),Ae=be.parcatsViewModel,ze=Ae.model.dimensions[be.model.dimensionInd],Re=Ae.trace,We=ce.top+ce.height/2,it,ot;Ae.dimensions.length>1&&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("<br>");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("<br>"),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.y<j&&j<=ee.y+ee.height&&(X.potentialClickBand=this)}))}),X.parcatsViewModel.dragDimension=X,M.loneUnhover(X.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function N(X){if(X.parcatsViewModel.arrangement!=="fixed"&&(X.dragHasMoved=!0,X.dragDimensionDisplayInd!==null)){var oe=X.dragDimensionDisplayInd,ne=oe-1,j=oe+1,ee=X.parcatsViewModel.dimensions[oe];if(X.dragCategoryDisplayInd!==null){var re=ee.categories[X.dragCategoryDisplayInd];re.model.dragY+=v.event.dy;var ce=re.model.dragY,be=re.model.displayInd,Ae=ee.categories,ze=Ae[be-1],Re=Ae[be+1];ze!==void 0&&ce<ze.y+ze.height/2&&(re.model.displayInd=ze.model.displayInd,ze.model.displayInd=be),Re!==void 0&&ce+re.height>Re.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.dragX<We.x+We.width&&(ee.model.displayInd=We.model.displayInd,We.model.displayInd=oe),it!==void 0&&ee.model.dragX+ee.width>it.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<ne.length;j++)if(X.key===ne[j].uid){oe=j;break}return oe}function Q(X,oe){oe===void 0&&(oe=!1);function ne(j){return oe?j.transition():j}X.pathSelection.data(function(j){return j.paths},o),ne(X.pathSelection).attr("d",function(j){return j.svgD})}function ue(X,oe){oe===void 0&&(oe=!1);function ne(Ae){return oe?Ae.transition():Ae}X.dimensionSelection.data(function(Ae){return Ae.dimensions},o);var j=X.dimensionSelection.selectAll("g.category").data(function(Ae){return Ae.categories},o);ne(X.dimensionSelection).attr("transform",function(Ae){return t(Ae.x,0)}),ne(j).attr("transform",function(Ae){return t(0,Ae.y)});var ee=j.select(".dimlabel");ee.text(function(Ae,ze){return ze===0?Ae.parcatsViewModel.model.dimensions[Ae.model.dimensionInd].dimensionLabel:null});var re=j.select(".catlabel");re.attr("text-anchor",function(Ae){return s(Ae)?"start":"end"}).attr("x",function(Ae){return s(Ae)?Ae.width+5:-5}).each(function(Ae){var ze,Re;s(Ae)?(ze=Ae.width+5,Re="start"):(ze=-5,Re="end"),v.select(this).selectAll("tspan").attr("x",ze).attr("text-anchor",Re)});var ce=j.selectAll("rect.bandrect").data(function(Ae){return Ae.bands},o),be=ce.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",function(Ae){return Ae.color}).attr("fill-opacity",0);ce.attr("fill",function(Ae){return Ae.color}).attr("width",function(Ae){return Ae.width}).attr("height",function(Ae){return Ae.height}).attr("y",function(Ae){return Ae.y}),b(be),ce.each(function(){e.raiseToTop(this)}),ce.exit().remove()}function se(X,oe,ne){var j=ne[0],ee=oe.margin||{l:80,r:80,t:100,b:80},re=j.trace,ce=re.domain,be=oe.width,Ae=oe.height,ze=Math.floor(be*(ce.x[1]-ce.x[0])),Re=Math.floor(Ae*(ce.y[1]-ce.y[0])),We=ce.x[0]*be+ee.l,it=oe.height-ce.y[1]*oe.height+ee.t,ot=re.line.shape,tt;re.hoverinfo==="all"?tt=["count","probability"]:tt=(re.hoverinfo||"").split("+");var ut={trace:re,key:re.uid,model:j,x:We,y:it,width:ze,height:Re,hoveron:re.hoveron,hoverinfoItems:tt,arrangement:re.arrangement,bundlecolors:re.bundlecolors,sortpaths:re.sortpaths,labelfont:re.labelfont,categorylabelfont:re.tickfont,pathShape:ot,dragDimension:null,margin:ee,paths:[],dimensions:[],graphDiv:X,traceSelection:null,pathSelection:null,dimensionSelection:null};return j.dimensions&&($(ut),H(ut)),ut}function he(X,oe,ne,j,ee){var re=[],ce=[],be,Ae;for(Ae=0;Ae<ne.length-1;Ae++)be=x(ne[Ae]+X[Ae],X[Ae+1]),re.push(be(ee)),ce.push(be(1-ee));var ze="M "+X[0]+","+oe[0];for(ze+="l"+ne[0]+",0 ",Ae=1;Ae<ne.length;Ae++)ze+="C"+re[Ae-1]+","+oe[Ae-1]+" "+ce[Ae-1]+","+oe[Ae]+" "+X[Ae]+","+oe[Ae],ze+="l"+ne[Ae]+",0 ";for(ze+="l0,"+j+" ",ze+="l -"+ne[ne.length-1]+",0 ",Ae=ne.length-2;Ae>=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)),Ir<bt?-1:Ir>bt?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;ut<ze.length;ut++){var Me=ze[ut],_e;ot>0?_e=tt*(Me.count/ot):_e=0;for(var fe=new Array(j.length),Fe=0;Fe<Me.categoryInds.length;Fe++){var rt=Me.categoryInds[Fe],st=ee[Fe][rt],Qe=re[Fe];fe[Qe]=j[Qe][st],j[Qe][st]+=_e;var Lt=X.dimensions[Qe].categories[st],kt=Lt.bands.length,qt=Lt.bands[kt-1];if(qt===void 0||Me.rawColor!==qt.rawColor){var Zt=qt===void 0?0:qt.y+qt.height;Lt.bands.push({key:Zt,color:Me.color,rawColor:Me.rawColor,height:_e,width:Lt.width,count:Me.count,y:Zt,categoryViewModel:Lt,parcatsViewModel:X})}else{var Sr=Lt.bands[kt-1];Sr.height+=_e,Sr.count+=Me.count}}var xr;X.pathShape==="hspline"?xr=he(be,fe,Ae,_e,.5):xr=he(be,fe,Ae,_e,0),it[ut]={key:Me.valueInds[0],model:Me,height:_e,leftXs:be,topYs:fe,dimWidths:Ae,svgD:xr,parcatsViewModel:X}}X.paths=it}function $(X){var oe=X.model.dimensions.map(function(ce){return{displayInd:ce.displayInd,dimensionInd:ce.dimensionInd}});oe.sort(function(ce,be){return ce.displayInd-be.displayInd});var ne=[];for(var j in oe){var ee=oe[j].dimensionInd,re=X.model.dimensions[ee];ne.push(J(X,re))}X.dimensions=ne}function J(X,oe){var ne=40,j=16,ee=X.model.dimensions.length,re=oe.displayInd,ce,be,Ae;ee>1?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;Fe<We;Fe++)fe=st[Fe].categoryInd,Me=oe.categories[fe],ot>0?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 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',M=['\xA9 <a target="_blank" href="https://carto.com/">Carto</a>',A].join(" "),e=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),t=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].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;P<E.length;P++){var N=E[P],U=N.lonlat;if(!_(U)){var W={};F&&(W.mcc=N.mcc=F(N.mc)),B&&(W.mrc=N.mrc=B(N.ms)),O&&(W.mo=O(N.mo)),p&&(W.selected=N.selected||0),I.push({type:"Feature",id:P+1,geometry:{type:"Point",coordinates:U},properties:W})}}var Q;if(p)for(Q=t.makeSelectedPointStyleFns(g),P=0;P<I.length;P++){var ue=I[P].properties;Q.selectedOpacityFn&&(ue.mo=L(Q.selectedOpacityFn(ue))),Q.selectedColorFn&&(ue.mcc=Q.selectedColorFn(ue)),Q.selectedSizeFn&&(ue.mrc=Q.selectedSizeFn(ue))}return{geojson:{type:"FeatureCollection",features:I},mcc:u||Q&&Q.selectedColorFn?{type:"identity",property:"mcc"}:b.color,mrc:y||Q&&Q.selectedSizeFn?{type:"identity",property:"mrc"}:z(b.size),mo:f||Q&&Q.selectedOpacityFn?{type:"identity",property:"mo"}:L(b.opacity)}}function d(E,g){for(var b=g._fullLayout,p=E[0].trace,u=p.marker||{},y=u.symbol,f=u.angle,P=y!=="circle"?T(y):l,L=f!=="auto"?T(f,!0):l,z=i.hasText(p)?T(p.text):l,F=[],B=0;B<E.length;B++){var O=E[B];if(!_(O.lonlat)){var I=p.texttemplate,N;if(I){var U=Array.isArray(I)?I[B]||"":I,W=p._module.formatLabels(O,p,b),Q={};o(Q,p,O.i);var ue=p._meta||{};N=x.texttemplateString(U,W,b._d3locale,Q,O,ue)}else N=z(B);N&&(N=N.replace(s,"").replace(c,`
|
||
`)),F.push({type:"Feature",geometry:{type:"Point",coordinates:O.lonlat},properties:{symbol:P(B),angle:L(B),text:N}})}}return{type:"FeatureCollection",features:F}}function T(E,g){return x.isArrayOrTypedArray(E)?g?function(b){return v(E[b])?+E[b]:0}:function(b){return E[b]}:E?function(){return E}:l}function l(){return""}function _(E){return E[0]===A}function w(E,g){var b;if(x.isArrayOrTypedArray(E)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],E[0]];for(var p=1;p<E.length;p++)b.push(g[p-1],E[p])}else b=E;return b}function S(E){var g=E.textfont,b=g.family,p=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||p==="italic";var P=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?P+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(P="Metropolis",u>850?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<c.length;h++)if(c[h].id===o){s=!0;break}s?(this.subplot.setOptions(o,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(o,"setPaintProperty",n.paint)):this.subplot.addLayer(n,a)},t.update=function(i){var a=i[0].trace,n=this.subplot,o=n.map,s=x(n.gd,i),c=n.belowLookup["trace-"+this.uid],h=!!(a.cluster&&a.cluster.enabled),m=!!this.clusterEnabled,d=this;function T(u){u||d.addSource("circle",s.circle,a.cluster);for(var y=M.cluster,f=0;f<y.length;f++){var P=y[f],L=s[P];d.addLayer(P,L,c)}}function l(u){for(var y=M.cluster,f=y.length-1;f>=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<y.length;f++){var P=y[f],L=s[P];u||d.addSource(P,L),d.addLayer(P,L,c)}}function w(u){for(var y=M.nonCluster,f=y.length-1;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<u.length;y++){var f=u[y],P=s[f];P&&(n.setOptions(d.layerIds[f],"setLayoutProperty",P.layout),P.layout.visibility==="visible"&&(f!=="cluster"&&d.setSourceData(f,P),n.setOptions(d.layerIds[f],"setPaintProperty",P.paint)))}}var b=this.isHidden,p=a.visible!==!0;p?b||S():b?p||E():m!==h?(S(),E()):(this.below!==c&&(S(!0),E(!0)),g()),this.clusterEnabled=h,this.isHidden=p,this.below=c,i[0].trace._glTrace=this},t.dispose=function(){for(var i=this.subplot.map,a=this.clusterEnabled?M.cluster:M.nonCluster,n=a.length-1;n>=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<M.cluster.length;d++)T=M.cluster[d],l=h[T],c.addLayer(T,l,m);else for(d=0;d<M.nonCluster.length;d++)T=M.nonCluster[d],l=h[T],c.addSource(T,l,n.cluster),c.addLayer(T,l,m);return a[0].trace._glTrace=c,c}}}),ST=Ze({"src/traces/scattermapbox/hover.js"(Z,q){"use strict";var v=ef(),x=ca(),A=l1(),M=x.fillText,e=Vs().BADNUM,t=am().traceLayerPrefix;function r(a,n,o){var s=a.cd,c=s[0].trace,h=a.xa,m=a.ya,d=a.subplot,T=[],l=t+c.uid+"-circle",_=c.cluster&&c.cluster.enabled;if(_){var w=d.map.queryRenderedFeatures(null,{layers:[l]});T=w.map(function(B){return B.id})}var S=n>=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("<br>")}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<r.length;s++)r[s].selected=0;else for(s=0;s<r.length;s++){var c=r[s],h=c.lonlat;if(h[0]!==A){var m=[v.modHalf(h[0],360),h[1]],d=[i.c2p(m),a.c2p(m)];t.contains(d,null,s,e)?(n.push({pointNumber:s,lon:h[0],lat:h[1]}),c.selected=1):c.selected=0}}return n}}}),EC=Ze({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?q.exports=x():(v=v||self,v.mapboxgl=x())})(Z,function(){"use strict";var v,x,A;function M(e,t){if(!v)v=t;else if(!x)x=t;else{var r="var sharedChunk = {}; ("+v+")(sharedChunk); ("+x+")(sharedChunk);",i={};v(i),A=t(i),typeof window<"u"&&(A.workerUrl=window.URL.createObjectURL(new Blob([r],{type:"text/javascript"})))}}return M(["exports"],function(e){"use strict";function t(C,k){return k={exports:{}},C(k,k.exports),k.exports}var r="1.13.4",i=a;function a(C,k,V,ie){this.cx=3*C,this.bx=3*(V-C)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*k,this.by=3*(ie-k)-this.cy,this.ay=1-this.cy-this.by,this.p1x=C,this.p1y=ie,this.p2x=V,this.p2y=ie}a.prototype.sampleCurveX=function(C){return((this.ax*C+this.bx)*C+this.cx)*C},a.prototype.sampleCurveY=function(C){return((this.ay*C+this.by)*C+this.cy)*C},a.prototype.sampleCurveDerivativeX=function(C){return(3*this.ax*C+2*this.bx)*C+this.cx},a.prototype.solveCurveX=function(C,k){typeof k>"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)<k)return xe;var ht=this.sampleCurveDerivativeX(xe);if(Math.abs(ht)<1e-6)break;xe=xe-Ie/ht}if(V=0,ie=1,xe=C,xe<V)return V;if(xe>ie)return ie;for(;V<ie;){if(Ie=this.sampleCurveX(xe),Math.abs(Ie-C)<k)return xe;C>Ie?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<C.length;V++)if(!c(C[V],k[V]))return!1;return!0}if(typeof C=="object"&&C!==null&&k!==null){if(typeof k!="object")return!1;var ie=Object.keys(C);if(ie.length!==Object.keys(k).length)return!1;for(var xe in C)if(!c(C[xe],k[xe]))return!1;return!0}return C===k}var h=Math.pow(2,53)-1;function m(C){if(C<=0)return 0;if(C>=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<xe.length;ie+=1){var Ie=xe[ie];for(var qe in Ie)C[qe]=Ie[qe]}return C}function b(C,k){for(var V={},ie=0;ie<k.length;ie++){var xe=k[ie];xe in C&&(V[xe]=C[xe])}return V}var p=1;function u(){return p++}function y(){function C(k){return k?(k^Math.random()*16>>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<C.length;V++)if(k.indexOf(C[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<ie;xe=V++)Ie=C[V],qe=C[xe],k+=(qe.x-Ie.x)*(Ie.y+qe.y);return k}function ue(C){var k=C[0],V=C[1],ie=C[2];return V+=90,V*=Math.PI/180,ie*=Math.PI/180,{x:k*Math.cos(V)*Math.sin(ie),y:k*Math.sin(V)*Math.sin(ie),z:k*Math.cos(ie)}}function se(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function he(C){var k=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\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<qe.length;Ie+=1){var ht=qe[Ie];st(ht)?xe.push(this.canonicalizeTileURL(ht,ie)):xe.push(ht)}return xe},fe.prototype._makeAPIURL=function(k,V){var ie="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",xe=qt(Ae.API_URL);if(k.protocol=xe.protocol,k.authority=xe.authority,k.protocol==="http"){var Ie=k.params.indexOf("secure");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<V.length;k+=1){var ie=V[k],xe=ie.match(/^access_token=(.*)$/);if(xe)return xe[1]}return null}var kt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function qt(C){var k=C.match(kt);if(!k)throw new Error("Unable to parse URL object");return{protocol:k[1],authority:k[2],path:k[3]||"/",params:k[4]?k[4].split("&"):[]}}function Zt(C){var k=C.params.length?"?"+C.params.join("&"):"";return C.protocol+"://"+C.authority+C.path+k}var Sr="mapbox.eventData";function xr(C){if(!C)return null;var k=C.split(".");if(!k||k.length!==3)return null;try{var V=JSON.parse(oe(k[1]));return V}catch{return null}}var jr=function(k){this.type=k,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};jr.prototype.getStorageKey=function(k){var V=xr(Ae.ACCESS_TOKEN),ie="";return V&&V.u?ie=X(V.u):ie=Ae.ACCESS_TOKEN||"",k?Sr+"."+k+":"+ie:Sr+":"+ie},jr.prototype.fetchEventData=function(){var k=J("localStorage"),V=this.getStorageKey(),ie=this.getStorageKey("uuid");if(k)try{var xe=s.localStorage.getItem(V);xe&&(this.eventData=JSON.parse(xe));var Ie=s.localStorage.getItem(ie);Ie&&(this.anonId=Ie)}catch{U("Unable to read from LocalStorage")}},jr.prototype.saveEventData=function(){var k=J("localStorage"),V=this.getStorageKey(),ie=this.getStorageKey("uuid");if(k)try{s.localStorage.setItem(ie,this.anonId),Object.keys(this.eventData).length>=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;Ie<Te||Tt(k,function(qe){var ht=new s.Response(qe,ie);at(),Pe&&Pe.then(function(Rt){return Rt.put(Gt(C.url),ht)}).catch(function(Rt){return U(Rt.message)})})}}}function Gt(C){var k=C.indexOf("?");return k<0?C:C.slice(0,k)}function rr(C,k){if(at(),!Pe)return k(null);var V=Gt(C.url);Pe.then(function(ie){ie.match(V).then(function(xe){var Ie=Qt(xe);ie.delete(V),Ie&&ie.put(V,xe.clone()),k(null,xe,Ie)}).catch(k)}).catch(k)}function Qt(C){if(!C)return!1;var k=new Date(C.headers.get("Expires")||0),V=he(C.headers.get("Cache-Control")||"");return k>Date.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<V.length-C;ie++)k.delete(V[ie])})})}function Ba(C){var k=s.caches.delete(Ee);C&&k.catch(C).then(function(){return C()})}function Ra(C,k){Ve=C,Ce=k}var Qa;function za(){return Qa==null&&(Qa=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&typeof s.createImageBitmap=="function"),Qa}var en={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(en);var kn=function(C){function k(V,ie,xe){ie===401&&st(xe)&&(V+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),C.call(this,V),this.status=ie,this.url=xe,this.name=this.constructor.name,this.message=V}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},k}(Error),Jt=se()?function(){return self.worker&&self.worker.referrer}:function(){return(s.location.protocol==="blob:"?s.parent:s).location.href},Nt=function(C){return/^file:/.test(C)||/^file:/.test(Jt())&&!/^\w+:/.test(C)};function Kt(C,k){var V=new s.AbortController,ie=new s.Request(C.url,{method:C.method||"GET",body:C.body,credentials:C.credentials,headers:C.headers,referrer:Jt(),signal:V.signal}),xe=!1,Ie=!1,qe=Qe(ie.url);C.type==="json"&&ie.headers.set("Accept","application/json");var ht=function(Ht,tr,Cr){if(!Ie){if(Ht&&Ht.message!=="SecurityError"&&U(Ht),tr&&Cr)return Rt(tr);var Xr=Date.now();s.fetch(ie).then(function(Vr){if(Vr.ok){var pa=qe?Vr.clone():null;return Rt(Vr,pa,Xr)}else return k(new kn(Vr.statusText,Vr.status,C.url))}).catch(function(Vr){Vr.code!==20&&k(new Error(Vr.message))})}},Rt=function(Ht,tr,Cr){(C.type==="arrayBuffer"?Ht.arrayBuffer():C.type==="json"?Ht.json():Ht.text()).then(function(Xr){Ie||(tr&&Cr&&Ot(ie,tr,Cr),xe=!0,k(null,Xr,Ht.headers.get("Cache-Control"),Ht.headers.get("Expires")))}).catch(function(Xr){Ie||k(new Error(Xr.message))})};return qe?rr(ie,ht):ht(null,null),{cancel:function(){Ie=!0,xe||V.abort()}}}function Wt(C,k){var V=new s.XMLHttpRequest;V.open(C.method||"GET",C.url,!0),C.type==="arrayBuffer"&&(V.responseType="arraybuffer");for(var ie in C.headers)V.setRequestHeader(ie,C.headers[ie]);return C.type==="json"&&(V.responseType="text",V.setRequestHeader("Accept","application/json")),V.withCredentials=C.credentials==="include",V.onerror=function(){k(new Error(V.statusText))},V.onload=function(){if((V.status>=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&&xt<Ae.MAX_PARALLEL_IMAGE_REQUESTS;){var qe=yn.shift(),ht=qe.requestParameters,Rt=qe.callback,Ht=qe.cancelled;Ht||(qe.cancel=Nr(ht,Rt).cancel)}},Ie=ma(C,function(qe,ht,Rt,Ht){xe(),qe?k(qe):ht&&(za()?nn(ht,k):rn(ht,k,Rt,Ht))});return{cancel:function(){Ie.cancel(),xe()}}},Or=function(C,k){var V=s.document.createElement("video");V.muted=!0,V.onloadstart=function(){k(null,V)};for(var ie=0;ie<C.length;ie++){var xe=s.document.createElement("source");Ia(C[ie])||(V.crossOrigin="Anonymous"),xe.src=C[ie],V.appendChild(xe)}return{cancel:function(){}}};function Rr(C,k,V){var ie=V[C]&&V[C].indexOf(k)!==-1;ie||(V[C]=V[C]||[],V[C].push(k))}function Lr(C,k,V){if(V&&V[C]){var ie=V[C].indexOf(k);ie!==-1&&V[C].splice(ie,1)}}var Gr=function(k,V){V===void 0&&(V={}),g(this,V),this.type=k},Kr=function(C){function k(V,ie){ie===void 0&&(ie={}),C.call(this,"error",g({error:V},ie))}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k}(Gr),Ur=function(){};Ur.prototype.on=function(k,V){return this._listeners=this._listeners||{},Rr(k,V,this._listeners),this},Ur.prototype.off=function(k,V){return Lr(k,V,this._listeners),Lr(k,V,this._oneTimeListeners),this},Ur.prototype.once=function(k,V){return this._oneTimeListeners=this._oneTimeListeners||{},Rr(k,V,this._oneTimeListeners),this},Ur.prototype.fire=function(k,V){typeof k=="string"&&(k=new Gr(k,V||{}));var ie=k.type;if(this.listens(ie)){k.target=this;for(var xe=this._listeners&&this._listeners[ie]?this._listeners[ie].slice():[],Ie=0,qe=xe;Ie<qe.length;Ie+=1){var ht=qe[Ie];ht.call(this,k)}for(var Rt=this._oneTimeListeners&&this._oneTimeListeners[ie]?this._oneTimeListeners[ie].slice():[],Ht=0,tr=Rt;Ht<tr.length;Ht+=1){var Cr=tr[Ht];Lr(ie,Cr,this._oneTimeListeners),Cr.call(this,k)}var Xr=this._eventedParent;Xr&&(g(k,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Xr.fire(k))}else k instanceof Kr&&console.error(k.error);return this},Ur.prototype.listens=function(k){return this._listeners&&this._listeners[k]&&this._listeners[k].length>0||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<xe.length;ie+=1){var Ie=xe[ie];for(var qe in Ie)C[qe]=Ie[qe]}return C}function uo(C){return C instanceof Number||C instanceof String||C instanceof Boolean?C.valueOf():C}function $s(C){if(Array.isArray(C))return C.map($s);if(C instanceof Object&&!(C instanceof Number||C instanceof String||C instanceof Boolean)){var k={};for(var V in C)k[V]=$s(C[V]);return k}return uo(C)}var ms=function(C){function k(V,ie){C.call(this,ie),this.message=ie,this.key=V}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k}(Error),Is=function(k,V){V===void 0&&(V=[]),this.parent=k,this.bindings={};for(var ie=0,xe=V;ie<xe.length;ie+=1){var Ie=xe[ie],qe=Ie[0],ht=Ie[1];this.bindings[qe]=ht}};Is.prototype.concat=function(k){return new Is(this,k)},Is.prototype.get=function(k){if(this.bindings[k])return this.bindings[k];if(this.parent)return this.parent.get(k);throw new Error(k+" not found in scope.")},Is.prototype.has=function(k){return this.bindings[k]?!0:this.parent?this.parent.has(k):!1};var rl={kind:"null"},Si={kind:"number"},po={kind:"string"},ro={kind:"boolean"},As={kind:"color"},al={kind:"object"},$i={kind:"value"},zs={kind:"error"},au={kind:"collator"},fl={kind:"formatted"},xu={kind:"resolvedImage"};function zl(C,k){return{kind:"array",itemType:C,N:k}}function Ns(C){if(C.kind==="array"){var k=Ns(C.itemType);return typeof C.N=="number"?"array<"+k+", "+C.N+">":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;V<ie.length;V+=1){var xe=ie[V];if(!Eu(xe,k))return null}}return"Expected "+Ns(C)+" but found "+Ns(k)+" instead."}function Bc(C,k){return k.some(function(V){return V.kind===C.kind})}function Cu(C,k){return k.some(function(V){return V==="null"?C===null:V==="array"?Array.isArray(C):V==="object"?C&&!Array.isArray(C)&&typeof C=="object":V===typeof C})}var Af=t(function(C,k){var V={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ie(Ht){return Ht=Math.round(Ht),Ht<0?0:Ht>255?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<ie.length;V+=1){var xe=ie[V];if(xe.image){k.push(["image",xe.image.name]);continue}k.push(xe.text);var Ie={};xe.fontStack&&(Ie["text-font"]=["literal",xe.fontStack.split(",")]),xe.scale&&(Ie["font-scale"]=xe.scale),xe.textColor&&(Ie["text-color"]=["rgba"].concat(xe.textColor.toArray())),k.push(Ie)}return k};var Ll=function(k){this.name=k.name,this.available=k.available};Ll.prototype.toString=function(){return this.name},Ll.fromString=function(k){return k?new Ll({name:k,available:!1}):null},Ll.prototype.serialize=function(){return["image",this.name]};function nc(C,k,V,ie){if(!(typeof C=="number"&&C>=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;k<V.length;k+=1){var ie=V[k];if(!Ou(ie))return!1}return!0}else if(typeof C=="object"){for(var xe in C)if(!Ou(C[xe]))return!1;return!0}else return!1}function nl(C){if(C===null)return rl;if(typeof C=="string")return po;if(typeof C=="boolean")return ro;if(typeof C=="number")return Si;if(C instanceof Us)return As;if(C instanceof qc)return au;if(C instanceof iu)return fl;if(C instanceof Ll)return xu;if(Array.isArray(C)){for(var k=C.length,V,ie=0,xe=C;ie<xe.length;ie+=1){var Ie=xe[ie],qe=nl(Ie);if(!V)V=qe;else{if(V===qe)continue;V=$i;break}}return zl(V||$i,k)}else return al}function vl(C){var k=typeof C;return C===null?"":k==="string"||k==="number"||k==="boolean"?String(C):C instanceof Us||C instanceof iu||C instanceof Ll?C.toString():JSON.stringify(C)}var gs=function(k,V){this.type=k,this.value=V};gs.parse=function(k,V){if(k.length!==2)return V.error("'literal' expression requires exactly one argument, but found "+(k.length-1)+" instead.");if(!Ou(k[1]))return V.error("invalid value");var ie=k[1],xe=nl(ie),Ie=V.expectedType;return xe.kind==="array"&&xe.N===0&&Ie&&Ie.kind==="array"&&(typeof Ie.N!="number"||Ie.N===0)&&(xe=Ie),new gs(xe,ie)},gs.prototype.evaluate=function(){return this.value},gs.prototype.eachChild=function(){},gs.prototype.outputDefined=function(){return!0},gs.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Us?["rgba"].concat(this.value.toArray()):this.value instanceof iu?this.value.serialize():this.value};var qs=function(k){this.name="ExpressionEvaluationError",this.message=k};qs.prototype.toJSON=function(){return this.message};var ic={string:po,number:Si,boolean:ro,object:al},Nl=function(k,V){this.type=k,this.args=V};Nl.parse=function(k,V){if(k.length<2)return V.error("Expected at least one argument.");var ie=1,xe,Ie=k[0];if(Ie==="array"){var qe;if(k.length>2){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=[];ie<k.length;ie++){var tr=V.parse(k[ie],ie,$i);if(!tr)return null;Ht.push(tr)}return new Nl(xe,Ht)},Nl.prototype.evaluate=function(k){for(var V=0;V<this.args.length;V++){var ie=this.args[V].evaluate(k),xe=Eu(this.type,nl(ie));if(xe){if(V===this.args.length-1)throw new qs("Expected value to be of type "+Ns(this.type)+", but found "+Ns(nl(ie))+" instead.")}else return ie}return null},Nl.prototype.eachChild=function(k){this.args.forEach(k)},Nl.prototype.outputDefined=function(){return this.args.every(function(k){return k.outputDefined()})},Nl.prototype.serialize=function(){var k=this.type,V=[k.kind];if(k.kind==="array"){var ie=k.itemType;if(ie.kind==="string"||ie.kind==="number"||ie.kind==="boolean"){V.push(ie.kind);var xe=k.N;(typeof xe=="number"||this.args.length>1)&&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<ie.length;V+=1){var xe=ie[V];k(xe.content),xe.scale&&k(xe.scale),xe.font&&k(xe.font),xe.textColor&&k(xe.textColor)}},Vu.prototype.outputDefined=function(){return!1},Vu.prototype.serialize=function(){for(var k=["format"],V=0,ie=this.sections;V<ie.length;V+=1){var xe=ie[V];k.push(xe.content.serialize());var Ie={};xe.scale&&(Ie["font-scale"]=xe.scale.serialize()),xe.font&&(Ie["text-font"]=xe.font.serialize()),xe.textColor&&(Ie["text-color"]=xe.textColor.serialize()),k.push(Ie)}return k};var cl=function(k){this.type=xu,this.input=k};cl.parse=function(k,V){if(k.length!==2)return V.error("Expected two arguments.");var ie=V.parse(k[1],1,po);return ie?new cl(ie):V.error("No image name provided.")},cl.prototype.evaluate=function(k){var V=this.input.evaluate(k),ie=Ll.fromString(V);return ie&&k.availableImages&&(ie.available=k.availableImages.indexOf(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;qe<k.length;qe++){var ht=V.parse(k[qe],qe,$i);if(!ht)return null;Ie.push(ht)}return new ls(xe,Ie)},ls.prototype.evaluate=function(k){if(this.type.kind==="boolean")return!!this.args[0].evaluate(k);if(this.type.kind==="color"){for(var V,ie,xe=0,Ie=this.args;xe<Ie.length;xe+=1){var qe=Ie[xe];if(V=qe.evaluate(k),ie=null,V instanceof Us)return V;if(typeof V=="string"){var ht=k.parseColor(V);if(ht)return ht}else if(Array.isArray(V)&&(V.length<3||V.length>4?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<tr.length;Ht+=1){var Cr=tr[Ht];if(Rt=Cr.evaluate(k),Rt===null)return 0;var Xr=Number(Rt);if(!isNaN(Xr))return Xr}throw new qs("Could not convert "+JSON.stringify(Rt)+" to number.")}else return this.type.kind==="formatted"?iu.fromString(vl(this.args[0].evaluate(k))):this.type.kind==="resolvedImage"?Ll.fromString(vl(this.args[0].evaluate(k))):vl(this.args[0].evaluate(k))},ls.prototype.eachChild=function(k){this.args.forEach(k)},ls.prototype.outputDefined=function(){return this.args.every(function(k){return k.outputDefined()})},ls.prototype.serialize=function(){if(this.type.kind==="formatted")return new Vu([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new cl(this.args[0]).serialize();var k=["to-"+this.type.kind];return this.eachChild(function(V){k.push(V.serialize())}),k};var _h=["Unknown","Point","LineString","Polygon"],Ss=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Ss.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ss.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?_h[this.feature.type]:this.feature.type:null},Ss.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Ss.prototype.canonicalID=function(){return this.canonical},Ss.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ss.prototype.parseColor=function(k){var V=this._parseColorCache[k];return V||(V=this._parseColorCache[k]=Us.parse(k)),V};var Qi=function(k,V,ie,xe){this.name=k,this.type=V,this._evaluate=ie,this.args=xe};Qi.prototype.evaluate=function(k){return this._evaluate(k,this.args)},Qi.prototype.eachChild=function(k){this.args.forEach(k)},Qi.prototype.outputDefined=function(){return!1},Qi.prototype.serialize=function(){return[this.name].concat(this.args.map(function(k){return k.serialize()}))},Qi.parse=function(k,V){var ie,xe=k[0],Ie=Qi.definitions[xe];if(!Ie)return V.error('Unknown expression "'+xe+'". If you wanted a literal array, use ["literal", [...]].',0);for(var qe=Array.isArray(Ie)?Ie[0]:Ie.type,ht=Array.isArray(Ie)?[[Ie[1],Ie[2]]]:Ie.overloads,Rt=ht.filter(function(Eo){var Ro=Eo[0];return!Array.isArray(Ro)||Ro.length===k.length-1}),Ht=null,tr=0,Cr=Rt;tr<Cr.length;tr+=1){var Xr=Cr[tr],Vr=Xr[0],pa=Xr[1];Ht=new il(V.registry,V.path,null,V.scope);for(var ja=[],Cn=!1,un=1;un<k.length;un++){var ti=k[un],Un=Array.isArray(Vr)?Vr[un-1]:Vr.type,ei=Ht.parse(ti,1+ja.length,Un);if(!ei){Cn=!0;break}ja.push(ei)}if(!Cn){if(Array.isArray(Vr)&&Vr.length!==ja.length){Ht.error("Expected "+Vr.length+" arguments, but found "+ja.length+" instead.");continue}for(var li=0;li<ja.length;li++){var xi=Array.isArray(Vr)?Vr[li]:Vr.type,Vi=ja[li];Ht.concat(li+1).checkSubtype(xi,Vi.type)}if(Ht.errors.length===0)return new Qi(xe,qe,pa,ja)}}if(Rt.length===1)(ie=V.errors).push.apply(ie,Ht.errors);else{for(var Ni=Rt.length?Rt:ht,Mo=Ni.map(function(Eo){var Ro=Eo[0];return Gc(Ro)}).join(" | "),io=[],_o=1;_o<k.length;_o++){var Ms=V.parse(k[_o],1+io.length);if(!Ms)return null;io.push(Ns(Ms.type))}V.error("Expected arguments of type "+Mo+", but found ("+io.join(", ")+") instead.")}return null},Qi.register=function(k,V){Qi.definitions=V;for(var ie in V)k[ie]=Qi};function Gc(C){return Array.isArray(C)?"("+C.map(Ns).join(", ")+")":"("+Ns(C.type)+"...)"}var qu=function(k,V,ie){this.type=au,this.locale=ie,this.caseSensitive=k,this.diacriticSensitive=V};qu.parse=function(k,V){if(k.length!==2)return V.error("Expected one argument.");var ie=k[1];if(typeof ie!="object"||Array.isArray(ie))return V.error("Collator options argument must be an object.");var xe=V.parse(ie["case-sensitive"]===void 0?!1:ie["case-sensitive"],1,ro);if(!xe)return null;var Ie=V.parse(ie["diacritic-sensitive"]===void 0?!1:ie["diacritic-sensitive"],1,ro);if(!Ie)return null;var qe=null;return ie.locale&&(qe=V.parse(ie.locale,1,po),!qe)?null:new qu(xe,Ie,qe)},qu.prototype.evaluate=function(k){return new qc(this.caseSensitive.evaluate(k),this.diacriticSensitive.evaluate(k),this.locale?this.locale.evaluate(k):null)},qu.prototype.eachChild=function(k){k(this.caseSensitive),k(this.diacriticSensitive),this.locale&&k(this.locale)},qu.prototype.outputDefined=function(){return!1},qu.prototype.serialize=function(){var k={};return k["case-sensitive"]=this.caseSensitive.serialize(),k["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(k.locale=this.locale.serialize()),["collator",k]};var Ul=8192;function Mf(C,k){C[0]=Math.min(C[0],k[0]),C[1]=Math.min(C[1],k[1]),C[2]=Math.max(C[2],k[0]),C[3]=Math.max(C[3],k[1])}function wc(C){return(180+C)/360}function rf(C){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360)))/360}function Kl(C,k){return!(C[0]<=k[0]||C[2]>=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;ie<xe;ie++)for(var Ie=k[ie],qe=0,ht=Ie.length;qe<ht-1;qe++){if(zf(C,Ie[qe],Ie[qe+1]))return!1;af(C,Ie[qe],Ie[qe+1])&&(V=!V)}return V}function Ff(C,k){for(var V=0;V<k.length;V++)if(Nc(C,k[V]))return!0;return!1}function Of(C,k){return C[0]*k[1]-C[1]*k[0]}function Gu(C,k,V,ie){var xe=C[0]-V[0],Ie=C[1]-V[1],qe=k[0]-V[0],ht=k[1]-V[1],Rt=ie[0]-V[0],Ht=ie[1]-V[1],tr=xe*Ht-Rt*Ie,Cr=qe*Ht-Rt*ht;return tr>0&&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;ie<xe.length;ie+=1)for(var Ie=xe[ie],qe=0;qe<Ie.length-1;++qe)if(Ef(C,k,Ie[qe],Ie[qe+1]))return!0;return!1}function Hc(C,k){for(var V=0;V<C.length;++V)if(!Nc(C[V],k))return!1;for(var ie=0;ie<C.length-1;++ie)if(oc(C[ie],C[ie+1],k))return!1;return!0}function Jl(C,k){for(var V=0;V<k.length;V++)if(Hc(C,k[V]))return!0;return!1}function Uc(C,k,V){for(var ie=[],xe=0;xe<C.length;xe++){for(var Ie=[],qe=0;qe<C[xe].length;qe++){var ht=Yf(C[xe][qe],V);Mf(k,ht),Ie.push(ht)}ie.push(Ie)}return ie}function Tc(C,k,V){for(var ie=[],xe=0;xe<C.length;xe++){var Ie=Uc(C[xe],k,V);ie.push(Ie)}return ie}function Gs(C,k,V,ie){if(C[0]<V[0]||C[0]>V[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<Rt.length;ht+=1)for(var Ht=Rt[ht],tr=0,Cr=Ht;tr<Cr.length;tr+=1){var Xr=Cr[tr],Vr=[Xr.x+Ie[0],Xr.y+Ie[1]];Gs(Vr,k,V,xe),qe.push(Vr)}return qe}function Bf(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<Rt.length;ht+=1){for(var Ht=Rt[ht],tr=[],Cr=0,Xr=Ht;Cr<Xr.length;Cr+=1){var Vr=Xr[Cr],pa=[Vr.x+Ie[0],Vr.y+Ie[1]];Mf(k,pa),tr.push(pa)}qe.push(tr)}if(k[2]-k[0]<=xe/2){Cf(k);for(var ja=0,Cn=qe;ja<Cn.length;ja+=1)for(var un=Cn[ja],ti=0,Un=un;ti<Un.length;ti+=1){var ei=Un[ti];Gs(ei,k,V,xe)}}return qe}function Wc(C,k){var V=[1/0,1/0,-1/0,-1/0],ie=[1/0,1/0,-1/0,-1/0],xe=C.canonicalID();if(k.type==="Polygon"){var Ie=Uc(k.coordinates,ie,xe),qe=lh(C.geometry(),V,ie,xe);if(!Kl(V,ie))return!1;for(var ht=0,Rt=qe;ht<Rt.length;ht+=1){var Ht=Rt[ht];if(!Nc(Ht,Ie))return!1}}if(k.type==="MultiPolygon"){var tr=Tc(k.coordinates,ie,xe),Cr=lh(C.geometry(),V,ie,xe);if(!Kl(V,ie))return!1;for(var Xr=0,Vr=Cr;Xr<Vr.length;Xr+=1){var pa=Vr[Xr];if(!Ff(pa,tr))return!1}}return!0}function Kf(C,k){var V=[1/0,1/0,-1/0,-1/0],ie=[1/0,1/0,-1/0,-1/0],xe=C.canonicalID();if(k.type==="Polygon"){var Ie=Uc(k.coordinates,ie,xe),qe=Bf(C.geometry(),V,ie,xe);if(!Kl(V,ie))return!1;for(var ht=0,Rt=qe;ht<Rt.length;ht+=1){var Ht=Rt[ht];if(!Hc(Ht,Ie))return!1}}if(k.type==="MultiPolygon"){var tr=Tc(k.coordinates,ie,xe),Cr=Bf(C.geometry(),V,ie,xe);if(!Kl(V,ie))return!1;for(var Xr=0,Vr=Cr;Xr<Vr.length;Xr+=1){var pa=Vr[Xr];if(!Jl(pa,tr))return!1}}return!0}var ku=function(k,V){this.type=ro,this.geojson=k,this.geometries=V};ku.parse=function(k,V){if(k.length!==2)return V.error("'within' expression requires exactly one argument, but found "+(k.length-1)+" instead.");if(Ou(k[1])){var ie=k[1];if(ie.type==="FeatureCollection")for(var xe=0;xe<ie.features.length;++xe){var Ie=ie.features[xe].geometry.type;if(Ie==="Polygon"||Ie==="MultiPolygon")return new ku(ie,ie.features[xe].geometry)}else if(ie.type==="Feature"){var qe=ie.geometry.type;if(qe==="Polygon"||qe==="MultiPolygon")return new ku(ie,ie.geometry)}else if(ie.type==="Polygon"||ie.type==="MultiPolygon")return new ku(ie,ie)}return V.error("'within' expression requires valid geojson object that contains polygon geometry type.")},ku.prototype.evaluate=function(k){if(k.geometry()!=null&&k.canonicalID()!=null){if(k.geometryType()==="Point")return Wc(k,this.geometries);if(k.geometryType()==="LineString")return Kf(k,this.geometries)}return!1},ku.prototype.eachChild=function(){},ku.prototype.outputDefined=function(){return!0},ku.prototype.serialize=function(){return["within",this.geojson]};function Nf(C){if(C instanceof Qi){if(C.name==="get"&&C.args.length===1)return!1;if(C.name==="feature-state")return!1;if(C.name==="has"&&C.args.length===1)return!1;if(C.name==="properties"||C.name==="geometry-type"||C.name==="id")return!1;if(/^filter-/.test(C.name))return!1}if(C instanceof ku)return!1;var k=!0;return C.eachChild(function(V){k&&!Nf(V)&&(k=!1)}),k}function ml(C){if(C instanceof Qi&&C.name==="feature-state")return!1;var k=!0;return C.eachChild(function(V){k&&!ml(V)&&(k=!1)}),k}function Lu(C,k){if(C instanceof Qi&&k.indexOf(C.name)>=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||k<ht)return Ie;ie=Ie+1}else if(qe>k)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<Ie.length;xe+=1){var qe=Ie[xe],ht=qe[0],Rt=qe[1];this.labels.push(ht),this.outputs.push(Rt)}};bu.parse=function(k,V){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.");var ie=V.parse(k[1],1,Si);if(!ie)return null;var xe=[],Ie=null;V.expectedType&&V.expectedType.kind!=="value"&&(Ie=V.expectedType);for(var qe=1;qe<k.length;qe+=2){var ht=qe===1?-1/0:k[qe],Rt=k[qe+1],Ht=qe,tr=qe+1;if(typeof ht!="number")return V.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ht);if(xe.length&&xe[xe.length-1][0]>=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;V<ie.length;V+=1){var xe=ie[V];k(xe)}},bu.prototype.outputDefined=function(){return this.outputs.every(function(k){return k.outputDefined()})},bu.prototype.serialize=function(){for(var k=["step",this.input.serialize()],V=0;V<this.labels.length;V++)V>0&&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;qe<ht.length;qe+=1){var Rt=ht[qe],Ht=Rt[0],tr=Rt[1];this.labels.push(Ht),this.outputs.push(tr)}};ru.interpolationFactor=function(k,V,ie,xe){var Ie=0;if(k.name==="exponential")Ie=jf(V,k.base,ie,xe);else if(k.name==="linear")Ie=jf(V,1,ie,xe);else if(k.name==="cubic-bezier"){var qe=k.controlPoints,ht=new i(qe[0],qe[1],qe[2],qe[3]);Ie=ht.solve(jf(V,1,ie,xe))}return Ie},ru.parse=function(k,V){var ie=k[0],xe=k[1],Ie=k[2],qe=k.slice(3);if(!Array.isArray(xe)||xe.length===0)return V.error("Expected an interpolation type expression.",1);if(xe[0]==="linear")xe={name:"linear"};else if(xe[0]==="exponential"){var ht=xe[1];if(typeof ht!="number")return V.error("Exponential interpolation requires a numeric base.",1,1);xe={name:"exponential",base:ht}}else if(xe[0]==="cubic-bezier"){var Rt=xe.slice(1);if(Rt.length!==4||Rt.some(function(un){return typeof un!="number"||un<0||un>1}))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<qe.length;Cr+=2){var Xr=qe[Cr],Vr=qe[Cr+1],pa=Cr+3,ja=Cr+4;if(typeof Xr!="number")return V.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',pa);if(Ht.length&&Ht[Ht.length-1][0]>=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;V+=1){var xe=ie[V];k(xe)}},ru.prototype.outputDefined=function(){return this.outputs.every(function(k){return k.outputDefined()})},ru.prototype.serialize=function(){var k;this.interpolation.name==="linear"?k=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?k=["linear"]:k=["exponential",this.interpolation.base]:k=["cubic-bezier"].concat(this.interpolation.controlPoints);for(var V=[this.operator,k,this.input.serialize()],ie=0;ie<this.labels.length;ie++)V.push(this.labels[ie],this.outputs[ie].serialize());return V};function jf(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 Xu=function(k,V){this.type=k,this.args=V};Xu.parse=function(k,V){if(k.length<2)return V.error("Expectected at least one argument.");var ie=null,xe=V.expectedType;xe&&xe.kind!=="value"&&(ie=xe);for(var Ie=[],qe=0,ht=k.slice(1);qe<ht.length;qe+=1){var Rt=ht[qe],Ht=V.parse(Rt,1+Ie.length,ie,void 0,{typeAnnotation:"omit"});if(!Ht)return null;ie=ie||Ht.type,Ie.push(Ht)}var tr=xe&&Ie.some(function(Cr){return Eu(xe,Cr.type)});return tr?new Xu($i,Ie):new Xu(ie,Ie)},Xu.prototype.evaluate=function(k){for(var V=null,ie=0,xe,Ie=0,qe=this.args;Ie<qe.length;Ie+=1){var ht=qe[Ie];if(ie++,V=ht.evaluate(k),V&&V instanceof Ll&&!V.available&&(xe||(xe=V.name),V=null,ie===this.args.length&&(V=xe)),V!==null)break}return V},Xu.prototype.eachChild=function(k){this.args.forEach(k)},Xu.prototype.outputDefined=function(){return this.args.every(function(k){return k.outputDefined()})},Xu.prototype.serialize=function(){var k=["coalesce"];return this.eachChild(function(V){k.push(V.serialize())}),k};var Ec=function(k,V){this.type=V.type,this.bindings=[].concat(k),this.result=V};Ec.prototype.evaluate=function(k){return this.result.evaluate(k)},Ec.prototype.eachChild=function(k){for(var V=0,ie=this.bindings;V<ie.length;V+=1){var xe=ie[V];k(xe[1])}k(this.result)},Ec.parse=function(k,V){if(k.length<4)return V.error("Expected at least 3 arguments, but found "+(k.length-1)+" instead.");for(var ie=[],xe=1;xe<k.length-1;xe+=2){var Ie=k[xe];if(typeof Ie!="string")return V.error("Expected string, but found "+typeof Ie+" instead.",xe);if(/[^a-zA-Z0-9_]/.test(Ie))return V.error("Variable names must contain only alphanumeric characters or '_'.",xe);var qe=V.parse(k[xe+1],xe+1);if(!qe)return null;ie.push([Ie,qe])}var ht=V.parse(k[k.length-1],k.length-1,V.expectedType,ie);return ht?new Ec(ie,ht):null},Ec.prototype.outputDefined=function(){return this.result.outputDefined()},Ec.prototype.serialize=function(){for(var k=["let"],V=0,ie=this.bindings;V<ie.length;V+=1){var xe=ie[V],Ie=xe[0],qe=xe[1];k.push(Ie,qe.serialize())}return k.push(this.result.serialize()),k};var mc=function(k,V,ie){this.type=k,this.index=V,this.input=ie};mc.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,Si),xe=V.parse(k[2],2,zl(V.expectedType||$i));if(!ie||!xe)return null;var Ie=xe.type;return new mc(Ie.itemType,ie,xe)},mc.prototype.evaluate=function(k){var V=this.index.evaluate(k),ie=this.input.evaluate(k);if(V<0)throw new qs("Array index out of bounds: "+V+" < 0.");if(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;ht<k.length-1;ht+=2){var Rt=k[ht],Ht=k[ht+1];Array.isArray(Rt)||(Rt=[Rt]);var tr=V.concat(ht);if(Rt.length===0)return tr.error("Expected at least one branch label.");for(var Cr=0,Xr=Rt;Cr<Xr.length;Cr+=1){var Vr=Xr[Cr];if(typeof Vr!="number"&&typeof Vr!="string")return tr.error("Branch labels must be numbers or strings.");if(typeof Vr=="number"&&Math.abs(Vr)>Number.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<ht.length;qe+=1){var Rt=ht[qe],Ht=Ie[this.cases[Rt]];Ht===void 0?(Ie[this.cases[Rt]]=xe.length,xe.push([this.cases[Rt],[Rt]])):xe[Ht][1].push(Rt)}for(var tr=function(ja){return k.inputType.kind==="number"?Number(ja):ja},Cr=0,Xr=xe;Cr<Xr.length;Cr+=1){var Vr=Xr[Cr],Ht=Vr[0],pa=Vr[1];pa.length===1?V.push(tr(pa[0])):V.push(pa.map(tr)),V.push(this.outputs[outputIndex$1].serialize())}return V.push(this.otherwise.serialize()),V};var Yc=function(k,V,ie){this.type=k,this.branches=V,this.otherwise=ie};Yc.parse=function(k,V){if(k.length<4)return V.error("Expected at least 3 arguments, but found only "+(k.length-1)+".");if(k.length%2!==0)return V.error("Expected an odd number of arguments.");var ie;V.expectedType&&V.expectedType.kind!=="value"&&(ie=V.expectedType);for(var xe=[],Ie=1;Ie<k.length-1;Ie+=2){var qe=V.parse(k[Ie],Ie,ro);if(!qe)return null;var ht=V.parse(k[Ie+1],Ie+1,ie);if(!ht)return null;xe.push([qe,ht]),ie=ie||ht.type}var Rt=V.parse(k[k.length-1],k.length-1,ie);return Rt?new Yc(ie,xe,Rt):null},Yc.prototype.evaluate=function(k){for(var V=0,ie=this.branches;V<ie.length;V+=1){var xe=ie[V],Ie=xe[0],qe=xe[1];if(Ie.evaluate(k))return qe.evaluate(k)}return this.otherwise.evaluate(k)},Yc.prototype.eachChild=function(k){for(var V=0,ie=this.branches;V<ie.length;V+=1){var xe=ie[V],Ie=xe[0],qe=xe[1];k(Ie),k(qe)}k(this.otherwise)},Yc.prototype.outputDefined=function(){return this.branches.every(function(k){var V=k[0],ie=k[1];return ie.outputDefined()})&&this.otherwise.outputDefined()},Yc.prototype.serialize=function(){var k=["case"];return this.eachChild(function(V){k.push(V.serialize())}),k};var sc=function(k,V,ie,xe){this.type=k,this.input=V,this.beginIndex=ie,this.endIndex=xe};sc.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,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 k<V}function $r(C,k,V){return k>V}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<xe.length;ie+=1){var Ie=xe[ie];V+=Ie.evaluate(C)}return V}],"*":[Si,Ks(Si),function(C,k){for(var V=1,ie=0,xe=k;ie<xe.length;ie+=1){var Ie=xe[ie];V*=Ie.evaluate(C)}return V}],"-":{type:Si,overloads:[[[Si,Si],function(C,k){var V=k[0],ie=k[1];return V.evaluate(C)-ie.evaluate(C)}],[[Si],function(C,k){var V=k[0];return-V.evaluate(C)}]]},"/":[Si,[Si,Si],function(C,k){var V=k[0],ie=k[1];return V.evaluate(C)/ie.evaluate(C)}],"%":[Si,[Si,Si],function(C,k){var V=k[0],ie=k[1];return V.evaluate(C)%ie.evaluate(C)}],ln2:[Si,[],function(){return Math.LN2}],pi:[Si,[],function(){return Math.PI}],e:[Si,[],function(){return Math.E}],"^":[Si,[Si,Si],function(C,k){var V=k[0],ie=k[1];return Math.pow(V.evaluate(C),ie.evaluate(C))}],sqrt:[Si,[Si],function(C,k){var V=k[0];return Math.sqrt(V.evaluate(C))}],log10:[Si,[Si],function(C,k){var V=k[0];return Math.log(V.evaluate(C))/Math.LN10}],ln:[Si,[Si],function(C,k){var V=k[0];return Math.log(V.evaluate(C))}],log2:[Si,[Si],function(C,k){var V=k[0];return Math.log(V.evaluate(C))/Math.LN2}],sin:[Si,[Si],function(C,k){var V=k[0];return Math.sin(V.evaluate(C))}],cos:[Si,[Si],function(C,k){var V=k[0];return Math.cos(V.evaluate(C))}],tan:[Si,[Si],function(C,k){var V=k[0];return Math.tan(V.evaluate(C))}],asin:[Si,[Si],function(C,k){var V=k[0];return Math.asin(V.evaluate(C))}],acos:[Si,[Si],function(C,k){var V=k[0];return Math.acos(V.evaluate(C))}],atan:[Si,[Si],function(C,k){var V=k[0];return Math.atan(V.evaluate(C))}],min:[Si,Ks(Si),function(C,k){return Math.min.apply(Math,k.map(function(V){return V.evaluate(C)}))}],max:[Si,Ks(Si),function(C,k){return Math.max.apply(Math,k.map(function(V){return V.evaluate(C)}))}],abs:[Si,[Si],function(C,k){var V=k[0];return Math.abs(V.evaluate(C))}],round:[Si,[Si],function(C,k){var V=k[0],ie=V.evaluate(C);return ie<0?-Math.round(-ie):Math.round(ie)}],floor:[Si,[Si],function(C,k){var V=k[0];return Math.floor(V.evaluate(C))}],ceil:[Si,[Si],function(C,k){var V=k[0];return Math.ceil(V.evaluate(C))}],"filter-==":[ro,[po,$i],function(C,k){var V=k[0],ie=k[1];return C.properties()[V.value]===ie.value}],"filter-id-==":[ro,[$i],function(C,k){var V=k[0];return C.id()===V.value}],"filter-type-==":[ro,[po],function(C,k){var V=k[0];return C.geometryType()===V.value}],"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-<=":[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<ie.length;V+=1){var xe=ie[V];if(!xe.evaluate(C))return!1}return!0}]]},any:{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<ie.length;V+=1){var xe=ie[V];if(xe.evaluate(C))return!0}return!1}]]},"!":[ro,[ro],function(C,k){var V=k[0];return!V.evaluate(C)}],"is-supported-script":[ro,[po],function(C,k){var V=k[0],ie=C.globals&&C.globals.isSupportedScript;return ie?ie(V.evaluate(C)):!0}],upcase:[po,[po],function(C,k){var V=k[0];return V.evaluate(C).toUpperCase()}],downcase:[po,[po],function(C,k){var V=k[0];return V.evaluate(C).toLowerCase()}],concat:[po,Ks($i),function(C,k){return k.map(function(V){return vl(V.evaluate(C))}).join("")}],"resolved-locale":[po,[au],function(C,k){var V=k[0];return V.evaluate(C).resolvedLocale()}]});function ys(C){return{result:"success",value:C}}function Fl(C){return{result:"error",value:C}}function yl(C){return C["property-type"]==="data-driven"||C["property-type"]==="cross-faded-data-driven"}function sl(C){return!!C.expression&&C.expression.parameters.indexOf("zoom")>-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<Cr.length;tr+=1){var Xr=Cr[tr];Rt[Xr[0]]=Xr[1]}Ht=typeof C.stops[0][0]}else if(qe==="identity")ht=Pc;else throw new Error('Unknown function type "'+qe+'"');if(ie){for(var Vr={},pa=[],ja=0;ja<C.stops.length;ja++){var Cn=C.stops[ja],un=Cn[0].zoom;Vr[un]===void 0&&(Vr[un]={zoom:un,type:C.type,property:C.property,default:C.default,stops:[]},pa.push(un)),Vr[un].stops.push([Cn[0].value,Cn[1]])}for(var ti=[],Un=0,ei=pa;Un<ei.length;Un+=1){var li=ei[Un];ti.push([Vr[li].zoom,ou(Vr[li],k)])}var xi={name:"linear"};return{kind:"composite",interpolationType:xi,interpolationFactor:ru.interpolationFactor.bind(void 0,xi),zoomStops:ti.map(function(Ni){return Ni[0]}),evaluate:function(Mo,io){var _o=Mo.zoom;return yu({stops:ti,base:C.base},k,_o).evaluate(_o,io)}}}else if(Ie){var Vi=qe==="exponential"?{name:"exponential",base:C.base!==void 0?C.base:1}:null;return{kind:"camera",interpolationType:Vi,interpolationFactor:ru.interpolationFactor.bind(void 0,Vi),zoomStops:C.stops.map(function(Ni){return Ni[0]}),evaluate:function(Ni){var Mo=Ni.zoom;return ht(C,k,Mo,Rt,Ht)}}}else return{kind:"source",evaluate:function(Mo,io){var _o=io&&io.properties?io.properties[C.property]:void 0;return _o===void 0?Iu(C.default,k.default):ht(C,k,_o,Rt,Ht)}}}function Iu(C,k,V){if(C!==void 0)return C;if(k!==void 0)return k;if(V!==void 0)return V}function Zu(C,k,V,ie,xe){var Ie=typeof V===xe?ie[V]:void 0;return Iu(Ie,C.default,k.default)}function Lc(C,k,V){if(Io(V)!=="number")return Iu(C.default,k.default);var ie=C.stops.length;if(ie===1||V<=C.stops[0][0])return C.stops[0][1];if(V>=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;V<ie.length;V+=1){var xe=ie[V];if(k=ae(xe),k)break}else(C instanceof bu||C instanceof ru)&&C.input instanceof Qi&&C.input.name==="zoom"&&(k=C);return k instanceof ms||C.eachChild(function(Ie){var qe=ae(Ie);qe instanceof ms?k=qe:!k&&qe?k=new ms("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):k&&qe&&k!==qe&&(k=new ms("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),k}function we(C){var k={color:As,string:po,number:Si,enum:po,boolean:ro,formatted:fl,resolvedImage:xu};return C.type==="array"?zl(k[C.value]||$i,C.length):k[C.type]}function Se(C){return C.type==="color"&&Xs(C.default)?new Us(0,0,0,0):C.type==="color"?Us.parse(C.default)||null:C.default===void 0?null:C.default}function Oe(C){var k=C.key,V=C.value,ie=C.valueSpec||{},xe=C.objectElementValidators||{},Ie=C.style,qe=C.styleSpec,ht=[],Rt=Io(V);if(Rt!=="object")return[new Ci(k,V,"object expected, "+Rt+" found")];for(var Ht in V){var tr=Ht.split(".")[0],Cr=ie[tr]||ie["*"],Xr=void 0;if(xe[tr])Xr=xe[tr];else if(ie[tr])Xr=So;else if(xe["*"])Xr=xe["*"];else if(ie["*"])Xr=So;else{ht.push(new Ci(k,V[Ht],'unknown property "'+Ht+'"'));continue}ht=ht.concat(Xr({key:(k&&k+".")+Ht,value:V[Ht],valueSpec:Cr,style:Ie,styleSpec:qe,object:V,objectKey:Ht},V))}for(var Vr in ie)xe[Vr]||ie[Vr].required&&ie[Vr].default===void 0&&V[Vr]===void 0&&ht.push(new Ci(k,V,'missing required property "'+Vr+'"'));return ht}function pt(C){var k=C.value,V=C.valueSpec,ie=C.style,xe=C.styleSpec,Ie=C.key,qe=C.arrayElementValidator||So;if(Io(k)!=="array")return[new Ci(Ie,k,"array expected, "+Io(k)+" found")];if(V.length&&k.length!==V.length)return[new Ci(Ie,k,"array length "+V.length+" expected, length "+k.length+" found")];if(V["min-length"]&&k.length<V["min-length"])return[new Ci(Ie,k,"array length at least "+V["min-length"]+" expected, length "+k.length+" found")];var ht={type:V.value,values:V.values};xe.$version<7&&(ht.function=V.function),Io(V.value)==="object"&&(ht=V.value);for(var Rt=[],Ht=0;Ht<k.length;Ht++)Rt=Rt.concat(qe({array:k,arrayIndex:Ht,value:k[Ht],valueSpec:ht,style:ie,styleSpec:xe,key:Ie+"["+Ht+"]"}));return Rt}function At(C){var k=C.key,V=C.value,ie=C.valueSpec,xe=Io(V);return xe==="number"&&V!==V&&(xe="NaN"),xe!=="number"?[new Ci(k,V,"number expected, "+xe+" found")]:"minimum"in ie&&V<ie.minimum?[new Ci(k,V,V+" is less than the minimum value "+ie.minimum)]:"maximum"in ie&&V>ie.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<Ie?[new Ci(ja.key,Un,"stop domain values must appear in ascending order")]:(Ie=ti,V==="categorical"&&ti in xe?[new Ci(ja.key,Un,"stop domain values must be unique")]:(xe[ti]=!0,[]))}function pa(ja){return So({key:ja.key,value:ja.value,valueSpec:k,style:ja.style,styleSpec:ja.styleSpec})}}function $t(C){var k=(C.expressionContext==="property"?Yu:zo)($s(C.value),C.valueSpec);if(k.result==="error")return k.value.map(function(ie){return new Ci(""+C.key+ie.key,C.value,ie.message)});var V=k.value.expression||k.value._styleExpression.expression;if(C.expressionContext==="property"&&C.propertyKey==="text-font"&&!V.outputDefined())return[new Ci(C.key,C.value,'Invalid data expression for "'+C.propertyKey+'". Output values must be contained as literals within the expression.')];if(C.expressionContext==="property"&&C.propertyType==="layout"&&!ml(V))return[new Ci(C.key,C.value,'"feature-state" data expressions are not supported with layout properties.')];if(C.expressionContext==="filter"&&!ml(V))return[new Ci(C.key,C.value,'"feature-state" data expressions are not supported with filters.')];if(C.expressionContext&&C.expressionContext.indexOf("cluster")===0){if(!Lu(V,["zoom","feature-state"]))return[new Ci(C.key,C.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(C.expressionContext==="cluster-initial"&&!Nf(V))return[new Ci(C.key,C.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function br(C){var k=C.value,V=C.key,ie=Io(k);return ie!=="boolean"?[new Ci(V,k,"boolean expected, "+ie+" found")]:[]}function Ar(C){var k=C.key,V=C.value,ie=Io(V);return ie!=="string"?[new Ci(k,V,"color expected, "+ie+" found")]:pf(V)===null?[new Ci(k,V,'color expected, "'+V+'" found')]:[]}function Yr(C){var k=C.key,V=C.value,ie=C.valueSpec,xe=[];return Array.isArray(ie.values)?ie.values.indexOf(uo(V))===-1&&xe.push(new Ci(k,V,"expected one of ["+ie.values.join(", ")+"], "+JSON.stringify(V)+" found")):Object.keys(ie.values).indexOf(uo(V))===-1&&xe.push(new Ci(k,V,"expected one of ["+Object.keys(ie.values).join(", ")+"], "+JSON.stringify(V)+" found")),xe}function sa(C){if(C===!0||C===!1)return!0;if(!Array.isArray(C)||C.length===0)return!1;switch(C[0]){case"has":return C.length>=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);k<V.length;k+=1){var ie=V[k];if(!sa(ie)&&typeof ie!="boolean")return!1}return!0;default:return!0}}var He={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Je(C){if(C==null)return{filter:function(){return!0},needGeometry:!1};sa(C)||(C=Ct(C));var k=zo(C,He);if(k.result==="error")throw new Error(k.value.map(function(ie){return ie.key+": "+ie.message}).join(", "));var V=dt(C);return{filter:function(ie,xe,Ie){return k.value.evaluate(ie,xe,{},Ie)},needGeometry:V}}function lt(C,k){return C<k?-1:C>k?1:0}function dt(C){if(!Array.isArray(C))return!1;if(C[0]==="within")return!0;for(var k=1;k<C.length;k++)if(dt(C[k]))return!0;return!1}function Ct(C){if(!C)return!0;var k=C[0];if(C.length<=1)return k!=="any";var V=k==="=="?wt(C[1],C[2],"=="):k==="!="?Er(wt(C[1],C[2],"==")):k==="<"||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<k.length;qe++)xe=Io(k[qe]),uo(k[1])==="$type"?Ie=Ie.concat(Yr({key:V+"["+qe+"]",value:k[qe],valueSpec:ie.geometry_type,style:C.style,styleSpec:C.styleSpec})):xe!=="string"&&xe!=="number"&&xe!=="boolean"&&Ie.push(new Ci(V+"["+qe+"]",k[qe],"string, number, or boolean expected, "+xe+" found"));break;case"any":case"all":case"none":for(var ht=1;ht<k.length;ht++)Ie=Ie.concat(Qr({key:V+"["+ht+"]",value:k[ht],style:C.style,styleSpec:C.styleSpec}));break;case"has":case"!has":xe=Io(k[1]),k.length!==2?Ie.push(new Ci(V,k,'filter array for "'+k[0]+'" operator must have 2 elements')):xe!=="string"&&Ie.push(new Ci(V+"[1]",k[1],"string expected, "+xe+" found"));break;case"within":xe=Io(k[1]),k.length!==2?Ie.push(new Ci(V,k,'filter array for "'+k[0]+'" operator must have 2 elements')):xe!=="object"&&Ie.push(new Ci(V+"[1]",k[1],"object expected, "+xe+" found"));break}return Ie}function ga(C,k){var V=C.key,ie=C.style,xe=C.styleSpec,Ie=C.value,qe=C.objectKey,ht=xe[k+"_"+C.layerType];if(!ht)return[];var Rt=qe.match(/^(.*)-transition$/);if(k==="paint"&&Rt&&ht[Rt[1]]&&ht[Rt[1]].transition)return So({key:V,value:Ie,valueSpec:xe.transition,style:ie,styleSpec:xe});var Ht=C.valueSpec||ht[qe];if(!Ht)return[new Ci(V,Ie,'unknown property "'+qe+'"')];var tr;if(Io(Ie)==="string"&&yl(Ht)&&!Ht.tokens&&(tr=/^{([^}]+)}$/.exec(Ie)))return[new Ci(V,Ie,'"'+qe+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(tr[1])+" }`.")];var Cr=[];return C.layerType==="symbol"&&(qe==="text-field"&&ie&&!ie.glyphs&&Cr.push(new Ci(V,Ie,'use of "text-field" requires a style "glyphs" property')),qe==="text-font"&&Xs($s(Ie))&&uo(Ie.type)==="identity"&&Cr.push(new Ci(V,Ie,'"text-font" does not support identity functions'))),Cr.concat(So({key:C.key,value:Ie,valueSpec:Ht,style:ie,styleSpec:xe,expressionContext:"property",propertyType:k,propertyKey:qe}))}function Sa(C){return ga(C,"paint")}function Oa(C){return ga(C,"layout")}function vn(C){var k=[],V=C.value,ie=C.key,xe=C.style,Ie=C.styleSpec;!V.type&&!V.ref&&k.push(new Ci(ie,V,'either "type" or "ref" is required'));var qe=uo(V.type),ht=uo(V.ref);if(V.id)for(var Rt=uo(V.id),Ht=0;Ht<C.arrayIndex;Ht++){var tr=xe.layers[Ht];uo(tr.id)===Rt&&k.push(new Ci(ie,V.id,'duplicate layer id "'+V.id+'", previously used at line '+tr.id.__line__))}if("ref"in V){["type","source","source-layer","filter","layout"].forEach(function(pa){pa in V&&k.push(new Ci(ie,V[pa],'"'+pa+'" is prohibited for ref layers'))});var Cr;xe.layers.forEach(function(pa){uo(pa.id)===ht&&(Cr=pa)}),Cr?Cr.ref?k.push(new Ci(ie,V.ref,"ref cannot reference another ref layer")):qe=uo(Cr.type):k.push(new Ci(ie,V.ref,'ref layer "'+ht+'" not found'))}else if(qe!=="background")if(!V.source)k.push(new Ci(ie,V,'missing required property "source"'));else{var Xr=xe.sources&&xe.sources[V.source],Vr=Xr&&uo(Xr.type);Xr?Vr==="vector"&&qe==="raster"?k.push(new Ci(ie,V.source,'layer "'+V.id+'" requires a raster source')):Vr==="raster"&&qe!=="raster"?k.push(new Ci(ie,V.source,'layer "'+V.id+'" requires a vector source')):Vr==="vector"&&!V["source-layer"]?k.push(new Ci(ie,V,'layer "'+V.id+'" must specify a "source-layer"')):Vr==="raster-dem"&&qe!=="hillshade"?k.push(new Ci(ie,V.source,"raster-dem source can only be used with layer type 'hillshade'.")):qe==="line"&&V.paint&&V.paint["line-gradient"]&&(Vr!=="geojson"||!Xr.lineMetrics)&&k.push(new Ci(ie,V,'layer "'+V.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):k.push(new Ci(ie,V.source,'source "'+V.source+'" not found'))}return k=k.concat(Oe({key:ie,value:V,valueSpec:Ie.layer,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return So({key:ie+".type",value:V.type,valueSpec:Ie.layer.type,style:C.style,styleSpec:C.styleSpec,object:V,objectKey:"type"})},filter:Br,layout:function(ja){return Oe({layer:V,key:ja.key,value:ja.value,style:ja.style,styleSpec:ja.styleSpec,objectElementValidators:{"*":function(un){return Oa(Bs({layerType:qe},un))}}})},paint:function(ja){return Oe({layer:V,key:ja.key,value:ja.value,style:ja.style,styleSpec:ja.styleSpec,objectElementValidators:{"*":function(un){return Sa(Bs({layerType:qe},un))}}})}}})),k}function Xn(C){var k=C.value,V=C.key,ie=Io(k);return ie!=="string"?[new Ci(V,k,"string expected, "+ie+" found")]:[]}var Hn={promoteId:Ti};function oi(C){var k=C.value,V=C.key,ie=C.styleSpec,xe=C.style;if(!k.type)return[new Ci(V,k,'"type" is required')];var Ie=uo(k.type),qe;switch(Ie){case"vector":case"raster":case"raster-dem":return qe=Oe({key:V,value:k,valueSpec:ie["source_"+Ie.replace("-","_")],style:C.style,styleSpec:ie,objectElementValidators:Hn}),qe;case"geojson":if(qe=Oe({key:V,value:k,valueSpec:ie.source_geojson,style:xe,styleSpec:ie,objectElementValidators:Hn}),k.cluster)for(var ht in k.clusterProperties){var Rt=k.clusterProperties[ht],Ht=Rt[0],tr=Rt[1],Cr=typeof Ht=="string"?[Ht,["accumulated"],["get",ht]]:Ht;qe.push.apply(qe,$t({key:V+"."+ht+".map",value:tr,expressionContext:"cluster-map"})),qe.push.apply(qe,$t({key:V+"."+ht+".reduce",value:Cr,expressionContext:"cluster-reduce"}))}return qe;case"video":return Oe({key:V,value:k,valueSpec:ie.source_video,style:xe,styleSpec:ie});case"image":return Oe({key:V,value:k,valueSpec:ie.source_image,style:xe,styleSpec:ie});case"canvas":return[new Ci(V,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yr({key:V+".type",value:k.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:xe,styleSpec:ie})}}function Ti(C){var k=C.key,V=C.value;if(Io(V)==="string")return Xn({key:k,value:V});var ie=[];for(var xe in V)ie.push.apply(ie,Xn({key:k+"."+xe,value:V[xe]}));return ie}function Wi(C){var k=C.value,V=C.styleSpec,ie=V.light,xe=C.style,Ie=[],qe=Io(k);if(k===void 0)return Ie;if(qe!=="object")return Ie=Ie.concat([new Ci("light",k,"object expected, "+qe+" found")]),Ie;for(var ht in k){var Rt=ht.match(/^(.*)-transition$/);Rt&&ie[Rt[1]]&&ie[Rt[1]].transition?Ie=Ie.concat(So({key:ht,value:k[ht],valueSpec:V.transition,style:xe,styleSpec:V})):ie[ht]?Ie=Ie.concat(So({key:ht,value:k[ht],valueSpec:ie[ht],style:xe,styleSpec:V})):Ie=Ie.concat([new Ci(ht,k[ht],'unknown property "'+ht+'"')])}return Ie}function Bi(C){return Xn(C).length===0?[]:$t(C)}function Ao(C){return Xn(C).length===0?[]:$t(C)}var ss={"*":function(){return[]},array:pt,boolean:br,number:At,color:Ar,constants:tl,enum:Yr,filter:Br,function:Bt,layer:vn,object:Oe,source:oi,light:Wi,string:Xn,formatted:Bi,resolvedImage:Ao};function So(C){var k=C.value,V=C.valueSpec,ie=C.styleSpec;if(V.expression&&Xs(uo(k)))return Bt(C);if(V.expression&&fo($s(k)))return $t(C);if(V.type&&ss[V.type])return ss[V.type](C);var xe=Oe(Bs({},C,{valueSpec:V.type?ie[V.type]:V}));return xe}function Ko(C){var k=C.value,V=C.key,ie=Xn(C);return ie.length||(k.indexOf("{fontstack}")===-1&&ie.push(new Ci(V,k,'"glyphs" url must include a "{fontstack}" token')),k.indexOf("{range}")===-1&&ie.push(new Ci(V,k,'"glyphs" url must include a "{range}" token'))),ie}function hs(C,k){k===void 0&&(k=jn);var V=[];return V=V.concat(So({key:"",value:C,valueSpec:k.$root,styleSpec:k,style:C,objectElementValidators:{glyphs:Ko,"*":function(){return[]}}})),C.constants&&(V=V.concat(tl({key:"constants",value:C.constants,style:C,styleSpec:k}))),ll(V)}hs.source=Js(oi),hs.light=Js(Wi),hs.layer=Js(vn),hs.filter=Js(Br),hs.paintProperty=Js(Sa),hs.layoutProperty=Js(Oa);function ll(C){return[].concat(C).sort(function(k,V){return k.line-V.line})}function Js(C){return function(){for(var k=[],V=arguments.length;V--;)k[V]=arguments[V];return ll(C.apply(this,k))}}var es=hs,ts=es.light,Pl=es.paintProperty,$l=es.layoutProperty;function Ru(C,k){var V=!1;if(k&&k.length)for(var ie=0,xe=k;ie<xe.length;ie+=1){var Ie=xe[ie];C.fire(new Kr(new Error(Ie.message))),V=!0}return V}var hu=su,wl=3;function su(C,k,V){var ie=this.cells=[];if(C instanceof ArrayBuffer){this.arrayBuffer=C;var xe=new Int32Array(this.arrayBuffer);C=xe[0],k=xe[1],V=xe[2],this.d=k+2*V;for(var Ie=0;Ie<this.d*this.d;Ie++){var qe=xe[wl+Ie],ht=xe[wl+Ie+1];ie.push(qe===ht?null:xe.subarray(qe,ht))}var Rt=xe[wl+ie.length],Ht=xe[wl+ie.length+1];this.keys=xe.subarray(Rt,Ht),this.bboxes=xe.subarray(Ht),this.insert=this._insertReadonly}else{this.d=k+2*V;for(var tr=0;tr<this.d*this.d;tr++)ie.push([]);this.keys=[],this.bboxes=[]}this.n=k,this.extent=C,this.padding=V,this.scale=k/C,this.uid=0;var Cr=V/k*C;this.min=-Cr,this.max=C+Cr}su.prototype.insert=function(C,k,V,ie,xe){this._forEachCell(k,V,ie,xe,this._insertCell,this.uid++),this.keys.push(C),this.bboxes.push(k),this.bboxes.push(V),this.bboxes.push(ie),this.bboxes.push(xe)},su.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},su.prototype._insertCell=function(C,k,V,ie,xe,Ie){this.cells[xe].push(Ie)},su.prototype.query=function(C,k,V,ie,xe){var Ie=this.min,qe=this.max;if(C<=Ie&&k<=Ie&&qe<=V&&qe<=ie&&!xe)return Array.prototype.slice.call(this.keys);var ht=[],Rt={};return this._forEachCell(C,k,V,ie,this._queryCell,ht,Rt,xe),ht},su.prototype._queryCell=function(C,k,V,ie,xe,Ie,qe,ht){var Rt=this.cells[xe];if(Rt!==null)for(var Ht=this.keys,tr=this.bboxes,Cr=0;Cr<Rt.length;Cr++){var Xr=Rt[Cr];if(qe[Xr]===void 0){var Vr=Xr*4;(ht?ht(tr[Vr+0],tr[Vr+1],tr[Vr+2],tr[Vr+3]):C<=tr[Vr+2]&&k<=tr[Vr+3]&&V>=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<this.cells.length;ie++)V+=this.cells[ie].length;var xe=new Int32Array(k+V+this.keys.length+this.bboxes.length);xe[0]=this.extent,xe[1]=this.n,xe[2]=this.padding;for(var Ie=k,qe=0;qe<C.length;qe++){var ht=C[qe];xe[wl+qe]=Ie,xe.set(ht,Ie),Ie+=ht.length}return xe[wl+C.length]=Ie,xe.set(this.keys,Ie),Ie+=this.keys.length,xe[wl+C.length+1]=Ie,xe.set(this.bboxes,Ie),Ie+=this.bboxes.length,xe.buffer};var uc=s.ImageData,Vl=s.ImageBitmap,ql={};function de(C,k,V){V===void 0&&(V={}),Object.defineProperty(k,"_classRegistryKey",{value:C,writeable:!1}),ql[C]={klass:k,omit:V.omit||[],shallow:V.shallow||[]}}de("Object",Object),hu.serialize=function(k,V){var ie=k.toArrayBuffer();return V&&V.push(ie),{buffer:ie}},hu.deserialize=function(k){return new hu(k.buffer)},de("Grid",hu),de("Color",Us),de("Error",Error),de("ResolvedImage",Ll),de("StylePropertyFunction",Ne),de("StyleExpression",gc,{omit:["_evaluator"]}),de("ZoomDependentExpression",lc),de("ZoomConstantExpression",Ic),de("CompoundExpression",Qi,{omit:["_evaluate"]});for(var De in xo)xo[De]._classRegistryKey||de("Expression_"+De,xo[De]);function et(C){return C&&typeof ArrayBuffer<"u"&&(C instanceof ArrayBuffer||C.constructor&&C.constructor.name==="ArrayBuffer")}function vt(C){return Vl&&C instanceof Vl}function _t(C,k){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)return C;if(et(C)||vt(C))return k&&k.push(C),C;if(ArrayBuffer.isView(C)){var V=C;return k&&k.push(V.buffer),V}if(C instanceof uc)return k&&k.push(C.data.buffer),C;if(Array.isArray(C)){for(var ie=[],xe=0,Ie=C;xe<Ie.length;xe+=1){var qe=Ie[xe];ie.push(_t(qe,k))}return ie}if(typeof C=="object"){var ht=C.constructor,Rt=ht._classRegistryKey;if(!Rt)throw new Error("can't serialize object of unregistered class");var Ht=ht.serialize?ht.serialize(C,k):{};if(!ht.serialize){for(var tr in C)if(C.hasOwnProperty(tr)&&!(ql[Rt].omit.indexOf(tr)>=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<qe.length;Ie+=1){var ht=qe[Ie];if(ht!=="$name"){var Rt=C[ht];xe[ht]=ql[k].shallow.indexOf(ht)>=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<ie&&(this.lastIntegerZoom=ie,this.lastIntegerZoomTime=V),k!==this.lastZoom?(this.lastZoom=k,this.lastFloorZoom=ie,!0):!1)};var zt={"Latin-1 Supplement":function(C){return C>=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<V.length;k+=1){var ie=V[k];if(ya(ie.charCodeAt(0)))return!0}return!1}function qr(C){for(var k=0,V=C;k<V.length;k+=1){var ie=V[k];if(!Wr(ie.charCodeAt(0)))return!1}return!0}function Wr(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 Ta(C){return C<11904?!1:!!(zt["Bopomofo Extended"](C)||zt.Bopomofo(C)||zt["CJK Compatibility Forms"](C)||zt["CJK Compatibility Ideographs"](C)||zt["CJK Compatibility"](C)||zt["CJK Radicals Supplement"](C)||zt["CJK Strokes"](C)||zt["CJK Symbols and Punctuation"](C)||zt["CJK Unified Ideographs Extension A"](C)||zt["CJK Unified Ideographs"](C)||zt["Enclosed CJK Letters and Months"](C)||zt["Halfwidth and Fullwidth Forms"](C)||zt.Hiragana(C)||zt["Ideographic Description Characters"](C)||zt["Kangxi Radicals"](C)||zt["Katakana Phonetic Extensions"](C)||zt.Katakana(C)||zt["Vertical Forms"](C)||zt["Yi Radicals"](C)||zt["Yi Syllables"](C))}function ya(C){return C===746||C===747?!0:C<4352?!1:!!(zt["Bopomofo Extended"](C)||zt.Bopomofo(C)||zt["CJK Compatibility Forms"](C)&&!(C>=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<V.length;k+=1){var ie=V[k];if(Na(ie.charCodeAt(0)))return!0}return!1}function cn(C,k){for(var V=0,ie=C;V<ie.length;V+=1){var xe=ie[V];if(!Ka(xe.charCodeAt(0),k))return!1}return!0}var Pa={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},si=null,ni=Pa.unavailable,vi=null,Pi=function(C){C&&typeof C=="string"&&C.indexOf("NetworkError")>-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);V<ie.length;V+=1){var xe=ie[V],Ie=this.getValue(xe);Ie!==void 0&&(k[xe]=Ie);var qe=this.getTransition(xe);qe!==void 0&&(k[xe+"-transition"]=qe)}return k},ps.prototype.transitioned=function(k,V){for(var ie=new Gl(this._properties),xe=0,Ie=Object.keys(this._values);xe<Ie.length;xe+=1){var qe=Ie[xe];ie._values[qe]=this._values[qe].transitioned(k,V._values[qe])}return ie},ps.prototype.untransitioned=function(){for(var k=new Gl(this._properties),V=0,ie=Object.keys(this._values);V<ie.length;V+=1){var xe=ie[V];k._values[xe]=this._values[xe].untransitioned()}return k};var Tl=function(k,V,ie,xe,Ie){this.property=k,this.value=V,this.begin=Ie+xe.delay||0,this.end=this.begin+xe.duration||0,k.specification.transition&&(xe.delay||xe.duration)&&(this.prior=ie)};Tl.prototype.possiblyEvaluate=function(k,V,ie){var xe=k.now||0,Ie=this.value.possiblyEvaluate(k,V,ie),qe=this.prior;if(qe){if(xe>this.end)return this.prior=null,Ie;if(this.value.isDataDriven())return this.prior=null,Ie;if(xe<this.begin)return qe.possiblyEvaluate(k,V,ie);var ht=(xe-this.begin)/(this.end-this.begin);return this.property.interpolate(qe.possiblyEvaluate(k,V,ie),Ie,m(ht))}else return Ie};var Gl=function(k){this._properties=k,this._values=Object.create(k.defaultTransitioningPropertyValues)};Gl.prototype.possiblyEvaluate=function(k,V,ie){for(var xe=new yc(this._properties),Ie=0,qe=Object.keys(this._values);Ie<qe.length;Ie+=1){var ht=qe[Ie];xe._values[ht]=this._values[ht].possiblyEvaluate(k,V,ie)}return xe},Gl.prototype.hasTransition=function(){for(var k=0,V=Object.keys(this._values);k<V.length;k+=1){var ie=V[k];if(this._values[ie].prior)return!0}return!1};var Tu=function(k){this._properties=k,this._values=Object.create(k.defaultPropertyValues)};Tu.prototype.getValue=function(k){return O(this._values[k].value)},Tu.prototype.setValue=function(k,V){this._values[k]=new vo(this._values[k].property,V===null?void 0:O(V))},Tu.prototype.serialize=function(){for(var k={},V=0,ie=Object.keys(this._values);V<ie.length;V+=1){var xe=ie[V],Ie=this.getValue(xe);Ie!==void 0&&(k[xe]=Ie)}return k},Tu.prototype.possiblyEvaluate=function(k,V,ie){for(var xe=new yc(this._properties),Ie=0,qe=Object.keys(this._values);Ie<qe.length;Ie+=1){var ht=qe[Ie];xe._values[ht]=this._values[ht].possiblyEvaluate(k,V,ie)}return xe};var Il=function(k,V,ie){this.property=k,this.value=V,this.parameters=ie};Il.prototype.isConstant=function(){return this.value.kind==="constant"},Il.prototype.constantOr=function(k){return this.value.kind==="constant"?this.value.value:k},Il.prototype.evaluate=function(k,V,ie,xe){return this.property.evaluate(this.value,this.parameters,k,V,ie,xe)};var yc=function(k){this._properties=k,this._values=Object.create(k.defaultPossiblyEvaluatedValues)};yc.prototype.get=function(k){return this._values[k]};var nt=function(k){this.specification=k};nt.prototype.possiblyEvaluate=function(k,V){return k.expression.evaluate(V)},nt.prototype.interpolate=function(k,V,ie){var xe=Bu[this.specification.type];return xe?xe(k,V,ie):k};var Yt=function(k,V){this.specification=k,this.overrides=V};Yt.prototype.possiblyEvaluate=function(k,V,ie,xe){return k.expression.kind==="constant"||k.expression.kind==="camera"?new Il(this,{kind:"constant",value:k.expression.evaluate(V,null,{},ie,xe)},V):new Il(this,k.expression,V)},Yt.prototype.interpolate=function(k,V,ie){if(k.value.kind!=="constant"||V.value.kind!=="constant")return k;if(k.value.value===void 0||V.value.value===void 0)return new Il(this,{kind:"constant",value:void 0},k.parameters);var xe=Bu[this.specification.type];return xe?new Il(this,{kind:"constant",value:xe(k.value.value,V.value.value,ie)},k.parameters):k},Yt.prototype.evaluate=function(k,V,ie,xe,Ie,qe){return k.kind==="constant"?k.value:k.evaluate(V,ie,xe,Ie,qe)};var cr=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,Ie,qe){if(ie.value===void 0)return new Il(this,{kind:"constant",value:void 0},xe);if(ie.expression.kind==="constant"){var ht=ie.expression.evaluate(xe,null,{},Ie,qe),Rt=ie.property.specification.type==="resolvedImage",Ht=Rt&&typeof ht!="string"?ht.name:ht,tr=this._calculate(Ht,Ht,Ht,xe);return new Il(this,{kind:"constant",value:tr},xe)}else if(ie.expression.kind==="camera"){var Cr=this._calculate(ie.expression.evaluate({zoom:xe.zoom-1}),ie.expression.evaluate({zoom:xe.zoom}),ie.expression.evaluate({zoom:xe.zoom+1}),xe);return new Il(this,{kind:"constant",value:Cr},xe)}else return new Il(this,ie.expression,xe)},k.prototype.evaluate=function(ie,xe,Ie,qe,ht,Rt){if(ie.kind==="source"){var Ht=ie.evaluate(xe,Ie,qe,ht,Rt);return this._calculate(Ht,Ht,Ht,xe)}else return ie.kind==="composite"?this._calculate(ie.evaluate({zoom:Math.floor(xe.zoom)-1},Ie,qe),ie.evaluate({zoom:Math.floor(xe.zoom)},Ie,qe),ie.evaluate({zoom:Math.floor(xe.zoom)+1},Ie,qe),xe):ie.value},k.prototype._calculate=function(ie,xe,Ie,qe){var ht=qe.zoom;return ht>qe.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.minzoom||this.maxzoom&&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<V.length;k+=1){var ie=V[k];for(var xe in ie.vaos)ie.vaos[xe].destroy()}},Lo.simpleSegment=function(k,V,ie,xe){return new Lo([{vertexOffset:k,primitiveOffset:V,vertexLength:ie,primitiveLength:xe,vaos:{},sortKey:0}])},Lo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,de("SegmentVector",Lo);function ve(C,k){return C=l(Math.floor(C),0,255),k=l(Math.floor(k),0,255),256*C+k}var Y=Ln([{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"}]),ye=t(function(C){function k(V,ie){var xe,Ie,qe,ht,Rt,Ht,tr,Cr;for(xe=V.length&3,Ie=V.length-xe,qe=ie,Rt=3432918353,Ht=461845907,Cr=0;Cr<Ie;)tr=V.charCodeAt(Cr)&255|(V.charCodeAt(++Cr)&255)<<8|(V.charCodeAt(++Cr)&255)<<16|(V.charCodeAt(++Cr)&255)<<24,++Cr,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,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<xe;){var Ie=ie+xe>>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<ie;){for(var xe=C[V+ie>>1],Ie=V-1,qe=ie+1;;){do Ie++;while(C[Ie]<xe);do qe--;while(C[qe]>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-V<ie-qe?(_r(C,k,V,qe),V=qe+1):(_r(C,k,qe+1,ie),ie=qe)}}function Fr(C,k,V){var ie=C[k];C[k]=C[V],C[V]=ie}de("FeaturePositionMap",$e);var hr=function(k,V){this.gl=k.gl,this.location=V},gt=function(C){function k(V,ie){C.call(this,V,ie),this.current=0}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){this.current!==ie&&(this.current=ie,this.gl.uniform1i(this.location,ie))},k}(hr),Et=function(C){function k(V,ie){C.call(this,V,ie),this.current=0}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){this.current!==ie&&(this.current=ie,this.gl.uniform1f(this.location,ie))},k}(hr),Ft=function(C){function k(V,ie){C.call(this,V,ie),this.current=[0,0]}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){(ie[0]!==this.current[0]||ie[1]!==this.current[1])&&(this.current=ie,this.gl.uniform2f(this.location,ie[0],ie[1]))},k}(hr),nr=function(C){function k(V,ie){C.call(this,V,ie),this.current=[0,0,0]}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){(ie[0]!==this.current[0]||ie[1]!==this.current[1]||ie[2]!==this.current[2])&&(this.current=ie,this.gl.uniform3f(this.location,ie[0],ie[1],ie[2]))},k}(hr),fr=function(C){function k(V,ie){C.call(this,V,ie),this.current=[0,0,0,0]}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){(ie[0]!==this.current[0]||ie[1]!==this.current[1]||ie[2]!==this.current[2]||ie[3]!==this.current[3])&&(this.current=ie,this.gl.uniform4f(this.location,ie[0],ie[1],ie[2],ie[3]))},k}(hr),sr=function(C){function k(V,ie){C.call(this,V,ie),this.current=Us.transparent}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){(ie.r!==this.current.r||ie.g!==this.current.g||ie.b!==this.current.b||ie.a!==this.current.a)&&(this.current=ie,this.gl.uniform4f(this.location,ie.r,ie.g,ie.b,ie.a))},k}(hr),pr=new Float32Array(16),lr=function(C){function k(V,ie){C.call(this,V,ie),this.current=pr}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.set=function(ie){if(ie[12]!==this.current[12]||ie[0]!==this.current[0]){this.current=ie,this.gl.uniformMatrix4fv(this.location,!1,ie);return}for(var xe=1;xe<16;xe++)if(ie[xe]!==this.current[xe]){this.current=ie,this.gl.uniformMatrix4fv(this.location,!1,ie);break}},k}(hr);function Xt(C){return[ve(255*C.r,255*C.g),ve(255*C.b,255*C.a)]}var or=function(k,V,ie){this.value=k,this.uniformNames=V.map(function(xe){return"u_"+xe}),this.type=ie};or.prototype.setUniform=function(k,V,ie){k.set(ie.constantOr(this.value))},or.prototype.getBinding=function(k,V,ie){return this.type==="color"?new sr(k,V):new Et(k,V)};var Vt=function(k,V){this.uniformNames=V.map(function(ie){return"u_"+ie}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Vt.prototype.setConstantPatternPositions=function(k,V){this.pixelRatioFrom=V.pixelRatio,this.pixelRatioTo=k.pixelRatio,this.patternFrom=V.tlbr,this.patternTo=k.tlbr},Vt.prototype.setUniform=function(k,V,ie,xe){var Ie=xe==="u_pattern_to"?this.patternTo:xe==="u_pattern_from"?this.patternFrom:xe==="u_pixel_ratio_to"?this.pixelRatioTo:xe==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ie&&k.set(Ie)},Vt.prototype.getBinding=function(k,V,ie){return ie.substr(0,9)==="u_pattern"?new fr(k,V):new Et(k,V)};var Dr=function(k,V,ie,xe){this.expression=k,this.type=ie,this.maxValue=0,this.paintVertexAttributes=V.map(function(Ie){return{name:"a_"+Ie,type:"Float32",components:ie==="color"?2:1,offset:0}}),this.paintVertexArray=new xe};Dr.prototype.populatePaintArray=function(k,V,ie,xe,Ie){var qe=this.paintVertexArray.length,ht=this.expression.evaluate(new gi(0),V,{},xe,[],Ie);this.paintVertexArray.resize(k),this._setPaintValue(qe,k,ht)},Dr.prototype.updatePaintArray=function(k,V,ie,xe){var Ie=this.expression.evaluate({zoom:0},ie,xe);this._setPaintValue(k,V,Ie)},Dr.prototype._setPaintValue=function(k,V,ie){if(this.type==="color")for(var xe=Xt(ie),Ie=k;Ie<V;Ie++)this.paintVertexArray.emplace(Ie,xe[0],xe[1]);else{for(var qe=k;qe<V;qe++)this.paintVertexArray.emplace(qe,ie);this.maxValue=Math.max(this.maxValue,Math.abs(ie))}},Dr.prototype.upload=function(k){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=k.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Dr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Jr=function(k,V,ie,xe,Ie,qe){this.expression=k,this.uniformNames=V.map(function(ht){return"u_"+ht+"_t"}),this.type=ie,this.useIntegerZoom=xe,this.zoom=Ie,this.maxValue=0,this.paintVertexAttributes=V.map(function(ht){return{name:"a_"+ht,type:"Float32",components:ie==="color"?4:2,offset:0}}),this.paintVertexArray=new qe};Jr.prototype.populatePaintArray=function(k,V,ie,xe,Ie){var qe=this.expression.evaluate(new gi(this.zoom),V,{},xe,[],Ie),ht=this.expression.evaluate(new gi(this.zoom+1),V,{},xe,[],Ie),Rt=this.paintVertexArray.length;this.paintVertexArray.resize(k),this._setPaintValue(Rt,k,qe,ht)},Jr.prototype.updatePaintArray=function(k,V,ie,xe){var Ie=this.expression.evaluate({zoom:this.zoom},ie,xe),qe=this.expression.evaluate({zoom:this.zoom+1},ie,xe);this._setPaintValue(k,V,Ie,qe)},Jr.prototype._setPaintValue=function(k,V,ie,xe){if(this.type==="color")for(var Ie=Xt(ie),qe=Xt(xe),ht=k;ht<V;ht++)this.paintVertexArray.emplace(ht,Ie[0],Ie[1],qe[0],qe[1]);else{for(var Rt=k;Rt<V;Rt++)this.paintVertexArray.emplace(Rt,ie,xe);this.maxValue=Math.max(this.maxValue,Math.abs(ie),Math.abs(xe))}},Jr.prototype.upload=function(k){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=k.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Jr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Jr.prototype.setUniform=function(k,V){var ie=this.useIntegerZoom?Math.floor(V.zoom):V.zoom,xe=l(this.expression.interpolationFactor(ie,this.zoom,this.zoom+1),0,1);k.set(xe)},Jr.prototype.getBinding=function(k,V,ie){return new Et(k,V)};var ba=function(k,V,ie,xe,Ie,qe){this.expression=k,this.type=V,this.useIntegerZoom=ie,this.zoom=xe,this.layerId=qe,this.zoomInPaintVertexArray=new Ie,this.zoomOutPaintVertexArray=new Ie};ba.prototype.populatePaintArray=function(k,V,ie){var xe=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(k),this.zoomOutPaintVertexArray.resize(k),this._setPaintValues(xe,k,V.patterns&&V.patterns[this.layerId],ie)},ba.prototype.updatePaintArray=function(k,V,ie,xe,Ie){this._setPaintValues(k,V,ie.patterns&&ie.patterns[this.layerId],Ie)},ba.prototype._setPaintValues=function(k,V,ie,xe){if(!(!xe||!ie)){var Ie=ie.min,qe=ie.mid,ht=ie.max,Rt=xe[Ie],Ht=xe[qe],tr=xe[ht];if(!(!Rt||!Ht||!tr))for(var Cr=k;Cr<V;Cr++)this.zoomInPaintVertexArray.emplace(Cr,Ht.tl[0],Ht.tl[1],Ht.br[0],Ht.br[1],Rt.tl[0],Rt.tl[1],Rt.br[0],Rt.br[1],Ht.pixelRatio,Rt.pixelRatio),this.zoomOutPaintVertexArray.emplace(Cr,Ht.tl[0],Ht.tl[1],Ht.br[0],Ht.br[1],tr.tl[0],tr.tl[1],tr.br[0],tr.br[1],Ht.pixelRatio,tr.pixelRatio)}},ba.prototype.upload=function(k){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=k.createVertexBuffer(this.zoomInPaintVertexArray,Y.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=k.createVertexBuffer(this.zoomOutPaintVertexArray,Y.members,this.expression.isStateDependent))},ba.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var _n=function(k,V,ie){this.binders={},this._buffers=[];var xe=[];for(var Ie in k.paint._values)if(ie(Ie)){var qe=k.paint.get(Ie);if(!(!(qe instanceof Il)||!yl(qe.property.specification))){var ht=ln(Ie,k.type),Rt=qe.value,Ht=qe.property.specification.type,tr=qe.property.useIntegerZoom,Cr=qe.property.specification["property-type"],Xr=Cr==="cross-faded"||Cr==="cross-faded-data-driven";if(Rt.kind==="constant")this.binders[Ie]=Xr?new Vt(Rt.value,ht):new or(Rt.value,ht,Ht),xe.push("/u_"+Ie);else if(Rt.kind==="source"||Xr){var Vr=Nn(Ie,Ht,"source");this.binders[Ie]=Xr?new ba(Rt,Ht,tr,V,Vr,k.id):new Dr(Rt,ht,Ht,Vr),xe.push("/a_"+Ie)}else{var pa=Nn(Ie,Ht,"composite");this.binders[Ie]=new Jr(Rt,ht,Ht,tr,V,pa),xe.push("/z_"+Ie)}}}this.cacheKey=xe.sort().join("")};_n.prototype.getMaxValue=function(k){var V=this.binders[k];return V instanceof Dr||V instanceof Jr?V.maxValue:0},_n.prototype.populatePaintArrays=function(k,V,ie,xe,Ie){for(var qe in this.binders){var ht=this.binders[qe];(ht instanceof Dr||ht instanceof Jr||ht instanceof ba)&&ht.populatePaintArray(k,V,ie,xe,Ie)}},_n.prototype.setConstantPatternPositions=function(k,V){for(var ie in this.binders){var xe=this.binders[ie];xe instanceof Vt&&xe.setConstantPatternPositions(k,V)}},_n.prototype.updatePaintArrays=function(k,V,ie,xe,Ie){var qe=!1;for(var ht in k)for(var Rt=V.getPositions(ht),Ht=0,tr=Rt;Ht<tr.length;Ht+=1){var Cr=tr[Ht],Xr=ie.feature(Cr.index);for(var Vr in this.binders){var pa=this.binders[Vr];if((pa instanceof Dr||pa instanceof Jr||pa instanceof ba)&&pa.expression.isStateDependent===!0){var ja=xe.paint.get(Vr);pa.expression=ja.value,pa.updatePaintArray(Cr.start,Cr.end,Xr,k[ht],Ie),qe=!0}}}return qe},_n.prototype.defines=function(){var k=[];for(var V in this.binders){var ie=this.binders[V];(ie instanceof or||ie instanceof Vt)&&k.push.apply(k,ie.uniformNames.map(function(xe){return"#define HAS_UNIFORM_"+xe}))}return k},_n.prototype.getBinderAttributes=function(){var k=[];for(var V in this.binders){var ie=this.binders[V];if(ie instanceof Dr||ie instanceof Jr)for(var xe=0;xe<ie.paintVertexAttributes.length;xe++)k.push(ie.paintVertexAttributes[xe].name);else if(ie instanceof ba)for(var Ie=0;Ie<Y.members.length;Ie++)k.push(Y.members[Ie].name)}return k},_n.prototype.getBinderUniforms=function(){var k=[];for(var V in this.binders){var ie=this.binders[V];if(ie instanceof or||ie instanceof Vt||ie instanceof Jr)for(var xe=0,Ie=ie.uniformNames;xe<Ie.length;xe+=1){var qe=Ie[xe];k.push(qe)}}return k},_n.prototype.getPaintVertexBuffers=function(){return this._buffers},_n.prototype.getUniforms=function(k,V){var ie=[];for(var xe in this.binders){var Ie=this.binders[xe];if(Ie instanceof or||Ie instanceof Vt||Ie instanceof Jr)for(var qe=0,ht=Ie.uniformNames;qe<ht.length;qe+=1){var Rt=ht[qe];if(V[Rt]){var Ht=Ie.getBinding(k,V[Rt],Rt);ie.push({name:Rt,property:xe,binding:Ht})}}}return ie},_n.prototype.setUniforms=function(k,V,ie,xe){for(var Ie=0,qe=V;Ie<qe.length;Ie+=1){var ht=qe[Ie],Rt=ht.name,Ht=ht.property,tr=ht.binding;this.binders[Ht].setUniform(tr,xe,ie.get(Ht),Rt)}},_n.prototype.updatePaintBuffers=function(k){this._buffers=[];for(var V in this.binders){var ie=this.binders[V];if(k&&ie instanceof ba){var xe=k.fromScale===2?ie.zoomInPaintVertexBuffer:ie.zoomOutPaintVertexBuffer;xe&&this._buffers.push(xe)}else(ie instanceof Dr||ie instanceof Jr)&&ie.paintVertexBuffer&&this._buffers.push(ie.paintVertexBuffer)}},_n.prototype.upload=function(k){for(var V in this.binders){var ie=this.binders[V];(ie instanceof Dr||ie instanceof Jr||ie instanceof ba)&&ie.upload(k)}this.updatePaintBuffers()},_n.prototype.destroy=function(){for(var k in this.binders){var V=this.binders[k];(V instanceof Dr||V instanceof Jr||V instanceof ba)&&V.destroy()}};var Xa=function(k,V,ie){ie===void 0&&(ie=function(){return!0}),this.programConfigurations={};for(var xe=0,Ie=k;xe<Ie.length;xe+=1){var qe=Ie[xe];this.programConfigurations[qe.id]=new _n(qe,V,ie)}this.needsUpload=!1,this._featureMap=new $e,this._bufferOffset=0};Xa.prototype.populatePaintArrays=function(k,V,ie,xe,Ie,qe){for(var ht in this.programConfigurations)this.programConfigurations[ht].populatePaintArrays(k,V,xe,Ie,qe);V.id!==void 0&&this._featureMap.add(V.id,ie,this._bufferOffset,k),this._bufferOffset=k,this.needsUpload=!0},Xa.prototype.updatePaintArrays=function(k,V,ie,xe){for(var Ie=0,qe=ie;Ie<qe.length;Ie+=1){var ht=qe[Ie];this.needsUpload=this.programConfigurations[ht.id].updatePaintArrays(k,this._featureMap,V,ht,xe)||this.needsUpload}},Xa.prototype.get=function(k){return this.programConfigurations[k]},Xa.prototype.upload=function(k){if(this.needsUpload){for(var V in this.programConfigurations)this.programConfigurations[V].upload(k);this.needsUpload=!1}},Xa.prototype.destroy=function(){for(var k in this.programConfigurations)this.programConfigurations[k].destroy()};function ln(C,k){var V={"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"]};return V[C]||[C.replace(k+"-","").replace(/-/g,"_")]}function $n(C){var k={"line-pattern":{source:Rn,composite:Rn},"fill-pattern":{source:Rn,composite:Rn},"fill-extrusion-pattern":{source:Rn,composite:Rn}};return k[C]}function Nn(C,k,V){var ie={color:{source:Vn,composite:Ps},number:{source:zn,composite:Vn}},xe=$n(C);return xe&&xe[V]||ie[k][V]}de("ConstantBinder",or),de("CrossFadedConstantBinder",Vt),de("SourceExpressionBinder",Dr),de("CrossFadedCompositeBinder",ba),de("CompositeExpressionBinder",Jr),de("ProgramConfiguration",_n,{omit:["_buffers"]}),de("ProgramConfigurationSet",Xa);var dn=8192,Tn=15,En=Math.pow(2,Tn-1)-1,Gn=-En-1;function ci(C){for(var k=dn/C.extent,V=C.loadGeometry(),ie=0;ie<V.length;ie++)for(var xe=V[ie],Ie=0;Ie<xe.length;Ie++){var qe=xe[Ie],ht=Math.round(qe.x*k),Rt=Math.round(qe.y*k);qe.x=l(ht,Gn,En),qe.y=l(Rt,Gn,En),(ht<qe.x||ht>qe.x+1||Rt<qe.y||Rt>qe.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<Rt.length;ht+=1){var Ht=Rt[ht],tr=Ht.feature,Cr=Ht.id,Xr=Ht.index,Vr=Ht.sourceLayerIndex,pa=this.layers[0]._featureFilter.needGeometry,ja=bo(tr,pa);if(this.layers[0]._featureFilter.filter(new gi(this.zoom),ja,ie)){var Cn=qe?qe.evaluate(ja,{},ie):void 0,un={id:Cr,properties:tr.properties,type:tr.type,sourceLayerIndex:Vr,index:Xr,geometry:pa?ja.geometry:ci(tr),patterns:{},sortKey:Cn};Ie.push(un)}}qe&&Ie.sort(function(io,_o){return io.sortKey-_o.sortKey});for(var ti=0,Un=Ie;ti<Un.length;ti+=1){var ei=Un[ti],li=ei,xi=li.geometry,Vi=li.index,Ni=li.sourceLayerIndex,Mo=k[Vi].feature;this.addFeature(ei,xi,Vi,ie),V.featureIndex.insert(Mo,xi,Vi,Ni,this.index)}},ks.prototype.update=function(k,V,ie){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(k,V,this.stateDependentLayers,ie)},ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ks.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ks.prototype.upload=function(k){this.uploaded||(this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,Cl),this.indexBuffer=k.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(k),this.uploaded=!0},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ks.prototype.addFeature=function(k,V,ie,xe){for(var Ie=0,qe=V;Ie<qe.length;Ie+=1)for(var ht=qe[Ie],Rt=0,Ht=ht;Rt<Ht.length;Rt+=1){var tr=Ht[Rt],Cr=tr.x,Xr=tr.y;if(!(Cr<0||Cr>=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<C.length;V++)if(Ih(k,C[V]))return!0;for(var ie=0;ie<k.length;ie++)if(Ih(C,k[ie]))return!0;return!!Sp(C,k)}function bs(C,k,V){return!!(Ih(C,k)||Vp(k,C,V))}function Hs(C,k){if(C.length===1)return td(k,C[0]);for(var V=0;V<k.length;V++)for(var ie=k[V],xe=0;xe<ie.length;xe++)if(Ih(C,ie[xe]))return!0;for(var Ie=0;Ie<C.length;Ie++)if(td(k,C[Ie]))return!0;for(var qe=0;qe<k.length;qe++)if(Sp(C,k[qe]))return!0;return!1}function pu(C,k,V){for(var ie=0;ie<k.length;ie++){var xe=k[ie];if(C.length>=3){for(var Ie=0;Ie<xe.length;Ie++)if(Ih(C,xe[Ie]))return!0}if(Ap(C,xe,V))return!0}return!1}function Ap(C,k,V){if(C.length>1){if(Sp(C,k))return!0;for(var ie=0;ie<k.length;ie++)if(Vp(k[ie],C,V))return!0}for(var xe=0;xe<C.length;xe++)if(Vp(C[xe],k,V))return!0;return!1}function Sp(C,k){if(C.length===0||k.length===0)return!1;for(var V=0;V<C.length-1;V++)for(var ie=C[V],xe=C[V+1],Ie=0;Ie<k.length-1;Ie++){var qe=k[Ie],ht=k[Ie+1];if(Ph(ie,xe,qe,ht))return!0}return!1}function Ph(C,k,V,ie){return W(C,V,ie)!==W(k,V,ie)&&W(C,k,V)!==W(C,k,ie)}function Vp(C,k,V){var ie=V*V;if(k.length===1)return C.distSqr(k[0])<ie;for(var xe=1;xe<k.length;xe++){var Ie=k[xe-1],qe=k[xe];if(Vd(C,Ie,qe)<ie)return!0}return!1}function Vd(C,k,V){var ie=k.distSqr(V);if(ie===0)return C.distSqr(k);var xe=((C.x-k.x)*(V.x-k.x)+(C.y-k.y)*(V.y-k.y))/ie;return xe<0?C.distSqr(k):xe>1?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;qe<C.length;qe++){ie=C[qe];for(var ht=0,Rt=ie.length-1;ht<ie.length;Rt=ht++)xe=ie[ht],Ie=ie[Rt],xe.y>k.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;ie<C.length;xe=ie++){var Ie=C[ie],qe=C[xe];Ie.y>k.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<qe.length;Ie+=1){var ht=qe[Ie];if(k<=ht.x&&V<=ht.y&&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;Ht<tr.length;Ht+=1){var Cr=tr[Ht];if(Ih(C,Cr))return!0}for(var Xr=0;Xr<C.length-1;Xr++){var Vr=C[Xr],pa=C[Xr+1];if(Kh(Vr,pa,Rt))return!0}return!1}function Kh(C,k,V){var ie=V[0],xe=V[2];if(C.x<ie.x&&k.x<ie.x||C.x>xe.x&&k.x>xe.x||C.y<ie.y&&k.y<ie.y||C.y>xe.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;ht<C.length;ht++){var Rt=C[ht];qe.push(Rt.sub(Ie))}return qe}var Ep=new xa({"circle-sort-key":new Yt(jn.layout_circle["circle-sort-key"])}),kv=new xa({"circle-radius":new Yt(jn.paint_circle["circle-radius"]),"circle-color":new Yt(jn.paint_circle["circle-color"]),"circle-blur":new Yt(jn.paint_circle["circle-blur"]),"circle-opacity":new Yt(jn.paint_circle["circle-opacity"]),"circle-translate":new nt(jn.paint_circle["circle-translate"]),"circle-translate-anchor":new nt(jn.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new nt(jn.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new nt(jn.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yt(jn.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yt(jn.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yt(jn.paint_circle["circle-stroke-opacity"])}),qd={paint:kv,layout:Ep},Vf=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var C=arguments,k=0,V=arguments.length;V--;)k+=C[V]*C[V];return Math.sqrt(k)});function Gd(){var C=new Vf(4);return Vf!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C}function Lv(C,k,V){var ie=k[0],xe=k[1],Ie=k[2],qe=k[3],ht=Math.sin(V),Rt=Math.cos(V);return C[0]=ie*Rt+Ie*ht,C[1]=xe*Rt+qe*ht,C[2]=ie*-ht+Ie*Rt,C[3]=xe*-ht+qe*Rt,C}function ch(){var C=new Vf(9);return Vf!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[5]=0,C[6]=0,C[7]=0),C[0]=1,C[4]=1,C[8]=1,C}function nv(C,k){var V=Math.sin(k),ie=Math.cos(k);return C[0]=ie,C[1]=V,C[2]=0,C[3]=-V,C[4]=ie,C[5]=0,C[6]=0,C[7]=0,C[8]=1,C}function nm(){var C=new Vf(16);return Vf!=Float32Array&&(C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=0,C[12]=0,C[13]=0,C[14]=0),C[0]=1,C[5]=1,C[10]=1,C[15]=1,C}function im(C){var k=new Vf(16);return k[0]=C[0],k[1]=C[1],k[2]=C[2],k[3]=C[3],k[4]=C[4],k[5]=C[5],k[6]=C[6],k[7]=C[7],k[8]=C[8],k[9]=C[9],k[10]=C[10],k[11]=C[11],k[12]=C[12],k[13]=C[13],k[14]=C[14],k[15]=C[15],k}function Pv(C){return C[0]=1,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=1,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=1,C[11]=0,C[12]=0,C[13]=0,C[14]=0,C[15]=1,C}function iv(C,k){var V=k[0],ie=k[1],xe=k[2],Ie=k[3],qe=k[4],ht=k[5],Rt=k[6],Ht=k[7],tr=k[8],Cr=k[9],Xr=k[10],Vr=k[11],pa=k[12],ja=k[13],Cn=k[14],un=k[15],ti=V*ht-ie*qe,Un=V*Rt-xe*qe,ei=V*Ht-Ie*qe,li=ie*Rt-xe*ht,xi=ie*Ht-Ie*ht,Vi=xe*Ht-Ie*Rt,Ni=tr*ja-Cr*pa,Mo=tr*Cn-Xr*pa,io=tr*un-Vr*pa,_o=Cr*Cn-Xr*ja,Ms=Cr*un-Vr*ja,Eo=Xr*un-Vr*Cn,Ro=ti*Eo-Un*Ms+ei*_o+li*io-xi*Mo+Vi*Ni;return Ro?(Ro=1/Ro,C[0]=(ht*Eo-Rt*Ms+Ht*_o)*Ro,C[1]=(xe*Ms-ie*Eo-Ie*_o)*Ro,C[2]=(ja*Vi-Cn*xi+un*li)*Ro,C[3]=(Xr*xi-Cr*Vi-Vr*li)*Ro,C[4]=(Rt*io-qe*Eo-Ht*Mo)*Ro,C[5]=(V*Eo-xe*io+Ie*Mo)*Ro,C[6]=(Cn*ei-pa*Vi-un*Un)*Ro,C[7]=(tr*Vi-Xr*ei+Vr*Un)*Ro,C[8]=(qe*Ms-ht*io+Ht*Ni)*Ro,C[9]=(ie*io-V*Ms-Ie*Ni)*Ro,C[10]=(pa*xi-ja*ei+un*ti)*Ro,C[11]=(Cr*ei-tr*xi-Vr*ti)*Ro,C[12]=(ht*Mo-qe*_o-Rt*Ni)*Ro,C[13]=(V*_o-ie*Mo+xe*Ni)*Ro,C[14]=(ja*Un-pa*li-Cn*ti)*Ro,C[15]=(tr*li-Cr*Un+Xr*ti)*Ro,C):null}function ov(C,k,V){var ie=k[0],xe=k[1],Ie=k[2],qe=k[3],ht=k[4],Rt=k[5],Ht=k[6],tr=k[7],Cr=k[8],Xr=k[9],Vr=k[10],pa=k[11],ja=k[12],Cn=k[13],un=k[14],ti=k[15],Un=V[0],ei=V[1],li=V[2],xi=V[3];return C[0]=Un*ie+ei*ht+li*Cr+xi*ja,C[1]=Un*xe+ei*Rt+li*Xr+xi*Cn,C[2]=Un*Ie+ei*Ht+li*Vr+xi*un,C[3]=Un*qe+ei*tr+li*pa+xi*ti,Un=V[4],ei=V[5],li=V[6],xi=V[7],C[4]=Un*ie+ei*ht+li*Cr+xi*ja,C[5]=Un*xe+ei*Rt+li*Xr+xi*Cn,C[6]=Un*Ie+ei*Ht+li*Vr+xi*un,C[7]=Un*qe+ei*tr+li*pa+xi*ti,Un=V[8],ei=V[9],li=V[10],xi=V[11],C[8]=Un*ie+ei*ht+li*Cr+xi*ja,C[9]=Un*xe+ei*Rt+li*Xr+xi*Cn,C[10]=Un*Ie+ei*Ht+li*Vr+xi*un,C[11]=Un*qe+ei*tr+li*pa+xi*ti,Un=V[12],ei=V[13],li=V[14],xi=V[15],C[12]=Un*ie+ei*ht+li*Cr+xi*ja,C[13]=Un*xe+ei*Rt+li*Xr+xi*Cn,C[14]=Un*Ie+ei*Ht+li*Vr+xi*un,C[15]=Un*qe+ei*tr+li*pa+xi*ti,C}function cc(C,k,V){var ie=V[0],xe=V[1],Ie=V[2],qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un;return k===C?(C[12]=k[0]*ie+k[4]*xe+k[8]*Ie+k[12],C[13]=k[1]*ie+k[5]*xe+k[9]*Ie+k[13],C[14]=k[2]*ie+k[6]*xe+k[10]*Ie+k[14],C[15]=k[3]*ie+k[7]*xe+k[11]*Ie+k[15]):(qe=k[0],ht=k[1],Rt=k[2],Ht=k[3],tr=k[4],Cr=k[5],Xr=k[6],Vr=k[7],pa=k[8],ja=k[9],Cn=k[10],un=k[11],C[0]=qe,C[1]=ht,C[2]=Rt,C[3]=Ht,C[4]=tr,C[5]=Cr,C[6]=Xr,C[7]=Vr,C[8]=pa,C[9]=ja,C[10]=Cn,C[11]=un,C[12]=qe*ie+tr*xe+pa*Ie+k[12],C[13]=ht*ie+Cr*xe+ja*Ie+k[13],C[14]=Rt*ie+Xr*xe+Cn*Ie+k[14],C[15]=Ht*ie+Vr*xe+un*Ie+k[15]),C}function lu(C,k,V){var ie=V[0],xe=V[1],Ie=V[2];return C[0]=k[0]*ie,C[1]=k[1]*ie,C[2]=k[2]*ie,C[3]=k[3]*ie,C[4]=k[4]*xe,C[5]=k[5]*xe,C[6]=k[6]*xe,C[7]=k[7]*xe,C[8]=k[8]*Ie,C[9]=k[9]*Ie,C[10]=k[10]*Ie,C[11]=k[11]*Ie,C[12]=k[12],C[13]=k[13],C[14]=k[14],C[15]=k[15],C}function Dh(C,k,V){var ie=Math.sin(V),xe=Math.cos(V),Ie=k[4],qe=k[5],ht=k[6],Rt=k[7],Ht=k[8],tr=k[9],Cr=k[10],Xr=k[11];return k!==C&&(C[0]=k[0],C[1]=k[1],C[2]=k[2],C[3]=k[3],C[12]=k[12],C[13]=k[13],C[14]=k[14],C[15]=k[15]),C[4]=Ie*xe+Ht*ie,C[5]=qe*xe+tr*ie,C[6]=ht*xe+Cr*ie,C[7]=Rt*xe+Xr*ie,C[8]=Ht*xe-Ie*ie,C[9]=tr*xe-qe*ie,C[10]=Cr*xe-ht*ie,C[11]=Xr*xe-Rt*ie,C}function Iv(C,k,V){var ie=Math.sin(V),xe=Math.cos(V),Ie=k[0],qe=k[1],ht=k[2],Rt=k[3],Ht=k[4],tr=k[5],Cr=k[6],Xr=k[7];return k!==C&&(C[8]=k[8],C[9]=k[9],C[10]=k[10],C[11]=k[11],C[12]=k[12],C[13]=k[13],C[14]=k[14],C[15]=k[15]),C[0]=Ie*xe+Ht*ie,C[1]=qe*xe+tr*ie,C[2]=ht*xe+Cr*ie,C[3]=Rt*xe+Xr*ie,C[4]=Ht*xe-Ie*ie,C[5]=tr*xe-qe*ie,C[6]=Cr*xe-ht*ie,C[7]=Xr*xe-Rt*ie,C}function om(C,k,V,ie,xe){var Ie=1/Math.tan(k/2),qe;return C[0]=Ie/V,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=Ie,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[11]=-1,C[12]=0,C[13]=0,C[15]=0,xe!=null&&xe!==1/0?(qe=1/(ie-xe),C[10]=(xe+ie)*qe,C[14]=2*xe*ie*qe):(C[10]=-1,C[14]=-2*ie),C}function Au(C,k,V,ie,xe,Ie,qe){var ht=1/(k-V),Rt=1/(ie-xe),Ht=1/(Ie-qe);return C[0]=-2*ht,C[1]=0,C[2]=0,C[3]=0,C[4]=0,C[5]=-2*Rt,C[6]=0,C[7]=0,C[8]=0,C[9]=0,C[10]=2*Ht,C[11]=0,C[12]=(k+V)*ht,C[13]=(xe+ie)*Rt,C[14]=(qe+Ie)*Ht,C[15]=1,C}var xg=ov;function sv(){var C=new Vf(3);return Vf!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0),C}function _0(C){var k=new Vf(3);return k[0]=C[0],k[1]=C[1],k[2]=C[2],k}function Cp(C,k,V){return C[0]=k[0]+V[0],C[1]=k[1]+V[1],C[2]=k[2]+V[2],C}function lv(C,k,V){return C[0]=k[0]-V[0],C[1]=k[1]-V[1],C[2]=k[2]-V[2],C}function x0(C,k,V){return C[0]=k[0]*V,C[1]=k[1]*V,C[2]=k[2]*V,C}function bg(C,k){var V=k[0],ie=k[1],xe=k[2],Ie=V*V+ie*ie+xe*xe;return Ie>0&&(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;ht<Rt;ht+=V)C[0]=k[ht],C[1]=k[ht+1],C[2]=k[ht+2],Ie(C,C,qe),k[ht]=C[0],k[ht+1]=C[1],k[ht+2]=C[2];return k}}();function GT(){var C=new Vf(4);return Vf!=Float32Array&&(C[0]=0,C[1]=0,C[2]=0,C[3]=0),C}function HT(C,k,V){return C[0]=k[0]*V,C[1]=k[1]*V,C[2]=k[2]*V,C[3]=k[3]*V,C}function WT(C,k){return C[0]*k[0]+C[1]*k[1]+C[2]*k[2]+C[3]*k[3]}function Rv(C,k,V){var ie=k[0],xe=k[1],Ie=k[2],qe=k[3];return C[0]=V[0]*ie+V[4]*xe+V[8]*Ie+V[12]*qe,C[1]=V[1]*ie+V[5]*xe+V[9]*Ie+V[13]*qe,C[2]=V[2]*ie+V[6]*xe+V[10]*Ie+V[14]*qe,C[3]=V[3]*ie+V[7]*xe+V[11]*Ie+V[15]*qe,C}var wg=function(){var C=GT();return function(k,V,ie,xe,Ie,qe){var ht,Rt;for(V||(V=4),ie||(ie=0),xe?Rt=Math.min(xe*V+ie,k.length):Rt=k.length,ht=ie;ht<Rt;ht+=V)C[0]=k[ht],C[1]=k[ht+1],C[2]=k[ht+2],C[3]=k[ht+3],Ie(C,C,qe),k[ht]=C[0],k[ht+1]=C[1],k[ht+2]=C[2],k[ht+3]=C[3];return k}}();function kx(){var C=new Vf(2);return Vf!=Float32Array&&(C[0]=0,C[1]=0),C}function P1(C){var k=C[0],V=C[1];return k*k+V*V}var I1=P1,vk=function(){var C=kx();return function(k,V,ie,xe,Ie,qe){var ht,Rt;for(V||(V=2),ie||(ie=0),xe?Rt=Math.min(xe*V+ie,k.length):Rt=k.length,ht=ie;ht<Rt;ht+=V)C[0]=k[ht],C[1]=k[ht+1],Ie(C,C,qe),k[ht]=C[0],k[ht+1]=C[1];return k}}(),XT=function(C){function k(V){C.call(this,V,qd)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.createBucket=function(ie){return new ks(ie)},k.prototype.queryRadius=function(ie){var xe=ie;return Rh("circle-radius",this,xe)+Rh("circle-stroke-width",this,xe)+Mp(this.paint.get("circle-translate"))},k.prototype.queryIntersectsFeature=function(ie,xe,Ie,qe,ht,Rt,Ht,tr){for(var Cr=qp(ie,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Rt.angle,Ht),Xr=this.paint.get("circle-radius").evaluate(xe,Ie),Vr=this.paint.get("circle-stroke-width").evaluate(xe,Ie),pa=Xr+Vr,ja=this.paint.get("circle-pitch-alignment")==="map",Cn=ja?Cr:Px(Cr,tr),un=ja?pa*Ht:pa,ti=0,Un=qe;ti<Un.length;ti+=1)for(var ei=Un[ti],li=0,xi=ei;li<xi.length;li+=1){var Vi=xi[li],Ni=ja?Vi:Lx(Vi,tr),Mo=un,io=Rv([],[Vi.x,Vi.y,0,1],tr);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Mo*=io[3]/Rt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Mo*=Rt.cameraToCenterDistance/io[3]),bs(Cn,Ni,Mo))return!0}return!1},k}(Ja);function Lx(C,k){var V=Rv([],[C.x,C.y,0,1],k);return new n(V[0]/V[3],V[1]/V[3])}function Px(C,k){return C.map(function(V){return Lx(V,k)})}var R1=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}(ks);de("HeatmapBucket",R1,{omit:["layers"]});function zh(C,k,V,ie){var xe=k.width,Ie=k.height;if(!ie)ie=new Uint8Array(xe*Ie*V);else if(ie instanceof Uint8ClampedArray)ie=new Uint8Array(ie.buffer);else if(ie.length!==xe*Ie*V)throw new RangeError("mismatched image size");return C.width=xe,C.height=Ie,C.data=ie,C}function b0(C,k,V){var ie=k.width,xe=k.height;if(!(ie===C.width&&xe===C.height)){var Ie=zh({},{width:ie,height:xe},V);w0(C,Ie,{x:0,y:0},{x:0,y:0},{width:Math.min(C.width,ie),height:Math.min(C.height,xe)},V),C.width=ie,C.height=xe,C.data=Ie.data}}function w0(C,k,V,ie,xe,Ie){if(xe.width===0||xe.height===0)return k;if(xe.width>C.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;Rt<xe.height;Rt++)for(var Ht=((V.y+Rt)*C.width+V.x)*Ie,tr=((ie.y+Rt)*k.width+ie.x)*Ie,Cr=0;Cr<xe.width*Ie;Cr++)ht[tr+Cr]=qe[Ht+Cr];return k}var kp=function(k,V){zh(this,k,1,V)};kp.prototype.resize=function(k){b0(this,k,1)},kp.prototype.clone=function(){return new kp({width:this.width,height:this.height},new Uint8Array(this.data))},kp.copy=function(k,V,ie,xe,Ie){w0(k,V,ie,xe,Ie,1)};var $f=function(k,V){zh(this,k,4,V)};$f.prototype.resize=function(k){b0(this,k,4)},$f.prototype.replace=function(k,V){V?this.data.set(k):k instanceof Uint8ClampedArray?this.data=new Uint8Array(k.buffer):this.data=k},$f.prototype.clone=function(){return new $f({width:this.width,height:this.height},new Uint8Array(this.data))},$f.copy=function(k,V,ie,xe,Ie){w0(k,V,ie,xe,Ie,4)},de("AlphaImage",kp),de("RGBAImage",$f);var Tg=new xa({"heatmap-radius":new Yt(jn.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yt(jn.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new nt(jn.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Aa(jn.paint_heatmap["heatmap-color"]),"heatmap-opacity":new nt(jn.paint_heatmap["heatmap-opacity"])}),sm={paint:Tg};function Ag(C){var k={},V=C.resolution||256,ie=C.clips?C.clips.length:1,xe=C.image||new $f({width:V,height:ie}),Ie=function(ti,Un,ei){k[C.evaluationKey]=ei;var li=C.expression.evaluate(k);xe.data[ti+Un+0]=Math.floor(li.r*255/li.a),xe.data[ti+Un+1]=Math.floor(li.g*255/li.a),xe.data[ti+Un+2]=Math.floor(li.b*255/li.a),xe.data[ti+Un+3]=Math.floor(li.a*255)};if(C.clips)for(var Ht=0,tr=0;Ht<ie;++Ht,tr+=V*4)for(var Cr=0,Xr=0;Cr<V;Cr++,Xr+=4){var Vr=Cr/(V-1),pa=C.clips[Ht],ja=pa.start,Cn=pa.end,un=ja*(1-Vr)+Cn*Vr;Ie(tr,Xr,un)}else for(var qe=0,ht=0;qe<V;qe++,ht+=4){var Rt=qe/(V-1);Ie(0,ht,Rt)}return xe}var T0=function(C){function k(V){C.call(this,V,sm),this._updateColorRamp()}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.createBucket=function(ie){return new R1(ie)},k.prototype._handleSpecialPaintPropertyUpdate=function(ie){ie==="heatmap-color"&&this._updateColorRamp()},k.prototype._updateColorRamp=function(){var ie=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ag({expression:ie,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},k.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},k.prototype.queryRadius=function(){return 0},k.prototype.queryIntersectsFeature=function(){return!1},k.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},k}(Ja),ZT=new xa({"hillshade-illumination-direction":new nt(jn.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new nt(jn.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new nt(jn.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new nt(jn.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new nt(jn.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new nt(jn.paint_hillshade["hillshade-accent-color"])}),YT={paint:ZT},Ix=function(C){function k(V){C.call(this,V,YT)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},k}(Ja),Rx=Ln([{name:"a_pos",components:2,type:"Int16"}],4),KT=Rx.members,A0=lm,Dx=lm;function lm(C,k,V){V=V||2;var ie=k&&k.length,xe=ie?k[0]*V:C.length,Ie=S0(C,0,xe,V,!0),qe=[];if(!Ie||Ie.next===Ie.prev)return qe;var ht,Rt,Ht,tr,Cr,Xr,Vr;if(ie&&(Ie=cv(C,k,Ie,V)),C.length>80*V){ht=Ht=C[0],Rt=tr=C[1];for(var pa=V;pa<xe;pa+=V)Cr=C[pa],Xr=C[pa+1],Cr<ht&&(ht=Cr),Xr<Rt&&(Rt=Xr),Cr>Ht&&(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<V;Ie+=ie)qe=Nx(Ie,C[Ie],C[Ie+1],qe);else for(Ie=V-ie;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.x<Ie.x?xe.x<qe.x?xe.x:qe.x:Ie.x<qe.x?Ie.x:qe.x,Rt=xe.y<Ie.y?xe.y<qe.y?xe.y:qe.y:Ie.y<qe.y?Ie.y:qe.y,Ht=xe.x>Ie.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<qe;Ie++)ht=k[Ie]*ie,Rt=Ie<qe-1?k[Ie+1]*ie:C.length,Ht=S0(C,ht,Rt,ie,!1),Ht===Ht.next&&(Ht.steiner=!0),xe.push(O1(Ht));for(xe.sort(Ox),Ie=0;Ie<xe.length;Ie++)D1(xe[Ie],V),V=uv(V,V.next);return V}function Ox(C,k){return C.x-k.x}function D1(C,k){if(k=JT(C,k),k){var V=B1(k,C);uv(k,k.next),uv(V,V.next)}}function JT(C,k){var V=k,ie=C.x,xe=C.y,Ie=-1/0,qe;do{if(xe<=V.y&&xe>=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.next.x?V:V.next}}V=V.next}while(V!==k);if(!qe)return null;if(ie===Ie)return qe;var Rt=qe,Ht=qe.x,tr=qe.y,Cr=1/0,Xr;V=qe;do ie>=V.x&&V.x>=Ht&&ie!==V.x&&fv(xe<tr?ie:Ie,xe,Ht,tr,xe<tr?Ie:ie,xe,V.x,V.y)&&(Xr=Math.abs(xe-V.y)/(ie-V.x),kg(V,C)&&(Xr<Cr||Xr===Cr&&(V.x>qe.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;k<Ht&&(ht++,ie=ie.nextZ,!!ie);k++);for(Rt=Ht;ht>0||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<V.x||k.x===V.x&&k.y<V.y)&&(V=k),k=k.next;while(k!==C);return V}function fv(C,k,V,ie,xe,Ie,qe,ht){return(xe-qe)*(k-ht)-(C-qe)*(Ie-ht)>=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;ht<Rt;ht++){var Ht=k[ht]*V,tr=ht<Rt-1?k[ht+1]*V:C.length;qe-=Math.abs(U1(C,Ht,tr,V))}var Cr=0;for(ht=0;ht<ie.length;ht+=3){var Xr=ie[ht]*V,Vr=ie[ht+1]*V,pa=ie[ht+2]*V;Cr+=Math.abs((C[Xr]-C[pa])*(C[Vr+1]-C[Xr+1])-(C[Xr]-C[Vr])*(C[pa+1]-C[Xr+1]))}return qe===0&&Cr===0?0:Math.abs((Cr-qe)/qe)};function U1(C,k,V,ie){for(var xe=0,Ie=k,qe=V-ie;Ie<V;Ie+=ie)xe+=(C[qe]-C[Ie])*(C[Ie+1]+C[qe+1]),qe=Ie;return xe}lm.flatten=function(C){for(var k=C[0][0].length,V={vertices:[],holes:[],dimensions:k},ie=0,xe=0;xe<C.length;xe++){for(var Ie=0;Ie<C[xe].length;Ie++)for(var qe=0;qe<k;qe++)V.vertices.push(C[xe][Ie][qe]);xe>0&&(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);Vr<pa;){for(cm(C,Vr,pa),Vr++,pa--;xe(C[Vr],Xr)<0;)Vr++;for(;xe(C[pa],Xr)>0;)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 C<k?-1:C>k?1:0}function C0(C,k){var V=C.length;if(V<=1)return[C];for(var ie=[],xe,Ie,qe=0;qe<V;qe++){var ht=Q(C[qe]);ht!==0&&(C[qe].area=Math.abs(ht),Ie===void 0&&(Ie=ht<0),Ie===ht<0?(xe&&ie.push(xe),xe=[C[qe]]):xe.push(C[qe]))}if(xe&&ie.push(xe),k>1)for(var Rt=0;Rt<ie.length;Rt++)ie[Rt].length<=k||(j1(ie[Rt],k,1,ie[Rt].length-1,jx),ie[Rt]=ie[Rt].slice(0,k));return ie}function jx(C,k){return k.area-C.area}function k0(C,k,V){for(var ie=V.patternDependencies,xe=!1,Ie=0,qe=k;Ie<qe.length;Ie+=1){var ht=qe[Ie],Rt=ht.paint.get(C+"-pattern");Rt.isConstant()||(xe=!0);var Ht=Rt.constantOr(null);Ht&&(xe=!0,ie[Ht.to]=!0,ie[Ht.from]=!0)}return xe}function Pg(C,k,V,ie,xe){for(var Ie=xe.patternDependencies,qe=0,ht=k;qe<ht.length;qe+=1){var Rt=ht[qe],Ht=Rt.paint.get(C+"-pattern"),tr=Ht.value;if(tr.kind!=="constant"){var Cr=tr.evaluate({zoom:ie-1},V,{},xe.availableImages),Xr=tr.evaluate({zoom:ie},V,{},xe.availableImages),Vr=tr.evaluate({zoom:ie+1},V,{},xe.availableImages);Cr=Cr&&Cr.name?Cr.name:Cr,Xr=Xr&&Xr.name?Xr.name:Xr,Vr=Vr&&Vr.name?Vr.name:Vr,Ie[Cr]=!0,Ie[Xr]=!0,Ie[Vr]=!0,V.patterns[Rt.id]={min:Cr,mid:Xr,max:Vr}}}return V}var Ig=500,ad=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.patternFeatures=[],this.layoutVertexArray=new Ea,this.indexArray=new Jn,this.indexArray2=new Ri,this.programConfigurations=new Xa(k.layers,k.zoom),this.segments=new Lo,this.segments2=new Lo,this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};ad.prototype.populate=function(k,V,ie){this.hasPattern=k0("fill",this.layers,V);for(var xe=this.layers[0].layout.get("fill-sort-key"),Ie=[],qe=0,ht=k;qe<ht.length;qe+=1){var Rt=ht[qe],Ht=Rt.feature,tr=Rt.id,Cr=Rt.index,Xr=Rt.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,pa=bo(Ht,Vr);if(this.layers[0]._featureFilter.filter(new gi(this.zoom),pa,ie)){var ja=xe?xe.evaluate(pa,{},ie,V.availableImages):void 0,Cn={id:tr,properties:Ht.properties,type:Ht.type,sourceLayerIndex:Xr,index:Cr,geometry:Vr?pa.geometry:ci(Ht),patterns:{},sortKey:ja};Ie.push(Cn)}}xe&&Ie.sort(function(io,_o){return io.sortKey-_o.sortKey});for(var un=0,ti=Ie;un<ti.length;un+=1){var Un=ti[un],ei=Un,li=ei.geometry,xi=ei.index,Vi=ei.sourceLayerIndex;if(this.hasPattern){var Ni=Pg("fill",this.layers,Un,this.zoom,V);this.patternFeatures.push(Ni)}else this.addFeature(Un,li,xi,ie,{});var Mo=k[xi].feature;V.featureIndex.insert(Mo,li,xi,Vi,this.index)}},ad.prototype.update=function(k,V,ie){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(k,V,this.stateDependentLayers,ie)},ad.prototype.addFeatures=function(k,V,ie){for(var xe=0,Ie=this.patternFeatures;xe<Ie.length;xe+=1){var qe=Ie[xe];this.addFeature(qe,qe.geometry,qe.index,V,ie)}},ad.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ad.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ad.prototype.upload=function(k){this.uploaded||(this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,KT),this.indexBuffer=k.createIndexBuffer(this.indexArray),this.indexBuffer2=k.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(k),this.uploaded=!0},ad.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ad.prototype.addFeature=function(k,V,ie,xe,Ie){for(var qe=0,ht=C0(V,Ig);qe<ht.length;qe+=1){for(var Rt=ht[qe],Ht=0,tr=0,Cr=Rt;tr<Cr.length;tr+=1){var Xr=Cr[tr];Ht+=Xr.length}for(var Vr=this.segments.prepareSegment(Ht,this.layoutVertexArray,this.indexArray),pa=Vr.vertexLength,ja=[],Cn=[],un=0,ti=Rt;un<ti.length;un+=1){var Un=ti[un];if(Un.length!==0){Un!==Rt[0]&&Cn.push(ja.length/2);var ei=this.segments2.prepareSegment(Un.length,this.layoutVertexArray,this.indexArray2),li=ei.vertexLength;this.layoutVertexArray.emplaceBack(Un[0].x,Un[0].y),this.indexArray2.emplaceBack(li+Un.length-1,li),ja.push(Un[0].x),ja.push(Un[0].y);for(var xi=1;xi<Un.length;xi++)this.layoutVertexArray.emplaceBack(Un[xi].x,Un[xi].y),this.indexArray2.emplaceBack(li+xi-1,li+xi),ja.push(Un[xi].x),ja.push(Un[xi].y);ei.vertexLength+=Un.length,ei.primitiveLength+=Un.length}}for(var Vi=A0(ja,Cn),Ni=0;Ni<Vi.length;Ni+=3)this.indexArray.emplaceBack(pa+Vi[Ni],pa+Vi[Ni+1],pa+Vi[Ni+2]);Vr.vertexLength+=Ht,Vr.primitiveLength+=Vi.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,k,ie,Ie,xe)},de("FillBucket",ad,{omit:["layers","patternFeatures"]});var V1=new xa({"fill-sort-key":new Yt(jn.layout_fill["fill-sort-key"])}),Vx=new xa({"fill-antialias":new nt(jn.paint_fill["fill-antialias"]),"fill-opacity":new Yt(jn.paint_fill["fill-opacity"]),"fill-color":new Yt(jn.paint_fill["fill-color"]),"fill-outline-color":new Yt(jn.paint_fill["fill-outline-color"]),"fill-translate":new nt(jn.paint_fill["fill-translate"]),"fill-translate-anchor":new nt(jn.paint_fill["fill-translate-anchor"]),"fill-pattern":new cr(jn.paint_fill["fill-pattern"])}),Gp={paint:Vx,layout:V1},Rg=function(C){function k(V){C.call(this,V,Gp)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.recalculate=function(ie,xe){C.prototype.recalculate.call(this,ie,xe);var Ie=this.paint._values["fill-outline-color"];Ie.value.kind==="constant"&&Ie.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},k.prototype.createBucket=function(ie){return new ad(ie)},k.prototype.queryRadius=function(){return Mp(this.paint.get("fill-translate"))},k.prototype.queryIntersectsFeature=function(ie,xe,Ie,qe,ht,Rt,Ht){var tr=qp(ie,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Rt.angle,Ht);return Hs(tr,qe)},k.prototype.isTileClipped=function(){return!0},k}(Ja),qx=Ln([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Gx=qx.members,q1=zv;function zv(C,k,V,ie,xe){this.properties={},this.extent=V,this.type=0,this._pbf=C,this._geometry=-1,this._keys=ie,this._values=xe,C.readFields(Hx,this,k)}function Hx(C,k,V){C==1?k.id=V.readVarint():C==2?Wx(V,k):C==3?k.type=V.readVarint():C==4&&(k._geometry=V.pos)}function Wx(C,k){for(var V=C.readVarint()+C.pos;C.pos<V;){var ie=k._keys[C.readVarint()],xe=k._values[C.readVarint()];k.properties[ie]=xe}}zv.types=["Unknown","Point","LineString","Polygon"],zv.prototype.loadGeometry=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=[],ht;C.pos<k;){if(ie<=0){var Rt=C.readVarint();V=Rt&7,ie=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<k;){if(ie<=0){var tr=C.readVarint();V=tr&7,ie=tr>>3}if(ie--,V===1||V===2)xe+=C.readSVarint(),Ie+=C.readSVarint(),xe<qe&&(qe=xe),xe>ht&&(ht=xe),Ie<Rt&&(Rt=Ie),Ie>Ht&&(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<Vr.length;pa++){var ja=Vr[pa],Cn=180-(ja.y+Ie)*360/ie;Vr[pa]=[(ja.x+xe)*360/ie-180,360/Math.PI*Math.atan(Math.exp(Cn*Math.PI/180))-90]}}switch(this.type){case 1:var Cr=[];for(Rt=0;Rt<qe.length;Rt++)Cr[Rt]=qe[Rt][0];qe=Cr,tr(qe);break;case 2:for(Rt=0;Rt<qe.length;Rt++)tr(qe[Rt]);break;case 3:for(qe=eA(qe),Rt=0;Rt<qe.length;Rt++)for(Ht=0;Ht<qe[Rt].length;Ht++)tr(qe[Rt][Ht]);break}qe.length===1?qe=qe[0]:ht="Multi"+ht;var Xr={type:"Feature",geometry:{type:ht,coordinates:qe},properties:this.properties};return"id"in this&&(Xr.id=this.id),Xr};function eA(C){var k=C.length;if(k<=1)return[C];for(var V=[],ie,xe,Ie=0;Ie<k;Ie++){var qe=Xx(C[Ie]);qe!==0&&(xe===void 0&&(xe=qe<0),xe===qe<0?(ie&&V.push(ie),ie=[C[Ie]]):ie.push(C[Ie]))}return ie&&V.push(ie),V}function Xx(C){for(var k=0,V=0,ie=C.length,xe=ie-1,Ie,qe;V<ie;xe=V++)Ie=C[V],qe=C[xe],k+=(qe.x-Ie.x)*(Ie.y+qe.y);return k}var Wd=G1;function G1(C,k){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=C,this._keys=[],this._values=[],this._features=[],C.readFields(Zx,this,k),this.length=this._features.length}function Zx(C,k,V){C===15?k.version=V.readVarint():C===1?k.name=V.readString():C===5?k.extent=V.readVarint():C===2?k._features.push(V.pos):C===3?k._keys.push(V.readString()):C===4&&k._values.push(Yx(V))}function Yx(C){for(var k=null,V=C.readVarint()+C.pos;C.pos<V;){var ie=C.readVarint()>>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<Ie.length;xe+=1){var qe=Ie[xe],ht=qe.feature,Rt=qe.id,Ht=qe.index,tr=qe.sourceLayerIndex,Cr=this.layers[0]._featureFilter.needGeometry,Xr=bo(ht,Cr);if(this.layers[0]._featureFilter.filter(new gi(this.zoom),Xr,ie)){var Vr={id:Rt,sourceLayerIndex:tr,index:Ht,geometry:Cr?Xr.geometry:ci(ht),properties:ht.properties,type:ht.type,patterns:{}};this.hasPattern?this.features.push(Pg("fill-extrusion",this.layers,Vr,this.zoom,V)):this.addFeature(Vr,Vr.geometry,Ht,ie,{}),V.featureIndex.insert(ht,Vr.geometry,Ht,tr,this.index,!0)}}},fd.prototype.addFeatures=function(k,V,ie){for(var xe=0,Ie=this.features;xe<Ie.length;xe+=1){var qe=Ie[xe],ht=qe.geometry;this.addFeature(qe,ht,qe.index,V,ie)}},fd.prototype.update=function(k,V,ie){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(k,V,this.stateDependentLayers,ie)},fd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},fd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fd.prototype.upload=function(k){this.uploaded||(this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,Gx),this.indexBuffer=k.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(k),this.uploaded=!0},fd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},fd.prototype.addFeature=function(k,V,ie,xe,Ie){for(var qe=0,ht=C0(V,L0);qe<ht.length;qe+=1){for(var Rt=ht[qe],Ht=0,tr=0,Cr=Rt;tr<Cr.length;tr+=1){var Xr=Cr[tr];Ht+=Xr.length}for(var Vr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),pa=0,ja=Rt;pa<ja.length;pa+=1){var Cn=ja[pa];if(Cn.length!==0&&!nA(Cn))for(var un=0,ti=0;ti<Cn.length;ti++){var Un=Cn[ti];if(ti>=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;_o<Ms.length;_o+=1){var Eo=Ms[_o];if(Eo.length!==0){Eo!==Rt[0]&&Mo.push(Ni.length/2);for(var Ro=0;Ro<Eo.length;Ro++){var Zs=Eo[Ro];hv(this.layoutVertexArray,Zs.x,Zs.y,0,0,1,1,0),Ni.push(Zs.x),Ni.push(Zs.y)}}}for(var _s=A0(Ni,Mo),Wl=0;Wl<_s.length;Wl+=3)this.indexArray.emplaceBack(io+_s[Wl],io+_s[Wl+2],io+_s[Wl+1]);Vr.primitiveLength+=_s.length/3,Vr.vertexLength+=Ht}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,k,ie,Ie,xe)},de("FillExtrusionBucket",fd,{omit:["layers","features"]});function aA(C,k){return C.x===k.x&&(C.x<0||C.x>dn)||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<k.length;V++){var Ie=k[V],qe=C[0],ht=xe.sub(ie),Rt=Ie.sub(ie),Ht=qe.sub(ie),tr=Fv(ht,ht),Cr=Fv(ht,Rt),Xr=Fv(Rt,Rt),Vr=Fv(Ht,ht),pa=Fv(Ht,Rt),ja=tr*Xr-Cr*Cr,Cn=(Xr*Vr-Cr*pa)/ja,un=(tr*pa-Cr*Vr)/ja,ti=1-Cn-un,Un=ie.z*ti+xe.z*Cn+Ie.z*un;if(isFinite(Un))return Un}return 1/0}else{for(var ei=1/0,li=0,xi=k;li<xi.length;li+=1){var Vi=xi[li];ei=Math.min(ei,Vi.z)}return ei}}function eb(C,k,V){var ie=1/0;Hs(V,k)&&(ie=H1(V,k[0]));for(var xe=0;xe<k.length;xe++)for(var Ie=k[xe],qe=C[xe],ht=0;ht<Ie.length-1;ht++){var Rt=Ie[ht],Ht=Ie[ht+1],tr=qe[ht],Cr=qe[ht+1],Xr=[Rt,Ht,Cr,tr,Rt];Fo(V,Xr)&&(ie=Math.min(ie,H1(V,Xr)))}return ie===1/0?!1:ie}function W1(C,k,V,ie){for(var xe=[],Ie=[],qe=ie[8]*k,ht=ie[9]*k,Rt=ie[10]*k,Ht=ie[11]*k,tr=ie[8]*V,Cr=ie[9]*V,Xr=ie[10]*V,Vr=ie[11]*V,pa=0,ja=C;pa<ja.length;pa+=1){for(var Cn=ja[pa],un=[],ti=[],Un=0,ei=Cn;Un<ei.length;Un+=1){var li=ei[Un],xi=li.x,Vi=li.y,Ni=ie[0]*xi+ie[4]*Vi+ie[12],Mo=ie[1]*xi+ie[5]*Vi+ie[13],io=ie[2]*xi+ie[6]*Vi+ie[14],_o=ie[3]*xi+ie[7]*Vi+ie[15],Ms=Ni+qe,Eo=Mo+ht,Ro=io+Rt,Zs=_o+Ht,_s=Ni+tr,Wl=Mo+Cr,zu=io+Xr,Xl=_o+Vr,Zl=new n(Ms/Zs,Eo/Zs);Zl.z=Ro/Zs,un.push(Zl);var Ol=new n(_s/Xl,Wl/Xl);Ol.z=zu/Xl,ti.push(Ol)}xe.push(un),Ie.push(ti)}return[xe,Ie]}function iA(C,k,V,ie){for(var xe=[],Ie=0,qe=C;Ie<qe.length;Ie+=1){var ht=qe[Ie],Rt=[ht.x,ht.y,ie,1];Rv(Rt,Rt,k),xe.push(new n(Rt[0]/Rt[3],Rt[1]/Rt[3]))}return xe}var tb=Ln([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),rb=tb.members,oA=Ln([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),ab=oA.members,X1=Xd.VectorTileFeature.types,P0=63,nb=Math.cos(75/2*(Math.PI/180)),Dg=15,Z1=20,ib=15,I0=1/2,zg=Math.pow(2,ib-1)/I0,qf=function(k){var V=this;this.zoom=k.zoom,this.overscaling=k.overscaling,this.layers=k.layers,this.layerIds=this.layers.map(function(ie){return ie.id}),this.index=k.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(ie){V.gradients[ie.id]={}}),this.layoutVertexArray=new Wa,this.layoutVertexArray2=new Vn,this.indexArray=new Jn,this.programConfigurations=new Xa(k.layers,k.zoom),this.segments=new Lo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(ie){return ie.isStateDependent()}).map(function(ie){return ie.id})};qf.prototype.populate=function(k,V,ie){this.hasPattern=k0("line",this.layers,V);for(var xe=this.layers[0].layout.get("line-sort-key"),Ie=[],qe=0,ht=k;qe<ht.length;qe+=1){var Rt=ht[qe],Ht=Rt.feature,tr=Rt.id,Cr=Rt.index,Xr=Rt.sourceLayerIndex,Vr=this.layers[0]._featureFilter.needGeometry,pa=bo(Ht,Vr);if(this.layers[0]._featureFilter.filter(new gi(this.zoom),pa,ie)){var ja=xe?xe.evaluate(pa,{},ie):void 0,Cn={id:tr,properties:Ht.properties,type:Ht.type,sourceLayerIndex:Xr,index:Cr,geometry:Vr?pa.geometry:ci(Ht),patterns:{},sortKey:ja};Ie.push(Cn)}}xe&&Ie.sort(function(io,_o){return io.sortKey-_o.sortKey});for(var un=0,ti=Ie;un<ti.length;un+=1){var Un=ti[un],ei=Un,li=ei.geometry,xi=ei.index,Vi=ei.sourceLayerIndex;if(this.hasPattern){var Ni=Pg("line",this.layers,Un,this.zoom,V);this.patternFeatures.push(Ni)}else this.addFeature(Un,li,xi,ie,{});var Mo=k[xi].feature;V.featureIndex.insert(Mo,li,xi,Vi,this.index)}},qf.prototype.update=function(k,V,ie){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(k,V,this.stateDependentLayers,ie)},qf.prototype.addFeatures=function(k,V,ie){for(var xe=0,Ie=this.patternFeatures;xe<Ie.length;xe+=1){var qe=Ie[xe];this.addFeature(qe,qe.geometry,qe.index,V,ie)}},qf.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},qf.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},qf.prototype.upload=function(k){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=k.createVertexBuffer(this.layoutVertexArray2,ab)),this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,rb),this.indexBuffer=k.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(k),this.uploaded=!0},qf.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},qf.prototype.lineFeatureClips=function(k){if(k.properties&&k.properties.hasOwnProperty("mapbox_clip_start")&&k.properties.hasOwnProperty("mapbox_clip_end")){var V=+k.properties.mapbox_clip_start,ie=+k.properties.mapbox_clip_end;return{start:V,end:ie}}},qf.prototype.addFeature=function(k,V,ie,xe,Ie){var qe=this.layers[0].layout,ht=qe.get("line-join").evaluate(k,{}),Rt=qe.get("line-cap"),Ht=qe.get("line-miter-limit"),tr=qe.get("line-round-limit");this.lineClips=this.lineFeatureClips(k);for(var Cr=0,Xr=V;Cr<Xr.length;Cr+=1){var Vr=Xr[Cr];this.addLine(Vr,k,ht,Rt,Ht,tr)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,k,ie,Ie,xe)},qf.prototype.addLine=function(k,V,ie,xe,Ie,qe){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var ht=0;ht<k.length-1;ht++)this.totalDistance+=k[ht].dist(k[ht+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var Rt=X1[V.type]==="Polygon",Ht=k.length;Ht>=2&&k[Ht-1].equals(k[Ht-2]);)Ht--;for(var tr=0;tr<Ht-1&&k[tr].equals(k[tr+1]);)tr++;if(!(Ht<(Rt?3:2))){ie==="bevel"&&(Ie=1.05);var Cr=this.overscaling<=16?Dg*dn/(512*this.overscaling):0,Xr=this.segments.prepareSegment(Ht*10,this.layoutVertexArray,this.indexArray),Vr,pa=void 0,ja=void 0,Cn=void 0,un=void 0;this.e1=this.e2=-1,Rt&&(Vr=k[Ht-2],un=k[tr].sub(Vr)._unit()._perp());for(var ti=tr;ti<Ht;ti++)if(ja=ti===Ht-1?Rt?k[tr+1]:void 0:k[ti+1],!(ja&&k[ti].equals(ja))){un&&(Cn=un),Vr&&(pa=Vr),Vr=k[ti],un=ja?ja.sub(Vr)._unit()._perp():Cn,Cn=Cn||un;var Un=Cn.add(un);(Un.x!==0||Un.y!==0)&&Un._unit();var ei=Cn.x*un.x+Cn.y*un.y,li=Un.x*un.x+Un.y*un.y,xi=li!==0?1/li:1/0,Vi=2*Math.sqrt(2-2*li),Ni=li<nb&&pa&&ja,Mo=Cn.x*un.y-Cn.y*un.x>0;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"&&(xi<qe?Eo="miter":xi<=2&&(Eo="fakeround")),Eo==="miter"&&xi>Ie&&(Eo="bevel"),Eo==="bevel"&&(xi>2&&(Eo="flipbevel"),xi<Ie&&(Eo="miter")),pa&&this.updateDistance(pa,Vr),Eo==="miter")Un._mult(xi),this.addCurrentVertex(Vr,Un,0,0,Xr);else if(Eo==="flipbevel"){if(xi>100)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;Xl<zu;Xl++){var Zl=Xl/zu;if(Zl!==.5){var Ol=Zl-.5,$u=1.0904+ei*(-3.2452+ei*(3.55645-ei*1.43519)),hc=.848013+ei*(-1.06021+ei*.215638);Zl=Zl+Zl*Ol*(Zl-1)*($u*Ol*Ol+hc)}var cf=un.sub(Cn)._mult(Zl)._add(Cn)._unit()._mult(Mo?-1:1);this.addHalfVertex(Vr,cf.x,cf.y,!1,Mo,0,Xr)}ja&&this.addCurrentVertex(Vr,un,-_s,-Wl,Xr)}else if(Eo==="butt")this.addCurrentVertex(Vr,Un,0,0,Xr);else if(Eo==="square"){var yf=pa?1:-1;this.addCurrentVertex(Vr,Un,yf,yf,Xr)}else Eo==="round"&&(pa&&(this.addCurrentVertex(Vr,Cn,0,0,Xr),this.addCurrentVertex(Vr,Cn,1,1,Xr,!0)),ja&&(this.addCurrentVertex(Vr,un,-1,-1,Xr,!0),this.addCurrentVertex(Vr,un,0,0,Xr)));if(Ni&&ti<Ht-1){var dh=Vr.dist(ja);if(dh>2*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<C.length;xe++){for(var Ie=C[xe],qe=[],ht=0;ht<Ie.length;ht++){var Rt=Ie[ht-1],Ht=Ie[ht],tr=Ie[ht+1],Cr=ht===0?ie:Ht.sub(Rt)._unit()._perp(),Xr=ht===Ie.length-1?ie:tr.sub(Ht)._unit()._perp(),Vr=Cr._add(Xr)._unit(),pa=Vr.x*Xr.x+Vr.y*Xr.y;Vr._mult(1/pa),qe.push(Vr._mult(k)._add(Ht))}V.push(qe)}return V}var ke=Ln([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),je=Ln([{name:"a_projected_pos",components:3,type:"Float32"}],4),Xe=Ln([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ft=Ln([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Mt=Ln([{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"}]),Ut=Ln([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ir=Ln([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Mr=Ln([{name:"triangle",components:3,type:"Uint16"}]),zr=Ln([{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"}]),Hr=Ln([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),oa=Ln([{type:"Float32",name:"offsetX"}]),va=Ln([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Ga(C,k,V){var ie=k.layout.get("text-transform").evaluate(V,{});return ie==="uppercase"?C=C.toLocaleUpperCase():ie==="lowercase"&&(C=C.toLocaleLowerCase()),el.applyArabicShaping&&(C=el.applyArabicShaping(C)),C}function $a(C,k,V){return C.sections.forEach(function(ie){ie.text=Ga(ie.text,k,V)}),C}function Kn(C){var k={},V={},ie=[],xe=0;function Ie(un){ie.push(C[un]),xe++}function qe(un,ti,Un){var ei=V[un];return delete V[un],V[ti]=ei,ie[ei].geometry[0].pop(),ie[ei].geometry[0]=ie[ei].geometry[0].concat(Un[0]),ei}function ht(un,ti,Un){var ei=k[ti];return delete k[ti],k[un]=ei,ie[ei].geometry[0].shift(),ie[ei].geometry[0]=Un[0].concat(ie[ei].geometry[0]),ei}function Rt(un,ti,Un){var ei=Un?ti[0][ti[0].length-1]:ti[0][0];return un+":"+ei.x+":"+ei.y}for(var Ht=0;Ht<C.length;Ht++){var tr=C[Ht],Cr=tr.geometry,Xr=tr.text?tr.text.toString():null;if(!Xr){Ie(Ht);continue}var Vr=Rt(Xr,Cr),pa=Rt(Xr,Cr,!0);if(Vr in V&&pa in k&&V[Vr]!==k[pa]){var ja=ht(Vr,pa,Cr),Cn=qe(Vr,pa,ie[ja].geometry);delete k[Vr],delete V[pa],V[Rt(Xr,ie[Cn].geometry,!0)]=Cn,ie[ja].geometry=null}else Vr in V?qe(Vr,pa,Cr):pa in k?ht(Vr,pa,Cr):(Ie(Ht),k[Vr]=xe-1,V[pa]=xe-1)}return ie.filter(function(un){return un.geometry})}var bn={"!":"\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"};function Wn(C){for(var k="",V=0;V<C.length;V++){var ie=C.charCodeAt(V+1)||null,xe=C.charCodeAt(V-1)||null,Ie=(!ie||!on(ie)||bn[C[V+1]])&&(!xe||!on(xe)||bn[C[V-1]]);Ie&&bn[C[V]]?k+=bn[C[V]]:k+=C[V]}return k}var ai=24,ji=function(C,k,V,ie,xe){var Ie,qe,ht=xe*8-ie-1,Rt=(1<<ht)-1,Ht=Rt>>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<<Ht)-1,Cr=tr>>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<<xe|ht,Ht+=xe;Ht>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<V;){var ie=this.readVarint(),xe=ie>>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.pos<V;)C.push(this.readVarint(k));return C},readPackedSVarint:function(C){if(this.type!==Di.Bytes)return C.push(this.readSVarint());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readSVarint());return C},readPackedBoolean:function(C){if(this.type!==Di.Bytes)return C.push(this.readBoolean());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readBoolean());return C},readPackedFloat:function(C){if(this.type!==Di.Bytes)return C.push(this.readFloat());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readFloat());return C},readPackedDouble:function(C){if(this.type!==Di.Bytes)return C.push(this.readDouble());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readDouble());return C},readPackedFixed32:function(C){if(this.type!==Di.Bytes)return C.push(this.readFixed32());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readFixed32());return C},readPackedSFixed32:function(C){if(this.type!==Di.Bytes)return C.push(this.readSFixed32());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readSFixed32());return C},readPackedFixed64:function(C){if(this.type!==Di.Bytes)return C.push(this.readFixed64());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readFixed64());return C},readPackedSFixed64:function(C){if(this.type!==Di.Bytes)return C.push(this.readSFixed64());var k=No(this);for(C=C||[];this.pos<k;)C.push(this.readSFixed64());return C},skip:function(C){var k=C&7;if(k===Di.Varint)for(;this.buf[this.pos++]>127;);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;k<this.pos+C;)k*=2;if(k!==this.length){var V=new Uint8Array(k);V.set(this.buf),this.buf=V,this.length=k}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(C){this.realloc(4),gf(this.buf,C,this.pos),this.pos+=4},writeSFixed32:function(C){this.realloc(4),gf(this.buf,C,this.pos),this.pos+=4},writeFixed64:function(C){this.realloc(8),gf(this.buf,C&-1,this.pos),gf(this.buf,Math.floor(C*qo),this.pos+4),this.pos+=8},writeSFixed64:function(C){this.realloc(8),gf(this.buf,C&-1,this.pos),gf(this.buf,Math.floor(C*qo),this.pos+4),this.pos+=8},writeVarint:function(C){if(C=+C||0,C>268435455||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<k;V++)this.buf[this.pos++]=C[V]},writeRawMessage:function(C,k){this.pos++;var V=this.pos;C(k,this);var ie=this.pos-V;ie>=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<C.length;V++)k.writeVarint(C[V])}function eh(C,k){for(var V=0;V<C.length;V++)k.writeSVarint(C[V])}function Jh(C,k){for(var V=0;V<C.length;V++)k.writeFloat(C[V])}function $h(C,k){for(var V=0;V<C.length;V++)k.writeDouble(C[V])}function Qh(C,k){for(var V=0;V<C.length;V++)k.writeBoolean(C[V])}function uf(C,k){for(var V=0;V<C.length;V++)k.writeFixed32(C[V])}function th(C,k){for(var V=0;V<C.length;V++)k.writeSFixed32(C[V])}function Fh(C,k){for(var V=0;V<C.length;V++)k.writeFixed64(C[V])}function wh(C,k){for(var V=0;V<C.length;V++)k.writeSFixed64(C[V])}function fh(C,k){return(C[k]|C[k+1]<<8|C[k+2]<<16)+C[k+3]*16777216}function gf(C,k,V){C[V]=k,C[V+1]=k>>>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;xe<V;){var Ie=C[xe],qe=null,ht=Ie>239?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;ie<k.length;ie++){if(xe=k.charCodeAt(ie),xe>55295&&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<xe.length;ie+=1){var Ie=xe[ie];k+=Ie.w*Ie.h,V=Math.max(V,Ie.w)}C.sort(function(Cn,un){return un.h-Cn.h});for(var qe=Math.max(Math.ceil(Math.sqrt(k/.95)),V),ht=[{x:0,y:0,w:qe,h:1/0}],Rt=0,Ht=0,tr=0,Cr=C;tr<Cr.length;tr+=1)for(var Xr=Cr[tr],Vr=ht.length-1;Vr>=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<ht.length&&(ht[Vr]=ja)}else Xr.h===pa.h?(pa.x+=Xr.w,pa.w-=Xr.w):Xr.w===pa.w?(pa.y+=Xr.h,pa.h-=Xr.h):(ht.push({x:pa.x+Xr.w,y:pa.y,w:pa.w-Xr.w,h:Xr.h}),pa.y+=Xr.h,pa.h-=Xr.h);break}}return{w:Rt,h:Ht,fill:k/(Rt*Ht)||0}}var Rc=1,Pf=function(k,V){var ie=V.pixelRatio,xe=V.version,Ie=V.stretchX,qe=V.stretchY,ht=V.content;this.paddedRect=k,this.pixelRatio=ie,this.stretchX=Ie,this.stretchY=qe,this.content=ht,this.version=xe},Xp={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Xp.tl.get=function(){return[this.paddedRect.x+Rc,this.paddedRect.y+Rc]},Xp.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-Rc,this.paddedRect.y+this.paddedRect.h-Rc]},Xp.tlbr.get=function(){return this.tl.concat(this.br)},Xp.displaySize.get=function(){return[(this.paddedRect.w-Rc*2)/this.pixelRatio,(this.paddedRect.h-Rc*2)/this.pixelRatio]},Object.defineProperties(Pf.prototype,Xp);var Zd=function(k,V){var ie={},xe={};this.haveRenderCallbacks=[];var Ie=[];this.addImages(k,ie,Ie),this.addImages(V,xe,Ie);var qe=Wp(Ie),ht=qe.w,Rt=qe.h,Ht=new $f({width:ht||1,height:Rt||1});for(var tr in k){var Cr=k[tr],Xr=ie[tr].paddedRect;$f.copy(Cr.data,Ht,{x:0,y:0},{x:Xr.x+Rc,y:Xr.y+Rc},Cr.data)}for(var Vr in V){var pa=V[Vr],ja=xe[Vr].paddedRect,Cn=ja.x+Rc,un=ja.y+Rc,ti=pa.data.width,Un=pa.data.height;$f.copy(pa.data,Ht,{x:0,y:0},{x:Cn,y:un},pa.data),$f.copy(pa.data,Ht,{x:0,y:Un-1},{x:Cn,y:un-1},{width:ti,height:1}),$f.copy(pa.data,Ht,{x:0,y:0},{x:Cn,y:un+Un},{width:ti,height:1}),$f.copy(pa.data,Ht,{x:ti-1,y:0},{x:Cn-1,y:un},{width:1,height:Un}),$f.copy(pa.data,Ht,{x:0,y:0},{x:Cn+ti,y:un},{width:1,height:Un})}this.image=Ht,this.iconPositions=ie,this.patternPositions=xe};Zd.prototype.addImages=function(k,V,ie){for(var xe in k){var Ie=k[xe],qe={x:0,y:0,w:Ie.data.width+2*Rc,h:Ie.data.height+2*Rc};ie.push(qe),V[xe]=new Pf(qe,Ie),Ie.hasRenderCallback&&this.haveRenderCallbacks.push(xe)}},Zd.prototype.patchUpdatedImages=function(k,V){k.dispatchRenderCallbacks(this.haveRenderCallbacks);for(var ie in k.updatedImages)this.patchUpdatedImage(this.iconPositions[ie],k.getImage(ie),V),this.patchUpdatedImage(this.patternPositions[ie],k.getImage(ie),V)},Zd.prototype.patchUpdatedImage=function(k,V,ie){if(!(!k||!V)&&k.version!==V.version){k.version=V.version;var xe=k.tl,Ie=xe[0],qe=xe[1];ie.update(V.data,void 0,{x:Ie,y:qe})}},de("ImagePosition",Pf),de("ImageAtlas",Zd);var dp={horizontal:1,vertical:2,horizontalOnly:3},vm=-17;function J1(C){for(var k=0,V=C;k<V.length;k+=1){var ie=V[k];if(ie.positionedGlyphs.length!==0)return!1}return!0}var D0=57344,xd=63743,Ov=function(){this.scale=1,this.fontStack="",this.imageName=null};Ov.forText=function(k,V){var ie=new Ov;return ie.scale=k||1,ie.fontStack=V,ie},Ov.forImage=function(k){var V=new Ov;return V.imageName=k,V};var hh=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};hh.fromFeature=function(k,V){for(var ie=new hh,xe=0;xe<k.sections.length;xe++){var Ie=k.sections[xe];Ie.image?ie.addImageSection(Ie):ie.addTextSection(Ie,V)}return ie},hh.prototype.length=function(){return this.text.length},hh.prototype.getSection=function(k){return this.sections[this.sectionIndex[k]]},hh.prototype.getSectionIndex=function(k){return this.sectionIndex[k]},hh.prototype.getCharCode=function(k){return this.text.charCodeAt(k)},hh.prototype.verticalizePunctuation=function(){this.text=Wn(this.text)},hh.prototype.trim=function(){for(var k=0,V=0;V<this.text.length&&bd[this.text.charCodeAt(V)];V++)k++;for(var ie=this.text.length,xe=this.text.length-1;xe>=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<k.text.length;++xe)this.sectionIndex.push(ie)},hh.prototype.addImageSection=function(k){var V=k.image?k.image.name:"";if(V.length===0){U("Can't add FormattedSection with an empty image.");return}var ie=this.getNextImageSectionCharCode();if(!ie){U("Reached maximum number of images "+(xd-D0+2));return}this.text+=String.fromCharCode(ie),this.sections.push(Ov.forImage(V)),this.sectionIndex.push(this.sections.length-1)},hh.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=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<qe.length;Ie+=1){var ht=qe[Ie];V.push(C.substring(xe,ht)),xe=ht}return xe<ie.length&&V.push(C.substring(xe,ie.length)),V}function z0(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja){var Cn=hh.fromFeature(C,xe);Cr===dp.vertical&&Cn.verticalizePunctuation();var un,ti=el.processBidirectionalText,Un=el.processStyledBidirectionalText;if(ti&&Cn.sections.length===1){un=[];for(var ei=ti(Cn.toString(),F0(Cn,Ht,Ie,k,ie,Vr,pa)),li=0,xi=ei;li<xi.length;li+=1){var Vi=xi[li],Ni=new hh;Ni.text=Vi,Ni.sections=Cn.sections;for(var Mo=0;Mo<Vi.length;Mo++)Ni.sectionIndex.push(0);un.push(Ni)}}else if(Un){un=[];for(var io=Un(Cn.text,Cn.sectionIndex,F0(Cn,Ht,Ie,k,ie,Vr,pa)),_o=0,Ms=io;_o<Ms.length;_o+=1){var Eo=Ms[_o],Ro=new hh;Ro.text=Eo[0],Ro.sectionIndex=Eo[1],Ro.sections=Cn.sections,un.push(Ro)}}else un=lA(Cn,F0(Cn,Ht,Ie,k,ie,Vr,pa));var Zs=[],_s={positionedLines:Zs,text:Cn.toString(),top:tr[1],bottom:tr[1],left:tr[0],right:tr[0],writingMode:Cr,iconsInText:!1,verticalizable:!1};return fA(_s,k,V,ie,un,qe,ht,Rt,Cr,Ht,Xr,ja),J1(Zs)?!1:_s}var bd={};bd[9]=!0,bd[10]=!0,bd[11]=!0,bd[12]=!0,bd[13]=!0,bd[32]=!0;var vp={};vp[10]=!0,vp[32]=!0,vp[38]=!0,vp[40]=!0,vp[41]=!0,vp[43]=!0,vp[45]=!0,vp[47]=!0,vp[173]=!0,vp[183]=!0,vp[8203]=!0,vp[8208]=!0,vp[8211]=!0,vp[8231]=!0;function ob(C,k,V,ie,xe,Ie){if(k.imageName){var Rt=ie[k.imageName];return Rt?Rt.displaySize[0]*k.scale*ai/Ie+xe:0}else{var qe=V[k.fontStack],ht=qe&&qe[C];return ht?ht.metrics.advance*k.scale+xe:0}}function uA(C,k,V,ie,xe,Ie){for(var qe=0,ht=0;ht<C.length();ht++){var Rt=C.getSection(ht);qe+=ob(C.getCharCode(ht),Rt,ie,xe,k,Ie)}var Ht=Math.max(1,Math.ceil(qe/V));return qe/Ht}function sb(C,k,V,ie){var xe=Math.pow(C-k,2);return ie?C<k?xe/2:xe*2:xe+Math.abs(V)*V}function cA(C,k,V){var ie=0;return C===10&&(ie-=1e4),V&&(ie+=150),(C===40||C===65288)&&(ie+=50),(k===41||k===65289)&&(ie+=50),ie}function nd(C,k,V,ie,xe,Ie){for(var qe=null,ht=sb(k,V,xe,Ie),Rt=0,Ht=ie;Rt<Ht.length;Rt+=1){var tr=Ht[Rt],Cr=k-tr.x,Xr=sb(Cr,V,xe,Ie)+tr.badness;Xr<=ht&&(qe=tr,ht=Xr)}return{index:C,x:k,priorBreak:qe,badness:ht}}function Fg(C){return C?Fg(C.priorBreak).concat(C.index):[]}function F0(C,k,V,ie,xe,Ie,qe){if(Ie!=="point")return[];if(!C)return[];for(var ht=[],Rt=uA(C,k,V,ie,xe,qe),Ht=C.text.indexOf("\u200B")>=0,tr=0,Cr=0;Cr<C.length();Cr++){var Xr=C.getSection(Cr),Vr=C.getCharCode(Cr);if(bd[Vr]||(tr+=ob(Vr,Xr,ie,xe,k,qe)),Cr<C.length()-1){var pa=Ta(Vr);(vp[Vr]||pa||Xr.imageName)&&ht.push(nd(Cr+1,tr,Rt,ht,cA(Vr,C.getCharCode(Cr+1),pa&&Ht),!1))}}return Fg(nd(C.length(),tr,Rt,ht,0,!0))}function $1(C){var k=.5,V=.5;switch(C){case"right":case"top-right":case"bottom-right":k=1;break;case"left":case"top-left":case"bottom-left":k=0;break}switch(C){case"bottom":case"bottom-right":case"bottom-left":V=1;break;case"top":case"top-right":case"top-left":V=0;break}return{horizontalAlign:k,verticalAlign:V}}function fA(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr){for(var Xr=0,Vr=vm,pa=0,ja=0,Cn=ht==="right"?1:ht==="left"?0:.5,un=0,ti=0,Un=xe;ti<Un.length;ti+=1){var ei=Un[ti];ei.trim();var li=ei.getMaxScale(),xi=(li-1)*ai,Vi={positionedGlyphs:[],lineOffset:0};C.positionedLines[un]=Vi;var Ni=Vi.positionedGlyphs,Mo=0;if(!ei.length()){Vr+=Ie,++un;continue}for(var io=0;io<ei.length();io++){var _o=ei.getSection(io),Ms=ei.getSectionIndex(io),Eo=ei.getCharCode(io),Ro=0,Zs=null,_s=null,Wl=null,zu=ai,Xl=!(Rt===dp.horizontal||!tr&&!ya(Eo)||tr&&(bd[Eo]||Ma(Eo)));if(_o.imageName){var cf=ie[_o.imageName];if(!cf)continue;Wl=_o.imageName,C.iconsInText=C.iconsInText||!0,_s=cf.paddedRect;var yf=cf.displaySize;_o.scale=_o.scale*ai/Cr,Zs={width:yf[0],height:yf[1],left:Rc,top:-hd,advance:Xl?yf[1]:yf[0]};var dh=ai-yf[1]*_o.scale;Ro=xi+dh,zu=Zs.advance;var Wf=Xl?yf[0]*_o.scale-ai*li:yf[1]*_o.scale-ai*li;Wf>0&&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<Xr.length;Cr+=1)for(var Vr=Xr[Cr],pa=0,ja=Vr.positionedGlyphs;pa<ja.length;pa+=1){var Cn=ja[pa];Cn.x+=Ht,Cn.y+=tr}}function Zp(C,k,V){var ie=$1(V),xe=ie.horizontalAlign,Ie=ie.verticalAlign,qe=k[0],ht=k[1],Rt=qe-C.displaySize[0]*xe,Ht=Rt+C.displaySize[0],tr=ht-C.displaySize[1]*Ie,Cr=tr+C.displaySize[1];return{image:C,top:tr,bottom:Cr,left:Rt,right:Ht}}function dv(C,k,V,ie,xe,Ie){var qe=C.image,ht;if(qe.content){var Rt=qe.content,Ht=qe.pixelRatio||1;ht=[Rt[0]/Ht,Rt[1]/Ht,qe.displaySize[0]-Rt[2]/Ht,qe.displaySize[1]-Rt[3]/Ht]}var tr=k.left*Ie,Cr=k.right*Ie,Xr,Vr,pa,ja;V==="width"||V==="both"?(ja=xe[0]+tr-ie[3],Vr=xe[0]+Cr+ie[1]):(ja=xe[0]+(tr+Cr-qe.displaySize[0])/2,Vr=ja+qe.displaySize[0]);var Cn=k.top*Ie,un=k.bottom*Ie;return V==="height"||V==="both"?(Xr=xe[1]+Cn-ie[0],pa=xe[1]+un+ie[2]):(Xr=xe[1]+(Cn+un-qe.displaySize[1])/2,pa=Xr+qe.displaySize[1]),{image:qe,top:Xr,right:Vr,bottom:pa,left:ja,collisionPadding:ht}}var ep=function(C){function k(V,ie,xe,Ie){C.call(this,V,ie),this.angle=xe,Ie!==void 0&&(this.segment=Ie)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.clone=function(){return new k(this.x,this.y,this.angle,this.segment)},k}(n);de("Anchor",ep);var Bh=128;function id(C,k){var V=k.expression;if(V.kind==="constant"){var ie=V.evaluate(new gi(C+1));return{kind:"constant",layoutSize:ie}}else{if(V.kind==="source")return{kind:"source"};for(var xe=V.zoomStops,Ie=V.interpolationType,qe=0;qe<xe.length&&xe[qe]<=C;)qe++;qe=Math.max(0,qe-1);for(var ht=qe;ht<xe.length&&xe[ht]<C+1;)ht++;ht=Math.min(xe.length-1,ht);var Rt=xe[qe],Ht=xe[ht];if(V.kind==="composite")return{kind:"composite",minZoom:Rt,maxZoom:Ht,interpolationType:Ie};var tr=V.evaluate(new gi(Rt)),Cr=V.evaluate(new gi(Ht));return{kind:"camera",minZoom:Rt,maxZoom:Ht,minSize:tr,maxSize:Cr,interpolationType:Ie}}}function mk(C,k,V){var ie=k.uSize,xe=k.uSizeT,Ie=V.lowerSize,qe=V.upperSize;return C.kind==="source"?Ie/Bh:C.kind==="composite"?Ml(Ie/Bh,qe/Bh,xe):ie}function gk(C,k){var V=0,ie=0;if(C.kind==="constant")ie=C.layoutSize;else if(C.kind!=="source"){var xe=C.interpolationType,Ie=C.minZoom,qe=C.maxZoom,ht=xe?l(ru.interpolationFactor(xe,k,Ie,qe),0,1):0;C.kind==="camera"?ie=Ml(C.minSize,C.maxSize,ht):V=ht}return{uSizeT:V,uSize:ie}}var gW=Object.freeze({__proto__:null,getSizeData:id,evaluateSizeForFeature:mk,evaluateSizeForZoom:gk,SIZE_PACK_FACTOR:Bh});function yk(C,k,V,ie,xe){if(k.segment===void 0)return!0;for(var Ie=k,qe=k.segment+1,ht=0;ht>-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;ht<V/2;){var tr=C[qe-1],Cr=C[qe],Xr=C[qe+1];if(!Xr)return!1;var Vr=tr.angleTo(Cr)-Cr.angleTo(Xr);for(Vr=Math.abs((Vr+3*Math.PI)%(Math.PI*2)-Math.PI),Rt.push({distance:ht,angleDelta:Vr}),Ht+=Vr;ht-Rt[0].distance>ie;)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;V<C.length-1;V++)k+=C[V].dist(C[V+1]);return k}function xk(C,k,V){return C?3/5*k*V:0}function bk(C,k){return Math.max(C?C.right-C.left:0,k?k.right-k.left:0)}function yW(C,k,V,ie,xe,Ie){for(var qe=xk(V,xe,Ie),ht=bk(V,ie)*Ie,Rt=0,Ht=_k(C)/2,tr=0;tr<C.length-1;tr++){var Cr=C[tr],Xr=C[tr+1],Vr=Cr.dist(Xr);if(Rt+Vr>Ht){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<k/4&&(k=Cr+k/4);var Vr=Ie*2,pa=Xr?k/2*ht%k:(tr/2+Vr)*qe*ht%k;return wk(C,pa,k,Ht,V,Cr,Xr,!1,Rt)}function wk(C,k,V,ie,xe,Ie,qe,ht,Rt){for(var Ht=Ie/2,tr=_k(C),Cr=0,Xr=k-V,Vr=[],pa=0;pa<C.length-1;pa++){for(var ja=C[pa],Cn=C[pa+1],un=ja.dist(Cn),ti=Cn.angleTo(ja);Xr+V<Cr+un;){Xr+=V;var Un=(Xr-Cr)/un,ei=Ml(ja.x,Cn.x,Un),li=Ml(ja.y,Cn.y,Un);if(ei>=0&&ei<Rt&&li>=0&&li<Rt&&Xr-Ht>=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<C.length;qe++)for(var ht=C[qe],Rt=void 0,Ht=0;Ht<ht.length-1;Ht++){var tr=ht[Ht],Cr=ht[Ht+1];tr.x<k&&Cr.x<k||(tr.x<k?tr=new n(k,tr.y+(Cr.y-tr.y)*((k-tr.x)/(Cr.x-tr.x)))._round():Cr.x<k&&(Cr=new n(k,tr.y+(Cr.y-tr.y)*((k-tr.x)/(Cr.x-tr.x)))._round()),!(tr.y<V&&Cr.y<V)&&(tr.y<V?tr=new n(tr.x+(Cr.x-tr.x)*((V-tr.y)/(Cr.y-tr.y)),V)._round():Cr.y<V&&(Cr=new n(tr.x+(Cr.x-tr.x)*((V-tr.y)/(Cr.y-tr.y)),V)._round()),!(tr.x>=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;Ro<Ms.length-1;Ro++)for(var Zs=Ms[Ro],_s=Ms[Ro+1],Wl=0;Wl<Eo.length-1;Wl++){var zu=Eo[Wl],Xl=Eo[Wl+1];xe.push(_o(Zs,zu,_s,Xl))}return xe}function lb(C,k,V){for(var ie=0,xe=0,Ie=C;xe<Ie.length;xe+=1){var qe=Ie[xe];ie+=Math.max(k,Math.min(V,qe[1]))-Math.max(k,Math.min(V,qe[0]))}return ie}function Sk(C,k,V){for(var ie=[{fixed:-O0,stretch:0}],xe=0,Ie=C;xe<Ie.length;xe+=1){var qe=Ie[xe],ht=qe[0],Rt=qe[1],Ht=ie[ie.length-1];ie.push({fixed:ht-Ht.stretch,stretch:Ht.stretch}),ie.push({fixed:ht-Ht.stretch,stretch:Ht.stretch+(Rt-ht)})}return ie.push({fixed:k+O0,stretch:V}),ie}function ub(C,k,V,ie){return C/k*V+ie}function cb(C,k,V,ie){return C-k*V/ie}function xW(C,k,V,ie,xe,Ie,qe,ht){for(var Rt=ie.layout.get("text-rotate").evaluate(Ie,{})*Math.PI/180,Ht=[],tr=0,Cr=k.positionedLines;tr<Cr.length;tr+=1)for(var Xr=Cr[tr],Vr=0,pa=Xr.positionedGlyphs;Vr<pa.length;Vr+=1){var ja=pa[Vr];if(ja.rect){var Cn=ja.rect||{},un=1,ti=hd+un,Un=!0,ei=1,li=0,xi=(xe||ht)&&ja.vertical,Vi=ja.metrics.advance*ja.scale/2;if(ht&&k.verticalizable){var Ni=(ja.scale-1)*ai,Mo=(ai-ja.metrics.width*ja.scale)/2;li=Xr.lineOffset/2-(ja.imageName?-Mo:Ni)}if(ja.imageName){var io=qe[ja.imageName];Un=io.sdf,ei=io.pixelRatio,ti=Rc/ei}var _o=xe?[ja.x+Vi,ja.y]:[0,0],Ms=xe?[0,0]:[ja.x+Vi+V[0],ja.y+V[1]-li],Eo=[0,0];xi&&(Eo=Ms,Ms=[0,0]);var Ro=(ja.metrics.left-ti)*ja.scale-Vi+Ms[0],Zs=(-ja.metrics.top-ti)*ja.scale+Ms[1],_s=Ro+Cn.w*ja.scale/ei,Wl=Zs+Cn.h*ja.scale/ei,zu=new n(Ro,Zs),Xl=new n(_s,Zs),Zl=new n(Ro,Wl),Ol=new n(_s,Wl);if(xi){var $u=new n(-Vi,Vi-vm),hc=-Math.PI/2,cf=ai/2-Vi,yf=ja.imageName?cf:0,dh=new n(5-vm-cf,-yf),Wf=new(Function.prototype.bind.apply(n,[null].concat(Eo)));zu._rotateAround(hc,$u)._add(dh)._add(Wf),Xl._rotateAround(hc,$u)._add(dh)._add(Wf),Zl._rotateAround(hc,$u)._add(dh)._add(Wf),Ol._rotateAround(hc,$u)._add(dh)._add(Wf)}if(Rt){var tp=Math.sin(Rt),rp=Math.cos(Rt),vh=[rp,-tp,tp,rp];zu._matMult(vh),Xl._matMult(vh),Zl._matMult(vh),Ol._matMult(vh)}var mp=new n(0,0),gp=new n(0,0),rh=0,yp=0;Ht.push({tl:zu,tr:Xl,bl:Zl,br:Ol,tex:Cn,writingMode:k.writingMode,glyphOffset:_o,sectionIndex:ja.sectionIndex,isSDF:Un,pixelOffsetTL:mp,pixelOffsetBR:gp,minFontScaleX:rh,minFontScaleY:yp})}}return Ht}var fb=function(k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr){if(this.boxStartIndex=k.length,Ht){var Cr=qe.top,Xr=qe.bottom,Vr=qe.collisionPadding;Vr&&(Cr-=Vr[1],Xr+=Vr[3]);var pa=Xr-Cr;pa>0&&(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<Ie;){var ht=(k<<1)+1,Rt=ie[ht],Ht=ht+1;if(Ht<this.length&&xe(ie[Ht],Rt)<0&&(ht=Ht,Rt=ie[Ht]),xe(Rt,qe)>=0)break;ie[k]=Rt,k=ht}ie[k]=qe};function bW(C,k){return C<k?-1:C>k?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;Rt<ht.length;Rt++){var Ht=ht[Rt];(!Rt||Ht.x<ie)&&(ie=Ht.x),(!Rt||Ht.y<xe)&&(xe=Ht.y),(!Rt||Ht.x>Ie)&&(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;ja<Ie;ja+=Xr)for(var Cn=xe;Cn<qe;Cn+=Xr)pa.push(new N0(ja+Vr,Cn+Vr,Vr,C));for(var un=SW(C),ti=pa.length;pa.length;){var Un=pa.pop();(Un.d>un.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;xe<k.length;xe++)for(var Ie=k[xe],qe=0,ht=Ie.length,Rt=ht-1;qe<ht;Rt=qe++){var Ht=Ie[qe],tr=Ie[Rt];Ht.y>C.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<qe;ht=Ie++){var Rt=xe[Ie],Ht=xe[ht],tr=Rt.x*Ht.y-Ht.x*Rt.y;V+=(Rt.x+Ht.x)*tr,ie+=(Rt.y+Ht.y)*tr,k+=tr*3}return new N0(V/k,ie/k,0,C)}var U0=7,pA=Number.POSITIVE_INFINITY;function Mk(C,k){function V(xe,Ie){var qe=0,ht=0;Ie<0&&(Ie=0);var Rt=Ie/Math.sqrt(2);switch(xe){case"top-right":case"top-left":ht=Rt-U0;break;case"bottom-right":case"bottom-left":ht=-Rt+U0;break;case"bottom":ht=-Ie+U0;break;case"top":ht=Ie-U0;break}switch(xe){case"top-right":case"bottom-right":qe=-Rt;break;case"top-left":case"bottom-left":qe=Rt;break;case"left":qe=Ie;break;case"right":qe=-Ie;break}return[qe,ht]}function ie(xe,Ie,qe){var ht=0,Rt=0;switch(Ie=Math.abs(Ie),qe=Math.abs(qe),xe){case"top-right":case"top-left":case"top":Rt=qe-U0;break;case"bottom-right":case"bottom-left":case"bottom":Rt=-qe+U0;break}switch(xe){case"top-right":case"bottom-right":case"right":ht=-Ie;break;case"top-left":case"bottom-left":case"left":ht=Ie;break}return[ht,Rt]}return k[1]!==pA?ie(C,k[0],k[1]):V(C,k[0])}function MW(C,k,V,ie,xe,Ie,qe){C.createArrays();var ht=512*C.overscaling;C.tilePixelRatio=dn/ht,C.compareText={},C.iconsNeedLinear=!1;var Rt=C.layers[0].layout,Ht=C.layers[0]._unevaluatedLayout._values,tr={};if(C.textSizeData.kind==="composite"){var Cr=C.textSizeData,Xr=Cr.minZoom,Vr=Cr.maxZoom;tr.compositeTextSizes=[Ht["text-size"].possiblyEvaluate(new gi(Xr),qe),Ht["text-size"].possiblyEvaluate(new gi(Vr),qe)]}if(C.iconSizeData.kind==="composite"){var pa=C.iconSizeData,ja=pa.minZoom,Cn=pa.maxZoom;tr.compositeIconSizes=[Ht["icon-size"].possiblyEvaluate(new gi(ja),qe),Ht["icon-size"].possiblyEvaluate(new gi(Cn),qe)]}tr.layoutTextSize=Ht["text-size"].possiblyEvaluate(new gi(C.zoom+1),qe),tr.layoutIconSize=Ht["icon-size"].possiblyEvaluate(new gi(C.zoom+1),qe),tr.textMaxSize=Ht["text-size"].possiblyEvaluate(new gi(18));for(var un=Rt.get("text-line-height")*ai,ti=Rt.get("text-rotation-alignment")==="map"&&Rt.get("symbol-placement")!=="point",Un=Rt.get("text-keep-upright"),ei=Rt.get("text-size"),li=function(){var Ni=Vi[xi],Mo=Rt.get("text-font").evaluate(Ni,{},qe).join(","),io=ei.evaluate(Ni,{},qe),_o=tr.layoutTextSize.evaluate(Ni,{},qe),Ms=tr.layoutIconSize.evaluate(Ni,{},qe),Eo={horizontal:{},vertical:void 0},Ro=Ni.text,Zs=[0,0];if(Ro){var _s=Ro.toString(),Wl=Rt.get("text-letter-spacing").evaluate(Ni,{},qe)*ai,zu=qr(_s)?Wl:0,Xl=Rt.get("text-anchor").evaluate(Ni,{},qe),Zl=Rt.get("text-variable-anchor");if(!Zl){var Ol=Rt.get("text-radial-offset").evaluate(Ni,{},qe);Ol?Zs=Mk(Xl,[Ol*ai,pA]):Zs=Rt.get("text-offset").evaluate(Ni,{},qe).map(function(Uv){return Uv*ai})}var $u=ti?"center":Rt.get("text-justify").evaluate(Ni,{},qe),hc=Rt.get("symbol-placement"),cf=hc==="point"?Rt.get("text-max-width").evaluate(Ni,{},qe)*ai:0,yf=function(){C.allowVerticalPlacement&&gr(_s)&&(Eo.vertical=z0(Ro,k,V,xe,Mo,cf,un,Xl,"left",zu,Zs,dp.vertical,!0,hc,_o,io))};if(!ti&&Zl){for(var dh=$u==="auto"?Zl.map(function(Uv){return dA(Uv)}):[$u],Wf=!1,tp=0;tp<dh.length;tp++){var rp=dh[tp];if(!Eo.horizontal[rp])if(Wf)Eo.horizontal[rp]=Eo.horizontal[0];else{var vh=z0(Ro,k,V,xe,Mo,cf,un,"center",rp,zu,Zs,dp.horizontal,!1,hc,_o,io);vh&&(Eo.horizontal[rp]=vh,Wf=vh.positionedLines.length===1)}}yf()}else{$u==="auto"&&($u=dA(Xl));var mp=z0(Ro,k,V,xe,Mo,cf,un,Xl,$u,zu,Zs,dp.horizontal,!1,hc,_o,io);mp&&(Eo.horizontal[$u]=mp),yf(),gr(_s)&&ti&&Un&&(Eo.vertical=z0(Ro,k,V,xe,Mo,cf,un,Xl,$u,zu,Zs,dp.vertical,!1,hc,_o,io))}}var gp=void 0,rh=!1;if(Ni.icon&&Ni.icon.name){var yp=ie[Ni.icon.name];yp&&(gp=Zp(xe[Ni.icon.name],Rt.get("icon-offset").evaluate(Ni,{},qe),Rt.get("icon-anchor").evaluate(Ni,{},qe)),rh=yp.sdf,C.sdfIcons===void 0?C.sdfIcons=yp.sdf:C.sdfIcons!==yp.sdf&&U("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(yp.pixelRatio!==C.pixelRatio||Rt.get("icon-rotate").constantOr(1)!==0)&&(C.iconsNeedLinear=!0))}var od=Ck(Eo.horizontal)||Eo.vertical;C.iconsInText=od?od.iconsInText:!1,(od||gp)&&EW(C,Ni,Eo,gp,ie,tr,_o,Ms,Zs,rh,qe)},xi=0,Vi=C.features;xi<Vi.length;xi+=1)li();Ie&&C.generateCollisionDebugBuffers()}function dA(C){switch(C){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function EW(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr){var Cr=Ie.textMaxSize.evaluate(k,{});Cr===void 0&&(Cr=qe);var Xr=C.layers[0].layout,Vr=Xr.get("icon-offset").evaluate(k,{},tr),pa=Ck(V.horizontal),ja=24,Cn=qe/ja,un=C.tilePixelRatio*Cn,ti=C.tilePixelRatio*Cr/ja,Un=C.tilePixelRatio*ht,ei=C.tilePixelRatio*Xr.get("symbol-spacing"),li=Xr.get("text-padding")*C.tilePixelRatio,xi=Xr.get("icon-padding")*C.tilePixelRatio,Vi=Xr.get("text-max-angle")/180*Math.PI,Ni=Xr.get("text-rotation-alignment")==="map"&&Xr.get("symbol-placement")!=="point",Mo=Xr.get("icon-rotation-alignment")==="map"&&Xr.get("symbol-placement")!=="point",io=Xr.get("symbol-placement"),_o=ei/2,Ms=Xr.get("icon-text-fit"),Eo;ie&&Ms!=="none"&&(C.allowVerticalPlacement&&V.vertical&&(Eo=dv(ie,V.vertical,Ms,Xr.get("icon-text-fit-padding"),Vr,Cn)),pa&&(ie=dv(ie,pa,Ms,Xr.get("icon-text-fit-padding"),Vr,Cn)));var Ro=function(H0,wd){wd.x<0||wd.x>=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;Xl<Zl.length;Xl+=1){var Ol=Zl[Xl],$u=pa;(!$u||!kW(C,$u.text,_o,Ol))&&Ro(Wl,Ol)}else if(io==="line-center")for(var hc=0,cf=k.geometry;hc<cf.length;hc+=1){var yf=cf[hc];if(yf.length>1){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);Wf<tp.length;Wf+=1){var rp=tp[Wf],vh=wW(rp,16);Ro(rp[0],new ep(vh.x,vh.y,0))}else if(k.type==="LineString")for(var mp=0,gp=k.geometry;mp<gp.length;mp+=1){var rh=gp[mp];Ro(rh,new ep(rh[0].x,rh[0].y,0))}else if(k.type==="Point")for(var yp=0,od=k.geometry;yp<od.length;yp+=1)for(var Uv=od[yp],ym=0,_m=Uv;ym<_m.length;ym+=1){var xm=_m[ym];Ro([xm],new ep(xm.x,xm.y,0))}}var Q1=255,mm=Q1*Bh;function Ek(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa){var ja=xW(k,V,ht,xe,Ie,qe,ie,C.allowVerticalPlacement),Cn=C.textSizeData,un=null;Cn.kind==="source"?(un=[Bh*xe.layout.get("text-size").evaluate(qe,{})],un[0]>mm&&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;ti<Un.length;ti+=1){var ei=Un[ti];Cr[ei]=C.text.placedSymbolArray.length-1}return ja.length*4}function Ck(C){for(var k in C)return C[k];return null}function CW(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr,Vr,pa,ja,Cn,un,ti,Un,ei,li,xi,Vi,Ni){var Mo,io=C.addToLineVertexArray(k,V),_o,Ms,Eo,Ro,Zs=0,_s=0,Wl=0,zu=0,Xl=-1,Zl=-1,Ol={},$u=me(""),hc=0,cf=0;if(ht._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Mo=ht.layout.get("text-offset").evaluate(ei,{},Vi).map(function(r_){return r_*ai}),hc=Mo[0],cf=Mo[1]):(hc=ht.layout.get("text-radial-offset").evaluate(ei,{},Vi)*ai,cf=pA),C.allowVerticalPlacement&&ie.vertical){var yf=ht.layout.get("text-rotate").evaluate(ei,{},Vi),dh=yf+90,Wf=ie.vertical;Eo=new fb(Rt,k,Ht,tr,Cr,Wf,Xr,Vr,pa,dh),qe&&(Ro=new fb(Rt,k,Ht,tr,Cr,qe,Cn,un,pa,dh))}if(xe){var tp=ht.layout.get("icon-rotate").evaluate(ei,{}),rp=ht.layout.get("icon-text-fit")!=="none",vh=Ak(xe,tp,xi,rp),mp=qe?Ak(qe,tp,xi,rp):void 0;Ms=new fb(Rt,k,Ht,tr,Cr,xe,Cn,un,!1,tp),Zs=vh.length*4;var gp=C.iconSizeData,rh=null;gp.kind==="source"?(rh=[Bh*ht.layout.get("icon-size").evaluate(ei,{})],rh[0]>mm&&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])<V)return!0;return xe[k].push(ie),!1}var LW=Xd.VectorTileFeature.types,PW=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function hb(C,k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr){var Vr=ht?Math.min(mm,Math.round(ht[0])):0,pa=ht?Math.min(mm,Math.round(ht[1])):0;C.emplaceBack(k,V,Math.round(ie*32),Math.round(xe*32),Ie,qe,(Vr<<1)+(Rt?1:0),pa,Ht*16,tr*16,Cr*256,Xr*256)}function vA(C,k,V){C.emplaceBack(k.x,k.y,V),C.emplaceBack(k.x,k.y,V),C.emplaceBack(k.x,k.y,V),C.emplaceBack(k.x,k.y,V)}function IW(C){for(var k=0,V=C.sections;k<V.length;k+=1){var ie=V[k];if(mn(ie.text))return!0}return!1}var j0=function(k){this.layoutVertexArray=new hi,this.indexArray=new Jn,this.programConfigurations=k,this.segments=new Lo,this.dynamicLayoutVertexArray=new Za,this.opacityVertexArray=new qa,this.placedSymbolArray=new fs};j0.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},j0.prototype.upload=function(k,V,ie,xe){this.isEmpty()||(ie&&(this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,ke.members),this.indexBuffer=k.createIndexBuffer(this.indexArray,V),this.dynamicLayoutVertexBuffer=k.createVertexBuffer(this.dynamicLayoutVertexArray,je.members,!0),this.opacityVertexBuffer=k.createVertexBuffer(this.opacityVertexArray,PW,!0),this.opacityVertexBuffer.itemSize=1),(ie||xe)&&this.programConfigurations.upload(k))},j0.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},de("SymbolBuffers",j0);var e_=function(k,V,ie){this.layoutVertexArray=new k,this.layoutAttributes=V,this.indexArray=new ie,this.segments=new Lo,this.collisionVertexArray=new An};e_.prototype.upload=function(k){this.layoutVertexBuffer=k.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=k.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=k.createVertexBuffer(this.collisionVertexArray,ft.members,!0)},e_.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},de("CollisionBuffers",e_);var Du=function(k){this.collisionBoxArray=k.collisionBoxArray,this.zoom=k.zoom,this.overscaling=k.overscaling,this.layers=k.layers,this.layerIds=this.layers.map(function(Rt){return Rt.id}),this.index=k.index,this.pixelRatio=k.pixelRatio,this.sourceLayerIndex=k.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Pv([]),this.placementViewportMatrix=Pv([]);var V=this.layers[0],ie=V._unevaluatedLayout._values;this.textSizeData=id(this.zoom,ie["text-size"]),this.iconSizeData=id(this.zoom,ie["icon-size"]);var xe=this.layers[0].layout,Ie=xe.get("symbol-sort-key"),qe=xe.get("symbol-z-order");this.canOverlap=xe.get("text-allow-overlap")||xe.get("icon-allow-overlap")||xe.get("text-ignore-placement")||xe.get("icon-ignore-placement"),this.sortFeaturesByKey=qe!=="viewport-y"&&Ie.constantOr(1)!==void 0;var ht=qe==="viewport-y"||qe==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=ht&&this.canOverlap,xe.get("symbol-placement")==="point"&&(this.writingModes=xe.get("text-writing-mode").map(function(Rt){return dp[Rt]})),this.stateDependentLayerIds=this.layers.filter(function(Rt){return Rt.isStateDependent()}).map(function(Rt){return Rt.id}),this.sourceID=k.sourceID};Du.prototype.createArrays=function(){this.text=new j0(new Xa(this.layers,this.zoom,function(k){return/^text/.test(k)})),this.icon=new j0(new Xa(this.layers,this.zoom,function(k){return/^icon/.test(k)})),this.glyphOffsetArray=new Ql,this.lineVertexArray=new Fs,this.symbolInstances=new El},Du.prototype.calculateGlyphDependencies=function(k,V,ie,xe,Ie){for(var qe=0;qe<k.length;qe++)if(V[k.charCodeAt(qe)]=!0,(ie||xe)&&Ie){var ht=bn[k.charAt(qe)];ht&&(V[ht.charCodeAt(0)]=!0)}},Du.prototype.populate=function(k,V,ie){var xe=this.layers[0],Ie=xe.layout,qe=Ie.get("text-font"),ht=Ie.get("text-field"),Rt=Ie.get("icon-image"),Ht=(ht.value.kind!=="constant"||ht.value.value instanceof iu&&!ht.value.value.isEmpty()||ht.value.value.toString().length>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<un.length;Cn+=1){var ti=un[Cn],Un=ti.feature,ei=ti.id,li=ti.index,xi=ti.sourceLayerIndex,Vi=xe._featureFilter.needGeometry,Ni=bo(Un,Vi);if(xe._featureFilter.filter(ja,Ni,ie)){Vi||(Ni.geometry=ci(Un));var Mo=void 0;if(Ht){var io=xe.getValueAndResolveTokens("text-field",Ni,ie,pa),_o=iu.factory(io);IW(_o)&&(this.hasRTLText=!0),(!this.hasRTLText||$o()==="unavailable"||this.hasRTLText&&el.isParsed())&&(Mo=$a(_o,xe,Ni))}var Ms=void 0;if(tr){var Eo=xe.getValueAndResolveTokens("icon-image",Ni,ie,pa);Eo instanceof Ll?Ms=Eo:Ms=Ll.fromString(Eo)}if(!(!Mo&&!Ms)){var Ro=this.sortFeaturesByKey?Cr.evaluate(Ni,{},ie):void 0,Zs={id:ei,text:Mo,icon:Ms,index:li,sourceLayerIndex:xi,geometry:Ni.geometry,properties:Un.properties,type:LW[Un.type],sortKey:Ro};if(this.features.push(Zs),Ms&&(Xr[Ms.name]=!0),Mo){var _s=qe.evaluate(Ni,{},ie).join(","),Wl=Ie.get("text-rotation-alignment")==="map"&&Ie.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(dp.vertical)>=0;for(var zu=0,Xl=Mo.sections;zu<Xl.length;zu+=1){var Zl=Xl[zu];if(Zl.image)Xr[Zl.image.name]=!0;else{var Ol=gr(Mo.toString()),$u=Zl.fontStack||_s,hc=Vr[$u]=Vr[$u]||{};this.calculateGlyphDependencies(Zl.text,hc,Wl,this.allowVerticalPlacement,Ol)}}}}}}Ie.get("symbol-placement")==="line"&&(this.features=Kn(this.features)),this.sortFeaturesByKey&&this.features.sort(function(cf,yf){return cf.sortKey-yf.sortKey})}},Du.prototype.update=function(k,V,ie){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(k,V,this.layers,ie),this.icon.programConfigurations.updatePaintArrays(k,V,this.layers,ie))},Du.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Du.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Du.prototype.upload=function(k){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(k),this.iconCollisionBox.upload(k)),this.text.upload(k,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(k,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Du.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Du.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Du.prototype.addToLineVertexArray=function(k,V){var ie=this.lineVertexArray.length;if(k.segment!==void 0){for(var xe=k.dist(V[k.segment+1]),Ie=k.dist(V[k.segment]),qe={},ht=k.segment+1;ht<V.length;ht++)qe[ht]={x:V[ht].x,y:V[ht].y,tileUnitDistanceFromAnchor:xe},ht<V.length-1&&(xe+=V[ht+1].dist(V[ht]));for(var Rt=k.segment||0;Rt>=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;Ht<V.length;Ht++){var tr=qe[Ht];this.lineVertexArray.emplaceBack(tr.x,tr.y,tr.tileUnitDistanceFromAnchor)}}return{lineStartIndex:ie,lineLength:this.lineVertexArray.length-ie}},Du.prototype.addSymbols=function(k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr,Xr){for(var Vr=k.indexArray,pa=k.layoutVertexArray,ja=k.segments.prepareSegment(4*V.length,pa,Vr,this.canOverlap?qe.sortKey:void 0),Cn=this.glyphOffsetArray.length,un=ja.vertexLength,ti=this.allowVerticalPlacement&&ht===dp.vertical?Math.PI/2:0,Un=qe.text&&qe.text.sections,ei=0;ei<V.length;ei++){var li=V[ei],xi=li.tl,Vi=li.tr,Ni=li.bl,Mo=li.br,io=li.tex,_o=li.pixelOffsetTL,Ms=li.pixelOffsetBR,Eo=li.minFontScaleX,Ro=li.minFontScaleY,Zs=li.glyphOffset,_s=li.isSDF,Wl=li.sectionIndex,zu=ja.vertexLength,Xl=Zs[1];hb(pa,Rt.x,Rt.y,xi.x,Xl+xi.y,io.x,io.y,ie,_s,_o.x,_o.y,Eo,Ro),hb(pa,Rt.x,Rt.y,Vi.x,Xl+Vi.y,io.x+io.w,io.y,ie,_s,Ms.x,_o.y,Eo,Ro),hb(pa,Rt.x,Rt.y,Ni.x,Xl+Ni.y,io.x,io.y+io.h,ie,_s,_o.x,Ms.y,Eo,Ro),hb(pa,Rt.x,Rt.y,Mo.x,Xl+Mo.y,io.x+io.w,io.y+io.h,ie,_s,Ms.x,Ms.y,Eo,Ro),vA(k.dynamicLayoutVertexArray,Rt,ti),Vr.emplaceBack(zu,zu+1,zu+2),Vr.emplaceBack(zu+1,zu+2,zu+3),ja.vertexLength+=4,ja.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Zs[0]),(ei===V.length-1||Wl!==V[ei+1].sectionIndex)&&k.programConfigurations.populatePaintArrays(pa.length,qe,qe.index,{},Xr,Un&&Un[Wl])}k.placedSymbolArray.emplaceBack(Rt.x,Rt.y,Cn,this.glyphOffsetArray.length-Cn,un,Ht,tr,Rt.segment,ie?ie[0]:0,ie?ie[1]:0,xe[0],xe[1],ht,0,!1,0,Cr)},Du.prototype._addCollisionDebugVertex=function(k,V,ie,xe,Ie,qe){return V.emplaceBack(0,0),k.emplaceBack(ie.x,ie.y,xe,Ie,Math.round(qe.x),Math.round(qe.y))},Du.prototype.addCollisionDebugVertices=function(k,V,ie,xe,Ie,qe,ht){var Rt=Ie.segments.prepareSegment(4,Ie.layoutVertexArray,Ie.indexArray),Ht=Rt.vertexLength,tr=Ie.layoutVertexArray,Cr=Ie.collisionVertexArray,Xr=ht.anchorX,Vr=ht.anchorY;this._addCollisionDebugVertex(tr,Cr,qe,Xr,Vr,new n(k,V)),this._addCollisionDebugVertex(tr,Cr,qe,Xr,Vr,new n(ie,V)),this._addCollisionDebugVertex(tr,Cr,qe,Xr,Vr,new n(ie,xe)),this._addCollisionDebugVertex(tr,Cr,qe,Xr,Vr,new n(k,xe)),Rt.vertexLength+=4;var pa=Ie.indexArray;pa.emplaceBack(Ht,Ht+1),pa.emplaceBack(Ht+1,Ht+2),pa.emplaceBack(Ht+2,Ht+3),pa.emplaceBack(Ht+3,Ht),Rt.primitiveLength+=4},Du.prototype.addDebugCollisionBoxes=function(k,V,ie,xe){for(var Ie=k;Ie<V;Ie++){var qe=this.collisionBoxArray.get(Ie),ht=qe.x1,Rt=qe.y1,Ht=qe.x2,tr=qe.y2;this.addCollisionDebugVertices(ht,Rt,Ht,tr,xe?this.textCollisionBox:this.iconCollisionBox,qe.anchorPoint,ie)}},Du.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new e_(Fn,Ut.members,Ri),this.iconCollisionBox=new e_(Fn,Ut.members,Ri);for(var k=0;k<this.symbolInstances.length;k++){var V=this.symbolInstances.get(k);this.addDebugCollisionBoxes(V.textBoxStartIndex,V.textBoxEndIndex,V,!0),this.addDebugCollisionBoxes(V.verticalTextBoxStartIndex,V.verticalTextBoxEndIndex,V,!0),this.addDebugCollisionBoxes(V.iconBoxStartIndex,V.iconBoxEndIndex,V,!1),this.addDebugCollisionBoxes(V.verticalIconBoxStartIndex,V.verticalIconBoxEndIndex,V,!1)}},Du.prototype._deserializeCollisionBoxesForSymbol=function(k,V,ie,xe,Ie,qe,ht,Rt,Ht){for(var tr={},Cr=V;Cr<ie;Cr++){var Xr=k.get(Cr);tr.textBox={x1:Xr.x1,y1:Xr.y1,x2:Xr.x2,y2:Xr.y2,anchorPointX:Xr.anchorPointX,anchorPointY:Xr.anchorPointY},tr.textFeatureIndex=Xr.featureIndex;break}for(var Vr=xe;Vr<Ie;Vr++){var pa=k.get(Vr);tr.verticalTextBox={x1:pa.x1,y1:pa.y1,x2:pa.x2,y2:pa.y2,anchorPointX:pa.anchorPointX,anchorPointY:pa.anchorPointY},tr.verticalTextFeatureIndex=pa.featureIndex;break}for(var ja=qe;ja<ht;ja++){var Cn=k.get(ja);tr.iconBox={x1:Cn.x1,y1:Cn.y1,x2:Cn.x2,y2:Cn.y2,anchorPointX:Cn.anchorPointX,anchorPointY:Cn.anchorPointY},tr.iconFeatureIndex=Cn.featureIndex;break}for(var un=Rt;un<Ht;un++){var ti=k.get(un);tr.verticalIconBox={x1:ti.x1,y1:ti.y1,x2:ti.x2,y2:ti.y2,anchorPointX:ti.anchorPointX,anchorPointY:ti.anchorPointY},tr.verticalIconFeatureIndex=ti.featureIndex;break}return tr},Du.prototype.deserializeCollisionBoxes=function(k){this.collisionArrays=[];for(var V=0;V<this.symbolInstances.length;V++){var ie=this.symbolInstances.get(V);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(k,ie.textBoxStartIndex,ie.textBoxEndIndex,ie.verticalTextBoxStartIndex,ie.verticalTextBoxEndIndex,ie.iconBoxStartIndex,ie.iconBoxEndIndex,ie.verticalIconBoxStartIndex,ie.verticalIconBoxEndIndex))}},Du.prototype.hasTextData=function(){return this.text.segments.get().length>0},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;Ie<xe;Ie+=4)k.indexArray.emplaceBack(Ie,Ie+1,Ie+2),k.indexArray.emplaceBack(Ie+1,Ie+2,Ie+3)},Du.prototype.getSortedSymbolIndexes=function(k){if(this.sortedAngle===k&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var V=Math.sin(k),ie=Math.cos(k),xe=[],Ie=[],qe=[],ht=0;ht<this.symbolInstances.length;++ht){qe.push(ht);var Rt=this.symbolInstances.get(ht);xe.push(Math.round(V*Rt.anchorX+ie*Rt.anchorY)|0),Ie.push(Rt.featureIndex)}return qe.sort(function(Ht,tr){return xe[Ht]-xe[tr]||Ie[tr]-Ie[Ht]}),qe},Du.prototype.addToSortKeyRanges=function(k,V){var ie=this.sortKeyRanges[this.sortKeyRanges.length-1];ie&&ie.sortKey===V?ie.symbolInstanceEnd=k+1:this.sortKeyRanges.push({sortKey:V,symbolInstanceStart:k,symbolInstanceEnd:k+1})},Du.prototype.sortFeatures=function(k){var V=this;if(this.sortFeaturesByY&&this.sortedAngle!==k&&!(this.text.segments.get().length>1||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<xe.length;ie+=1){var Ie=xe[ie],qe=this.symbolInstances.get(Ie);this.featureSortOrder.push(qe.featureIndex),[qe.rightJustifiedTextSymbolIndex,qe.centerJustifiedTextSymbolIndex,qe.leftJustifiedTextSymbolIndex].forEach(function(ht,Rt,Ht){ht>=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<Rt.length;ht+=1){var Ht=Rt[ht];qe.indexOf(Ht)<0&&qe.push(Ht)}this.layout._values["text-writing-mode"]=qe}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},k.prototype.getValueAndResolveTokens=function(ie,xe,Ie,qe){var ht=this.layout.get(ie).evaluate(xe,{},Ie,qe),Rt=this._unevaluatedLayout._values[ie];return!Rt.isDataDriven()&&!fo(Rt.value)&&ht?RW(xe.properties,ht):ht},k.prototype.createBucket=function(ie){return new Du(ie)},k.prototype.queryRadius=function(){return 0},k.prototype.queryIntersectsFeature=function(){return!1},k.prototype._setPaintOverrides=function(){for(var ie=0,xe=mA.paint.overridableProperties;ie<xe.length;ie+=1){var Ie=xe[ie];if(k.hasPaintOverride(this.layout,Ie)){var qe=this.paint.get(Ie),ht=new V0(qe),Rt=new gc(ht,qe.property.specification),Ht=null;qe.value.kind==="constant"||qe.value.kind==="source"?Ht=new Ic("source",Rt):Ht=new lc("composite",Rt,qe.value.zoomStops,qe.value._interpolationType),this.paint._values[Ie]=new Il(qe.property,Ht,qe.parameters)}}},k.prototype._handleOverridablePaintPropertyUpdate=function(ie,xe,Ie){return!this.layout||xe.isDataDriven()||Ie.isDataDriven()?!1:k.hasPaintOverride(this.layout,ie)},k.hasPaintOverride=function(ie,xe){var Ie=ie.get("text-field"),qe=mA.paint.properties[xe],ht=!1,Rt=function(Cr){for(var Xr=0,Vr=Cr;Xr<Vr.length;Xr+=1){var pa=Vr[Xr];if(qe.overrides&&qe.overrides.hasOverride(pa)){ht=!0;return}}};if(Ie.value.kind==="constant"&&Ie.value.value instanceof iu)Rt(Ie.value.value.sections);else if(Ie.value.kind==="source"){var Ht=function(Cr){if(!ht)if(Cr instanceof gs&&nl(Cr.value)===fl){var Xr=Cr.value;Rt(Xr.sections)}else Cr instanceof Vu?Rt(Cr.sections):Cr.eachChild(Ht)},tr=Ie.value;tr._styleExpression&&Ht(tr._styleExpression.expression)}return ht},k}(Ja),OW=new xa({"background-color":new nt(jn.paint_background["background-color"]),"background-pattern":new ua(jn.paint_background["background-pattern"]),"background-opacity":new nt(jn.paint_background["background-opacity"])}),BW={paint:OW},NW=function(C){function k(V){C.call(this,V,BW)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k}(Ja),UW=new xa({"raster-opacity":new nt(jn.paint_raster["raster-opacity"]),"raster-hue-rotate":new nt(jn.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new nt(jn.paint_raster["raster-brightness-min"]),"raster-brightness-max":new nt(jn.paint_raster["raster-brightness-max"]),"raster-saturation":new nt(jn.paint_raster["raster-saturation"]),"raster-contrast":new nt(jn.paint_raster["raster-contrast"]),"raster-resampling":new nt(jn.paint_raster["raster-resampling"]),"raster-fade-duration":new nt(jn.paint_raster["raster-fade-duration"])}),jW={paint:UW},VW=function(C){function k(V){C.call(this,V,jW)}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k}(Ja);function qW(C){var k=[],V=C.id;return V===void 0&&k.push({message:"layers."+V+': missing required property "id"'}),C.render===void 0&&k.push({message:"layers."+V+': missing required method "render"'}),C.renderingMode&&C.renderingMode!=="2d"&&C.renderingMode!=="3d"&&k.push({message:"layers."+V+': property "renderingMode" must be either "2d" or "3d"'}),k}var GW=function(C){function k(V){C.call(this,V,{}),this.implementation=V}return C&&(k.__proto__=C),k.prototype=Object.create(C&&C.prototype),k.prototype.constructor=k,k.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},k.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},k.prototype.recalculate=function(){},k.prototype.updateTransitions=function(){},k.prototype.hasTransition=function(){},k.prototype.serialize=function(){},k.prototype.onAdd=function(ie){this.implementation.onAdd&&this.implementation.onAdd(ie,ie.painter.context.gl)},k.prototype.onRemove=function(ie){this.implementation.onRemove&&this.implementation.onRemove(ie,ie.painter.context.gl)},k}(Ja),HW={circle:XT,heatmap:T0,hillshade:Ix,fill:Rg,"fill-extrusion":pv,line:D,symbol:FW,background:NW,raster:VW};function WW(C){return C.type==="custom"?new GW(C):new HW[C.type](C)}var kk=s.HTMLImageElement,Lk=s.HTMLCanvasElement,Pk=s.HTMLVideoElement,Ik=s.ImageData,pb=s.ImageBitmap,Og=function(k,V,ie,xe){this.context=k,this.format=ie,this.texture=k.gl.createTexture(),this.update(V,xe)};Og.prototype.update=function(k,V,ie){var xe=k.width,Ie=k.height,qe=(!this.size||this.size[0]!==xe||this.size[1]!==Ie)&&!ie,ht=this,Rt=ht.context,Ht=Rt.gl;if(this.useMipmap=!!(V&&V.useMipmap),Ht.bindTexture(Ht.TEXTURE_2D,this.texture),Rt.pixelStoreUnpackFlipY.set(!1),Rt.pixelStoreUnpack.set(1),Rt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ht.RGBA&&(!V||V.premultiply!==!1)),qe)this.size=[xe,Ie],k instanceof kk||k instanceof Lk||k instanceof Pk||k instanceof Ik||pb&&k instanceof pb?Ht.texImage2D(Ht.TEXTURE_2D,0,this.format,this.format,Ht.UNSIGNED_BYTE,k):Ht.texImage2D(Ht.TEXTURE_2D,0,this.format,xe,Ie,0,this.format,Ht.UNSIGNED_BYTE,k.data);else{var tr=ie||{x:0,y:0},Cr=tr.x,Xr=tr.y;k instanceof kk||k instanceof Lk||k instanceof Pk||k instanceof Ik||pb&&k instanceof pb?Ht.texSubImage2D(Ht.TEXTURE_2D,0,Cr,Xr,Ht.RGBA,Ht.UNSIGNED_BYTE,k):Ht.texSubImage2D(Ht.TEXTURE_2D,0,Cr,Xr,xe,Ie,Ht.RGBA,Ht.UNSIGNED_BYTE,k.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ht.generateMipmap(Ht.TEXTURE_2D)},Og.prototype.bind=function(k,V,ie){var xe=this,Ie=xe.context,qe=Ie.gl;qe.bindTexture(qe.TEXTURE_2D,this.texture),ie===qe.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(ie=qe.LINEAR),k!==this.filter&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,k),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,ie||k),this.filter=k),V!==this.wrap&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,V),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,V),this.wrap=V)},Og.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},Og.prototype.destroy=function(){var k=this.context,V=k.gl;V.deleteTexture(this.texture),this.texture=null};var gA=function(k){var V=this;this._callback=k,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){V._triggered=!1,V._callback()})};gA.prototype.trigger=function(){var k=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){k._triggered=!1,k._callback()},0))},gA.prototype.remove=function(){delete this._channel,this._callback=function(){}};var q0=function(k,V,ie){this.target=k,this.parent=V,this.mapId=ie,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},L(["receive","process"],this),this.invoker=new gA(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=se()?k:s};q0.prototype.send=function(k,V,ie,xe,Ie){var qe=this;Ie===void 0&&(Ie=!1);var ht=Math.round(Math.random()*1e18).toString(36).substring(0,10);ie&&(this.callbacks[ht]=ie);var Rt=$(this.globalScope)?void 0:[];return this.target.postMessage({id:ht,type:k,hasCallback:!!ie,targetMapId:xe,mustQueue:Ie,sourceMapId:this.mapId,data:_t(V,Rt)},Rt),{cancel:function(){ie&&delete qe.callbacks[ht],qe.target.postMessage({id:ht,type:"<cancel>",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==="<cancel>"){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==="<response>"){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:"<response>",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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};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<this.overscaledZ&&k.canonical.x===this.canonical.x>>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.wrap<k.wrap?!0:this.wrap>k.wrap?!1:this.overscaledZ<k.overscaledZ?!0:this.overscaledZ>k.overscaledZ?!1:this.canonical.x<k.canonical.x?!0:this.canonical.x>k.canonical.x?!1:this.canonical.y<k.canonical.y},Hf.prototype.wrapped=function(){return new Hf(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Hf.prototype.unwrapTo=function(k){return new Hf(this.overscaledZ,k,this.canonical.z,this.canonical.x,this.canonical.y)},Hf.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Hf.prototype.toUnwrapped=function(){return new Uk(this.wrap,this.canonical)},Hf.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Hf.prototype.getTilePoint=function(k){return this.canonical.getTilePoint(new Bg(k.x-this.wrap,k.y))};function t_(C,k,V,ie,xe){C*=2,C<0&&(C=C*-1-1);var Ie=1<<V;return(Ie*Ie*C+Ie*xe+ie).toString(36)+V.toString(36)+k.toString(36)}function JW(C,k,V){for(var ie="",xe,Ie=C;Ie>0;Ie--)xe=1<<Ie-1,ie+=(k&xe?1:0)+(V&xe?2:0);return ie}de("CanonicalTileID",Ng),de("OverscaledTileID",Hf,{omit:["posMatrix"]});var Bv=function(k,V,ie){if(this.uid=k,V.height!==V.width)throw new RangeError("DEM tiles must be square");if(ie&&ie!=="mapbox"&&ie!=="terrarium")return U('"'+ie+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=V.height;var xe=this.dim=V.height-2;this.data=new Uint32Array(V.data.buffer),this.encoding=ie||"mapbox";for(var Ie=0;Ie<xe;Ie++)this.data[this._idx(-1,Ie)]=this.data[this._idx(0,Ie)],this.data[this._idx(xe,Ie)]=this.data[this._idx(xe-1,Ie)],this.data[this._idx(Ie,-1)]=this.data[this._idx(Ie,0)],this.data[this._idx(Ie,xe)]=this.data[this._idx(Ie,xe-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(xe,-1)]=this.data[this._idx(xe-1,0)],this.data[this._idx(-1,xe)]=this.data[this._idx(0,xe-1)],this.data[this._idx(xe,xe)]=this.data[this._idx(xe-1,xe-1)]};Bv.prototype.get=function(k,V){var ie=new Uint8Array(this.data.buffer),xe=this._idx(k,V)*4,Ie=this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox;return Ie(ie[xe],ie[xe+1],ie[xe+2])},Bv.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Bv.prototype._idx=function(k,V){if(k<-1||k>=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<ht;tr++)for(var Cr=xe;Cr<Ie;Cr++)this.data[this._idx(Cr,tr)]=k.data[this._idx(Cr+Rt,tr+Ht)]},de("DEMData",Bv);function $W(C,k){var V={};if(!k)return V;for(var ie=function(){var qe=Ie[xe],ht=qe.layerIds.map(function(Cr){return k.getLayer(Cr)}).filter(Boolean);if(ht.length!==0){qe.layers=ht,qe.stateDependentLayerIds&&(qe.stateDependentLayers=qe.stateDependentLayerIds.map(function(Cr){return ht.filter(function(Xr){return Xr.id===Cr})[0]}));for(var Rt=0,Ht=ht;Rt<Ht.length;Rt+=1){var tr=Ht[Rt];V[tr.id]=qe}}},xe=0,Ie=C;xe<Ie.length;xe+=1)ie();return V}var db=function(k){this._stringToNumber={},this._numberToString=[];for(var V=0;V<k.length;V++){var ie=k[V];this._stringToNumber[ie]=V,this._numberToString[V]=ie}};db.prototype.encode=function(k){return this._stringToNumber[k]},db.prototype.decode=function(k){return this._numberToString[k]};var vb=function(k,V,ie,xe,Ie){this.type="Feature",this._vectorTileFeature=k,k._z=V,k._x=ie,k._y=xe,this.properties=k.properties,this.id=Ie},_A={geometry:{configurable:!0}};_A.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},_A.geometry.set=function(C){this._geometry=C},vb.prototype.toJSON=function(){var k={geometry:this.geometry};for(var V in this)V==="_geometry"||V==="_vectorTileFeature"||(k[V]=this[V]);return k},Object.defineProperties(vb.prototype,_A);var G0=function(){this.state={},this.stateChanges={},this.deletedStates={}};G0.prototype.updateState=function(k,V,ie){var xe=String(V);if(this.stateChanges[k]=this.stateChanges[k]||{},this.stateChanges[k][xe]=this.stateChanges[k][xe]||{},g(this.stateChanges[k][xe],ie),this.deletedStates[k]===null){this.deletedStates[k]={};for(var Ie in this.state[k])Ie!==xe&&(this.deletedStates[k][Ie]=null)}else{var qe=this.deletedStates[k]&&this.deletedStates[k][xe]===null;if(qe){this.deletedStates[k][xe]={};for(var ht in this.state[k][xe])ie[ht]||(this.deletedStates[k][xe][ht]=null)}else for(var Rt in ie){var Ht=this.deletedStates[k]&&this.deletedStates[k][xe]&&this.deletedStates[k][xe][Rt]===null;Ht&&delete this.deletedStates[k][xe][Rt]}}},G0.prototype.removeFeatureState=function(k,V,ie){var xe=this.deletedStates[k]===null;if(!xe){var Ie=String(V);if(this.deletedStates[k]=this.deletedStates[k]||{},ie&&V!==void 0)this.deletedStates[k][Ie]!==null&&(this.deletedStates[k][Ie]=this.deletedStates[k][Ie]||{},this.deletedStates[k][Ie][ie]=null);else if(V!==void 0){var qe=this.stateChanges[k]&&this.stateChanges[k][Ie];if(qe){this.deletedStates[k][Ie]={};for(ie in this.stateChanges[k][Ie])this.deletedStates[k][Ie][ie]=null}else this.deletedStates[k][Ie]=null}else this.deletedStates[k]=null}},G0.prototype.getState=function(k,V){var ie=String(V),xe=this.state[k]||{},Ie=this.stateChanges[k]||{},qe=g({},xe[ie],Ie[ie]);if(this.deletedStates[k]===null)return{};if(this.deletedStates[k]){var ht=this.deletedStates[k][V];if(ht===null)return{};for(var Rt in ht)delete qe[Rt]}return qe},G0.prototype.initializeTileState=function(k,V){k.setFeatureState(this.state,V)},G0.prototype.coalesceChanges=function(k,V){var ie={};for(var xe in this.stateChanges){this.state[xe]=this.state[xe]||{};var Ie={};for(var qe in this.stateChanges[xe])this.state[xe][qe]||(this.state[xe][qe]={}),g(this.state[xe][qe],this.stateChanges[xe][qe]),Ie[qe]=this.state[xe][qe];ie[xe]=Ie}for(var ht in this.deletedStates){this.state[ht]=this.state[ht]||{};var Rt={};if(this.deletedStates[ht]===null)for(var Ht in this.state[ht])Rt[Ht]={},this.state[ht][Ht]={};else for(var tr in this.deletedStates[ht]){var Cr=this.deletedStates[ht][tr]===null;if(Cr)this.state[ht][tr]={};else for(var Xr=0,Vr=Object.keys(this.deletedStates[ht][tr]);Xr<Vr.length;Xr+=1){var pa=Vr[Xr];delete this.state[ht][tr][pa]}Rt[tr]=this.state[ht][tr]}ie[ht]=ie[ht]||{},g(ie[ht],Rt)}if(this.stateChanges={},this.deletedStates={},Object.keys(ie).length!==0)for(var ja in k){var Cn=k[ja];Cn.setFeatureState(ie,V)}};var Nv=function(k,V){this.tileID=k,this.x=k.canonical.x,this.y=k.canonical.y,this.z=k.canonical.z,this.grid=new hu(dn,16,0),this.grid3D=new hu(dn,16,0),this.featureIndexArray=new bl,this.promoteId=V};Nv.prototype.insert=function(k,V,ie,xe,Ie,qe){var ht=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ie,xe,Ie);for(var Rt=qe?this.grid3D:this.grid,Ht=0;Ht<V.length;Ht++){for(var tr=V[Ht],Cr=[1/0,1/0,-1/0,-1/0],Xr=0;Xr<tr.length;Xr++){var Vr=tr[Xr];Cr[0]=Math.min(Cr[0],Vr.x),Cr[1]=Math.min(Cr[1],Vr.y),Cr[2]=Math.max(Cr[2],Vr.x),Cr[3]=Math.max(Cr[3],Vr.y)}Cr[0]<dn&&Cr[1]<dn&&Cr[2]>=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;ja<Cn.length;ja+=1){var un=Cn[ja];Xr.push(un)}Xr.sort(QW);for(var ti={},Un,ei=function(xi){var Vi=Xr[xi];if(Vi!==Un){Un=Vi;var Ni=Ie.featureIndexArray.get(Vi),Mo=null;Ie.loadMatchingFeature(ti,Ni.bucketIndex,Ni.sourceLayerIndex,Ni.featureIndex,Rt,qe.layers,qe.availableImages,V,ie,xe,function(io,_o,Ms){return Mo||(Mo=ci(io)),_o.queryIntersectsFeature(Ht,io,Ms,Mo,Ie.z,k.transform,ht,k.pixelPosMatrix)})}},li=0;li<Xr.length;li++)ei(li);return ti},Nv.prototype.loadMatchingFeature=function(k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr,Cr){var Xr=this.bucketLayerIDs[V];if(!(qe&&!I(qe,Xr))){var Vr=this.sourceLayerCoder.decode(ie),pa=this.vtLayers[Vr],ja=pa.feature(xe);if(Ie.needGeometry){var Cn=bo(ja,!0);if(!Ie.filter(new gi(this.tileID.overscaledZ),Cn,this.tileID.canonical))return}else if(!Ie.filter(new gi(this.tileID.overscaledZ),ja))return;for(var un=this.getId(ja,Vr),ti=0;ti<Xr.length;ti++){var Un=Xr[ti];if(!(qe&&qe.indexOf(Un)<0)){var ei=Rt[Un];if(ei){var li={};un!==void 0&&tr&&(li=tr.getState(ei.sourceLayer||"_geojsonTileLayer",un));var xi=g({},Ht[Un]);xi.paint=jk(xi.paint,ei.paint,ja,li,ht),xi.layout=jk(xi.layout,ei.layout,ja,li,ht);var Vi=!Cr||Cr(ja,ei,li);if(Vi){var Ni=new vb(ja,this.z,this.x,this.y,un);Ni.layer=xi;var Mo=k[Un];Mo===void 0&&(Mo=k[Un]=[]),Mo.push({featureIndex:xe,feature:Ni,intersectionZ:Vi})}}}}}},Nv.prototype.lookupSymbolFeatures=function(k,V,ie,xe,Ie,qe,ht,Rt){var Ht={};this.loadVTLayers();for(var tr=Je(Ie),Cr=0,Xr=k;Cr<Xr.length;Cr+=1){var Vr=Xr[Cr];this.loadMatchingFeature(Ht,ie,xe,Vr,tr,qe,ht,Rt,V)}return Ht},Nv.prototype.hasLayer=function(k){for(var V=0,ie=this.bucketLayerIDs;V<ie.length;V+=1)for(var xe=ie[V],Ie=0,qe=xe;Ie<qe.length;Ie+=1){var ht=qe[Ie];if(k===ht)return!0}return!1},Nv.prototype.getId=function(k,V){var ie=k.id;if(this.promoteId){var xe=typeof this.promoteId=="string"?this.promoteId:this.promoteId[V];ie=k.properties[xe],typeof ie=="boolean"&&(ie=Number(ie))}return ie},de("FeatureIndex",Nv,{omit:["rawTileData","sourceLayerCoder"]});function jk(C,k,V,ie,xe){return F(C,function(Ie,qe){var ht=k instanceof yc?k.get(qe):null;return ht&&ht.evaluate?ht.evaluate(V,ie,xe):ht})}function Vk(C){for(var k=1/0,V=1/0,ie=-1/0,xe=-1/0,Ie=0,qe=C;Ie<qe.length;Ie+=1){var ht=qe[Ie];k=Math.min(k,ht.x),V=Math.min(V,ht.y),ie=Math.max(ie,ht.x),xe=Math.max(xe,ht.y)}return{minX:k,minY:V,maxX:ie,maxY:xe}}function QW(C,k){return k-C}var eX=3e4,ph=function(k,V){this.tileID=k,this.uid=u(),this.uses=0,this.tileSize=V,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ph.prototype.registerFadeDuration=function(k){var V=k+this.timeAdded;V<be.now()||this.fadeEndTime&&V<this.fadeEndTime||(this.fadeEndTime=V)},ph.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},ph.prototype.loadVectorData=function(k,V,ie){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!k){this.collisionBoxArray=new ho;return}k.featureIndex&&(this.latestFeatureIndex=k.featureIndex,k.rawTileData?(this.latestRawTileData=k.rawTileData,this.latestFeatureIndex.rawTileData=k.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=k.collisionBoxArray,this.buckets=$W(k.buckets,V.style),this.hasSymbolBuckets=!1;for(var xe in this.buckets){var Ie=this.buckets[xe];if(Ie instanceof Du)if(this.hasSymbolBuckets=!0,ie)Ie.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var qe in this.buckets){var ht=this.buckets[qe];if(ht instanceof Du&&ht.hasRTLText){this.hasRTLText=!0,_l();break}}this.queryPadding=0;for(var Rt in this.buckets){var Ht=this.buckets[Rt];this.queryPadding=Math.max(this.queryPadding,V.style.getLayer(Rt).queryRadius(Ht))}k.imageAtlas&&(this.imageAtlas=k.imageAtlas),k.glyphAtlasImage&&(this.glyphAtlasImage=k.glyphAtlasImage)},ph.prototype.unloadVectorData=function(){for(var k in this.buckets)this.buckets[k].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ph.prototype.getBucket=function(k){return this.buckets[k.id]},ph.prototype.upload=function(k){for(var V in this.buckets){var ie=this.buckets[V];ie.uploadPending()&&ie.upload(k)}var xe=k.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Og(k,this.imageAtlas.image,xe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Og(k,this.glyphAtlasImage,xe.ALPHA),this.glyphAtlasImage=null)},ph.prototype.prepare=function(k){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(k,this.imageAtlasTexture)},ph.prototype.queryRenderedFeatures=function(k,V,ie,xe,Ie,qe,ht,Rt,Ht,tr){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:xe,cameraQueryGeometry:Ie,scale:qe,tileSize:this.tileSize,pixelPosMatrix:tr,transform:Rt,params:ht,queryPadding:this.queryPadding*Ht},k,V,ie)},ph.prototype.querySourceFeatures=function(k,V){var ie=this.latestFeatureIndex;if(!(!ie||!ie.rawTileData)){var xe=ie.loadVTLayers(),Ie=V?V.sourceLayer:"",qe=xe._geojsonTileLayer||xe[Ie];if(qe)for(var ht=Je(V&&V.filter),Rt=this.tileID.canonical,Ht=Rt.z,tr=Rt.x,Cr=Rt.y,Xr={z:Ht,x:tr,y:Cr},Vr=0;Vr<qe.length;Vr++){var pa=qe.feature(Vr);if(ht.needGeometry){var ja=bo(pa,!0);if(!ht.filter(new gi(this.tileID.overscaledZ),ja,this.tileID.canonical))continue}else if(!ht.filter(new gi(this.tileID.overscaledZ),pa))continue;var Cn=ie.getId(pa,Ie),un=new vb(pa,Ht,tr,Cr,Cn);un.tile=Xr,k.push(un)}}},ph.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},ph.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ph.prototype.setExpiryData=function(k){var V=this.expirationTime;if(k.cacheControl){var ie=he(k.cacheControl);ie["max-age"]&&(this.expirationTime=Date.now()+ie["max-age"]*1e3)}else k.expires&&(this.expirationTime=new Date(k.expires).getTime());if(this.expirationTime){var xe=Date.now(),Ie=!1;if(this.expirationTime>xe)Ie=!1;else if(!V)Ie=!0;else if(this.expirationTime<V)Ie=!0;else{var qe=this.expirationTime-V;qe?this.expirationTime=xe+Math.max(qe,eX):Ie=!0}Ie?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ph.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},ph.prototype.setFeatureState=function(k,V){if(!(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(k).length===0)){var ie=this.latestFeatureIndex.loadVTLayers();for(var xe in this.buckets)if(V.style.hasLayer(xe)){var Ie=this.buckets[xe],qe=Ie.layers[0].sourceLayer||"_geojsonTileLayer",ht=ie[qe],Rt=k[qe];if(!(!ht||!Rt||Object.keys(Rt).length===0)){Ie.update(Rt,ht,this.imageAtlas&&this.imageAtlas.patternPositions||{});var Ht=V&&V.style&&V.style.getLayer(xe);Ht&&(this.queryPadding=Math.max(this.queryPadding,Ht.queryRadius(Ie)))}}}},ph.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},ph.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<be.now()},ph.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ph.prototype.setHoldDuration=function(k){this.symbolFadeHoldUntil=be.now()+k},ph.prototype.setDependencies=function(k,V){for(var ie={},xe=0,Ie=V;xe<Ie.length;xe+=1){var qe=Ie[xe];ie[qe]=!0}this.dependencies[k]=ie},ph.prototype.hasDependency=function(k,V){for(var ie=0,xe=k;ie<xe.length;ie+=1){var Ie=xe[ie],qe=this.dependencies[Ie];if(qe)for(var ht=0,Rt=V;ht<Rt.length;ht+=1){var Ht=Rt[ht];if(qe[Ht])return!0}}return!1};var tX=["type","source","source-layer","minzoom","maxzoom","filter","layout"],gm=s.performance,qk=function(k){this._marks={start:[k.url,"start"].join("#"),end:[k.url,"end"].join("#"),measure:k.url.toString()},gm.mark(this._marks.start)};qk.prototype.finish=function(){gm.mark(this._marks.end);var k=gm.getEntriesByName(this._marks.measure);return k.length===0&&(gm.measure(this._marks.measure,this._marks.start,this._marks.end),k=gm.getEntriesByName(this._marks.measure),gm.clearMarks(this._marks.start),gm.clearMarks(this._marks.end),gm.clearMeasures(this._marks.measure)),k},e.Actor=q0,e.AlphaImage=kp,e.CanonicalTileID=Ng,e.CollisionBoxArray=ho,e.Color=Us,e.DEMData=Bv,e.DataConstantProperty=nt,e.DictionaryCoder=db,e.EXTENT=dn,e.ErrorEvent=Kr,e.EvaluationParameters=gi,e.Event=Gr,e.Evented=Ur,e.FeatureIndex=Nv,e.FillBucket=ad,e.FillExtrusionBucket=fd,e.ImageAtlas=Zd,e.ImagePosition=Pf,e.LineBucket=qf,e.LngLat=Dc,e.LngLatBounds=Gf,e.MercatorCoordinate=Bg,e.ONE_EM=ai,e.OverscaledTileID=Hf,e.Point=n,e.Point$1=n,e.Properties=xa,e.Protobuf=yo,e.RGBAImage=$f,e.RequestManager=fe,e.RequestPerformance=qk,e.ResourceType=en,e.SegmentVector=Lo,e.SourceFeatureState=G0,e.StructArrayLayout1ui2=Gi,e.StructArrayLayout2f1f2i16=Mn,e.StructArrayLayout2i4=Ea,e.StructArrayLayout3ui6=Jn,e.StructArrayLayout4i8=an,e.SymbolBucket=Du,e.Texture=Og,e.Tile=ph,e.Transitionable=ps,e.Uniform1f=Et,e.Uniform1i=gt,e.Uniform2f=Ft,e.Uniform3f=nr,e.Uniform4f=fr,e.UniformColor=sr,e.UniformMatrix4f=lr,e.UnwrappedTileID=Uk,e.ValidationError=Ci,e.WritingMode=dp,e.ZoomHistory=ar,e.add=Cp,e.addDynamicAttributes=vA,e.asyncAll=w,e.bezier=d,e.bindAll=L,e.browser=be,e.cacheEntryPossiblyAdded=la,e.clamp=l,e.clearTileCache=Ba,e.clipLine=Tk,e.clone=im,e.clone$1=O,e.clone$2=_0,e.collisionCircleLayout=ir,e.config=Ae,e.create=nm,e.create$1=ch,e.create$2=Gd,e.createCommonjsModule=t,e.createExpression=zo,e.createLayout=Ln,e.createStyleLayer=WW,e.cross=jT,e.deepEqual=c,e.dot=UT,e.dot$1=WT,e.ease=T,e.emitValidationErrors=Ru,e.endsWith=z,e.enforceCacheSizeLimit=Ua,e.evaluateSizeForFeature=mk,e.evaluateSizeForZoom=gk,e.evaluateVariableOffset=Mk,e.evented=eo,e.extend=g,e.featureFilter=Je,e.filterObject=B,e.fromRotation=nv,e.getAnchorAlignment=$1,e.getAnchorJustification=dA,e.getArrayBuffer=ma,e.getImage=Nr,e.getJSON=ta,e.getRTLTextPluginStatus=$o,e.getReferrer=Jt,e.getVideo=Or,e.identity=Pv,e.invert=iv,e.isChar=zt,e.isMapboxURL=Fe,e.keysDifference=E,e.makeRequest=Pr,e.mapObject=F,e.mercatorXfromLng=Ok,e.mercatorYfromLat=Bk,e.mercatorZfromAltitude=Nk,e.mul=xg,e.multiply=ov,e.mvt=Xd,e.nextPowerOfTwo=f,e.normalize=bg,e.number=Ml,e.offscreenCanvasSupported=za,e.ortho=Au,e.parseGlyphPBF=_d,e.pbf=yo,e.performSymbolLayout=MW,e.perspective=om,e.pick=b,e.plugin=el,e.polygonIntersectsPolygon=Fo,e.postMapLoadEvent=Ue,e.postTurnstileEvent=Be,e.potpack=Wp,e.refProperties=tX,e.register=de,e.registerForPluginStateChange=no,e.renderColorRamp=Ag,e.rotate=Lv,e.rotateX=Dh,e.rotateZ=Iv,e.scale=lu,e.scale$1=HT,e.scale$2=x0,e.setCacheLimits=Ra,e.setRTLTextPlugin=Zo,e.sphericalToCartesian=ue,e.sqrLen=I1,e.styleSpec=jn,e.sub=qT,e.symbolSize=gW,e.transformMat3=VT,e.transformMat4=Rv,e.translate=cc,e.triggerPluginCompletionEvent=Pi,e.uniqueId=u,e.validateCustomStyleLayer=qW,e.validateLight=ts,e.validateStyle=es,e.values=S,e.vectorTile=Xd,e.version=r,e.warnOnce=U,e.webpSupported=ze,e.window=s,e.wrap=_}),M(["./shared"],function(e){"use strict";function t(Jt){var Nt=typeof Jt;if(Nt==="number"||Nt==="boolean"||Nt==="string"||Jt===void 0||Jt===null)return JSON.stringify(Jt);if(Array.isArray(Jt)){for(var Kt="[",Wt=0,Pr=Jt;Wt<Pr.length;Wt+=1){var ta=Pr[Wt];Kt+=t(ta)+","}return Kt+"]"}for(var ma=Object.keys(Jt).sort(),ra="{",Ia=0;Ia<ma.length;Ia++)ra+=JSON.stringify(ma[Ia])+":"+t(Jt[ma[Ia]])+",";return ra+"}"}function r(Jt){for(var Nt="",Kt=0,Wt=e.refProperties;Kt<Wt.length;Kt+=1){var Pr=Wt[Kt];Nt+="/"+t(Jt[Pr])}return Nt}function i(Jt,Nt){for(var Kt={},Wt=0;Wt<Jt.length;Wt++){var Pr=Nt&&Nt[Jt[Wt].id]||r(Jt[Wt]);Nt&&(Nt[Jt[Wt].id]=Pr);var ta=Kt[Pr];ta||(ta=Kt[Pr]=[]),ta.push(Jt[Wt])}var ma=[];for(var ra in Kt)ma.push(Kt[ra]);return ma}var a=function(Nt){this.keyCache={},Nt&&this.replace(Nt)};a.prototype.replace=function(Nt){this._layerConfigs={},this._layers={},this.update(Nt,[])},a.prototype.update=function(Nt,Kt){for(var Wt=this,Pr=0,ta=Nt;Pr<ta.length;Pr+=1){var ma=ta[Pr];this._layerConfigs[ma.id]=ma;var ra=this._layers[ma.id]=e.createStyleLayer(ma);ra._featureFilter=e.featureFilter(ra.filter),this.keyCache[ma.id]&&delete this.keyCache[ma.id]}for(var Ia=0,Ha=Kt;Ia<Ha.length;Ia+=1){var rn=Ha[Ia];delete this.keyCache[rn],delete this._layerConfigs[rn],delete this._layers[rn]}this.familiesBySource={};for(var nn=i(e.values(this._layerConfigs),this.keyCache),yn=0,xt=nn;yn<xt.length;yn+=1){var ct=xt[yn],Nr=ct.map(function(Ur){return Wt._layers[Ur.id]}),Or=Nr[0];if(Or.visibility!=="none"){var Rr=Or.source||"",Lr=this.familiesBySource[Rr];Lr||(Lr=this.familiesBySource[Rr]={});var Gr=Or.sourceLayer||"_geojsonTileLayer",Kr=Lr[Gr];Kr||(Kr=Lr[Gr]=[]),Kr.push(Nr)}}};var n=1,o=function(Nt){var Kt={},Wt=[];for(var Pr in Nt){var ta=Nt[Pr],ma=Kt[Pr]={};for(var ra in ta){var Ia=ta[+ra];if(!(!Ia||Ia.bitmap.width===0||Ia.bitmap.height===0)){var Ha={x:0,y:0,w:Ia.bitmap.width+2*n,h:Ia.bitmap.height+2*n};Wt.push(Ha),ma[ra]={rect:Ha,metrics:Ia.metrics}}}}var rn=e.potpack(Wt),nn=rn.w,yn=rn.h,xt=new e.AlphaImage({width:nn||1,height:yn||1});for(var ct in Nt){var Nr=Nt[ct];for(var Or in Nr){var Rr=Nr[+Or];if(!(!Rr||Rr.bitmap.width===0||Rr.bitmap.height===0)){var Lr=Kt[ct][Or].rect;e.AlphaImage.copy(Rr.bitmap,xt,{x:0,y:0},{x:Lr.x+n,y:Lr.y+n},Rr.bitmap)}}}this.image=xt,this.positions=Kt};e.register("GlyphAtlas",o);var s=function(Nt){this.tileID=new e.OverscaledTileID(Nt.tileID.overscaledZ,Nt.tileID.wrap,Nt.tileID.canonical.z,Nt.tileID.canonical.x,Nt.tileID.canonical.y),this.uid=Nt.uid,this.zoom=Nt.zoom,this.pixelRatio=Nt.pixelRatio,this.tileSize=Nt.tileSize,this.source=Nt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Nt.showCollisionBoxes,this.collectResourceTiming=!!Nt.collectResourceTiming,this.returnDependencies=!!Nt.returnDependencies,this.promoteId=Nt.promoteId};s.prototype.parse=function(Nt,Kt,Wt,Pr,ta){var ma=this;this.status="parsing",this.data=Nt,this.collisionBoxArray=new e.CollisionBoxArray;var ra=new e.DictionaryCoder(Object.keys(Nt.layers).sort()),Ia=new e.FeatureIndex(this.tileID,this.promoteId);Ia.bucketLayerIDs=[];var Ha={},rn={featureIndex:Ia,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Wt},nn=Kt.familiesBySource[this.source];for(var yn in nn){var xt=Nt.layers[yn];if(xt){xt.version===1&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+yn+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var ct=ra.encode(yn),Nr=[],Or=0;Or<xt.length;Or++){var Rr=xt.feature(Or),Lr=Ia.getId(Rr,yn);Nr.push({feature:Rr,id:Lr,index:Or,sourceLayerIndex:ct})}for(var Gr=0,Kr=nn[yn];Gr<Kr.length;Gr+=1){var Ur=Kr[Gr],aa=Ur[0];if(!(aa.minzoom&&this.zoom<Math.floor(aa.minzoom))&&!(aa.maxzoom&&this.zoom>=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<ta.length;Pr+=1){var ma=ta[Pr];ma.recalculate(Wt,Kt)}}function h(Jt,Nt){var Kt=e.getArrayBuffer(Jt.request,function(Wt,Pr,ta,ma){Wt?Nt(Wt):Pr&&Nt(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(Pr)),rawData:Pr,cacheControl:ta,expires:ma})});return function(){Kt.cancel(),Nt()}}var m=function(Nt,Kt,Wt,Pr){this.actor=Nt,this.layerIndex=Kt,this.availableImages=Wt,this.loadVectorData=Pr||h,this.loading={},this.loaded={}};m.prototype.loadTile=function(Nt,Kt){var Wt=this,Pr=Nt.uid;this.loading||(this.loading={});var ta=Nt&&Nt.request&&Nt.request.collectResourceTiming?new e.RequestPerformance(Nt.request):!1,ma=this.loading[Pr]=new s(Nt);ma.abort=this.loadVectorData(Nt,function(ra,Ia){if(delete Wt.loading[Pr],ra||!Ia)return ma.status="done",Wt.loaded[Pr]=ma,Kt(ra);var Ha=Ia.rawData,rn={};Ia.expires&&(rn.expires=Ia.expires),Ia.cacheControl&&(rn.cacheControl=Ia.cacheControl);var nn={};if(ta){var yn=ta.finish();yn&&(nn.resourceTiming=JSON.parse(JSON.stringify(yn)))}ma.vectorTile=Ia.vectorTile,ma.parse(Ia.vectorTile,Wt.layerIndex,Wt.availableImages,Wt.actor,function(xt,ct){if(xt||!ct)return Kt(xt);Kt(null,e.extend({rawTileData:Ha.slice(0)},ct,rn,nn))}),Wt.loaded=Wt.loaded||{},Wt.loaded[Pr]=ma})},m.prototype.reloadTile=function(Nt,Kt){var Wt=this,Pr=this.loaded,ta=Nt.uid,ma=this;if(Pr&&Pr[ta]){var ra=Pr[ta];ra.showCollisionBoxes=Nt.showCollisionBoxes;var Ia=function(Ha,rn){var nn=ra.reloadCallback;nn&&(delete ra.reloadCallback,ra.parse(ra.vectorTile,ma.layerIndex,Wt.availableImages,ma.actor,nn)),Kt(Ha,rn)};ra.status==="parsing"?ra.reloadCallback=Ia:ra.status==="done"&&(ra.vectorTile?ra.parse(ra.vectorTile,this.layerIndex,this.availableImages,this.actor,Ia):Ia())}},m.prototype.abortTile=function(Nt,Kt){var Wt=this.loading,Pr=Nt.uid;Wt&&Wt[Pr]&&Wt[Pr].abort&&(Wt[Pr].abort(),delete Wt[Pr]),Kt()},m.prototype.removeTile=function(Nt,Kt){var Wt=this.loaded,Pr=Nt.uid;Wt&&Wt[Pr]&&delete Wt[Pr],Kt()};var d=e.window.ImageBitmap,T=function(){this.loaded={}};T.prototype.loadTile=function(Nt,Kt){var Wt=Nt.uid,Pr=Nt.encoding,ta=Nt.rawImageData,ma=d&&ta instanceof d?this.getImageData(ta):ta,ra=new e.DEMData(Wt,ma,Pr);this.loaded=this.loaded||{},this.loaded[Wt]=ra,Kt(null,ra)},T.prototype.getImageData=function(Nt){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(Nt.width,Nt.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Nt.width,this.offscreenCanvas.height=Nt.height,this.offscreenCanvasContext.drawImage(Nt,0,0,Nt.width,Nt.height);var Kt=this.offscreenCanvasContext.getImageData(-1,-1,Nt.width+2,Nt.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:Kt.width,height:Kt.height},Kt.data)},T.prototype.removeTile=function(Nt){var Kt=this.loaded,Wt=Nt.uid;Kt&&Kt[Wt]&&delete Kt[Wt]};var l=_;function _(Jt,Nt){var Kt=Jt&&Jt.type,Wt;if(Kt==="FeatureCollection")for(Wt=0;Wt<Jt.features.length;Wt++)_(Jt.features[Wt],Nt);else if(Kt==="GeometryCollection")for(Wt=0;Wt<Jt.geometries.length;Wt++)_(Jt.geometries[Wt],Nt);else if(Kt==="Feature")_(Jt.geometry,Nt);else if(Kt==="Polygon")w(Jt.coordinates,Nt);else if(Kt==="MultiPolygon")for(Wt=0;Wt<Jt.coordinates.length;Wt++)w(Jt.coordinates[Wt],Nt);return Jt}function w(Jt,Nt){if(Jt.length!==0){S(Jt[0],Nt);for(var Kt=1;Kt<Jt.length;Kt++)S(Jt[Kt],!Nt)}}function S(Jt,Nt){for(var Kt=0,Wt=0,Pr=Jt.length,ta=Pr-1;Wt<Pr;ta=Wt++)Kt+=(Jt[Wt][0]-Jt[ta][0])*(Jt[ta][1]+Jt[Wt][1]);Kt>=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<Wt.length;Kt+=1){var Pr=Wt[Kt];Nt.push([new e.Point$1(Pr[0],Pr[1])])}return Nt}else{for(var ta=[],ma=0,ra=this._feature.geometry;ma<ra.length;ma+=1){for(var Ia=ra[ma],Ha=[],rn=0,nn=Ia;rn<nn.length;rn+=1){var yn=nn[rn];Ha.push(new e.Point$1(yn[0],yn[1]))}ta.push(Ha)}return ta}},g.prototype.toGeoJSON=function(Nt,Kt,Wt){return E.call(this,Nt,Kt,Wt)};var b=function(Nt){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=Nt.length,this._features=Nt};b.prototype.feature=function(Nt){return new g(this._features[Nt])};var p=e.vectorTile.VectorTileFeature,u=y;function y(Jt,Nt){this.options=Nt||{},this.features=Jt,this.length=Jt.length}y.prototype.feature=function(Jt){return new f(this.features[Jt],this.options.extent)};function f(Jt,Nt){this.id=typeof Jt.id=="number"?Jt.id:void 0,this.type=Jt.type,this.rawGeometry=Jt.type===1?[Jt.geometry]:Jt.geometry,this.properties=Jt.tags,this.extent=Nt||4096}f.prototype.loadGeometry=function(){var Jt=this.rawGeometry;this.geometry=[];for(var Nt=0;Nt<Jt.length;Nt++){for(var Kt=Jt[Nt],Wt=[],Pr=0;Pr<Kt.length;Pr++)Wt.push(new e.Point$1(Kt[Pr][0],Kt[Pr][1]));this.geometry.push(Wt)}return this.geometry},f.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Jt=this.geometry,Nt=1/0,Kt=-1/0,Wt=1/0,Pr=-1/0,ta=0;ta<Jt.length;ta++)for(var ma=Jt[ta],ra=0;ra<ma.length;ra++){var Ia=ma[ra];Nt=Math.min(Nt,Ia.x),Kt=Math.max(Kt,Ia.x),Wt=Math.min(Wt,Ia.y),Pr=Math.max(Pr,Ia.y)}return[Nt,Wt,Kt,Pr]},f.prototype.toGeoJSON=p.prototype.toGeoJSON;var P=B,L=B,z=O,F=u;function B(Jt){var Nt=new e.pbf;return I(Jt,Nt),Nt.finish()}function O(Jt,Nt){Nt=Nt||{};var Kt={};for(var Wt in Jt)Kt[Wt]=new u(Jt[Wt].features,Nt),Kt[Wt].name=Wt,Kt[Wt].version=Nt.version,Kt[Wt].extent=Nt.extent;return B({layers:Kt})}function I(Jt,Nt){for(var Kt in Jt.layers)Nt.writeMessage(3,N,Jt.layers[Kt])}function N(Jt,Nt){Nt.writeVarintField(15,Jt.version||1),Nt.writeStringField(1,Jt.name||""),Nt.writeVarintField(5,Jt.extent||4096);var Kt,Wt={keys:[],values:[],keycache:{},valuecache:{}};for(Kt=0;Kt<Jt.length;Kt++)Wt.feature=Jt.feature(Kt),Nt.writeMessage(2,U,Wt);var Pr=Wt.keys;for(Kt=0;Kt<Pr.length;Kt++)Nt.writeStringField(3,Pr[Kt]);var ta=Wt.values;for(Kt=0;Kt<ta.length;Kt++)Nt.writeMessage(4,he,ta[Kt])}function U(Jt,Nt){var Kt=Jt.feature;Kt.id!==void 0&&Nt.writeVarintField(1,Kt.id),Nt.writeMessage(2,W,Jt),Nt.writeVarintField(3,Kt.type),Nt.writeMessage(4,se,Kt)}function W(Jt,Nt){var Kt=Jt.feature,Wt=Jt.keys,Pr=Jt.values,ta=Jt.keycache,ma=Jt.valuecache;for(var ra in Kt.properties){var Ia=ta[ra];typeof Ia>"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<ma;ra++){var Ia=Kt[ra],Ha=1;Wt===1&&(Ha=Ia.length),Nt.writeVarint(Q(1,Ha));for(var rn=Wt===3?Ia.length-1:Ia.length,nn=0;nn<rn;nn++){nn===1&&Wt!==1&&Nt.writeVarint(Q(2,rn-1));var yn=Ia[nn].x-Pr,xt=Ia[nn].y-ta;Nt.writeVarint(ue(yn)),Nt.writeVarint(ue(xt)),Pr+=yn,ta+=xt}Wt===3&&Nt.writeVarint(Q(7,1))}}function he(Jt,Nt){var Kt=typeof Jt;Kt==="string"?Nt.writeStringField(1,Jt):Kt==="boolean"?Nt.writeBooleanField(7,Jt):Kt==="number"&&(Jt%1!==0?Nt.writeDoubleField(3,Jt):Jt<0?Nt.writeSVarintField(6,Jt):Nt.writeVarintField(5,Jt))}P.fromVectorTileJs=L,P.fromGeojsonVt=z,P.GeoJSONWrapper=F;function H(Jt,Nt,Kt,Wt,Pr,ta){if(!(Pr-Wt<=Kt)){var ma=Wt+Pr>>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);ct<Nr;){for(J(Jt,Nt,ct,Nr),ct++,Nr--;Nt[2*ct+ta]<xt;)ct++;for(;Nt[2*Nr+ta]>xt;)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<Nt.length;Ha++)ra[Ha]=Ha,Ia[2*Ha]=Kt(Nt[Ha]),Ia[2*Ha+1]=Wt(Nt[Ha]);H(ra,Ia,Pr,0,ra.length-1,0)};ce.prototype.range=function(Nt,Kt,Wt,Pr){return oe(this.ids,this.coords,Nt,Kt,Wt,Pr,this.nodeSize)},ce.prototype.within=function(Nt,Kt,Wt){return ne(this.ids,this.coords,Nt,Kt,Wt,this.nodeSize)};var be={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Jt){return Jt}},Ae=function(Nt){this.options=_e(Object.create(be),Nt),this.trees=new Array(this.options.maxZoom+1)};Ae.prototype.load=function(Nt){var Kt=this.options,Wt=Kt.log,Pr=Kt.minZoom,ta=Kt.maxZoom,ma=Kt.nodeSize;Wt&&console.time("total time");var ra="prepare "+Nt.length+" points";Wt&&console.time(ra),this.points=Nt;for(var Ia=[],Ha=0;Ha<Nt.length;Ha++)Nt[Ha].geometry&&Ia.push(Re(Nt[Ha],Ha));this.trees[ta+1]=new ce(Ia,fe,Fe,ma,Float32Array),Wt&&console.timeEnd(ra);for(var rn=ta;rn>=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;yn<xt.length;yn+=1){var ct=xt[yn],Nr=Ha.points[ct];nn.push(Nr.numPoints?We(Nr):this.points[Nr.index])}return nn},Ae.prototype.getChildren=function(Nt){var Kt=this._getOriginId(Nt),Wt=this._getOriginZoom(Nt),Pr="No cluster with the specified id.",ta=this.trees[Wt];if(!ta)throw new Error(Pr);var ma=ta.points[Kt];if(!ma)throw new Error(Pr);for(var ra=this.options.radius/(this.options.extent*Math.pow(2,Wt-1)),Ia=ta.within(ma.x,ma.y,ra),Ha=[],rn=0,nn=Ia;rn<nn.length;rn+=1){var yn=nn[rn],xt=ta.points[yn];xt.parentId===Nt&&Ha.push(xt.numPoints?We(xt):this.points[xt.index])}if(Ha.length===0)throw new Error(Pr);return Ha},Ae.prototype.getLeaves=function(Nt,Kt,Wt){Kt=Kt||10,Wt=Wt||0;var Pr=[];return this._appendLeaves(Pr,Nt,Kt,Wt,0),Pr},Ae.prototype.getTile=function(Nt,Kt,Wt){var Pr=this.trees[this._limitZoom(Nt)],ta=Math.pow(2,Nt),ma=this.options,ra=ma.extent,Ia=ma.radius,Ha=Ia/ra,rn=(Wt-Ha)/ta,nn=(Wt+1+Ha)/ta,yn={features:[]};return this._addTileFeatures(Pr.range((Kt-Ha)/ta,rn,(Kt+1+Ha)/ta,nn),Pr.points,Kt,Wt,ta,yn),Kt===0&&this._addTileFeatures(Pr.range(1-Ha/ta,rn,1,nn),Pr.points,ta,Wt,ta,yn),Kt===ta-1&&this._addTileFeatures(Pr.range(0,rn,Ha/ta,nn),Pr.points,-1,Wt,ta,yn),yn.features.length?yn:null},Ae.prototype.getClusterExpansionZoom=function(Nt){for(var Kt=this._getOriginZoom(Nt)-1;Kt<=this.options.maxZoom;){var Wt=this.getChildren(Nt);if(Kt++,Wt.length!==1)break;Nt=Wt[0].properties.cluster_id}return Kt},Ae.prototype._appendLeaves=function(Nt,Kt,Wt,Pr,ta){for(var ma=this.getChildren(Kt),ra=0,Ia=ma;ra<Ia.length;ra+=1){var Ha=Ia[ra],rn=Ha.properties;if(rn&&rn.cluster?ta+rn.point_count<=Pr?ta+=rn.point_count:ta=this._appendLeaves(Nt,rn.cluster_id,Wt,Pr,ta):ta<Pr?ta++:Nt.push(Ha),Nt.length===Wt)break}return ta},Ae.prototype._addTileFeatures=function(Nt,Kt,Wt,Pr,ta,ma){for(var ra=0,Ia=Nt;ra<Ia.length;ra+=1){var Ha=Ia[ra],rn=Kt[Ha],nn=rn.numPoints,yn={type:1,geometry:[[Math.round(this.options.extent*(rn.x*ta-Wt)),Math.round(this.options.extent*(rn.y*ta-Pr))]],tags:nn?it(rn):this.points[rn.index].properties},xt=void 0;nn?xt=rn.id:this.options.generateId?xt=rn.index:this.points[rn.index].id&&(xt=this.points[rn.index].id),xt!==void 0&&(yn.id=xt),ma.features.push(yn)}},Ae.prototype._limitZoom=function(Nt){return Math.max(this.options.minZoom,Math.min(+Nt,this.options.maxZoom+1))},Ae.prototype._cluster=function(Nt,Kt){for(var Wt=[],Pr=this.options,ta=Pr.radius,ma=Pr.extent,ra=Pr.reduce,Ia=Pr.minPoints,Ha=ta/(ma*Math.pow(2,Kt)),rn=0;rn<Nt.length;rn++){var nn=Nt[rn];if(!(nn.zoom<=Kt)){nn.zoom=Kt;for(var yn=this.trees[Kt+1],xt=yn.within(nn.x,nn.y,Ha),ct=nn.numPoints||1,Nr=ct,Or=0,Rr=xt;Or<Rr.length;Or+=1){var Lr=Rr[Or],Gr=yn.points[Lr];Gr.zoom>Kt&&(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;fa<It.length;fa+=1){var dr=It[fa],kr=yn.points[dr];if(!(kr.zoom<=Kt)){kr.zoom=Kt;var na=kr.numPoints||1;Kr+=kr.x*na,Ur+=kr.y*na,kr.parentId=da,ra&&(aa||(aa=this._map(nn,!0)),ra(aa,this._map(kr)))}}nn.parentId=da,Wt.push(ze(Kr/Nr,Ur/Nr,da,Nr,aa))}else if(Wt.push(nn),Nr>1)for(var Ca=0,Fa=xt;Ca<Fa.length;Ca+=1){var Ya=Fa[Ca],ha=yn.points[Ya];ha.zoom<=Kt||(ha.zoom=Kt,Wt.push(ha))}}}return Wt},Ae.prototype._getOriginId=function(Nt){return Nt-this.points.length>>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;yn<Kt;yn+=3){var xt=st(Jt[yn],Jt[yn+1],Ia,Ha,rn,nn);if(xt>Pr)ra=yn,Pr=xt;else if(xt===Pr){var ct=Math.abs(yn-ta);ct<ma&&(ra=yn,ma=ct)}}Pr>Wt&&(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;Wt<Nt.length;Wt++)kt(Jt,Nt[Wt]);else if(Kt==="MultiPolygon")for(Wt=0;Wt<Nt.length;Wt++)for(var Pr=0;Pr<Nt[Wt].length;Pr++)kt(Jt,Nt[Wt][Pr])}function kt(Jt,Nt){for(var Kt=0;Kt<Nt.length;Kt+=3)Jt.minX=Math.min(Jt.minX,Nt[Kt]),Jt.minY=Math.min(Jt.minY,Nt[Kt+1]),Jt.maxX=Math.max(Jt.maxX,Nt[Kt]),Jt.maxY=Math.max(Jt.maxY,Nt[Kt+1])}function qt(Jt,Nt){var Kt=[];if(Jt.type==="FeatureCollection")for(var Wt=0;Wt<Jt.features.length;Wt++)Zt(Kt,Jt.features[Wt],Nt,Wt);else Jt.type==="Feature"?Zt(Kt,Jt,Nt):Zt(Kt,{geometry:Jt},Nt);return Kt}function Zt(Jt,Nt,Kt,Wt){if(Nt.geometry){var Pr=Nt.geometry.coordinates,ta=Nt.geometry.type,ma=Math.pow(Kt.tolerance/((1<<Kt.maxZoom)*Kt.extent),2),ra=[],Ia=Nt.id;if(Kt.promoteId?Ia=Nt.properties[Kt.promoteId]:Kt.generateId&&(Ia=Wt||0),ta==="Point")Sr(Pr,ra);else if(ta==="MultiPoint")for(var Ha=0;Ha<Pr.length;Ha++)Sr(Pr[Ha],ra);else if(ta==="LineString")xr(Pr,ra,ma,!1);else if(ta==="MultiLineString")if(Kt.lineMetrics){for(Ha=0;Ha<Pr.length;Ha++)ra=[],xr(Pr[Ha],ra,ma,!1),Jt.push(Qe(Ia,"LineString",ra,Nt.properties));return}else jr(Pr,ra,ma,!1);else if(ta==="Polygon")jr(Pr,ra,ma,!0);else if(ta==="MultiPolygon")for(Ha=0;Ha<Pr.length;Ha++){var rn=[];jr(Pr[Ha],rn,ma,!0),ra.push(rn)}else if(ta==="GeometryCollection"){for(Ha=0;Ha<Nt.geometry.geometries.length;Ha++)Zt(Jt,{id:Ia,geometry:Nt.geometry.geometries[Ha],properties:Nt.properties},Kt,Wt);return}else throw new Error("Input data is not a valid GeoJSON object.");Jt.push(Qe(Ia,ta,ra,Nt.properties))}}function Sr(Jt,Nt){Nt.push(wr(Jt[0])),Nt.push(Ir(Jt[1])),Nt.push(0)}function xr(Jt,Nt,Kt,Wt){for(var Pr,ta,ma=0,ra=0;ra<Jt.length;ra++){var Ia=wr(Jt[ra][0]),Ha=Ir(Jt[ra][1]);Nt.push(Ia),Nt.push(Ha),Nt.push(0),ra>0&&(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;Pr<Jt.length;Pr++){var ta=[];xr(Jt[Pr],ta,Kt,Wt),Nt.push(ta)}}function wr(Jt){return Jt/360+.5}function Ir(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 bt(Jt,Nt,Kt,Wt,Pr,ta,ma,ra){if(Kt/=Nt,Wt/=Nt,ta>=Kt&&ma<Wt)return Jt;if(ma<Kt||ta>=Wt)return null;for(var Ia=[],Ha=0;Ha<Jt.length;Ha++){var rn=Jt[Ha],nn=rn.geometry,yn=rn.type,xt=Pr===0?rn.minX:rn.minY,ct=Pr===0?rn.maxX:rn.maxY;if(xt>=Kt&&ct<Wt){Ia.push(rn);continue}else if(ct<Kt||xt>=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<nn.length;Or++){var Rr=[];Ee(nn[Or],Rr,Kt,Wt,Pr,!0),Rr.length&&Nr.push(Rr)}if(Nr.length){if(ra.lineMetrics&&yn==="LineString"){for(Or=0;Or<Nr.length;Or++)Ia.push(Qe(rn.id,yn,Nr[Or],rn.tags));continue}(yn==="LineString"||yn==="MultiLineString")&&(Nr.length===1?(yn="LineString",Nr=Nr[0]):yn="MultiLineString"),(yn==="Point"||yn==="MultiPoint")&&(yn=Nr.length===3?"Point":"MultiPoint"),Ia.push(Qe(rn.id,yn,Nr,rn.tags))}}return Ia.length?Ia:null}function Be(Jt,Nt,Kt,Wt,Pr){for(var ta=0;ta<Jt.length;ta+=3){var ma=Jt[ta+Pr];ma>=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;yn<Jt.length-3;yn+=3){var xt=Jt[yn],ct=Jt[yn+1],Nr=Jt[yn+2],Or=Jt[yn+3],Rr=Jt[yn+4],Lr=Pr===0?xt:ct,Gr=Pr===0?Or:Rr,Kr=!1;ma&&(rn=Math.sqrt(Math.pow(xt-Or,2)+Math.pow(ct-Rr,2))),Lr<Kt?Gr>Kt&&(nn=Ia(ra,xt,ct,Or,Rr,Kt),ma&&(ra.start=Ha+rn*nn)):Lr>Wt?Gr<Wt&&(nn=Ia(ra,xt,ct,Or,Rr,Wt),ma&&(ra.start=Ha+rn*nn)):Ve(ra,xt,ct,Nr),Gr<Kt&&Lr>=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;ma<Jt.length;ma++)Ke(Jt[ma],Nt,Kt,Wt,Pr,ta,!1)}function Ve(Jt,Nt,Kt,Wt){Jt.push(Nt),Jt.push(Kt),Jt.push(Wt)}function Ce(Jt,Nt,Kt,Wt,Pr,ta){var ma=(ta-Nt)/(Wt-Nt);return Jt.push(ta),Jt.push(Kt+(Pr-Kt)*ma),Jt.push(1),ma}function Te(Jt,Nt,Kt,Wt,Pr,ta){var ma=(ta-Kt)/(Pr-Kt);return Jt.push(Nt+(Wt-Nt)*ma),Jt.push(ta),Jt.push(1),ma}function Pe(Jt,Nt){var Kt=Nt.buffer/Nt.extent,Wt=Jt,Pr=bt(Jt,1,-1-Kt,Kt,0,-1,2,Nt),ta=bt(Jt,1,1-Kt,2+Kt,0,-1,2,Nt);return(Pr||ta)&&(Wt=bt(Jt,1,-Kt,1+Kt,0,-1,2,Nt)||[],Pr&&(Wt=at(Pr,1).concat(Wt)),ta&&(Wt=Wt.concat(at(ta,-1)))),Wt}function at(Jt,Nt){for(var Kt=[],Wt=0;Wt<Jt.length;Wt++){var Pr=Jt[Wt],ta=Pr.type,ma;if(ta==="Point"||ta==="MultiPoint"||ta==="LineString")ma=yt(Pr.geometry,Nt);else if(ta==="MultiLineString"||ta==="Polygon"){ma=[];for(var ra=0;ra<Pr.geometry.length;ra++)ma.push(yt(Pr.geometry[ra],Nt))}else if(ta==="MultiPolygon")for(ma=[],ra=0;ra<Pr.geometry.length;ra++){for(var Ia=[],Ha=0;Ha<Pr.geometry[ra].length;Ha++)Ia.push(yt(Pr.geometry[ra][Ha],Nt));ma.push(Ia)}Kt.push(Qe(Pr.id,ta,ma,Pr.tags))}return Kt}function yt(Jt,Nt){var Kt=[];Kt.size=Jt.size,Jt.start!==void 0&&(Kt.start=Jt.start,Kt.end=Jt.end);for(var Wt=0;Wt<Jt.length;Wt+=3)Kt.push(Jt[Wt]+Nt,Jt[Wt+1],Jt[Wt+2]);return Kt}function Tt(Jt,Nt){if(Jt.transformed)return Jt;var Kt=1<<Jt.z,Wt=Jt.x,Pr=Jt.y,ta,ma,ra;for(ta=0;ta<Jt.features.length;ta++){var Ia=Jt.features[ta],Ha=Ia.geometry,rn=Ia.type;if(Ia.geometry=[],rn===1)for(ma=0;ma<Ha.length;ma+=2)Ia.geometry.push(Ot(Ha[ma],Ha[ma+1],Nt,Kt,Wt,Pr));else for(ma=0;ma<Ha.length;ma++){var nn=[];for(ra=0;ra<Ha[ma].length;ra+=2)nn.push(Ot(Ha[ma][ra],Ha[ma][ra+1],Nt,Kt,Wt,Pr));Ia.geometry.push(nn)}}return Jt.transformed=!0,Jt}function Ot(Jt,Nt,Kt,Wt,Pr,ta){return[Math.round(Kt*(Jt*Wt-Pr)),Math.round(Kt*(Nt*Wt-ta))]}function Gt(Jt,Nt,Kt,Wt,Pr){for(var ta=Nt===Pr.maxZoom?0:Pr.tolerance/((1<<Nt)*Pr.extent),ma={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Kt,y:Wt,z:Nt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},ra=0;ra<Jt.length;ra++){ma.numFeatures++,rr(ma,Jt[ra],ta,Pr);var Ia=Jt[ra].minX,Ha=Jt[ra].minY,rn=Jt[ra].maxX,nn=Jt[ra].maxY;Ia<ma.minX&&(ma.minX=Ia),Ha<ma.minY&&(ma.minY=Ha),rn>ma.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;ra<Pr.length;ra+=3)ma.push(Pr[ra]),ma.push(Pr[ra+1]),Jt.numPoints++,Jt.numSimplified++;else if(ta==="LineString")Qt(ma,Pr,Jt,Kt,!1,!1);else if(ta==="MultiLineString"||ta==="Polygon")for(ra=0;ra<Pr.length;ra++)Qt(ma,Pr[ra],Jt,Kt,ta==="Polygon",ra===0);else if(ta==="MultiPolygon")for(var Ia=0;Ia<Pr.length;Ia++){var Ha=Pr[Ia];for(ra=0;ra<Ha.length;ra++)Qt(ma,Ha[ra],Jt,Kt,!0,ra===0)}if(ma.length){var rn=Nt.tags||null;if(ta==="LineString"&&Wt.lineMetrics){rn={};for(var nn in Nt.tags)rn[nn]=Nt.tags[nn];rn.mapbox_clip_start=Pr.start/Pr.size,rn.mapbox_clip_end=Pr.end/Pr.size}var yn={geometry:ma,type:ta==="Polygon"||ta==="MultiPolygon"?3:ta==="LineString"||ta==="MultiLineString"?2:1,tags:rn};Nt.id!==null&&(yn.id=Nt.id),Jt.features.push(yn)}}function Qt(Jt,Nt,Kt,Wt,Pr,ta){var ma=Wt*Wt;if(Wt>0&&Nt.size<(Pr?ma:Wt)){Kt.numPoints+=Nt.length/3;return}for(var ra=[],Ia=0;Ia<Nt.length;Ia+=3)(Wt===0||Nt[Ia+2]>ma)&&(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;Wt<Pr;ta=Wt,Wt+=2)Kt+=(Jt[Wt]-Jt[ta])*(Jt[Wt+1]+Jt[ta+1]);if(Kt>0===Nt)for(Wt=0,Pr=Jt.length;Wt<Pr/2;Wt+=2){var ma=Jt[Wt],ra=Jt[Wt+1];Jt[Wt]=Jt[Pr-2-Wt],Jt[Wt+1]=Jt[Pr-1-Wt],Jt[Pr-2-Wt]=ma,Jt[Pr-1-Wt]=ra}}function la(Jt,Nt){return new Ua(Jt,Nt)}function Ua(Jt,Nt){Nt=this.options=Ra(Object.create(this.options),Nt);var Kt=Nt.debug;if(Kt&&console.time("preprocess data"),Nt.maxZoom<0||Nt.maxZoom>24)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<<Nt,nn=Ba(Nt,Kt,Wt),yn=this.tiles[nn];if(!yn&&(Ha>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<<Pr-Nt;if(Kt!==Math.floor(ta/ct)||Wt!==Math.floor(ma/ct))continue}else if(Nt===Ia.indexMaxZoom||yn.numPoints<=Ia.indexMaxPoints)continue;if(yn.source=null,Jt.length!==0){Ha>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<<Jt;Nt=(Nt%ma+ma)%ma;var ra=Ba(Jt,Nt,Kt);if(this.tiles[ra])return Tt(this.tiles[ra],Pr);ta>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<<Jt)*Kt+Nt)*32+Jt}function Ra(Jt,Nt){for(var Kt in Nt)Jt[Kt]=Nt[Kt];return Jt}function Qa(Jt,Nt){var Kt=Jt.tileID.canonical;if(!this._geoJSONIndex)return Nt(null,null);var Wt=this._geoJSONIndex.getTile(Kt.z,Kt.x,Kt.y);if(!Wt)return Nt(null,null);var Pr=new b(Wt.features),ta=P(Pr);(ta.byteOffset!==0||ta.byteLength!==ta.buffer.byteLength)&&(ta=new Uint8Array(ta)),Nt(null,{vectorTile:Pr,rawData:ta.buffer})}var za=function(Jt){function Nt(Kt,Wt,Pr,ta){Jt.call(this,Kt,Wt,Pr,Qa),ta&&(this.loadGeoJSON=ta)}return Jt&&(Nt.__proto__=Jt),Nt.prototype=Object.create(Jt&&Jt.prototype),Nt.prototype.constructor=Nt,Nt.prototype.loadData=function(Wt,Pr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=Pr,this._pendingLoadDataParams=Wt,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},Nt.prototype._loadData=function(){var Wt=this;if(!(!this._pendingCallback||!this._pendingLoadDataParams)){var Pr=this._pendingCallback,ta=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var ma=ta&&ta.request&&ta.request.collectResourceTiming?new e.RequestPerformance(ta.request):!1;this.loadGeoJSON(ta,function(ra,Ia){if(ra||!Ia)return Pr(ra);if(typeof Ia!="object")return Pr(new Error("Input data given to '"+ta.source+"' is not a valid GeoJSON object."));l(Ia,!0);try{if(ta.filter){var Ha=e.createExpression(ta.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ha.result==="error")throw new Error(Ha.value.map(function(xt){return xt.key+": "+xt.message}).join(", "));var rn=Ia.features.filter(function(xt){return Ha.value.evaluate({zoom:0},xt)});Ia={type:"FeatureCollection",features:rn}}Wt._geoJSONIndex=ta.cluster?new Ae(en(ta)).load(Ia.features):la(Ia,ta.geojsonVtOptions)}catch(xt){return Pr(xt)}Wt.loaded={};var nn={};if(ma){var yn=ma.finish();yn&&(nn.resourceTiming={},nn.resourceTiming[ta.source]=JSON.parse(JSON.stringify(yn)))}Pr(null,nn)})}},Nt.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},Nt.prototype.reloadTile=function(Wt,Pr){var ta=this.loaded,ma=Wt.uid;return ta&&ta[ma]?Jt.prototype.reloadTile.call(this,Wt,Pr):this.loadTile(Wt,Pr)},Nt.prototype.loadGeoJSON=function(Wt,Pr){if(Wt.request)e.getJSON(Wt.request,Pr);else if(typeof Wt.data=="string")try{return Pr(null,JSON.parse(Wt.data))}catch{return Pr(new Error("Input data given to '"+Wt.source+"' is not a valid GeoJSON object."))}else return Pr(new Error("Input data given to '"+Wt.source+"' is not a valid GeoJSON object."))},Nt.prototype.removeSource=function(Wt,Pr){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Pr()},Nt.prototype.getClusterExpansionZoom=function(Wt,Pr){try{Pr(null,this._geoJSONIndex.getClusterExpansionZoom(Wt.clusterId))}catch(ta){Pr(ta)}},Nt.prototype.getClusterChildren=function(Wt,Pr){try{Pr(null,this._geoJSONIndex.getChildren(Wt.clusterId))}catch(ta){Pr(ta)}},Nt.prototype.getClusterLeaves=function(Wt,Pr){try{Pr(null,this._geoJSONIndex.getLeaves(Wt.clusterId,Wt.limit,Wt.offset))}catch(ta){Pr(ta)}},Nt}(m);function en(Jt){var Nt=Jt.superclusterOptions,Kt=Jt.clusterProperties;if(!Kt||!Nt)return Nt;for(var Wt={},Pr={},ta={accumulated:null,zoom:0},ma={properties:null},ra=Object.keys(Kt),Ia=0,Ha=ra;Ia<Ha.length;Ia+=1){var rn=Ha[Ia],nn=Kt[rn],yn=nn[0],xt=nn[1],ct=e.createExpression(xt),Nr=e.createExpression(typeof yn=="string"?[yn,["accumulated"],["get",rn]]:yn);Wt[rn]=ct.value,Pr[rn]=Nr.value}return Nt.map=function(Or){ma.properties=Or;for(var Rr={},Lr=0,Gr=ra;Lr<Gr.length;Lr+=1){var Kr=Gr[Lr];Rr[Kr]=Wt[Kr].evaluate(ta,ma)}return Rr},Nt.reduce=function(Or,Rr){ma.properties=Rr;for(var Lr=0,Gr=ra;Lr<Gr.length;Lr+=1){var Kr=Gr[Lr];ta.accumulated=Or[Kr],Or[Kr]=Pr[Kr].evaluate(ta,ma)}},Nt}var kn=function(Nt){var Kt=this;this.self=Nt,this.actor=new e.Actor(Nt,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:m,geojson:za},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(Wt,Pr){if(Kt.workerSourceTypes[Wt])throw new Error('Worker source with name "'+Wt+'" already registered.');Kt.workerSourceTypes[Wt]=Pr},this.self.registerRTLTextPlugin=function(Wt){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=Wt.applyArabicShaping,e.plugin.processBidirectionalText=Wt.processBidirectionalText,e.plugin.processStyledBidirectionalText=Wt.processStyledBidirectionalText}};return kn.prototype.setReferrer=function(Nt,Kt){this.referrer=Kt},kn.prototype.setImages=function(Nt,Kt,Wt){this.availableImages[Nt]=Kt;for(var Pr in this.workerSources[Nt]){var ta=this.workerSources[Nt][Pr];for(var ma in ta)ta[ma].availableImages=Kt}Wt()},kn.prototype.setLayers=function(Nt,Kt,Wt){this.getLayerIndex(Nt).replace(Kt),Wt()},kn.prototype.updateLayers=function(Nt,Kt,Wt){this.getLayerIndex(Nt).update(Kt.layers,Kt.removedIds),Wt()},kn.prototype.loadTile=function(Nt,Kt,Wt){this.getWorkerSource(Nt,Kt.type,Kt.source).loadTile(Kt,Wt)},kn.prototype.loadDEMTile=function(Nt,Kt,Wt){this.getDEMWorkerSource(Nt,Kt.source).loadTile(Kt,Wt)},kn.prototype.reloadTile=function(Nt,Kt,Wt){this.getWorkerSource(Nt,Kt.type,Kt.source).reloadTile(Kt,Wt)},kn.prototype.abortTile=function(Nt,Kt,Wt){this.getWorkerSource(Nt,Kt.type,Kt.source).abortTile(Kt,Wt)},kn.prototype.removeTile=function(Nt,Kt,Wt){this.getWorkerSource(Nt,Kt.type,Kt.source).removeTile(Kt,Wt)},kn.prototype.removeDEMTile=function(Nt,Kt){this.getDEMWorkerSource(Nt,Kt.source).removeTile(Kt)},kn.prototype.removeSource=function(Nt,Kt,Wt){if(!(!this.workerSources[Nt]||!this.workerSources[Nt][Kt.type]||!this.workerSources[Nt][Kt.type][Kt.source])){var Pr=this.workerSources[Nt][Kt.type][Kt.source];delete this.workerSources[Nt][Kt.type][Kt.source],Pr.removeSource!==void 0?Pr.removeSource(Kt,Wt):Wt()}},kn.prototype.loadWorkerSource=function(Nt,Kt,Wt){try{this.self.importScripts(Kt.url),Wt()}catch(Pr){Wt(Pr.toString())}},kn.prototype.syncRTLPluginState=function(Nt,Kt,Wt){try{e.plugin.setState(Kt);var Pr=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&Pr!=null){this.self.importScripts(Pr);var ta=e.plugin.isParsed(),ma=ta?void 0:new Error("RTL Text Plugin failed to import scripts from "+Pr);Wt(ma,ta)}}catch(ra){Wt(ra.toString())}},kn.prototype.getAvailableImages=function(Nt){var Kt=this.availableImages[Nt];return Kt||(Kt=[]),Kt},kn.prototype.getLayerIndex=function(Nt){var Kt=this.layerIndexes[Nt];return Kt||(Kt=this.layerIndexes[Nt]=new a),Kt},kn.prototype.getWorkerSource=function(Nt,Kt,Wt){var Pr=this;if(this.workerSources[Nt]||(this.workerSources[Nt]={}),this.workerSources[Nt][Kt]||(this.workerSources[Nt][Kt]={}),!this.workerSources[Nt][Kt][Wt]){var ta={send:function(ma,ra,Ia){Pr.actor.send(ma,ra,Ia,Nt)}};this.workerSources[Nt][Kt][Wt]=new this.workerSourceTypes[Kt](ta,this.getLayerIndex(Nt),this.getAvailableImages(Nt))}return this.workerSources[Nt][Kt][Wt]},kn.prototype.getDEMWorkerSource=function(Nt,Kt){return this.demWorkerSources[Nt]||(this.demWorkerSources[Nt]={}),this.demWorkerSources[Nt][Kt]||(this.demWorkerSources[Nt][Kt]=new T),this.demWorkerSources[Nt][Kt]},kn.prototype.enforceCacheSizeLimit=function(Nt,Kt){e.enforceCacheSizeLimit(Kt)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new kn(self)),kn}),M(["./shared"],function(e){"use strict";var t=e.createCommonjsModule(function(ve){ve.exports?ve.exports=Y:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=Y,window.mapboxgl.notSupportedReason=ye);function Y(nr){return!ye(nr)}function ye(nr){if(!te())return"not a browser";if(!me())return"insufficent Array support";if(!Ge())return"insufficient Function support";if(!Le())return"insufficient Object support";if(!$e())return"insufficient JSON support";if(!mt())return"insufficient worker support";if(!jt())return"insufficient Uint8ClampedArray support";if(!_r())return"insufficient ArrayBuffer support";if(!Fr())return"insufficient Canvas/getImageData support";if(!gt(nr&&nr.failIfMajorPerformanceCaveat))return"insufficient WebGL support"}function te(){return typeof window<"u"&&typeof document<"u"}function me(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function Ge(){return Function.prototype&&Function.prototype.bind}function Le(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function $e(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function mt(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var nr=new Blob([""],{type:"text/javascript"}),fr=URL.createObjectURL(nr),sr,pr;try{pr=new Worker(fr),sr=!0}catch{sr=!1}return pr&&pr.terminate(),URL.revokeObjectURL(fr),sr}function jt(){return"Uint8ClampedArray"in window}function _r(){return ArrayBuffer.isView}function Fr(){var nr=document.createElement("canvas");nr.width=nr.height=1;var fr=nr.getContext("2d");if(!fr)return!1;var sr=fr.getImageData(0,0,1,1);return sr&&sr.width===nr.width}var hr={};function gt(nr){return hr[nr]===void 0&&(hr[nr]=Ft(nr)),hr[nr]}Y.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};function Et(nr){var fr=document.createElement("canvas"),sr=Object.create(Y.webGLContextAttributes);return sr.failIfMajorPerformanceCaveat=nr,fr.probablySupportsContext?fr.probablySupportsContext("webgl",sr)||fr.probablySupportsContext("experimental-webgl",sr):fr.supportsContext?fr.supportsContext("webgl",sr)||fr.supportsContext("experimental-webgl",sr):fr.getContext("webgl",sr)||fr.getContext("experimental-webgl",sr)}function Ft(nr){var fr=Et(nr);if(!fr)return!1;var sr=fr.createShader(fr.VERTEX_SHADER);return!sr||fr.isContextLost()?!1:(fr.shaderSource(sr,"void main() {}"),fr.compileShader(sr),fr.getShaderParameter(sr,fr.COMPILE_STATUS)===!0)}}),r={};r.create=function(ve,Y,ye){var te=e.window.document.createElement(ve);return Y!==void 0&&(te.className=Y),ye&&ye.appendChild(te),te},r.createNS=function(ve,Y){var ye=e.window.document.createElementNS(ve,Y);return ye};var i=e.window.document&&e.window.document.documentElement.style;function a(ve){if(!i)return ve[0];for(var Y=0;Y<ve.length;Y++)if(ve[Y]in i)return ve[Y];return ve[0]}var n=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o;r.disableDrag=function(){i&&n&&(o=i[n],i[n]="none")},r.enableDrag=function(){i&&n&&(i[n]=o)};var s=a(["transform","WebkitTransform"]);r.setTransform=function(ve,Y){ve.style[s]=Y};var c=!1;try{var h=Object.defineProperty({},"passive",{get:function(){c=!0}});e.window.addEventListener("test",h,h),e.window.removeEventListener("test",h,h)}catch{c=!1}r.addEventListener=function(ve,Y,ye,te){te===void 0&&(te={}),"passive"in te&&c?ve.addEventListener(Y,ye,te):ve.addEventListener(Y,ye,te.capture)},r.removeEventListener=function(ve,Y,ye,te){te===void 0&&(te={}),"passive"in te&&c?ve.removeEventListener(Y,ye,te):ve.removeEventListener(Y,ye,te.capture)};var m=function(ve){ve.preventDefault(),ve.stopPropagation(),e.window.removeEventListener("click",m,!0)};r.suppressClick=function(){e.window.addEventListener("click",m,!0),e.window.setTimeout(function(){e.window.removeEventListener("click",m,!0)},0)},r.mousePos=function(ve,Y){var ye=ve.getBoundingClientRect();return new e.Point(Y.clientX-ye.left-ve.clientLeft,Y.clientY-ye.top-ve.clientTop)},r.touchPos=function(ve,Y){for(var ye=ve.getBoundingClientRect(),te=[],me=0;me<Y.length;me++)te.push(new e.Point(Y[me].clientX-ye.left-ve.clientLeft,Y[me].clientY-ye.top-ve.clientTop));return te},r.mouseButton=function(ve){return typeof e.window.InstallTrigger<"u"&&ve.button===2&&ve.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=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<Ge.length;me+=1){var Le=Ge[me],$e=Le.ids,mt=Le.callback;this._notify($e,mt)}this.requestors=[]}},Y.prototype.getImage=function(te){return this.images[te]},Y.prototype.addImage=function(te,me){this._validate(te,me)&&(this.images[te]=me)},Y.prototype._validate=function(te,me){var Ge=!0;return this._validateStretch(me.stretchX,me.data&&me.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchX" value'))),Ge=!1),this._validateStretch(me.stretchY,me.data&&me.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "stretchY" value'))),Ge=!1),this._validateContent(me.content,me)||(this.fire(new e.ErrorEvent(new Error('Image "'+te+'" has invalid "content" value'))),Ge=!1),Ge},Y.prototype._validateStretch=function(te,me){if(!te)return!0;for(var Ge=0,Le=0,$e=te;Le<$e.length;Le+=1){var mt=$e[Le];if(mt[0]<Ge||mt[1]<mt[0]||me<mt[1])return!1;Ge=mt[1]}return!0},Y.prototype._validateContent=function(te,me){return te?!(te.length!==4||te[0]<0||me.data.width<te[0]||te[1]<0||me.data.height<te[1]||te[2]<0||me.data.width<te[2]||te[3]<0||me.data.height<te[3]||te[2]<te[0]||te[3]<te[1]):!0},Y.prototype.updateImage=function(te,me){var Ge=this.images[te];me.version=Ge.version+1,this.images[te]=me,this.updatedImages[te]=!0},Y.prototype.removeImage=function(te){var me=this.images[te];delete this.images[te],delete this.patterns[te],me.userImage&&me.userImage.onRemove&&me.userImage.onRemove()},Y.prototype.listImages=function(){return Object.keys(this.images)},Y.prototype.getImages=function(te,me){var Ge=!0;if(!this.isLoaded())for(var Le=0,$e=te;Le<$e.length;Le+=1){var mt=$e[Le];this.images[mt]||(Ge=!1)}this.isLoaded()||Ge?this._notify(te,me):this.requestors.push({ids:te,callback:me})},Y.prototype._notify=function(te,me){for(var Ge={},Le=0,$e=te;Le<$e.length;Le+=1){var mt=$e[Le];this.images[mt]||this.fire(new e.Event("styleimagemissing",{id:mt}));var jt=this.images[mt];jt?Ge[mt]={data:jt.data.clone(),pixelRatio:jt.pixelRatio,sdf:jt.sdf,version:jt.version,stretchX:jt.stretchX,stretchY:jt.stretchY,content:jt.content,hasRenderCallback:!!(jt.userImage&&jt.userImage.render)}:e.warnOnce('Image "'+mt+'" 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.')}me(null,Ge)},Y.prototype.getPixelSize=function(){var te=this.atlasImage,me=te.width,Ge=te.height;return{width:me,height:Ge}},Y.prototype.getPattern=function(te){var me=this.patterns[te],Ge=this.getImage(te);if(!Ge)return null;if(me&&me.position.version===Ge.version)return me.position;if(me)me.position.version=Ge.version;else{var Le=Ge.data.width+l*2,$e=Ge.data.height+l*2,mt={w:Le,h:$e,x:0,y:0},jt=new e.ImagePosition(mt,Ge);this.patterns[te]={bin:mt,position:jt}}return this._updatePatternAtlas(),this.patterns[te].position},Y.prototype.bind=function(te){var me=te.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(te,this.atlasImage,me.RGBA),this.atlasTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE)},Y.prototype._updatePatternAtlas=function(){var te=[];for(var me in this.patterns)te.push(this.patterns[me].bin);var Ge=e.potpack(te),Le=Ge.w,$e=Ge.h,mt=this.atlasImage;mt.resize({width:Le||1,height:$e||1});for(var jt in this.patterns){var _r=this.patterns[jt],Fr=_r.bin,hr=Fr.x+l,gt=Fr.y+l,Et=this.images[jt].data,Ft=Et.width,nr=Et.height;e.RGBAImage.copy(Et,mt,{x:0,y:0},{x:hr,y:gt},{width:Ft,height:nr}),e.RGBAImage.copy(Et,mt,{x:0,y:nr-1},{x:hr,y:gt-1},{width:Ft,height:1}),e.RGBAImage.copy(Et,mt,{x:0,y:0},{x:hr,y:gt+nr},{width:Ft,height:1}),e.RGBAImage.copy(Et,mt,{x:Ft-1,y:0},{x:hr-1,y:gt},{width:1,height:nr}),e.RGBAImage.copy(Et,mt,{x:0,y:0},{x:hr+Ft,y:gt},{width:1,height:nr})}this.dirty=!0},Y.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},Y.prototype.dispatchRenderCallbacks=function(te){for(var me=0,Ge=te;me<Ge.length;me+=1){var Le=Ge[me];if(!this.callbackDispatchedThisFrame[Le]){this.callbackDispatchedThisFrame[Le]=!0;var $e=this.images[Le],mt=T($e);mt&&this.updateImage(Le,$e)}}},Y}(e.Evented);function w(ve,Y,ye,te,me){var Ge=Y*256,Le=Ge+255,$e=te.transformRequest(te.normalizeGlyphsURL(ye).replace("{fontstack}",ve).replace("{range}",Ge+"-"+Le),e.ResourceType.Glyphs);e.getArrayBuffer($e,function(mt,jt){if(mt)me(mt);else if(jt){for(var _r={},Fr=0,hr=e.parseGlyphPBF(jt);Fr<hr.length;Fr+=1){var gt=hr[Fr];_r[gt.id]=gt}me(null,_r)}})}var S=b,E=b,g=1e20;function b(ve,Y,ye,te,me,Ge){this.fontSize=ve||24,this.buffer=Y===void 0?3:Y,this.cutoff=te||.25,this.fontFamily=me||"sans-serif",this.fontWeight=Ge||"normal",this.radius=ye||8;var Le=this.size=this.fontSize+this.buffer*2;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=Le,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(Le*Le),this.gridInner=new Float64Array(Le*Le),this.f=new Float64Array(Le),this.d=new Float64Array(Le),this.z=new Float64Array(Le+1),this.v=new Int16Array(Le),this.middle=Math.round(Le/2*(navigator.userAgent.indexOf("Gecko/")>=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;te<this.size*this.size;te++){var me=Y.data[te*4+3]/255;this.gridOuter[te]=me===1?0:me===0?g:Math.pow(Math.max(0,.5-me),2),this.gridInner[te]=me===1?g:me===0?0:Math.pow(Math.max(0,me-.5),2)}for(p(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),p(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),te=0;te<this.size*this.size;te++){var Ge=this.gridOuter[te]-this.gridInner[te];ye[te]=Math.max(0,Math.min(255,Math.round(255-255*(Ge/this.radius+this.cutoff))))}return ye};function p(ve,Y,ye,te,me,Ge,Le){for(var $e=0;$e<Y;$e++){for(var mt=0;mt<ye;mt++)te[mt]=ve[mt*Y+$e];for(u(te,me,Ge,Le,ye),mt=0;mt<ye;mt++)ve[mt*Y+$e]=me[mt]}for(mt=0;mt<ye;mt++){for($e=0;$e<Y;$e++)te[$e]=ve[mt*Y+$e];for(u(te,me,Ge,Le,Y),$e=0;$e<Y;$e++)ve[mt*Y+$e]=Math.sqrt(me[$e])}}function u(ve,Y,ye,te,me){ye[0]=0,te[0]=-g,te[1]=+g;for(var Ge=1,Le=0;Ge<me;Ge++){for(var $e=(ve[Ge]+Ge*Ge-(ve[ye[Le]]+ye[Le]*ye[Le]))/(2*Ge-2*ye[Le]);$e<=te[Le];)Le--,$e=(ve[Ge]+Ge*Ge-(ve[ye[Le]]+ye[Le]*ye[Le]))/(2*Ge-2*ye[Le]);Le++,ye[Le]=Ge,te[Le]=$e,te[Le+1]=+g}for(Ge=0,Le=0;Ge<me;Ge++){for(;te[Le+1]<Ge;)Le++;Y[Ge]=(Ge-ye[Le])*(Ge-ye[Le])+ve[ye[Le]]}}S.default=E;var y=function(Y,ye){this.requestManager=Y,this.localIdeographFontFamily=ye,this.entries={}};y.prototype.setURL=function(Y){this.url=Y},y.prototype.getGlyphs=function(Y,ye){var te=this,me=[];for(var Ge in Y)for(var Le=0,$e=Y[Ge];Le<$e.length;Le+=1){var mt=$e[Le];me.push({stack:Ge,id:mt})}e.asyncAll(me,function(jt,_r){var Fr=jt.stack,hr=jt.id,gt=te.entries[Fr];gt||(gt=te.entries[Fr]={glyphs:{},requests:{},ranges:{}});var Et=gt.glyphs[hr];if(Et!==void 0){_r(null,{stack:Fr,id:hr,glyph:Et});return}if(Et=te._tinySDF(gt,Fr,hr),Et){gt.glyphs[hr]=Et,_r(null,{stack:Fr,id:hr,glyph:Et});return}var Ft=Math.floor(hr/256);if(Ft*256>65535){_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;lr<Xt.length;lr+=1){var or=Xt[lr];or(fr,sr)}delete gt.requests[Ft]})),nr.push(function(fr,sr){fr?_r(fr):sr&&_r(null,{stack:Fr,id:hr,glyph:sr[hr]||null})})},function(jt,_r){if(jt)ye(jt);else if(_r){for(var Fr={},hr=0,gt=_r;hr<gt.length;hr+=1){var Et=gt[hr],Ft=Et.stack,nr=Et.id,fr=Et.glyph;(Fr[Ft]||(Fr[Ft]={}))[nr]=fr&&{id:fr.id,bitmap:fr.bitmap.clone(),metrics:fr.metrics}}ye(null,Fr)}})},y.prototype._doesCharSupportLocalGlyph=function(Y){return!!this.localIdeographFontFamily&&(e.isChar["CJK Unified Ideographs"](Y)||e.isChar["Hangul Syllables"](Y)||e.isChar.Hiragana(Y)||e.isChar.Katakana(Y))},y.prototype._tinySDF=function(Y,ye,te){var me=this.localIdeographFontFamily;if(me&&this._doesCharSupportLocalGlyph(te)){var Ge=Y.tinySDF;if(!Ge){var Le="400";/bold/i.test(ye)?Le="900":/medium/i.test(ye)?Le="500":/light/i.test(ye)&&(Le="200"),Ge=Y.tinySDF=new y.TinySDF(24,3,8,.25,me,Le)}return{id:te,bitmap:new e.AlphaImage({width:30,height:30},Ge.draw(String.fromCharCode(te))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=w,y.TinySDF=S;var f=function(){this.specification=e.styleSpec.light.position};f.prototype.possiblyEvaluate=function(Y,ye){return e.sphericalToCartesian(Y.expression.evaluate(ye))},f.prototype.interpolate=function(Y,ye,te){return{x:e.number(Y.x,ye.x,te),y:e.number(Y.y,ye.y,te),z:e.number(Y.z,ye.z,te)}};var P=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new f,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),L="-transition",z=function(ve){function Y(ye){ve.call(this),this._transitionable=new e.Transitionable(P),this.setLight(ye),this._transitioning=this._transitionable.untransitioned()}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.getLight=function(){return this._transitionable.serialize()},Y.prototype.setLight=function(te,me){if(me===void 0&&(me={}),!this._validate(e.validateLight,te,me))for(var Ge in te){var Le=te[Ge];e.endsWith(Ge,L)?this._transitionable.setTransition(Ge.slice(0,-L.length),Le):this._transitionable.setValue(Ge,Le)}},Y.prototype.updateTransitions=function(te){this._transitioning=this._transitionable.transitioned(te,this._transitioning)},Y.prototype.hasTransition=function(){return this._transitioning.hasTransition()},Y.prototype.recalculate=function(te){this.properties=this._transitioning.possiblyEvaluate(te)},Y.prototype._validate=function(te,me,Ge){return Ge&&Ge.validate===!1?!1:e.emitValidationErrors(this,te.call(e.validateStyle,e.extend({value:me,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},Y}(e.Evented),F=function(Y,ye){this.width=Y,this.height=ye,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};F.prototype.getDash=function(Y,ye){var te=Y.join(",")+String(ye);return this.dashEntry[te]||(this.dashEntry[te]=this.addDash(Y,ye)),this.dashEntry[te]},F.prototype.getDashRanges=function(Y,ye,te){var me=Y.length%2===1,Ge=[],Le=me?-Y[Y.length-1]*te:0,$e=Y[0]*te,mt=!0;Ge.push({left:Le,right:$e,isDash:mt,zeroLength:Y[0]===0});for(var jt=Y[0],_r=1;_r<Y.length;_r++){mt=!mt;var Fr=Y[_r];Le=jt*te,jt+=Fr,$e=jt*te,Ge.push({left:Le,right:$e,isDash:mt,zeroLength:Fr===0})}return Ge},F.prototype.addRoundDash=function(Y,ye,te){for(var me=ye/2,Ge=-te;Ge<=te;Ge++)for(var Le=this.nextRow+te+Ge,$e=this.width*Le,mt=0,jt=Y[mt],_r=0;_r<this.width;_r++){_r/jt.right>1&&(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;_r<this.width;_r++){_r/jt.right>1&&(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<Y.length;Le++)Ge+=Y[Le];if(Ge!==0){var $e=this.width/Ge,mt=this.getDashRanges(Y,this.width,$e);ye?this.addRoundDash(mt,$e,te):this.addRegularDash(mt)}var jt={y:(this.nextRow+te+.5)/this.height,height:2*te/this.height,width:Ge};return this.nextRow+=me,this.dirty=!0,jt},F.prototype.bind=function(Y){var ye=Y.gl;this.texture?(ye.bindTexture(ye.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,ye.texSubImage2D(ye.TEXTURE_2D,0,0,0,this.width,this.height,ye.ALPHA,ye.UNSIGNED_BYTE,this.data))):(this.texture=ye.createTexture(),ye.bindTexture(ye.TEXTURE_2D,this.texture),ye.texParameteri(ye.TEXTURE_2D,ye.TEXTURE_WRAP_S,ye.REPEAT),ye.texParameteri(ye.TEXTURE_2D,ye.TEXTURE_WRAP_T,ye.REPEAT),ye.texParameteri(ye.TEXTURE_2D,ye.TEXTURE_MIN_FILTER,ye.LINEAR),ye.texParameteri(ye.TEXTURE_2D,ye.TEXTURE_MAG_FILTER,ye.LINEAR),ye.texImage2D(ye.TEXTURE_2D,0,ye.ALPHA,this.width,this.height,0,ye.ALPHA,ye.UNSIGNED_BYTE,this.data))};var B=function ve(Y,ye){this.workerPool=Y,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var te=this.workerPool.acquire(this.id),me=0;me<te.length;me++){var Ge=te[me],Le=new ve.Actor(Ge,ye,this.id);Le.name="Worker "+me,this.actors.push(Le)}};B.prototype.broadcast=function(Y,ye,te){te=te||function(){},e.asyncAll(this.actors,function(me,Ge){me.send(Y,ye,Ge)},te)},B.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},B.prototype.remove=function(){this.actors.forEach(function(Y){Y.remove()}),this.actors=[],this.workerPool.release(this.id)},B.Actor=e.Actor;function O(ve,Y,ye){var te=function(me,Ge){if(me)return ye(me);if(Ge){var Le=e.pick(e.extend(Ge,ve),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);Ge.vector_layers&&(Le.vectorLayers=Ge.vector_layers,Le.vectorLayerIds=Le.vectorLayers.map(function($e){return $e.id})),Le.tiles=Y.canonicalizeTileset(Le,ve.url),ye(null,Le)}};return ve.url?e.getJSON(Y.transformRequest(Y.normalizeSourceURL(ve.url),e.ResourceType.Source),te):e.browser.frame(function(){return te(null,ve)})}var I=function(Y,ye,te){this.bounds=e.LngLatBounds.convert(this.validateBounds(Y)),this.minzoom=ye||0,this.maxzoom=te||24};I.prototype.validateBounds=function(Y){return!Array.isArray(Y)||Y.length!==4?[-180,-90,180,90]:[Math.max(-180,Y[0]),Math.max(-90,Y[1]),Math.min(180,Y[2]),Math.min(90,Y[3])]},I.prototype.contains=function(Y){var ye=Math.pow(2,Y.z),te={minX:Math.floor(e.mercatorXfromLng(this.bounds.getWest())*ye),minY:Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*ye),maxX:Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*ye),maxY:Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*ye)},me=Y.x>=te.minX&&Y.x<te.maxX&&Y.y>=te.minY&&Y.y<te.maxY;return me};var N=function(ve){function Y(ye,te,me,Ge){if(ve.call(this),this.id=ye,this.dispatcher=me,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(te,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},te),this._collectResourceTiming=te.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Ge)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(this._options,this.map._requestManager,function(me,Ge){te._tileJSONRequest=null,te._loaded=!0,me?te.fire(new e.ErrorEvent(me)):Ge&&(e.extend(te,Ge),Ge.bounds&&(te.tileBounds=new I(Ge.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(Ge.tiles,te.map._requestManager._customAccessToken),e.postMapLoadEvent(Ge.tiles,te.map._getMapId(),te.map._requestManager._skuToken,te.map._requestManager._customAccessToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.setSourceProperty=function(te){this._tileJSONRequest&&this._tileJSONRequest.cancel(),te();var me=this.map.style.sourceCaches[this.id];me.clearTiles(),this.load()},Y.prototype.setTiles=function(te){var me=this;return this.setSourceProperty(function(){me._options.tiles=te}),this},Y.prototype.setUrl=function(te){var me=this;return this.setSourceProperty(function(){me.url=te,me._options.url=te}),this},Y.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},Y.prototype.serialize=function(){return e.extend({},this._options)},Y.prototype.loadTile=function(te,me){var Ge=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme)),Le={request:this.map._requestManager.transformRequest(Ge,e.ResourceType.Tile),uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,tileSize:this.tileSize*te.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Le.request.collectResourceTiming=this._collectResourceTiming,!te.actor||te.state==="expired"?(te.actor=this.dispatcher.getActor(),te.request=te.actor.send("loadTile",Le,$e.bind(this))):te.state==="loading"?te.reloadCallback=me:te.request=te.actor.send("reloadTile",Le,$e.bind(this));function $e(mt,jt){if(delete te.request,te.aborted)return me(null);if(mt&&mt.status!==404)return me(mt);jt&&jt.resourceTiming&&(te.resourceTiming=jt.resourceTiming),this.map._refreshExpiredTiles&&jt&&te.setExpiryData(jt),te.loadVectorData(jt,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),me(null),te.reloadCallback&&(this.loadTile(te,te.reloadCallback),te.reloadCallback=null)}},Y.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.actor&&te.actor.send("abortTile",{uid:te.uid,type:this.type,source:this.id},void 0)},Y.prototype.unloadTile=function(te){te.unloadVectorData(),te.actor&&te.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id},void 0)},Y.prototype.hasTransition=function(){return!1},Y}(e.Evented),U=function(ve){function Y(ye,te,me,Ge){ve.call(this),this.id=ye,this.dispatcher=me,this.setEventedParent(Ge),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},te),e.extend(this,e.pick(te,["url","scheme","tileSize"]))}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){var te=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(this._options,this.map._requestManager,function(me,Ge){te._tileJSONRequest=null,te._loaded=!0,me?te.fire(new e.ErrorEvent(me)):Ge&&(e.extend(te,Ge),Ge.bounds&&(te.tileBounds=new I(Ge.bounds,te.minzoom,te.maxzoom)),e.postTurnstileEvent(Ge.tiles),e.postMapLoadEvent(Ge.tiles,te.map._getMapId(),te.map._requestManager._skuToken),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),te.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))})},Y.prototype.loaded=function(){return this._loaded},Y.prototype.onAdd=function(te){this.map=te,this.load()},Y.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},Y.prototype.serialize=function(){return e.extend({},this._options)},Y.prototype.hasTile=function(te){return!this.tileBounds||this.tileBounds.contains(te.canonical)},Y.prototype.loadTile=function(te,me){var Ge=this,Le=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(Le,e.ResourceType.Tile),function($e,mt){if(delete te.request,te.aborted)te.state="unloaded",me(null);else if($e)te.state="errored",me($e);else if(mt){Ge.map._refreshExpiredTiles&&te.setExpiryData(mt),delete mt.cacheControl,delete mt.expires;var jt=Ge.map.painter.context,_r=jt.gl;te.texture=Ge.map.painter.getTileTexture(mt.width),te.texture?te.texture.update(mt,{useMipmap:!0}):(te.texture=new e.Texture(jt,mt,_r.RGBA,{useMipmap:!0}),te.texture.bind(_r.LINEAR,_r.CLAMP_TO_EDGE,_r.LINEAR_MIPMAP_NEAREST),jt.extTextureFilterAnisotropic&&_r.texParameterf(_r.TEXTURE_2D,jt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,jt.extTextureFilterAnisotropicMax)),te.state="loaded",e.cacheEntryPossiblyAdded(Ge.dispatcher),me(null)}})},Y.prototype.abortTile=function(te,me){te.request&&(te.request.cancel(),delete te.request),me()},Y.prototype.unloadTile=function(te,me){te.texture&&this.map.painter.saveTileTexture(te.texture),me()},Y.prototype.hasTransition=function(){return!1},Y}(e.Evented),W=function(ve){function Y(ye,te,me,Ge){ve.call(this,ye,te,me,Ge),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},te),this.encoding=te.encoding||"mapbox"}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},Y.prototype.loadTile=function(te,me){var Ge=this.map._requestManager.normalizeTileURL(te.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);te.request=e.getImage(this.map._requestManager.transformRequest(Ge,e.ResourceType.Tile),Le.bind(this)),te.neighboringTiles=this._getNeighboringTiles(te.tileID);function Le(mt,jt){if(delete te.request,te.aborted)te.state="unloaded",me(null);else if(mt)te.state="errored",me(mt);else if(jt){this.map._refreshExpiredTiles&&te.setExpiryData(jt),delete jt.cacheControl,delete jt.expires;var _r=e.window.ImageBitmap&&jt instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported(),Fr=_r?jt:e.browser.getImageData(jt,1),hr={uid:te.uid,coord:te.tileID,source:this.id,rawImageData:Fr,encoding:this.encoding};(!te.actor||te.state==="expired")&&(te.actor=this.dispatcher.getActor(),te.actor.send("loadDEMTile",hr,$e.bind(this)))}}function $e(mt,jt){mt&&(te.state="errored",me(mt)),jt&&(te.dem=jt,te.needsHillshadePrepare=!0,te.state="loaded",me(null))}},Y.prototype._getNeighboringTiles=function(te){var me=te.canonical,Ge=Math.pow(2,me.z),Le=(me.x-1+Ge)%Ge,$e=me.x===0?te.wrap-1:te.wrap,mt=(me.x+1+Ge)%Ge,jt=me.x+1===Ge?te.wrap+1:te.wrap,_r={};return _r[new e.OverscaledTileID(te.overscaledZ,$e,me.z,Le,me.y).key]={backfilled:!1},_r[new e.OverscaledTileID(te.overscaledZ,jt,me.z,mt,me.y).key]={backfilled:!1},me.y>0&&(_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+1<Ge&&(_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}),_r},Y.prototype.unloadTile=function(te){te.demTexture&&this.map.painter.saveTileTexture(te.demTexture),te.fbo&&(te.fbo.destroy(),delete te.fbo),te.dem&&delete te.dem,delete te.neighboringTiles,te.state="unloaded",te.actor&&te.actor.send("removeDEMTile",{uid:te.uid,source:this.id})},Y}(U),Q=function(ve){function Y(ye,te,me,Ge){ve.call(this),this.id=ye,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=me.getActor(),this.setEventedParent(Ge),this._data=te.data,this._options=e.extend({},te),this._collectResourceTiming=te.collectResourceTiming,this._resourceTiming=[],te.maxzoom!==void 0&&(this.maxzoom=te.maxzoom),te.type&&(this.type=te.type),te.attribution&&(this.attribution=te.attribution),this.promoteId=te.promoteId;var Le=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:te.cluster||!1,geojsonVtOptions:{buffer:(te.buffer!==void 0?te.buffer:128)*Le,tolerance:(te.tolerance!==void 0?te.tolerance:.375)*Le,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:te.lineMetrics||!1,generateId:te.generateId||!1},superclusterOptions:{maxZoom:te.clusterMaxZoom!==void 0?Math.min(te.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,te.clusterMinPoints||2),extent:e.EXTENT,radius:(te.clusterRadius||50)*Le,log:!1,generateId:te.generateId||!1},clusterProperties:te.clusterProperties,filter:te.filter},te.workerOptions)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){var te=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(me){if(me){te.fire(new e.ErrorEvent(me));return}var Ge={dataType:"source",sourceDataType:"metadata"};te._collectResourceTiming&&te._resourceTiming&&te._resourceTiming.length>0&&(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;Ge<Le.length;Ge+=1){var $e=Le[Ge];Y=Math.min(Y,$e.x),ye=Math.min(ye,$e.y),te=Math.max(te,$e.x),me=Math.max(me,$e.y)}var mt=te-Y,jt=me-ye,_r=Math.max(mt,jt),Fr=Math.max(0,Math.floor(-Math.log(_r)/Math.LN2)),hr=Math.pow(2,Fr);return new e.CanonicalTileID(Fr,Math.floor((Y+te)/2*hr),Math.floor((ye+me)/2*hr))}var H=function(ve){function Y(ye,te,me,Ge){ve.call(this,ye,te,me,Ge),this.roundZoom=!0,this.type="video",this.options=te}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.load=function(){var te=this;this._loaded=!1;var me=this.options;this.urls=[];for(var Ge=0,Le=me.urls;Ge<Le.length;Ge+=1){var $e=Le[Ge];this.urls.push(this.map._requestManager.transformRequest($e,e.ResourceType.Source).url)}e.getVideo(this.urls,function(mt,jt){te._loaded=!0,mt?te.fire(new e.ErrorEvent(mt)):jt&&(te.video=jt,te.video.loop=!0,te.video.addEventListener("playing",function(){te.map.triggerRepaint()}),te.map&&te.video.play(),te._finishLoading())})},Y.prototype.pause=function(){this.video&&this.video.pause()},Y.prototype.play=function(){this.video&&this.video.play()},Y.prototype.seek=function(te){if(this.video){var me=this.video.seekable;te<me.start(0)||te>me.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];te<me.length;te+=1){var Ge=me[te];if(isNaN(Ge)||Ge<=0)return!0}return!1},Y}(se),J={vector:N,raster:U,"raster-dem":W,geojson:Q,video:H,image:se,canvas:$},X=function(ve,Y,ye,te){var me=new J[Y.type](ve,Y,ye,te);if(me.id!==ve)throw new Error("Expected Source id to be "+ve+" instead of "+me.id);return e.bindAll(["load","abort","unload","serialize","prepare"],me),me},oe=function(ve){return J[ve]},ne=function(ve,Y){J[ve]=Y};function j(ve,Y){var ye=e.identity([]);return e.translate(ye,ye,[1,1,0]),e.scale(ye,ye,[ve.width*.5,ve.height*.5,1]),e.multiply(ye,ye,ve.calculatePosMatrix(Y.toUnwrapped()))}function ee(ve,Y,ye){if(ve)for(var te=0,me=ve;te<me.length;te+=1){var Ge=me[te],Le=Y[Ge];if(Le&&Le.source===ye&&Le.type==="fill-extrusion")return!0}else for(var $e in Y){var mt=Y[$e];if(mt.source===ye&&mt.type==="fill-extrusion")return!0}return!1}function re(ve,Y,ye,te,me,Ge){var Le=ee(me&&me.layers,Y,ve.id),$e=Ge.maxPitchScaleFactor(),mt=ve.tilesIn(te,$e,Le);mt.sort(Ae);for(var jt=[],_r=0,Fr=mt;_r<Fr.length;_r+=1){var hr=Fr[_r];jt.push({wrappedTileID:hr.tileID.wrapped().key,queryResults:hr.tile.queryRenderedFeatures(Y,ye,ve._state,hr.queryGeometry,hr.cameraQueryGeometry,hr.scale,me,Ge,$e,j(ve.transform,hr.tileID))})}var gt=ze(jt);for(var Et in gt)gt[Et].forEach(function(Ft){var nr=Ft.feature,fr=ve.getFeatureState(nr.layer["source-layer"],nr.id);nr.source=nr.layer.source,nr.layer["source-layer"]&&(nr.sourceLayer=nr.layer["source-layer"]),nr.state=fr});return gt}function ce(ve,Y,ye,te,me,Ge,Le){for(var $e={},mt=Ge.queryRenderedSymbols(te),jt=[],_r=0,Fr=Object.keys(mt).map(Number);_r<Fr.length;_r+=1){var hr=Fr[_r];jt.push(Le[hr])}jt.sort(Ae);for(var gt=function(){var sr=Ft[Et],pr=sr.featureIndex.lookupSymbolFeatures(mt[sr.bucketInstanceId],Y,sr.bucketIndex,sr.sourceLayerIndex,me.filter,me.layers,me.availableImages,ve);for(var lr in pr){var Xt=$e[lr]=$e[lr]||[],or=pr[lr];or.sort(function(ba,_n){var Xa=sr.featureSortOrder;if(Xa){var ln=Xa.indexOf(ba.featureIndex),$n=Xa.indexOf(_n.featureIndex);return $n-ln}else return _n.featureIndex-ba.featureIndex});for(var Vt=0,Dr=or;Vt<Dr.length;Vt+=1){var Jr=Dr[Vt];Xt.push(Jr)}}},Et=0,Ft=jt;Et<Ft.length;Et+=1)gt();var nr=function(sr){$e[sr].forEach(function(pr){var lr=pr.feature,Xt=ve[sr],or=ye[Xt.source],Vt=or.getFeatureState(lr.layer["source-layer"],lr.id);lr.source=lr.layer.source,lr.layer["source-layer"]&&(lr.sourceLayer=lr.layer["source-layer"]),lr.state=Vt})};for(var fr in $e)nr(fr);return $e}function be(ve,Y){for(var ye=ve.getRenderableIds().map(function(mt){return ve.getTileByID(mt)}),te=[],me={},Ge=0;Ge<ye.length;Ge++){var Le=ye[Ge],$e=Le.tileID.canonical.key;me[$e]||(me[$e]=!0,Le.querySourceFeatures(te,Y))}return te}function Ae(ve,Y){var ye=ve.tileID,te=Y.tileID;return ye.overscaledZ-te.overscaledZ||ye.canonical.y-te.canonical.y||ye.wrap-te.wrap||ye.canonical.x-te.canonical.x}function ze(ve){for(var Y={},ye={},te=0,me=ve;te<me.length;te+=1){var Ge=me[te],Le=Ge.queryResults,$e=Ge.wrappedTileID,mt=ye[$e]=ye[$e]||{};for(var jt in Le)for(var _r=Le[jt],Fr=mt[jt]=mt[jt]||{},hr=Y[jt]=Y[jt]||[],gt=0,Et=_r;gt<Et.length;gt+=1){var Ft=Et[gt];Fr[Ft.featureIndex]||(Fr[Ft.featureIndex]=!0,hr.push(Ft))}}return Y}var Re=function(Y,ye){this.max=Y,this.onRemove=ye,this.reset()};Re.prototype.reset=function(){for(var Y in this.data)for(var ye=0,te=this.data[Y];ye<te.length;ye+=1){var me=te[ye];me.timeout&&clearTimeout(me.timeout),this.onRemove(me.value)}return this.data={},this.order=[],this},Re.prototype.add=function(Y,ye,te){var me=this,Ge=Y.wrapped().key;this.data[Ge]===void 0&&(this.data[Ge]=[]);var Le={value:ye,timeout:void 0};if(te!==void 0&&(Le.timeout=setTimeout(function(){me.remove(Y,Le)},te)),this.data[Ge].push(Le),this.order.push(Ge),this.order.length>this.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];me<Ge.length;me+=1){var Le=Ge[me];Y(Le.value)||ye.push(Le)}for(var $e=0,mt=ye;$e<mt.length;$e+=1){var jt=mt[$e];this.remove(jt.value.tileID,jt)}};var We=function(Y,ye,te){this.context=Y;var me=Y.gl;this.buffer=me.createBuffer(),this.dynamicDraw=!!te,this.context.unbindVAO(),Y.bindElementBuffer.set(this.buffer),me.bufferData(me.ELEMENT_ARRAY_BUFFER,ye.arrayBuffer,this.dynamicDraw?me.DYNAMIC_DRAW:me.STATIC_DRAW),this.dynamicDraw||delete ye.arrayBuffer};We.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},We.prototype.updateData=function(Y){var ye=this.context.gl;this.context.unbindVAO(),this.bind(),ye.bufferSubData(ye.ELEMENT_ARRAY_BUFFER,0,Y.arrayBuffer)},We.prototype.destroy=function(){var Y=this.context.gl;this.buffer&&(Y.deleteBuffer(this.buffer),delete this.buffer)};var it={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},ot=function(Y,ye,te,me){this.length=ye.length,this.attributes=te,this.itemSize=ye.bytesPerElement,this.dynamicDraw=me,this.context=Y;var Ge=Y.gl;this.buffer=Ge.createBuffer(),Y.bindVertexBuffer.set(this.buffer),Ge.bufferData(Ge.ARRAY_BUFFER,ye.arrayBuffer,this.dynamicDraw?Ge.DYNAMIC_DRAW:Ge.STATIC_DRAW),this.dynamicDraw||delete ye.arrayBuffer};ot.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},ot.prototype.updateData=function(Y){var ye=this.context.gl;this.bind(),ye.bufferSubData(ye.ARRAY_BUFFER,0,Y.arrayBuffer)},ot.prototype.enableAttributes=function(Y,ye){for(var te=0;te<this.attributes.length;te++){var me=this.attributes[te],Ge=ye.attributes[me.name];Ge!==void 0&&Y.enableVertexAttribArray(Ge)}},ot.prototype.setVertexAttribPointers=function(Y,ye,te){for(var me=0;me<this.attributes.length;me++){var Ge=this.attributes[me],Le=ye.attributes[Ge.name];Le!==void 0&&Y.vertexAttribPointer(Le,Ge.components,Y[it[Ge.type]],!1,this.itemSize,Ge.offset+this.itemSize*(te||0))}},ot.prototype.destroy=function(){var Y=this.context.gl;this.buffer&&(Y.deleteBuffer(this.buffer),delete this.buffer)};var tt=function(Y){this.gl=Y.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};tt.prototype.get=function(){return this.current},tt.prototype.set=function(Y){},tt.prototype.getDefault=function(){return this.default},tt.prototype.setDefault=function(){this.set(this.default)};var ut=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.getDefault=function(){return e.Color.transparent},Y.prototype.set=function(te){var me=this.current;te.r===me.r&&te.g===me.g&&te.b===me.b&&te.a===me.a&&!this.dirty||(this.gl.clearColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},Y}(tt),Me=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.getDefault=function(){return 1},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearDepth(te),this.current=te,this.dirty=!1)},Y}(tt),_e=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.getDefault=function(){return 0},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.clearStencil(te),this.current=te,this.dirty=!1)},Y}(tt),fe=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.getDefault=function(){return[!0,!0,!0,!0]},Y.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&te[3]===me[3]&&!this.dirty||(this.gl.colorMask(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},Y}(tt),Fe=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.getDefault=function(){return!0},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthMask(te),this.current=te,this.dirty=!1)},Y}(tt),rt=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.getDefault=function(){return 255},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.stencilMask(te),this.current=te,this.dirty=!1)},Y}(tt),st=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.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},Y.prototype.set=function(te){var me=this.current;te.func===me.func&&te.ref===me.ref&&te.mask===me.mask&&!this.dirty||(this.gl.stencilFunc(te.func,te.ref,te.mask),this.current=te,this.dirty=!1)},Y}(tt),Qe=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.getDefault=function(){var te=this.gl;return[te.KEEP,te.KEEP,te.KEEP]},Y.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&!this.dirty||(this.gl.stencilOp(te[0],te[1],te[2]),this.current=te,this.dirty=!1)},Y}(tt),Lt=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.STENCIL_TEST):me.disable(me.STENCIL_TEST),this.current=te,this.dirty=!1}},Y}(tt),kt=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.getDefault=function(){return[0,1]},Y.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&!this.dirty||(this.gl.depthRange(te[0],te[1]),this.current=te,this.dirty=!1)},Y}(tt),qt=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.DEPTH_TEST):me.disable(me.DEPTH_TEST),this.current=te,this.dirty=!1}},Y}(tt),Zt=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.getDefault=function(){return this.gl.LESS},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.depthFunc(te),this.current=te,this.dirty=!1)},Y}(tt),Sr=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.BLEND):me.disable(me.BLEND),this.current=te,this.dirty=!1}},Y}(tt),xr=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.getDefault=function(){var te=this.gl;return[te.ONE,te.ZERO]},Y.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&!this.dirty||(this.gl.blendFunc(te[0],te[1]),this.current=te,this.dirty=!1)},Y}(tt),jr=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.getDefault=function(){return e.Color.transparent},Y.prototype.set=function(te){var me=this.current;te.r===me.r&&te.g===me.g&&te.b===me.b&&te.a===me.a&&!this.dirty||(this.gl.blendColor(te.r,te.g,te.b,te.a),this.current=te,this.dirty=!1)},Y}(tt),wr=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.getDefault=function(){return this.gl.FUNC_ADD},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.blendEquation(te),this.current=te,this.dirty=!1)},Y}(tt),Ir=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;te?me.enable(me.CULL_FACE):me.disable(me.CULL_FACE),this.current=te,this.dirty=!1}},Y}(tt),bt=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.getDefault=function(){return this.gl.BACK},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.cullFace(te),this.current=te,this.dirty=!1)},Y}(tt),Be=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.getDefault=function(){return this.gl.CCW},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.frontFace(te),this.current=te,this.dirty=!1)},Y}(tt),Ke=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.getDefault=function(){return null},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.useProgram(te),this.current=te,this.dirty=!1)},Y}(tt),Ue=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.getDefault=function(){return this.gl.TEXTURE0},Y.prototype.set=function(te){te===this.current&&!this.dirty||(this.gl.activeTexture(te),this.current=te,this.dirty=!1)},Y}(tt),Ee=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.getDefault=function(){var te=this.gl;return[0,0,te.drawingBufferWidth,te.drawingBufferHeight]},Y.prototype.set=function(te){var me=this.current;te[0]===me[0]&&te[1]===me[1]&&te[2]===me[2]&&te[3]===me[3]&&!this.dirty||(this.gl.viewport(te[0],te[1],te[2],te[3]),this.current=te,this.dirty=!1)},Y}(tt),Ve=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.getDefault=function(){return null},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindFramebuffer(me.FRAMEBUFFER,te),this.current=te,this.dirty=!1}},Y}(tt),Ce=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.getDefault=function(){return null},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindRenderbuffer(me.RENDERBUFFER,te),this.current=te,this.dirty=!1}},Y}(tt),Te=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.getDefault=function(){return null},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindTexture(me.TEXTURE_2D,te),this.current=te,this.dirty=!1}},Y}(tt),Pe=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.getDefault=function(){return null},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.bindBuffer(me.ARRAY_BUFFER,te),this.current=te,this.dirty=!1}},Y}(tt),at=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.getDefault=function(){return null},Y.prototype.set=function(te){var me=this.gl;me.bindBuffer(me.ELEMENT_ARRAY_BUFFER,te),this.current=te,this.dirty=!1},Y}(tt),yt=function(ve){function Y(ye){ve.call(this,ye),this.vao=ye.extVertexArrayObject}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.getDefault=function(){return null},Y.prototype.set=function(te){!this.vao||te===this.current&&!this.dirty||(this.vao.bindVertexArrayOES(te),this.current=te,this.dirty=!1)},Y}(tt),Tt=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.getDefault=function(){return 4},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_ALIGNMENT,te),this.current=te,this.dirty=!1}},Y}(tt),Ot=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te),this.current=te,this.dirty=!1}},Y}(tt),Gt=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.getDefault=function(){return!1},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){var me=this.gl;me.pixelStorei(me.UNPACK_FLIP_Y_WEBGL,te),this.current=te,this.dirty=!1}},Y}(tt),rr=function(ve){function Y(ye,te){ve.call(this,ye),this.context=ye,this.parent=te}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.getDefault=function(){return null},Y}(tt),Qt=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.setDirty=function(){this.dirty=!0},Y.prototype.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var me=this.gl;me.framebufferTexture2D(me.FRAMEBUFFER,me.COLOR_ATTACHMENT0,me.TEXTURE_2D,te,0),this.current=te,this.dirty=!1}},Y}(rr),Tr=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.set=function(te){if(!(te===this.current&&!this.dirty)){this.context.bindFramebuffer.set(this.parent);var me=this.gl;me.framebufferRenderbuffer(me.FRAMEBUFFER,me.DEPTH_ATTACHMENT,me.RENDERBUFFER,te),this.current=te,this.dirty=!1}},Y}(rr),la=function(Y,ye,te,me){this.context=Y,this.width=ye,this.height=te;var Ge=Y.gl,Le=this.framebuffer=Ge.createFramebuffer();this.colorAttachment=new Qt(Y,Le),me&&(this.depthAttachment=new Tr(Y,Le))};la.prototype.destroy=function(){var Y=this.context.gl,ye=this.colorAttachment.get();if(ye&&Y.deleteTexture(ye),this.depthAttachment){var te=this.depthAttachment.get();te&&Y.deleteRenderbuffer(te)}Y.deleteFramebuffer(this.framebuffer)};var Ua=519,Ba=function(Y,ye,te){this.func=Y,this.mask=ye,this.range=te};Ba.ReadOnly=!1,Ba.ReadWrite=!0,Ba.disabled=new Ba(Ua,Ba.ReadOnly,[0,1]);var Ra=519,Qa=7680,za=function(Y,ye,te,me,Ge,Le){this.test=Y,this.ref=ye,this.mask=te,this.fail=me,this.depthFail=Ge,this.pass=Le};za.disabled=new za({func:Ra,mask:0},0,0,Qa,Qa,Qa);var en=0,kn=1,Jt=771,Nt=function(Y,ye,te){this.blendFunction=Y,this.blendColor=ye,this.mask=te};Nt.Replace=[kn,en],Nt.disabled=new Nt(Nt.Replace,e.Color.transparent,[!1,!1,!1,!1]),Nt.unblended=new Nt(Nt.Replace,e.Color.transparent,[!0,!0,!0,!0]),Nt.alphaBlended=new Nt([kn,Jt],e.Color.transparent,[!0,!0,!0,!0]);var Kt=1029,Wt=2305,Pr=function(Y,ye,te){this.enable=Y,this.mode=ye,this.frontFace=te};Pr.disabled=new Pr(!1,Kt,Wt),Pr.backCCW=new Pr(!0,Kt,Wt);var ta=function(Y){this.gl=Y,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new ut(this),this.clearDepth=new Me(this),this.clearStencil=new _e(this),this.colorMask=new fe(this),this.depthMask=new Fe(this),this.stencilMask=new rt(this),this.stencilFunc=new st(this),this.stencilOp=new Qe(this),this.stencilTest=new Lt(this),this.depthRange=new kt(this),this.depthTest=new qt(this),this.depthFunc=new Zt(this),this.blend=new Sr(this),this.blendFunc=new xr(this),this.blendColor=new jr(this),this.blendEquation=new wr(this),this.cullFace=new Ir(this),this.cullFaceSide=new bt(this),this.frontFace=new Be(this),this.program=new Ke(this),this.activeTexture=new Ue(this),this.viewport=new Ee(this),this.bindFramebuffer=new Ve(this),this.bindRenderbuffer=new Ce(this),this.bindTexture=new Te(this),this.bindVertexBuffer=new Pe(this),this.bindElementBuffer=new at(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new yt(this),this.pixelStoreUnpack=new Tt(this),this.pixelStoreUnpackPremultiplyAlpha=new Ot(this),this.pixelStoreUnpackFlipY=new Gt(this),this.extTextureFilterAnisotropic=Y.getExtension("EXT_texture_filter_anisotropic")||Y.getExtension("MOZ_EXT_texture_filter_anisotropic")||Y.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=Y.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=Y.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(Y.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=Y.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=Y.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=Y.getParameter(Y.MAX_TEXTURE_SIZE)};ta.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},ta.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},ta.prototype.createIndexBuffer=function(Y,ye){return new We(this,Y,ye)},ta.prototype.createVertexBuffer=function(Y,ye,te){return new ot(this,Y,ye,te)},ta.prototype.createRenderbuffer=function(Y,ye,te){var me=this.gl,Ge=me.createRenderbuffer();return this.bindRenderbuffer.set(Ge),me.renderbufferStorage(me.RENDERBUFFER,Y,ye,te),this.bindRenderbuffer.set(null),Ge},ta.prototype.createFramebuffer=function(Y,ye,te){return new la(this,Y,ye,te)},ta.prototype.clear=function(Y){var ye=Y.color,te=Y.depth,me=this.gl,Ge=0;ye&&(Ge|=me.COLOR_BUFFER_BIT,this.clearColor.set(ye),this.colorMask.set([!0,!0,!0,!0])),typeof te<"u"&&(Ge|=me.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(te),this.depthMask.set(!0)),me.clear(Ge)},ta.prototype.setCullFace=function(Y){Y.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(Y.mode),this.frontFace.set(Y.frontFace))},ta.prototype.setDepthMode=function(Y){Y.func===this.gl.ALWAYS&&!Y.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(Y.func),this.depthMask.set(Y.mask),this.depthRange.set(Y.range))},ta.prototype.setStencilMode=function(Y){Y.test.func===this.gl.ALWAYS&&!Y.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(Y.mask),this.stencilOp.set([Y.fail,Y.depthFail,Y.pass]),this.stencilFunc.set({func:Y.test.func,ref:Y.ref,mask:Y.test.mask}))},ta.prototype.setColorMode=function(Y){e.deepEqual(Y.blendFunction,Nt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(Y.blendFunction),this.blendColor.set(Y.blendColor)),this.colorMask.set(Y.mask)},ta.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var ma=function(ve){function Y(ye,te,me){var Ge=this;ve.call(this),this.id=ye,this.dispatcher=me,this.on("data",function(Le){Le.dataType==="source"&&Le.sourceDataType==="metadata"&&(Ge._sourceLoaded=!0),Ge._sourceLoaded&&!Ge._paused&&Le.dataType==="source"&&Le.sourceDataType==="content"&&(Ge.reload(),Ge.transform&&Ge.update(Ge.transform))}),this.on("error",function(){Ge._sourceErrored=!0}),this._source=X(ye,te,me,this),this._tiles={},this._cache=new Re(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.onAdd=function(te){this.map=te,this._maxTileCacheSize=te?te._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(te)},Y.prototype.onRemove=function(te){this._source&&this._source.onRemove&&this._source.onRemove(te)},Y.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var te in this._tiles){var me=this._tiles[te];if(me.state!=="loaded"&&me.state!=="errored")return!1}return!0},Y.prototype.getSource=function(){return this._source},Y.prototype.pause=function(){this._paused=!0},Y.prototype.resume=function(){if(this._paused){var te=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,te&&this.reload(),this.transform&&this.update(this.transform)}},Y.prototype._loadTile=function(te,me){return this._source.loadTile(te,me)},Y.prototype._unloadTile=function(te){if(this._source.unloadTile)return this._source.unloadTile(te,function(){})},Y.prototype._abortTile=function(te){if(this._source.abortTile)return this._source.abortTile(te,function(){})},Y.prototype.serialize=function(){return this._source.serialize()},Y.prototype.prepare=function(te){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(var me in this._tiles){var Ge=this._tiles[me];Ge.upload(te),Ge.prepare(this.map.style.imageManager)}},Y.prototype.getIds=function(){return e.values(this._tiles).map(function(te){return te.tileID}).sort(ra).map(function(te){return te.key})},Y.prototype.getRenderableIds=function(te){var me=this,Ge=[];for(var Le in this._tiles)this._isIdRenderable(Le,te)&&Ge.push(this._tiles[Le]);return te?Ge.sort(function($e,mt){var jt=$e.tileID,_r=mt.tileID,Fr=new e.Point(jt.canonical.x,jt.canonical.y)._rotate(me.transform.angle),hr=new e.Point(_r.canonical.x,_r.canonical.y)._rotate(me.transform.angle);return jt.overscaledZ-_r.overscaledZ||hr.y-Fr.y||hr.x-Fr.x}).map(function($e){return $e.tileID.key}):Ge.map(function($e){return $e.tileID}).sort(ra).map(function($e){return $e.key})},Y.prototype.hasRenderableParent=function(te){var me=this.findLoadedParent(te,0);return me?this._isIdRenderable(me.tileID.key):!1},Y.prototype._isIdRenderable=function(te,me){return this._tiles[te]&&this._tiles[te].hasData()&&!this._coveredTiles[te]&&(me||!this._tiles[te].holdingForFade())},Y.prototype.reload=function(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(var te in this._tiles)this._tiles[te].state!=="errored"&&this._reloadTile(te,"reloading")},Y.prototype._reloadTile=function(te,me){var Ge=this._tiles[te];Ge&&(Ge.state!=="loading"&&(Ge.state=me),this._loadTile(Ge,this._tileLoaded.bind(this,Ge,te,me)))},Y.prototype._tileLoaded=function(te,me,Ge,Le){if(Le){te.state="errored",Le.status!==404?this._source.fire(new e.ErrorEvent(Le,{tile:te})):this.update(this.transform);return}te.timeAdded=e.browser.now(),Ge==="expired"&&(te.refreshedUponExpiration=!0),this._setTileReloadTimer(me,te),this.getSource().type==="raster-dem"&&te.dem&&this._backfillDEM(te),this._state.initializeTileState(te,this.map?this.map.painter:null),this._source.fire(new e.Event("data",{dataType:"source",tile:te,coord:te.tileID}))},Y.prototype._backfillDEM=function(te){for(var me=this.getRenderableIds(),Ge=0;Ge<me.length;Ge++){var Le=me[Ge];if(te.neighboringTiles&&te.neighboringTiles[Le]){var $e=this.getTileByID(Le);mt(te,$e),mt($e,te)}}function mt(jt,_r){jt.needsHillshadePrepare=!0;var Fr=_r.tileID.canonical.x-jt.tileID.canonical.x,hr=_r.tileID.canonical.y-jt.tileID.canonical.y,gt=Math.pow(2,jt.tileID.canonical.z),Et=_r.tileID.key;Fr===0&&hr===0||Math.abs(hr)>1||(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;gt<Et.length;gt+=1){var Ft=Et[gt],nr=jt[Ft],fr=this._tiles[Ft];if(!(!fr||fr.fadeEndTime&&fr.fadeEndTime<=e.browser.now())){var sr=this.findLoadedParent(nr,$e);sr&&(this._addTile(sr.tileID),_r[sr.tileID.key]=sr.tileID),Fr[Ft]=nr}}this._retainLoadedChildren(Fr,Le,mt,jt);for(var pr in _r)jt[pr]||(this._coveredTiles[pr]=!0,jt[pr]=_r[pr])}for(var lr in jt)this._tiles[lr].clearFadeHold();for(var Xt=e.keysDifference(this._tiles,jt),or=0,Vt=Xt;or<Vt.length;or+=1){var Dr=Vt[or],Jr=this._tiles[Dr];Jr.hasSymbolBuckets&&!Jr.holdingForFade()?Jr.setHoldDuration(this.map._fadeDuration):(!Jr.hasSymbolBuckets||Jr.symbolFadeFinished())&&this._removeTile(Dr)}this._updateLoadedParentTileCache()}},Y.prototype.releaseSymbolFadeTiles=function(){for(var te in this._tiles)this._tiles[te].holdingForFade()&&this._removeTile(te)},Y.prototype._updateRetainedTiles=function(te,me){for(var Ge={},Le={},$e=Math.max(me-Y.maxOverzooming,this._source.minzoom),mt=Math.max(me+Y.maxUnderzooming,this._source.minzoom),jt={},_r=0,Fr=te;_r<Fr.length;_r+=1){var hr=Fr[_r],gt=this._addTile(hr);Ge[hr.key]=hr,!gt.hasData()&&me<this._source.maxzoom&&(jt[hr.key]=hr)}this._retainLoadedChildren(jt,me,mt,Ge);for(var Et=0,Ft=te;Et<Ft.length;Et+=1){var nr=Ft[Et],fr=this._tiles[nr.key];if(!fr.hasData()){if(me+1>this._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;mt<jt.length;mt+=1){var _r=jt[mt];this._loadedParentTiles[_r]=Ge}}},Y.prototype._addTile=function(te){var me=this._tiles[te.key];if(me)return me;me=this._cache.getAndRemove(te),me&&(this._setTileReloadTimer(te.key,me),me.tileID=te,this._state.initializeTileState(me,this.map?this.map.painter:null),this._cacheTimers[te.key]&&(clearTimeout(this._cacheTimers[te.key]),delete this._cacheTimers[te.key],this._setTileReloadTimer(te.key,me)));var Ge=!!me;return Ge||(me=new e.Tile(te,this._source.tileSize*te.overscaleFactor()),this._loadTile(me,this._tileLoaded.bind(this,me,te.key,me.state))),me?(me.uses++,this._tiles[te.key]=me,Ge||this._source.fire(new e.Event("dataloading",{tile:me,coord:me.tileID,dataType:"source"})),me):null},Y.prototype._setTileReloadTimer=function(te,me){var Ge=this;te in this._timers&&(clearTimeout(this._timers[te]),delete this._timers[te]);var Le=me.getExpiryTimeout();Le&&(this._timers[te]=setTimeout(function(){Ge._reloadTile(te,"expired"),delete Ge._timers[te]},Le))},Y.prototype._removeTile=function(te){var me=this._tiles[te];me&&(me.uses--,delete this._tiles[te],this._timers[te]&&(clearTimeout(this._timers[te]),delete this._timers[te]),!(me.uses>0)&&(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<sr.length;fr+=1){var pr=sr[fr];gt=Math.min(gt,pr.x),Et=Math.min(Et,pr.y),Ft=Math.max(Ft,pr.x),nr=Math.max(nr,pr.y)}for(var lr=function(or){var Vt=Le._tiles[hr[or]];if(!Vt.holdingForFade()){var Dr=Vt.tileID,Jr=Math.pow(2,mt.zoom-Vt.tileID.overscaledZ),ba=me*Vt.queryPadding*e.EXTENT/Vt.tileSize/Jr,_n=[Dr.getTilePoint(new e.MercatorCoordinate(gt,Et)),Dr.getTilePoint(new e.MercatorCoordinate(Ft,nr))];if(_n[0].x-ba<e.EXTENT&&_n[0].y-ba<e.EXTENT&&_n[1].x+ba>=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<hr.length;Xt++)lr(Xt);return $e},Y.prototype.getVisibleCoordinates=function(te){for(var me=this,Ge=this.getRenderableIds(te).map(function(jt){return me._tiles[jt].tileID}),Le=0,$e=Ge;Le<$e.length;Le+=1){var mt=$e[Le];mt.posMatrix=this.transform.calculatePosMatrix(mt.toUnwrapped())}return Ge},Y.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Ia(this._source.type))for(var te in this._tiles){var me=this._tiles[te];if(me.fadeEndTime!==void 0&&me.fadeEndTime>=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.length<nn.workerCount;)this.workers.push(new Ha);return this.active[Y]=!0,this.workers.slice()},nn.prototype.release=function(Y){delete this.active[Y],this.numActive()===0&&(this.workers.forEach(function(ye){ye.terminate()}),this.workers=null)},nn.prototype.isPreloaded=function(){return!!this.active[rn]},nn.prototype.numActive=function(){return Object.keys(this.active).length};var yn=Math.floor(e.browser.hardwareConcurrency/2);nn.workerCount=Math.max(Math.min(yn,6),1);var xt;function ct(){return xt||(xt=new nn),xt}function Nr(){var ve=ct();ve.acquire(rn)}function Or(){var ve=xt;ve&&(ve.isPreloaded()&&ve.numActive()===1?(ve.release(rn),xt=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()"))}function Rr(ve,Y){var ye={};for(var te in ve)te!=="ref"&&(ye[te]=ve[te]);return e.refProperties.forEach(function(me){me in Y&&(ye[me]=Y[me])}),ye}function Lr(ve){ve=ve.slice();for(var Y=Object.create(null),ye=0;ye<ve.length;ye++)Y[ve[ye].id]=ve[ye];for(var te=0;te<ve.length;te++)"ref"in ve[te]&&(ve[te]=Rr(ve[te],Y[ve[te].ref]));return ve}function Gr(){var ve={},Y=e.styleSpec.$version;for(var ye in e.styleSpec.$root){var te=e.styleSpec.$root[ye];if(te.required){var me=null;ye==="version"?me=Y:te.type==="array"?me=[]:me={},me!=null&&(ve[ye]=me)}}return ve}var Kr={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ur(ve,Y,ye){ye.push({command:Kr.addSource,args:[ve,Y[ve]]})}function aa(ve,Y,ye){Y.push({command:Kr.removeSource,args:[ve]}),ye[ve]=!0}function da(ve,Y,ye,te){aa(ve,ye,te),Ur(ve,Y,ye)}function fa(ve,Y,ye){var te;for(te in ve[ye])if(ve[ye].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[ye][te],Y[ye][te]))return!1;for(te in Y[ye])if(Y[ye].hasOwnProperty(te)&&te!=="data"&&!e.deepEqual(ve[ye][te],Y[ye][te]))return!1;return!0}function It(ve,Y,ye,te){ve=ve||{},Y=Y||{};var me;for(me in ve)ve.hasOwnProperty(me)&&(Y.hasOwnProperty(me)||aa(me,ye,te));for(me in Y)Y.hasOwnProperty(me)&&(ve.hasOwnProperty(me)?e.deepEqual(ve[me],Y[me])||(ve[me].type==="geojson"&&Y[me].type==="geojson"&&fa(ve,Y,me)?ye.push({command:Kr.setGeoJSONSourceData,args:[me,Y[me].data]}):da(me,Y,ye,te)):Ur(me,Y,ye))}function dr(ve,Y,ye,te,me,Ge){ve=ve||{},Y=Y||{};var Le;for(Le in ve)ve.hasOwnProperty(Le)&&(e.deepEqual(ve[Le],Y[Le])||ye.push({command:Ge,args:[te,Le,Y[Le],me]}));for(Le in Y)!Y.hasOwnProperty(Le)||ve.hasOwnProperty(Le)||e.deepEqual(ve[Le],Y[Le])||ye.push({command:Ge,args:[te,Le,Y[Le],me]})}function kr(ve){return ve.id}function na(ve,Y){return ve[Y.id]=Y,ve}function Ca(ve,Y,ye){ve=ve||[],Y=Y||[];var te=ve.map(kr),me=Y.map(kr),Ge=ve.reduce(na,{}),Le=Y.reduce(na,{}),$e=te.slice(),mt=Object.create(null),jt,_r,Fr,hr,gt,Et,Ft;for(jt=0,_r=0;jt<te.length;jt++)Fr=te[jt],Le.hasOwnProperty(Fr)?_r++:(ye.push({command:Kr.removeLayer,args:[Fr]}),$e.splice($e.indexOf(Fr,_r),1));for(jt=0,_r=0;jt<me.length;jt++)Fr=me[me.length-1-jt],$e[$e.length-1-jt]!==Fr&&(Ge.hasOwnProperty(Fr)?(ye.push({command:Kr.removeLayer,args:[Fr]}),$e.splice($e.lastIndexOf(Fr,$e.length-_r),1)):_r++,Et=$e[$e.length-jt],ye.push({command:Kr.addLayer,args:[Le[Fr],Et]}),$e.splice($e.length-jt,0,Fr),mt[Fr]=!0);for(jt=0;jt<me.length;jt++)if(Fr=me[jt],hr=Ge[Fr],gt=Le[Fr],!(mt[Fr]||e.deepEqual(hr,gt))){if(!e.deepEqual(hr.source,gt.source)||!e.deepEqual(hr["source-layer"],gt["source-layer"])||!e.deepEqual(hr.type,gt.type)){ye.push({command:Kr.removeLayer,args:[Fr]}),Et=$e[$e.lastIndexOf(Fr)+1],ye.push({command:Kr.addLayer,args:[gt,Et]});continue}dr(hr.layout,gt.layout,ye,Fr,null,Kr.setLayoutProperty),dr(hr.paint,gt.paint,ye,Fr,null,Kr.setPaintProperty),e.deepEqual(hr.filter,gt.filter)||ye.push({command:Kr.setFilter,args:[Fr,gt.filter]}),(!e.deepEqual(hr.minzoom,gt.minzoom)||!e.deepEqual(hr.maxzoom,gt.maxzoom))&&ye.push({command:Kr.setLayerZoomRange,args:[Fr,gt.minzoom,gt.maxzoom]});for(Ft in hr)hr.hasOwnProperty(Ft)&&(Ft==="layout"||Ft==="paint"||Ft==="filter"||Ft==="metadata"||Ft==="minzoom"||Ft==="maxzoom"||(Ft.indexOf("paint.")===0?dr(hr[Ft],gt[Ft],ye,Fr,Ft.slice(6),Kr.setPaintProperty):e.deepEqual(hr[Ft],gt[Ft])||ye.push({command:Kr.setLayerProperty,args:[Fr,Ft,gt[Ft]]})));for(Ft in gt)!gt.hasOwnProperty(Ft)||hr.hasOwnProperty(Ft)||Ft==="layout"||Ft==="paint"||Ft==="filter"||Ft==="metadata"||Ft==="minzoom"||Ft==="maxzoom"||(Ft.indexOf("paint.")===0?dr(hr[Ft],gt[Ft],ye,Fr,Ft.slice(6),Kr.setPaintProperty):e.deepEqual(hr[Ft],gt[Ft])||ye.push({command:Kr.setLayerProperty,args:[Fr,Ft,gt[Ft]]}))}}function Fa(ve,Y){if(!ve)return[{command:Kr.setStyle,args:[Y]}];var ye=[];try{if(!e.deepEqual(ve.version,Y.version))return[{command:Kr.setStyle,args:[Y]}];e.deepEqual(ve.center,Y.center)||ye.push({command:Kr.setCenter,args:[Y.center]}),e.deepEqual(ve.zoom,Y.zoom)||ye.push({command:Kr.setZoom,args:[Y.zoom]}),e.deepEqual(ve.bearing,Y.bearing)||ye.push({command:Kr.setBearing,args:[Y.bearing]}),e.deepEqual(ve.pitch,Y.pitch)||ye.push({command:Kr.setPitch,args:[Y.pitch]}),e.deepEqual(ve.sprite,Y.sprite)||ye.push({command:Kr.setSprite,args:[Y.sprite]}),e.deepEqual(ve.glyphs,Y.glyphs)||ye.push({command:Kr.setGlyphs,args:[Y.glyphs]}),e.deepEqual(ve.transition,Y.transition)||ye.push({command:Kr.setTransition,args:[Y.transition]}),e.deepEqual(ve.light,Y.light)||ye.push({command:Kr.setLight,args:[Y.light]});var te={},me=[];It(ve.sources,Y.sources,me,te);var Ge=[];ve.layers&&ve.layers.forEach(function(Le){te[Le.source]?ye.push({command:Kr.removeLayer,args:[Le.id]}):Ge.push(Le)}),ye=ye.concat(me),Ca(Ge,Y.layers,ye)}catch(Le){console.warn("Unable to compute style diff:",Le),ye=[{command:Kr.setStyle,args:[Y]}]}return ye}var Ya=function(Y,ye){this.reset(Y,ye)};Ya.prototype.reset=function(Y,ye){this.points=Y||[],this._distances=[0];for(var te=1;te<this.points.length;te++)this._distances[te]=this._distances[te-1]+this.points[te].dist(this.points[te-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(ye||0,this.length*.5),this.paddedLength=this.length-this.padding*2},Ya.prototype.lerp=function(Y){if(this.points.length===1)return this.points[0];Y=e.clamp(Y,0,1);for(var ye=1,te=this._distances[ye],me=Y*this.paddedLength+this.padding;te<me&&ye<this._distances.length;)te=this._distances[++ye];var Ge=ye-1,Le=this._distances[Ge],$e=te-Le,mt=$e>0?(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;Le<this.xCellCount*this.yCellCount;Le++)me.push([]),Ge.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=Y,this.height=ye,this.xScale=this.xCellCount/Y,this.yScale=this.yCellCount/ye,this.boxUid=0,this.circleUid=0};ha.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ha.prototype.insert=function(Y,ye,te,me,Ge){this._forEachCell(ye,te,me,Ge,this._insertBoxCell,this.boxUid++),this.boxKeys.push(Y),this.bboxes.push(ye),this.bboxes.push(te),this.bboxes.push(me),this.bboxes.push(Ge)},ha.prototype.insertCircle=function(Y,ye,te,me){this._forEachCell(ye-me,te-me,ye+me,te+me,this._insertCircleCell,this.circleUid++),this.circleKeys.push(Y),this.circles.push(ye),this.circles.push(te),this.circles.push(me)},ha.prototype._insertBoxCell=function(Y,ye,te,me,Ge,Le){this.boxCells[Ge].push(Le)},ha.prototype._insertCircleCell=function(Y,ye,te,me,Ge,Le){this.circleCells[Ge].push(Le)},ha.prototype._query=function(Y,ye,te,me,Ge,Le){if(te<0||Y>this.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;mt<this.boxKeys.length;mt++)$e.push({key:this.boxKeys[mt],x1:this.bboxes[mt*4],y1:this.bboxes[mt*4+1],x2:this.bboxes[mt*4+2],y2:this.bboxes[mt*4+3]});for(var jt=0;jt<this.circleKeys.length;jt++){var _r=this.circles[jt*3],Fr=this.circles[jt*3+1],hr=this.circles[jt*3+2];$e.push({key:this.circleKeys[jt],x1:_r-hr,y1:Fr-hr,x2:_r+hr,y2:Fr+hr})}return Le?$e.filter(Le):$e}else{var gt={hitTest:Ge,seenUids:{box:{},circle:{}}};return this._forEachCell(Y,ye,te,me,this._queryCell,$e,gt,Le),Ge?$e.length>0:$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<gt.length;hr+=1){var Et=gt[hr];if(!jt.box[Et]){jt.box[Et]=!0;var Ft=Et*4;if(Y<=Fr[Ft+2]&&ye<=Fr[Ft+3]&&te>=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<pr.length;sr+=1){var lr=pr[sr];if(!jt.circle[lr]){jt.circle[lr]=!0;var Xt=lr*3;if(this._circleAndRectCollide(fr[Xt],fr[Xt+1],fr[Xt+2],Y,ye,te,me)&&(!mt||mt(this.circleKeys[lr]))){if($e.hitTest)return Le.push(!0),!0;var or=fr[Xt],Vt=fr[Xt+1],Dr=fr[Xt+2];Le.push({key:this.circleKeys[lr],x1:or-Dr,y1:Vt-Dr,x2:or+Dr,y2:Vt+Dr})}}}},ha.prototype._queryCellCircle=function(Y,ye,te,me,Ge,Le,$e,mt){var jt=$e.circle,_r=$e.seenUids,Fr=this.boxCells[Ge];if(Fr!==null)for(var hr=this.bboxes,gt=0,Et=Fr;gt<Et.length;gt+=1){var Ft=Et[gt];if(!_r.box[Ft]){_r.box[Ft]=!0;var nr=Ft*4;if(this._circleAndRectCollide(jt.x,jt.y,jt.radius,hr[nr+0],hr[nr+1],hr[nr+2],hr[nr+3])&&(!mt||mt(this.boxKeys[Ft])))return Le.push(!0),!0}}var fr=this.circleCells[Ge];if(fr!==null)for(var sr=this.circles,pr=0,lr=fr;pr<lr.length;pr+=1){var Xt=lr[pr];if(!_r.circle[Xt]){_r.circle[Xt]=!0;var or=Xt*3;if(this._circlesCollide(sr[or],sr[or+1],sr[or+2],jt.x,jt.y,jt.radius)&&(!mt||mt(this.circleKeys[Xt])))return Le.push(!0),!0}}},ha.prototype._forEachCell=function(Y,ye,te,me,Ge,Le,$e,mt){for(var jt=this._convertToXCellCoord(Y),_r=this._convertToYCellCoord(ye),Fr=this._convertToXCellCoord(te),hr=this._convertToYCellCoord(me),gt=jt;gt<=Fr;gt++)for(var Et=_r;Et<=hr;Et++){var Ft=this.xCellCount*Et+gt;if(Ge.call(this,Y,ye,te,me,Ft,Le,$e,mt))return}},ha.prototype._convertToXCellCoord=function(Y){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(Y*this.xScale)))},ha.prototype._convertToYCellCoord=function(Y){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(Y*this.yScale)))},ha.prototype._circlesCollide=function(Y,ye,te,me,Ge,Le){var $e=me-Y,mt=Ge-ye,jt=te+Le;return jt*jt>$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;nr<gt.length;nr++){var fr=gt.get(nr);if(fr.hidden||fr.writingMode===e.WritingMode.vertical&&!Ft){Xo(fr.numGlyphs,Fr);continue}Ft=!1;var sr=[fr.anchorX,fr.anchorY,0,1];if(e.transformMat4(sr,sr,Y),!Ai(sr,_r)){Xo(fr.numGlyphs,Fr);continue}var pr=sr[3],lr=fi(ye.transform.cameraToCenterDistance,pr),Xt=e.evaluateSizeForFeature(mt,jt,fr),or=Le?Xt/lr:Xt*lr,Vt=new e.Point(fr.anchorX,fr.anchorY),Dr=Pn(Vt,me).point,Jr={},ba=to(fr,or,!1,$e,Y,me,Ge,ve.glyphOffsetArray,hr,Fr,Dr,Vt,Jr,Et);Ft=ba.useVertical,(ba.notEnoughRoom||Ft||ba.needsFlipping&&to(fr,or,!0,$e,Y,me,Ge,ve.glyphOffsetArray,hr,Fr,Dr,Vt,Jr,Et).notEnoughRoom)&&Xo(fr.numGlyphs,Fr)}te?ve.text.dynamicLayoutVertexBuffer.updateData(Fr):ve.icon.dynamicLayoutVertexBuffer.updateData(Fr)}function zi(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r){var Fr=$e.glyphStartIndex+$e.numGlyphs,hr=$e.lineStartIndex,gt=$e.lineStartIndex+$e.lineLength,Et=Y.getoffsetX($e.glyphStartIndex),Ft=Y.getoffsetX(Fr-1),nr=pi(ve*Et,ye,te,me,Ge,Le,$e.segment,hr,gt,mt,jt,_r);if(!nr)return null;var fr=pi(ve*Ft,ye,te,me,Ge,Le,$e.segment,hr,gt,mt,jt,_r);return fr?{first:nr,last:fr}:null}function Xi(ve,Y,ye,te){if(ve===e.WritingMode.horizontal){var me=Math.abs(ye.y-Y.y),Ge=Math.abs(ye.x-Y.x)*te;if(me>Ge)return{useVertical:!0}}return(ve===e.WritingMode.vertical?Y.y<ye.y:Y.x>ye.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;Jr<sr-1;Jr++)fr.push(pi(Et*$e.getoffsetX(Jr),Ft,nr,ye,_r,Fr,ve.segment,pr,lr,mt,Ge,hr));fr.push(Xt.last)}else{if(te&&!ye){var ba=Pn(Fr,me).point,_n=ve.lineStartIndex+ve.segment+1,Xa=new e.Point(mt.getx(_n),mt.gety(_n)),ln=Pn(Xa,me),$n=ln.signedDistanceFromCamera>0?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;Tn<En.length;Tn+=1){var Gn=En[Tn];e.addDynamicAttributes(jt,Gn.point,Gn.angle)}return{}}function go(ve,Y,ye,te,me){var Ge=Pn(ve.add(ve.sub(Y)._unit()),me).point,Le=ye.sub(Ge);return ye.add(Le._mult(te/Le.mag()))}function pi(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr){var hr=te?ve-Y:ve+Y,gt=hr>0?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<ve;ye++){var te=Y.length;Y.resize(te+4),Y.float32.set(Jo,te*3)}}function Ts(ve,Y,ye){var te=Y[0],me=Y[1];return ve[0]=ye[0]*te+ye[4]*me+ye[12],ve[1]=ye[1]*te+ye[5]*me+ye[13],ve[3]=ye[3]*te+ye[7]*me+ye[15],ve}var Po=100,so=function(Y,ye,te){ye===void 0&&(ye=new ha(Y.width+2*Po,Y.height+2*Po,25)),te===void 0&&(te=new ha(Y.width+2*Po,Y.height+2*Po,25)),this.transform=Y,this.grid=ye,this.ignoredGrid=te,this.pitchfactor=Math.cos(Y._pitch)*Y.cameraToCenterDistance,this.screenRightBoundary=Y.width+Po,this.screenBottomBoundary=Y.height+Po,this.gridRightBoundary=Y.width+2*Po,this.gridBottomBoundary=Y.height+2*Po};so.prototype.placeCollisionBox=function(Y,ye,te,me,Ge){var Le=this.projectAndGetPerspectiveRatio(me,Y.anchorPointX,Y.anchorPointY),$e=te*Le.perspectiveRatio,mt=Y.x1*$e+Le.point.x,jt=Y.y1*$e+Le.point.y,_r=Y.x2*$e+Le.point.x,Fr=Y.y2*$e+Le.point.y;return!this.isInsideGrid(mt,jt,_r,Fr)||!ye&&this.grid.hitTest(mt,jt,_r,Fr,Ge)?{box:[],offscreen:!1}:{box:[mt,jt,_r,Fr],offscreen:this.isOffscreen(mt,jt,_r,Fr)}},so.prototype.placeCollisionCircles=function(Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr,hr,gt){var Et=[],Ft=new e.Point(ye.anchorX,ye.anchorY),nr=Pn(Ft,Le),fr=fi(this.transform.cameraToCenterDistance,nr.signedDistanceFromCamera),sr=_r?Ge/fr:Ge*fr,pr=sr/e.ONE_EM,lr=Pn(Ft,$e).point,Xt={},or=ye.lineOffsetX*pr,Vt=ye.lineOffsetY*pr,Dr=zi(pr,me,or,Vt,!1,lr,Ft,ye,te,$e,Xt),Jr=!1,ba=!1,_n=!0;if(Dr){for(var Xa=hr*.5*fr+gt,ln=new e.Point(-Po,-Po),$n=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),Nn=new Ya,dn=Dr.first,Tn=Dr.last,En=[],Gn=dn.path.length-1;Gn>=1;Gn--)En.push(dn.path[Gn]);for(var ci=1;ci<Tn.path.length;ci++)En.push(Tn.path[ci]);var bo=Xa*2.5;if(mt){var jo=En.map(function(Ep){return Pn(Ep,mt)});jo.some(function(Ep){return Ep.signedDistanceFromCamera<=0})?En=[]:En=jo.map(function(Ep){return Ep.point})}var ks=[];if(En.length>0){for(var Fo=En[0].clone(),bs=En[0].clone(),Hs=1;Hs<En.length;Hs++)Fo.x=Math.min(Fo.x,En[Hs].x),Fo.y=Math.min(Fo.y,En[Hs].y),bs.x=Math.max(bs.x,En[Hs].x),bs.y=Math.max(bs.y,En[Hs].y);Fo.x>=ln.x&&bs.x<=$n.x&&Fo.y>=ln.y&&bs.y<=$n.y?ks=[En]:bs.x<ln.x||Fo.x>$n.x||bs.y<ln.y||Fo.y>$n.y?ks=[]:ks=e.clipLine([En],ln.x,ln.y,$n.x,$n.y)}for(var pu=0,Ap=ks;pu<Ap.length;pu+=1){var Sp=Ap[pu];Nn.reset(Sp,Xa*.25);var Ph=0;Nn.length<=.5*Xa?Ph=1:Ph=Math.ceil(Nn.paddedLength/bo)+1;for(var Vp=0;Vp<Ph;Vp++){var Vd=Vp/Math.max(Ph-1,1),td=Nn.lerp(Vd),Ih=td.x+Po,rd=td.y+Po;Et.push(Ih,rd,Xa,0);var Kh=Ih-Xa,Rh=rd-Xa,Mp=Ih+Xa,qp=rd+Xa;if(_n=_n&&this.isOffscreen(Kh,Rh,Mp,qp),ba=ba||this.isInsideGrid(Kh,Rh,Mp,qp),!Y&&this.grid.hitTestCircle(Ih,rd,Xa,Fr)&&(Jr=!0,!jt))return{circles:[],offscreen:!1,collisionDetected:Jr}}}}return{circles:!jt&&Jr||!ba?[]:Et,offscreen:_n,collisionDetected:Jr}},so.prototype.queryRenderedSymbols=function(Y){if(Y.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var ye=[],te=1/0,me=1/0,Ge=-1/0,Le=-1/0,$e=0,mt=Y;$e<mt.length;$e+=1){var jt=mt[$e],_r=new e.Point(jt.x+Po,jt.y+Po);te=Math.min(te,_r.x),me=Math.min(me,_r.y),Ge=Math.max(Ge,_r.x),Le=Math.max(Le,_r.y),ye.push(_r)}for(var Fr=this.grid.query(te,me,Ge,Le).concat(this.ignoredGrid.query(te,me,Ge,Le)),hr={},gt={},Et=0,Ft=Fr;Et<Ft.length;Et+=1){var nr=Ft[Et],fr=nr.key;if(hr[fr.bucketInstanceId]===void 0&&(hr[fr.bucketInstanceId]={}),!hr[fr.bucketInstanceId][fr.featureIndex]){var sr=[new e.Point(nr.x1,nr.y1),new e.Point(nr.x2,nr.y1),new e.Point(nr.x2,nr.y2),new e.Point(nr.x1,nr.y2)];e.polygonIntersectsPolygon(ye,sr)&&(hr[fr.bucketInstanceId][fr.featureIndex]=!0,gt[fr.bucketInstanceId]===void 0&&(gt[fr.bucketInstanceId]=[]),gt[fr.bucketInstanceId].push(fr.featureIndex))}}return gt},so.prototype.insertCollisionBox=function(Y,ye,te,me,Ge){var Le=ye?this.ignoredGrid:this.grid,$e={bucketInstanceId:te,featureIndex:me,collisionGroupID:Ge};Le.insert($e,Y[0],Y[1],Y[2],Y[3])},so.prototype.insertCollisionCircles=function(Y,ye,te,me,Ge){for(var Le=ye?this.ignoredGrid:this.grid,$e={bucketInstanceId:te,featureIndex:me,collisionGroupID:Ge},mt=0;mt<Y.length;mt+=4)Le.insertCircle($e,Y[mt],Y[mt+1],Y[mt+2])},so.prototype.projectAndGetPerspectiveRatio=function(Y,ye,te){var me=[ye,te,0,1];Ts(me,me,Y);var Ge=new e.Point((me[0]/me[3]+1)/2*this.transform.width+Po,(-me[1]/me[3]+1)/2*this.transform.height+Po);return{point:Ge,perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/me[3])}},so.prototype.isOffscreen=function(Y,ye,te,me){return te<Po||Y>=this.screenRightBoundary||me<Po||ye>this.screenBottomBoundary},so.prototype.isInsideGrid=function(Y,ye,te,me){return te>=0&&Y<this.gridRightBoundary&&me>=0&&ye<this.gridBottomBoundary},so.prototype.getViewportMatrix=function(){var Y=e.identity([]);return e.translate(Y,Y,[-Po,-Po,0]),Y};function qi(ve,Y,ye){return Y*(e.EXTENT/(ve.tileSize*Math.pow(2,ye-ve.tileID.overscaledZ)))}var To=function(Y,ye,te,me){Y?this.opacity=Math.max(0,Math.min(1,Y.opacity+(Y.placed?ye:-ye))):this.opacity=me&&te?1:0,this.placed=te};To.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var Vo=function(Y,ye,te,me,Ge){this.text=new To(Y?Y.text:null,ye,te,Ge),this.icon=new To(Y?Y.icon:null,ye,me,Ge)};Vo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Oo=function(Y,ye,te){this.text=Y,this.icon=ye,this.skipFade=te},lo=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},Co=function(Y,ye,te,me,Ge){this.bucketInstanceId=Y,this.featureIndex=ye,this.sourceLayerIndex=te,this.bucketIndex=me,this.tileID=Ge},os=function(Y){this.crossSourceCollisions=Y,this.maxGroupID=0,this.collisionGroups={}};os.prototype.get=function(Y){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[Y]){var ye=++this.maxGroupID;this.collisionGroups[Y]={ID:ye,predicate:function(te){return te.collisionGroupID===ye}}}return this.collisionGroups[Y]};function Ys(ve,Y,ye,te,me){var Ge=e.getAnchorAlignment(ve),Le=Ge.horizontalAlign,$e=Ge.verticalAlign,mt=-(Le-.5)*Y,jt=-($e-.5)*ye,_r=e.evaluateVariableOffset(ve,te);return new e.Point(mt+_r[0]*me,jt+_r[1]*me)}function Os(ve,Y,ye,te,me,Ge){var Le=ve.x1,$e=ve.x2,mt=ve.y1,jt=ve.y2,_r=ve.anchorPointX,Fr=ve.anchorPointY,hr=new e.Point(Y,ye);return te&&hr._rotate(me?Ge:-Ge),{x1:Le+hr.x,y1:mt+hr.y,x2:$e+hr.x,y2:jt+hr.y,anchorPointX:_r,anchorPointY:Fr}}var Yo=function(Y,ye,te,me){this.transform=Y.clone(),this.collisionIndex=new so(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=ye,this.retainedQueryData={},this.collisionGroups=new os(te),this.collisionCircleArrays={},this.prevPlacement=me,me&&(me.prevPlacement=void 0),this.placedOrientations={}};Yo.prototype.getBucketParts=function(Y,ye,te,me){var Ge=te.getBucket(ye),Le=te.latestFeatureIndex;if(!(!Ge||!Le||ye.id!==Ge.layerIds[0])){var $e=te.collisionBoxArray,mt=Ge.layers[0].layout,jt=Math.pow(2,this.transform.zoom-te.tileID.overscaledZ),_r=te.tileSize/e.EXTENT,Fr=this.transform.calculatePosMatrix(te.tileID.toUnwrapped()),hr=mt.get("text-pitch-alignment")==="map",gt=mt.get("text-rotation-alignment")==="map",Et=qi(te,1,this.transform.zoom),Ft=Da(Fr,hr,gt,this.transform,Et),nr=null;if(hr){var fr=Zn(Fr,hr,gt,this.transform,Et);nr=e.multiply([],this.transform.labelPlaneMatrix,fr)}this.retainedQueryData[Ge.bucketInstanceId]=new Co(Ge.bucketInstanceId,Le,Ge.sourceLayerIndex,Ge.index,te.tileID);var sr={bucket:Ge,layout:mt,posMatrix:Fr,textLabelPlaneMatrix:Ft,labelToScreenMatrix:nr,scale:jt,textPixelRatio:_r,holdingForFade:te.holdingForFade(),collisionBoxArray:$e,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(Ge.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ge.sourceID)};if(me)for(var pr=0,lr=Ge.sortKeyRanges;pr<lr.length;pr+=1){var Xt=lr[pr],or=Xt.sortKey,Vt=Xt.symbolInstanceStart,Dr=Xt.symbolInstanceEnd;Y.push({sortKey:or,symbolInstanceStart:Vt,symbolInstanceEnd:Dr,parameters:sr})}else Y.push({symbolInstanceStart:0,symbolInstanceEnd:Ge.symbolInstances.length,parameters:sr})}},Yo.prototype.attemptAnchorPlacement=function(Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr,hr,gt,Et,Ft){var nr=[hr.textOffset0,hr.textOffset1],fr=Ys(Y,te,me,nr,Ge),sr=this.collisionIndex.placeCollisionBox(Os(ye,fr.x,fr.y,Le,$e,this.transform.angle),Fr,mt,jt,_r.predicate);if(Ft){var pr=this.collisionIndex.placeCollisionBox(Os(Ft,fr.x,fr.y,Le,$e,this.transform.angle),Fr,mt,jt,_r.predicate);if(pr.box.length===0)return}if(sr.box.length>0){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;Dh<Iv.length;Dh+=1){var om=Iv[Dh];if(om===e.WritingMode.vertical?(jo=lu(),ks=jo):jo=cc(),jo&&jo.box&&jo.box.length)break}else jo=cc()};if($e.get("text-variable-anchor")){var Kh=$e.get("text-variable-anchor");if(me.prevPlacement&&me.prevPlacement.variableOffsets[dn.crossTileID]){var Rh=me.prevPlacement.variableOffsets[dn.crossTileID];Kh.indexOf(Rh.anchor)>0&&(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<bs.circles.length;ov+=4)iv.circles.push(bs.circles[ov+0]),iv.circles.push(bs.circles[ov+1]),iv.circles.push(bs.circles[ov+2]),iv.circles.push(bs.collisionDetected?1:0)}me.placements[dn.crossTileID]=new Oo(En||Dr,Gn||Jr,ci||Le.justReloaded),ye[dn.crossTileID]=!0}};if(Vt)for(var _n=Le.getSortedSymbolIndexes(this.transform.angle),Xa=_n.length-1;Xa>=0;--Xa){var ln=_n[Xa];ba(Le.symbolInstances.get(ln),Le.collisionArrays[ln])}else for(var $n=Y.symbolInstanceStart;$n<Y.symbolInstanceEnd;$n++)ba(Le.symbolInstances.get($n),Le.collisionArrays[$n]);if(te&&Le.bucketInstanceId in this.collisionCircleArrays){var Nn=this.collisionCircleArrays[Le.bucketInstanceId];e.invert(Nn.invProjMatrix,mt),Nn.viewportMatrix=this.collisionIndex.getViewportMatrix()}Le.justReloaded=!1},Yo.prototype.markUsedJustification=function(Y,ye,te,me){var Ge={left:te.leftJustifiedTextSymbolIndex,center:te.centerJustifiedTextSymbolIndex,right:te.rightJustifiedTextSymbolIndex},Le;me===e.WritingMode.vertical?Le=te.verticalPlacedTextSymbolIndex:Le=Ge[e.getAnchorJustification(ye)];for(var $e=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex,te.verticalPlacedTextSymbolIndex],mt=0,jt=$e;mt<jt.length;mt+=1){var _r=jt[mt];_r>=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;$e<mt.length;$e+=1){var jt=mt[$e];Y.text.placedSymbolArray.get(jt).placedOrientation=me}te.verticalPlacedTextSymbolIndex&&(Y.text.placedSymbolArray.get(te.verticalPlacedTextSymbolIndex).placedOrientation=Ge)},Yo.prototype.commit=function(Y){this.commitTime=Y,this.zoomAtLastRecencyCheck=this.transform.zoom;var ye=this.prevPlacement,te=!1;this.prevZoomAdjustment=ye?ye.zoomAdjustment(this.transform.zoom):0;var me=ye?ye.symbolFadeChange(Y):1,Ge=ye?ye.opacities:{},Le=ye?ye.variableOffsets:{},$e=ye?ye.placedOrientations:{};for(var mt in this.placements){var jt=this.placements[mt],_r=Ge[mt];_r?(this.opacities[mt]=new Vo(_r,me,jt.text,jt.icon),te=te||jt.text!==_r.text.placed||jt.icon!==_r.icon.placed):(this.opacities[mt]=new Vo(null,me,jt.text,jt.icon,jt.skipFade),te=te||jt.text||jt.icon)}for(var Fr in Ge){var hr=Ge[Fr];if(!this.opacities[Fr]){var gt=new Vo(hr,me,!1,!1);gt.isHidden()||(this.opacities[Fr]=gt,te=te||hr.text.placed||hr.icon.placed)}}for(var Et in Le)!this.variableOffsets[Et]&&this.opacities[Et]&&!this.opacities[Et].isHidden()&&(this.variableOffsets[Et]=Le[Et]);for(var Ft in $e)!this.placedOrientations[Ft]&&this.opacities[Ft]&&!this.opacities[Ft].isHidden()&&(this.placedOrientations[Ft]=$e[Ft]);te?this.lastPlacementChangeTime=Y:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ye?ye.lastPlacementChangeTime:Y)},Yo.prototype.updateLayerOpacities=function(Y,ye){for(var te={},me=0,Ge=ye;me<Ge.length;me+=1){var Le=Ge[me],$e=Le.getBucket(Y);$e&&Le.latestFeatureIndex&&Y.id===$e.layerIds[0]&&this.updateBucketOpacities($e,te,Le.collisionBoxArray)}},Yo.prototype.updateBucketOpacities=function(Y,ye,te){var me=this;Y.hasTextData()&&Y.text.opacityVertexArray.clear(),Y.hasIconData()&&Y.icon.opacityVertexArray.clear(),Y.hasIconCollisionBoxData()&&Y.iconCollisionBox.collisionVertexArray.clear(),Y.hasTextCollisionBoxData()&&Y.textCollisionBox.collisionVertexArray.clear();var Ge=Y.layers[0].layout,Le=new Vo(null,0,!1,!1,!0),$e=Ge.get("text-allow-overlap"),mt=Ge.get("icon-allow-overlap"),jt=Ge.get("text-variable-anchor"),_r=Ge.get("text-rotation-alignment")==="map",Fr=Ge.get("text-pitch-alignment")==="map",hr=Ge.get("icon-text-fit")!=="none",gt=new Vo(null,0,$e&&(mt||!Y.hasIconData()||Ge.get("icon-optional")),mt&&($e||!Y.hasTextData()||Ge.get("text-optional")),!0);!Y.collisionArrays&&te&&(Y.hasIconCollisionBoxData()||Y.hasTextCollisionBoxData())&&Y.deserializeCollisionBoxes(te);for(var Et=function(sr,pr,lr){for(var Xt=0;Xt<pr/4;Xt++)sr.opacityVertexArray.emplaceBack(lr)},Ft=function(sr){var pr=Y.symbolInstances.get(sr),lr=pr.numHorizontalGlyphVertices,Xt=pr.numVerticalGlyphVertices,or=pr.crossTileID,Vt=ye[or],Dr=me.opacities[or];Vt?Dr=Le:Dr||(Dr=gt,me.opacities[or]=Dr),ye[or]=!0;var Jr=lr>0||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;nr<Y.symbolInstances.length;nr++)Ft(nr);if(Y.sortFeatures(this.transform.angle),this.retainedQueryData[Y.bucketInstanceId]&&(this.retainedQueryData[Y.bucketInstanceId].featureSortOrder=Y.featureSortOrder),Y.hasTextData()&&Y.text.opacityVertexBuffer&&Y.text.opacityVertexBuffer.updateData(Y.text.opacityVertexArray),Y.hasIconData()&&Y.icon.opacityVertexBuffer&&Y.icon.opacityVertexBuffer.updateData(Y.icon.opacityVertexArray),Y.hasIconCollisionBoxData()&&Y.iconCollisionBox.collisionVertexBuffer&&Y.iconCollisionBox.collisionVertexBuffer.updateData(Y.iconCollisionBox.collisionVertexArray),Y.hasTextCollisionBoxData()&&Y.textCollisionBox.collisionVertexBuffer&&Y.textCollisionBox.collisionVertexBuffer.updateData(Y.textCollisionBox.collisionVertexArray),Y.bucketInstanceId in this.collisionCircleArrays){var fr=this.collisionCircleArrays[Y.bucketInstanceId];Y.placementInvProjMatrix=fr.invProjMatrix,Y.placementViewportMatrix=fr.viewportMatrix,Y.collisionCircleArray=fr.circles,delete this.collisionCircleArrays[Y.bucketInstanceId]}},Yo.prototype.symbolFadeChange=function(Y){return this.fadeDuration===0?1:(Y-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Yo.prototype.zoomAdjustment=function(Y){return Math.max(0,(this.transform.zoom-Y)/1.5)},Yo.prototype.hasTransitions=function(Y){return this.stale||Y-this.lastPlacementChangeTime<this.fadeDuration},Yo.prototype.stillRecent=function(Y,ye){var te=this.zoomAtLastRecencyCheck===ye?1-this.zoomAdjustment(ye):1;return this.zoomAtLastRecencyCheck=ye,this.commitTime+this.fadeDuration*te>Y},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._currentTileIndex<Y.length;){var $e=Y[this._currentTileIndex];if(ye.getBucketParts(Le,me,$e,this._sortAcrossTiles),this._currentTileIndex++,Ge())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,Le.sort(function(jt,_r){return jt.sortKey-_r.sortKey}));this._currentPartIndex<Le.length;){var mt=Le[this._currentPartIndex];if(ye.placeLayerBucketPart(mt,this._seenCrossTileIDs,te),this._currentPartIndex++,Ge())return!0}return!1};var ro=function(Y,ye,te,me,Ge,Le,$e){this.placement=new Yo(Y,Ge,Le,$e),this._currentPlacementIndex=ye.length-1,this._forceFullPlacement=te,this._showCollisionBoxes=me,this._done=!1};ro.prototype.isDone=function(){return this._done},ro.prototype.continuePlacement=function(Y,ye,te){for(var me=this,Ge=e.browser.now(),Le=function(){var Fr=e.browser.now()-Ge;return me._forceFullPlacement?!1:Fr>2};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;me<ye.length;me++){var Ge=ye.get(me),Le=Ge.key;this.indexedSymbolInstances[Le]||(this.indexedSymbolInstances[Le]=[]),this.indexedSymbolInstances[Le].push({crossTileID:Ge.crossTileID,coord:this.getScaledCoordinates(Ge,Y)})}};al.prototype.getScaledCoordinates=function(Y,ye){var te=ye.canonical.z-this.tileID.canonical.z,me=As/Math.pow(2,te);return{x:Math.floor((ye.canonical.x*e.EXTENT+Y.anchorX)*me),y:Math.floor((ye.canonical.y*e.EXTENT+Y.anchorY)*me)}},al.prototype.findMatches=function(Y,ye,te){for(var me=this.tileID.canonical.z<ye.canonical.z?1:Math.pow(2,this.tileID.canonical.z-ye.canonical.z),Ge=0;Ge<Y.length;Ge++){var Le=Y.get(Ge);if(!Le.crossTileID){var $e=this.indexedSymbolInstances[Le.key];if($e)for(var mt=this.getScaledCoordinates(Le,ye),jt=0,_r=$e;jt<_r.length;jt+=1){var Fr=_r[jt];if(Math.abs(Fr.coord.x-mt.x)<=me&&Math.abs(Fr.coord.y-mt.y)<=me&&!te[Fr.crossTileID]){te[Fr.crossTileID]=!0,Le.crossTileID=Fr.crossTileID;break}}}}};var $i=function(){this.maxCrossTileID=0};$i.prototype.generate=function(){return++this.maxCrossTileID};var zs=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};zs.prototype.handleWrapJump=function(Y){var ye=Math.round((Y-this.lng)/360);if(ye!==0)for(var te in this.indexes){var me=this.indexes[te],Ge={};for(var Le in me){var $e=me[Le];$e.tileID=$e.tileID.unwrapTo($e.tileID.wrap+ye),Ge[$e.tileID.key]=$e}this.indexes[te]=Ge}this.lng=Y},zs.prototype.addBucket=function(Y,ye,te){if(this.indexes[Y.overscaledZ]&&this.indexes[Y.overscaledZ][Y.key]){if(this.indexes[Y.overscaledZ][Y.key].bucketInstanceId===ye.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(Y.overscaledZ,this.indexes[Y.overscaledZ][Y.key])}for(var me=0;me<ye.symbolInstances.length;me++){var Ge=ye.symbolInstances.get(me);Ge.crossTileID=0}this.usedCrossTileIDs[Y.overscaledZ]||(this.usedCrossTileIDs[Y.overscaledZ]={});var Le=this.usedCrossTileIDs[Y.overscaledZ];for(var $e in this.indexes){var mt=this.indexes[$e];if(Number($e)>Y.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;gt<ye.symbolInstances.length;gt++){var Et=ye.symbolInstances.get(gt);Et.crossTileID||(Et.crossTileID=te.generate(),Le[Et.crossTileID]=!0)}return this.indexes[Y.overscaledZ]===void 0&&(this.indexes[Y.overscaledZ]={}),this.indexes[Y.overscaledZ][Y.key]=new al(Y,ye.symbolInstances,ye.bucketInstanceId),!0},zs.prototype.removeBucketCrossTileIDs=function(Y,ye){for(var te in ye.indexedSymbolInstances)for(var me=0,Ge=ye.indexedSymbolInstances[te];me<Ge.length;me+=1){var Le=Ge[me];delete this.usedCrossTileIDs[Y][Le.crossTileID]}},zs.prototype.removeStaleBuckets=function(Y){var ye=!1;for(var te in this.indexes){var me=this.indexes[te];for(var Ge in me)Y[me[Ge].bucketInstanceId]||(this.removeBucketCrossTileIDs(te,me[Ge]),delete me[Ge],ye=!0)}return ye};var au=function(){this.layerIndexes={},this.crossTileIDs=new $i,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};au.prototype.addLayer=function(Y,ye,te){var me=this.layerIndexes[Y.id];me===void 0&&(me=this.layerIndexes[Y.id]=new zs);var Ge=!1,Le={};me.handleWrapJump(te);for(var $e=0,mt=ye;$e<mt.length;$e+=1){var jt=mt[$e],_r=jt.getBucket(Y);!_r||Y.id!==_r.layerIds[0]||(_r.bucketInstanceId||(_r.bucketInstanceId=++this.maxBucketInstanceId),me.addBucket(jt.tileID,_r,this.crossTileIDs)&&(Ge=!0),Le[_r.bucketInstanceId]=!0)}return me.removeStaleBuckets(Le)&&(Ge=!0),Ge},au.prototype.pruneUnusedLayers=function(Y){var ye={};Y.forEach(function(me){ye[me]=!0});for(var te in this.layerIndexes)ye[te]||delete this.layerIndexes[te]};var fl=function(ve,Y){return e.emitValidationErrors(ve,Y&&Y.filter(function(ye){return ye.identifier!=="source.canvas"}))},xu=e.pick(Kr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),zl=e.pick(Kr,["setCenter","setZoom","setBearing","setPitch"]),Ns=Gr(),nu=function(ve){function Y(ye,te){var me=this;te===void 0&&(te={}),ve.call(this),this.map=ye,this.dispatcher=new B(ct(),this),this.imageManager=new _,this.imageManager.setEventedParent(this),this.glyphManager=new y(ye._requestManager,te.localIdeographFontFamily),this.lineAtlas=new F(256,512),this.crossTileSymbolIndex=new au,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());var Ge=this;this._rtlTextPluginCallback=Y.registerForPluginStateChange(function(Le){var $e={pluginStatus:Le.pluginStatus,pluginURL:Le.pluginURL};Ge.dispatcher.broadcast("syncRTLPluginState",$e,function(mt,jt){if(e.triggerPluginCompletionEvent(mt),jt){var _r=jt.every(function(hr){return hr});if(_r)for(var Fr in Ge.sourceCaches)Ge.sourceCaches[Fr].reload()}})}),this.on("data",function(Le){if(!(Le.dataType!=="source"||Le.sourceDataType!=="metadata")){var $e=me.sourceCaches[Le.sourceId];if($e){var mt=$e.getSource();if(!(!mt||!mt.vectorLayerIds))for(var jt in me._layers){var _r=me._layers[jt];_r.source===mt.id&&me._validateLayer(_r)}}}})}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.loadURL=function(te,me){var Ge=this;me===void 0&&(me={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var Le=typeof me.validate=="boolean"?me.validate:!e.isMapboxURL(te);te=this.map._requestManager.normalizeStyleURL(te,me.accessToken);var $e=this.map._requestManager.transformRequest(te,e.ResourceType.Style);this._request=e.getJSON($e,function(mt,jt){Ge._request=null,mt?Ge.fire(new e.ErrorEvent(mt)):jt&&Ge._load(jt,Le)})},Y.prototype.loadJSON=function(te,me){var Ge=this;me===void 0&&(me={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame(function(){Ge._request=null,Ge._load(te,me.validate!==!1)})},Y.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Ns,!1)},Y.prototype._load=function(te,me){if(!(me&&fl(this,e.validateStyle(te)))){this._loaded=!0,this.stylesheet=te;for(var Ge in te.sources)this.addSource(Ge,te.sources[Ge],{validate:!1});te.sprite?this._loadSprite(te.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(te.glyphs);var Le=Lr(this.stylesheet.layers);this._order=Le.map(function(_r){return _r.id}),this._layers={},this._serializedLayers={};for(var $e=0,mt=Le;$e<mt.length;$e+=1){var jt=mt[$e];jt=e.createStyleLayer(jt),jt.setEventedParent(this,{layer:{id:jt.id}}),this._layers[jt.id]=jt,this._serializedLayers[jt.id]=jt.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new z(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},Y.prototype._loadSprite=function(te){var me=this;this._spriteRequest=d(te,this.map._requestManager,function(Ge,Le){if(me._spriteRequest=null,Ge)me.fire(new e.ErrorEvent(Ge));else if(Le)for(var $e in Le)me.imageManager.addImage($e,Le[$e]);me.imageManager.setLoaded(!0),me._availableImages=me.imageManager.listImages(),me.dispatcher.broadcast("setImages",me._availableImages),me.fire(new e.Event("data",{dataType:"style"}))})},Y.prototype._validateLayer=function(te){var me=this.sourceCaches[te.source];if(me){var Ge=te.sourceLayer;if(Ge){var Le=me.getSource();(Le.type==="geojson"||Le.vectorLayerIds&&Le.vectorLayerIds.indexOf(Ge)===-1)&&this.fire(new e.ErrorEvent(new Error('Source layer "'+Ge+'" does not exist on source "'+Le.id+'" as specified by style layer "'+te.id+'"')))}}},Y.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var te in this.sourceCaches)if(!this.sourceCaches[te].loaded())return!1;return!!this.imageManager.isLoaded()},Y.prototype._serializeLayers=function(te){for(var me=[],Ge=0,Le=te;Ge<Le.length;Ge+=1){var $e=Le[Ge],mt=this._layers[$e];mt.type!=="custom"&&me.push(mt.serialize())}return me},Y.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var te in this.sourceCaches)if(this.sourceCaches[te].hasTransition())return!0;for(var me in this._layers)if(this._layers[me].hasTransition())return!0;return!1},Y.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},Y.prototype.update=function(te){if(this._loaded){var me=this._changed;if(this._changed){var Ge=Object.keys(this._updatedLayers),Le=Object.keys(this._removedLayers);(Ge.length||Le.length)&&this._updateWorkerLayers(Ge,Le);for(var $e in this._updatedSources){var mt=this._updatedSources[$e];mt==="reload"?this._reloadSource($e):mt==="clear"&&this._clearSource($e)}this._updateTilesForChangedImages();for(var jt in this._updatedPaintProps)this._layers[jt].updateTransitions(te);this.light.updateTransitions(te),this._resetUpdates()}var _r={};for(var Fr in this.sourceCaches){var hr=this.sourceCaches[Fr];_r[Fr]=hr.used,hr.used=!1}for(var gt=0,Et=this._order;gt<Et.length;gt+=1){var Ft=Et[gt],nr=this._layers[Ft];nr.recalculate(te,this._availableImages),!nr.isHidden(te.zoom)&&nr.source&&(this.sourceCaches[nr.source].used=!0)}for(var fr in _r){var sr=this.sourceCaches[fr];_r[fr]!==sr.used&&sr.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:fr}))}this.light.recalculate(te),this.z=te.zoom,me&&this.fire(new e.Event("data",{dataType:"style"}))}},Y.prototype._updateTilesForChangedImages=function(){var te=Object.keys(this._changedImages);if(te.length){for(var me in this.sourceCaches)this.sourceCaches[me].reloadTilesForDependencies(["icons","patterns"],te);this._changedImages={}}},Y.prototype._updateWorkerLayers=function(te,me){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(te),removedIds:me})},Y.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},Y.prototype.setState=function(te){var me=this;if(this._checkLoaded(),fl(this,e.validateStyle(te)))return!1;te=e.clone$1(te),te.layers=Lr(te.layers);var Ge=Fa(this.serialize(),te).filter(function($e){return!($e.command in zl)});if(Ge.length===0)return!1;var Le=Ge.filter(function($e){return!($e.command in xu)});if(Le.length>0)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<Fr.length;_r+=1){var hr=Fr[_r],gt=hr[jt];if(gt)for(var Et=0,Ft=gt;Et<Ft.length;Et+=1){var nr=Ft[Et];$e.push(nr)}}}}$e.sort(function(ln,$n){return $n.intersectionZ-ln.intersectionZ});for(var fr=[],sr=this._order.length-1;sr>=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]<sr)break;fr.push(Xt),$e.pop()}else for(var or=0,Vt=te;or<Vt.length;or+=1){var Dr=Vt[or],Jr=Dr[pr];if(Jr)for(var ba=0,_n=Jr;ba<_n.length;ba+=1){var Xa=_n[ba];fr.push(Xa.feature)}}}return fr},Y.prototype.queryRenderedFeatures=function(te,me,Ge){me&&me.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",me.filter,null,me);var Le={};if(me&&me.layers){if(!Array.isArray(me.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var $e=0,mt=me.layers;$e<mt.length;$e+=1){var jt=mt[$e],_r=this._layers[jt];if(!_r)return this.fire(new e.ErrorEvent(new Error("The layer '"+jt+"' does not exist in the map's style and cannot be queried for features."))),[];Le[_r.source]=!0}}var Fr=[];me.availableImages=this._availableImages;for(var hr in this.sourceCaches)me.layers&&!Le[hr]||Fr.push(re(this.sourceCaches[hr],this._layers,this._serializedLayers,te,me,Ge));return this.placement&&Fr.push(ce(this._layers,this._serializedLayers,this.sourceCaches,te,me,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Fr)},Y.prototype.querySourceFeatures=function(te,me){me&&me.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",me.filter,null,me);var Ge=this.sourceCaches[te];return Ge?be(Ge,me):[]},Y.prototype.addSourceType=function(te,me,Ge){if(Y.getSourceType(te))return Ge(new Error('A source type called "'+te+'" already exists.'));if(Y.setSourceType(te,me),!me.workerSourceURL)return Ge(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:te,url:me.workerSourceURL},Ge)},Y.prototype.getLight=function(){return this.light.getLight()},Y.prototype.setLight=function(te,me){me===void 0&&(me={}),this._checkLoaded();var Ge=this.light.getLight(),Le=!1;for(var $e in te)if(!e.deepEqual(te[$e],Ge[$e])){Le=!0;break}if(Le){var mt={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(te,me),this.light.updateTransitions(mt)}},Y.prototype._validate=function(te,me,Ge,Le,$e){return $e===void 0&&($e={}),$e&&$e.validate===!1?!1:fl(this,te.call(e.validateStyle,e.extend({key:me,style:this.serialize(),value:Ge,styleSpec:e.styleSpec},Le)))},Y.prototype._remove=function(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(var te in this._layers){var me=this._layers[te];me.setEventedParent(null)}for(var Ge in this.sourceCaches)this.sourceCaches[Ge].clearTiles(),this.sourceCaches[Ge].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},Y.prototype._clearSource=function(te){this.sourceCaches[te].clearTiles()},Y.prototype._reloadSource=function(te){this.sourceCaches[te].resume(),this.sourceCaches[te].reload()},Y.prototype._updateSources=function(te){for(var me in this.sourceCaches)this.sourceCaches[me].update(te)},Y.prototype._generateCollisionBoxes=function(){for(var te in this.sourceCaches)this._reloadSource(te)},Y.prototype._updatePlacement=function(te,me,Ge,Le,$e){$e===void 0&&($e=!1);for(var mt=!1,jt=!1,_r={},Fr=0,hr=this._order;Fr<hr.length;Fr+=1){var gt=hr[Fr],Et=this._layers[gt];if(Et.type==="symbol"){if(!_r[Et.source]){var Ft=this.sourceCaches[Et.source];_r[Et.source]=Ft.getRenderableIds(!0).map(function(or){return Ft.getTileByID(or)}).sort(function(or,Vt){return Vt.tileID.overscaledZ-or.tileID.overscaledZ||(or.tileID.isLessThan(Vt.tileID)?-1:1)})}var nr=this.crossTileSymbolIndex.addLayer(Et,_r[Et.source],te.center.lng);mt=mt||nr}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),$e=$e||this._layerOrderChanged||Ge===0,($e||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),te.zoom))&&(this.pauseablePlacement=new ro(te,this._order,$e,me,Ge,Le,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,_r),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),jt=!0),mt&&this.pauseablePlacement.placement.setStale()),jt||mt)for(var fr=0,sr=this._order;fr<sr.length;fr+=1){var pr=sr[fr],lr=this._layers[pr];lr.type==="symbol"&&this.placement.updateLayerOpacities(lr,_r[lr.source])}var Xt=!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now());return Xt},Y.prototype._releaseSymbolFadeTiles=function(){for(var te in this.sourceCaches)this.sourceCaches[te].releaseSymbolFadeTiles()},Y.prototype.getImages=function(te,me,Ge){this.imageManager.getImages(me.icons,Ge),this._updateTilesForChangedImages();var Le=this.sourceCaches[me.source];Le&&Le.setDependencies(me.tileID.key,me.type,me.icons)},Y.prototype.getGlyphs=function(te,me,Ge){this.glyphManager.getGlyphs(me.stacks,Ge)},Y.prototype.getResource=function(te,me,Ge){return e.makeRequest(me,Ge)},Y}(e.Evented);nu.getSourceType=oe,nu.setSourceType=ne,nu.registerForPluginStateChange=e.registerForPluginStateChange;var Eu=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Bc=`#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`,Cu=`#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;}`,Af=`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
|
||
}`,pf="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Us=`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
|
||
}`,qc="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);}",Sf=`varying vec3 v_data;
|
||
#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);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,iu=`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;
|
||
#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);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,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`,Ll="void main() {gl_FragColor=vec4(1.0);}",nc="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}",Ou=`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
|
||
}`,nl=`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,0,1);gl_Position=u_matrix*pos;}`,vl=`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
|
||
}`,gs="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;}",qs="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;}}",ic="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}",Nl="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;}",Vu="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);}",cl="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);}",yh="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,0,1);}",ls=`#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
|
||
}`,_h=`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);}`,Ss=`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
|
||
}`,Qi=`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;}`,Gc=`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
|
||
}`,qu=`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;}`,Ul=`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
|
||
}`,Mf=`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);}`,wc=`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
||
#ifdef OVERDRAW_INSPECTOR
|
||
gl_FragColor=vec4(1.0);
|
||
#endif
|
||
}`,rf=`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;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;base=max(0.0,base);height=max(0.0,height);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;}`,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<me.length;_r++)this.boundPaintVertexBuffers[_r]!==me[_r]&&(jt=!0);var Fr=!this.vao||this.boundProgram!==ye||this.boundLayoutVertexBuffer!==te||jt||this.boundIndexBuffer!==Ge||this.boundVertexOffset!==Le||this.boundDynamicVertexBuffer!==$e||this.boundDynamicVertexBuffer2!==mt;!Y.extVertexArrayObject||Fr?this.freshBind(ye,te,me,Ge,Le,$e,mt):(Y.bindVertexArrayOES.set(this.vao),$e&&$e.bind(),Ge&&Ge.dynamicDraw&&Ge.bind(),mt&&mt.bind())},Mc.prototype.freshBind=function(Y,ye,te,me,Ge,Le,$e){var mt,jt=Y.numAttributes,_r=this.context,Fr=_r.gl;if(_r.extVertexArrayObject)this.vao&&this.destroy(),this.vao=_r.extVertexArrayObject.createVertexArrayOES(),_r.bindVertexArrayOES.set(this.vao),mt=0,this.boundProgram=Y,this.boundLayoutVertexBuffer=ye,this.boundPaintVertexBuffers=te,this.boundIndexBuffer=me,this.boundVertexOffset=Ge,this.boundDynamicVertexBuffer=Le,this.boundDynamicVertexBuffer2=$e;else{mt=_r.currentNumAttributes||0;for(var hr=jt;hr<mt;hr++)Fr.disableVertexAttribArray(hr)}ye.enableAttributes(Fr,Y);for(var gt=0,Et=te;gt<Et.length;gt+=1){var Ft=Et[gt];Ft.enableAttributes(Fr,Y)}Le&&Le.enableAttributes(Fr,Y),$e&&$e.enableAttributes(Fr,Y),ye.bind(),ye.setVertexAttribPointers(Fr,Y,Ge);for(var nr=0,fr=te;nr<fr.length;nr+=1){var sr=fr[nr];sr.bind(),sr.setVertexAttribPointers(Fr,Y,Ge)}Le&&(Le.bind(),Le.setVertexAttribPointers(Fr,Y,Ge)),me&&me.bind(),$e&&($e.bind(),$e.setVertexAttribPointers(Fr,Y,Ge)),_r.currentNumAttributes=jt},Mc.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};function Hu(ve){for(var Y=[],ye=0;ye<ve.length;ye++)if(ve[ye]!==null){var te=ve[ye].split(" ");Y.push(te.pop())}return Y}var mf=function(Y,ye,te,me,Ge,Le){var $e=Y.gl;this.program=$e.createProgram();for(var mt=Hu(te.staticAttributes),jt=me?me.getBinderAttributes():[],_r=mt.concat(jt),Fr=te.staticUniforms?Hu(te.staticUniforms):[],hr=me?me.getBinderUniforms():[],gt=Fr.concat(hr),Et=[],Ft=0,nr=gt;Ft<nr.length;Ft+=1){var fr=nr[Ft];Et.indexOf(fr)<0&&Et.push(fr)}var sr=me?me.defines():[];Le&&sr.push("#define OVERDRAW_INSPECTOR;");var pr=sr.concat(ml.fragmentSource,te.fragmentSource).join(`
|
||
`),lr=sr.concat(ml.vertexSource,te.vertexSource).join(`
|
||
`),Xt=$e.createShader($e.FRAGMENT_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(Xt,pr),$e.compileShader(Xt),$e.attachShader(this.program,Xt);var or=$e.createShader($e.VERTEX_SHADER);if($e.isContextLost()){this.failedToCreate=!0;return}$e.shaderSource(or,lr),$e.compileShader(or),$e.attachShader(this.program,or),this.attributes={};var Vt={};this.numAttributes=_r.length;for(var Dr=0;Dr<this.numAttributes;Dr++)_r[Dr]&&($e.bindAttribLocation(this.program,Dr,_r[Dr]),this.attributes[_r[Dr]]=Dr);$e.linkProgram(this.program),$e.deleteShader(or),$e.deleteShader(Xt);for(var Jr=0;Jr<Et.length;Jr++){var ba=Et[Jr];if(ba&&!Vt[ba]){var _n=$e.getUniformLocation(this.program,ba);_n&&(Vt[ba]=_n)}}this.fixedUniforms=Ge(Y,Vt),this.binderUniforms=me?me.getUniforms(Y,Vt):[]};mf.prototype.draw=function(Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr,hr,gt,Et,Ft,nr){var fr,sr=Y.gl;if(!this.failedToCreate){Y.program.set(this.program),Y.setDepthMode(te),Y.setStencilMode(me),Y.setColorMode(Ge),Y.setCullFace(Le);for(var pr in this.fixedUniforms)this.fixedUniforms[pr].set($e[pr]);Et&&Et.setUniforms(Y,this.binderUniforms,hr,{zoom:gt});for(var lr=(fr={},fr[sr.LINES]=2,fr[sr.TRIANGLES]=3,fr[sr.LINE_STRIP]=1,fr)[ye],Xt=0,or=Fr.get();Xt<or.length;Xt+=1){var Vt=or[Xt],Dr=Vt.vaos||(Vt.vaos={}),Jr=Dr[mt]||(Dr[mt]=new Mc);Jr.bind(Y,this,jt,Et?Et.getPaintVertexBuffers():[],_r,Vt.vertexOffset,Ft,nr),sr.drawElements(ye,Vt.primitiveLength*lr,sr.UNSIGNED_SHORT,Vt.primitiveOffset*lr*2)}}};function Wu(ve,Y,ye){var te=1/qi(ye,1,Y.transform.tileZoom),me=Math.pow(2,ye.tileID.overscaledZ),Ge=ye.tileSize*Math.pow(2,Y.transform.tileZoom)/me,Le=Ge*(ye.tileID.canonical.x+ye.tileID.wrap*me),$e=Ge*ye.tileID.canonical.y;return{u_image:0,u_texsize:ye.imageAtlasTexture.size,u_scale:[te,ve.fromScale,ve.toScale],u_fade:ve.t,u_pixel_coord_upper:[Le>>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;gt<te.length;gt++){var Et=te[gt],Ft=Y.getTile(Et),nr=Ft.getBucket(ye);if(nr){var fr=Et.posMatrix;(me[0]!==0||me[1]!==0)&&(fr=ve.translatePosMatrix(Et.posMatrix,Ft,me,Ge));var sr=Le?nr.textCollisionBox:nr.iconCollisionBox,pr=nr.collisionCircleArray;if(pr.length>0){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<ba.length;Jr+=1)for(var _n=ba[Jr],Xa=0;Xa<_n.circleArray.length/4;Xa++){var ln=Xa*4,$n=_n.circleArray[ln+0],Nn=_n.circleArray[ln+1],dn=_n.circleArray[ln+2],Tn=_n.circleArray[ln+3];Vt.emplace(Dr++,$n,Nn,dn,Tn,0),Vt.emplace(Dr++,$n,Nn,dn,Tn,1),Vt.emplace(Dr++,$n,Nn,dn,Tn,2),Vt.emplace(Dr++,$n,Nn,dn,Tn,3)}(!Ic||Ic.length<Fr*2)&&(Ic=Yu(Fr));for(var En=$e.createIndexBuffer(Ic,!0),Gn=$e.createVertexBuffer(Vt,e.collisionCircleLayout.members,!0),ci=0,bo=_r;ci<bo.length;ci+=1){var jo=bo[ci],ks=pn(jo.transform,jo.invTransform,ve.transform);or.draw($e,mt.TRIANGLES,Ba.disabled,za.disabled,ve.colorModeForRenderPass(),Pr.disabled,ks,ye.id,Gn,En,e.SegmentVector.simpleSegment(0,jo.circleOffset*2,jo.circleArray.length,jo.circleArray.length/2),null,ve.transform.zoom,null,null,null)}Gn.destroy(),En.destroy()}}function Yu(ve){var Y=ve*2,ye=new e.StructArrayLayout3ui6;ye.resize(Y),ye._trim();for(var te=0;te<Y;te++){var me=te*6;ye.uint16[me+0]=te*4+0,ye.uint16[me+1]=te*4+1,ye.uint16[me+2]=te*4+2,ye.uint16[me+3]=te*4+2,ye.uint16[me+4]=te*4+3,ye.uint16[me+5]=te*4+0}return ye}var Ne=e.identity(new Float32Array(16));function R(ve,Y,ye,te,me){if(ve.renderPass==="translucent"){var Ge=za.disabled,Le=ve.colorModeForRenderPass(),$e=ye.layout.get("text-variable-anchor");$e&&we(te,ve,ye,Y,ye.layout.get("text-rotation-alignment"),ye.layout.get("text-pitch-alignment"),me),ye.paint.get("icon-opacity").constantOr(1)!==0&&pt(ve,Y,ye,te,!1,ye.paint.get("icon-translate"),ye.paint.get("icon-translate-anchor"),ye.layout.get("icon-rotation-alignment"),ye.layout.get("icon-pitch-alignment"),ye.layout.get("icon-keep-upright"),Ge,Le),ye.paint.get("text-opacity").constantOr(1)!==0&&pt(ve,Y,ye,te,!0,ye.paint.get("text-translate"),ye.paint.get("text-translate-anchor"),ye.layout.get("text-rotation-alignment"),ye.layout.get("text-pitch-alignment"),ye.layout.get("text-keep-upright"),Ge,Le),Y.map.showCollisionBoxes&&(lc(ve,Y,ye,te,ye.paint.get("text-translate"),ye.paint.get("text-translate-anchor"),!0),lc(ve,Y,ye,te,ye.paint.get("icon-translate"),ye.paint.get("icon-translate-anchor"),!1))}}function ae(ve,Y,ye,te,me,Ge){var Le=e.getAnchorAlignment(ve),$e=Le.horizontalAlign,mt=Le.verticalAlign,jt=-($e-.5)*Y,_r=-(mt-.5)*ye,Fr=e.evaluateVariableOffset(ve,te);return new e.Point((jt/me+Fr[0])*Ge,(_r/me+Fr[1])*Ge)}function we(ve,Y,ye,te,me,Ge,Le){for(var $e=Y.transform,mt=me==="map",jt=Ge==="map",_r=0,Fr=ve;_r<Fr.length;_r+=1){var hr=Fr[_r],gt=te.getTile(hr),Et=gt.getBucket(ye);if(!(!Et||!Et.text||!Et.text.segments.get().length)){var Ft=Et.textSizeData,nr=e.evaluateSizeForZoom(Ft,$e.zoom),fr=qi(gt,1,Y.transform.zoom),sr=Da(hr.posMatrix,jt,mt,Y.transform,fr),pr=ye.layout.get("icon-text-fit")!=="none"&&Et.hasIconData();if(nr){var lr=Math.pow(2,$e.zoom-gt.tileID.overscaledZ);Se(Et,mt,jt,Le,e.symbolSize,$e,sr,hr.posMatrix,lr,nr,pr)}}}}function Se(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r){var Fr=ve.text.placedSymbolArray,hr=ve.text.dynamicLayoutVertexArray,gt=ve.icon.dynamicLayoutVertexArray,Et={};hr.clear();for(var Ft=0;Ft<Fr.length;Ft++){var nr=Fr.get(Ft),fr=ve.allowVerticalPlacement&&!nr.placedOrientation,sr=!nr.hidden&&nr.crossTileID&&!fr?te[nr.crossTileID]:null;if(!sr)Xo(nr.numGlyphs,hr);else{var pr=new e.Point(nr.anchorX,nr.anchorY),lr=Pn(pr,ye?$e:Le),Xt=fi(Ge.cameraToCenterDistance,lr.signedDistanceFromCamera),or=me.evaluateSizeForFeature(ve.textSizeData,jt,nr)*Xt/e.ONE_EM;ye&&(or*=ve.tilePixelRatio/mt);for(var Vt=sr.width,Dr=sr.height,Jr=sr.anchor,ba=sr.textOffset,_n=sr.textBoxScale,Xa=ae(Jr,Vt,Dr,ba,_n,or),ln=ye?Pn(pr.add(Xa),Le).point:lr.point.add(Y?Xa.rotate(-Ge.angle):Xa),$n=ve.allowVerticalPlacement&&nr.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,Nn=0;Nn<nr.numGlyphs;Nn++)e.addDynamicAttributes(hr,ln,$n);_r&&nr.associatedIconIndex>=0&&(Et[nr.associatedIconIndex]={shiftedAnchor:ln,angle:$n})}}if(_r){gt.clear();for(var dn=ve.icon.placedSymbolArray,Tn=0;Tn<dn.length;Tn++){var En=dn.get(Tn);if(En.hidden)Xo(En.numGlyphs,gt);else{var Gn=Et[Tn];if(!Gn)Xo(En.numGlyphs,gt);else for(var ci=0;ci<En.numGlyphs;ci++)e.addDynamicAttributes(gt,Gn.shiftedAnchor,Gn.angle)}}ve.icon.dynamicLayoutVertexBuffer.updateData(gt)}ve.text.dynamicLayoutVertexBuffer.updateData(hr)}function Oe(ve,Y,ye){return ye.iconsInText&&Y?"symbolTextAndIcon":ve?"symbolSDF":"symbolIcon"}function pt(ve,Y,ye,te,me,Ge,Le,$e,mt,jt,_r,Fr){for(var hr=ve.context,gt=hr.gl,Et=ve.transform,Ft=$e==="map",nr=mt==="map",fr=Ft&&ye.layout.get("symbol-placement")!=="point",sr=Ft&&!nr&&!fr,pr=ye.layout.get("symbol-sort-key").constantOr(1)!==void 0,lr=!1,Xt=ve.depthModeForSublayer(0,Ba.ReadOnly),or=ye.layout.get("text-variable-anchor"),Vt=[],Dr=0,Jr=te;Dr<Jr.length;Dr+=1){var ba=Jr[Dr],_n=Y.getTile(ba),Xa=_n.getBucket(ye);if(Xa){var ln=me?Xa.text:Xa.icon;if(!(!ln||!ln.segments.get().length)){var $n=ln.programConfigurations.get(ye.id),Nn=me||Xa.sdfIcons,dn=me?Xa.textSizeData:Xa.iconSizeData,Tn=nr||Et.pitch!==0,En=ve.useProgram(Oe(Nn,me,Xa),$n),Gn=e.evaluateSizeForZoom(dn,Et.zoom),ci=void 0,bo=[0,0],jo=void 0,ks=void 0,Fo=null,bs=void 0;if(me){if(jo=_n.glyphAtlasTexture,ks=gt.LINEAR,ci=_n.glyphAtlasTexture.size,Xa.iconsInText){bo=_n.imageAtlasTexture.size,Fo=_n.imageAtlasTexture;var Hs=dn.kind==="composite"||dn.kind==="camera";bs=Tn||ve.options.rotating||ve.options.zooming||Hs?gt.LINEAR:gt.NEAREST}}else{var pu=ye.layout.get("icon-size").constantOr(0)!==1||Xa.iconsNeedLinear;jo=_n.imageAtlasTexture,ks=Nn||ve.options.rotating||ve.options.zooming||pu||Tn?gt.LINEAR:gt.NEAREST,ci=_n.imageAtlasTexture.size}var Ap=qi(_n,1,ve.transform.zoom),Sp=Da(ba.posMatrix,nr,Ft,ve.transform,Ap),Ph=Zn(ba.posMatrix,nr,Ft,ve.transform,Ap),Vp=or&&Xa.hasTextData(),Vd=ye.layout.get("icon-text-fit")!=="none"&&Vp&&Xa.hasIconData();fr&&ki(Xa,ba.posMatrix,ve,me,Sp,Ph,nr,jt);var td=ve.translatePosMatrix(ba.posMatrix,_n,Ge,Le),Ih=fr||me&&or||Vd?Ne:Sp,rd=ve.translatePosMatrix(Ph,_n,Ge,Le,!0),Kh=Nn&&ye.paint.get(me?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Rh=void 0;Nn?Xa.iconsInText?Rh=yu(dn.kind,Gn,sr,nr,ve,td,Ih,rd,ci,bo):Rh=Lc(dn.kind,Gn,sr,nr,ve,td,Ih,rd,me,ci,!0):Rh=Zu(dn.kind,Gn,sr,nr,ve,td,Ih,rd,me,ci);var Mp={program:En,buffers:ln,uniformValues:Rh,atlasTexture:jo,atlasTextureIcon:Fo,atlasInterpolation:ks,atlasInterpolationIcon:bs,isSDF:Nn,hasHalo:Kh};if(pr&&Xa.canOverlap){lr=!0;for(var qp=ln.segments.get(),Ep=0,kv=qp;Ep<kv.length;Ep+=1){var qd=kv[Ep];Vt.push({segments:new e.SegmentVector([qd]),sortKey:qd.sortKey,state:Mp})}}else Vt.push({segments:ln.segments,sortKey:0,state:Mp})}}}lr&&Vt.sort(function(nm,im){return nm.sortKey-im.sortKey});for(var Vf=0,Gd=Vt;Vf<Gd.length;Vf+=1){var Lv=Gd[Vf],ch=Lv.state;if(hr.activeTexture.set(gt.TEXTURE0),ch.atlasTexture.bind(ch.atlasInterpolation,gt.CLAMP_TO_EDGE),ch.atlasTextureIcon&&(hr.activeTexture.set(gt.TEXTURE1),ch.atlasTextureIcon&&ch.atlasTextureIcon.bind(ch.atlasInterpolationIcon,gt.CLAMP_TO_EDGE)),ch.isSDF){var nv=ch.uniformValues;ch.hasHalo&&(nv.u_is_halo=1,At(ch.buffers,Lv.segments,ye,ve,ch.program,Xt,_r,Fr,nv)),nv.u_is_halo=0}At(ch.buffers,Lv.segments,ye,ve,ch.program,Xt,_r,Fr,ch.uniformValues)}}function At(ve,Y,ye,te,me,Ge,Le,$e,mt){var jt=te.context,_r=jt.gl;me.draw(jt,_r.TRIANGLES,Ge,Le,$e,Pr.disabled,mt,ye.id,ve.layoutVertexBuffer,ve.indexBuffer,Y,ye.paint,te.transform.zoom,ve.programConfigurations.get(ye.id),ve.dynamicLayoutVertexBuffer,ve.opacityVertexBuffer)}function Bt(ve,Y,ye,te){if(ve.renderPass==="translucent"){var me=ye.paint.get("circle-opacity"),Ge=ye.paint.get("circle-stroke-width"),Le=ye.paint.get("circle-stroke-opacity"),$e=ye.layout.get("circle-sort-key").constantOr(1)!==void 0;if(!(me.constantOr(1)===0&&(Ge.constantOr(1)===0||Le.constantOr(1)===0))){for(var mt=ve.context,jt=mt.gl,_r=ve.depthModeForSublayer(0,Ba.ReadOnly),Fr=za.disabled,hr=ve.colorModeForRenderPass(),gt=[],Et=0;Et<te.length;Et++){var Ft=te[Et],nr=Y.getTile(Ft),fr=nr.getBucket(ye);if(fr){var sr=fr.programConfigurations.get(ye.id),pr=ve.useProgram("circle",sr),lr=fr.layoutVertexBuffer,Xt=fr.indexBuffer,or=yr(ve,Ft,nr,ye),Vt={programConfiguration:sr,program:pr,layoutVertexBuffer:lr,indexBuffer:Xt,uniformValues:or};if($e)for(var Dr=fr.segments.get(),Jr=0,ba=Dr;Jr<ba.length;Jr+=1){var _n=ba[Jr];gt.push({segments:new e.SegmentVector([_n]),sortKey:_n.sortKey,state:Vt})}else gt.push({segments:fr.segments,sortKey:0,state:Vt})}}$e&>.sort(function(jo,ks){return jo.sortKey-ks.sortKey});for(var Xa=0,ln=gt;Xa<ln.length;Xa+=1){var $n=ln[Xa],Nn=$n.state,dn=Nn.programConfiguration,Tn=Nn.program,En=Nn.layoutVertexBuffer,Gn=Nn.indexBuffer,ci=Nn.uniformValues,bo=$n.segments;Tn.draw(mt,jt.TRIANGLES,_r,Fr,hr,Pr.disabled,ci,ye.id,En,Gn,bo,ye.paint,ve.transform.zoom,dn)}}}}function $t(ve,Y,ye,te){if(ye.paint.get("heatmap-opacity")!==0)if(ve.renderPass==="offscreen"){var me=ve.context,Ge=me.gl,Le=za.disabled,$e=new Nt([Ge.ONE,Ge.ONE],e.Color.transparent,[!0,!0,!0,!0]);br(me,ve,ye),me.clear({color:e.Color.transparent});for(var mt=0;mt<te.length;mt++){var jt=te[mt];if(!Y.hasRenderableParent(jt)){var _r=Y.getTile(jt),Fr=_r.getBucket(ye);if(Fr){var hr=Fr.programConfigurations.get(ye.id),gt=ve.useProgram("heatmap",hr),Et=ve.transform,Ft=Et.zoom;gt.draw(me,Ge.TRIANGLES,Ba.disabled,Le,$e,Pr.disabled,qn(jt.posMatrix,_r,Ft,ye.paint.get("heatmap-intensity")),ye.id,Fr.layoutVertexBuffer,Fr.indexBuffer,Fr.segments,ye.paint,ve.transform.zoom,hr)}}}me.viewport.set([0,0,ve.width,ve.height])}else ve.renderPass==="translucent"&&(ve.context.setColorMode(ve.colorModeForRenderPass()),Yr(ve,ye))}function br(ve,Y,ye){var te=ve.gl;ve.activeTexture.set(te.TEXTURE1),ve.viewport.set([0,0,Y.width/4,Y.height/4]);var me=ye.heatmapFbo;if(me)te.bindTexture(te.TEXTURE_2D,me.colorAttachment.get()),ve.bindFramebuffer.set(me.framebuffer);else{var Ge=te.createTexture();te.bindTexture(te.TEXTURE_2D,Ge),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_WRAP_S,te.CLAMP_TO_EDGE),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_WRAP_T,te.CLAMP_TO_EDGE),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_MIN_FILTER,te.LINEAR),te.texParameteri(te.TEXTURE_2D,te.TEXTURE_MAG_FILTER,te.LINEAR),me=ye.heatmapFbo=ve.createFramebuffer(Y.width/4,Y.height/4,!1),Ar(ve,Y,Ge,me)}}function Ar(ve,Y,ye,te){var me=ve.gl,Ge=ve.extRenderToTextureHalfFloat?ve.extTextureHalfFloat.HALF_FLOAT_OES:me.UNSIGNED_BYTE;me.texImage2D(me.TEXTURE_2D,0,me.RGBA,Y.width/4,Y.height/4,0,me.RGBA,Ge,null),te.colorAttachment.set(ye)}function Yr(ve,Y){var ye=ve.context,te=ye.gl,me=Y.heatmapFbo;if(me){ye.activeTexture.set(te.TEXTURE0),te.bindTexture(te.TEXTURE_2D,me.colorAttachment.get()),ye.activeTexture.set(te.TEXTURE1);var Ge=Y.colorRampTexture;Ge||(Ge=Y.colorRampTexture=new e.Texture(ye,Y.colorRamp,te.RGBA)),Ge.bind(te.LINEAR,te.CLAMP_TO_EDGE),ve.useProgram("heatmapTexture").draw(ye,te.TRIANGLES,Ba.disabled,za.disabled,ve.colorModeForRenderPass(),Pr.disabled,xn(ve,Y,0,1),Y.id,ve.viewportBuffer,ve.quadTriangleIndexBuffer,ve.viewportSegments,Y.paint,ve.transform.zoom)}}function sa(ve,Y,ye,te){if(ve.renderPass==="translucent"){var me=ye.paint.get("line-opacity"),Ge=ye.paint.get("line-width");if(!(me.constantOr(1)===0||Ge.constantOr(1)===0))for(var Le=ve.depthModeForSublayer(0,Ba.ReadOnly),$e=ve.colorModeForRenderPass(),mt=ye.paint.get("line-dasharray"),jt=ye.paint.get("line-pattern"),_r=jt.constantOr(1),Fr=ye.paint.get("line-gradient"),hr=ye.getCrossfadeParameters(),gt=_r?"linePattern":mt?"lineSDF":Fr?"lineGradient":"line",Et=ve.context,Ft=Et.gl,nr=!0,fr=0,sr=te;fr<sr.length;fr+=1){var pr=sr[fr],lr=Y.getTile(pr);if(!(_r&&!lr.patternsLoaded())){var Xt=lr.getBucket(ye);if(Xt){var or=Xt.programConfigurations.get(ye.id),Vt=ve.context.program.get(),Dr=ve.useProgram(gt,or),Jr=nr||Dr.program!==Vt,ba=jt.constantOr(null);if(ba&&lr.imageAtlas){var _n=lr.imageAtlas,Xa=_n.patternPositions[ba.to.toString()],ln=_n.patternPositions[ba.from.toString()];Xa&&ln&&or.setConstantPatternPositions(Xa,ln)}var $n=_r?Rs(ve,lr,ye,hr):mt?Ks(ve,lr,ye,mt,hr):Fr?Qs(ve,lr,ye,Xt.lineClipsArray.length):xs(ve,lr,ye);if(_r)Et.activeTexture.set(Ft.TEXTURE0),lr.imageAtlasTexture.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),or.updatePaintBuffers(hr);else if(mt&&(Jr||ve.lineAtlas.dirty))Et.activeTexture.set(Ft.TEXTURE0),ve.lineAtlas.bind(Et);else if(Fr){var Nn=Xt.gradients[ye.id],dn=Nn.texture;if(ye.gradientVersion!==Nn.version){var Tn=256;if(ye.stepInterpolant){var En=Y.getSource().maxzoom,Gn=pr.canonical.z===En?Math.ceil(1<<ve.transform.maxZoom-pr.canonical.z):1,ci=Xt.maxLineLength/e.EXTENT,bo=1024,jo=ci*bo*Gn;Tn=e.clamp(e.nextPowerOfTwo(jo),256,Et.maxTextureSize)}Nn.gradient=e.renderColorRamp({expression:ye.gradientExpression(),evaluationKey:"lineProgress",resolution:Tn,image:Nn.gradient||void 0,clips:Xt.lineClipsArray}),Nn.texture?Nn.texture.update(Nn.gradient):Nn.texture=new e.Texture(Et,Nn.gradient,Ft.RGBA),Nn.version=ye.gradientVersion,dn=Nn.texture}Et.activeTexture.set(Ft.TEXTURE0),dn.bind(ye.stepInterpolant?Ft.NEAREST:Ft.LINEAR,Ft.CLAMP_TO_EDGE)}Dr.draw(Et,Ft.TRIANGLES,Le,ve.stencilModeForClipping(pr),$e,Pr.disabled,$n,ye.id,Xt.layoutVertexBuffer,Xt.indexBuffer,Xt.segments,ye.paint,ve.transform.zoom,or,Xt.layoutVertexBuffer2),nr=!1}}}}}function He(ve,Y,ye,te){var me=ye.paint.get("fill-color"),Ge=ye.paint.get("fill-opacity");if(Ge.constantOr(1)!==0){var Le=ve.colorModeForRenderPass(),$e=ye.paint.get("fill-pattern"),mt=ve.opaquePassEnabledForLayer()&&!$e.constantOr(1)&&me.constantOr(e.Color.transparent).a===1&&Ge.constantOr(0)===1?"opaque":"translucent";if(ve.renderPass===mt){var jt=ve.depthModeForSublayer(1,ve.renderPass==="opaque"?Ba.ReadWrite:Ba.ReadOnly);Je(ve,Y,ye,te,jt,Le,!1)}if(ve.renderPass==="translucent"&&ye.paint.get("fill-antialias")){var _r=ve.depthModeForSublayer(ye.getPaintProperty("fill-outline-color")?2:0,Ba.ReadOnly);Je(ve,Y,ye,te,_r,Le,!0)}}}function Je(ve,Y,ye,te,me,Ge,Le){var $e=ve.context.gl,mt=ye.paint.get("fill-pattern"),jt=mt&&mt.constantOr(1),_r=ye.getCrossfadeParameters(),Fr,hr,gt,Et,Ft;Le?(hr=jt&&!ye.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Fr=$e.LINES):(hr=jt?"fillPattern":"fill",Fr=$e.TRIANGLES);for(var nr=0,fr=te;nr<fr.length;nr+=1){var sr=fr[nr],pr=Y.getTile(sr);if(!(jt&&!pr.patternsLoaded())){var lr=pr.getBucket(ye);if(lr){var Xt=lr.programConfigurations.get(ye.id),or=ve.useProgram(hr,Xt);jt&&(ve.context.activeTexture.set($e.TEXTURE0),pr.imageAtlasTexture.bind($e.LINEAR,$e.CLAMP_TO_EDGE),Xt.updatePaintBuffers(_r));var Vt=mt.constantOr(null);if(Vt&&pr.imageAtlas){var Dr=pr.imageAtlas,Jr=Dr.patternPositions[Vt.to.toString()],ba=Dr.patternPositions[Vt.from.toString()];Jr&&ba&&Xt.setConstantPatternPositions(Jr,ba)}var _n=ve.translatePosMatrix(sr.posMatrix,pr,ye.paint.get("fill-translate"),ye.paint.get("fill-translate-anchor"));if(!Le)Et=lr.indexBuffer,Ft=lr.segments,gt=jt?Yc(_n,ve,_r,pr):Cc(_n);else{Et=lr.indexBuffer2,Ft=lr.segments2;var Xa=[$e.drawingBufferWidth,$e.drawingBufferHeight];gt=hr==="fillOutlinePattern"&&jt?kc(_n,ve,_r,pr,Xa):sc(_n,Xa)}or.draw(ve.context,Fr,me,ve.stencilModeForClipping(sr),Ge,Pr.disabled,gt,ye.id,lr.layoutVertexBuffer,Et,Ft,ye.paint,ve.transform.zoom,Xt)}}}}function lt(ve,Y,ye,te){var me=ye.paint.get("fill-extrusion-opacity");if(me!==0&&ve.renderPass==="translucent"){var Ge=new Ba(ve.context.gl.LEQUAL,Ba.ReadWrite,ve.depthRangeFor3D);if(me===1&&!ye.paint.get("fill-extrusion-pattern").constantOr(1)){var Le=ve.colorModeForRenderPass();dt(ve,Y,ye,te,Ge,za.disabled,Le)}else dt(ve,Y,ye,te,Ge,za.disabled,Nt.disabled),dt(ve,Y,ye,te,Ge,ve.stencilModeFor3D(),ve.colorModeForRenderPass())}}function dt(ve,Y,ye,te,me,Ge,Le){for(var $e=ve.context,mt=$e.gl,jt=ye.paint.get("fill-extrusion-pattern"),_r=jt.constantOr(1),Fr=ye.getCrossfadeParameters(),hr=ye.paint.get("fill-extrusion-opacity"),gt=0,Et=te;gt<Et.length;gt+=1){var Ft=Et[gt],nr=Y.getTile(Ft),fr=nr.getBucket(ye);if(fr){var sr=fr.programConfigurations.get(ye.id),pr=ve.useProgram(_r?"fillExtrusionPattern":"fillExtrusion",sr);_r&&(ve.context.activeTexture.set(mt.TEXTURE0),nr.imageAtlasTexture.bind(mt.LINEAR,mt.CLAMP_TO_EDGE),sr.updatePaintBuffers(Fr));var lr=jt.constantOr(null);if(lr&&nr.imageAtlas){var Xt=nr.imageAtlas,or=Xt.patternPositions[lr.to.toString()],Vt=Xt.patternPositions[lr.from.toString()];or&&Vt&&sr.setConstantPatternPositions(or,Vt)}var Dr=ve.translatePosMatrix(Ft.posMatrix,nr,ye.paint.get("fill-extrusion-translate"),ye.paint.get("fill-extrusion-translate-anchor")),Jr=ye.paint.get("fill-extrusion-vertical-gradient"),ba=_r?Xu(Dr,ve,Jr,hr,Ft,Fr,nr):jf(Dr,ve,Jr,hr);pr.draw($e,$e.gl.TRIANGLES,me,Ge,Le,Pr.backCCW,ba,ye.id,fr.layoutVertexBuffer,fr.indexBuffer,fr.segments,ye.paint,ve.transform.zoom,sr)}}}function Ct(ve,Y,ye,te){if(!(ve.renderPass!=="offscreen"&&ve.renderPass!=="translucent")){for(var me=ve.context,Ge=ve.depthModeForSublayer(0,Ba.ReadOnly),Le=ve.colorModeForRenderPass(),$e=ve.renderPass==="translucent"?ve.stencilConfigForOverlap(te):[{},te],mt=$e[0],jt=$e[1],_r=0,Fr=jt;_r<Fr.length;_r+=1){var hr=Fr[_r],gt=Y.getTile(hr);gt.needsHillshadePrepare&&ve.renderPass==="offscreen"?Dt(ve,gt,ye,Ge,za.disabled,Le):ve.renderPass==="translucent"&&wt(ve,gt,ye,Ge,mt[hr.overscaledZ],Le)}me.viewport.set([0,0,ve.width,ve.height])}}function wt(ve,Y,ye,te,me,Ge){var Le=ve.context,$e=Le.gl,mt=Y.fbo;if(mt){var jt=ve.useProgram("hillshade");Le.activeTexture.set($e.TEXTURE0),$e.bindTexture($e.TEXTURE_2D,mt.colorAttachment.get());var _r=ao(ve,Y,ye);jt.draw(Le,$e.TRIANGLES,te,me,Ge,Pr.disabled,_r,ye.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments)}}function Dt(ve,Y,ye,te,me,Ge){var Le=ve.context,$e=Le.gl,mt=Y.dem;if(mt&&mt.data){var jt=mt.dim,_r=mt.stride,Fr=mt.getPixels();if(Le.activeTexture.set($e.TEXTURE1),Le.pixelStoreUnpackPremultiplyAlpha.set(!1),Y.demTexture=Y.demTexture||ve.getTileTexture(_r),Y.demTexture){var hr=Y.demTexture;hr.update(Fr,{premultiply:!1}),hr.bind($e.NEAREST,$e.CLAMP_TO_EDGE)}else Y.demTexture=new e.Texture(Le,Fr,$e.RGBA,{premultiply:!1}),Y.demTexture.bind($e.NEAREST,$e.CLAMP_TO_EDGE);Le.activeTexture.set($e.TEXTURE0);var gt=Y.fbo;if(!gt){var Et=new e.Texture(Le,{width:jt,height:jt,data:null},$e.RGBA);Et.bind($e.LINEAR,$e.CLAMP_TO_EDGE),gt=Y.fbo=Le.createFramebuffer(jt,jt,!0),gt.colorAttachment.set(Et.texture)}Le.bindFramebuffer.set(gt.framebuffer),Le.viewport.set([0,0,jt,jt]),ve.useProgram("hillshadePrepare").draw(Le,$e.TRIANGLES,te,me,Ge,Pr.disabled,Ji(Y.tileID,mt),ye.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments),Y.needsHillshadePrepare=!1}}function ur(ve,Y,ye,te){if(ve.renderPass==="translucent"&&ye.paint.get("raster-opacity")!==0&&te.length)for(var me=ve.context,Ge=me.gl,Le=Y.getSource(),$e=ve.useProgram("raster"),mt=ve.colorModeForRenderPass(),jt=Le instanceof se?[{},te]:ve.stencilConfigForOverlap(te),_r=jt[0],Fr=jt[1],hr=Fr[Fr.length-1].overscaledZ,gt=!ve.options.moving,Et=0,Ft=Fr;Et<Ft.length;Et+=1){var nr=Ft[Et],fr=ve.depthModeForSublayer(nr.overscaledZ-hr,ye.paint.get("raster-opacity")===1?Ba.ReadWrite:Ba.ReadOnly,Ge.LESS),sr=Y.getTile(nr),pr=ve.transform.calculatePosMatrix(nr.toUnwrapped(),gt);sr.registerFadeDuration(ye.paint.get("raster-fade-duration"));var lr=Y.findLoadedParent(nr,0),Xt=mr(sr,lr,Y,ye,ve.transform),or=void 0,Vt=void 0,Dr=ye.paint.get("raster-resampling")==="nearest"?Ge.NEAREST:Ge.LINEAR;me.activeTexture.set(Ge.TEXTURE0),sr.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST),me.activeTexture.set(Ge.TEXTURE1),lr?(lr.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST),or=Math.pow(2,lr.tileID.overscaledZ-sr.tileID.overscaledZ),Vt=[sr.tileID.canonical.x*or%1,sr.tileID.canonical.y*or%1]):sr.texture.bind(Dr,Ge.CLAMP_TO_EDGE,Ge.LINEAR_MIPMAP_NEAREST);var Jr=sl(pr,Vt||[0,0],or||1,Xt,ye);Le instanceof se?$e.draw(me,Ge.TRIANGLES,fr,za.disabled,mt,Pr.disabled,Jr,ye.id,Le.boundsBuffer,ve.quadTriangleIndexBuffer,Le.boundsSegments):$e.draw(me,Ge.TRIANGLES,fr,_r[nr.overscaledZ],mt,Pr.disabled,Jr,ye.id,ve.rasterBoundsBuffer,ve.quadTriangleIndexBuffer,ve.rasterBoundsSegments)}}function mr(ve,Y,ye,te,me){var Ge=te.paint.get("raster-fade-duration");if(Ge>0){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<sr.length;fr+=1){var pr=sr[fr],lr=ve.transform.calculatePosMatrix(pr.toUnwrapped()),Xt=jt?fo(lr,me,ve,jt,{tileID:pr,tileSize:mt},nr):gc(lr,me,te);Et.draw(Ge,Le.TRIANGLES,hr,Fr,gt,Pr.disabled,Xt,ye.id,ve.tileExtentBuffer,ve.quadTriangleIndexBuffer,ve.tileExtentSegments)}}}}}var Br=new e.Color(1,0,0,1),Qr=new e.Color(0,1,0,1),ga=new e.Color(0,0,1,1),Sa=new e.Color(1,0,1,1),Oa=new e.Color(0,1,1,1);function vn(ve){var Y=ve.transform.padding,ye=3;Hn(ve,ve.transform.height-(Y.top||0),ye,Br),Hn(ve,Y.bottom||0,ye,Qr),oi(ve,Y.left||0,ye,ga),oi(ve,ve.transform.width-(Y.right||0),ye,Sa);var te=ve.transform.centerPoint;Xn(ve,te.x,ve.transform.height-te.y,Oa)}function Xn(ve,Y,ye,te){var me=20,Ge=2;Ti(ve,Y-Ge/2,ye-me/2,Ge,me,te),Ti(ve,Y-me/2,ye-Ge/2,me,Ge,te)}function Hn(ve,Y,ye,te){Ti(ve,0,Y+ye/2,ve.transform.width,ye,te)}function oi(ve,Y,ye,te){Ti(ve,Y-ye/2,0,ye,ve.transform.height,te)}function Ti(ve,Y,ye,te,me,Ge){var Le=ve.context,$e=Le.gl;$e.enable($e.SCISSOR_TEST),$e.scissor(Y*e.browser.devicePixelRatio,ye*e.browser.devicePixelRatio,te*e.browser.devicePixelRatio,me*e.browser.devicePixelRatio),Le.clear({color:Ge}),$e.disable($e.SCISSOR_TEST)}function Wi(ve,Y,ye){for(var te=0;te<ye.length;te++)Bi(ve,Y,ye[te])}function Bi(ve,Y,ye){var te=ve.context,me=te.gl,Ge=ye.posMatrix,Le=ve.useProgram("debug"),$e=Ba.disabled,mt=za.disabled,jt=ve.colorModeForRenderPass(),_r="$debug";te.activeTexture.set(me.TEXTURE0),ve.emptyTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE),Le.draw(te,me.LINE_STRIP,$e,mt,jt,Pr.disabled,Yn(Ge,e.Color.red),_r,ve.debugBuffer,ve.tileBorderIndexBuffer,ve.debugSegments);var Fr=Y.getTileByID(ye.key).latestRawTileData,hr=Fr&&Fr.byteLength||0,gt=Math.floor(hr/1024),Et=Y.getTile(ye).tileSize,Ft=512/Math.min(Et,512)*(ye.overscaledZ/ve.transform.zoom)*.5,nr=ye.canonical.toString();ye.overscaledZ!==ye.canonical.z&&(nr+=" => "+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;te<me.length;te+=1){var Ge=me[te];this.style._layers[Ge].resize()}},Ko.prototype.setup=function(){var Y=this.context,ye=new e.StructArrayLayout2i4;ye.emplaceBack(0,0),ye.emplaceBack(e.EXTENT,0),ye.emplaceBack(0,e.EXTENT),ye.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=Y.createVertexBuffer(ye,Eu.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var te=new e.StructArrayLayout2i4;te.emplaceBack(0,0),te.emplaceBack(e.EXTENT,0),te.emplaceBack(0,e.EXTENT),te.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=Y.createVertexBuffer(te,Eu.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var me=new e.StructArrayLayout4i8;me.emplaceBack(0,0,0,0),me.emplaceBack(e.EXTENT,0,e.EXTENT,0),me.emplaceBack(0,e.EXTENT,0,e.EXTENT),me.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=Y.createVertexBuffer(me,ue.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var Ge=new e.StructArrayLayout2i4;Ge.emplaceBack(0,0),Ge.emplaceBack(1,0),Ge.emplaceBack(0,1),Ge.emplaceBack(1,1),this.viewportBuffer=Y.createVertexBuffer(Ge,Eu.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var Le=new e.StructArrayLayout1ui2;Le.emplaceBack(0),Le.emplaceBack(1),Le.emplaceBack(3),Le.emplaceBack(2),Le.emplaceBack(0),this.tileBorderIndexBuffer=Y.createIndexBuffer(Le);var $e=new e.StructArrayLayout3ui6;$e.emplaceBack(0,1,2),$e.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=Y.createIndexBuffer($e),this.emptyTexture=new e.Texture(Y,{width:1,height:1,data:new Uint8Array([0,0,0,0])},Y.gl.RGBA);var mt=this.context.gl;this.stencilClearMode=new za({func:mt.ALWAYS,mask:0},0,255,mt.ZERO,mt.ZERO,mt.ZERO)},Ko.prototype.clearStencil=function(){var Y=this.context,ye=Y.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var te=e.create();e.ortho(te,0,this.width,this.height,0,0,1),e.scale(te,te,[ye.drawingBufferWidth,ye.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(Y,ye.TRIANGLES,Ba.disabled,this.stencilClearMode,Nt.disabled,Pr.disabled,di(te),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Ko.prototype._renderTileClippingMasks=function(Y,ye){if(!(this.currentStencilSource===Y.source||!Y.isTileClipped()||!ye||!ye.length)){this.currentStencilSource=Y.source;var te=this.context,me=te.gl;this.nextStencilID+ye.length>256&&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<Le;mt++)$e[mt+Ge]=new za({func:te.GEQUAL,mask:255},mt+this.nextStencilID,255,te.KEEP,te.KEEP,te.REPLACE);return this.nextStencilID+=Le,[$e,me]}return[(ye={},ye[Ge]=za.disabled,ye),me]},Ko.prototype.colorModeForRenderPass=function(){var Y=this.context.gl;if(this._showOverdrawInspector){var ye=8,te=1/ye;return new Nt([Y.CONSTANT_COLOR,Y.ONE],new e.Color(te,te,te,0),[!0,!0,!0,!0])}else return this.renderPass==="opaque"?Nt.unblended:Nt.alphaBlended},Ko.prototype.depthModeForSublayer=function(Y,ye,te){if(!this.opaquePassEnabledForLayer())return Ba.disabled;var me=1-((1+this.currentLayer)*this.numSublayers+Y)*this.depthEpsilon;return new Ba(te||this.context.gl.LEQUAL,ye,[me,me])},Ko.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Ko.prototype.render=function(Y,ye){var te=this;this.style=Y,this.options=ye,this.lineAtlas=Y.lineAtlas,this.imageManager=Y.imageManager,this.glyphManager=Y.glyphManager,this.symbolFadeChange=Y.placement.symbolFadeChange(e.browser.now()),this.imageManager.beginFrame();var me=this.style._order,Ge=this.style.sourceCaches;for(var Le in Ge){var $e=Ge[Le];$e.used&&$e.prepare(this.context)}var mt={},jt={},_r={};for(var Fr in Ge){var hr=Ge[Fr];mt[Fr]=hr.getVisibleCoordinates(),jt[Fr]=mt[Fr].slice().reverse(),_r[Fr]=hr.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var gt=0;gt<me.length;gt++){var Et=me[gt];if(this.style._layers[Et].is3D()){this.opaquePassCutoff=gt;break}}this.renderPass="offscreen";for(var Ft=0,nr=me;Ft<nr.length;Ft+=1){var fr=nr[Ft],sr=this.style._layers[fr];if(!(!sr.hasOffscreenPass()||sr.isHidden(this.transform.zoom))){var pr=jt[sr.source];sr.type!=="custom"&&!pr.length||this.renderLayer(this,Ge[sr.source],sr,pr)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:ye.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=ye.showOverdrawInspector,this.depthRangeFor3D=[0,1-(Y._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=me.length-1;this.currentLayer>=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.currentLayer<me.length;this.currentLayer++){var Vt=this.style._layers[me[this.currentLayer]],Dr=Ge[Vt.source],Jr=(Vt.type==="symbol"?_r:jt)[Vt.source];this._renderTileClippingMasks(Vt,mt[Vt.source]),this.renderLayer(this,Dr,Vt,Jr)}if(this.options.showTileBoundaries){var ba,_n,Xa=e.values(this.style._layers);Xa.forEach(function(ln){ln.source&&!ln.isHidden(te.transform.zoom)&&(ln.source!==(_n&&_n.id)&&(_n=te.style.sourceCaches[ln.source]),(!ba||ba.getSource().maxzoom<_n.getSource().maxzoom)&&(ba=_n))}),ba&&So.debug(this,ba,ba.getVisibleCoordinates())}this.options.showPadding&&vn(this),this.context.setDefault()},Ko.prototype.renderLayer=function(Y,ye,te,me){te.isHidden(this.transform.zoom)||te.type!=="background"&&te.type!=="custom"&&!me.length||(this.id=te.id,this.gpuTimingStart(te),So[te.type](Y,ye,te,me,this.style.placement.variableOffsets),this.gpuTimingEnd())},Ko.prototype.gpuTimingStart=function(Y){if(this.options.gpuTiming){var ye=this.context.extTimerQuery,te=this.gpuTimers[Y.id];te||(te=this.gpuTimers[Y.id]={calls:0,cpuTime:0,query:ye.createQueryEXT()}),te.calls++,ye.beginQueryEXT(ye.TIME_ELAPSED_EXT,te.query)}},Ko.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var Y=this.context.extTimerQuery;Y.endQueryEXT(Y.TIME_ELAPSED_EXT)}},Ko.prototype.collectGpuTimers=function(){var Y=this.gpuTimers;return this.gpuTimers={},Y},Ko.prototype.queryGpuTimers=function(Y){var ye={};for(var te in Y){var me=Y[te],Ge=this.context.extTimerQuery,Le=Ge.getQueryObjectEXT(me.query,Ge.QUERY_RESULT_EXT)/(1e3*1e3);Ge.deleteQueryEXT(me.query),ye[te]=Le}return ye},Ko.prototype.translatePosMatrix=function(Y,ye,te,me,Ge){if(!te[0]&&!te[1])return Y;var Le=Ge?me==="map"?this.transform.angle:0:me==="viewport"?-this.transform.angle:0;if(Le){var $e=Math.sin(Le),mt=Math.cos(Le);te=[te[0]*mt-te[1]*$e,te[0]*$e+te[1]*mt]}var jt=[Ge?te[0]:qi(ye,te[0],this.transform.zoom),Ge?te[1]:qi(ye,te[1],this.transform.zoom),0],_r=new Float32Array(16);return e.translate(_r,Y,jt),_r},Ko.prototype.saveTileTexture=function(Y){var ye=this._tileTextures[Y.size[0]];ye?ye.push(Y):this._tileTextures[Y.size[0]]=[Y]},Ko.prototype.getTileTexture=function(Y){var ye=this._tileTextures[Y];return ye&&ye.length>0?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<ye.length;Ge++)te[Ge]=ye[Ge]?this.min[Ge]:this.center[Ge],me[Ge]=ye[Ge]?this.center[Ge]:this.max[Ge];return me[2]=this.max[2],new ll(te,me)},ll.prototype.distanceX=function(Y){var ye=Math.max(Math.min(this.max[0],Y[0]),this.min[0]);return ye-Y[0]},ll.prototype.distanceY=function(Y){var ye=Math.max(Math.min(this.max[1],Y[1]),this.min[1]);return ye-Y[1]},ll.prototype.intersects=function(Y){for(var ye=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],te=!0,me=0;me<Y.planes.length;me++){for(var Ge=Y.planes[me],Le=0,$e=0;$e<ye.length;$e++)Le+=e.dot$1(Ge,ye[$e])>=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;Fr<Y.points.length;Fr++){var hr=Y.points[Fr][mt]-this.min[mt];jt=Math.min(jt,hr),_r=Math.max(_r,hr)}if(_r<0||jt>this.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&&ye<Y.minzoom)return[];Y.maxzoom!==void 0&&ye>Y.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<<gt-nr.zoom)-2;if(nr.zoom===gt||Vt>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-Y<jt.y?jt.y/(ye-Y):0}if(this.lngRange){var hr=this.lngRange;te=e.mercatorXfromLng(hr[0])*this.worldSize,me=e.mercatorXfromLng(hr[1])*this.worldSize,Le=me-te<jt.x?jt.x/(me-te):0}var gt=this.point,Et=Math.max(Le||0,Ge||0);if(Et){this.center=this.unproject(new e.Point(Le?(me+te)/2:gt.x,Ge?(ye+Y)/2:gt.y)),this.zoom+=this.scaleZoom(Et),this._unmodified=_r,this._constraining=!1;return}if(this.latRange){var Ft=gt.y,nr=jt.y/2;Ft-nr<Y&&(mt=Y+nr),Ft+nr>ye&&(mt=ye-nr)}if(this.lngRange){var fr=gt.x,sr=jt.x/2;fr-sr<te&&($e=te+sr),fr+sr>me&&($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<mt.length;$e+=1){var jt=mt[$e];te=Math.min(te,jt.x),me=Math.min(me,jt.y),Ge=Math.max(Ge,jt.x),Le=Math.max(Le,jt.y)}return[new e.Point(te,me),new e.Point(Ge,me),new e.Point(Ge,Le),new e.Point(te,Le),new e.Point(te,me)]},Object.defineProperties(es.prototype,ts);function Pl(ve,Y){var ye=!1,te=null,me=function(){te=null,ye&&(ve(),te=setTimeout(me,Y),ye=!1)};return function(){return ye=!0,te||me(),te}}var $l=function(Y){this._hashName=Y&&encodeURIComponent(Y),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Pl(this._updateHashUnthrottled.bind(this),30*1e3/100)};$l.prototype.addTo=function(Y){return this._map=Y,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},$l.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},$l.prototype.getHashString=function(Y){var ye=this._map.getCenter(),te=Math.round(this._map.getZoom()*100)/100,me=Math.ceil((te*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ge=Math.pow(10,me),Le=Math.round(ye.lng*Ge)/Ge,$e=Math.round(ye.lat*Ge)/Ge,mt=this._map.getBearing(),jt=this._map.getPitch(),_r="";if(Y?_r+="/"+Le+"/"+$e+"/"+te:_r+=te+"/"+$e+"/"+Le,(mt||jt)&&(_r+="/"+Math.round(mt*10)/10),jt&&(_r+="/"+Math.round(jt)),this._hashName){var Fr=this._hashName,hr=!1,gt=e.window.location.hash.slice(1).split("&").map(function(Et){var Ft=Et.split("=")[0];return Ft===Fr?(hr=!0,Ft+"="+_r):Et}).filter(function(Et){return Et});return hr||gt.push(Fr+"="+_r),"#"+gt.join("&")}return"#"+_r},$l.prototype._getCurrentHash=function(){var Y=this,ye=e.window.location.hash.replace("#","");if(this._hashName){var te;return ye.split("&").map(function(me){return me.split("=")}).forEach(function(me){me[0]===Y._hashName&&(te=me)}),(te&&te[1]||"").split("/")}return ye.split("/")},$l.prototype._onHashChange=function(){var Y=this._getCurrentHash();if(Y.length>=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<me.length;te+=1){var Ge=me[te],Le=Ge.settings;ye.zoom+=Le.zoomDelta||0,ye.bearing+=Le.bearingDelta||0,ye.pitch+=Le.pitchDelta||0,Le.panDelta&&ye.pan._add(Le.panDelta),Le.around&&(ye.around=Le.around),Le.pinchAround&&(ye.pinchAround=Le.pinchAround)}var $e=this._inertiaBuffer[this._inertiaBuffer.length-1],mt=$e.time-this._inertiaBuffer[0].time,jt={};if(ye.pan.mag()){var _r=de(ye.pan.mag(),mt,e.extend({},hu,Y||{}));jt.offset=ye.pan.mult(_r.amount/ye.pan.mag()),jt.center=this._map.transform.center,ql(jt,_r)}if(ye.zoom){var Fr=de(ye.zoom,mt,wl);jt.zoom=this._map.transform.zoom+Fr.amount,ql(jt,Fr)}if(ye.bearing){var hr=de(ye.bearing,mt,su);jt.bearing=this._map.transform.bearing+e.clamp(hr.amount,-179,179),ql(jt,hr)}if(ye.pitch){var gt=de(ye.pitch,mt,uc);jt.pitch=this._map.transform.pitch+gt.amount,ql(jt,gt)}if(jt.zoom||jt.bearing){var Et=ye.pinchAround===void 0?ye.around:ye.pinchAround;jt.around=Et?this._map.unproject(Et):this._map.getCenter()}return this.clear(),e.extend(jt,{noMoveStart:!0})}};function ql(ve,Y){(!ve.duration||ve.duration<Y.duration)&&(ve.duration=Y.duration,ve.easing=Y.easing)}function de(ve,Y,ye){var te=ye.maxSpeed,me=ye.linearity,Ge=ye.deceleration,Le=e.clamp(ve*me/(Y/1e3),-te,te),$e=Math.abs(Le)/(Ge*me);return{easing:ye.easing,duration:$e*1e3,amount:Le*($e/2)}}var De=function(ve){function Y(te,me,Ge,Le){Le===void 0&&(Le={});var $e=r.mousePos(me.getCanvasContainer(),Ge),mt=me.unproject($e);ve.call(this,te,e.extend({point:$e,lngLat:mt,originalEvent:Ge},Le)),this._defaultPrevented=!1,this.target=me}ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y;var ye={defaultPrevented:{configurable:!0}};return Y.prototype.preventDefault=function(){this._defaultPrevented=!0},ye.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(Y.prototype,ye),Y}(e.Event),et=function(ve){function Y(te,me,Ge){var Le=te==="touchend"?Ge.changedTouches:Ge.touches,$e=r.touchPos(me.getCanvasContainer(),Le),mt=$e.map(function(Fr){return me.unproject(Fr)}),jt=$e.reduce(function(Fr,hr,gt,Et){return Fr.add(hr.div(Et.length))},new e.Point(0,0)),_r=me.unproject(jt);ve.call(this,te,{points:$e,point:jt,lngLats:mt,lngLat:_r,originalEvent:Ge}),this._defaultPrevented=!1}ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y;var ye={defaultPrevented:{configurable:!0}};return Y.prototype.preventDefault=function(){this._defaultPrevented=!0},ye.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(Y.prototype,ye),Y}(e.Event),vt=function(ve){function Y(te,me,Ge){ve.call(this,te,{originalEvent:Ge}),this._defaultPrevented=!1}ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y;var ye={defaultPrevented:{configurable:!0}};return Y.prototype.preventDefault=function(){this._defaultPrevented=!0},ye.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(Y.prototype,ye),Y}(e.Event),_t=function(Y,ye){this._map=Y,this._clickTolerance=ye.clickTolerance};_t.prototype.reset=function(){delete this._mousedownPos},_t.prototype.wheel=function(Y){return this._firePreventable(new vt(Y.type,this._map,Y))},_t.prototype.mousedown=function(Y,ye){return this._mousedownPos=ye,this._firePreventable(new De(Y.type,this._map,Y))},_t.prototype.mouseup=function(Y){this._map.fire(new De(Y.type,this._map,Y))},_t.prototype.click=function(Y,ye){this._mousedownPos&&this._mousedownPos.dist(ye)>=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._clickTolerance)){var me=this._startPos;this._lastPos=te,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",Y));var Ge=Math.min(me.x,te.x),Le=Math.max(me.x,te.x),$e=Math.min(me.y,te.y),mt=Math.max(me.y,te.y);r.setTransform(this._box,"translate("+Ge+"px,"+$e+"px)"),this._box.style.width=Le-Ge+"px",this._box.style.height=mt-$e+"px"}}},ar.prototype.mouseupWindow=function(Y,ye){var te=this;if(this._active&&Y.button===0){var me=this._startPos,Ge=ye;if(this.reset(),r.suppressClick(),me.x===Ge.x&&me.y===Ge.y)this._fireEvent("boxzoomcancel",Y);else return this._map.fire(new e.Event("boxzoomend",{originalEvent:Y})),{cameraAnimation:function(Le){return Le.fitScreenCoordinates(me,Ge,te._map.getBearing(),{linear:!0})}}}},ar.prototype.keydown=function(Y){this._active&&Y.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",Y))},ar.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},ar.prototype._fireEvent=function(Y,ye){return this._map.fire(new e.Event(Y,{originalEvent:ye}))};function zt(ve,Y){for(var ye={},te=0;te<ve.length;te++)ye[ve[te].identifier]=Y[te];return ye}function gr(ve){for(var Y=new e.Point(0,0),ye=0,te=ve;ye<te.length;ye+=1){var me=te[ye];Y._add(me)}return Y.div(ve.length)}var qr=500,Wr=500,Ta=30,ya=function(Y){this.reset(),this.numTouches=Y.numTouches};ya.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},ya.prototype.touchstart=function(Y,ye,te){(this.centroid||te.length>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.lastTime<qr,Le=!this.lastTap||this.lastTap.dist(me)<Ta;if((!Ge||!Le)&&this.reset(),this.count++,this.lastTime=Y.timeStamp,this.lastTap=me,this.count===this.numTaps)return this.reset(),me}};var on=function(){this._zoomIn=new tn({numTouches:1,numTaps:2}),this._zoomOut=new tn({numTouches:2,numTaps:1}),this.reset()};on.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},on.prototype.touchstart=function(Y,ye,te){this._zoomIn.touchstart(Y,ye,te),this._zoomOut.touchstart(Y,ye,te)},on.prototype.touchmove=function(Y,ye,te){this._zoomIn.touchmove(Y,ye,te),this._zoomOut.touchmove(Y,ye,te)},on.prototype.touchend=function(Y,ye,te){var me=this,Ge=this._zoomIn.touchend(Y,ye,te),Le=this._zoomOut.touchend(Y,ye,te);if(Ge)return this._active=!0,Y.preventDefault(),setTimeout(function(){return me.reset()},0),{cameraAnimation:function($e){return $e.easeTo({duration:300,zoom:$e.getZoom()+1,around:$e.unproject(Ge)},{originalEvent:Y})}};if(Le)return this._active=!0,Y.preventDefault(),setTimeout(function(){return me.reset()},0),{cameraAnimation:function($e){return $e.easeTo({duration:300,zoom:$e.getZoom()-1,around:$e.unproject(Le)},{originalEvent:Y})}}},on.prototype.touchcancel=function(){this.reset()},on.prototype.enable=function(){this._enabled=!0},on.prototype.disable=function(){this._enabled=!1,this.reset()},on.prototype.isEnabled=function(){return this._enabled},on.prototype.isActive=function(){return this._active};var Ma=0,Na=2,Ka={};Ka[Ma]=1,Ka[Na]=2;function mn(ve,Y){var ye=Ka[Y];return ve.buttons===void 0||(ve.buttons&ye)!==ye}var cn=function(Y){this.reset(),this._clickTolerance=Y.clickTolerance||1};cn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},cn.prototype._correctButton=function(Y,ye){return!1},cn.prototype._move=function(Y,ye){return{}},cn.prototype.mousedown=function(Y,ye){if(!this._lastPoint){var te=r.mouseButton(Y);this._correctButton(Y,te)&&(this._lastPoint=ye,this._eventButton=te)}},cn.prototype.mousemoveWindow=function(Y,ye){var te=this._lastPoint;if(te){if(Y.preventDefault(),mn(Y,this._eventButton)){this.reset();return}if(!(!this._moved&&ye.dist(te)<this._clickTolerance))return this._moved=!0,this._lastPoint=ye,this._move(te,ye)}},cn.prototype.mouseupWindow=function(Y){if(this._lastPoint){var ye=r.mouseButton(Y);ye===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())}},cn.prototype.enable=function(){this._enabled=!0},cn.prototype.disable=function(){this._enabled=!1,this.reset()},cn.prototype.isEnabled=function(){return this._enabled},cn.prototype.isActive=function(){return this._active};var Pa=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.mousedown=function(te,me){ve.prototype.mousedown.call(this,te,me),this._lastPoint&&(this._active=!0)},Y.prototype._correctButton=function(te,me){return me===Ma&&!te.ctrlKey},Y.prototype._move=function(te,me){return{around:me,panDelta:me.sub(te)}},Y}(cn),si=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._correctButton=function(te,me){return me===Ma&&te.ctrlKey||me===Na},Y.prototype._move=function(te,me){var Ge=.8,Le=(me.x-te.x)*Ge;if(Le)return this._active=!0,{bearingDelta:Le}},Y.prototype.contextmenu=function(te){te.preventDefault()},Y}(cn),ni=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._correctButton=function(te,me){return me===Ma&&te.ctrlKey||me===Na},Y.prototype._move=function(te,me){var Ge=-.5,Le=(me.y-te.y)*Ge;if(Le)return this._active=!0,{pitchDelta:Le}},Y.prototype.contextmenu=function(te){te.preventDefault()},Y}(cn),vi=function(Y){this._minTouches=1,this._clickTolerance=Y.clickTolerance||1,this.reset()};vi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},vi.prototype.touchstart=function(Y,ye,te){return this._calculateTransform(Y,ye,te)},vi.prototype.touchmove=function(Y,ye,te){if(!(!this._active||te.length<this._minTouches))return Y.preventDefault(),this._calculateTransform(Y,ye,te)},vi.prototype.touchend=function(Y,ye,te){this._calculateTransform(Y,ye,te),this._active&&te.length<this._minTouches&&this.reset()},vi.prototype.touchcancel=function(){this.reset()},vi.prototype._calculateTransform=function(Y,ye,te){te.length>0&&(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,!($e<this._minTouches||!Le.mag())){var Fr=Le.div($e);if(this._sum._add(Fr),!(this._sum.mag()<this._clickTolerance)){var hr=Ge.div($e);return{around:hr,panDelta:Fr}}}},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var Pi=function(){this.reset()};Pi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Pi.prototype._start=function(Y){},Pi.prototype._move=function(Y,ye,te){return{}},Pi.prototype.touchstart=function(Y,ye,te){this._firstTwoTouches||te.length<2||(this._firstTwoTouches=[te[0].identifier,te[1].identifier],this._start([ye[0],ye[1]]))},Pi.prototype.touchmove=function(Y,ye,te){if(this._firstTwoTouches){Y.preventDefault();var me=this._firstTwoTouches,Ge=me[0],Le=me[1],$e=Zi(te,ye,Ge),mt=Zi(te,ye,Le);if(!(!$e||!mt)){var jt=this._aroundCenter?null:$e.add(mt).div(2);return this._move([$e,mt],jt,Y)}}},Pi.prototype.touchend=function(Y,ye,te){if(this._firstTwoTouches){var me=this._firstTwoTouches,Ge=me[0],Le=me[1],$e=Zi(te,ye,Ge),mt=Zi(te,ye,Le);$e&&mt||(this._active&&r.suppressClick(),this.reset())}},Pi.prototype.touchcancel=function(){this.reset()},Pi.prototype.enable=function(Y){this._enabled=!0,this._aroundCenter=!!Y&&Y.around==="center"},Pi.prototype.disable=function(){this._enabled=!1,this.reset()},Pi.prototype.isEnabled=function(){return this._enabled},Pi.prototype.isActive=function(){return this._active};function Zi(ve,Y,ye){for(var te=0;te<ve.length;te++)if(ve[te].identifier===ye)return Y[te]}var eo=.1;function $o(ve,Y){return Math.log(ve/Y)/Math.LN2}var no=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),delete this._distance,delete this._startDistance},Y.prototype._start=function(te){this._startDistance=this._distance=te[0].dist(te[1])},Y.prototype._move=function(te,me){var Ge=this._distance;if(this._distance=te[0].dist(te[1]),!(!this._active&&Math.abs($o(this._distance,this._startDistance))<eo))return this._active=!0,{zoomDelta:$o(this._distance,Ge),pinchAround:me}},Y}(Pi),Zo=25;function ul(ve,Y){return ve.angleWith(Y)*180/Math.PI}var el=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),delete this._minDiameter,delete this._startVector,delete this._vector},Y.prototype._start=function(te){this._startVector=this._vector=te[0].sub(te[1]),this._minDiameter=te[0].dist(te[1])},Y.prototype._move=function(te,me){var Ge=this._vector;if(this._vector=te[0].sub(te[1]),!(!this._active&&this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:ul(this._vector,Ge),pinchAround:me}},Y.prototype._isBelowThreshold=function(te){this._minDiameter=Math.min(this._minDiameter,te.mag());var me=Math.PI*this._minDiameter,Ge=Zo/me*360,Le=ul(te,this._startVector);return Math.abs(Le)<Ge},Y}(Pi);function _l(ve){return Math.abs(ve.y)>Math.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._firstMove<gi?void 0:!1;var jt=te.y>0==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<Ge.length;me+=1){var Le=Ge[me],$e=Le[0],mt=Le[1],jt=Le[2];r.addEventListener($e,mt,$e===e.window.document?this.handleWindowEvent:this.handleEvent,jt)}};hn.prototype.destroy=function(){for(var Y=0,ye=this._listeners;Y<ye.length;Y+=1){var te=ye[Y],me=te[0],Ge=te[1],Le=te[2];r.removeEventListener(me,Ge,me===e.window.document?this.handleWindowEvent:this.handleEvent,Le)}},hn.prototype._addDefaultHandlers=function(Y){var ye=this._map,te=ye.getCanvasContainer();this._add("mapEvent",new _t(ye,Y));var me=ye.boxZoom=new ar(ye,Y);this._add("boxZoom",me);var Ge=new on,Le=new cr;ye.doubleClickZoom=new Yt(Le,Ge),this._add("tapZoom",Ge),this._add("clickZoom",Le);var $e=new ua;this._add("tapDragZoom",$e);var mt=ye.touchPitch=new vo;this._add("touchPitch",mt);var jt=new si(Y),_r=new ni(Y);ye.dragRotate=new xa(Y,jt,_r),this._add("mouseRotate",jt,["mousePitch"]),this._add("mousePitch",_r,["mouseRotate"]);var Fr=new Pa(Y),hr=new vi(Y);ye.dragPan=new Aa(te,Fr,hr),this._add("mousePan",Fr),this._add("touchPan",hr,["touchZoom","touchRotate"]);var gt=new el,Et=new no;ye.touchZoomRotate=new wa(te,Et,gt,$e),this._add("touchRotate",gt,["touchPan","touchZoom"]),this._add("touchZoom",Et,["touchPan","touchRotate"]);var Ft=ye.scrollZoom=new nt(ye,this);this._add("scrollZoom",Ft,["mousePan"]);var nr=ye.keyboard=new ps;this._add("keyboard",nr),this._add("blockableMapEvent",new St(ye));for(var fr=0,sr=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];fr<sr.length;fr+=1){var pr=sr[fr];Y.interactive&&Y[pr]&&ye[pr].enable(Y[pr])}},hn.prototype._add=function(Y,ye,te){this._handlers.push({handlerName:Y,handler:ye,allowed:te}),this._handlersById[Y]=ye},hn.prototype.stop=function(Y){if(!this._updatingCamera){for(var ye=0,te=this._handlers;ye<te.length;ye+=1){var me=te[ye],Ge=me.handler;Ge.reset()}this._inertia.clear(),this._fireEvents({},{},Y),this._changes=[]}},hn.prototype.isActive=function(){for(var Y=0,ye=this._handlers;Y<ye.length;Y+=1){var te=ye[Y],me=te.handler;if(me.isActive())return!0}return!1},hn.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},hn.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},hn.prototype.isMoving=function(){return!!Ja(this._eventsInProgress)||this.isZooming()},hn.prototype._blockedByActive=function(Y,ye,te){for(var me in Y)if(me!==te&&(!ye||ye.indexOf(me)<0))return!0;return!1},hn.prototype.handleWindowEvent=function(Y){this.handleEvent(Y,Y.type+"Window")},hn.prototype._getMapTouches=function(Y){for(var ye=[],te=0,me=Y;te<me.length;te+=1){var Ge=me[te],Le=Ge.target;this._el.contains(Le)&&ye.push(Ge)}return ye},hn.prototype.handleEvent=function(Y,ye){if(Y.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;for(var te=Y.type==="renderFrame"?void 0:Y,me={needsRenderFrame:!1},Ge={},Le={},$e=Y.touches?this._getMapTouches(Y.touches):void 0,mt=$e?r.touchPos(this._el,$e):r.mousePos(this._el,Y),jt=0,_r=this._handlers;jt<_r.length;jt+=1){var Fr=_r[jt],hr=Fr.handlerName,gt=Fr.handler,Et=Fr.allowed;if(gt.isEnabled()){var Ft=void 0;this._blockedByActive(Le,Et,hr)?gt.reset():gt[ye||Y.type]&&(Ft=gt[ye||Y.type](Y,mt,$e),this.mergeHandlerResult(me,Ge,Ft,hr,te),Ft&&Ft.needsRenderFrame&&this._triggerRenderFrame()),(Ft||gt.isActive())&&(Le[hr]=gt)}}var nr={};for(var fr in this._previousActiveHandlers)Le[fr]||(nr[fr]=te);this._previousActiveHandlers=Le,(Object.keys(nr).length||wn(me))&&(this._changes.push([me,Ge,nr]),this._triggerRenderFrame()),(Object.keys(Le).length||wn(me))&&this._map._stop(!0),this._updatingCamera=!1;var sr=me.cameraAnimation;sr&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],sr(this._map))},hn.prototype.mergeHandlerResult=function(Y,ye,te,me,Ge){if(te){e.extend(Y,te);var Le={handlerName:me,originalEvent:te.originalEvent||Ge};te.zoomDelta!==void 0&&(ye.zoom=Le),te.panDelta!==void 0&&(ye.drag=Le),te.pitchDelta!==void 0&&(ye.pitch=Le),te.bearingDelta!==void 0&&(ye.rotate=Le)}},hn.prototype._applyChanges=function(){for(var Y={},ye={},te={},me=0,Ge=this._changes;me<Ge.length;me+=1){var Le=Ge[me],$e=Le[0],mt=Le[1],jt=Le[2];$e.panDelta&&(Y.panDelta=(Y.panDelta||new e.Point(0,0))._add($e.panDelta)),$e.zoomDelta&&(Y.zoomDelta=(Y.zoomDelta||0)+$e.zoomDelta),$e.bearingDelta&&(Y.bearingDelta=(Y.bearingDelta||0)+$e.bearingDelta),$e.pitchDelta&&(Y.pitchDelta=(Y.pitchDelta||0)+$e.pitchDelta),$e.around!==void 0&&(Y.around=$e.around),$e.pinchAround!==void 0&&(Y.pinchAround=$e.pinchAround),$e.noInertia&&(Y.noInertia=$e.noInertia),e.extend(ye,mt),e.extend(te,jt)}this._updateMapTransform(Y,ye,te),this._changes=[]},hn.prototype._updateMapTransform=function(Y,ye,te){var me=this._map,Ge=me.transform;if(!wn(Y))return this._fireEvents(ye,te,!0);var Le=Y.panDelta,$e=Y.zoomDelta,mt=Y.bearingDelta,jt=Y.pitchDelta,_r=Y.around,Fr=Y.pinchAround;Fr!==void 0&&(_r=Fr),me._stop(!0),_r=_r||me.transform.centerPoint;var hr=Ge.pointLocation(Le?_r.sub(Le):_r);mt&&(Ge.bearing+=mt),jt&&(Ge.pitch+=jt),$e&&(Ge.zoom+=$e),Ge.setLocationAtPoint(hr,_r),this._map._update(),Y.noInertia||this._inertia.record(Y),this._fireEvents(ye,te,!0)},hn.prototype._fireEvents=function(Y,ye,te){var me=this,Ge=Ja(this._eventsInProgress),Le=Ja(Y),$e={};for(var mt in Y){var jt=Y[mt],_r=jt.originalEvent;this._eventsInProgress[mt]||($e[mt+"start"]=_r),this._eventsInProgress[mt]=Y[mt]}!Ge&&Le&&this._fireEvent("movestart",Le.originalEvent);for(var Fr in $e)this._fireEvent(Fr,$e[Fr]);Le&&this._fireEvent("move",Le.originalEvent);for(var hr in Y){var gt=Y[hr],Et=gt.originalEvent;this._fireEvent(hr,Et)}var Ft={},nr;for(var fr in this._eventsInProgress){var sr=this._eventsInProgress[fr],pr=sr.handlerName,lr=sr.originalEvent;this._handlersById[pr].isActive()||(delete this._eventsInProgress[fr],nr=ye[pr]||lr,Ft[fr+"end"]=nr)}for(var Xt in Ft)this._fireEvent(Xt,Ft[Xt]);var or=Ja(this._eventsInProgress);if(te&&(Ge||Le)&&!or){this._updatingCamera=!0;var Vt=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Dr=function(Jr){return Jr!==0&&-me._bearingSnap<Jr&&Jr<me._bearingSnap};Vt?(Dr(Vt.bearing||this._map.getBearing())&&(Vt.bearing=0),this._map.easeTo(Vt,{originalEvent:nr})):(this._map.fire(new e.Event("moveend",{originalEvent:nr})),Dr(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},hn.prototype._fireEvent=function(Y,ye){this._map.fire(new e.Event(Y,ye?{originalEvent:ye}:{}))},hn.prototype._requestFrame=function(){var Y=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(ye){delete Y._frameId,Y.handleEvent(new Sn("renderFrame",{timeStamp:ye})),Y._applyChanges()})},hn.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var yi=function(ve){function Y(ye,te){ve.call(this),this._moving=!1,this._zooming=!1,this.transform=ye,this._bearingSnap=te.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},Y.prototype.setCenter=function(te,me){return this.jumpTo({center:te},me)},Y.prototype.panBy=function(te,me,Ge){return te=e.Point.convert(te).mult(-1),this.panTo(this.transform.center,e.extend({offset:te},me),Ge)},Y.prototype.panTo=function(te,me,Ge){return this.easeTo(e.extend({center:te},me),Ge)},Y.prototype.getZoom=function(){return this.transform.zoom},Y.prototype.setZoom=function(te,me){return this.jumpTo({zoom:te},me),this},Y.prototype.zoomTo=function(te,me,Ge){return this.easeTo(e.extend({zoom:te},me),Ge)},Y.prototype.zoomIn=function(te,me){return this.zoomTo(this.getZoom()+1,te,me),this},Y.prototype.zoomOut=function(te,me){return this.zoomTo(this.getZoom()-1,te,me),this},Y.prototype.getBearing=function(){return this.transform.bearing},Y.prototype.setBearing=function(te,me){return this.jumpTo({bearing:te},me),this},Y.prototype.getPadding=function(){return this.transform.padding},Y.prototype.setPadding=function(te,me){return this.jumpTo({padding:te},me),this},Y.prototype.rotateTo=function(te,me,Ge){return this.easeTo(e.extend({bearing:te},me),Ge)},Y.prototype.resetNorth=function(te,me){return this.rotateTo(0,e.extend({duration:1e3},te),me),this},Y.prototype.resetNorthPitch=function(te,me){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},te),me),this},Y.prototype.snapToNorth=function(te,me){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(te,me):this},Y.prototype.getPitch=function(){return this.transform.pitch},Y.prototype.setPitch=function(te,me){return this.jumpTo({pitch:te},me),this},Y.prototype.cameraForBounds=function(te,me){te=e.LngLatBounds.convert(te);var Ge=me&&me.bearing||0;return this._cameraForBoxAndBearing(te.getNorthWest(),te.getSouthEast(),Ge,me)},Y.prototype._cameraForBoxAndBearing=function(te,me,Ge,Le){var $e={top:0,bottom:0,right:0,left:0};if(Le=e.extend({padding:$e,offset:[0,0],maxZoom:this.transform.maxZoom},Le),typeof Le.padding=="number"){var mt=Le.padding;Le.padding={top:mt,bottom:mt,right:mt,left:mt}}Le.padding=e.extend($e,Le.padding);var jt=this.transform,_r=jt.padding,Fr=jt.project(e.LngLat.convert(te)),hr=jt.project(e.LngLat.convert(me)),gt=Fr.rotate(-Ge*Math.PI/180),Et=hr.rotate(-Ge*Math.PI/180),Ft=new e.Point(Math.max(gt.x,Et.x),Math.max(gt.y,Et.y)),nr=new e.Point(Math.min(gt.x,Et.x),Math.min(gt.y,Et.y)),fr=Ft.sub(nr),sr=(jt.width-(_r.left+_r.right+Le.padding.left+Le.padding.right))/fr.x,pr=(jt.height-(_r.top+_r.bottom+Le.padding.top+Le.padding.bottom))/fr.y;if(pr<0||sr<0){e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}var lr=Math.min(jt.scaleZoom(jt.scale*Math.min(sr,pr)),Le.maxZoom),Xt=typeof Le.offset.x=="number"?new e.Point(Le.offset.x,Le.offset.y):e.Point.convert(Le.offset),or=(Le.padding.left-Le.padding.right)/2,Vt=(Le.padding.top-Le.padding.bottom)/2,Dr=new e.Point(or,Vt),Jr=Dr.rotate(Ge*Math.PI/180),ba=Xt.add(Jr),_n=ba.mult(jt.scale/jt.zoomScale(lr)),Xa=jt.unproject(Fr.add(hr).div(2).sub(_n));return{center:Xa,zoom:lr,bearing:Ge}},Y.prototype.fitBounds=function(te,me,Ge){return this._fitInternal(this.cameraForBounds(te,me),me,Ge)},Y.prototype.fitScreenCoordinates=function(te,me,Ge,Le,$e){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(te)),this.transform.pointLocation(e.Point.convert(me)),Ge,Le),Le,$e)},Y.prototype._fitInternal=function(te,me,Ge){return te?(me=e.extend(te,me),delete me.padding,me.linear?this.easeTo(me,Ge):this.flyTo(me,Ge)):this},Y.prototype.jumpTo=function(te,me){this.stop();var Ge=this.transform,Le=!1,$e=!1,mt=!1;return"zoom"in te&&Ge.zoom!==+te.zoom&&(Le=!0,Ge.zoom=+te.zoom),te.center!==void 0&&(Ge.center=e.LngLat.convert(te.center)),"bearing"in te&&Ge.bearing!==+te.bearing&&($e=!0,Ge.bearing=+te.bearing),"pitch"in te&&Ge.pitch!==+te.pitch&&(mt=!0,Ge.pitch=+te.pitch),te.padding!=null&&!Ge.isPaddingEqual(te.padding)&&(Ge.padding=te.padding),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me)),Le&&this.fire(new e.Event("zoomstart",me)).fire(new e.Event("zoom",me)).fire(new e.Event("zoomend",me)),$e&&this.fire(new e.Event("rotatestart",me)).fire(new e.Event("rotate",me)).fire(new e.Event("rotateend",me)),mt&&this.fire(new e.Event("pitchstart",me)).fire(new e.Event("pitch",me)).fire(new e.Event("pitchend",me)),this.fire(new e.Event("moveend",me))},Y.prototype.easeTo=function(te,me){var Ge=this;this._stop(!1,te.easeId),te=e.extend({offset:[0,0],duration:500,easing:e.ease},te),(te.animate===!1||!te.essential&&e.browser.prefersReducedMotion)&&(te.duration=0);var Le=this.transform,$e=this.getZoom(),mt=this.getBearing(),jt=this.getPitch(),_r=this.getPadding(),Fr="zoom"in te?+te.zoom:$e,hr="bearing"in te?this._normalizeBearing(te.bearing,mt):mt,gt="pitch"in te?+te.pitch:jt,Et="padding"in te?te.padding:Le.padding,Ft=e.Point.convert(te.offset),nr=Le.centerPoint.add(Ft),fr=Le.pointLocation(nr),sr=e.LngLat.convert(te.center||fr);this._normalizeCenter(sr);var pr=Le.project(fr),lr=Le.project(sr).sub(pr),Xt=Le.zoomScale(Fr-$e),or,Vt;te.around&&(or=e.LngLat.convert(te.around),Vt=Le.locationPoint(or));var Dr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||Fr!==$e,this._rotating=this._rotating||mt!==hr,this._pitching=this._pitching||gt!==jt,this._padding=!Le.isPaddingEqual(Et),this._easeId=te.easeId,this._prepareEase(me,te.noMoveStart,Dr),this._ease(function(Jr){if(Ge._zooming&&(Le.zoom=e.number($e,Fr,Jr)),Ge._rotating&&(Le.bearing=e.number(mt,hr,Jr)),Ge._pitching&&(Le.pitch=e.number(jt,gt,Jr)),Ge._padding&&(Le.interpolatePadding(_r,Et,Jr),nr=Le.centerPoint.add(Ft)),or)Le.setLocationAtPoint(or,Vt);else{var ba=Le.zoomScale(Le.zoom-$e),_n=Fr>$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=Jr<Dr?-1:1;bo=Math.abs(Math.log(Jr/Dr))/Vt,ci=function(){return 0},Gn=function(Fo){return Math.exp(jo*Vt*Fo)}}if("duration"in te)te.duration=+te.duration;else{var ks="screenSpeed"in te?+te.screenSpeed/Vt:+te.speed;te.duration=1e3*bo/ks}return te.maxDuration&&te.duration>te.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)<Ge&&(te-=360),Math.abs(te+360-me)<Ge&&(te+=360),te},Y.prototype._normalizeCenter=function(te){var me=this.transform;if(!(!me.renderWorldCopies||me.lngRange)){var Ge=te.lng-me.center.lng;te.lng+=Ge>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<ye.length-1?"&":"")),me},"?");Y.href=e.config.FEEDBACK_URL+"/"+te+(this._map._hash?this._map._hash.getHashString(!0):""),Y.rel="noopener nofollow",this._setElementTitle(Y,"MapFeedback")}},Bn.prototype._updateData=function(Y){Y&&(Y.sourceDataType==="metadata"||Y.sourceDataType==="visibility"||Y.dataType==="style")&&(this._updateAttributions(),this._updateEditLink())},Bn.prototype._updateAttributions=function(){if(this._map.style){var Y=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?Y=Y.concat(this.options.customAttribution.map(function(mt){return typeof mt!="string"?"":mt})):typeof this.options.customAttribution=="string"&&Y.push(this.options.customAttribution)),this._map.style.stylesheet){var ye=this._map.style.stylesheet;this.styleOwner=ye.owner,this.styleId=ye.id}var te=this._map.style.sourceCaches;for(var me in te){var Ge=te[me];if(Ge.used){var Le=Ge.getSource();Le.attribution&&Y.indexOf(Le.attribution)<0&&Y.push(Le.attribution)}}Y.sort(function(mt,jt){return mt.length-jt.length}),Y=Y.filter(function(mt,jt){for(var _r=jt+1;_r<Y.length;_r++)if(Y[_r].indexOf(mt)>=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;me<Ge.length;me+=1){var Le=Ge[me];if(Le.id===Y){Le.cancelled=!0;return}}},Va.prototype.run=function(Y){Y===void 0&&(Y=0);var ye=this._currentlyRunning=this._queue;this._queue=[];for(var te=0,me=ye;te<me.length;te+=1){var Ge=me[te];if(!Ge.cancelled&&(Ge.callback(Y),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Va.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var ea={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ea=e.window.HTMLImageElement,an=e.window.HTMLElement,gn=e.window.ImageBitmap,Wa=-2,Vn=22,Rn=0,hi=60,Za={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:Wa,maxZoom:Vn,minPitch:Rn,maxPitch:hi,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},qa=function(ve){function Y(te){var me=this;if(te=e.extend({},Za,te),te.minZoom!=null&&te.maxZoom!=null&&te.minZoom>te.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.minPitch<Rn)throw new Error("minPitch must be greater than or equal to "+Rn);if(te.maxPitch!=null&&te.maxPitch>hi)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()<me&&this.setZoom(me),this;throw new Error("minZoom must be between "+Wa+" and the current maxZoom, inclusive")},Y.prototype.getMinZoom=function(){return this.transform.minZoom},Y.prototype.setMaxZoom=function(me){if(me=me??Vn,me>=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)throw new Error("minPitch must be greater than or equal to "+Rn);if(me>=Rn&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()<me&&this.setPitch(me),this;throw new Error("minPitch must be between "+Rn+" and the current maxPitch, inclusive")},Y.prototype.getMinPitch=function(){return this.transform.minPitch},Y.prototype.setMaxPitch=function(me){if(me=me??hi,me>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;me<Ge.length;me+=1){var Le=Ge[me];Le.onRemove(this)}this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof e.window<"u"&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1));var $e=this.painter.context.gl.getExtension("WEBGL_lose_context");$e&&$e.loseContext&&$e.loseContext(),Qn(this._canvasContainer),Qn(this._controlContainer),Qn(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new e.Event("remove"))},Y.prototype.triggerRepaint=function(){var me=this;this.style&&!this._frame&&(this._frame=e.browser.frame(function(Ge){me._frame=null,me._render(Ge)}))},Y.prototype._onWindowOnline=function(){this._update()},Y.prototype._onWindowResize=function(me){this._trackResize&&this.resize({originalEvent:me})._update()},ye.showTileBoundaries.get=function(){return!!this._showTileBoundaries},ye.showTileBoundaries.set=function(te){this._showTileBoundaries!==te&&(this._showTileBoundaries=te,this._update())},ye.showPadding.get=function(){return!!this._showPadding},ye.showPadding.set=function(te){this._showPadding!==te&&(this._showPadding=te,this._update())},ye.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},ye.showCollisionBoxes.set=function(te){this._showCollisionBoxes!==te&&(this._showCollisionBoxes=te,te?this.style._generateCollisionBoxes():this._update())},ye.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},ye.showOverdrawInspector.set=function(te){this._showOverdrawInspector!==te&&(this._showOverdrawInspector=te,this._update())},ye.repaint.get=function(){return!!this._repaint},ye.repaint.set=function(te){this._repaint!==te&&(this._repaint=te,this.triggerRepaint())},ye.vertices.get=function(){return!!this._vertices},ye.vertices.set=function(te){this._vertices=te,this._update()},Y.prototype._setCacheLimits=function(me,Ge){e.setCacheLimits(me,Ge)},ye.version.get=function(){return e.version},Object.defineProperties(Y.prototype,ye),Y}(yi);function Qn(ve){ve.parentNode&&ve.parentNode.removeChild(ve)}var Fn={showCompass:!0,showZoom:!0,visualizePitch:!1},Mn=function(Y){var ye=this;this.options=e.extend({},Fn,Y),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(te){return te.preventDefault()}),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(te){return ye._map.zoomIn({},{originalEvent:te})}),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(te){return ye._map.zoomOut({},{originalEvent:te})}),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(te){ye.options.visualizePitch?ye._map.resetNorthPitch({},{originalEvent:te}):ye._map.resetNorth({},{originalEvent:te})}),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Mn.prototype._updateZoomButtons=function(){var Y=this._map.getZoom(),ye=Y===this._map.getMaxZoom(),te=Y===this._map.getMinZoom();this._zoomInButton.disabled=ye,this._zoomOutButton.disabled=te,this._zoomInButton.setAttribute("aria-disabled",ye.toString()),this._zoomOutButton.setAttribute("aria-disabled",te.toString())},Mn.prototype._rotateCompassArrow=function(){var Y=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=Y},Mn.prototype.onAdd=function(Y){return this._map=Y,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 An(this._map,this._compass,this.options.visualizePitch)),this._container},Mn.prototype.onRemove=function(){r.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},Mn.prototype._createButton=function(Y,ye){var te=r.create("button",Y,this._container);return te.type="button",te.addEventListener("click",ye),te},Mn.prototype._setButtonTitle=function(Y,ye){var te=this._map._getUIString("NavigationControl."+ye);Y.title=te,Y.setAttribute("aria-label",te)};var An=function(Y,ye,te){te===void 0&&(te=!1),this._clickTolerance=10,this.element=ye,this.mouseRotate=new si({clickTolerance:Y.dragRotate._mouseRotate._clickTolerance}),this.map=Y,te&&(this.mousePitch=new ni({clickTolerance:Y.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(ye,"mousedown",this.mousedown),r.addEventListener(ye,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(ye,"touchmove",this.touchmove),r.addEventListener(ye,"touchend",this.touchend),r.addEventListener(ye,"touchcancel",this.reset)};An.prototype.down=function(Y,ye){this.mouseRotate.mousedown(Y,ye),this.mousePitch&&this.mousePitch.mousedown(Y,ye),r.disableDrag()},An.prototype.move=function(Y,ye){var te=this.map,me=this.mouseRotate.mousemoveWindow(Y,ye);if(me&&me.bearingDelta&&te.setBearing(te.getBearing()+me.bearingDelta),this.mousePitch){var Ge=this.mousePitch.mousemoveWindow(Y,ye);Ge&&Ge.pitchDelta&&te.setPitch(te.getPitch()+Ge.pitchDelta)}},An.prototype.off=function(){var Y=this.element;r.removeEventListener(Y,"mousedown",this.mousedown),r.removeEventListener(Y,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(Y,"touchmove",this.touchmove),r.removeEventListener(Y,"touchend",this.touchend),r.removeEventListener(Y,"touchcancel",this.reset),this.offTemp()},An.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},An.prototype.mousedown=function(Y){this.down(e.extend({},Y,{ctrlKey:!0,preventDefault:function(){return Y.preventDefault()}}),r.mousePos(this.element,Y)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},An.prototype.mousemove=function(Y){this.move(Y,r.mousePos(this.element,Y))},An.prototype.mouseup=function(Y){this.mouseRotate.mouseupWindow(Y),this.mousePitch&&this.mousePitch.mouseupWindow(Y),this.offTemp()},An.prototype.touchstart=function(Y){Y.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,Y.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return Y.preventDefault()}},this._startPos))},An.prototype.touchmove=function(Y){Y.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,Y.targetTouches)[0],this.move({preventDefault:function(){return Y.preventDefault()}},this._lastPos))},An.prototype.touchend=function(Y){Y.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},An.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};function Jn(ve,Y,ye){if(ve=new e.LngLat(ve.lng,ve.lat),Y){var te=new e.LngLat(ve.lng-360,ve.lat),me=new e.LngLat(ve.lng+360,ve.lat),Ge=ye.locationPoint(ve).distSqr(Y);ye.locationPoint(te).distSqr(Y)<Ge?ve=te:ye.locationPoint(me).distSqr(Y)<Ge&&(ve=me)}for(;Math.abs(ve.lng-ye.center.lng)>180;){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<hr.length;Fr+=1){var gt=hr[Fr],Et=r.createNS("http://www.w3.org/2000/svg","ellipse");Et.setAttributeNS(null,"opacity","0.04"),Et.setAttributeNS(null,"cx","10.5"),Et.setAttributeNS(null,"cy","5.80029008"),Et.setAttributeNS(null,"rx",gt.rx),Et.setAttributeNS(null,"ry",gt.ry),jt.appendChild(Et)}var Ft=r.createNS("http://www.w3.org/2000/svg","g");Ft.setAttributeNS(null,"fill",this._color);var nr=r.createNS("http://www.w3.org/2000/svg","path");nr.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"),Ft.appendChild(nr);var fr=r.createNS("http://www.w3.org/2000/svg","g");fr.setAttributeNS(null,"opacity","0.25"),fr.setAttributeNS(null,"fill","#000000");var sr=r.createNS("http://www.w3.org/2000/svg","path");sr.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"),fr.appendChild(sr);var pr=r.createNS("http://www.w3.org/2000/svg","g");pr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),pr.setAttributeNS(null,"fill","#FFFFFF");var lr=r.createNS("http://www.w3.org/2000/svg","g");lr.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Xt=r.createNS("http://www.w3.org/2000/svg","circle");Xt.setAttributeNS(null,"fill","#000000"),Xt.setAttributeNS(null,"opacity","0.25"),Xt.setAttributeNS(null,"cx","5.5"),Xt.setAttributeNS(null,"cy","5.5"),Xt.setAttributeNS(null,"r","5.4999962");var or=r.createNS("http://www.w3.org/2000/svg","circle");or.setAttributeNS(null,"fill","#FFFFFF"),or.setAttributeNS(null,"cx","5.5"),or.setAttributeNS(null,"cy","5.5"),or.setAttributeNS(null,"r","5.4999962"),lr.appendChild(Xt),lr.appendChild(or),mt.appendChild(jt),mt.appendChild(Ft),mt.appendChild(fr),mt.appendChild(pr),mt.appendChild(lr),me.appendChild(mt),me.setAttributeNS(null,"height",Ge*this._scale+"px"),me.setAttributeNS(null,"width",Le*this._scale+"px"),this._element.appendChild(me),this._offset=e.Point.convert(ye&&ye.offset||[0,-14])}else this._element=ye.element,this._offset=e.Point.convert(ye&&ye.offset||[0,0]);this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(Vt){Vt.preventDefault()}),this._element.addEventListener("mousedown",function(Vt){Vt.preventDefault()}),Ii(this._element,this._anchor,"marker"),this._popup=null}return ve&&(Y.__proto__=ve),Y.prototype=Object.create(ve&&ve.prototype),Y.prototype.constructor=Y,Y.prototype.addTo=function(te){return this.remove(),this._map=te,te.getCanvasContainer().appendChild(this._element),te.on("move",this._update),te.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},Y.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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),r.remove(this._element),this._popup&&this._popup.remove(),this},Y.prototype.getLngLat=function(){return this._lngLat},Y.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},Y.prototype.getElement=function(){return this._element},Y.prototype.setPopup=function(te){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),te){if(!("offset"in te.options)){var me=38.1,Ge=13.5,Le=Math.sqrt(Math.pow(Ge,2)/2);te.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-me],"bottom-left":[Le,(me-Ge+Le)*-1],"bottom-right":[-Le,(me-Ge+Le)*-1],left:[Ge,(me-Ge)*-1],right:[-Ge,(me-Ge)*-1]}:this._offset}this._popup=te,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},Y.prototype._onKeyPress=function(te){var me=te.code,Ge=te.charCode||te.keyCode;(me==="Space"||me==="Enter"||Ge===32||Ge===13)&&this.togglePopup()},Y.prototype._onMapClick=function(te){var me=te.originalEvent.target,Ge=this._element;this._popup&&(me===Ge||Ge.contains(me))&&this.togglePopup()},Y.prototype.getPopup=function(){return this._popup},Y.prototype.togglePopup=function(){var te=this._popup;if(te)te.isOpen()?te.remove():te.addTo(this._map);else return this;return this},Y.prototype._update=function(te){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Jn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var me="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?me="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(me="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var Ge="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ge="rotateX(0deg)":this._pitchAlignment==="map"&&(Ge="rotateX("+this._map.getPitch()+"deg)"),(!te||te.type==="moveend")&&(this._pos=this._pos.round()),r.setTransform(this._element,mi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+Ge+" "+me)}},Y.prototype.getOffset=function(){return this._offset},Y.prototype.setOffset=function(te){return this._offset=e.Point.convert(te),this._update(),this},Y.prototype._onMove=function(te){if(!this._isDragging){var me=this._clickTolerance||this._map._clickTolerance;this._isDragging=te.point.dist(this._pointerdownPos)>=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.longitude<me.getWest()||Ge.longitude>me.getEast()||Ge.latitude<me.getSouth()||Ge.latitude>me.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.x<jt/2?Fr.push("left"):Le.x>this._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;s<o.length;s++){var c=o[s].id;if(typeof c=="string"&&c.indexOf(M.traceLayerPrefix)===0){n=c;break}}return n},t.updateLayer=function(n){var o=this.subplot,s=i(n),c=this.lookupBelow(),h=this.findFollowingMapboxLayerId(c);this.removeLayer(),r(n)&&o.addLayer({id:this.idLayer,source:this.idSource,"source-layer":n.sourcelayer||"",type:n.type,minzoom:n.minzoom,maxzoom:n.maxzoom,layout:s.layout,paint:s.paint},h),this.layerType=n.type,this.below=c},t.updateStyle=function(n){if(r(n)){var o=i(n);this.subplot.setOptions(this.idLayer,"setLayoutProperty",o.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",o.paint)}},t.removeLayer=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer)},t.dispose=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer),n.getSource(this.idSource)&&n.removeSource(this.idSource)};function r(n){if(!n.visible)return!1;var o=n.source;if(Array.isArray(o)&&o.length>0){for(var s=0;s<o.length;s++)if(typeof o[s]!="string"||o[s].length===0)return!1;return!0}return v.isPlainObject(o)||typeof o=="string"&&o.length>0}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;y<g.length;y++){var z=g[y][0].trace,F=z._module;typeof z.below=="string"?f=z.below:F.getBelow&&(f=F.getBelow(z,this)),f===""&&(L=!0),P["trace-"+z.uid]=f||""}for(y=0;y<u.length;y++){var B=u[y];typeof B.below=="string"?f=B.below:L?f="traces":f="",P["layout-"+y]=f}var O={},I,N;for(I in P)f=P[I],O[f]?O[f].push(I):O[f]=[I];for(f in O){var U=O[f];if(U.length>1)for(y=0;y<U.length;y++)I=U[y],I.indexOf("trace-")===0?(N=I.split("trace-")[1],this.traceHash[N]&&(this.traceHash[N].below=null)):I.indexOf("layout-")===0&&(N=I.split("layout-")[1],this.layerList[N]&&(this.layerList[N].below=null))}};var _={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};l.updateData=function(g){var b=this.traceHash,p,u,y,f,P=g.slice().sort(function(O,I){return _[O[0].trace.type]-_[I[0].trace.type]});for(y=0;y<P.length;y++){var L=P[y];u=L[0].trace,p=b[u.uid];var z=!1;p&&(p.type===u.type?(p.update(L),z=!0):p.dispose()),!z&&u._module&&(b[u.uid]=u._module.plot(this,L))}var F=Object.keys(b);e:for(y=0;y<F.length;y++){var B=F[y];for(f=0;f<g.length;f++)if(u=g[f][0].trace,B===u.uid)continue e;p=b[B],p.dispose(),delete b[B]}},l.updateLayout=function(g){var b=this.map,p=g[this.id];!this.dragging&&!this.wheeling&&(b.setCenter(E(p.center)),b.setZoom(p.zoom),b.setBearing(p.bearing),b.setPitch(p.pitch)),this.updateLayers(g),this.updateFramework(g),this.updateFx(g),this.map.resize(),this.gd._context._scrollZoom.mapbox?b.scrollZoom.enable():b.scrollZoom.disable()},l.resolveOnRender=function(g){var b=this.map;b.on("render",function p(){b.loaded()&&(b.off("render",p),setTimeout(g,10))})},l.rejectOnError=function(g){var b=this.map;function p(){g(new Error(m.mapOnErrorMsg))}b.once("error",p),b.once("style.error",p),b.once("source.error",p),b.once("tile.error",p),b.once("layer.error",p)},l.createFramework=function(g){var b=this,p=b.div=document.createElement("div");p.id=b.uid,p.style.position="absolute",b.container.appendChild(p),b.xaxis={_id:"x",c2p:function(u){return b.project(u).x}},b.yaxis={_id:"y",c2p:function(u){return b.project(u).y}},b.updateFramework(g),b.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},e.setConvert(b.mockAxis,g)},l.initFx=function(g,b){var p=this,u=p.gd,y=p.map;y.on("moveend",function(L){if(p.map){var z=u._fullLayout;if(L.originalEvent||p.wheeling){var F=z[p.id];M.call("_storeDirectGUIEdit",u.layout,z._preGUI,p.getViewEdits(F));var B=p.getView();F._input.center=F.center=B.center,F._input.zoom=F.zoom=B.zoom,F._input.bearing=F.bearing=B.bearing,F._input.pitch=F.pitch=B.pitch,u.emit("plotly_relayout",p.getViewEditsWithDerived(B))}L.originalEvent&&L.originalEvent.type==="mouseup"?p.dragging=!1:p.wheeling&&(p.wheeling=!1),z._rehover&&z._rehover()}}),y.on("wheel",function(){p.wheeling=!0}),y.on("mousemove",function(L){var z=p.div.getBoundingClientRect(),F=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return z},p.xaxis.p2c=function(){return y.unproject(F).lng},p.yaxis.p2c=function(){return y.unproject(F).lat},u._fullLayout._rehover=function(){u._fullLayout._hoversubplot===p.id&&u._fullLayout[p.id]&&r.hover(u,L,p.id)},r.hover(u,L,p.id),u._fullLayout._hoversubplot=p.id});function f(){r.loneUnhover(b._hoverlayer)}y.on("dragstart",function(){p.dragging=!0,f()}),y.on("zoomstart",f),y.on("mouseout",function(){u._fullLayout._hoversubplot=null});function P(){var L=p.getView();u.emit("plotly_relayouting",p.getViewEditsWithDerived(L))}y.on("drag",P),y.on("zoom",P),y.on("dblclick",function(){var L=u._fullLayout[p.id];M.call("_storeDirectGUIEdit",u.layout,u._fullLayout._preGUI,p.getViewEdits(L));var z=p.viewInitial;y.setCenter(E(z.center)),y.setZoom(z.zoom),y.setBearing(z.bearing),y.setPitch(z.pitch);var F=p.getView();L._input.center=L.center=F.center,L._input.zoom=L.zoom=F.zoom,L._input.bearing=L.bearing=F.bearing,L._input.pitch=L.pitch=F.pitch,u.emit("plotly_doubleclick",null),u.emit("plotly_relayout",p.getViewEditsWithDerived(F))}),p.clearOutline=function(){c(p.dragOptions),s(p.dragOptions.gd)},p.onClickInPanFn=function(L){return function(z){var F=u._fullLayout.clickmode;F.indexOf("select")>-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;y<u.length;y++)u[y].dispose();for(u=this.layerList=[],y=0;y<p.length;y++)u.push(d(this,y,p[y]))}else for(y=0;y<p.length;y++)u[y].update(p[y])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(g,b,p){for(var u in p)this.map[b](g,u,p[u])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(g,b){var p=this.map;if(typeof b=="string"){if(b===""){p.addLayer(g,b);return}for(var u=this.getMapLayers(),y=0;y<u.length;y++)if(b===u[y].id){p.addLayer(g,b);return}x.warn(["Trying to add layer with *below* value",b,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}p.addLayer(g)},l.project=function(g){return this.map.project(new v.LngLat(g[0],g[1]))},l.getView=function(){var g=this.map,b=g.getCenter(),p=b.lng,u=b.lat,y={lon:p,lat:u},f=g.getCanvas(),P=parseInt(f.style.width),L=parseInt(f.style.height);return{center:y,zoom:g.getZoom(),bearing:g.getBearing(),pitch:g.getPitch(),_derived:{coordinates:[g.unproject([0,0]).toArray(),g.unproject([P,0]).toArray(),g.unproject([P,L]).toArray(),g.unproject([0,L]).toArray()]}}},l.getViewEdits=function(g){for(var b=this.id,p=["center","zoom","bearing","pitch"],u={},y=0;y<p.length;y++){var f=p[y];u[b+"."+f]=g[f]}return u},l.getViewEditsWithDerived=function(g){var b=this.id,p=this.getViewEdits(g);return p[b+"._derived"]=g._derived,p};function w(g,b){var p={};if(x.isPlainObject(g))p.id=g.id,p.style=g;else if(typeof g=="string")if(p.id=g,m.styleValuesMapbox.indexOf(g)!==-1)p.style=S(g);else if(m.stylesNonMapbox[g]){p.style=m.stylesNonMapbox[g];var u=p.style.sources["plotly-"+g],y=u?u.tiles:void 0;y&&y[0]&&y[0].slice(-9)==="?api_key="&&(y[0]+=b._mapboxAccessToken)}else p.style=g;else p.id=m.styleValueDflt,p.style=S(m.styleValueDflt);return p.transition={duration:0,delay:0},p}function S(g){return m.styleUrlPrefix+g+"-"+m.styleUrlSuffix}function E(g){return[g.lon,g.lat]}q.exports=T}}),_q=Ze({"src/plots/mapbox/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=ng(),A=fp(),M=Mx();q.exports=function(i,a,n){x(i,a,n,{type:"mapbox",attributes:M,handleDefaults:e,partition:"y",accessToken:a._mapboxAccessToken})};function e(r,i,a,n){a("accesstoken",n.accessToken),a("style"),a("center.lon"),a("center.lat"),a("zoom"),a("bearing"),a("pitch");var o=a("bounds.west"),s=a("bounds.east"),c=a("bounds.south"),h=a("bounds.north");(o===void 0||s===void 0||c===void 0||h===void 0)&&delete i.bounds,A(r,i,{name:"layers",handleItemDefaults:t}),i._input=r}function t(r,i){function a(m,d){return v.coerce(r,i,M.layers,m,d)}var n=a("visible");if(n){var o=a("sourcetype"),s=o==="raster"||o==="image";a("source"),a("sourceattribution"),o==="vector"&&a("sourcelayer"),o==="image"&&a("coordinates");var c;s&&(c="raster");var h=a("type",c);s&&h!=="raster"&&(h=i.type="raster",v.log("Source types *raster* and *image* must drawn *raster* layer type.")),a("below"),a("color"),a("opacity"),a("minzoom"),a("maxzoom"),h==="circle"&&a("circle.radius"),h==="line"&&(a("line.width"),a("line.dash")),h==="fill"&&a("fill.outlinecolor"),h==="symbol"&&(a("symbol.icon"),a("symbol.iconsize"),a("symbol.text"),v.coerceFont(a,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),a("symbol.textposition"),a("symbol.placement"))}}}}),MT=Ze({"src/plots/mapbox/index.js"(Z){"use strict";var q=EC(),v=ca(),x=v.strTranslate,A=v.strScale,M=Hh().getSubplotCalcData,e=vd(),t=Oi(),r=as(),i=fu(),a=yq(),n="mapbox",o=Z.constants=am();Z.name=n,Z.attr="subplot",Z.idRoot=n,Z.idRegex=Z.attrRegex=v.counterRegex(n);var s=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");Z.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},Z.layoutAttributes=Mx(),Z.supplyLayoutDefaults=_q();var c=!0;Z.plot=function(T){c&&(c=!1,v.warn(s));var l=T._fullLayout,_=T.calcdata,w=l._subplots[n];if(q.version!==o.requiredVersion)throw new Error(o.wrongVersionErrorMsg);var S=h(T,w);q.accessToken=S;for(var E=0;E<w.length;E++){var g=w[E],b=M(_,n,g),p=l[g],u=p._subplot;u||(u=new a(T,g),l[g]._subplot=u),u.viewInitial||(u.viewInitial={center:v.extendFlat({},p.center),zoom:p.zoom,bearing:p.bearing,pitch:p.pitch}),u.plot(b,l,T._promises)}},Z.clean=function(d,T,l,_){for(var w=_._subplots[n]||[],S=0;S<w.length;S++){var E=w[S];!T[E]&&_[E]._subplot&&_[E]._subplot.destroy()}},Z.toSVG=function(d){for(var T=d._fullLayout,l=T._subplots[n],_=T._size,w=0;w<l.length;w++){var S=T[l[w]],E=S.domain,g=S._subplot,b=g.toImage("png"),p=T._glimages.append("svg:image");p.attr({xmlns:e.svg,"xlink:href":b,x:_.l+_.w*E.x[0],y:_.t+_.h*(1-E.y[1]),width:_.w*(E.x[1]-E.x[0]),height:_.h*(E.y[1]-E.y[0]),preserveAspectRatio:"none"});var u=t.select(S._subplot.div),y=u.select(".mapboxgl-ctrl-logo").node().offsetParent===null;if(!y){var f=T._glimages.append("g");f.attr("transform",x(_.l+_.w*E.x[0]+10,_.t+_.h*(1-E.y[0])-31)),f.append("path").attr("d",o.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),f.append("path").attr("d",o.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),f.append("path").attr("d",o.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),f.append("polygon").attr("points",o.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var P=u.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),L=T._glimages.append("g"),z=L.append("text");z.text(P).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":P});var F=r.bBox(z.node()),B=_.w*(E.x[1]-E.x[0]);if(F.width>B/2){var O=P.split("|").join("<br>");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;b<T.length;b++){var p=l[T[b]],u=p.accesstoken;m(p.style)&&(u?v.pushUnique(w,u):(m(p._input.style)&&(v.error("Uses Mapbox map style, but did not set an access token."),E=!0),g=!0)),u&&v.pushUnique(S,u)}if(g){var y=E?o.noAccessTokenErrorMsg:o.missingStyleErrorMsg;throw v.error(y),new Error(y)}return w.length?(w.length>1&&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;_<l.length;_++){var w=T[l[_]]._subplot;w.updateFx(T)}}}}),xq=Ze({"src/traces/scattermapbox/index.js"(Z,q){"use strict";var v=["*scattermapbox* trace is deprecated!","Please consider switching to the *scattermap* 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:AT(),supplyDefaults:hq(),colorbar:hp(),formatLabels:SC(),calc:nT(),plot:dq(),hoverPoints:ST().hoverPoints,eventData:vq(),selectPoints:mq(),styleOnSelect:function(x,A){if(A){var M=A[0].trace;M._glTrace.update(A)}},moduleType:"trace",name:"scattermapbox",basePlotModule:MT(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}}),bq=Ze({"lib/scattermapbox.js"(Z,q){"use strict";q.exports=xq()}}),CC=Ze({"src/traces/choroplethmapbox/attributes.js"(Z,q){"use strict";var v=C1(),x=Mu(),A=Cs().hovertemplateAttrs,M=eu(),e=rs().extendFlat;q.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},v.featureidkey,{}),below:{valType:"string",editType:"plot"},text:v.text,hovertext:v.hovertext,marker:{line:{color:e({},v.marker.line.color,{editType:"plot"}),width:e({},v.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},v.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},v.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},v.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:v.hoverinfo,hovertemplate:A({},{keys:["properties"]}),showlegend:e({},M.showlegend,{dflt:!1})},x("",{cLetter:"z",editTypeOverride:"calc"}))}}),wq=Ze({"src/traces/choroplethmapbox/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=CC();q.exports=function(e,t,r,i){function a(h,m){return v.coerce(e,t,A,h,m)}var n=a("locations"),o=a("z"),s=a("geojson");if(!v.isArrayOrTypedArray(n)||!n.length||!v.isArrayOrTypedArray(o)||!o.length||!(typeof s=="string"&&s!==""||v.isPlainObject(s))){t.visible=!1;return}a("featureidkey"),t._length=Math.min(n.length,o.length),a("below"),a("text"),a("hovertext"),a("hovertemplate");var c=a("marker.line.width");c&&a("marker.line.color"),a("marker.opacity"),x(e,t,i,a,{prefix:"",cLetter:"z"}),v.coerceSelectionMarkerOpacity(t,a)}}}),kC=Ze({"src/traces/choroplethmapbox/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=rc(),M=as(),e=dg().makeBlank,t=vg();function r(a){var n=a[0].trace,o=n.visible===!0&&n._length!==0,s={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},h=n._opts={fill:s,line:c,geojson:e()};if(!o)return h;var m=t.extractTraceFeature(a);if(!m)return h;var d=A.makeColorScaleFuncFromTrace(n),T=n.marker,l=T.line||{},_;x.isArrayOrTypedArray(T.opacity)&&(_=function(y){var f=y.mo;return v(f)?+x.constrain(f,0,1):0});var w;x.isArrayOrTypedArray(l.color)&&(w=function(y){return y.mlc});var S;x.isArrayOrTypedArray(l.width)&&(S=function(y){return y.mlw});for(var E=0;E<a.length;E++){var g=a[E],b=g.fOut;if(b){var p=b.properties;p.fc=d(g.z),_&&(p.mo=_(g)),w&&(p.mlc=w(g)),S&&(p.mlw=S(g)),g.ct=p.ct,g._polygons=t.feature2polygons(b)}}var u=_?{type:"identity",property:"mo"}:T.opacity;return x.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":u}),x.extendFlat(c.paint,{"line-color":w?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":u}),s.layout.visibility="visible",c.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:m},i(a),h}function i(a){var n=a[0].trace,o=n._opts,s;if(n.selectedpoints){for(var c=M.makeSelectedPointStyleFns(n),h=0;h<a.length;h++){var m=a[h];m.fOut&&(m.fOut.properties.mo2=c.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=x.isArrayOrTypedArray(n.marker.opacity)?{type:"identity",property:"mo"}:n.marker.opacity;return x.extendFlat(o.fill.paint,{"fill-opacity":s}),x.extendFlat(o.line.paint,{"line-opacity":s}),o}q.exports={convert:r,convertOnSelect:i}}}),Tq=Ze({"src/traces/choroplethmapbox/plot.js"(Z,q){"use strict";var v=kC().convert,x=kC().convertOnSelect,A=am().traceLayerPrefix;function M(t,r){this.type="choroplethmapbox",this.subplot=t,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",A+r+"-fill"],["line",A+r+"-line"]],this.below=null}var e=M.prototype;e.update=function(t){this._update(v(t)),t[0].trace._glTrace=this},e.updateOnSelect=function(t){this._update(x(t))},e._update=function(t){var r=this.subplot,i=this.layerList,a=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(t.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(t,a),this.below=a);for(var n=0;n<i.length;n++){var o=i[n],s=o[0],c=o[1],h=t[s];r.setOptions(c,"setLayoutProperty",h.layout),h.layout.visibility==="visible"&&r.setOptions(c,"setPaintProperty",h.paint)}},e._addLayers=function(t,r){for(var i=this.subplot,a=this.layerList,n=this.sourceId,o=0;o<a.length;o++){var s=a[o],c=s[0],h=t[c];i.addLayer({type:c,id:s[1],source:n,layout:h.layout,paint:h.paint},r)}},e._removeLayers=function(){for(var t=this.subplot.map,r=this.layerList,i=r.length-1;i>=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;r<M.length;r++)if(t=M[r].id,typeof t=="string"&&t.indexOf("plotly-")===-1)return t}}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:MT(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}}),Sq=Ze({"lib/choroplethmapbox.js"(Z,q){"use strict";q.exports=Aq()}}),LC=Ze({"src/traces/densitymapbox/attributes.js"(Z,q){"use strict";var v=Mu(),x=Cs().hovertemplateAttrs,A=eu(),M=AT(),e=rs().extendFlat;q.exports=e({lon:M.lon,lat:M.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:M.text,hovertext:M.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:x(),showlegend:e({},A.showlegend,{dflt:!1})},v("",{cLetter:"z",editTypeOverride:"calc"}))}}),Mq=Ze({"src/traces/densitymapbox/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=LC();q.exports=function(e,t,r,i){function a(c,h){return v.coerce(e,t,A,c,h)}var n=a("lon")||[],o=a("lat")||[],s=Math.min(n.length,o.length);if(!s){t.visible=!1;return}t._length=s,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),x(e,t,i,a,{prefix:"",cLetter:"z"})}}}),Eq=Ze({"src/traces/densitymapbox/calc.js"(Z,q){"use strict";var v=is(),x=ca().isArrayOrTypedArray,A=Vs().BADNUM,M=jp(),e=ca()._;q.exports=function(r,i){for(var a=i._length,n=new Array(a),o=i.z,s=x(o)&&o.length,c=0;c<a;c++){var h=n[c]={},m=i.lon[c],d=i.lat[c];if(h.lonlat=v(m)&&v(d)?[+m,+d]:[A,A],s){var T=o[c];h.z=v(T)?T:A}}return M(r,i,{vals:s?o:[0,1],containerStr:"",cLetter:"z"}),a&&(n[0].t={labels:{lat:e(r,"lat:")+" ",lon:e(r,"lon:")+" "}}),n}}}),Cq=Ze({"src/traces/densitymapbox/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=Yi(),M=rc(),e=Vs().BADNUM,t=dg().makeBlank;q.exports=function(i){var a=i[0].trace,n=a.visible===!0&&a._length!==0,o={layout:{visibility:"none"},paint:{}},s=a._opts={heatmap:o,geojson:t()};if(!n)return s;var c=[],h,m=a.z,d=a.radius,T=x.isArrayOrTypedArray(m)&&m.length,l=x.isArrayOrTypedArray(d);for(h=0;h<i.length;h++){var _=i[h],w=_.lonlat;if(w[0]!==e){var S={};if(T){var E=_.z;S.z=E!==e?E:0}l&&(S.r=v(d[h])&&d[h]>0?+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<b.length;h++)y.push(b[h][0],b[h][1]);var f=["interpolate",["linear"],["get","z"],g.min,0,g.max,1];return x.extendFlat(s.heatmap.paint,{"heatmap-weight":T?f:1/(g.max-g.min),"heatmap-color":y,"heatmap-radius":l?{type:"identity",property:"r"}:a.radius,"heatmap-opacity":a.opacity}),s.geojson={type:"FeatureCollection",features:c},s.heatmap.layout.visibility="visible",s}}}),kq=Ze({"src/traces/densitymapbox/plot.js"(Z,q){"use strict";var v=Cq(),x=am().traceLayerPrefix;function A(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",x+t+"-heatmap"]],this.below=null}var M=A.prototype;M.update=function(e){var t=this.subplot,r=this.layerList,i=v(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var n=0;n<r.length;n++){var o=r[n],s=o[0],c=o[1],h=i[s];t.setOptions(c,"setLayoutProperty",h.layout),h.layout.visibility==="visible"&&t.setOptions(c,"setPaintProperty",h.paint)}},M._addLayers=function(e,t){for(var r=this.subplot,i=this.layerList,a=this.sourceId,n=0;n<i.length;n++){var o=i[n],s=o[0],c=e[s];r.addLayer({type:s,id:o[1],source:a,layout:c.layout,paint:c.paint},t)}},M._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=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;e<M.length;e++){var t=M[e],r=t.id;if(t.type==="symbol"&&typeof r=="string"&&r.indexOf("plotly-")===-1)return r}},moduleType:"trace",name:"densitymapbox",basePlotModule:MT(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}}),Rq=Ze({"lib/densitymapbox.js"(Z,q){"use strict";q.exports=Iq()}}),Dq=Ze({"src/plots/map/styles/arcgis-sat-hybrid.js"(Z,q){q.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},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 © <a href='http://www.esri.com'>ESRI</a>"},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 © <a href='http://www.esri.com'>ESRI</a>"},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 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> 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;P<E.length;P++){var N=E[P],U=N.lonlat;if(!_(U)){var W={};F&&(W.mcc=N.mcc=F(N.mc)),B&&(W.mrc=N.mrc=B(N.ms)),O&&(W.mo=O(N.mo)),p&&(W.selected=N.selected||0),I.push({type:"Feature",id:P+1,geometry:{type:"Point",coordinates:U},properties:W})}}var Q;if(p)for(Q=t.makeSelectedPointStyleFns(g),P=0;P<I.length;P++){var ue=I[P].properties;Q.selectedOpacityFn&&(ue.mo=L(Q.selectedOpacityFn(ue))),Q.selectedColorFn&&(ue.mcc=Q.selectedColorFn(ue)),Q.selectedSizeFn&&(ue.mrc=Q.selectedSizeFn(ue))}return{geojson:{type:"FeatureCollection",features:I},mcc:u||Q&&Q.selectedColorFn?{type:"identity",property:"mcc"}:b.color,mrc:y||Q&&Q.selectedSizeFn?{type:"identity",property:"mrc"}:z(b.size),mo:f||Q&&Q.selectedOpacityFn?{type:"identity",property:"mo"}:L(b.opacity)}}function d(E,g){for(var b=g._fullLayout,p=E[0].trace,u=p.marker||{},y=u.symbol,f=u.angle,P=y!=="circle"?T(y):l,L=f!=="auto"?T(f,!0):l,z=i.hasText(p)?T(p.text):l,F=[],B=0;B<E.length;B++){var O=E[B];if(!_(O.lonlat)){var I=p.texttemplate,N;if(I){var U=Array.isArray(I)?I[B]||"":I,W=p._module.formatLabels(O,p,b),Q={};o(Q,p,O.i);var ue=p._meta||{};N=x.texttemplateString(U,W,b._d3locale,Q,O,ue)}else N=z(B);N&&(N=N.replace(s,"").replace(c,`
|
||
`)),F.push({type:"Feature",geometry:{type:"Point",coordinates:O.lonlat},properties:{symbol:P(B),angle:L(B),text:N}})}}return{type:"FeatureCollection",features:F}}function T(E,g){return x.isArrayOrTypedArray(E)?g?function(b){return v(E[b])?+E[b]:0}:function(b){return E[b]}:E?function(){return E}:l}function l(){return""}function _(E){return E[0]===A}function w(E,g){var b;if(x.isArrayOrTypedArray(E)&&x.isArrayOrTypedArray(g)){b=["step",["get","point_count"],E[0]];for(var p=1;p<E.length;p++)b.push(g[p-1],E[p])}else b=E;return b}function S(E){var g=E.textfont,b=g.family,p=g.style,u=g.weight,y=b.split(" "),f=y[y.length-1]==="Italic";f&&y.pop(),f=f||p==="italic";var P=y.join(" ");u==="bold"&&y.indexOf("Bold")===-1?P+=" Bold":u<=1e3&&(y[0]==="Metropolis"?(P="Metropolis",u>850?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<c.length;h++)if(c[h].id===o){s=!0;break}s?(this.subplot.setOptions(o,"setLayoutProperty",n.layout),n.layout.visibility==="visible"&&this.subplot.setOptions(o,"setPaintProperty",n.paint)):this.subplot.addLayer(n,a)},t.update=function(i){var a=i[0].trace,n=this.subplot,o=n.map,s=x(n.gd,i),c=n.belowLookup["trace-"+this.uid],h=!!(a.cluster&&a.cluster.enabled),m=!!this.clusterEnabled,d=this;function T(u){u||d.addSource("circle",s.circle,a.cluster);for(var y=M.cluster,f=0;f<y.length;f++){var P=y[f],L=s[P];d.addLayer(P,L,c)}}function l(u){for(var y=M.cluster,f=y.length-1;f>=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<y.length;f++){var P=y[f],L=s[P];u||d.addSource(P,L),d.addLayer(P,L,c)}}function w(u){for(var y=M.nonCluster,f=y.length-1;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<u.length;y++){var f=u[y],P=s[f];P&&(n.setOptions(d.layerIds[f],"setLayoutProperty",P.layout),P.layout.visibility==="visible"&&(f!=="cluster"&&d.setSourceData(f,P),n.setOptions(d.layerIds[f],"setPaintProperty",P.paint)))}}var b=this.isHidden,p=a.visible!==!0;p?b||S():b?p||E():m!==h?(S(),E()):(this.below!==c&&(S(!0),E(!0)),g()),this.clusterEnabled=h,this.isHidden=p,this.below=c,i[0].trace._glTrace=this},t.dispose=function(){for(var i=this.subplot.map,a=this.clusterEnabled?M.cluster:M.nonCluster,n=a.length-1;n>=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<M.cluster.length;d++)T=M.cluster[d],l=h[T],c.addLayer(T,l,m);else for(d=0;d<M.nonCluster.length;d++)T=M.nonCluster[d],l=h[T],c.addSource(T,l,n.cluster),c.addLayer(T,l,m);return a[0].trace._glTrace=c,c}}}),CT=Ze({"src/traces/scattermap/hover.js"(Z,q){"use strict";var v=ef(),x=ca(),A=l1(),M=x.fillText,e=Vs().BADNUM,t=_g().traceLayerPrefix;function r(a,n,o){var s=a.cd,c=s[0].trace,h=a.xa,m=a.ya,d=a.subplot,T=[],l=t+c.uid+"-circle",_=c.cluster&&c.cluster.enabled;if(_){var w=d.map.queryRenderedFeatures(null,{layers:[l]});T=w.map(function(B){return B.id})}var S=n>=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("<br>")}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;s<r.length;s++)r[s].selected=0;else for(s=0;s<r.length;s++){var c=r[s],h=c.lonlat;if(h[0]!==A){var m=[v.modHalf(h[0],360),h[1]],d=[i.c2p(m),a.c2p(m)];t.contains(d,null,s,e)?(n.push({pointNumber:s,lon:h[0],lat:h[1]}),c.selected=1):c.selected=0}}return n}}}),jq=Ze({"node_modules/maplibre-gl/dist/maplibre-gl.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?q.exports=x():(v=typeof globalThis<"u"?globalThis:v||self,v.maplibregl=x())})(Z,function(){"use strict";var v={},x={};function A(e,t,r){if(x[e]=r,e==="index"){var i="var sharedModule = {}; ("+x.shared+")(sharedModule); ("+x.worker+")(sharedModule);",a={};return x.shared(a),x.index(v,a),typeof window<"u"&&v.setWorkerUrl(window.URL.createObjectURL(new Blob([i],{type:"text/javascript"}))),v}}A("shared",["exports"],function(e){"use strict";function t(G,D,K,pe){return new(K||(K=Promise))(function(ke,je){function Xe(Ut){try{Mt(pe.next(Ut))}catch(ir){je(ir)}}function ft(Ut){try{Mt(pe.throw(Ut))}catch(ir){je(ir)}}function Mt(Ut){var ir;Ut.done?ke(Ut.value):(ir=Ut.value,ir instanceof K?ir:new K(function(Mr){Mr(ir)})).then(Xe,ft)}Mt((pe=pe.apply(G,D||[])).next())})}function r(G){return G&&G.__esModule&&Object.prototype.hasOwnProperty.call(G,"default")?G.default:G}typeof SuppressedError=="function"&&SuppressedError;var i=a;function a(G,D){this.x=G,this.y=D}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(G){return this.clone()._add(G)},sub:function(G){return this.clone()._sub(G)},multByPoint:function(G){return this.clone()._multByPoint(G)},divByPoint:function(G){return this.clone()._divByPoint(G)},mult:function(G){return this.clone()._mult(G)},div:function(G){return this.clone()._div(G)},rotate:function(G){return this.clone()._rotate(G)},rotateAround:function(G,D){return this.clone()._rotateAround(G,D)},matMult:function(G){return this.clone()._matMult(G)},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(G){return this.x===G.x&&this.y===G.y},dist:function(G){return Math.sqrt(this.distSqr(G))},distSqr:function(G){var D=G.x-this.x,K=G.y-this.y;return D*D+K*K},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(G){return Math.atan2(this.y-G.y,this.x-G.x)},angleWith:function(G){return this.angleWithSep(G.x,G.y)},angleWithSep:function(G,D){return Math.atan2(this.x*D-this.y*G,this.x*G+this.y*D)},_matMult:function(G){var D=G[2]*this.x+G[3]*this.y;return this.x=G[0]*this.x+G[1]*this.y,this.y=D,this},_add:function(G){return this.x+=G.x,this.y+=G.y,this},_sub:function(G){return this.x-=G.x,this.y-=G.y,this},_mult:function(G){return this.x*=G,this.y*=G,this},_div:function(G){return this.x/=G,this.y/=G,this},_multByPoint:function(G){return this.x*=G.x,this.y*=G.y,this},_divByPoint:function(G){return this.x/=G.x,this.y/=G.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var G=this.y;return this.y=this.x,this.x=-G,this},_rotate:function(G){var D=Math.cos(G),K=Math.sin(G),pe=K*this.x+D*this.y;return this.x=D*this.x-K*this.y,this.y=pe,this},_rotateAround:function(G,D){var K=Math.cos(G),pe=Math.sin(G),ke=D.y+pe*(this.x-D.x)+K*(this.y-D.y);return this.x=D.x+K*(this.x-D.x)-pe*(this.y-D.y),this.y=ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(G){return G instanceof a?G:Array.isArray(G)?new a(G[0],G[1]):G};var n=r(i),o=s;function s(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}s.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)<D)return K;var je=this.sampleCurveDerivativeX(K);if(Math.abs(je)<1e-6)break;K-=ke/je}var Xe=0,ft=1;for(K=G,pe=0;pe<20&&(ke=this.sampleCurveX(K),!(Math.abs(ke-G)<D));pe++)G>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;Ut<Mt.length;Ut+=4){let ir=Mt[Ut];Mt[Ut]=Mt[Ut+2],Mt[Ut+2]=ir}return Mt}finally{je.close()}})}let I,N,U="AbortError";function W(){return new Error(U)}let Q={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ue(G){return Q.REGISTERED_PROTOCOLS[G.substring(0,G.indexOf("://"))]}let se="global-dispatcher";class he extends Error{constructor(D,K,pe,ke){super(`AJAXError: ${K} (${D}): ${pe}`),this.status=D,this.statusText=K,this.url=pe,this.body=ke}}let H=()=>L(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.length;K++)if(!Ae(G[K],D[K]))return!1;return!0}if(typeof G=="object"&&G!==null&&D!==null){if(typeof D!="object"||Object.keys(G).length!==Object.keys(D).length)return!1;for(let K in G)if(!Ae(G[K],D[K]))return!1;return!0}return G===D}function ze(G,D){G.push(D)}function Re(G,D,K){ze(K,{command:"addSource",args:[G,D[G]]})}function We(G,D,K){ze(D,{command:"removeSource",args:[G]}),K[G]=!0}function it(G,D,K,pe){We(G,K,pe),Re(G,D,K)}function ot(G,D,K){let pe;for(pe in G[K])if(Object.prototype.hasOwnProperty.call(G[K],pe)&&pe!=="data"&&!Ae(G[K][pe],D[K][pe]))return!1;for(pe in D[K])if(Object.prototype.hasOwnProperty.call(D[K],pe)&&pe!=="data"&&!Ae(G[K][pe],D[K][pe]))return!1;return!0}function tt(G,D,K,pe,ke,je){G=G||{},D=D||{};for(let Xe in G)Object.prototype.hasOwnProperty.call(G,Xe)&&(Ae(G[Xe],D[Xe])||K.push({command:je,args:[pe,Xe,D[Xe],ke]}));for(let Xe in D)Object.prototype.hasOwnProperty.call(D,Xe)&&!Object.prototype.hasOwnProperty.call(G,Xe)&&(Ae(G[Xe],D[Xe])||K.push({command:je,args:[pe,Xe,D[Xe],ke]}))}function ut(G){return G.id}function Me(G,D){return G[D.id]=D,G}class _e{constructor(D,K,pe,ke){this.message=(D?`${D}: `:"")+pe,ke&&(this.identifier=ke),K!=null&&K.__line__&&(this.line=K.__line__)}}function fe(G,...D){for(let K of D)for(let pe in K)G[pe]=K[pe];return G}class Fe extends Error{constructor(D,K){super(K),this.message=K,this.key=D}}class rt{constructor(D,K=[]){this.parent=D,this.bindings={};for(let[pe,ke]of K)this.bindings[pe]=ke}concat(D){return new rt(this,D)}get(D){if(this.bindings[D])return this.bindings[D];if(this.parent)return this.parent.get(D);throw new Error(`${D} not found in scope.`)}has(D){return!!this.bindings[D]||!!this.parent&&this.parent.has(D)}}let st={kind:"null"},Qe={kind:"number"},Lt={kind:"string"},kt={kind:"boolean"},qt={kind:"color"},Zt={kind:"object"},Sr={kind:"value"},xr={kind:"collator"},jr={kind:"formatted"},wr={kind:"padding"},Ir={kind:"resolvedImage"},bt={kind:"variableAnchorOffsetCollection"};function Be(G,D){return{kind:"array",itemType:G,N:D}}function Ke(G){if(G.kind==="array"){let D=Ke(G.itemType);return typeof G.N=="number"?`array<${D}, ${G.N}>`: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<D.length;K+=2){let pe=D[K],ke=D[K+1];if(typeof pe!="string"||!Ia.has(pe)||!Array.isArray(ke)||ke.length!==2||typeof ke[0]!="number"||typeof ke[1]!="number")return}return new Ha(D)}}toString(){return JSON.stringify(this.values)}}class rn{constructor(D){this.name=D.name,this.available=D.available}toString(){return this.name}static fromString(D){return D?new rn({name:D,available:!1}):null}}function nn(G,D,K,pe){return typeof G=="number"&&G>=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(;ke<D.length;ke++){let ft=K.parse(D[ke],ke,Sr);if(!ft)return null;Xe.push(ft)}return new Lr(pe,Xe)}evaluate(D){for(let K=0;K<this.args.length;K++){let pe=this.args[K].evaluate(D);if(!Ee(this.type,xt(pe)))return pe;if(K===this.args.length-1)throw new Or(`Expected value to be of type ${Ke(this.type)}, but found ${Ke(xt(pe))} instead.`)}throw new Error}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.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;Xe<D.length;Xe++){let ft=K.parse(D[Xe],Xe,Sr);if(!ft)return null;je.push(ft)}return new Kr(ke,je)}evaluate(D){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(D);case"color":{let K,pe;for(let ke of this.args){if(K=ke.evaluate(D),pe=null,K instanceof Wt)return K;if(typeof K=="string"){let je=D.parseColor(K);if(je)return je}else if(Array.isArray(K)&&(pe=K.length<3||K.length>4?`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<D.length-1;je+=2){let Xe=D[je];if(typeof Xe!="string")return K.error(`Expected string, but found ${typeof Xe} instead.`,je);if(/[^a-zA-Z0-9_]/.test(Xe))return K.error("Variable names must contain only alphanumeric characters or '_'.",je);let ft=K.parse(D[je+1],je+1);if(!ft)return null;pe.push([Xe,ft])}let ke=K.parse(D[D.length-1],D.length-1,K.expectedType,pe);return ke?new fa(pe,ke):null}outputDefined(){return this.result.outputDefined()}}class It{constructor(D,K){this.type=K.type,this.name=D,this.boundExpression=K}static parse(D,K){if(D.length!==2||typeof D[1]!="string")return K.error("'var' expression requires exactly one string literal argument.");let pe=D[1];return K.scope.has(pe)?new It(pe,K.scope.get(pe)):K.error(`Unknown variable "${pe}". Make sure "${pe}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(D){return this.boundExpression.evaluate(D)}eachChild(){}outputDefined(){return!1}}class dr{constructor(D,K,pe){this.type=D,this.index=K,this.input=pe}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,Qe),ke=K.parse(D[2],2,Be(K.expectedType||Sr));return pe&&ke?new dr(ke.type.itemType,pe,ke):null}evaluate(D){let K=this.index.evaluate(D),pe=this.input.evaluate(D);if(K<0)throw new Or(`Array index out of bounds: ${K} < 0.`);if(K>=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;Ut<D.length-1;Ut+=2){let ir=D[Ut],Mr=D[Ut+1];Array.isArray(ir)||(ir=[ir]);let zr=K.concat(Ut);if(ir.length===0)return zr.error("Expected at least one branch label.");for(let oa of ir){if(typeof oa!="number"&&typeof oa!="string")return zr.error("Branch labels must be numbers or strings.");if(typeof oa=="number"&&Math.abs(oa)>Number.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;Xe<D.length-1;Xe+=2){let ft=K.parse(D[Xe],Xe,kt);if(!ft)return null;let Mt=K.parse(D[Xe+1],Xe+1,pe);if(!Mt)return null;ke.push([ft,Mt]),pe=pe||Mt.type}let je=K.parse(D[D.length-1],D.length-1,pe);if(!je)return null;if(!pe)throw new Error("Can't infer output type");return new Fa(pe,ke,je)}evaluate(D){for(let[K,pe]of this.branches)if(K.evaluate(D))return pe.evaluate(D);return this.otherwise.evaluate(D)}eachChild(D){for(let[K,pe]of this.branches)D(K),D(pe);D(this.otherwise)}outputDefined(){return this.branches.every(([D,K])=>K.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||D<ke)return ft;je=ft+1}else{if(!(pe>D))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<D.length;Xe+=2){let ft=Xe===1?-1/0:D[Xe],Mt=D[Xe+1],Ut=Xe,ir=Xe+1;if(typeof ft!="number")return K.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Ut);if(ke.length&&ke[ke.length-1][0]>=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)<D)return K;var je=this.sampleCurveDerivativeX(K);if(Math.abs(je)<1e-6)break;K-=ke/je}var Xe=0,ft=1;for(K=G,pe=0;pe<20&&(ke=this.sampleCurveX(K),!(Math.abs(ke-G)<D));pe++)G>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:Mt<ke&&ke-Mt>180&&(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;Xe<pe.length;Xe+=2){if(pe[Xe]!==ke[Xe])throw new Or(`Cannot interpolate values containing mismatched anchors. from[${Xe}]: ${pe[Xe]}, to[${Xe}]: ${ke[Xe]}`);je.push(pe[Xe]);let[ft,Mt]=pe[Xe+1],[Ut,ir]=ke[Xe+1];je.push([ki(ft,Ut,K),ki(Mt,ir,K)])}return new Ha(je)}};class to{constructor(D,K,pe,ke,je){this.type=D,this.operator=K,this.interpolation=pe,this.input=ke,this.labels=[],this.outputs=[];for(let[Xe,ft]of je)this.labels.push(Xe),this.outputs.push(ft)}static interpolationFactor(D,K,pe,ke){let je=0;if(D.name==="exponential")je=go(K,D.base,pe,ke);else if(D.name==="linear")je=go(K,1,pe,ke);else if(D.name==="cubic-bezier"){let Xe=D.controlPoints;je=new Ai(Xe[0],Xe[1],Xe[2],Xe[3]).solve(go(K,1,pe,ke))}return je}static parse(D,K){let[pe,ke,je,...Xe]=D;if(!Array.isArray(ke)||ke.length===0)return K.error("Expected an interpolation type expression.",1);if(ke[0]==="linear")ke={name:"linear"};else if(ke[0]==="exponential"){let Ut=ke[1];if(typeof Ut!="number")return K.error("Exponential interpolation requires a numeric base.",1,1);ke={name:"exponential",base:Ut}}else{if(ke[0]!=="cubic-bezier")return K.error(`Unknown interpolation type ${String(ke[0])}`,1,0);{let Ut=ke.slice(1);if(Ut.length!==4||Ut.some(ir=>typeof 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<Xe.length;Ut+=2){let ir=Xe[Ut],Mr=Xe[Ut+1],zr=Ut+3,Hr=Ut+4;if(typeof ir!="number")return K.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',zr);if(ft.length&&ft[ft.length-1][0]>=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<K},function(G,D,K,pe){return pe.compare(D,K)<0}),To=Ts(">",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<pe.length-1;++ke)if($s(G,D,pe[ke],pe[ke+1]))return!0;return!1}function Is(G,D,K=!1){let pe=!1;for(let ft of D)for(let Mt=0;Mt<ft.length-1;Mt++){if(uo(G,ft[Mt],ft[Mt+1]))return K;(je=ft[Mt])[1]>(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;K<G.length-1;++K)if(ms(G[K],G[K+1],D))return!1;return!0}function po(G,D){for(let K of D)if(Si(G,K))return!0;return!1}function ro(G,D,K,pe){let ke=pe[0]-K[0],je=pe[1]-K[1],Xe=(G[0]-K[0])*je-ke*(G[1]-K[1]),ft=(D[0]-K[0])*je-ke*(D[1]-K[1]);return Xe>0&&ft<0||Xe<0&&ft>0}function As(G,D,K){let pe=[];for(let ke=0;ke<G.length;ke++){let je=[];for(let Xe=0;Xe<G[ke].length;Xe++){let ft=jn(G[ke][Xe],K);tl(D,ft),je.push(ft)}pe.push(je)}return pe}function al(G,D,K){let pe=[];for(let ke=0;ke<G.length;ke++){let je=As(G[ke],D,K);pe.push(je)}return pe}function $i(G,D,K,pe){if(G[0]<K[0]||G[0]>K[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)=>K<pe?-1:K>pe?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<pe;){let je=1+(G<<1),Xe=je+1;if(Xe<this.length&&K(D[Xe],D[je])<0&&(je=Xe),K(D[je],ke)>=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);Mr<zr;){for(nu(G,Mr,zr),Mr++,zr--;ke(G[Mr],ir)<0;)Mr++;for(;ke(G[zr],ir)>0;)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 G<D?-1:G>D?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;je<K.length;je++)K[je].length<=D||(zl(K[je],D,1,K[je].length-1,Cu),K[je]=K[je].slice(0,D));return K}function Cu(G,D){return D.area-G.area}function Af(G){let D=0;for(let K,pe,ke=0,je=G.length,Xe=je-1;ke<je;Xe=ke++)K=G[ke],pe=G[Xe],D+=(pe.x-K.x)*(K.y+pe.y);return D}let pf=1/298.257223563,Us=pf*(2-pf),qc=Math.PI/180;class Sf{constructor(D){let K=6378.137*qc*1e3,pe=Math.cos(D*qc),ke=1/(1-Us*(1-pe*pe)),je=Math.sqrt(ke);this.kx=K*je*pe,this.ky=K*je*ke*(1-Us)}distance(D,K){let pe=this.wrap(D[0]-K[0])*this.kx,ke=(D[1]-K[1])*this.ky;return Math.sqrt(pe*pe+ke*ke)}pointOnLine(D,K){let pe,ke,je,Xe,ft=1/0;for(let Mt=0;Mt<D.length-1;Mt++){let Ut=D[Mt][0],ir=D[Mt][1],Mr=this.wrap(D[Mt+1][0]-Ut)*this.kx,zr=(D[Mt+1][1]-ir)*this.ky,Hr=0;Mr===0&&zr===0||(Hr=(this.wrap(K[0]-Ut)*this.kx*Mr+(K[1]-ir)*this.ky*zr)/(Mr*Mr+zr*zr),Hr>1?(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;oa<ft&&(ft=oa,pe=Ut,ke=ir,je=Mt,Xe=Hr)}return{point:[pe,ke],index:je,t:Math.max(0,Math.min(1,Xe))}}wrap(D){for(;D<-180;)D+=360;for(;D>180;)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]<D}function Ou(G,D){if(G[0]>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[0]&&(pe=D[0]-G[2]),G[0]>D[2]&&(pe=G[0]-D[2]),G[1]>D[3]&&(ke=G[1]-D[3]),G[3]<D[1]&&(ke=D[1]-G[3]),K.distance([0,0],[pe,ke])}function ic(G,D,K){let pe=K.pointOnLine(D,G);return K.distance(G,pe.point)}function Nl(G,D,K,pe,ke){let je=Math.min(ic(G,[K,pe],ke),ic(D,[K,pe],ke)),Xe=Math.min(ic(K,[G,D],ke),ic(pe,[G,D],ke));return Math.min(je,Xe)}function Vu(G,D,K,pe,ke){if(!nc(D,G.length)||!nc(pe,K.length))return 1/0;let je=1/0;for(let Xe=D[0];Xe<D[1];++Xe){let ft=G[Xe],Mt=G[Xe+1];for(let Ut=pe[0];Ut<pe[1];++Ut){let ir=K[Ut],Mr=K[Ut+1];if($s(ft,Mt,ir,Mr))return 0;je=Math.min(je,Nl(ft,Mt,ir,Mr,ke))}}return je}function cl(G,D,K,pe,ke){if(!nc(D,G.length)||!nc(pe,K.length))return NaN;let je=1/0;for(let Xe=D[0];Xe<=D[1];++Xe)for(let ft=pe[0];ft<=pe[1];++ft)if(je=Math.min(je,ke.distance(G[Xe],K[ft])),je===0)return je;return je}function yh(G,D,K){if(Is(G,D,!0))return 0;let pe=1/0;for(let ke of D){let je=ke[0],Xe=ke[ke.length-1];if(je!==Xe&&(pe=Math.min(pe,ic(G,[Xe,je],K)),pe===0))return pe;let ft=K.pointOnLine(ke,G);if(pe=Math.min(pe,K.distance(G,ft.point)),pe===0)return pe}return pe}function ls(G,D,K,pe){if(!nc(D,G.length))return NaN;for(let je=D[0];je<=D[1];++je)if(Is(G[je],K,!0))return 0;let ke=1/0;for(let je=D[0];je<D[1];++je){let Xe=G[je],ft=G[je+1];for(let Mt of K)for(let Ut=0,ir=Mt.length,Mr=ir-1;Ut<ir;Mr=Ut++){let zr=Mt[Mr],Hr=Mt[Ut];if($s(Xe,ft,zr,Hr))return 0;ke=Math.min(ke,Nl(Xe,ft,zr,Hr,pe))}}return ke}function _h(G,D){for(let K of G)for(let pe of K)if(Is(pe,D,!0))return!0;return!1}function Ss(G,D,K,pe=1/0){let ke=vl(G),je=vl(D);if(pe!==1/0&&qs(ke,je,K)>=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;Mt<Ut;ir=Mt++){let Mr=ft[ir],zr=ft[Mt];for(let Hr of D)for(let oa=0,va=Hr.length,Ga=va-1;oa<va;Ga=oa++){let $a=Hr[Ga],Kn=Hr[oa];if($s(Mr,zr,$a,Kn))return 0;Xe=Math.min(Xe,Nl(Mr,zr,$a,Kn,K))}}return Xe}function Qi(G,D,K,pe,ke,je){if(!je)return;let Xe=qs(nl(pe,je),ke,K);Xe<D&&G.push([Xe,je,[0,0]])}function Gc(G,D,K,pe,ke,je,Xe){if(!je||!Xe)return;let ft=qs(nl(pe,je),nl(ke,Xe),K);ft<D&&G.push([ft,je,Xe])}function qu(G,D,K,pe,ke=1/0){let je=Math.min(pe.distance(G[0],K[0][0]),ke);if(je===0)return je;let Xe=new xu([[0,[0,G.length-1],[0,0]]],iu),ft=vl(K);for(;Xe.length>0;){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<D.length;Hr++){let oa=D[Hr],va=Array.isArray(Ut)?Ut[Hr-1]:Ut.type,Ga=Mt.parse(oa,1+Mr.length,va);if(!Ga){zr=!0;break}Mr.push(Ga)}if(!zr)if(Array.isArray(Ut)&&Ut.length!==Mr.length)Mt.error(`Expected ${Ut.length} arguments, but found ${Mr.length} instead.`);else{for(let Hr=0;Hr<Mr.length;Hr++){let oa=Array.isArray(Ut)?Ut[Hr]:Ut.type,va=Mr[Hr];Mt.concat(Hr+1).checkSubtype(oa,va.type)}if(Mt.errors.length===0)return new Kl(pe,je,ir,Mr)}}if(ft.length===1)K.errors.push(...Mt.errors);else{let Ut=(ft.length?ft:Xe).map(([Mr])=>{return zr=Mr,Array.isArray(zr)?`(${zr.map(Ke).join(", ")})`:`(${Ke(zr.type)}...)`;var zr}).join(" | "),ir=[];for(let Mr=1;Mr<D.length;Mr++){let zr=K.parse(D[Mr],1+ir.length);if(!zr)return null;ir.push(Ke(zr.type))}K.error(`Expected arguments of type ${Ut}, but found (${ir.join(", ")}) instead.`)}return null}static register(D,K){Kl.definitions=K;for(let pe in K)D[pe]=Kl}}function Yf(G,[D,K,pe,ke]){D=D.evaluate(G),K=K.evaluate(G),pe=pe.evaluate(G);let je=ke?ke.evaluate(G):1,Xe=nn(D,K,pe,je);if(Xe)throw new Or(Xe);return new Wt(D/255,K/255,pe/255,je,!1)}function zf(G,D){return G in D}function af(G,D){let K=D[G];return K===void 0?null:K}function Nc(G){return{type:G}}function Ff(G){if(G instanceof It)return Ff(G.boundExpression);if(G instanceof Kl&&G.name==="error"||G instanceof lo||G instanceof fl||G instanceof wc)return!1;let D=G instanceof Kr||G instanceof Lr,K=!0;return G.eachChild(pe=>{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;oa<G.stops.length;oa++){let va=G.stops[oa],Ga=va[0].zoom;ir[Ga]===void 0&&(ir[Ga]={zoom:Ga,type:G.type,property:G.property,default:G.default,stops:[]},Mr.push(Ga)),ir[Ga].stops.push([va[0].value,va[1]])}let zr=[];for(let oa of Mr)zr.push([ir[oa].zoom,Bf(ir[oa],D)]);let Hr={name:"linear"};return{kind:"composite",interpolationType:Hr,interpolationFactor:to.interpolationFactor.bind(void 0,Hr),zoomStops:zr.map(oa=>oa[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<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->=":[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 G<D?-1:G>D?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<G.length;D++)if(Lh(G[D]))return!0;return!1}function nf(G){if(!G)return!0;let D=G[0];return G.length<=1?D!=="any":D==="=="?df(G[1],G[2],"=="):D==="!="?tu(df(G[1],G[2],"==")):D==="<"||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;ke<K.length;ke++)pe+=`${JSON.stringify(K[ke])}:${Xc(G[K[ke]])},`;return`${pe}}`}function uh(G){let D="";for(let K of ce)D+=`/${Xc(G[K])}`;return D}function vf(G){let D=G.value;return D?[new _e(G.key,D,"constants have been deprecated as of v8")]:[]}function ol(G){return G instanceof Number||G instanceof String||G instanceof Boolean?G.valueOf():G}function mu(G){if(Array.isArray(G))return G.map(mu);if(G instanceof Object&&!(G instanceof Number||G instanceof String||G instanceof Boolean)){let D={};for(let K in G)D[K]=mu(G[K]);return D}return ol(G)}function Pu(G){let D=G.key,K=G.value,pe=G.valueSpec||{},ke=G.objectElementValidators||{},je=G.style,Xe=G.styleSpec,ft=G.validateSpec,Mt=[],Ut=Gs(K);if(Ut!=="object")return[new _e(D,K,`object expected, ${Ut} found`)];for(let ir in K){let Mr=ir.split(".")[0],zr=pe[Mr]||pe["*"],Hr;if(ke[Mr])Hr=ke[Mr];else if(pe[Mr])Hr=ft;else if(ke["*"])Hr=ke["*"];else{if(!pe["*"]){Mt.push(new _e(D,K[ir],`unknown property "${ir}"`));continue}Hr=ft}Mt=Mt.concat(Hr({key:(D&&`${D}.`)+ir,value:K[ir],valueSpec:zr,style:je,styleSpec:Xe,object:K,objectKey:ir,validateSpec:ft},K))}for(let ir in pe)ke[ir]||pe[ir].required&&pe[ir].default===void 0&&K[ir]===void 0&&Mt.push(new _e(D,K,`missing required property "${ir}"`));return Mt}function kf(G){let D=G.value,K=G.valueSpec,pe=G.style,ke=G.styleSpec,je=G.key,Xe=G.arrayElementValidator||G.validateSpec;if(Gs(D)!=="array")return[new _e(je,D,`array expected, ${Gs(D)} found`)];if(K.length&&D.length!==K.length)return[new _e(je,D,`array length ${K.length} expected, length ${D.length} found`)];if(K["min-length"]&&D.length<K["min-length"])return[new _e(je,D,`array length at least ${K["min-length"]} expected, length ${D.length} found`)];let ft={type:K.value,values:K.values};ke.$version<7&&(ft.function=K.function),Gs(K.value)==="object"&&(ft=K.value);let Mt=[];for(let Ut=0;Ut<D.length;Ut++)Mt=Mt.concat(Xe({array:D,arrayIndex:Ut,value:D[Ut],valueSpec:ft,validateSpec:G.validateSpec,style:pe,styleSpec:ke,key:`${je}[${Ut}]`}));return Mt}function hl(G){let D=G.key,K=G.value,pe=G.valueSpec,ke=Gs(K);return ke==="number"&&K!=K&&(ke="NaN"),ke!=="number"?[new _e(D,K,`number expected, ${ke} found`)]:"minimum"in pe&&K<pe.minimum?[new _e(D,K,`${K} is less than the minimum value ${pe.minimum}`)]:"maximum"in pe&&K>pe.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&&Ga<ke?[new _e(Hr.key,$a,"stop domain values must appear in ascending order")]:(ke=Ga,K==="categorical"&&Ga in Xe?[new _e(Hr.key,$a,"stop domain values must be unique")]:(Xe[Ga]=!0,[])):[new _e(Hr.key,$a,`integer expected, found ${Ga}`)]}}function Mc(G){let D=(G.expressionContext==="property"?bu:il)(mu(G.value),G.valueSpec);if(D.result==="error")return D.value.map(pe=>new _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<D.length;Xe++)ke=Gs(D[Xe]),ol(D[1])==="$type"?je=je.concat(Hu({key:`${K}[${Xe}]`,value:D[Xe],valueSpec:pe.geometry_type,style:G.style,styleSpec:G.styleSpec})):ke!=="string"&&ke!=="number"&&ke!=="boolean"&&je.push(new _e(`${K}[${Xe}]`,D[Xe],`string, number, or boolean expected, ${ke} found`));break;case"any":case"all":case"none":for(let Xe=1;Xe<D.length;Xe++)je=je.concat(Wu({key:`${K}[${Xe}]`,value:D[Xe],style:G.style,styleSpec:G.styleSpec}));break;case"has":case"!has":ke=Gs(D[1]),D.length!==2?je.push(new _e(K,D,`filter array for "${D[0]}" operator must have 2 elements`)):ke!=="string"&&je.push(new _e(`${K}[1]`,D[1],`string expected, ${ke} found`))}return je}function Zc(G,D){let K=G.key,pe=G.validateSpec,ke=G.style,je=G.styleSpec,Xe=G.value,ft=G.objectKey,Mt=je[`${D}_${G.layerType}`];if(!Mt)return[];let Ut=ft.match(/^(.*)-transition$/);if(D==="paint"&&Ut&&Mt[Ut[1]]&&Mt[Ut[1]].transition)return pe({key:K,value:Xe,valueSpec:je.transition,style:ke,styleSpec:je});let ir=G.valueSpec||Mt[ft];if(!ir)return[new _e(K,Xe,`unknown property "${ft}"`)];let Mr;if(Gs(Xe)==="string"&&Jl(ir)&&!ir.tokens&&(Mr=/^{([^}]+)}$/.exec(Xe)))return[new _e(K,Xe,`"${ft}" does not support interpolation syntax
|
||
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Mr[1])} }\`.`)];let zr=[];return G.layerType==="symbol"&&(ft==="text-field"&&ke&&!ke.glyphs&&zr.push(new _e(K,Xe,'use of "text-field" requires a style "glyphs" property')),ft==="text-font"&&Cf(mu(Xe))&&ol(Xe.type)==="identity"&&zr.push(new _e(K,Xe,'"text-font" does not support identity functions'))),zr.concat(pe({key:G.key,value:Xe,valueSpec:ir,style:ke,styleSpec:je,expressionContext:"property",propertyType:D,propertyKey:ft}))}function Lf(G){return Zc(G,"paint")}function ru(G){return Zc(G,"layout")}function jf(G){let D=[],K=G.value,pe=G.key,ke=G.style,je=G.styleSpec;K.type||K.ref||D.push(new _e(pe,K,'either "type" or "ref" is required'));let Xe=ol(K.type),ft=ol(K.ref);if(K.id){let Mt=ol(K.id);for(let Ut=0;Ut<G.arrayIndex;Ut++){let ir=ke.layers[Ut];ol(ir.id)===Mt&&D.push(new _e(pe,K.id,`duplicate layer id "${K.id}", previously used at line ${ir.id.__line__}`))}}if("ref"in K){let Mt;["type","source","source-layer","filter","layout"].forEach(Ut=>{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<K.length;je++)ke=ke.concat(G.validateSpec({key:`${D}[${je}]`,value:K[je],validateSpec:G.validateSpec,valueSpec:pe}));return ke}return hl({key:D,value:K,valueSpec:{}})},variableAnchorOffsetCollection:function(G){let D=G.key,K=G.value,pe=Gs(K),ke=G.styleSpec;if(pe!=="array"||K.length<1||K.length%2!=0)return[new _e(D,K,"variableAnchorOffsetCollection requires a non-empty array of even length")];let je=[];for(let Xe=0;Xe<K.length;Xe+=2)je=je.concat(Hu({key:`${D}[${Xe}]`,value:K[Xe],valueSpec:ke.layout_symbol["text-anchor"]})),je=je.concat(kf({key:`${D}[${Xe+1}]`,value:K[Xe+1],valueSpec:{length:2,value:"number"},validateSpec:G.validateSpec,style:G.style,styleSpec:ke}));return je},sprite:Yc};function kc(G){let D=G.value,K=G.valueSpec,pe=G.styleSpec;return G.validateSpec=kc,K.expression&&Cf(ol(D))?sf(G):K.expression&&Ac(mu(D))?Mc(G):K.type&&sc[K.type]?sc[K.type](G):Pu(fe({},G,{valueSpec:K.type?pe[K.type]:K}))}function er(G){let D=G.value,K=G.key,pe=Xu(G);return pe.length||(D.indexOf("{fontstack}")===-1&&pe.push(new _e(K,D,'"glyphs" url must include a "{fontstack}" token')),D.indexOf("{range}")===-1&&pe.push(new _e(K,D,'"glyphs" url must include a "{range}" token'))),pe}function yr(G,D=re){let K=[];return K=K.concat(kc({key:"",value:G,valueSpec:D.$root,styleSpec:D,style:G,validateSpec:kc,objectElementValidators:{glyphs:er,"*":()=>[]}})),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<this.d*this.d;Mt++){let Ut=Xe[3+Mt],ir=Xe[3+Mt+1];ke.push(Ut===ir?null:Xe.subarray(Ut,ir))}let ft=Xe[3+ke.length+1];this.keys=Xe.subarray(Xe[3+ke.length],ft),this.bboxes=Xe.subarray(ft),this.insert=this._insertReadonly}else{this.d=K+2*pe;for(let Xe=0;Xe<this.d*this.d;Xe++)ke.push([]);this.keys=[],this.bboxes=[]}this.n=K,this.extent=D,this.padding=pe,this.scale=K/D,this.uid=0;let je=pe/K*D;this.min=-je,this.max=D+je}insert(D,K,pe,ke,je){this._forEachCell(K,pe,ke,je,this._insertCell,this.uid++,void 0,void 0),this.keys.push(D),this.bboxes.push(K),this.bboxes.push(pe),this.bboxes.push(ke),this.bboxes.push(je)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(D,K,pe,ke,je,Xe){this.cells[je].push(Xe)}query(D,K,pe,ke,je){let Xe=this.min,ft=this.max;if(D<=Xe&&K<=Xe&&ft<=pe&&ft<=ke&&!je)return Array.prototype.slice.call(this.keys);{let Mt=[];return this._forEachCell(D,K,pe,ke,this._queryCell,Mt,{},je),Mt}}_queryCell(D,K,pe,ke,je,Xe,ft,Mt){let Ut=this.cells[je];if(Ut!==null){let ir=this.keys,Mr=this.bboxes;for(let zr=0;zr<Ut.length;zr++){let Hr=Ut[zr];if(ft[Hr]===void 0){let oa=4*Hr;(Mt?Mt(Mr[oa+0],Mr[oa+1],Mr[oa+2],Mr[oa+3]):D<=Mr[oa+2]&&K<=Mr[oa+3]&&pe>=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<this.cells.length;Xe++)pe+=this.cells[Xe].length;let ke=new Int32Array(K+pe+this.keys.length+this.bboxes.length);ke[0]=this.extent,ke[1]=this.n,ke[2]=this.padding;let je=K;for(let Xe=0;Xe<D.length;Xe++){let ft=D[Xe];ke[3+Xe]=je,ke.set(ft,je),je+=ft.length}return ke[3+D.length]=je,ke.set(this.keys,je),je+=this.keys.length,ke[3+D.length+1]=je,ke.set(this.bboxes,je),je+=this.bboxes.length,ke.buffer}static serialize(D,K){let pe=D.toArrayBuffer();return K&&K.push(pe),{buffer:pe}}static deserialize(D){return new On(D.buffer)}}let qn={};function xn(G,D,K={}){if(qn[G])throw new Error(`${G} is already registered.`);Object.defineProperty(D,"_classRegistryKey",{value:G,writeable:!1}),qn[G]={klass:D,omit:K.omit||[],shallow:K.shallow||[]}}xn("Object",Object),xn("TransferableGridIndex",On),xn("Color",Wt),xn("Error",Error),xn("AJAXError",he),xn("ResolvedImage",rn),xn("StylePropertyFunction",Ml),xn("StyleExpression",Lu,{omit:["_evaluator"]}),xn("ZoomDependentExpression",vu),xn("ZoomConstantExpression",dc),xn("CompoundExpression",Kl,{omit:["_evaluate"]});for(let G in rf)rf[G]._classRegistryKey||xn(`Expression_${G}`,rf[G]);function Mi(G){return G&&typeof ArrayBuffer<"u"&&(G instanceof ArrayBuffer||G.constructor&&G.constructor.name==="ArrayBuffer")}function Ki(G){return G.$name||G.constructor._classRegistryKey}function ao(G){return!function(D){if(D===null||typeof D!="object")return!1;let K=Ki(D);return!(!K||K==="Object")}(G)&&(G==null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||G instanceof Boolean||G instanceof Number||G instanceof String||G instanceof Date||G instanceof RegExp||G instanceof Blob||G instanceof Error||Mi(G)||F(G)||ArrayBuffer.isView(G)||G instanceof ImageData)}function Ji(G,D){if(ao(G))return(Mi(G)||F(G))&&D&&D.push(G),ArrayBuffer.isView(G)&&D&&D.push(G.buffer),G instanceof ImageData&&D&&D.push(G.data.buffer),G;if(Array.isArray(G)){let je=[];for(let Xe of G)je.push(Ji(Xe,D));return je}if(typeof G!="object")throw new Error("can't serialize object of type "+typeof G);let K=Ki(G);if(!K)throw new Error(`can't serialize object of unregistered class ${G.constructor.name}`);if(!qn[K])throw new Error(`${K} is not registered.`);let{klass:pe}=qn[K],ke=pe.serialize?pe.serialize(G,D):{};if(pe.serialize){if(D&&ke===D[D.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let je in G){if(!G.hasOwnProperty(je)||qn[K].omit.indexOf(je)>=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.lastFloorZoom<pe&&(this.lastIntegerZoom=pe,this.lastIntegerZoomTime=K),D!==this.lastZoom&&(this.lastZoom=D,this.lastFloorZoom=pe,!0))}}let ui={"Latin-1 Supplement":G=>G>=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<this.begin)return Xe.possiblyEvaluate(D,K,pe);{let ft=(ke-this.begin)/(this.end-this.begin);return this.property.interpolate(Xe.possiblyEvaluate(D,K,pe),je,function(Mt){if(Mt<=0)return 0;if(Mt>=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.minzoom)||!!(this.maxzoom&&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<pe;)Mt=255&G.charCodeAt(Ut)|(255&G.charCodeAt(++Ut))<<8|(255&G.charCodeAt(++Ut))<<16|(255&G.charCodeAt(++Ut))<<24,++Ut,ke=27492+(65535&(je=5*(65535&(ke=(ke^=Mt=(65535&(Mt=(Mt=(65535&Mt)*Xe+(((Mt>>>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<ke;){let Xe=pe+ke>>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<pe;){let ke=G[K+pe>>1],je=K-1,Xe=pe+1;for(;;){do je++;while(G[je]<ke);do Xe--;while(G[Xe]>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<pe-Xe?(Ka(G,D,K,Xe),K=Xe+1):(Ka(G,D,Xe+1,pe),pe=Xe)}}function mn(G,D,K){let pe=G[D];G[D]=G[K],G[K]=pe}xn("FeaturePositionMap",Ma);class cn{constructor(D,K){this.gl=D.gl,this.location=K}}class Pa extends cn{constructor(D,K){super(D,K),this.current=0}set(D){this.current!==D&&(this.current=D,this.gl.uniform1f(this.location,D))}}class si extends cn{constructor(D,K){super(D,K),this.current=[0,0,0,0]}set(D){D[0]===this.current[0]&&D[1]===this.current[1]&&D[2]===this.current[2]&&D[3]===this.current[3]||(this.current=D,this.gl.uniform4f(this.location,D[0],D[1],D[2],D[3]))}}class ni extends cn{constructor(D,K){super(D,K),this.current=Wt.transparent}set(D){D.r===this.current.r&&D.g===this.current.g&&D.b===this.current.b&&D.a===this.current.a||(this.current=D,this.gl.uniform4f(this.location,D.r,D.g,D.b,D.a))}}let vi=new Float32Array(16);function Pi(G){return[ar(255*G.r,255*G.g),ar(255*G.b,255*G.a)]}class Zi{constructor(D,K,pe){this.value=D,this.uniformNames=K.map(ke=>`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<K;je++)this.paintVertexArray.emplace(je,ke[0],ke[1])}else{for(let ke=D;ke<K;ke++)this.paintVertexArray.emplace(ke,pe);this.maxValue=Math.max(this.maxValue,Math.abs(pe))}}upload(D){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=D.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class no{constructor(D,K,pe,ke,je,Xe){this.expression=D,this.uniformNames=K.map(ft=>`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<K;ft++)this.paintVertexArray.emplace(ft,je[0],je[1],Xe[0],Xe[1])}else{for(let je=D;je<K;je++)this.paintVertexArray.emplace(je,pe,ke);this.maxValue=Math.max(this.maxValue,Math.abs(pe),Math.abs(ke))}}upload(D){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=D.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(D,K){let pe=this.useIntegerZoom?Math.floor(K.zoom):K.zoom,ke=w(this.expression.interpolationFactor(pe,this.zoom,this.zoom+1),0,1);D.set(ke)}getBinding(D,K,pe){return new Pa(D,K)}}class Zo{constructor(D,K,pe,ke,je,Xe){this.expression=D,this.type=K,this.useIntegerZoom=pe,this.zoom=ke,this.layerId=Xe,this.zoomInPaintVertexArray=new je,this.zoomOutPaintVertexArray=new je}populatePaintArray(D,K,pe){let ke=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(D),this.zoomOutPaintVertexArray.resize(D),this._setPaintValues(ke,D,K.patterns&&K.patterns[this.layerId],pe)}updatePaintArray(D,K,pe,ke,je){this._setPaintValues(D,K,pe.patterns&&pe.patterns[this.layerId],je)}_setPaintValues(D,K,pe,ke){if(!ke||!pe)return;let{min:je,mid:Xe,max:ft}=pe,Mt=ke[je],Ut=ke[Xe],ir=ke[ft];if(Mt&&Ut&&ir)for(let Mr=D;Mr<K;Mr++)this.zoomInPaintVertexArray.emplace(Mr,Ut.tl[0],Ut.tl[1],Ut.br[0],Ut.br[1],Mt.tl[0],Mt.tl[1],Mt.br[0],Mt.br[1],Ut.pixelRatio,Mt.pixelRatio),this.zoomOutPaintVertexArray.emplace(Mr,Ut.tl[0],Ut.tl[1],Ut.br[0],Ut.br[1],ir.tl[0],ir.tl[1],ir.br[0],ir.br[1],Ut.pixelRatio,ir.pixelRatio)}upload(D){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=D.createVertexBuffer(this.zoomInPaintVertexArray,zt.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=D.createVertexBuffer(this.zoomOutPaintVertexArray,zt.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class ul{constructor(D,K,pe){this.binders={},this._buffers=[];let ke=[];for(let je in D.paint._values){if(!pe(je))continue;let Xe=D.paint.get(je);if(!(Xe instanceof wu&&Jl(Xe.property.specification)))continue;let ft=_l(je,D.type),Mt=Xe.value,Ut=Xe.property.specification.type,ir=Xe.property.useIntegerZoom,Mr=Xe.property.specification["property-type"],zr=Mr==="cross-faded"||Mr==="cross-faded-data-driven";if(Mt.kind==="constant")this.binders[je]=zr?new eo(Mt.value,ft):new Zi(Mt.value,ft,Ut),ke.push(`/u_${je}`);else if(Mt.kind==="source"||zr){let Hr=gi(je,Ut,"source");this.binders[je]=zr?new Zo(Mt,Ut,ir,K,Hr,D.id):new $o(Mt,ft,Ut,Hr),ke.push(`/a_${je}`)}else{let Hr=gi(je,Ut,"composite");this.binders[je]=new no(Mt,ft,Ut,ir,K,Hr),ke.push(`/z_${je}`)}}this.cacheKey=ke.sort().join("")}getMaxValue(D){let K=this.binders[D];return K instanceof $o||K instanceof no?K.maxValue:0}populatePaintArrays(D,K,pe,ke,je){for(let Xe in this.binders){let ft=this.binders[Xe];(ft instanceof $o||ft instanceof no||ft instanceof Zo)&&ft.populatePaintArray(D,K,pe,ke,je)}}setConstantPatternPositions(D,K){for(let pe in this.binders){let ke=this.binders[pe];ke instanceof eo&&ke.setConstantPatternPositions(D,K)}}updatePaintArrays(D,K,pe,ke,je){let Xe=!1;for(let ft in D){let Mt=K.getPositions(ft);for(let Ut of Mt){let ir=pe.feature(Ut.index);for(let Mr in this.binders){let zr=this.binders[Mr];if((zr instanceof $o||zr instanceof no||zr instanceof Zo)&&zr.expression.isStateDependent===!0){let Hr=ke.paint.get(Mr);zr.expression=Hr.value,zr.updatePaintArray(Ut.start,Ut.end,ir,D[ft],je),Xe=!0}}}}return Xe}defines(){let D=[];for(let K in this.binders){let pe=this.binders[K];(pe instanceof Zi||pe instanceof eo)&&D.push(...pe.uniformNames.map(ke=>`#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<pe.paintVertexAttributes.length;ke++)D.push(pe.paintVertexAttributes[ke].name);else if(pe instanceof Zo)for(let ke=0;ke<zt.members.length;ke++)D.push(zt.members[ke].name)}return D}getBinderUniforms(){let D=[];for(let K in this.binders){let pe=this.binders[K];if(pe instanceof Zi||pe instanceof eo||pe instanceof no)for(let ke of pe.uniformNames)D.push(ke)}return D}getPaintVertexBuffers(){return this._buffers}getUniforms(D,K){let pe=[];for(let ke in this.binders){let je=this.binders[ke];if(je instanceof Zi||je instanceof eo||je instanceof no){for(let Xe of je.uniformNames)if(K[Xe]){let ft=je.getBinding(D,K[Xe],Xe);pe.push({name:Xe,property:ke,binding:ft})}}}return pe}setUniforms(D,K,pe,ke){for(let{name:je,property:Xe,binding:ft}of K)this.binders[Xe].setUniform(ft,ke,pe.get(Xe),je)}updatePaintBuffers(D){this._buffers=[];for(let K in this.binders){let pe=this.binders[K];if(D&&pe instanceof Zo){let ke=D.fromScale===2?pe.zoomInPaintVertexBuffer:pe.zoomOutPaintVertexBuffer;ke&&this._buffers.push(ke)}else(pe instanceof $o||pe instanceof no)&&pe.paintVertexBuffer&&this._buffers.push(pe.paintVertexBuffer)}}upload(D){for(let K in this.binders){let pe=this.binders[K];(pe instanceof $o||pe instanceof no||pe instanceof Zo)&&pe.upload(D)}this.updatePaintBuffers()}destroy(){for(let D in this.binders){let K=this.binders[D];(K instanceof $o||K instanceof no||K instanceof Zo)&&K.destroy()}}}class el{constructor(D,K,pe=()=>!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;pe<K.length;pe++){let ke=K[pe];for(let je=0;je<ke.length;je++){let Xe=ke[je],ft=Math.round(Xe.x*D),Mt=Math.round(Xe.y*D);Xe.x=w(ft,ps,cs),Xe.y=w(Mt,ps,cs),(ft<Xe.x||ft>Xe.x+1||Mt<Xe.y||Mt>Xe.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;K<G.length;K++)if(Sn(D,G[K]))return!0;for(let K=0;K<D.length;K++)if(Sn(G,D[K]))return!0;return!!ua(G,D)}function nt(G,D,K){return!!Sn(G,D)||!!xa(D,G,K)}function Yt(G,D){if(G.length===1)return Ja(D,G[0]);for(let K=0;K<D.length;K++){let pe=D[K];for(let ke=0;ke<pe.length;ke++)if(Sn(G,pe[ke]))return!0}for(let K=0;K<G.length;K++)if(Ja(D,G[K]))return!0;for(let K=0;K<D.length;K++)if(ua(G,D[K]))return!0;return!1}function cr(G,D,K){if(G.length>1){if(ua(G,D))return!0;for(let pe=0;pe<D.length;pe++)if(xa(D[pe],G,K))return!0}for(let pe=0;pe<G.length;pe++)if(xa(G[pe],D,K))return!0;return!1}function ua(G,D){if(G.length===0||D.length===0)return!1;for(let K=0;K<G.length-1;K++){let pe=G[K],ke=G[K+1];for(let je=0;je<D.length-1;je++)if(Aa(pe,ke,D[je],D[je+1]))return!0}return!1}function Aa(G,D,K,pe){return P(G,K,pe)!==P(D,K,pe)&&P(G,D,K)!==P(G,D,pe)}function xa(G,D,K){let pe=K*K;if(D.length===1)return G.distSqr(D[0])<pe;for(let ke=1;ke<D.length;ke++)if(wa(G,D[ke-1],D[ke])<pe)return!0;return!1}function wa(G,D,K){let pe=D.distSqr(K);if(pe===0)return G.distSqr(D);let ke=((G.x-D.x)*(K.x-D.x)+(G.y-D.y)*(K.y-D.y))/pe;return G.distSqr(ke<0?D:ke>1?K:K.sub(D)._mult(ke)._add(D))}function Ja(G,D){let K,pe,ke,je=!1;for(let Xe=0;Xe<G.length;Xe++){K=G[Xe];for(let ft=0,Mt=K.length-1;ft<K.length;Mt=ft++)pe=K[ft],ke=K[Mt],pe.y>D.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;pe<G.length;ke=pe++){let je=G[pe],Xe=G[ke];je.y>D.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.x<pe.x&&D.x<pe.x||G.x>ke.x&&D.x>ke.x||G.y<pe.y&&D.y<pe.y||G.y>ke.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;ft<G.length;ft++)Xe.push(G[ft].sub(je));return Xe}let Ln,Va;xn("CircleBucket",Il,{omit:["layers"]});var ea={get paint(){return Va=Va||new Ne({"circle-radius":new zo(re.paint_circle["circle-radius"]),"circle-color":new zo(re.paint_circle["circle-color"]),"circle-blur":new zo(re.paint_circle["circle-blur"]),"circle-opacity":new zo(re.paint_circle["circle-opacity"]),"circle-translate":new fo(re.paint_circle["circle-translate"]),"circle-translate-anchor":new fo(re.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new fo(re.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new fo(re.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new zo(re.paint_circle["circle-stroke-width"]),"circle-stroke-color":new zo(re.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new zo(re.paint_circle["circle-stroke-opacity"])})},get layout(){return Ln=Ln||new Ne({"circle-sort-key":new zo(re.layout_circle["circle-sort-key"])})}},Ea=1e-6,an=typeof Float32Array<"u"?Float32Array:Array;function gn(G){return G[0]=1,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=1,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=1,G[11]=0,G[12]=0,G[13]=0,G[14]=0,G[15]=1,G}function Wa(G,D,K){var pe=D[0],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],va=D[12],Ga=D[13],$a=D[14],Kn=D[15],bn=K[0],Wn=K[1],ai=K[2],ji=K[3];return G[0]=bn*pe+Wn*ft+ai*Mr+ji*va,G[1]=bn*ke+Wn*Mt+ai*zr+ji*Ga,G[2]=bn*je+Wn*Ut+ai*Hr+ji*$a,G[3]=bn*Xe+Wn*ir+ai*oa+ji*Kn,G[4]=(bn=K[4])*pe+(Wn=K[5])*ft+(ai=K[6])*Mr+(ji=K[7])*va,G[5]=bn*ke+Wn*Mt+ai*zr+ji*Ga,G[6]=bn*je+Wn*Ut+ai*Hr+ji*$a,G[7]=bn*Xe+Wn*ir+ai*oa+ji*Kn,G[8]=(bn=K[8])*pe+(Wn=K[9])*ft+(ai=K[10])*Mr+(ji=K[11])*va,G[9]=bn*ke+Wn*Mt+ai*zr+ji*Ga,G[10]=bn*je+Wn*Ut+ai*Hr+ji*$a,G[11]=bn*Xe+Wn*ir+ai*oa+ji*Kn,G[12]=(bn=K[12])*pe+(Wn=K[13])*ft+(ai=K[14])*Mr+(ji=K[15])*va,G[13]=bn*ke+Wn*Mt+ai*zr+ji*Ga,G[14]=bn*je+Wn*Ut+ai*Hr+ji*$a,G[15]=bn*Xe+Wn*ir+ai*oa+ji*Kn,G}Math.hypot||(Math.hypot=function(){for(var G=0,D=arguments.length;D--;)G+=arguments[D]*arguments[D];return Math.sqrt(G)});var Vn,Rn=Wa;function hi(G,D,K){var pe=D[0],ke=D[1],je=D[2],Xe=D[3];return G[0]=K[0]*pe+K[4]*ke+K[8]*je+K[12]*Xe,G[1]=K[1]*pe+K[5]*ke+K[9]*je+K[13]*Xe,G[2]=K[2]*pe+K[6]*ke+K[10]*je+K[14]*Xe,G[3]=K[3]*pe+K[7]*ke+K[11]*je+K[15]*Xe,G}Vn=new an(4),an!=Float32Array&&(Vn[0]=0,Vn[1]=0,Vn[2]=0,Vn[3]=0);class Za extends ae{constructor(D){super(D,ea)}createBucket(D){return new Il(D)}queryRadius(D){let K=D;return hn("circle-radius",this,K)+hn("circle-stroke-width",this,K)+yi(this.paint.get("circle-translate"))}queryIntersectsFeature(D,K,pe,ke,je,Xe,ft,Mt){let Ut=Bn(D,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),Xe.angle,ft),ir=this.paint.get("circle-radius").evaluate(K,pe)+this.paint.get("circle-stroke-width").evaluate(K,pe),Mr=this.paint.get("circle-pitch-alignment")==="map",zr=Mr?Ut:function(oa,va){return oa.map(Ga=>qa(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<ke.height;Mt++){let Ut=((K.y+Mt)*G.width+K.x)*je,ir=((pe.y+Mt)*D.width+pe.x)*je;for(let Mr=0;Mr<ke.width*je;Mr++)ft[ir+Mr]=Xe[Ut+Mr]}return D}class Ii{constructor(D,K){An(this,D,1,K)}resize(D){Jn(this,D,1)}clone(){return new Ii({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(D,K,pe,ke,je){mi(D,K,pe,ke,je,1)}}class zn{constructor(D,K){An(this,D,4,K)}resize(D){Jn(this,D,4)}replace(D,K){K?this.data.set(D):this.data=D instanceof Uint8ClampedArray?new Uint8Array(D.buffer):D}clone(){return new zn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(D,K,pe,ke,je){mi(D,K,pe,ke,je,4)}}function ii(G){let D={},K=G.resolution||256,pe=G.clips?G.clips.length:1,ke=G.image||new zn({width:K,height:pe});if(Math.log(K)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${K}`);let je=(Xe,ft,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;Xe<pe;++Xe,ft+=4*K)for(let Mt=0,Ut=0;Mt<K;Mt++,Ut+=4){let ir=Mt/(K-1),{start:Mr,end:zr}=G.clips[Xe];je(ft,Ut,Mr*(1-ir)+zr*ir)}else for(let Xe=0,ft=0;Xe<K;Xe++,ft+=4)je(0,ft,Xe/(K-1));return ke}xn("AlphaImage",Ii),xn("RGBAImage",zn);let Ei="big-fb";class Ri extends ae{createBucket(D){return new Qn(D)}constructor(D){super(D,Mn),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(D){D==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ii({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ei)&&this.heatmapFbos.delete(Ei)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Gi;var Ps={get paint(){return Gi=Gi||new Ne({"hillshade-illumination-direction":new fo(re.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new fo(re.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new fo(re.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new fo(re.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new fo(re.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new fo(re.paint_hillshade["hillshade-accent-color"])})}};class xl extends ae{constructor(D){super(D,Ps)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}let ho=pt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hl}=ho;function fs(G,D,K=2){let pe=D&&D.length,ke=pe?D[0]*K:G.length,je=Al(G,0,ke,K,!0),Xe=[];if(!je||je.next===je.prev)return Xe;let ft,Mt,Ut;if(pe&&(je=function(ir,Mr,zr,Hr){let oa=[];for(let va=0,Ga=Mr.length;va<Ga;va++){let $a=Al(ir,Mr[va]*Hr,va<Ga-1?Mr[va+1]*Hr:ir.length,Hr,!1);$a===$a.next&&($a.steiner=!0),oa.push(ye($a))}oa.sort(Cl);for(let va=0;va<oa.length;va++)zr=Lo(oa[va],zr);return zr}(G,D,je,K)),G.length>80*K){ft=1/0,Mt=1/0;let ir=-1/0,Mr=-1/0;for(let zr=K;zr<ke;zr+=K){let Hr=G[zr],oa=G[zr+1];Hr<ft&&(ft=Hr),oa<Mt&&(Mt=oa),Hr>ir&&(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;Mr<Mt;Mr+=Ut)ir+=(Xe[zr]-Xe[Mr])*(Xe[Mr+1]+Xe[zr+1]),zr=Mr;return ir}(G,D,K,pe)>0)for(let Xe=D;Xe<K;Xe+=pe)je=hr(Xe/pe|0,G[Xe],G[Xe+1],je);else for(let Xe=K-pe;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;ji<va&&(Wn++,bn=bn.nextZ,bn);ji++);let ai=va;for(;Wn>0||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=ke<je?ke<Xe?ke:Xe:je<Xe?je:Xe,Mr=ft<Mt?ft<Ut?ft:Ut:Mt<Ut?Mt:Ut,zr=ke>je?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=ft<Mt?ft<Ut?ft:Ut:Mt<Ut?Mt:Ut,oa=ir<Mr?ir<zr?ir:zr:Mr<zr?Mr:zr,va=ft>Mt?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.next.x?Xe:Xe.next,va===ft))return Ut}Xe=Xe.next}while(Xe!==je);if(!Ut)return null;let Mr=Ut,zr=Ut.x,Hr=Ut.y,oa=1/0;Xe=Ut;do{if(ft>=Xe.x&&Xe.x>=zr&&ft!==Xe.x&&te(Mt<Hr?ft:ir,Mt,zr,Hr,Mt<Hr?ir:ft,Mt,Xe.x,Xe.y)){let va=Math.abs(Mt-Xe.y)/(ft-Xe.x);_r(Xe,ke)&&(va<oa||va===oa&&(Xe.x>Ut.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<K.x||D.x===K.x&&D.y<K.y)&&(K=D),D=D.next;while(D!==G);return K}function te(G,D,K,pe,ke,je,Xe,ft){return(ke-Xe)*(D-ft)>=(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<Hr.length;Ga++)this.layoutVertexArray.emplaceBack(Hr[Ga].x,Hr[Ga].y),this.indexArray2.emplaceBack(va+Ga-1,va+Ga),ir.push(Hr[Ga].x),ir.push(Hr[Ga].y);oa.vertexLength+=Hr.length,oa.primitiveLength+=Hr.length}let zr=fs(ir,Mr);for(let Hr=0;Hr<zr.length;Hr+=3)this.indexArray.emplaceBack(Ut+zr[Hr],Ut+zr[Hr+1],Ut+zr[Hr+2]);Mt.vertexLength+=ft,Mt.primitiveLength+=zr.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,je,ke)}}let sr,pr;xn("FillBucket",fr,{omit:["layers","patternFeatures"]});var lr={get paint(){return pr=pr||new Ne({"fill-antialias":new fo(re.paint_fill["fill-antialias"]),"fill-opacity":new zo(re.paint_fill["fill-opacity"]),"fill-color":new zo(re.paint_fill["fill-color"]),"fill-outline-color":new zo(re.paint_fill["fill-outline-color"]),"fill-translate":new fo(re.paint_fill["fill-translate"]),"fill-translate-anchor":new fo(re.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ic(re.paint_fill["fill-pattern"])})},get layout(){return sr=sr||new Ne({"fill-sort-key":new zo(re.layout_fill["fill-sort-key"])})}};class Xt extends ae{constructor(D){super(D,lr)}recalculate(D,K){super.recalculate(D,K);let pe=this.paint._values["fill-outline-color"];pe.value.kind==="constant"&&pe.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(D){return new fr(D)}queryRadius(){return yi(this.paint.get("fill-translate"))}queryIntersectsFeature(D,K,pe,ke,je,Xe,ft){return Yt(Bn(D,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),Xe.angle,ft),ke)}isTileClipped(){return!0}}let or=pt([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Vt=pt([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Dr}=or;var Jr={},ba=i,_n=Xa;function Xa(G,D,K,pe,ke){this.properties={},this.extent=K,this.type=0,this._pbf=G,this._geometry=-1,this._keys=pe,this._values=ke,G.readFields(ln,this,D)}function ln(G,D,K){G==1?D.id=K.readVarint():G==2?function(pe,ke){for(var je=pe.readVarint()+pe.pos;pe.pos<je;){var Xe=ke._keys[pe.readVarint()],ft=ke._values[pe.readVarint()];ke.properties[Xe]=ft}}(K,D):G==3?D.type=K.readVarint():G==4&&(D._geometry=K.pos)}function $n(G){for(var D,K,pe=0,ke=0,je=G.length,Xe=je-1;ke<je;Xe=ke++)pe+=((K=G[Xe]).x-(D=G[ke]).x)*(D.y+K.y);return pe}Xa.types=["Unknown","Point","LineString","Polygon"],Xa.prototype.loadGeometry=function(){var G=this._pbf;G.pos=this._geometry;for(var D,K=G.readVarint()+G.pos,pe=1,ke=0,je=0,Xe=0,ft=[];G.pos<K;){if(ke<=0){var Mt=G.readVarint();pe=7&Mt,ke=Mt>>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<D;){if(pe<=0){var ir=G.readVarint();K=7&ir,pe=ir>>3}if(pe--,K===1||K===2)(ke+=G.readSVarint())<Xe&&(Xe=ke),ke>ft&&(ft=ke),(je+=G.readSVarint())<Mt&&(Mt=je),je>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<Hr.length;oa++){var va=Hr[oa];Hr[oa]=[360*(va.x+Xe)/je-180,360/Math.PI*Math.atan(Math.exp((180-360*(va.y+ft)/je)*Math.PI/180))-90]}}switch(this.type){case 1:var Mr=[];for(pe=0;pe<Mt.length;pe++)Mr[pe]=Mt[pe][0];ir(Mt=Mr);break;case 2:for(pe=0;pe<Mt.length;pe++)ir(Mt[pe]);break;case 3:for(Mt=function(Hr){var oa=Hr.length;if(oa<=1)return[Hr];for(var va,Ga,$a=[],Kn=0;Kn<oa;Kn++){var bn=$n(Hr[Kn]);bn!==0&&(Ga===void 0&&(Ga=bn<0),Ga===bn<0?(va&&$a.push(va),va=[Hr[Kn]]):va.push(Hr[Kn]))}return va&&$a.push(va),$a}(Mt),pe=0;pe<Mt.length;pe++)for(ke=0;ke<Mt[pe].length;ke++)ir(Mt[pe][ke])}Mt.length===1?Mt=Mt[0]:Ut="Multi"+Ut;var zr={type:"Feature",geometry:{type:Ut,coordinates:Mt},properties:this.properties};return"id"in this&&(zr.id=this.id),zr};var Nn=_n,dn=Tn;function Tn(G,D){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=G,this._keys=[],this._values=[],this._features=[],G.readFields(En,this,D),this.length=this._features.length}function En(G,D,K){G===15?D.version=K.readVarint():G===1?D.name=K.readString():G===5?D.extent=K.readVarint():G===2?D._features.push(K.pos):G===3?D._keys.push(K.readString()):G===4&&D._values.push(function(pe){for(var ke=null,je=pe.readVarint()+pe.pos;pe.pos<je;){var Xe=pe.readVarint()>>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<oa.length;Ga++){let $a=oa[Ga];if(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;va<oa.length;va++){let Ga=oa[va];ks(this.layoutVertexArray,Ga.x,Ga.y,0,0,1,1,0),ft.x+=Ga.x,ft.y+=Ga.y,ft.vertexCount+=1,ir.push(Ga.x),ir.push(Ga.y)}}let Hr=fs(ir,Mr);for(let oa=0;oa<Hr.length;oa+=3)this.indexArray.emplaceBack(zr+Hr[oa],zr+Hr[oa+2],zr+Hr[oa+1]);Ut.primitiveLength+=Hr.length/3,Ut.vertexLength+=Mt;for(let oa=0;oa<ft.vertexCount;oa++){let va=Math.floor(ft.x/ft.vertexCount),Ga=Math.floor(ft.y/ft.vertexCount);this.centroidVertexArray.emplaceBack(va,Ga)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,pe,je,ke)}}function bs(G,D){return G.x===D.x&&(G.x<0||G.x>vo)||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;Kn<va.length;Kn++){let bn=va[Kn],Wn=oa[Kn];for(let ai=0;ai<bn.length-1;ai++){let ji=bn[ai],ko=[ji,bn[ai+1],Wn[ai+1],Wn[ai],ji];yc(Ga,ko)&&($a=Math.min($a,Vp(Ga,ko)))}}return $a!==1/0&&$a}(Hr[0],Hr[1],zr)}}function Ph(G,D){return G.x*D.x+G.y*D.y}function Vp(G,D){if(G.length===1){let K=0,pe=D[K++],ke;for(;!ke||pe.equals(ke);)if(ke=D[K++],!ke)return 1/0;for(;K<D.length;K++){let je=D[K],Xe=G[0],ft=ke.sub(pe),Mt=je.sub(pe),Ut=Xe.sub(pe),ir=Ph(ft,ft),Mr=Ph(ft,Mt),zr=Ph(Mt,Mt),Hr=Ph(Ut,ft),oa=Ph(Ut,Mt),va=ir*zr-Mr*Mr,Ga=(zr*Hr-Mr*oa)/va,$a=(ir*oa-Mr*Hr)/va,Kn=pe.z*(1-Ga-$a)+ke.z*Ga+je.z*$a;if(isFinite(Kn))return Kn}return 1/0}{let K=1/0;for(let pe of D)K=Math.min(K,pe.z);return K}}let Vd=pt([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:td}=Vd,Ih=pt([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:rd}=Ih,Kh=Jr.VectorTileFeature.types,Rh=Math.cos(Math.PI/180*37.5),Mp=Math.pow(2,14)/.5;class qp{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.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<D.length-1;$a++)this.totalDistance+=D[$a].dist(D[$a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let ft=Kh[K.type]==="Polygon",Mt=D.length;for(;Mt>=2&&D[Mt-1].equals(D[Mt-2]);)Mt--;let Ut=0;for(;Ut<Mt-1&&D[Ut].equals(D[Ut+1]);)Ut++;if(Mt<(ft?3:2))return;pe==="bevel"&&(je=1.05);let ir=this.overscaling<=16?15*vo/(512*this.overscaling):0,Mr=this.segments.prepareSegment(10*Mt,this.layoutVertexArray,this.indexArray),zr,Hr,oa,va,Ga;this.e1=this.e2=-1,ft&&(zr=D[Mt-2],Ga=D[Ut].sub(zr)._unit()._perp());for(let $a=Ut;$a<Mt;$a++){if(oa=$a===Mt-1?ft?D[Ut+1]:void 0:D[$a+1],oa&&D[$a].equals(oa))continue;Ga&&(va=Ga),zr&&(Hr=zr),zr=D[$a],Ga=oa?oa.sub(zr)._unit()._perp():va,va=va||Ga;let Kn=va.add(Ga);Kn.x===0&&Kn.y===0||Kn._unit();let bn=va.x*Ga.x+va.y*Ga.y,Wn=Kn.x*Ga.x+Kn.y*Ga.y,ai=Wn!==0?1/Wn:1/0,ji=2*Math.sqrt(2-2*Wn),ko=Wn<Rh&&Hr&&oa,vs=va.x*Ga.y-va.y*Ga.x>0;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"&&(ai<Xe?Di="miter":ai<=2&&(Di="fakeround")),Di==="miter"&&ai>je&&(Di="bevel"),Di==="bevel"&&(ai>2&&(Di="flipbevel"),ai<je&&(Di="miter")),Hr&&this.updateDistance(Hr,zr),Di==="miter")Kn._mult(ai),this.addCurrentVertex(zr,Kn,0,0,Mr);else if(Di==="flipbevel"){if(ai>100)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&&$a<Mt-1){let ns=zr.dist(oa);if(ns>2*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<Mr.length;oa++){let va=Mr[oa],Ga=[];for(let $a=0;$a<va.length;$a++){let Kn=va[$a-1],bn=va[$a],Wn=va[$a+1],ai=$a===0?new n(0,0):bn.sub(Kn)._unit()._perp(),ji=$a===va.length-1?new n(0,0):Wn.sub(bn)._unit()._perp(),ko=ai._add(ji)._unit(),vs=ko.x*ji.x+ko.y*ji.y;vs!==0&&ko._mult(1/vs),Ga.push(ko._mult(zr)._add(bn))}Hr.push(Ga)}return Hr}(ke,ir*ft)),function(Mr,zr,Hr){for(let oa=0;oa<zr.length;oa++){let va=zr[oa];if(Mr.length>=3){for(let Ga=0;Ga<va.length;Ga++)if(Sn(Mr,va[Ga]))return!0}if(cr(Mr,va,Hr))return!0}return!1}(Mt,ke,Ut)}isTileClipped(){return!0}}function ch(G,D){return D>0?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<<ft)-1,Ut=Mt>>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<<Ut)-1,Mr=ir>>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<<ke|ft,Ut+=ke;Ut>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<G.length;K++)D.writeVarint(G[K])}function UT(G,D){for(var K=0;K<G.length;K++)D.writeSVarint(G[K])}function jT(G,D){for(var K=0;K<G.length;K++)D.writeFloat(G[K])}function VT(G,D){for(var K=0;K<G.length;K++)D.writeDouble(G[K])}function qT(G,D){for(var K=0;K<G.length;K++)D.writeBoolean(G[K])}function dk(G,D){for(var K=0;K<G.length;K++)D.writeFixed32(G[K])}function GT(G,D){for(var K=0;K<G.length;K++)D.writeSFixed32(G[K])}function HT(G,D){for(var K=0;K<G.length;K++)D.writeFixed64(G[K])}function WT(G,D){for(var K=0;K<G.length;K++)D.writeSFixed64(G[K])}function Rv(G,D){return(G[D]|G[D+1]<<8|G[D+2]<<16)+16777216*G[D+3]}function wg(G,D,K){G[K]=D,G[K+1]=D>>>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<K;){var pe=this.readVarint(),ke=pe>>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;Xe<ke;){var ft,Mt,Ut,ir=K[Xe],Mr=null,zr=ir>239?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.pos<K;)G.push(this.readVarint(D));return G},readPackedSVarint:function(G){if(this.type!==Au.Bytes)return G.push(this.readSVarint());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readSVarint());return G},readPackedBoolean:function(G){if(this.type!==Au.Bytes)return G.push(this.readBoolean());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readBoolean());return G},readPackedFloat:function(G){if(this.type!==Au.Bytes)return G.push(this.readFloat());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readFloat());return G},readPackedDouble:function(G){if(this.type!==Au.Bytes)return G.push(this.readDouble());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readDouble());return G},readPackedFixed32:function(G){if(this.type!==Au.Bytes)return G.push(this.readFixed32());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readFixed32());return G},readPackedSFixed32:function(G){if(this.type!==Au.Bytes)return G.push(this.readSFixed32());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readSFixed32());return G},readPackedFixed64:function(G){if(this.type!==Au.Bytes)return G.push(this.readFixed64());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readFixed64());return G},readPackedSFixed64:function(G){if(this.type!==Au.Bytes)return G.push(this.readSFixed64());var D=Cp(this);for(G=G||[];this.pos<D;)G.push(this.readSFixed64());return G},skip:function(G){var D=7&G;if(D===Au.Varint)for(;this.buf[this.pos++]>127;);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;D<this.pos+G;)D*=2;if(D!==this.length){var K=new Uint8Array(D);K.set(this.buf),this.buf=K,this.length=D}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(G){this.realloc(4),wg(this.buf,G,this.pos),this.pos+=4},writeSFixed32:function(G){this.realloc(4),wg(this.buf,G,this.pos),this.pos+=4},writeFixed64:function(G){this.realloc(8),wg(this.buf,-1&G,this.pos),wg(this.buf,Math.floor(G*sv),this.pos+4),this.pos+=8},writeSFixed64:function(G){this.realloc(8),wg(this.buf,-1&G,this.pos),wg(this.buf,Math.floor(G*sv),this.pos+4),this.pos+=8},writeVarint:function(G){(G=+G||0)>268435455||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;Mt<ke.length;Mt++){if((Xe=ke.charCodeAt(Mt))>55295&&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<D;K++)this.buf[this.pos++]=G[K]},writeRawMessage:function(G,D){this.pos++;var K=this.pos;G(D,this);var pe=this.pos-K;pe>=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<pe.length&&(pe[ft]=Ut)}else Xe.h===Mt.h?(Mt.x+=Xe.w,Mt.w-=Xe.w):Xe.w===Mt.w?(Mt.y+=Xe.h,Mt.h-=Xe.h):(pe.push({x:Mt.x+Xe.w,y:Mt.y,w:Mt.w-Xe.w,h:Xe.h}),Mt.y+=Xe.h,Mt.h-=Xe.h);break}}return{w:ke,h:je,fill:D/(ke*je)||0}}let zh=1;class b0{constructor(D,{pixelRatio:K,version:pe,stretchX:ke,stretchY:je,content:Xe,textFitWidth:ft,textFitHeight:Mt}){this.paddedRect=D,this.pixelRatio=K,this.stretchX=ke,this.stretchY=je,this.content=Xe,this.version=pe,this.textFitWidth=ft,this.textFitHeight=Mt}get tl(){return[this.paddedRect.x+zh,this.paddedRect.y+zh]}get br(){return[this.paddedRect.x+this.paddedRect.w-zh,this.paddedRect.y+this.paddedRect.h-zh]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*zh)/this.pixelRatio,(this.paddedRect.h-2*zh)/this.pixelRatio]}}class w0{constructor(D,K){let pe={},ke={};this.haveRenderCallbacks=[];let je=[];this.addImages(D,pe,je),this.addImages(K,ke,je);let{w:Xe,h:ft}=R1(je),Mt=new zn({width:Xe||1,height:ft||1});for(let Ut in D){let ir=D[Ut],Mr=pe[Ut].paddedRect;zn.copy(ir.data,Mt,{x:0,y:0},{x:Mr.x+zh,y:Mr.y+zh},ir.data)}for(let Ut in K){let ir=K[Ut],Mr=ke[Ut].paddedRect,zr=Mr.x+zh,Hr=Mr.y+zh,oa=ir.data.width,va=ir.data.height;zn.copy(ir.data,Mt,{x:0,y:0},{x:zr,y:Hr},ir.data),zn.copy(ir.data,Mt,{x:0,y:va-1},{x:zr,y:Hr-1},{width:oa,height:1}),zn.copy(ir.data,Mt,{x:0,y:0},{x:zr,y:Hr+va},{width:oa,height:1}),zn.copy(ir.data,Mt,{x:oa-1,y:0},{x:zr-1,y:Hr},{width:1,height:va}),zn.copy(ir.data,Mt,{x:0,y:0},{x:zr+oa,y:Hr},{width:1,height:va})}this.image=Mt,this.iconPositions=pe,this.patternPositions=ke}addImages(D,K,pe){for(let ke in D){let je=D[ke],Xe={x:0,y:0,w:je.data.width+2*zh,h:je.data.height+2*zh};pe.push(Xe),K[ke]=new b0(Xe,je),je.hasRenderCallback&&this.haveRenderCallbacks.push(ke)}}patchUpdatedImages(D,K){D.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let pe in D.updatedImages)this.patchUpdatedImage(this.iconPositions[pe],D.getImage(pe),K),this.patchUpdatedImage(this.patternPositions[pe],D.getImage(pe),K)}patchUpdatedImage(D,K,pe){if(!D||!K||D.version===K.version)return;D.version=K.version;let[ke,je]=D.tl;pe.update(K.data,void 0,{x:ke,y:je})}}var kp;xn("ImagePosition",b0),xn("ImageAtlas",w0),e.ah=void 0,(kp=e.ah||(e.ah={}))[kp.none=0]="none",kp[kp.horizontal=1]="horizontal",kp[kp.vertical=2]="vertical",kp[kp.horizontalOnly=3]="horizontalOnly";let $f=-17;class Tg{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(D,K){let pe=new Tg;return pe.scale=D||1,pe.fontStack=K,pe}static forImage(D){let K=new Tg;return K.imageName=D,K}}class sm{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(D,K){let pe=new sm;for(let ke=0;ke<D.sections.length;ke++){let je=D.sections[ke];je.image?pe.addImageSection(je):pe.addTextSection(je,K)}return pe}length(){return this.text.length}getSection(D){return this.sections[this.sectionIndex[D]]}getSectionIndex(D){return this.sectionIndex[D]}getCharCode(D){return this.text.charCodeAt(D)}verticalizePunctuation(){this.text=function(D){let K="";for(let pe=0;pe<D.length;pe++){let ke=D.charCodeAt(pe+1)||null,je=D.charCodeAt(pe-1)||null;K+=ke&&Fl(ke)&&!cc[D[pe+1]]||je&&Fl(je)&&!cc[D[pe-1]]||!cc[D[pe]]?D[pe]:cc[D[pe]]}return K}(this.text)}trim(){let D=0;for(let pe=0;pe<this.text.length&&T0[this.text.charCodeAt(pe)];pe++)D++;let K=this.text.length;for(let pe=this.text.length-1;pe>=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<D.text.length;++ke)this.sectionIndex.push(pe)}addImageSection(D){let K=D.image?D.image.name:"";if(K.length===0)return void f("Can't add FormattedSection with an empty image.");let pe=this.getNextImageSectionCharCode();pe?(this.text+=String.fromCharCode(pe),this.sections.push(Tg.forImage(K)),this.sectionIndex.push(this.sections.length-1)):f("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=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;vs<ji.length;vs++)ko.sectionIndex.push(0);Ga.push(ko)}}else if(Kn){Ga=[];let ai=Kn(va.text,va.sectionIndex,lm(va,Ut,je,D,pe,Hr));for(let ji of ai){let ko=new sm;ko.text=ji[0],ko.sectionIndex=ji[1],ko.sections=va.sections,Ga.push(ko)}}else Ga=function(ai,ji){let ko=[],vs=ai.text,yo=0;for(let Di of ji)ko.push(ai.substring(yo,Di)),yo=Di;return yo<vs.length&&ko.push(ai.substring(yo,vs.length)),ko}(va,lm(va,Ut,je,D,pe,Hr));let bn=[],Wn={positionedLines:bn,text:va.toString(),top:ir[1],bottom:ir[1],left:ir[0],right:ir[0],writingMode:Mr,iconsInText:!1,verticalizable:!1};return function(ai,ji,ko,vs,yo,Di,ns,qo,Bo,_i,us,No){let Es=0,Ku=$f,Uu=0,Qf=0,Hp=qo==="right"?1:qo==="left"?0:.5,bh=0;for(let uf of yo){uf.trim();let th=uf.getMaxScale(),Fh=(th-1)*lu,wh={positionedGlyphs:[],lineOffset:0};ai.positionedLines[bh]=wh;let fh=wh.positionedGlyphs,gf=0;if(!uf.length()){Ku+=Di,++bh;continue}for(let pp=0;pp<uf.length();pp++){let uu=uf.getSection(pp),fc=uf.getSectionIndex(pp),Ju=uf.getCharCode(pp),Pp=0,Kc=null,dm=null,_d=null,hd=lu,Wp=!(Bo===e.ah.horizontal||!us&&!ys(Ju)||us&&(T0[Ju]||(eh=Ju,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(eh)))));if(uu.imageName){let Rc=vs[uu.imageName];if(!Rc)continue;_d=uu.imageName,ai.iconsInText=ai.iconsInText||!0,dm=Rc.paddedRect;let Pf=Rc.displaySize;uu.scale=uu.scale*lu/No,Kc={width:Pf[0],height:Pf[1],left:zh,top:-Px,advance:Wp?Pf[1]:Pf[0]},Pp=Fh+(lu-Pf[1]*uu.scale),hd=Kc.advance;let Xp=Wp?Pf[0]*uu.scale-lu*th:Pf[1]*uu.scale-lu*th;Xp>0&&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<D?ke/2:2*ke:ke+Math.abs(K)*K}function KT(G,D,K){let pe=0;return G===10&&(pe-=1e4),K&&(pe+=150),G!==40&&G!==65288||(pe+=50),D!==41&&D!==65289||(pe+=50),pe}function A0(G,D,K,pe,ke,je){let Xe=null,ft=Rx(D,K,ke,je);for(let Mt of pe){let Ut=Rx(D-Mt.x,K,ke,je)+Mt.badness;Ut<=ft&&(Xe=Mt,ft=Ut)}return{index:G,x:D,priorBreak:Xe,badness:ft}}function Dx(G){return G?Dx(G.priorBreak).concat(G.index):[]}function lm(G,D,K,pe,ke,je){if(!G)return[];let Xe=[],ft=function(Mr,zr,Hr,oa,va,Ga){let $a=0;for(let Kn=0;Kn<Mr.length();Kn++){let bn=Mr.getSection(Kn);$a+=Ix(Mr.getCharCode(Kn),bn,oa,va,zr,Ga)}return $a/Math.max(1,Math.ceil($a/Hr))}(G,D,K,pe,ke,je),Mt=G.text.indexOf("\u200B")>=0,Ut=0;for(let Mr=0;Mr<G.length();Mr++){let zr=G.getSection(Mr),Hr=G.getCharCode(Mr);if(T0[Hr]||(Ut+=Ix(Hr,zr,pe,ke,D,je)),Mr<G.length()-1){let oa=!((ir=Hr)<11904)&&(!!ui["CJK Compatibility Forms"](ir)||!!ui["CJK Compatibility"](ir)||!!ui["CJK Strokes"](ir)||!!ui["CJK Symbols and Punctuation"](ir)||!!ui["Enclosed CJK Letters and Months"](ir)||!!ui["Halfwidth and Fullwidth Forms"](ir)||!!ui["Ideographic Description Characters"](ir)||!!ui["Vertical Forms"](ir)||Ks.test(String.fromCodePoint(ir)));(ZT[Hr]||oa||zr.imageName||Mr!==G.length()-2&&YT[G.getCharCode(Mr+1)])&&Xe.push(A0(Mr+1,Ut,ft,Xe,KT(Hr,G.getCharCode(Mr+1),oa&&Mt),!1))}}var ir;return Dx(A0(G.length(),Ut,ft,Xe,0,!0))}function S0(G){let D=.5,K=.5;switch(G){case"right":case"top-right":case"bottom-right":D=1;break;case"left":case"top-left":case"bottom-left":D=0}switch(G){case"bottom":case"bottom-right":case"bottom-left":K=1;break;case"top":case"top-right":case"top-left":K=0}return{horizontalAlign:D,verticalAlign:K}}function uv(G,D,K,pe,ke){if(!pe&&!ke)return;let je=G[K],Xe=(G[K].x+je.metrics.advance*je.scale)*pe;for(let ft=D;ft<=K;ft++)G[ft].x-=Xe,G[ft].y+=ke}function Sg(G,D,K){let{horizontalAlign:pe,verticalAlign:ke}=S0(K),je=D[0]-G.displaySize[0]*pe,Xe=D[1]-G.displaySize[1]*ke;return{image:G,top:Xe,bottom:Xe+G.displaySize[1],left:je,right:je+G.displaySize[0]}}function zx(G){var D,K;let pe=G.left,ke=G.top,je=G.right-pe,Xe=G.bottom-ke,ft=(D=G.image.textFitWidth)!==null&&D!==void 0?D:"stretchOrShrink",Mt=(K=G.image.textFitHeight)!==null&&K!==void 0?K:"stretchOrShrink",Ut=(G.image.content[2]-G.image.content[0])/(G.image.content[3]-G.image.content[1]);if(Mt==="proportional"){if(ft==="stretchOnly"&&je/Xe<Ut||ft==="proportional"){let ir=Math.ceil(Xe*Ut);pe*=ir/je,je=ir}}else if(ft==="proportional"&&Mt==="stretchOnly"&&Ut!==0&&je/Xe>Ut){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(;je<pe.length&&pe[je]<=G;)je++;je=Math.max(0,je-1);let Xe=je;for(;Xe<pe.length&&pe[Xe]<G+1;)Xe++;Xe=Math.min(pe.length-1,Xe);let ft=pe[je],Mt=pe[Xe];return K.kind==="composite"?{kind:"composite",minZoom:ft,maxZoom:Mt,interpolationType:ke}:{kind:"camera",minZoom:ft,maxZoom:Mt,minSize:K.evaluate(new Ls(ft)),maxSize:K.evaluate(new Ls(Mt)),interpolationType:ke}}}function D1(G,D,K){let pe="never",ke=G.get(D);return ke?pe=ke:G.get(K)&&(pe="always"),pe}let JT=Jr.VectorTileFeature.types,$T=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function M0(G,D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr){let Hr=ft?Math.min(cv,Math.round(ft[0])):0,oa=ft?Math.min(cv,Math.round(ft[1])):0;G.emplaceBack(D,K,Math.round(32*pe),Math.round(32*ke),je,Xe,(Hr<<1)+(Mt?1:0),oa,16*Ut,16*ir,256*Mr,256*zr)}function z1(G,D,K){G.emplaceBack(D.x,D.y,K),G.emplaceBack(D.x,D.y,K),G.emplaceBack(D.x,D.y,K),G.emplaceBack(D.x,D.y,K)}function F1(G){for(let D of G.sections)if(Io(D.text))return!0;return!1}class O1{constructor(D){this.layoutVertexArray=new su,this.indexArray=new De,this.programConfigurations=D,this.segments=new St,this.dynamicLayoutVertexArray=new uc,this.opacityVertexArray=new Vl,this.hasVisibleVertices=!1,this.placedSymbolArray=new Wi}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(D,K,pe,ke){this.isEmpty()||(pe&&(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,nv.members),this.indexBuffer=D.createIndexBuffer(this.indexArray,K),this.dynamicLayoutVertexBuffer=D.createVertexBuffer(this.dynamicLayoutVertexArray,nm.members,!0),this.opacityVertexBuffer=D.createVertexBuffer(this.opacityVertexArray,$T,!0),this.opacityVertexBuffer.itemSize=1),(pe||ke)&&this.programConfigurations.upload(D))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}xn("SymbolBuffers",O1);class fv{constructor(D,K,pe){this.layoutVertexArray=new D,this.layoutAttributes=K,this.indexArray=new pe,this.segments=new St,this.collisionVertexArray=new de}upload(D){this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=D.createVertexBuffer(this.collisionVertexArray,im.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}xn("CollisionBuffers",fv);class um{constructor(D){this.collisionBoxArray=D.collisionBoxArray,this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Xe=>Xe.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;Xe<D.length;Xe++)if(K[D.charCodeAt(Xe)]=!0,(pe||ke)&&je){let ft=cc[D.charAt(Xe)];ft&&(K[ft.charCodeAt(0)]=!0)}}populate(D,K,pe){let ke=this.layers[0],je=ke.layout,Xe=je.get("text-font"),ft=je.get("text-field"),Mt=je.get("icon-image"),Ut=(ft.value.kind!=="constant"||ft.value.value instanceof ma&&!ft.value.value.isEmpty()||ft.value.value.toString().length>0)&&(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;yo<Ga.length;yo++){let Di=Ga[yo],ns=Di.geometry,qo=Di.text?Di.text.toString():null;if(!qo){ai(yo);continue}let Bo=vs(qo,ns),_i=vs(qo,ns,!0);if(Bo in Kn&&_i in $a&&Kn[Bo]!==$a[_i]){let us=ko(Bo,_i,ns),No=ji(Bo,_i,bn[us].geometry);delete $a[Bo],delete Kn[_i],Kn[vs(qo,bn[No].geometry,!0)]=No,bn[us].geometry=null}else Bo in Kn?ji(Bo,_i,ns):_i in $a?ko(Bo,_i,ns):(ai(yo),$a[Bo]=Wn-1,Kn[_i]=Wn-1)}return bn.filter(yo=>yo.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<K.length;ft++)Xe[ft]={x:K[ft].x,y:K[ft].y,tileUnitDistanceFromAnchor:ke},ft<K.length-1&&(ke+=K[ft+1].dist(K[ft]));for(let ft=D.segment||0;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;ft<K.length;ft++){let Mt=Xe[ft];this.lineVertexArray.emplaceBack(Mt.x,Mt.y,Mt.tileUnitDistanceFromAnchor)}}return{lineStartIndex:pe,lineLength:this.lineVertexArray.length-pe}}addSymbols(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir,Mr,zr){let Hr=D.indexArray,oa=D.layoutVertexArray,va=D.segments.prepareSegment(4*K.length,oa,Hr,this.canOverlap?Xe.sortKey:void 0),Ga=this.glyphOffsetArray.length,$a=va.vertexLength,Kn=this.allowVerticalPlacement&&ft===e.ah.vertical?Math.PI/2:0,bn=Xe.text&&Xe.text.sections;for(let Wn=0;Wn<K.length;Wn++){let{tl:ai,tr:ji,bl:ko,br:vs,tex:yo,pixelOffsetTL:Di,pixelOffsetBR:ns,minFontScaleX:qo,minFontScaleY:Bo,glyphOffset:_i,isSDF:us,sectionIndex:No}=K[Wn],Es=va.vertexLength,Ku=_i[1];M0(oa,Mt.x,Mt.y,ai.x,Ku+ai.y,yo.x,yo.y,pe,us,Di.x,Di.y,qo,Bo),M0(oa,Mt.x,Mt.y,ji.x,Ku+ji.y,yo.x+yo.w,yo.y,pe,us,ns.x,Di.y,qo,Bo),M0(oa,Mt.x,Mt.y,ko.x,Ku+ko.y,yo.x,yo.y+yo.h,pe,us,Di.x,ns.y,qo,Bo),M0(oa,Mt.x,Mt.y,vs.x,Ku+vs.y,yo.x+yo.w,yo.y+yo.h,pe,us,ns.x,ns.y,qo,Bo),z1(D.dynamicLayoutVertexArray,Mt,Kn),Hr.emplaceBack(Es,Es+1,Es+2),Hr.emplaceBack(Es+1,Es+2,Es+3),va.vertexLength+=4,va.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_i[0]),Wn!==K.length-1&&No===K[Wn+1].sectionIndex||D.programConfigurations.populatePaintArrays(oa.length,Xe,Xe.index,{},zr,bn&&bn[No])}D.placedSymbolArray.emplaceBack(Mt.x,Mt.y,Ga,this.glyphOffsetArray.length-Ga,$a,Ut,ir,Mt.segment,pe?pe[0]:0,pe?pe[1]:0,ke[0],ke[1],ft,0,!1,0,Mr)}_addCollisionDebugVertex(D,K,pe,ke,je,Xe){return K.emplaceBack(0,0),D.emplaceBack(pe.x,pe.y,ke,je,Math.round(Xe.x),Math.round(Xe.y))}addCollisionDebugVertices(D,K,pe,ke,je,Xe,ft){let Mt=je.segments.prepareSegment(4,je.layoutVertexArray,je.indexArray),Ut=Mt.vertexLength,ir=je.layoutVertexArray,Mr=je.collisionVertexArray,zr=ft.anchorX,Hr=ft.anchorY;this._addCollisionDebugVertex(ir,Mr,Xe,zr,Hr,new n(D,K)),this._addCollisionDebugVertex(ir,Mr,Xe,zr,Hr,new n(pe,K)),this._addCollisionDebugVertex(ir,Mr,Xe,zr,Hr,new n(pe,ke)),this._addCollisionDebugVertex(ir,Mr,Xe,zr,Hr,new n(D,ke)),Mt.vertexLength+=4;let oa=je.indexArray;oa.emplaceBack(Ut,Ut+1),oa.emplaceBack(Ut+1,Ut+2),oa.emplaceBack(Ut+2,Ut+3),oa.emplaceBack(Ut+3,Ut),Mt.primitiveLength+=4}addDebugCollisionBoxes(D,K,pe,ke){for(let je=D;je<K;je++){let Xe=this.collisionBoxArray.get(je);this.addCollisionDebugVertices(Xe.x1,Xe.y1,Xe.x2,Xe.y2,ke?this.textCollisionBox:this.iconCollisionBox,Xe.anchorPoint,pe)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new fv(ql,Pv.members,et),this.iconCollisionBox=new fv(ql,Pv.members,et);for(let D=0;D<this.symbolInstances.length;D++){let K=this.symbolInstances.get(D);this.addDebugCollisionBoxes(K.textBoxStartIndex,K.textBoxEndIndex,K,!0),this.addDebugCollisionBoxes(K.verticalTextBoxStartIndex,K.verticalTextBoxEndIndex,K,!0),this.addDebugCollisionBoxes(K.iconBoxStartIndex,K.iconBoxEndIndex,K,!1),this.addDebugCollisionBoxes(K.verticalIconBoxStartIndex,K.verticalIconBoxEndIndex,K,!1)}}_deserializeCollisionBoxesForSymbol(D,K,pe,ke,je,Xe,ft,Mt,Ut){let ir={};for(let Mr=K;Mr<pe;Mr++){let zr=D.get(Mr);ir.textBox={x1:zr.x1,y1:zr.y1,x2:zr.x2,y2:zr.y2,anchorPointX:zr.anchorPointX,anchorPointY:zr.anchorPointY},ir.textFeatureIndex=zr.featureIndex;break}for(let Mr=ke;Mr<je;Mr++){let zr=D.get(Mr);ir.verticalTextBox={x1:zr.x1,y1:zr.y1,x2:zr.x2,y2:zr.y2,anchorPointX:zr.anchorPointX,anchorPointY:zr.anchorPointY},ir.verticalTextFeatureIndex=zr.featureIndex;break}for(let Mr=Xe;Mr<ft;Mr++){let zr=D.get(Mr);ir.iconBox={x1:zr.x1,y1:zr.y1,x2:zr.x2,y2:zr.y2,anchorPointX:zr.anchorPointX,anchorPointY:zr.anchorPointY},ir.iconFeatureIndex=zr.featureIndex;break}for(let Mr=Mt;Mr<Ut;Mr++){let zr=D.get(Mr);ir.verticalIconBox={x1:zr.x1,y1:zr.y1,x2:zr.x2,y2:zr.y2,anchorPointX:zr.anchorPointX,anchorPointY:zr.anchorPointY},ir.verticalIconFeatureIndex=zr.featureIndex;break}return ir}deserializeCollisionBoxes(D){this.collisionArrays=[];for(let K=0;K<this.symbolInstances.length;K++){let pe=this.symbolInstances.get(K);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(D,pe.textBoxStartIndex,pe.textBoxEndIndex,pe.verticalTextBoxStartIndex,pe.verticalTextBoxEndIndex,pe.iconBoxStartIndex,pe.iconBoxEndIndex,pe.verticalIconBoxStartIndex,pe.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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;je<ke;je+=4)D.indexArray.emplaceBack(je,je+1,je+2),D.indexArray.emplaceBack(je+1,je+2,je+3)}getSortedSymbolIndexes(D){if(this.sortedAngle===D&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let K=Math.sin(D),pe=Math.cos(D),ke=[],je=[],Xe=[];for(let ft=0;ft<this.symbolInstances.length;++ft){Xe.push(ft);let Mt=this.symbolInstances.get(ft);ke.push(0|Math.round(K*Mt.anchorX+pe*Mt.anchorY)),je.push(Mt.featureIndex)}return Xe.sort((ft,Mt)=>ke[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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}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<<Ga-1,va+=(zr&oa?1:0)+(Hr&oa?2:0);return va}(this.z,this.x,this.y);return D[(this.x+this.y)%D.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(pe==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,K>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<pe)throw new Error(`overscaledZ should be >= 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<this.overscaledZ&&D.canonical.x===this.canonical.x>>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.wrap<D.wrap||!(this.wrap>D.wrap)&&(this.overscaledZ<D.overscaledZ||!(this.overscaledZ>D.overscaledZ)&&(this.canonical.x<D.canonical.x||!(this.canonical.x>D.canonical.x)&&this.canonical.y<D.canonical.y))}wrapped(){return new Gp(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(D){return new Gp(this.overscaledZ,D,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Vx(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(D){return this.canonical.getTilePoint(new Ig(D.x-this.wrap,D.y))}}function Rg(G,D,K,pe,ke){(G*=2)<0&&(G=-1*G-1);let je=1<<K;return(je*je*G+je*ke+pe).toString(36)+K.toString(36)+D.toString(36)}xn("CanonicalTileID",V1),xn("OverscaledTileID",Gp,{omit:["posMatrix"]});class qx{constructor(D,K,pe,ke=1,je=1,Xe=1,ft=0){if(this.uid=D,K.height!==K.width)throw new RangeError("DEM tiles must be square");if(pe&&!["mapbox","terrarium","custom"].includes(pe))return void f(`"${pe}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=K.height;let Mt=this.dim=K.height-2;switch(this.data=new Uint32Array(K.data.buffer),pe){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=ke,this.greenFactor=je,this.blueFactor=Xe,this.baseShift=ft;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let Ut=0;Ut<Mt;Ut++)this.data[this._idx(-1,Ut)]=this.data[this._idx(0,Ut)],this.data[this._idx(Mt,Ut)]=this.data[this._idx(Mt-1,Ut)],this.data[this._idx(Ut,-1)]=this.data[this._idx(Ut,0)],this.data[this._idx(Ut,Mt)]=this.data[this._idx(Ut,Mt-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(Mt,-1)]=this.data[this._idx(Mt-1,0)],this.data[this._idx(-1,Mt)]=this.data[this._idx(0,Mt-1)],this.data[this._idx(Mt,Mt)]=this.data[this._idx(Mt-1,Mt-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let Ut=0;Ut<Mt;Ut++)for(let ir=0;ir<Mt;ir++){let Mr=this.get(Ut,ir);Mr>this.max&&(this.max=Mr),Mr<this.min&&(this.min=Mr)}}get(D,K){let pe=new Uint8Array(this.data.buffer),ke=4*this._idx(D,K);return this.unpack(pe[ke],pe[ke+1],pe[ke+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(D,K){if(D<-1||D>=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<ft;ir++)for(let Mr=ke;Mr<je;Mr++)this.data[this._idx(Mr,ir)]=D.data[this._idx(Mr+Mt,ir+Ut)]}}xn("DEMData",qx);class Gx{constructor(D){this._stringToNumber={},this._numberToString=[];for(let K=0;K<D.length;K++){let pe=D[K];this._stringToNumber[pe]=K,this._numberToString[K]=pe}}encode(D){return this._stringToNumber[D]}decode(D){if(D>=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<K.length;Ut++){let ir=K[Ut],Mr=[1/0,1/0,-1/0,-1/0];for(let zr=0;zr<ir.length;zr++){let Hr=ir[zr];Mr[0]=Math.min(Mr[0],Hr.x),Mr[1]=Math.min(Mr[1],Hr.y),Mr[2]=Math.max(Mr[2],Hr.x),Mr[3]=Math.max(Mr[3],Hr.y)}Mr[0]<vo&&Mr[1]<vo&&Mr[2]>=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<Wn.length-1;Di++)if(wn(Wn[Di],Wn[Di+1],yo))return!0;return!1}(D.cameraQueryGeometry,Ga-Ut,$a-Ut,Kn+Ut,bn+Ut));for(let Ga of Hr)Mr.push(Ga);Mr.sort(eA);let oa={},va;for(let Ga=0;Ga<Mr.length;Ga++){let $a=Mr[Ga];if($a===va)continue;va=$a;let Kn=this.featureIndexArray.get($a),bn=null;this.loadMatchingFeature(oa,Kn.bucketIndex,Kn.sourceLayerIndex,Kn.featureIndex,ft,je.layers,je.availableImages,K,pe,ke,(Wn,ai,ji)=>(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<Ga.length;Kn++)if($a.indexOf(Ga[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<zr.length;Ga++){let $a=zr[Ga];if(Xe&&Xe.indexOf($a)<0)continue;let Kn=Mt[$a];if(!Kn)continue;let bn={};va&&ir&&(bn=ir.getState(Kn.sourceLayer||"_geojsonTileLayer",va));let Wn=E({},Ut[$a]);Wn.paint=Hx(Wn.paint,Kn.paint,oa,bn,ft),Wn.layout=Hx(Wn.layout,Kn.layout,oa,bn,ft);let ai=!Mr||Mr(oa,Kn,bn);if(!ai)continue;let ji=new q1(oa,this.z,this.x,this.y,va);ji.layer=Wn;let ko=D[$a];ko===void 0&&(ko=D[$a]=[]),ko.push({featureIndex:ke,feature:ji,intersectionZ:ai})}}lookupSymbolFeatures(D,K,pe,ke,je,Xe,ft,Mt){let Ut={};this.loadVTLayers();let ir=Sc(je);for(let Mr of D)this.loadMatchingFeature(Ut,pe,ke,Mr,ir,Xe,ft,Mt,K);return Ut}hasLayer(D){for(let K of this.bucketLayerIDs)for(let pe of K)if(D===pe)return!0;return!1}getId(D,K){let pe=D.id;return this.promoteId&&(pe=D.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[K]],typeof pe=="boolean"&&(pe=Number(pe))),pe}}function Hx(G,D,K,pe,ke){return b(G,(je,Xe)=>{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<G.length;Xe++){let ft=G[Xe],Mt;for(let Ut=0;Ut<ft.length-1;Ut++){let ir=ft[Ut],Mr=ft[Ut+1];ir.x<D&&Mr.x<D||(ir.x<D?ir=new n(D,ir.y+(D-ir.x)/(Mr.x-ir.x)*(Mr.y-ir.y))._round():Mr.x<D&&(Mr=new n(D,ir.y+(D-ir.x)/(Mr.x-ir.x)*(Mr.y-ir.y))._round()),ir.y<K&&Mr.y<K||(ir.y<K?ir=new n(ir.x+(K-ir.y)/(Mr.y-ir.y)*(Mr.x-ir.x),K)._round():Mr.y<K&&(Mr=new n(ir.x+(K-ir.y)/(Mr.y-ir.y)*(Mr.x-ir.x),K)._round()),ir.x>=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(;ft<K/2;){let ir=G[Xe],Mr=G[Xe+1];if(!Mr)return!1;let zr=G[Xe-1].angleTo(ir)-ir.angleTo(Mr);for(zr=Math.abs((zr+3*Math.PI)%(2*Math.PI)-Math.PI),Mt.push({distance:ft,angleDelta:zr}),Ut+=zr;ft-Mt[0].distance>pe;)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;K<G.length-1;K++)D+=G[K].dist(G[K+1]);return D}function Yx(G,D,K){return G?.6*D*K:0}function Kx(G,D){return Math.max(G?G.right-G.left:0,D?D.right-D.left:0)}function tA(G,D,K,pe,ke,je){let Xe=Yx(K,ke,je),ft=Kx(K,pe)*je,Mt=0,Ut=Zx(G)/2;for(let ir=0;ir<G.length-1;ir++){let Mr=G[ir],zr=G[ir+1],Hr=Mr.dist(zr);if(Mt+Hr>Ut){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<D/4&&(D=Mr+D/4),Jx(G,zr?D/2*ft%D:(ir/2+2*je)*Xe*ft%D,D,Ut,K,Mr,zr,!1,Mt)}function Jx(G,D,K,pe,ke,je,Xe,ft,Mt){let Ut=je/2,ir=Zx(G),Mr=0,zr=D-K,Hr=[];for(let oa=0;oa<G.length-1;oa++){let va=G[oa],Ga=G[oa+1],$a=va.dist(Ga),Kn=Ga.angleTo(va);for(;zr+K<Mr+$a;){zr+=K;let bn=(zr-Mr)/$a,Wn=Xi.number(va.x,Ga.x,bn),ai=Xi.number(va.y,Ga.y,bn);if(Wn>=0&&Wn<Mt&&ai>=0&&ai<Mt&&zr-Ut>=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;Uu<us.length-1;Uu++)ke.push(Bo(Es,us[Uu],Ku,us[Uu+1]))}}else ke.push(Bo({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ft+1},{fixed:0,stretch:Mt+1}));return ke}function Xd(G,D,K){let pe=0;for(let ke of G)pe+=Math.max(D,Math.min(K,ke[1]))-Math.max(D,Math.min(K,ke[0]));return pe}function Qx(G,D,K){let pe=[{fixed:-fm,stretch:0}];for(let[ke,je]of G){let Xe=pe[pe.length-1];pe.push({fixed:ke-Xe.stretch,stretch:Xe.stretch}),pe.push({fixed:ke-Xe.stretch,stretch:Xe.stretch+(je-ke)})}return pe.push({fixed:D+fm,stretch:K}),pe}function L0(G,D,K,pe){return G/D*K+pe}function hm(G,D,K,pe){return G-D*K/pe}class hv{constructor(D,K,pe,ke,je,Xe,ft,Mt,Ut,ir){var Mr;if(this.boxStartIndex=D.length,Ut){let zr=Xe.top,Hr=Xe.bottom,oa=Xe.collisionPadding;oa&&(zr-=oa[1],Hr+=oa[3]);let va=Hr-zr;va>0&&(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)=>pe<ke?-1:pe>ke?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<ke;){let Xe=1+(D<<1),ft=Xe+1;if(ft<this.length&&pe(K[ft],K[Xe])<0&&(Xe=ft),pe(K[Xe],je)>=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;Hr<ft.length;Hr++){let oa=ft[Hr];(!Hr||oa.x<pe)&&(pe=oa.x),(!Hr||oa.y<ke)&&(ke=oa.y),(!Hr||oa.x>je)&&(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;Hr<je;Hr+=Mt)for(let oa=ke;oa<Xe;oa+=Mt)ir.push(new pm(Hr+Ut,oa+Ut,Ut,G));let Mr=function(Hr){let oa=0,va=0,Ga=0,$a=Hr[0];for(let Kn=0,bn=$a.length,Wn=bn-1;Kn<bn;Wn=Kn++){let ai=$a[Kn],ji=$a[Wn],ko=ai.x*ji.y-ji.x*ai.y;va+=(ai.x+ji.x)*ko,Ga+=(ai.y+ji.y)*ko,oa+=3*ko}return new pm(va/oa,Ga/oa,0,Hr)}(G),zr=ir.length;for(;ir.length;){let Hr=ir.pop();(Hr.d>Mr.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;Mt<je.length;Mt++){let Ut=je[Mt];for(let ir=0,Mr=Ut.length,zr=Mr-1;ir<Mr;zr=ir++){let Hr=Ut[ir],oa=Ut[zr];Hr.y>ke.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;Ut<ft.length;Ut+=2){let ir=Mt[Ut]=ft[Ut],Mr=ft[Ut+1].map(zr=>zr*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<ep.length;Bh+=2){let id=ep[Bh+1];Oh.emplaceBack(e.aq[ep[Bh]],id[0],id[1])}return[dv,Oh.length]}(No.textAnchorOffsets,$1);No.symbolInstances.emplaceBack(Es.x,Es.y,xd.right>=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])<K)return!0}else ke[D]=[];return ke[D].push(pe),!1}let ab=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class X1{static from(D){if(!(D instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[K,pe]=new Uint8Array(D,0,2);if(K!==219)throw new Error("Data does not appear to be in a KDBush format.");let ke=pe>>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);ft<Mt;){for(Dg(G,D,ft,Mt),ft++,Mt--;D[2*ft+je]<Xe;)ft++;for(;D[2*Mt+je]>Xe;)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:"<cancel>",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==="<cancel>"){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==="<response>"){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:"<response>",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<D.length;pe++){let ke=D[pe];ke in G&&(K[ke]=G[ke])}return K},e.N=Hd,e.O=C0,e.P=n,e.Q=jx,e.R=zn,e.S=Gp,e.T=Zu,e.U=d,e.V=T,e.W=O,e.X=vo,e.Y=pt,e.Z=Ig,e._=t,e.a=Q,e.a$=function(G,D){var K=G[0],pe=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],va=G[13],Ga=G[14],$a=G[15],Kn=D[0],bn=D[1],Wn=D[2],ai=D[3],ji=D[4],ko=D[5],vs=D[6],yo=D[7],Di=D[8],ns=D[9],qo=D[10],Bo=D[11],_i=D[12],us=D[13],No=D[14],Es=D[15];return Math.abs(K-Kn)<=Ea*Math.max(1,Math.abs(K),Math.abs(Kn))&&Math.abs(pe-bn)<=Ea*Math.max(1,Math.abs(pe),Math.abs(bn))&&Math.abs(ke-Wn)<=Ea*Math.max(1,Math.abs(ke),Math.abs(Wn))&&Math.abs(je-ai)<=Ea*Math.max(1,Math.abs(je),Math.abs(ai))&&Math.abs(Xe-ji)<=Ea*Math.max(1,Math.abs(Xe),Math.abs(ji))&&Math.abs(ft-ko)<=Ea*Math.max(1,Math.abs(ft),Math.abs(ko))&&Math.abs(Mt-vs)<=Ea*Math.max(1,Math.abs(Mt),Math.abs(vs))&&Math.abs(Ut-yo)<=Ea*Math.max(1,Math.abs(Ut),Math.abs(yo))&&Math.abs(ir-Di)<=Ea*Math.max(1,Math.abs(ir),Math.abs(Di))&&Math.abs(Mr-ns)<=Ea*Math.max(1,Math.abs(Mr),Math.abs(ns))&&Math.abs(zr-qo)<=Ea*Math.max(1,Math.abs(zr),Math.abs(qo))&&Math.abs(Hr-Bo)<=Ea*Math.max(1,Math.abs(Hr),Math.abs(Bo))&&Math.abs(oa-_i)<=Ea*Math.max(1,Math.abs(oa),Math.abs(_i))&&Math.abs(va-us)<=Ea*Math.max(1,Math.abs(va),Math.abs(us))&&Math.abs(Ga-No)<=Ea*Math.max(1,Math.abs(Ga),Math.abs(No))&&Math.abs($a-Es)<=Ea*Math.max(1,Math.abs($a),Math.abs(Es))},e.a0=St,e.a1=V1,e.a2=_e,e.a3=G=>{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<Ut.length;Wn++)va=Ut[Wn],Object.prototype.hasOwnProperty.call(zr,va)?ai++:(ze(Mt,{command:"removeLayer",args:[va]}),Hr.splice(Hr.indexOf(va,ai),1));for(let Wn=0,ai=0;Wn<ir.length;Wn++)va=ir[ir.length-1-Wn],Hr[Hr.length-1-Wn]!==va&&(Object.prototype.hasOwnProperty.call(Mr,va)?(ze(Mt,{command:"removeLayer",args:[va]}),Hr.splice(Hr.lastIndexOf(va,Hr.length-ai),1)):ai++,Kn=Hr[Hr.length-Wn],ze(Mt,{command:"addLayer",args:[zr[va],Kn]}),Hr.splice(Hr.length-Wn,0,va),oa[va]=!0);for(let Wn=0;Wn<ir.length;Wn++)if(va=ir[Wn],Ga=Mr[va],$a=zr[va],!oa[va]&&!Ae(Ga,$a))if(Ae(Ga.source,$a.source)&&Ae(Ga["source-layer"],$a["source-layer"])&&Ae(Ga.type,$a.type)){for(bn in tt(Ga.layout,$a.layout,Mt,va,null,"setLayoutProperty"),tt(Ga.paint,$a.paint,Mt,va,null,"setPaintProperty"),Ae(Ga.filter,$a.filter)||ze(Mt,{command:"setFilter",args:[va,$a.filter]}),Ae(Ga.minzoom,$a.minzoom)&&Ae(Ga.maxzoom,$a.maxzoom)||ze(Mt,{command:"setLayerZoomRange",args:[va,$a.minzoom,$a.maxzoom]}),Ga)Object.prototype.hasOwnProperty.call(Ga,bn)&&bn!=="layout"&&bn!=="paint"&&bn!=="filter"&&bn!=="metadata"&&bn!=="minzoom"&&bn!=="maxzoom"&&(bn.indexOf("paint.")===0?tt(Ga[bn],$a[bn],Mt,va,bn.slice(6),"setPaintProperty"):Ae(Ga[bn],$a[bn])||ze(Mt,{command:"setLayerProperty",args:[va,bn,$a[bn]]}));for(bn in $a)Object.prototype.hasOwnProperty.call($a,bn)&&!Object.prototype.hasOwnProperty.call(Ga,bn)&&bn!=="layout"&&bn!=="paint"&&bn!=="filter"&&bn!=="metadata"&&bn!=="minzoom"&&bn!=="maxzoom"&&(bn.indexOf("paint.")===0?tt(Ga[bn],$a[bn],Mt,va,bn.slice(6),"setPaintProperty"):Ae(Ga[bn],$a[bn])||ze(Mt,{command:"setLayerProperty",args:[va,bn,$a[bn]]}))}else ze(Mt,{command:"removeLayer",args:[va]}),Kn=Hr[Hr.lastIndexOf(va)+1],ze(Mt,{command:"addLayer",args:[$a,Kn]})}(je,D.layers,K)}catch(pe){console.warn("Unable to compute style diff:",pe),K=[{command:"setStyle",args:[D]}]}return K},e.aD=function(G){let D=[],K=G.id;return K===void 0&&D.push({message:`layers.${K}: missing required property "id"`}),G.render===void 0&&D.push({message:`layers.${K}: missing required method "render"`}),G.renderingMode&&G.renderingMode!=="2d"&&G.renderingMode!=="3d"&&D.push({message:`layers.${K}: property "renderingMode" must be either "2d" or "3d"`}),D},e.aE=function G(D,K){if(Array.isArray(D)){if(!Array.isArray(K)||D.length!==K.length)return!1;for(let pe=0;pe<D.length;pe++)if(!G(D[pe],K[pe]))return!1;return!0}if(typeof D=="object"&&D!==null&&K!==null){if(typeof K!="object"||Object.keys(D).length!==Object.keys(K).length)return!1;for(let pe in D)if(!G(D[pe],K[pe]))return!1;return!0}return D===K},e.aF=b,e.aG=p,e.aH=class extends cn{constructor(G,D){super(G,D),this.current=0}set(G){this.current!==G&&(this.current=G,this.gl.uniform1i(this.location,G))}},e.aI=Pa,e.aJ=class extends cn{constructor(G,D){super(G,D),this.current=vi}set(G){if(G[12]!==this.current[12]||G[0]!==this.current[0])return this.current=G,void this.gl.uniformMatrix4fv(this.location,!1,G);for(let D=1;D<16;D++)if(G[D]!==this.current[D]){this.current=G,this.gl.uniformMatrix4fv(this.location,!1,G);break}}},e.aK=si,e.aL=ni,e.aM=Wt,e.aN=class extends cn{constructor(G,D){super(G,D),this.current=[0,0,0]}set(G){G[0]===this.current[0]&&G[1]===this.current[1]&&G[2]===this.current[2]||(this.current=G,this.gl.uniform3f(this.location,G[0],G[1],G[2]))}},e.aO=class extends cn{constructor(G,D){super(G,D),this.current=[0,0]}set(G){G[0]===this.current[0]&&G[1]===this.current[1]||(this.current=G,this.gl.uniform2f(this.location,G[0],G[1]))}},e.aP=function(G,D,K,pe,ke,je,Xe){var ft=1/(D-K),Mt=1/(pe-ke),Ut=1/(je-Xe);return G[0]=-2*ft,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=-2*Mt,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=2*Ut,G[11]=0,G[12]=(D+K)*ft,G[13]=(ke+pe)*Mt,G[14]=(Xe+je)*Ut,G[15]=1,G},e.aQ=Rn,e.aR=class extends Dt{},e.aS=iv,e.aT=class extends mr{},e.aU=Ei,e.aV=function(G){return G<=1?1:Math.pow(2,Math.ceil(Math.log(G)/Math.LN2))},e.aW=ii,e.aX=es,e.aY=De,e.aZ=class extends vn{},e.a_=function(G,D){return G[0]===D[0]&&G[1]===D[1]&&G[2]===D[2]&&G[3]===D[3]&&G[4]===D[4]&&G[5]===D[5]&&G[6]===D[6]&&G[7]===D[7]&&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]},e.aa=function(G){let D={};if(G.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\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;K<G.length;K++)D[G[K].id]=G[K];for(let K=0;K<G.length;K++)"ref"in G[K]&&(G[K]=be(G[K],D[G[K].ref]));return G},e.b=F,e.b0=function(G,D){return G[0]=D[0],G[1]=D[1],G[2]=D[2],G[3]=D[3],G[4]=D[4],G[5]=D[5],G[6]=D[6],G[7]=D[7],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},e.b1=function(G,D,K){return G[0]=D[0]*K[0],G[1]=D[1]*K[1],G[2]=D[2]*K[2],G[3]=D[3]*K[3],G},e.b2=function(G,D){return G[0]*D[0]+G[1]*D[1]+G[2]*D[2]+G[3]*D[3]},e.b3=S,e.b4=Vx,e.b5=k0,e.b6=function(G,D,K,pe,ke){var je,Xe=1/Math.tan(D/2);return G[0]=Xe/K,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=Xe,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[11]=-1,G[12]=0,G[13]=0,G[15]=0,ke!=null&&ke!==1/0?(G[10]=(ke+pe)*(je=1/(pe-ke)),G[14]=2*ke*pe*je):(G[10]=-1,G[14]=-2*pe),G},e.b7=function(G,D,K){var pe=Math.sin(K),ke=Math.cos(K),je=D[4],Xe=D[5],ft=D[6],Mt=D[7],Ut=D[8],ir=D[9],Mr=D[10],zr=D[11];return D!==G&&(G[0]=D[0],G[1]=D[1],G[2]=D[2],G[3]=D[3],G[12]=D[12],G[13]=D[13],G[14]=D[14],G[15]=D[15]),G[4]=je*ke+Ut*pe,G[5]=Xe*ke+ir*pe,G[6]=ft*ke+Mr*pe,G[7]=Mt*ke+zr*pe,G[8]=Ut*ke-je*pe,G[9]=ir*ke-Xe*pe,G[10]=Mr*ke-ft*pe,G[11]=zr*ke-Mt*pe,G},e.b8=l,e.b9=_,e.bA=Dh,e.bB=function(G){return G.message===U},e.bC=il,e.bD=Xs,e.ba=function(G){return G*Math.PI/180},e.bb=function(G,D){let{x:K,y:pe}=Ig.fromLngLat(D);return!(G<0||G>25||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;ke<G.length;ke++){let je=D&&D[G[ke].id]||uh(G[ke]);D&&(D[G[ke].id]=je);let Xe=K[je];Xe||(Xe=K[je]=[]),Xe.push(G[ke])}let pe=[];for(let ke in K)pe.push(K[ke]);return pe},e.bl=xn,e.bm=Gx,e.bn=zv,e.bo=w0,e.bp=function(G){G.bucket.createArrays(),G.bucket.tilePixelRatio=vo/(512*G.bucket.overscaling),G.bucket.compareText={},G.bucket.iconsNeedLinear=!1;let D=G.bucket.layers[0],K=D.layout,pe=D._unevaluatedLayout._values,ke={layoutIconSize:pe["icon-size"].possiblyEvaluate(new Ls(G.bucket.zoom+1),G.canonical),layoutTextSize:pe["text-size"].possiblyEvaluate(new Ls(G.bucket.zoom+1),G.canonical),textMaxSize:pe["text-size"].possiblyEvaluate(new Ls(18))};if(G.bucket.textSizeData.kind==="composite"){let{minZoom:Ut,maxZoom:ir}=G.bucket.textSizeData;ke.compositeTextSizes=[pe["text-size"].possiblyEvaluate(new Ls(Ut),G.canonical),pe["text-size"].possiblyEvaluate(new Ls(ir),G.canonical)]}if(G.bucket.iconSizeData.kind==="composite"){let{minZoom:Ut,maxZoom:ir}=G.bucket.iconSizeData;ke.compositeIconSizes=[pe["icon-size"].possiblyEvaluate(new Ls(Ut),G.canonical),pe["icon-size"].possiblyEvaluate(new Ls(ir),G.canonical)]}let je=K.get("text-line-height")*lu,Xe=K.get("text-rotation-alignment")!=="viewport"&&K.get("symbol-placement")!=="point",ft=K.get("text-keep-upright"),Mt=K.get("text-size");for(let Ut of G.bucket.features){let ir=K.get("text-font").evaluate(Ut,{},G.canonical).join(","),Mr=Mt.evaluate(Ut,{},G.canonical),zr=ke.layoutTextSize.evaluate(Ut,{},G.canonical),Hr=ke.layoutIconSize.evaluate(Ut,{},G.canonical),oa={horizontal:{},vertical:void 0},va=Ut.text,Ga,$a=[0,0];if(va){let Wn=va.toString(),ai=K.get("text-letter-spacing").evaluate(Ut,{},G.canonical)*lu,ji=Qo(Wn)?ai:0,ko=K.get("text-anchor").evaluate(Ut,{},G.canonical),vs=eb(D,Ut,G.canonical);if(!vs){let qo=K.get("text-radial-offset").evaluate(Ut,{},G.canonical);$a=qo?H1(ko,[qo*lu,Fv]):K.get("text-offset").evaluate(Ut,{},G.canonical).map(Bo=>Bo*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;_i<vs.values.length;_i+=2)qo.add(W1(vs.values[_i]));else qo.add(yo);let Bo=!1;for(let _i of qo)if(!oa.horizontal[_i])if(Bo)oa.horizontal[_i]=oa.horizontal[0];else{let us=Ag(va,G.glyphMap,G.glyphPositions,G.imagePositions,ir,Di,je,"center",_i,ji,$a,e.ah.horizontal,!1,zr,Mr);us&&(oa.horizontal[_i]=us,Bo=us.positionedLines.length===1)}ns()}else{yo==="auto"&&(yo=W1(ko));let qo=Ag(va,G.glyphMap,G.glyphPositions,G.imagePositions,ir,Di,je,ko,yo,ji,$a,e.ah.horizontal,!1,zr,Mr);qo&&(oa.horizontal[yo]=qo),ns(),xo(Wn)&&Xe&&ft&&(oa.vertical=Ag(va,G.glyphMap,G.glyphPositions,G.imagePositions,ir,Di,je,ko,yo,ji,$a,e.ah.vertical,!1,zr,Mr))}}let Kn=!1;if(Ut.icon&&Ut.icon.name){let Wn=G.imageMap[Ut.icon.name];Wn&&(Ga=Sg(G.imagePositions[Ut.icon.name],K.get("icon-offset").evaluate(Ut,{},G.canonical),K.get("icon-anchor").evaluate(Ut,{},G.canonical)),Kn=!!Wn.sdf,G.bucket.sdfIcons===void 0?G.bucket.sdfIcons=Kn:G.bucket.sdfIcons!==Kn&&f("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Wn.pixelRatio!==G.bucket.pixelRatio||K.get("icon-rotate").constantOr(1)!==0)&&(G.bucket.iconsNeedLinear=!0))}let bn=rb(oa.horizontal)||oa.vertical;G.bucket.iconsInText=!!bn&&bn.iconsInText,(bn||Ga)&&iA(G.bucket,Ut,oa,Ga,G.imageMap,ke,zr,Hr,$a,Kn,G.canonical)}G.showCollisionBoxes&&G.bucket.generateCollisionDebugBuffers()},e.bq=qp,e.br=fr,e.bs=Fo,e.bt=Jr,e.bu=P1,e.bv=class{constructor(G){this._marks={start:[G.url,"start"].join("#"),end:[G.url,"end"].join("#"),measure:G.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let G=performance.getEntriesByName(this._marks.measure);return G.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),G=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),G}},e.bw=function(G,D,K,pe,ke){return t(this,void 0,void 0,function*(){if(T())try{return yield O(G,D,K,pe,ke)}catch{}return function(je,Xe,ft,Mt,Ut){let ir=je.width,Mr=je.height;I&&N||(I=new OffscreenCanvas(ir,Mr),N=I.getContext("2d",{willReadFrequently:!0})),I.width=ir,I.height=Mr,N.drawImage(je,0,0,ir,Mr);let zr=N.getImageData(Xe,ft,Mt,Ut);return N.clearRect(0,0,ir,Mr),zr.data}(G,D,K,pe,ke)})},e.bx=qx,e.by=r,e.bz=i,e.c=W,e.d=G=>t(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<za.length;Jt++){let Nt=za.feature(Jt),Kt=Ce.getId(Nt,Qa);kn.push({feature:Nt,id:Kt,index:Jt,sourceLayerIndex:en})}for(let Jt of at[Qa]){let Nt=Jt[0];Nt.source!==this.source&&e.w(`layer.source = ${Nt.source} does not equal this.source = ${this.source}`),Nt.minzoom&&this.zoom<Math.floor(Nt.minzoom)||Nt.maxzoom&&this.zoom>=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<bt.length;Ke++)c(bt[Ke],!Be)}}function c(bt,Be){for(var Ke=0,Ue=0,Ee=0,Ve=bt.length,Ce=Ve-1;Ee<Ve;Ce=Ee++){var Te=(bt[Ee][0]-bt[Ce][0])*(bt[Ce][1]+bt[Ee][1]),Pe=Ke+Te;Ue+=Math.abs(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<Be.features.length;Ue++)bt(Be.features[Ue],Ke);else if(Ee==="GeometryCollection")for(Ue=0;Ue<Be.geometries.length;Ue++)bt(Be.geometries[Ue],Ke);else if(Ee==="Feature")bt(Be.geometry,Ke);else if(Ee==="Polygon")s(Be.coordinates,Ke);else if(Ee==="MultiPolygon")for(Ue=0;Ue<Be.coordinates.length;Ue++)s(Be.coordinates[Ue],Ke);return Be});let m=e.bt.VectorTileFeature.prototype.toGeoJSON;var d={exports:{}},T=e.bz,l=e.bt.VectorTileFeature,_=w;function w(bt,Be){this.options=Be||{},this.features=bt,this.length=bt.length}function S(bt,Be){this.id=typeof bt.id=="number"?bt.id:void 0,this.type=bt.type,this.rawGeometry=bt.type===1?[bt.geometry]:bt.geometry,this.properties=bt.tags,this.extent=Be||4096}w.prototype.feature=function(bt){return new S(this.features[bt],this.options.extent)},S.prototype.loadGeometry=function(){var bt=this.rawGeometry;this.geometry=[];for(var Be=0;Be<bt.length;Be++){for(var Ke=bt[Be],Ue=[],Ee=0;Ee<Ke.length;Ee++)Ue.push(new T(Ke[Ee][0],Ke[Ee][1]));this.geometry.push(Ue)}return this.geometry},S.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var bt=this.geometry,Be=1/0,Ke=-1/0,Ue=1/0,Ee=-1/0,Ve=0;Ve<bt.length;Ve++)for(var Ce=bt[Ve],Te=0;Te<Ce.length;Te++){var Pe=Ce[Te];Be=Math.min(Be,Pe.x),Ke=Math.max(Ke,Pe.x),Ue=Math.min(Ue,Pe.y),Ee=Math.max(Ee,Pe.y)}return[Be,Ue,Ke,Ee]},S.prototype.toGeoJSON=l.prototype.toGeoJSON;var E=e.bA,g=_;function b(bt){var Be=new E;return function(Ke,Ue){for(var Ee in Ke.layers)Ue.writeMessage(3,p,Ke.layers[Ee])}(bt,Be),Be.finish()}function p(bt,Be){var Ke;Be.writeVarintField(15,bt.version||1),Be.writeStringField(1,bt.name||""),Be.writeVarintField(5,bt.extent||4096);var Ue={keys:[],values:[],keycache:{},valuecache:{}};for(Ke=0;Ke<bt.length;Ke++)Ue.feature=bt.feature(Ke),Be.writeMessage(2,u,Ue);var Ee=Ue.keys;for(Ke=0;Ke<Ee.length;Ke++)Be.writeStringField(3,Ee[Ke]);var Ve=Ue.values;for(Ke=0;Ke<Ve.length;Ke++)Be.writeMessage(4,z,Ve[Ke])}function u(bt,Be){var Ke=bt.feature;Ke.id!==void 0&&Be.writeVarintField(1,Ke.id),Be.writeMessage(2,y,bt),Be.writeVarintField(3,Ke.type),Be.writeMessage(4,L,Ke)}function y(bt,Be){var Ke=bt.feature,Ue=bt.keys,Ee=bt.values,Ve=bt.keycache,Ce=bt.valuecache;for(var Te in Ke.properties){var Pe=Ke.properties[Te],at=Ve[Te];if(Pe!==null){at===void 0&&(Ue.push(Te),Ve[Te]=at=Ue.length-1),Be.writeVarint(at);var yt=typeof Pe;yt!=="string"&&yt!=="boolean"&&yt!=="number"&&(Pe=JSON.stringify(Pe));var Tt=yt+":"+Pe,Ot=Ce[Tt];Ot===void 0&&(Ee.push(Pe),Ce[Tt]=Ot=Ee.length-1),Be.writeVarint(Ot)}}}function f(bt,Be){return(Be<<3)+(7&bt)}function P(bt){return bt<<1^bt>>31}function L(bt,Be){for(var Ke=bt.loadGeometry(),Ue=bt.type,Ee=0,Ve=0,Ce=Ke.length,Te=0;Te<Ce;Te++){var Pe=Ke[Te],at=1;Ue===1&&(at=Pe.length),Be.writeVarint(f(1,at));for(var yt=Ue===3?Pe.length-1:Pe.length,Tt=0;Tt<yt;Tt++){Tt===1&&Ue!==1&&Be.writeVarint(f(2,yt-1));var Ot=Pe[Tt].x-Ee,Gt=Pe[Tt].y-Ve;Be.writeVarint(P(Ot)),Be.writeVarint(P(Gt)),Ee+=Ot,Ve+=Gt}Ue===3&&Be.writeVarint(f(7,1))}}function z(bt,Be){var Ke=typeof bt;Ke==="string"?Be.writeStringField(1,bt):Ke==="boolean"?Be.writeBooleanField(7,bt):Ke==="number"&&(bt%1!=0?Be.writeDoubleField(3,bt):bt<0?Be.writeSVarintField(6,bt):Be.writeVarintField(5,bt))}d.exports=b,d.exports.fromVectorTileJs=b,d.exports.fromGeojsonVt=function(bt,Be){Be=Be||{};var Ke={};for(var Ue in bt)Ke[Ue]=new g(bt[Ue].features,Be),Ke[Ue].name=Ue,Ke[Ue].version=Be.version,Ke[Ue].extent=Be.extent;return b({layers:Ke})},d.exports.GeoJSONWrapper=g;var F=e.by(d.exports);let B={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:bt=>bt},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<Be.length;Pe++){let at=Be[Pe];if(!at.geometry)continue;let[yt,Tt]=at.geometry.coordinates,Ot=O(he(yt)),Gt=O(H(Tt));Ce.push(Ot,Gt,1/0,Pe,-1,1),this.options.reduce&&Ce.push(0)}let Te=this.trees[Ee+1]=this._createTree(Ce);Ke&&console.timeEnd(Ve);for(let Pe=Ee;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):Ve<Ee?Ve++:Be.push(Te),Be.length===Ue)break}return Ve}_createTree(Be){let Ke=new e.av(Be.length/this.stride|0,this.options.nodeSize,Float32Array);for(let Ue=0;Ue<Be.length;Ue+=this.stride)Ke.add(Be[Ue],Be[Ue+1]);return Ke.finish(),Ke.data=Be,Ke}_addTileFeatures(Be,Ke,Ue,Ee,Ve,Ce){for(let Te of Be){let Pe=Te*this.stride,at=Ke[Pe+U]>1,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;Tt<Pe.length;Tt+=yt){if(Pe[Tt+2]<=Ke)continue;Pe[Tt+2]=Ke;let Ot=Pe[Tt],Gt=Pe[Tt+1],rr=Be.within(Pe[Tt],Pe[Tt+1],Te),Qt=Pe[Tt+U],Tr=Qt;for(let la of rr){let Ua=la*yt;Pe[Ua+2]>Ke&&(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;la<yt;la++)at.push(Pe[Tt+la]);if(Tr>1)for(let la of rr){let Ua=la*yt;if(!(Pe[Ua+2]<=Ke)){Pe[Ua+2]=Ke;for(let Ba=0;Ba<yt;Ba++)at.push(Pe[Ua+Ba])}}}}return at}_getOriginId(Be){return Be-this.points.length>>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;Ot<Ke;Ot+=3){let Gt=X(bt[Ot],bt[Ot+1],Pe,at,yt,Tt);if(Gt>Ee)Ce=Ot,Ee=Gt;else if(Gt===Ee){let rr=Math.abs(Ot-Ve);rr<Te&&(Ce=Ot,Te=rr)}}Ee>Ue&&(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;Ke<Be.length;Ke+=3)bt.minX=Math.min(bt.minX,Be[Ke]),bt.minY=Math.min(bt.minY,Be[Ke+1]),bt.maxX=Math.max(bt.maxX,Be[Ke]),bt.maxY=Math.max(bt.maxY,Be[Ke+1])}function j(bt,Be,Ke,Ue){if(!Be.geometry)return;let Ee=Be.geometry.coordinates;if(Ee&&Ee.length===0)return;let Ve=Be.geometry.type,Ce=Math.pow(Ke.tolerance/((1<<Ke.maxZoom)*Ke.extent),2),Te=[],Pe=Be.id;if(Ke.promoteId?Pe=Be.properties[Ke.promoteId]:Ke.generateId&&(Pe=Ue||0),Ve==="Point")ee(Ee,Te);else if(Ve==="MultiPoint")for(let at of Ee)ee(at,Te);else if(Ve==="LineString")re(Ee,Te,Ce,!1);else if(Ve==="MultiLineString"){if(Ke.lineMetrics){for(let at of Ee)Te=[],re(at,Te,Ce,!1),bt.push(oe(Pe,"LineString",Te,Be.properties));return}ce(Ee,Te,Ce,!1)}else if(Ve==="Polygon")ce(Ee,Te,Ce,!0);else{if(Ve!=="MultiPolygon"){if(Ve==="GeometryCollection"){for(let at of Be.geometry.geometries)j(bt,{id:Pe,geometry:at,properties:Be.properties},Ke,Ue);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let at of Ee){let yt=[];ce(at,yt,Ce,!0),Te.push(yt)}}bt.push(oe(Pe,Ve,Te,Be.properties))}function ee(bt,Be){Be.push(be(bt[0]),Ae(bt[1]),0)}function re(bt,Be,Ke,Ue){let Ee,Ve,Ce=0;for(let Pe=0;Pe<bt.length;Pe++){let at=be(bt[Pe][0]),yt=Ae(bt[Pe][1]);Be.push(at,yt,0),Pe>0&&(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;Ee<bt.length;Ee++){let Ve=[];re(bt[Ee],Ve,Ke,Ue),Be.push(Ve)}}function be(bt){return bt/360+.5}function Ae(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 ze(bt,Be,Ke,Ue,Ee,Ve,Ce,Te){if(Ue/=Be,Ve>=(Ke/=Be)&&Ce<Ue)return bt;if(Ce<Ke||Ve>=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){Pe.push(at);continue}if(Gt<Ke||Ot>=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<bt.length;Ve+=3){let Ce=bt[Ve+Ee];Ce>=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;Tr<bt.length-3;Tr+=3){let la=bt[Tr],Ua=bt[Tr+1],Ba=bt[Tr+2],Ra=bt[Tr+3],Qa=bt[Tr+4],za=Ee===0?la:Ua,en=Ee===0?Ra:Qa,kn=!1;Ce&&(at=Math.sqrt(Math.pow(la-Ra,2)+Math.pow(Ua-Qa,2))),za<Ke?en>Ke&&(yt=Pe(Te,la,Ua,Ra,Qa,Ke),Ce&&(Te.start=Tt+at*yt)):za>Ue?en<Ue&&(yt=Pe(Te,la,Ua,Ra,Qa,Ue),Ce&&(Te.start=Tt+at*yt)):tt(Te,la,Ua,Ba),en<Ke&&za>=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;Ue<bt.length;Ue++){let Ee=bt[Ue],Ve=Ee.type,Ce;if(Ve==="Point"||Ve==="MultiPoint"||Ve==="LineString")Ce=fe(Ee.geometry,Be);else if(Ve==="MultiLineString"||Ve==="Polygon"){Ce=[];for(let Te of Ee.geometry)Ce.push(fe(Te,Be))}else if(Ve==="MultiPolygon"){Ce=[];for(let Te of Ee.geometry){let Pe=[];for(let at of Te)Pe.push(fe(at,Be));Ce.push(Pe)}}Ke.push(oe(Ee.id,Ve,Ce,Ee.tags))}return Ke}function fe(bt,Be){let Ke=[];Ke.size=bt.size,bt.start!==void 0&&(Ke.start=bt.start,Ke.end=bt.end);for(let Ue=0;Ue<bt.length;Ue+=3)Ke.push(bt[Ue]+Be,bt[Ue+1],bt[Ue+2]);return Ke}function Fe(bt,Be){if(bt.transformed)return bt;let Ke=1<<bt.z,Ue=bt.x,Ee=bt.y;for(let Ve of bt.features){let Ce=Ve.geometry,Te=Ve.type;if(Ve.geometry=[],Te===1)for(let Pe=0;Pe<Ce.length;Pe+=2)Ve.geometry.push(rt(Ce[Pe],Ce[Pe+1],Be,Ke,Ue,Ee));else for(let Pe=0;Pe<Ce.length;Pe++){let at=[];for(let yt=0;yt<Ce[Pe].length;yt+=2)at.push(rt(Ce[Pe][yt],Ce[Pe][yt+1],Be,Ke,Ue,Ee));Ve.geometry.push(at)}}return bt.transformed=!0,bt}function rt(bt,Be,Ke,Ue,Ee,Ve){return[Math.round(Ke*(bt*Ue-Ee)),Math.round(Ke*(Be*Ue-Ve))]}function st(bt,Be,Ke,Ue,Ee){let Ve=Be===Ee.maxZoom?0:Ee.tolerance/((1<<Be)*Ee.extent),Ce={features:[],numPoints:0,numSimplified:0,numFeatures:bt.length,source:null,x:Ke,y:Ue,z:Be,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let Te of bt)Qe(Ce,Te,Ve,Ee);return Ce}function Qe(bt,Be,Ke,Ue){let Ee=Be.geometry,Ve=Be.type,Ce=[];if(bt.minX=Math.min(bt.minX,Be.minX),bt.minY=Math.min(bt.minY,Be.minY),bt.maxX=Math.max(bt.maxX,Be.maxX),bt.maxY=Math.max(bt.maxY,Be.maxY),Ve==="Point"||Ve==="MultiPoint")for(let Te=0;Te<Ee.length;Te+=3)Ce.push(Ee[Te],Ee[Te+1]),bt.numPoints++,bt.numSimplified++;else if(Ve==="LineString")Lt(Ce,Ee,bt,Ke,!1,!1);else if(Ve==="MultiLineString"||Ve==="Polygon")for(let Te=0;Te<Ee.length;Te++)Lt(Ce,Ee[Te],bt,Ke,Ve==="Polygon",Te===0);else if(Ve==="MultiPolygon")for(let Te=0;Te<Ee.length;Te++){let Pe=Ee[Te];for(let at=0;at<Pe.length;at++)Lt(Ce,Pe[at],bt,Ke,!0,at===0)}if(Ce.length){let Te=Be.tags||null;if(Ve==="LineString"&&Ue.lineMetrics){Te={};for(let at in Be.tags)Te[at]=Be.tags[at];Te.mapbox_clip_start=Ee.start/Ee.size,Te.mapbox_clip_end=Ee.end/Ee.size}let Pe={geometry:Ce,type:Ve==="Polygon"||Ve==="MultiPolygon"?3:Ve==="LineString"||Ve==="MultiLineString"?2:1,tags:Te};Be.id!==null&&(Pe.id=Be.id),bt.features.push(Pe)}}function Lt(bt,Be,Ke,Ue,Ee,Ve){let Ce=Ue*Ue;if(Ue>0&&Be.size<(Ee?Ce:Ue))return void(Ke.numPoints+=Be.length/3);let Te=[];for(let Pe=0;Pe<Be.length;Pe+=3)(Ue===0||Be[Pe+2]>Ce)&&(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;Tt<Ot;Gt=Tt,Tt+=2)yt+=(Pe[Tt]-Pe[Gt])*(Pe[Tt+1]+Pe[Gt+1]);if(yt>0===at)for(let Tt=0,Ot=Pe.length;Tt<Ot/2;Tt+=2){let Gt=Pe[Tt],rr=Pe[Tt+1];Pe[Tt]=Pe[Ot-2-Tt],Pe[Tt+1]=Pe[Ot-1-Tt],Pe[Ot-2-Tt]=Gt,Pe[Ot-1-Tt]=rr}}(Te,Ve),bt.push(Te)}let kt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class qt{constructor(Be,Ke){let Ue=(Ke=this.options=function(Ve,Ce){for(let Te in Ce)Ve[Te]=Ce[Te];return Ve}(Object.create(kt),Ke)).debug;if(Ue&&console.time("preprocess data"),Ke.maxZoom<0||Ke.maxZoom>24)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;Pe<Ve.features.length;Pe++)j(Te,Ve.features[Pe],Ce,Pe);else j(Te,Ve.type==="Feature"?Ve:{geometry:Ve},Ce);return Te}(Be,Ke);this.tiles={},this.tileCoords=[],Ue&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Ke.indexMaxZoom,Ke.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ee=function(Ve,Ce){let Te=Ce.buffer/Ce.extent,Pe=Ve,at=ze(Ve,1,-1-Te,Te,0,-1,2,Ce),yt=ze(Ve,1,1-Te,2+Te,0,-1,2,Ce);return(at||yt)&&(Pe=ze(Ve,1,-Te,1+Te,0,-1,2,Ce)||[],at&&(Pe=_e(at,1).concat(Pe)),yt&&(Pe=Pe.concat(_e(yt,-1)))),Pe}(Ee,Ke),Ee.length&&this.splitTile(Ee,0,0,0),Ue&&(Ee.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)))}splitTile(Be,Ke,Ue,Ee,Ve,Ce,Te){let Pe=[Be,Ke,Ue,Ee],at=this.options,yt=at.debug;for(;Pe.length;){Ee=Pe.pop(),Ue=Pe.pop(),Ke=Pe.pop(),Be=Pe.pop();let Tt=1<<Ke,Ot=Zt(Ke,Ue,Ee),Gt=this.tiles[Ot];if(!Gt&&(yt>1&&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<<Be,Pe=Zt(Be,Ke=Ke+Te&Te-1,Ue);if(this.tiles[Pe])return Fe(this.tiles[Pe],Ve);Ce>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<<bt)*Ke+Be)+bt}function Sr(bt,Be){return Be?bt.properties[Be]:bt.id}function xr(bt,Be){if(bt==null)return!0;if(bt.type==="Feature")return Sr(bt,Be)!=null;if(bt.type==="FeatureCollection"){let Ke=new Set;for(let Ue of bt.features){let Ee=Sr(Ue,Be);if(Ee==null||Ke.has(Ee))return!1;Ke.add(Ee)}return!0}return!1}function jr(bt,Be){let Ke=new Map;if(bt!=null)if(bt.type==="Feature")Ke.set(Sr(bt,Be),bt);else for(let Ue of bt.features)Ke.set(Sr(Ue,Be),Ue);return Ke}class wr extends n{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Be,Ke){return e._(this,void 0,void 0,function*(){let Ue=Be.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let Ee=this._geoJSONIndex.getTile(Ue.z,Ue.x,Ue.y);if(!Ee)return null;let Ve=new class{constructor(Te){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.X,this.length=Te.length,this._features=Te}feature(Te){return new class{constructor(Pe){this._feature=Pe,this.extent=e.X,this.type=Pe.type,this.properties=Pe.tags,"id"in Pe&&!isNaN(Pe.id)&&(this.id=parseInt(Pe.id,10))}loadGeometry(){if(this._feature.type===1){let Pe=[];for(let at of this._feature.geometry)Pe.push([new e.P(at[0],at[1])]);return Pe}{let Pe=[];for(let at of this._feature.geometry){let yt=[];for(let Tt of at)yt.push(new e.P(Tt[0],Tt[1]));Pe.push(yt)}return Pe}}toGeoJSON(Pe,at,yt){return m.call(this,Pe,at,yt)}}(this._features[Te])}}(Ee.features),Ce=F(Ve);return Ce.byteOffset===0&&Ce.byteLength===Ce.buffer.byteLength||(Ce=new Uint8Array(Ce)),{vectorTile:Ve,rawData:Ce.buffer}})}loadData(Be){return e._(this,void 0,void 0,function*(){var Ke;(Ke=this._pendingRequest)===null||Ke===void 0||Ke.abort();let Ue=!!(Be&&Be.request&&Be.request.collectResourceTiming)&&new e.bv(Be.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(Be,this._pendingRequest),this._geoJSONIndex=Be.cluster?new Q(function({superclusterOptions:Ce,clusterProperties:Te}){if(!Te||!Ce)return Ce;let Pe={},at={},yt={accumulated:null,zoom:0},Tt={properties:null},Ot=Object.keys(Te);for(let Gt of Ot){let[rr,Qt]=Te[Gt],Tr=e.bC(Qt),la=e.bC(typeof rr=="string"?[rr,["accumulated"],["get",Gt]]:rr);Pe[Gt]=Tr.value,at[Gt]=la.value}return Ce.map=Gt=>{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<R.length;ae++)if(R[ae]in o.docStyle)return R[ae];return R[0]}static create(R,ae,we){let Se=window.document.createElement(R);return ae!==void 0&&(Se.className=ae),we&&we.appendChild(Se),Se}static createNS(R,ae){return window.document.createElementNS(R,ae)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(R,ae){R.style[o.transformProp]=ae}static addEventListener(R,ae,we,Se={}){R.addEventListener(ae,we,"passive"in Se?Se:Se.capture)}static removeEventListener(R,ae,we,Se={}){R.removeEventListener(ae,we,"passive"in Se?Se:Se.capture)}static suppressClickInternal(R){R.preventDefault(),R.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout(()=>{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<ae.length;Oe++)we.push(o.getPoint(R,Se,ae[Oe]));return we}static mouseButton(R){return R.button}static remove(R){R.parentNode&&R.parentNode.removeChild(R)}}o.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);let s={supported:!1,testSupport:function(Ne){!m&&h&&(d?T(Ne):c=Ne)}},c,h,m=!1,d=!1;function T(Ne){let R=Ne.createTexture();Ne.bindTexture(Ne.TEXTURE_2D,R);try{if(Ne.texImage2D(Ne.TEXTURE_2D,0,Ne.RGBA,Ne.RGBA,Ne.UNSIGNED_BYTE,h),Ne.isContextLost())return;s.supported=!0}catch{}Ne.deleteTexture(R),m=!0}var l;typeof document<"u"&&(h=document.createElement("img"),h.onload=()=>{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;$t<Bt&&R.length>0;$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]<we||Se[1]<Se[0]||ae<Se[1])return!1;we=Se[1]}return!0}_validateContent(R,ae){if(!R)return!0;if(R.length!==4)return!1;let we=ae.spriteData,Se=we&&we.width||ae.data.width,Oe=we&&we.height||ae.data.height;return!(R[0]<0||Se<R[0]||R[1]<0||Oe<R[1]||R[2]<0||Se<R[2]||R[3]<0||Oe<R[3]||R[2]<R[0]||R[3]<R[1])}updateImage(R,ae,we=!0){let Se=this.getImage(R);if(we&&(Se.data.width!==ae.data.width||Se.data.height!==ae.data.height))throw new Error(`size mismatch between old image (${Se.data.width}x${Se.data.height}) and new image (${ae.data.width}x${ae.data.height}).`);ae.version=Se.version+1,this.images[R]=ae,this.updatedImages[R]=!0}removeImage(R){let ae=this.images[R];delete this.images[R],delete this.patterns[R],ae.userImage&&ae.userImage.onRemove&&ae.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(R){return new Promise((ae,we)=>{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<R+we;$t++)z(Ne,ae*Oe+$t,Oe,Se,pt,At,Bt);for(let $t=ae;$t<ae+Se;$t++)z(Ne,$t*Oe+R,1,we,pt,At,Bt)}function z(Ne,R,ae,we,Se,Oe,pt){Oe[0]=0,pt[0]=-P,pt[1]=P,Se[0]=Ne[R];for(let At=1,Bt=0,$t=0;At<we;At++){Se[At]=Ne[R+At*ae];let br=At*At;do{let Ar=Oe[Bt];$t=(Se[At]-Se[Ar]+br-Ar*Ar)/(At-Ar)/2}while($t<=pt[Bt]&&--Bt>-1);Bt++,Oe[Bt]=At,pt[Bt]=$t,pt[Bt+1]=P}for(let At=0,Bt=0;At<we;At++){for(;pt[Bt+1]<At;)Bt++;let $t=Oe[Bt],br=At-$t;Ne[R+At*ae]=Se[$t]+br*br}}class F{constructor(R,ae){this.requestManager=R,this.localIdeographFontFamily=ae,this.entries={}}setURL(R){this.url=R}getGlyphs(R){return t._(this,void 0,void 0,function*(){let ae=[];for(let Oe in R)for(let pt of R[Oe])ae.push(this._getAndCacheGlyphsPromise(Oe,pt));let we=yield Promise.all(ae),Se={};for(let{stack:Oe,id:pt,glyph:At}of we)Se[Oe]||(Se[Oe]={}),Se[Oe][pt]=At&&{id:At.id,bitmap:At.bitmap.clone(),metrics:At.metrics};return Se})}_getAndCacheGlyphsPromise(R,ae){return t._(this,void 0,void 0,function*(){let we=this.entries[R];we||(we=this.entries[R]={glyphs:{},requests:{},ranges:{}});let Se=we.glyphs[ae];if(Se!==void 0)return{stack:R,id:ae,glyph:Se};if(Se=this._tinySDF(we,R,ae),Se)return we.glyphs[ae]=Se,{stack:R,id:ae,glyph:Se};let Oe=Math.floor(ae/256);if(256*Oe>65535)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;wt<Bt;wt++)for(let Dt=0;Dt<At;Dt++){let ur=Ct.data[4*(wt*At+Dt)+3]/255;if(ur===0)continue;let mr=(wt+Je)*$t+Dt+Je;if(ur===1)dt[mr]=0,lt[mr]=P;else{let Er=.5-ur;dt[mr]=Er>0?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;wt<Ar;wt++){let Dt=Math.sqrt(dt[wt])-Math.sqrt(lt[wt]);Yr[wt]=Math.round(255-255*(Dt/this.radius+this.cutoff))}return sa}};class B{constructor(){this.specification=t.v.light.position}possiblyEvaluate(R,ae){return t.x(R.expression.evaluate(ae))}interpolate(R,ae,we){return{x:t.y.number(R.x,ae.x,we),y:t.y.number(R.y,ae.y,we),z:t.y.number(R.z,ae.z,we)}}}let O;class I extends t.E{constructor(R){super(),O=O||new t.q({anchor:new t.D(t.v.light.anchor),position:new B,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(O),this.setLight(R),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(R,ae={}){if(!this._validate(t.r,R,ae))for(let we in R){let Se=R[we];we.endsWith("-transition")?this._transitionable.setTransition(we.slice(0,-11),Se):this._transitionable.setValue(we,Se)}}updateTransitions(R){this._transitioning=this._transitionable.transitioned(R,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(R){this.properties=this._transitioning.possiblyEvaluate(R)}_validate(R,ae,we){return(!we||we.validate!==!1)&&t.t(this,R.call(t.u,{value:ae,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}let N=new t.q({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class U extends t.E{constructor(R){super(),this._transitionable=new t.T(N),this.setSky(R),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(R,ae={}){if(!this._validate(t.B,R,ae)){R||(R={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let we in R){let Se=R[we];we.endsWith("-transition")?this._transitionable.setTransition(we.slice(0,-11),Se):this._transitionable.setValue(we,Se)}}}getSky(){return this._transitionable.serialize()}updateTransitions(R){this._transitioning=this._transitionable.transitioned(R,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(R){this.properties=this._transitioning.possiblyEvaluate(R)}_validate(R,ae,we={}){return we?.validate!==!1&&t.t(this,R.call(t.u,t.e({value:ae,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(R){return R<60?0:R<70?(R-60)/10:1}}class W{constructor(R,ae){this.width=R,this.height=ae,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(R,ae){let we=R.join(",")+String(ae);return this.dashEntry[we]||(this.dashEntry[we]=this.addDash(R,ae)),this.dashEntry[we]}getDashRanges(R,ae,we){let Se=[],Oe=R.length%2==1?-R[R.length-1]*we:0,pt=R[0]*we,At=!0;Se.push({left:Oe,right:pt,isDash:At,zeroLength:R[0]===0});let Bt=R[0];for(let $t=1;$t<R.length;$t++){At=!At;let br=R[$t];Oe=Bt*we,Bt+=br,pt=Bt*we,Se.push({left:Oe,right:pt,isDash:At,zeroLength:br===0})}return Se}addRoundDash(R,ae,we){let Se=ae/2;for(let Oe=-we;Oe<=we;Oe++){let pt=this.width*(this.nextRow+we+Oe),At=0,Bt=R[At];for(let $t=0;$t<this.width;$t++){$t/Bt.right>1&&(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;At<this.width;At++){At/pt.right>1&&(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<R.length;At++)Oe+=R[At];if(Oe!==0){let At=this.width/Oe,Bt=this.getDashRanges(R,this.width,At);ae?this.addRoundDash(Bt,At,we):this.addRegularDash(Bt)}let pt={y:(this.nextRow+we+.5)/this.height,height:2*we/this.height,width:Oe};return this.nextRow+=Se,this.dirty=!0,pt}bind(R){let ae=R.gl;this.texture?(ae.bindTexture(ae.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,ae.texSubImage2D(ae.TEXTURE_2D,0,0,0,this.width,this.height,ae.ALPHA,ae.UNSIGNED_BYTE,this.data))):(this.texture=ae.createTexture(),ae.bindTexture(ae.TEXTURE_2D,this.texture),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_WRAP_S,ae.REPEAT),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_WRAP_T,ae.REPEAT),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_MIN_FILTER,ae.LINEAR),ae.texParameteri(ae.TEXTURE_2D,ae.TEXTURE_MAG_FILTER,ae.LINEAR),ae.texImage2D(ae.TEXTURE_2D,0,ae.ALPHA,this.width,this.height,0,ae.ALPHA,ae.UNSIGNED_BYTE,this.data))}}let Q="maplibre_preloaded_worker_pool";class ue{constructor(){this.active={}}acquire(R){if(!this.workers)for(this.workers=[];this.workers.length<ue.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[R]=!0,this.workers.slice()}release(R){delete this.active[R],this.numActive()===0&&(this.workers.forEach(ae=>{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<we.length;Se++){let Oe=new t.F(we[Se],ae);Oe.name=`Worker ${Se}`,this.actors.push(Oe)}if(!this.actors.length)throw new Error("No actors found")}broadcast(R,ae){let we=[];for(let Se of this.actors)we.push(Se.sendAsync({type:R,data:ae}));return Promise.all(we)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(R=!0){this.actors.forEach(ae=>{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<Oe&&R.y>=Se&&R.y<pt}}class be extends t.E{constructor(R,ae,we,Se){if(super(),this.id=R,this.dispatcher=we,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.e(this,t.M(ae,["url","scheme","tileSize","promoteId"])),this._options=t.e({type:"vector"},ae),this._collectResourceTiming=ae.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Se)}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,this.map.style.sourceCaches[this.id].clearTiles(),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}hasTile(R){return!this.tileBounds||this.tileBounds.contains(R.canonical)}onAdd(R){this.map=R,this.load()}setSourceProperty(R){this._tileJSONRequest&&this._tileJSONRequest.abort(),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}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+1<we&&(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}),Bt}unloadTile(R){return t._(this,void 0,void 0,function*(){R.demTexture&&this.map.painter.saveTileTexture(R.demTexture),R.fbo&&(R.fbo.destroy(),delete R.fbo),R.dem&&delete R.dem,delete R.neighboringTiles,R.state="unloaded",R.actor&&(yield R.actor.sendAsync({type:"RDT",data:{type:this.type,uid:R.uid,source:this.id}}))})}}class Re extends t.E{constructor(R,ae,we,Se){super(),this.id=R,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=we.getActor(),this.setEventedParent(Se),this._data=ae.data,this._options=t.e({},ae),this._collectResourceTiming=ae.collectResourceTiming,ae.maxzoom!==void 0&&(this.maxzoom=ae.maxzoom),ae.type&&(this.type=ae.type),ae.attribution&&(this.attribution=ae.attribution),this.promoteId=ae.promoteId;let Oe=t.X/this.tileSize;ae.clusterMaxZoom!==void 0&&this.maxzoom<=ae.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${ae.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:ae.cluster||!1,geojsonVtOptions:{buffer:(ae.buffer!==void 0?ae.buffer:128)*Oe,tolerance:(ae.tolerance!==void 0?ae.tolerance:.375)*Oe,extent:t.X,maxZoom:this.maxzoom,lineMetrics:ae.lineMetrics||!1,generateId:ae.generateId||!1},superclusterOptions:{maxZoom:ae.clusterMaxZoom!==void 0?ae.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,ae.clusterMinPoints||2),extent:t.X,radius:(ae.clusterRadius||50)*Oe,log:!1,generateId:ae.generateId||!1},clusterProperties:ae.clusterProperties,filter:ae.filter},ae.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}load(){return t._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(R){this.map=R,this.load()}setData(R){return this._data=R,this._updateWorkerData(),this}updateData(R){return this._updateWorkerData(R),this}getData(){return t._(this,void 0,void 0,function*(){let R=t.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:R})})}setClusterOptions(R){return this.workerOptions.cluster=R.cluster,R&&(R.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=R.clusterRadius),R.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=R.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(R){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:R,source:this.id}})}getClusterChildren(R){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:R,source:this.id}})}getClusterLeaves(R,ae,we){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:R,limit:ae,offset:we}})}_updateWorkerData(R){return t._(this,void 0,void 0,function*(){let ae=t.e({type:this.type},this.workerOptions);R?ae.dataDiff=R:typeof this._data=="string"?(ae.request=this.map._requestManager.transformRequest(n.resolveURL(this._data),"Source"),ae.request.collectResourceTiming=this._collectResourceTiming):ae.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new t.k("dataloading",{dataType:"source"}));try{let we=yield this.actor.sendAsync({type:"LD",data:ae});if(this._pendingLoads--,this._removed||we.abandoned)return void this.fire(new t.k("dataabort",{dataType:"source"}));let Se=null;we.resourceTiming&&we.resourceTiming[this.id]&&(Se=we.resourceTiming[this.id].slice(0));let Oe={dataType:"source"};this._collectResourceTiming&&Se&&Se.length>0&&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;R<ae.start(0)||R>ae.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;ae<this.fadeEndTime||(this.fadeEndTime=ae)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(R){this.demTexture&&R.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(R,ae,we){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",R){R.featureIndex&&(this.latestFeatureIndex=R.featureIndex,R.rawTileData?(this.latestRawTileData=R.rawTileData,this.latestFeatureIndex.rawTileData=R.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=R.collisionBoxArray,this.buckets=function(Se,Oe){let pt={};if(!Oe)return pt;for(let At of Se){let Bt=At.layerIds.map($t=>Oe.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;Yr<pt.length;Yr++){let sa=pt.feature(Yr);if(At.needGeometry){let lt=t.a8(sa,!0);if(!At.filter(new t.z(this.tileID.overscaledZ),lt,this.tileID.canonical))continue}else if(!At.filter(new t.z(this.tileID.overscaledZ),sa))continue;let He=we.getId(sa,Oe),Je=new t.a9(sa,Bt,$t,br,He);Je.tile=Ar,R.push(Je)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(R){let ae=this.expirationTime;if(R.cacheControl){let we=t.aa(R.cacheControl);we["max-age"]&&(this.expirationTime=Date.now()+1e3*we["max-age"])}else R.expires&&(this.expirationTime=new Date(R.expires).getTime());if(this.expirationTime){let we=Date.now(),Se=!1;if(this.expirationTime>we)Se=!1;else if(ae)if(this.expirationTime<ae)Se=!0;else{let Oe=this.expirationTime-ae;Oe?this.expirationTime=we+Math.max(Oe,3e4):Se=!0}else Se=!0;Se?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(R,ae){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(R).length===0)return;let we=this.latestFeatureIndex.loadVTLayers();for(let Se in this.buckets){if(!ae.style.hasLayer(Se))continue;let Oe=this.buckets[Se],pt=Oe.layers[0].sourceLayer||"_geojsonTileLayer",At=we[pt],Bt=R[pt];if(!At||!Bt||Object.keys(Bt).length===0)continue;Oe.update(Bt,At,this.imageAtlas&&this.imageAtlas.patternPositions||{});let $t=ae&&ae.style&&ae.style.getLayer(Se);$t&&(this.queryPadding=Math.max(this.queryPadding,$t.queryRadius(Oe)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<n.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(R){this.symbolFadeHoldUntil=n.now()+R}setDependencies(R,ae){let we={};for(let Se of ae)we[Se]=!0;this.dependencies[R]=we}hasDependency(R,ae){for(let we of R){let Se=this.dependencies[we];if(Se){for(let Oe of ae)if(Se[Oe])return!0}}return!1}}class Qe{constructor(R,ae){this.max=R,this.onRemove=ae,this.reset()}reset(){for(let R in this.data)for(let ae of this.data[R])ae.timeout&&clearTimeout(ae.timeout),this.onRemove(ae.value);return this.data={},this.order=[],this}add(R,ae,we){let Se=R.wrapped().key;this.data[Se]===void 0&&(this.data[Se]=[]);let Oe={value:ae,timeout:void 0};if(we!==void 0&&(Oe.timeout=setTimeout(()=>{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;Se<ae.length;Se++){let Oe=ae[Se];if(R.neighboringTiles&&R.neighboringTiles[Oe]){let pt=this.getTileByID(Oe);we(R,pt),we(pt,R)}}function we(Se,Oe){Se.needsHillshadePrepare=!0,Se.needsTerrainPrepare=!0;let pt=Oe.tileID.canonical.x-Se.tileID.canonical.x,At=Oe.tileID.canonical.y-Se.tileID.canonical.y,Bt=Math.pow(2,Se.tileID.canonical.z),$t=Oe.tileID.key;pt===0&&At===0||Math.abs(At)>1||(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()||ae<this._source.maxzoom&&(Bt[$t.key]=$t)}this._retainLoadedChildren(Bt,ae,At,Se);for(let $t of R){let br=this._tiles[$t.key];if(br.hasData())continue;if(ae+1>this._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<t.X&&wt[0].y-Ct<t.X&&wt[1].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;we<this.points.length;we++)this._distances[we]=this._distances[we-1]+this.points[we].dist(this.points[we-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(ae||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(R){if(this.points.length===1)return this.points[0];R=t.ac(R,0,1);let ae=1,we=this._distances[ae],Se=R*this.paddedLength+this.padding;for(;we<Se&&ae<this._distances.length;)we=this._distances[++ae];let Oe=ae-1,pt=this._distances[Oe],At=we-pt,Bt=At>0?(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;pt<this.xCellCount*this.yCellCount;pt++)Se.push([]),Oe.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=R,this.height=ae,this.xScale=this.xCellCount/R,this.yScale=this.yCellCount/ae,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(R,ae,we,Se,Oe){this._forEachCell(ae,we,Se,Oe,this._insertBoxCell,this.boxUid++),this.boxKeys.push(R),this.bboxes.push(ae),this.bboxes.push(we),this.bboxes.push(Se),this.bboxes.push(Oe)}insertCircle(R,ae,we,Se){this._forEachCell(ae-Se,we-Se,ae+Se,we+Se,this._insertCircleCell,this.circleUid++),this.circleKeys.push(R),this.circles.push(ae),this.circles.push(we),this.circles.push(Se)}_insertBoxCell(R,ae,we,Se,Oe,pt){this.boxCells[Oe].push(pt)}_insertCircleCell(R,ae,we,Se,Oe,pt){this.circleCells[Oe].push(pt)}_query(R,ae,we,Se,Oe,pt,At){if(we<0||R>this.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;$t<this.boxKeys.length;$t++)Bt.push({key:this.boxKeys[$t],x1:this.bboxes[4*$t],y1:this.bboxes[4*$t+1],x2:this.bboxes[4*$t+2],y2:this.bboxes[4*$t+3]});for(let $t=0;$t<this.circleKeys.length;$t++){let br=this.circles[3*$t],Ar=this.circles[3*$t+1],Yr=this.circles[3*$t+2];Bt.push({key:this.circleKeys[$t],x1:br-Yr,y1:Ar-Yr,x2:br+Yr,y2:Ar+Yr})}}else this._forEachCell(R,ae,we,Se,this._queryCell,Bt,{hitTest:Oe,overlapMode:pt,seenUids:{box:{},circle:{}}},At);return Bt}query(R,ae,we,Se){return this._query(R,ae,we,Se,!1,null)}hitTest(R,ae,we,Se,Oe,pt){return this._query(R,ae,we,Se,!0,Oe,pt).length>0}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;Er<Dt.length;Er++){let Br=Dt.get(Er);if(Br.hidden||Br.writingMode===t.ah.vertical&&!mr){rr(Br.numGlyphs,Ct);continue}mr=!1;let Qr=bt(Br.anchorX,Br.anchorY,R,He);if(!Ke(Qr.point,dt)){rr(Br.numGlyphs,Ct);continue}let ga=Be(ae.transform.cameraToCenterDistance,Qr.signedDistanceFromCamera),Sa=t.ai(Je,lt,Br),Oa=pt?Sa/ga:Sa*ga,vn={getElevation:He,labelPlaneMatrix:Se,lineVertexArray:wt,pitchWithMap:pt,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:$t,tileAnchorPoint:new t.P(Br.anchorX,Br.anchorY),unwrappedTileID:br,width:Ar,height:Yr,translation:sa},Xn=Ce(vn,Br,Oa,!1,At,R,Oe,Ne.glyphOffsetArray,Ct,ur,Bt);mr=Xn.useVertical,(Xn.notEnoughRoom||mr||Xn.needsFlipping&&Ce(vn,Br,Oa,!0,At,R,Oe,Ne.glyphOffsetArray,Ct,ur,Bt).notEnoughRoom)&&rr(Br.numGlyphs,Ct)}we?Ne.text.dynamicLayoutVertexBuffer.updateData(Ct):Ne.icon.dynamicLayoutVertexBuffer.updateData(Ct)}function Ee(Ne,R,ae,we,Se,Oe,pt,At){let Bt=Oe.glyphStartIndex+Oe.numGlyphs,$t=Oe.lineStartIndex,br=Oe.lineStartIndex+Oe.lineLength,Ar=R.getoffsetX(Oe.glyphStartIndex),Yr=R.getoffsetX(Bt-1),sa=Ot(Ne*Ar,ae,we,Se,Oe.segment,$t,br,At,pt);if(!sa)return null;let He=Ot(Ne*Yr,ae,we,Se,Oe.segment,$t,br,At,pt);return He?At.projectionCache.anyProjectionOccluded?null:{first:sa,last:He}:null}function Ve(Ne,R,ae,we){return Ne===t.ah.horizontal&&Math.abs(ae.y-R.y)>Math.abs(ae.x-R.x)*we?{useVertical:!0}:(Ne===t.ah.vertical?R.y<ae.y:R.x>ae.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;ur<Je-1;ur++)He.push(Ot(Ar*At.getoffsetX(ur),Yr,sa,we,R.segment,lt,dt,Ne,br));He.push(Ct.last)}else{if(Se&&!we){let lt=bt(Ne.tileAnchorPoint.x,Ne.tileAnchorPoint.y,Oe,Ne.getElevation).point,dt=R.lineStartIndex+R.segment+1,Ct=new t.P(Ne.lineVertexArray.getx(dt),Ne.lineVertexArray.gety(dt)),wt=bt(Ct.x,Ct.y,Oe,Ne.getElevation),Dt=wt.signedDistanceFromCamera>0?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<we||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<Oe||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<Ne;ae++){let we=R.length;R.resize(we+4),R.float32.set(Gt,3*we)}}function Qt(Ne,R,ae){let we=R[0],Se=R[1];return Ne[0]=ae[0]*we+ae[4]*Se+ae[12],Ne[1]=ae[1]*we+ae[5]*Se+ae[13],Ne[3]=ae[3]*we+ae[7]*Se+ae[15],Ne}let Tr=100;class la{constructor(R,ae,we=new jr(R.width+200,R.height+200,25),Se=new jr(R.width+200,R.height+200,25)){this.transform=R,this.mapProjection=ae,this.grid=we,this.ignoredGrid=Se,this.pitchFactor=Math.cos(R._pitch)*R.cameraToCenterDistance,this.screenRightBoundary=R.width+Tr,this.screenBottomBoundary=R.height+Tr,this.gridRightBoundary=R.width+200,this.gridBottomBoundary=R.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar){let Yr=R.anchorPointX+Bt[0],sa=R.anchorPointY+Bt[1],He=this.projectAndGetPerspectiveRatio(Se,Yr,sa,Oe,br),Je=we*He.perspectiveRatio,lt;if(pt||At)lt=this._projectCollisionBox(R,Je,Se,Oe,pt,At,Bt,He,br,Ar);else{let ur=He.point.x+(Ar?Ar.x*Je:0),mr=He.point.y+(Ar?Ar.y*Je:0);lt={allPointsOccluded:!1,box:[ur+R.x1*Je,mr+R.y1*Je,ur+R.x2*Je,mr+R.y2*Je]}}let[dt,Ct,wt,Dt]=lt.box;return this.mapProjection.useSpecialProjectionForSymbols&&(pt?lt.allPointsOccluded:this.mapProjection.isOccluded(Yr,sa,Oe))||He.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(dt,Ct,wt,Dt)||ae!=="always"&&this.grid.hitTest(dt,Ct,wt,Dt,ae,$t)?{box:[dt,Ct,wt,Dt],placeable:!1,offscreen:!1}:{box:[dt,Ct,wt,Dt],placeable:!0,offscreen:this.isOffscreen(dt,Ct,wt,Dt)}}placeCollisionCircles(R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa,He,Je,lt){let dt=[],Ct=new t.P(ae.anchorX,ae.anchorY),wt=this.getPerspectiveRatio(pt,Ct.x,Ct.y,At,lt),Dt=(Ar?Oe/wt:Oe*wt)/t.ap,ur={getElevation:lt,labelPlaneMatrix:Bt,lineVertexArray:we,pitchWithMap:Ar,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:Ct,unwrappedTileID:At,width:this.transform.width,height:this.transform.height,translation:Je},mr=Ee(Dt,Se,ae.lineOffsetX*Dt,ae.lineOffsetY*Dt,!1,ae,!1,ur),Er=!1,Br=!1,Qr=!0;if(mr){let ga=.5*sa*wt+He,Sa=new t.P(-100,-100),Oa=new t.P(this.screenRightBoundary,this.screenBottomBoundary),vn=new Sr,Xn=mr.first,Hn=mr.last,oi=[];for(let Bi=Xn.path.length-1;Bi>=1;Bi--)oi.push(Xn.path[Bi]);for(let Bi=1;Bi<Hn.path.length;Bi++)oi.push(Hn.path[Bi]);let Ti=2.5*ga;if($t){let Bi=this.projectPathToScreenSpace(oi,ur,$t);oi=Bi.some(Ao=>Ao.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<oi.length;ss++)Bi.x=Math.min(Bi.x,oi[ss].x),Bi.y=Math.min(Bi.y,oi[ss].y),Ao.x=Math.max(Ao.x,oi[ss].x),Ao.y=Math.max(Ao.y,oi[ss].y);Wi=Bi.x>=Sa.x&&Ao.x<=Oa.x&&Bi.y>=Sa.y&&Ao.y<=Oa.y?[oi]:Ao.x<Sa.x||Bi.x>Oa.x||Ao.y<Sa.y||Bi.y>Oa.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;ss<Ao;ss++){let So=ss/Math.max(Ao-1,1),Ko=vn.lerp(So),hs=Ko.x+Tr,ll=Ko.y+Tr;dt.push(hs,ll,ga,0);let Js=hs-ga,es=ll-ga,ts=hs+ga,Pl=ll+ga;if(Qr=Qr&&this.isOffscreen(Js,es,ts,Pl),Br=Br||this.isInsideGrid(Js,es,ts,Pl),R!=="always"&&this.grid.hitTestCircle(hs,ll,ga,R,Yr)&&(Er=!0,!br))return{circles:[],offscreen:!1,collisionDetected:Er}}}}return{circles:!br&&Er||!Br||wt<this.perspectiveRatioCutoff?[]:dt,offscreen:Qr,collisionDetected:Er}}projectPathToScreenSpace(R,ae,we){return R.map(Se=>bt(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<R.length;$t+=4)At.insertCircle(Bt,R[$t],R[$t+1],R[$t+2])}projectAndGetPerspectiveRatio(R,ae,we,Se,Oe){let pt;Oe?(pt=[ae,we,Oe(ae,we),1],t.af(pt,pt,R)):(pt=[ae,we,0,1],Qt(pt,pt,R));let At=pt[3];return{point:new t.P((pt[0]/At+1)/2*this.transform.width+Tr,(-pt[1]/At+1)/2*this.transform.height+Tr),perspectiveRatio:.5+this.transform.cameraToCenterDistance/At*.5,isOccluded:!1,signedDistanceFromCamera:At}}getPerspectiveRatio(R,ae,we,Se,Oe){let pt=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(ae,we,Se,Oe):bt(ae,we,R,Oe);return .5+this.transform.cameraToCenterDistance/pt.signedDistanceFromCamera*.5}isOffscreen(R,ae,we,Se){return we<Tr||R>=this.screenRightBoundary||Se<Tr||ae>this.screenBottomBoundary}isInsideGrid(R,ae,we,Se){return we>=0&&R<this.gridRightBoundary&&Se>=0&&ae<this.gridBottomBoundary}getViewportMatrix(){let R=t.an([]);return t.J(R,R,[-100,-100,0]),R}_projectCollisionBox(R,ae,we,Se,Oe,pt,At,Bt,$t,br){let Ar=new t.P(1,0),Yr=new t.P(0,1),sa=new t.P(R.anchorPointX+At[0],R.anchorPointY+At[1]);if(pt&&!Oe){let Qr=this.projectAndGetPerspectiveRatio(we,sa.x+1,sa.y,Se,$t).point.sub(Bt.point).unit(),ga=Math.atan(Qr.y/Qr.x)+(Qr.x<0?Math.PI:0),Sa=Math.sin(ga),Oa=Math.cos(ga);Ar=new t.P(Oa,Sa),Yr=new t.P(-Sa,Oa)}else if(!pt&&Oe){let Qr=-this.transform.angle,ga=Math.sin(Qr),Sa=Math.cos(Qr);Ar=new t.P(Sa,ga),Yr=new t.P(-ga,Sa)}let He=Bt.point,Je=ae;if(Oe){He=sa;let Qr=this.transform.zoom-Math.floor(this.transform.zoom);Je=Math.pow(2,-Qr),Je*=this.mapProjection.getPitchedTextCorrection(this.transform,sa,Se),br||(Je*=t.ac(.5+Bt.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}br&&(He=He.add(Ar.mult(br.x*Je)).add(Yr.mult(br.y*Je)));let lt=R.x1*Je,dt=R.x2*Je,Ct=(lt+dt)/2,wt=R.y1*Je,Dt=R.y2*Je,ur=(wt+Dt)/2,mr=[{offsetX:lt,offsetY:wt},{offsetX:Ct,offsetY:wt},{offsetX:dt,offsetY:wt},{offsetX:dt,offsetY:ur},{offsetX:dt,offsetY:Dt},{offsetX:Ct,offsetY:Dt},{offsetX:lt,offsetY:Dt},{offsetX:lt,offsetY:ur}],Er=[];for(let{offsetX:Qr,offsetY:ga}of mr)Er.push(new t.P(He.x+Ar.x*Qr+Yr.x*ga,He.y+Ar.y*Qr+Yr.y*ga));let Br=!1;if(Oe){let Qr=Er.map(ga=>this.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;Ma<tn;Ma++){for(let Na=de;Na<De;Na++){let Ka=Se.textAnchorOffsets.get(Na);if(et&&Ka.textAnchor!==et)continue;let mn=this.attemptAnchorPlacement(Ka,St,gr,qr,Wr,Er,Br,Yr,Bt,$t,lt,on,Hn,Se,zt,pt,At,Ta,vn);if(mn&&(ya=mn.placedGlyphBoxes,ya&&ya.placeable))return Ao=!0,Ko=mn.shift,ya}et?et=null:on=wt}return we&&!ya&&(ya={box:this.collisionIndex.placeCollisionBox(hu,"always",Yr,Bt,$t,Br,Er,pt,lt.predicate,vn,new t.P(0,0)).box,offscreen:!1,placeable:!1}),ya};ql(()=>vt(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<R.symbolInstanceEnd;Hn++)Xn(Se.symbolInstances.get(Hn),Se.collisionArrays[Hn],Hn);if(we&&Se.bucketInstanceId in this.collisionCircleArrays){let Hn=this.collisionCircleArrays[Se.bucketInstanceId];t.as(Hn.invProjMatrix,Bt),Hn.viewportMatrix=this.collisionIndex.getViewportMatrix()}Se.justReloaded=!1}storeCollisionData(R,ae,we,Se,Oe,pt){if(we.textBox||we.iconBox){let At,Bt;this.collisionBoxArrays.has(R)?At=this.collisionBoxArrays.get(R):(At=new Map,this.collisionBoxArrays.set(R,At)),At.has(ae)?Bt=At.get(ae):(Bt={text:null,icon:null},At.set(ae,Bt)),we.textBox&&(Bt.text=Se.box),we.iconBox&&(Bt.icon=Oe.box)}if(pt){let At=this.collisionCircleArrays[R];At===void 0&&(At=this.collisionCircleArrays[R]=new za);for(let Bt=0;Bt<pt.circles.length;Bt+=4)At.circles.push(pt.circles[Bt+0]),At.circles.push(pt.circles[Bt+1]),At.circles.push(pt.circles[Bt+2]),At.circles.push(pt.collisionDetected?1:0)}}markUsedJustification(R,ae,we,Se){let Oe;Oe=Se===t.ah.vertical?we.verticalPlacedTextSymbolIndex:{left:we.leftJustifiedTextSymbolIndex,center:we.centerJustifiedTextSymbolIndex,right:we.rightJustifiedTextSymbolIndex}[t.at(ae)];let pt=[we.leftJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.rightJustifiedTextSymbolIndex,we.verticalPlacedTextSymbolIndex];for(let At of pt)At>=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;Dt<Ct/4;Dt++)dt.opacityVertexArray.emplaceBack(wt);dt.hasVisibleVertices=dt.hasVisibleVertices||wt!==nn},lt=this.collisionBoxArrays.get(R.bucketInstanceId);for(let dt=0;dt<R.symbolInstances.length;dt++){let Ct=R.symbolInstances.get(dt),{numHorizontalGlyphVertices:wt,numVerticalGlyphVertices:Dt,crossTileID:ur}=Ct,mr=this.opacities[ur];we[ur]?mr=At:mr||(mr=He,this.opacities[ur]=mr),we[ur]=!0;let Er=Ct.numIconVertices>0,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.lastPlacementChangeTime<this.fadeDuration}stillRecent(R,ae){let we=this.zoomAtLastRecencyCheck===ae?1-this.zoomAdjustment(ae):1;return this.zoomAtLastRecencyCheck=ae,this.commitTime+this.fadeDuration*we>R}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._currentTileIndex<R.length;)if(ae.getBucketParts(pt,Se,R[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,Oe())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,pt.sort((At,Bt)=>At.sortKey-Bt.sortKey));this._currentPartIndex<pt.length;)if(ae.placeLayerBucketPart(pt[this._currentPartIndex],this._seenCrossTileIDs,we),this._currentPartIndex++,Oe())return!0;return!1}}class ct{constructor(R,ae,we,Se,Oe,pt,At,Bt){this.placement=new Nt(R,yn(),ae,pt,At,Bt),this._currentPlacementIndex=we.length-1,this._forceFullPlacement=Se,this._showCollisionBoxes=Oe,this._done=!1}isDone(){return this._done}continuePlacement(R,ae,we){let Se=n.now(),Oe=()=>!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<ae.length;Oe++){let pt=ae.get(Oe),At=pt.key,Bt=Se.get(At);Bt?Bt.push(pt):Se.set(At,[pt])}for(let[Oe,pt]of Se){let At={positions:pt.map(Bt=>({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.z<ae.canonical.z?1:Math.pow(2,this.tileID.canonical.z-ae.canonical.z);for(let Oe=0;Oe<R.length;Oe++){let pt=R.get(Oe);if(pt.crossTileID)continue;let At=this._symbolsByKey[pt.key];if(!At)continue;let Bt=this.getScaledCoordinates(pt,ae);if(At.index){let $t=At.index.range(Bt.x-Se,Bt.y-Se,Bt.x+Se,Bt.y+Se).sort();for(let br of $t){let Ar=At.crossTileIDs[br];if(!we[Ar]){we[Ar]=!0,pt.crossTileID=Ar;break}}}else if(At.positions)for(let $t=0;$t<At.positions.length;$t++){let br=At.positions[$t],Ar=At.crossTileIDs[$t];if(Math.abs(br.x-Bt.x)<=Se&&Math.abs(br.y-Bt.y)<=Se&&!we[Ar]){we[Ar]=!0,pt.crossTileID=Ar;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:R})=>R)}}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;Oe<ae.symbolInstances.length;Oe++)ae.symbolInstances.get(Oe).crossTileID=0;this.usedCrossTileIDs[R.overscaledZ]||(this.usedCrossTileIDs[R.overscaledZ]={});let Se=this.usedCrossTileIDs[R.overscaledZ];for(let Oe in this.indexes){let pt=this.indexes[Oe];if(Number(Oe)>R.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.symbolInstances.length;Oe++){let pt=ae.symbolInstances.get(Oe);pt.crossTileID||(pt.crossTileID=we.generate(),Se[pt.crossTileID]=!0)}return this.indexes[R.overscaledZ]===void 0&&(this.indexes[R.overscaledZ]={}),this.indexes[R.overscaledZ][R.key]=new Or(R,ae.symbolInstances,ae.bucketInstanceId),!0}removeBucketCrossTileIDs(R,ae){for(let we of ae.getCrossTileIDsLists())for(let Se of we)delete this.usedCrossTileIDs[R][Se]}removeStaleBuckets(R){let ae=!1;for(let we in this.indexes){let Se=this.indexes[we];for(let Oe in Se)R[Se[Oe].bucketInstanceId]||(this.removeBucketCrossTileIDs(we,Se[Oe]),delete Se[Oe],ae=!0)}return ae}}class Gr{constructor(){this.layerIndexes={},this.crossTileIDs=new Rr,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(R,ae,we){let Se=this.layerIndexes[R.id];Se===void 0&&(Se=this.layerIndexes[R.id]=new Lr);let Oe=!1,pt={};Se.handleWrapJump(we);for(let At of ae){let Bt=At.getBucket(R);Bt&&R.id===Bt.layerIds[0]&&(Bt.bucketInstanceId||(Bt.bucketInstanceId=++this.maxBucketInstanceId),Se.addBucket(At.tileID,Bt,this.crossTileIDs)&&(Oe=!0),pt[Bt.bucketInstanceId]=!0)}return Se.removeStaleBuckets(pt)&&(Oe=!0),Oe}pruneUnusedLayers(R){let ae={};R.forEach(we=>{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]<pt)break;Oe.push($t),Se.pop()}else for(let Bt of R){let $t=Bt[At];if($t)for(let br of $t)Oe.push(br.feature)}}return Oe}queryRenderedFeatures(R,ae,we){ae&&ae.filter&&this._validate(t.u.filter,"queryRenderedFeatures.filter",ae.filter,null,ae);let Se={};if(ae&&ae.layers){if(!Array.isArray(ae.layers))return this.fire(new t.j(new Error("parameters.layers must be an Array."))),[];for(let At of ae.layers){let Bt=this._layers[At];if(!Bt)return this.fire(new t.j(new Error(`The layer '${At}' does not exist in the map's style and cannot be queried for features.`))),[];Se[Bt.source]=!0}}let Oe=[];ae.availableImages=this._availableImages;let pt=this._serializedAllLayers();for(let At in this.sourceCaches)ae.layers&&!Se[At]||Oe.push(ne(this.sourceCaches[At],this._layers,pt,R,ae,we));return this.placement&&Oe.push(function(At,Bt,$t,br,Ar,Yr,sa){let He={},Je=Yr.queryRenderedSymbols(br),lt=[];for(let dt of Object.keys(Je).map(Number))lt.push(sa[dt]);lt.sort(j);for(let dt of lt){let Ct=dt.featureIndex.lookupSymbolFeatures(Je[dt.bucketInstanceId],Bt,dt.bucketIndex,dt.sourceLayerIndex,Ar.filter,Ar.layers,Ar.availableImages,At);for(let wt in Ct){let Dt=He[wt]=He[wt]||[],ur=Ct[wt];ur.sort((mr,Er)=>{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;$t<pt.length;$t++){let br=pt[$t],Ar=br.tileID.canonical.key;Bt[Ar]||(Bt[Ar]=!0,br.querySourceFeatures(At,Oe))}return At}(we,ae):[]}getLight(){return this.light.getLight()}setLight(R,ae={}){this._checkLoaded();let we=this.light.getLight(),Se=!1;for(let pt in R)if(!t.aE(R[pt],we[pt])){Se=!0;break}if(!Se)return;let Oe={now:n.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(R,ae),this.light.updateTransitions(Oe)}getSky(){var R;return(R=this.stylesheet)===null||R===void 0?void 0:R.sky}setSky(R,ae={}){let we=this.getSky(),Se=!1;if(!R&&!we)return;if(R&&!we)Se=!0;else if(!R&&we)Se=!0;else for(let pt in R)if(!t.aE(R[pt],we[pt])){Se=!0;break}if(!Se)return;let Oe={now:n.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=R,this.sky.setSky(R,ae),this.sky.updateTransitions(Oe)}_validate(R,ae,we,Se,Oe={}){return(!Oe||Oe.validate!==!1)&&Kr(this,R.call(t.u,t.e({key:ae,style:this.serialize(),value:we,styleSpec:t.v},Se)))}_remove(R=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),rt().off(_e,this._rtlPluginLoaded);for(let ae in this._layers)this._layers[ae].setEventedParent(null);for(let ae in this.sourceCaches){let we=this.sourceCaches[ae];we.setEventedParent(null),we.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),R&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(R)}_clearSource(R){this.sourceCaches[R].clearTiles()}_reloadSource(R){this.sourceCaches[R].resume(),this.sourceCaches[R].reload()}_updateSources(R){for(let ae in this.sourceCaches)this.sourceCaches[ae].update(R,this.map.terrain)}_generateCollisionBoxes(){for(let R in this.sourceCaches)this._reloadSource(R)}_updatePlacement(R,ae,we,Se,Oe=!1){let pt=!1,At=!1,Bt={};for(let $t of this._order){let br=this._layers[$t];if(br.type!=="symbol")continue;if(!Bt[br.source]){let Yr=this.sourceCaches[br.source];Bt[br.source]=Yr.getRenderableIds(!0).map(sa=>Yr.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<Se.length;Ar++)this.boundPaintVertexBuffers[Ar]!==Se[Ar]&&(br=!0);!this.vao||this.boundProgram!==ae||this.boundLayoutVertexBuffer!==we||br||this.boundIndexBuffer!==Oe||this.boundVertexOffset!==pt||this.boundDynamicVertexBuffer!==At||this.boundDynamicVertexBuffer2!==Bt||this.boundDynamicVertexBuffer3!==$t?this.freshBind(ae,we,Se,Oe,pt,At,Bt,$t):(R.bindVertexArray.set(this.vao),At&&At.bind(),Oe&&Oe.dynamicDraw&&Oe.bind(),Bt&&Bt.bind(),$t&&$t.bind())}freshBind(R,ae,we,Se,Oe,pt,At,Bt){let $t=R.numAttributes,br=this.context,Ar=br.gl;this.vao&&this.destroy(),this.vao=br.createVertexArray(),br.bindVertexArray.set(this.vao),this.boundProgram=R,this.boundLayoutVertexBuffer=ae,this.boundPaintVertexBuffers=we,this.boundIndexBuffer=Se,this.boundVertexOffset=Oe,this.boundDynamicVertexBuffer=pt,this.boundDynamicVertexBuffer2=At,this.boundDynamicVertexBuffer3=Bt,ae.enableAttributes(Ar,R);for(let Yr of we)Yr.enableAttributes(Ar,R);pt&&pt.enableAttributes(Ar,R),At&&At.enableAttributes(Ar,R),Bt&&Bt.enableAttributes(Ar,R),ae.bind(),ae.setVertexAttribPointers(Ar,R,Oe);for(let Yr of we)Yr.bind(),Yr.setVertexAttribPointers(Ar,R,Oe);pt&&(pt.bind(),pt.setVertexAttribPointers(Ar,R,Oe)),Se&&Se.bind(),At&&(At.bind(),At.setVertexAttribPointers(Ar,R,Oe)),Bt&&(Bt.bind(),Bt.setVertexAttribPointers(Ar,R,Oe)),br.currentNumAttributes=$t}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let kr=(Ne,R,ae,we,Se)=>({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<Ne.length;ae++){if(Ne[ae]===null)continue;let we=Ne[ae].split(" ");R.push(we.pop())}return R}class Ca{constructor(R,ae,we,Se,Oe,pt){let At=R.gl;this.program=At.createProgram();let Bt=na(ae.staticAttributes),$t=we?we.getBinderAttributes():[],br=Bt.concat($t),Ar=fa.prelude.staticUniforms?na(fa.prelude.staticUniforms):[],Yr=ae.staticUniforms?na(ae.staticUniforms):[],sa=we?we.getBinderUniforms():[],He=Ar.concat(Yr).concat(sa),Je=[];for(let mr of He)Je.indexOf(mr)<0&&Je.push(mr);let lt=we?we.defines():[];Oe&<.push("#define OVERDRAW_INSPECTOR;"),pt&<.push("#define TERRAIN3D;");let dt=lt.concat(fa.prelude.fragmentSource,ae.fragmentSource).join(`
|
||
`),Ct=lt.concat(fa.prelude.vertexSource,ae.vertexSource).join(`
|
||
`),wt=At.createShader(At.FRAGMENT_SHADER);if(At.isContextLost())return void(this.failedToCreate=!0);if(At.shaderSource(wt,dt),At.compileShader(wt),!At.getShaderParameter(wt,At.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${At.getShaderInfoLog(wt)}`);At.attachShader(this.program,wt);let Dt=At.createShader(At.VERTEX_SHADER);if(At.isContextLost())return void(this.failedToCreate=!0);if(At.shaderSource(Dt,Ct),At.compileShader(Dt),!At.getShaderParameter(Dt,At.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${At.getShaderInfoLog(Dt)}`);At.attachShader(this.program,Dt),this.attributes={};let ur={};this.numAttributes=br.length;for(let mr=0;mr<this.numAttributes;mr++)br[mr]&&(At.bindAttribLocation(this.program,mr,br[mr]),this.attributes[br[mr]]=mr);if(At.linkProgram(this.program),!At.getProgramParameter(this.program,At.LINK_STATUS))throw new Error(`Program failed to link: ${At.getProgramInfoLog(this.program)}`);At.deleteShader(Dt),At.deleteShader(wt);for(let mr=0;mr<Je.length;mr++){let Er=Je[mr];if(Er&&!ur[Er]){let Br=At.getUniformLocation(this.program,Er);Br&&(ur[Er]=Br)}}this.fixedUniforms=Se(R,ur),this.terrainUniforms=((mr,Er)=>({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;we<this.attributes.length;we++){let Se=ae.attributes[this.attributes[we].name];Se!==void 0&&R.enableVertexAttribArray(Se)}}setVertexAttribPointers(R,ae,we){for(let Se=0;Se<this.attributes.length;Se++){let Oe=this.attributes[Se],pt=ae.attributes[Oe.name];pt!==void 0&&R.vertexAttribPointer(pt,Oe.components,R[jn[Oe.type]],!1,this.itemSize,Oe.offset+this.itemSize*(we||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let tl=new WeakMap;function Bs(Ne){var R;if(tl.has(Ne))return tl.get(Ne);{let ae=(R=Ne.getParameter(Ne.VERSION))===null||R===void 0?void 0:R.startsWith("WebGL 2.0");return tl.set(Ne,ae),ae}}class uo{constructor(R){this.gl=R.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(R){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class $s extends uo{getDefault(){return t.aM.transparent}set(R){let ae=this.current;(R.r!==ae.r||R.g!==ae.g||R.b!==ae.b||R.a!==ae.a||this.dirty)&&(this.gl.clearColor(R.r,R.g,R.b,R.a),this.current=R,this.dirty=!1)}}class ms extends uo{getDefault(){return 1}set(R){(R!==this.current||this.dirty)&&(this.gl.clearDepth(R),this.current=R,this.dirty=!1)}}class Is extends uo{getDefault(){return 0}set(R){(R!==this.current||this.dirty)&&(this.gl.clearStencil(R),this.current=R,this.dirty=!1)}}class rl extends uo{getDefault(){return[!0,!0,!0,!0]}set(R){let ae=this.current;(R[0]!==ae[0]||R[1]!==ae[1]||R[2]!==ae[2]||R[3]!==ae[3]||this.dirty)&&(this.gl.colorMask(R[0],R[1],R[2],R[3]),this.current=R,this.dirty=!1)}}class Si extends uo{getDefault(){return!0}set(R){(R!==this.current||this.dirty)&&(this.gl.depthMask(R),this.current=R,this.dirty=!1)}}class po extends uo{getDefault(){return 255}set(R){(R!==this.current||this.dirty)&&(this.gl.stencilMask(R),this.current=R,this.dirty=!1)}}class ro extends uo{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(R){let ae=this.current;(R.func!==ae.func||R.ref!==ae.ref||R.mask!==ae.mask||this.dirty)&&(this.gl.stencilFunc(R.func,R.ref,R.mask),this.current=R,this.dirty=!1)}}class As extends uo{getDefault(){let R=this.gl;return[R.KEEP,R.KEEP,R.KEEP]}set(R){let ae=this.current;(R[0]!==ae[0]||R[1]!==ae[1]||R[2]!==ae[2]||this.dirty)&&(this.gl.stencilOp(R[0],R[1],R[2]),this.current=R,this.dirty=!1)}}class al extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;R?ae.enable(ae.STENCIL_TEST):ae.disable(ae.STENCIL_TEST),this.current=R,this.dirty=!1}}class $i extends uo{getDefault(){return[0,1]}set(R){let ae=this.current;(R[0]!==ae[0]||R[1]!==ae[1]||this.dirty)&&(this.gl.depthRange(R[0],R[1]),this.current=R,this.dirty=!1)}}class zs extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;R?ae.enable(ae.DEPTH_TEST):ae.disable(ae.DEPTH_TEST),this.current=R,this.dirty=!1}}class au extends uo{getDefault(){return this.gl.LESS}set(R){(R!==this.current||this.dirty)&&(this.gl.depthFunc(R),this.current=R,this.dirty=!1)}}class fl extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;R?ae.enable(ae.BLEND):ae.disable(ae.BLEND),this.current=R,this.dirty=!1}}class xu extends uo{getDefault(){let R=this.gl;return[R.ONE,R.ZERO]}set(R){let ae=this.current;(R[0]!==ae[0]||R[1]!==ae[1]||this.dirty)&&(this.gl.blendFunc(R[0],R[1]),this.current=R,this.dirty=!1)}}class zl extends uo{getDefault(){return t.aM.transparent}set(R){let ae=this.current;(R.r!==ae.r||R.g!==ae.g||R.b!==ae.b||R.a!==ae.a||this.dirty)&&(this.gl.blendColor(R.r,R.g,R.b,R.a),this.current=R,this.dirty=!1)}}class Ns extends uo{getDefault(){return this.gl.FUNC_ADD}set(R){(R!==this.current||this.dirty)&&(this.gl.blendEquation(R),this.current=R,this.dirty=!1)}}class nu extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;R?ae.enable(ae.CULL_FACE):ae.disable(ae.CULL_FACE),this.current=R,this.dirty=!1}}class Eu extends uo{getDefault(){return this.gl.BACK}set(R){(R!==this.current||this.dirty)&&(this.gl.cullFace(R),this.current=R,this.dirty=!1)}}class Bc extends uo{getDefault(){return this.gl.CCW}set(R){(R!==this.current||this.dirty)&&(this.gl.frontFace(R),this.current=R,this.dirty=!1)}}class Cu extends uo{getDefault(){return null}set(R){(R!==this.current||this.dirty)&&(this.gl.useProgram(R),this.current=R,this.dirty=!1)}}class Af extends uo{getDefault(){return this.gl.TEXTURE0}set(R){(R!==this.current||this.dirty)&&(this.gl.activeTexture(R),this.current=R,this.dirty=!1)}}class pf extends uo{getDefault(){let R=this.gl;return[0,0,R.drawingBufferWidth,R.drawingBufferHeight]}set(R){let ae=this.current;(R[0]!==ae[0]||R[1]!==ae[1]||R[2]!==ae[2]||R[3]!==ae[3]||this.dirty)&&(this.gl.viewport(R[0],R[1],R[2],R[3]),this.current=R,this.dirty=!1)}}class Us extends uo{getDefault(){return null}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.bindFramebuffer(ae.FRAMEBUFFER,R),this.current=R,this.dirty=!1}}class qc extends uo{getDefault(){return null}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.bindRenderbuffer(ae.RENDERBUFFER,R),this.current=R,this.dirty=!1}}class Sf extends uo{getDefault(){return null}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.bindTexture(ae.TEXTURE_2D,R),this.current=R,this.dirty=!1}}class iu extends uo{getDefault(){return null}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.bindBuffer(ae.ARRAY_BUFFER,R),this.current=R,this.dirty=!1}}class Ll extends uo{getDefault(){return null}set(R){let ae=this.gl;ae.bindBuffer(ae.ELEMENT_ARRAY_BUFFER,R),this.current=R,this.dirty=!1}}class nc extends uo{getDefault(){return null}set(R){var ae;if(R===this.current&&!this.dirty)return;let we=this.gl;Bs(we)?we.bindVertexArray(R):(ae=we.getExtension("OES_vertex_array_object"))===null||ae===void 0||ae.bindVertexArrayOES(R),this.current=R,this.dirty=!1}}class Ou extends uo{getDefault(){return 4}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_ALIGNMENT,R),this.current=R,this.dirty=!1}}class nl extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_PREMULTIPLY_ALPHA_WEBGL,R),this.current=R,this.dirty=!1}}class vl extends uo{getDefault(){return!1}set(R){if(R===this.current&&!this.dirty)return;let ae=this.gl;ae.pixelStorei(ae.UNPACK_FLIP_Y_WEBGL,R),this.current=R,this.dirty=!1}}class gs extends uo{constructor(R,ae){super(R),this.context=R,this.parent=ae}getDefault(){return null}}class qs extends gs{setDirty(){this.dirty=!0}set(R){if(R===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferTexture2D(ae.FRAMEBUFFER,ae.COLOR_ATTACHMENT0,ae.TEXTURE_2D,R,0),this.current=R,this.dirty=!1}}class ic extends gs{set(R){if(R===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferRenderbuffer(ae.FRAMEBUFFER,ae.DEPTH_ATTACHMENT,ae.RENDERBUFFER,R),this.current=R,this.dirty=!1}}class Nl extends gs{set(R){if(R===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let ae=this.gl;ae.framebufferRenderbuffer(ae.FRAMEBUFFER,ae.DEPTH_STENCIL_ATTACHMENT,ae.RENDERBUFFER,R),this.current=R,this.dirty=!1}}class Vu{constructor(R,ae,we,Se,Oe){this.context=R,this.width=ae,this.height=we;let pt=R.gl,At=this.framebuffer=pt.createFramebuffer();if(this.colorAttachment=new qs(R,At),Se)this.depthAttachment=Oe?new Nl(R,At):new ic(R,At);else if(Oe)throw new Error("Stencil cannot be set without depth");if(pt.checkFramebufferStatus(pt.FRAMEBUFFER)!==pt.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let R=this.context.gl,ae=this.colorAttachment.get();if(ae&&R.deleteTexture(ae),this.depthAttachment){let we=this.depthAttachment.get();we&&R.deleteRenderbuffer(we)}R.deleteFramebuffer(this.framebuffer)}}class cl{constructor(R,ae,we){this.blendFunction=R,this.blendColor=ae,this.mask=we}}cl.Replace=[1,0],cl.disabled=new cl(cl.Replace,t.aM.transparent,[!1,!1,!1,!1]),cl.unblended=new cl(cl.Replace,t.aM.transparent,[!0,!0,!0,!0]),cl.alphaBlended=new cl([1,771],t.aM.transparent,[!0,!0,!0,!0]);class yh{constructor(R){var ae,we;if(this.gl=R,this.clearColor=new $s(this),this.clearDepth=new ms(this),this.clearStencil=new Is(this),this.colorMask=new rl(this),this.depthMask=new Si(this),this.stencilMask=new po(this),this.stencilFunc=new ro(this),this.stencilOp=new As(this),this.stencilTest=new al(this),this.depthRange=new $i(this),this.depthTest=new zs(this),this.depthFunc=new au(this),this.blend=new fl(this),this.blendFunc=new xu(this),this.blendColor=new zl(this),this.blendEquation=new Ns(this),this.cullFace=new nu(this),this.cullFaceSide=new Eu(this),this.frontFace=new Bc(this),this.program=new Cu(this),this.activeTexture=new Af(this),this.viewport=new pf(this),this.bindFramebuffer=new Us(this),this.bindRenderbuffer=new qc(this),this.bindTexture=new Sf(this),this.bindVertexBuffer=new iu(this),this.bindElementBuffer=new Ll(this),this.bindVertexArray=new nc(this),this.pixelStoreUnpack=new Ou(this),this.pixelStoreUnpackPremultiplyAlpha=new nl(this),this.pixelStoreUnpackFlipY=new vl(this),this.extTextureFilterAnisotropic=R.getExtension("EXT_texture_filter_anisotropic")||R.getExtension("MOZ_EXT_texture_filter_anisotropic")||R.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=R.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=R.getParameter(R.MAX_TEXTURE_SIZE),Bs(R)){this.HALF_FLOAT=R.HALF_FLOAT;let Se=R.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(ae=R.RGBA16F)!==null&&ae!==void 0?ae:Se?.RGBA16F_EXT,this.RGB16F=(we=R.RGB16F)!==null&&we!==void 0?we:Se?.RGB16F_EXT,R.getExtension("EXT_color_buffer_float")}else{R.getExtension("EXT_color_buffer_half_float"),R.getExtension("OES_texture_half_float_linear");let Se=R.getExtension("OES_texture_half_float");this.HALF_FLOAT=Se?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(R,ae){return new Yo(this,R,ae)}createVertexBuffer(R,ae,we){return new Ci(this,R,ae,we)}createRenderbuffer(R,ae,we){let Se=this.gl,Oe=Se.createRenderbuffer();return this.bindRenderbuffer.set(Oe),Se.renderbufferStorage(Se.RENDERBUFFER,R,ae,we),this.bindRenderbuffer.set(null),Oe}createFramebuffer(R,ae,we,Se){return new Vu(this,R,ae,we,Se)}clear({color:R,depth:ae,stencil:we}){let Se=this.gl,Oe=0;R&&(Oe|=Se.COLOR_BUFFER_BIT,this.clearColor.set(R),this.colorMask.set([!0,!0,!0,!0])),ae!==void 0&&(Oe|=Se.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(ae),this.depthMask.set(!0)),we!==void 0&&(Oe|=Se.STENCIL_BUFFER_BIT,this.clearStencil.set(we),this.stencilMask.set(255)),Se.clear(Oe)}setCullFace(R){R.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(R.mode),this.frontFace.set(R.frontFace))}setDepthMode(R){R.func!==this.gl.ALWAYS||R.mask?(this.depthTest.set(!0),this.depthFunc.set(R.func),this.depthMask.set(R.mask),this.depthRange.set(R.range)):this.depthTest.set(!1)}setStencilMode(R){R.test.func!==this.gl.ALWAYS||R.mask?(this.stencilTest.set(!0),this.stencilMask.set(R.mask),this.stencilOp.set([R.fail,R.depthFail,R.pass]),this.stencilFunc.set({func:R.test.func,ref:R.ref,mask:R.test.mask})):this.stencilTest.set(!1)}setColorMode(R){t.aE(R.blendFunction,cl.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(R.blendFunction),this.blendColor.set(R.blendColor)),this.colorMask.set(R.mask)}createVertexArray(){var R;return Bs(this.gl)?this.gl.createVertexArray():(R=this.gl.getExtension("OES_vertex_array_object"))===null||R===void 0?void 0:R.createVertexArrayOES()}deleteVertexArray(R){var ae;return Bs(this.gl)?this.gl.deleteVertexArray(R):(ae=this.gl.getExtension("OES_vertex_array_object"))===null||ae===void 0?void 0:ae.deleteVertexArrayOES(R)}unbindVAO(){this.bindVertexArray.set(null)}}class ls{constructor(R,ae,we){this.func=R,this.mask=ae,this.range=we}}ls.ReadOnly=!1,ls.ReadWrite=!0,ls.disabled=new ls(519,ls.ReadOnly,[0,1]);let _h=7680;class Ss{constructor(R,ae,we,Se,Oe,pt){this.test=R,this.ref=ae,this.mask=we,this.fail=Se,this.depthFail=Oe,this.pass=pt}}Ss.disabled=new Ss({func:519,mask:0},0,0,_h,_h,_h);class Qi{constructor(R,ae,we){this.enable=R,this.mode=ae,this.frontFace=we}}let Gc;function qu(Ne,R,ae,we,Se){let Oe=Ne.context,pt=Oe.gl,At=Ne.useProgram("collisionBox"),Bt=[],$t=0,br=0;for(let dt=0;dt<we.length;dt++){let Ct=we[dt],wt=R.getTile(Ct).getBucket(ae);if(!wt)continue;let Dt=Se?wt.textCollisionBox:wt.iconCollisionBox,ur=wt.collisionCircleArray;if(ur.length>0){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<dt.circleArray.length/4;Ct++){let wt=4*Ct,Dt=dt.circleArray[wt+0],ur=dt.circleArray[wt+1],mr=dt.circleArray[wt+2],Er=dt.circleArray[wt+3];sa.emplace(He++,Dt,ur,mr,Er,0),sa.emplace(He++,Dt,ur,mr,Er,1),sa.emplace(He++,Dt,ur,mr,Er,2),sa.emplace(He++,Dt,ur,mr,Er,3)}(!Gc||Gc.length<2*$t)&&(Gc=function(dt){let Ct=2*dt,wt=new t.aT;wt.resize(Ct),wt._trim();for(let Dt=0;Dt<Ct;Dt++){let ur=6*Dt;wt.uint16[ur+0]=4*Dt+0,wt.uint16[ur+1]=4*Dt+1,wt.uint16[ur+2]=4*Dt+2,wt.uint16[ur+3]=4*Dt+2,wt.uint16[ur+4]=4*Dt+3,wt.uint16[ur+5]=4*Dt+0}return wt}($t));let Je=Oe.createIndexBuffer(Gc,!0),lt=Oe.createVertexBuffer(sa,t.aS.members,!0);for(let dt of Bt){let Ct=ki(dt.transform,dt.invTransform,Ne.transform);Yr.draw(Oe,pt.TRIANGLES,ls.disabled,Ss.disabled,Ne.colorModeForRenderPass(),Qi.disabled,Ct,Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(dt.coord),ae.id,lt,Je,t.a0.simpleSegment(0,2*dt.circleOffset,dt.circleArray.length,dt.circleArray.length/2),null,Ne.transform.zoom,null,null,null)}lt.destroy(),Je.destroy()}Qi.disabled=new Qi(!1,1029,2305),Qi.backCCW=new Qi(!0,1029,2305);let Ul=t.an(new Float32Array(16));function Mf(Ne,R,ae,we,Se,Oe){let{horizontalAlign:pt,verticalAlign:At}=t.au(Ne);return new t.P((-(pt-.5)*R/Se+we[0])*Oe,(-(At-.5)*ae/Se+we[1])*Oe)}function wc(Ne,R,ae,we,Se,Oe){let pt=R.tileAnchorPoint.add(new t.P(R.translation[0],R.translation[1]));if(R.pitchWithMap){let At=we.mult(Oe);ae||(At=At.rotate(-Se));let Bt=pt.add(At);return bt(Bt.x,Bt.y,R.labelPlaneMatrix,R.getElevation).point}if(ae){let At=at(R.tileAnchorPoint.x+1,R.tileAnchorPoint.y,R).point.sub(Ne),Bt=Math.atan(At.y/At.x)+(At.x<0?Math.PI:0);return Ne.add(we.rotate(Bt))}return Ne.add(we)}function rf(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar,Yr,sa){let He=Ne.text.placedSymbolArray,Je=Ne.text.dynamicLayoutVertexArray,lt=Ne.icon.dynamicLayoutVertexArray,dt={};Je.clear();for(let Ct=0;Ct<He.length;Ct++){let wt=He.get(Ct),Dt=wt.hidden||!wt.crossTileID||Ne.allowVerticalPlacement&&!wt.placedOrientation?null:we[wt.crossTileID];if(Dt){let ur=new t.P(wt.anchorX,wt.anchorY),mr={getElevation:sa,width:Se.width,height:Se.height,labelPlaneMatrix:Oe,lineVertexArray:null,pitchWithMap:ae,projection:br,projectionCache:null,tileAnchorPoint:ur,translation:Ar,unwrappedTileID:Yr},Er=ae?bt(ur.x,ur.y,pt,sa):at(ur.x,ur.y,mr),Br=Be(Se.cameraToCenterDistance,Er.signedDistanceFromCamera),Qr=t.ai(Ne.textSizeData,Bt,wt)*Br/t.ap;ae&&(Qr*=Ne.tilePixelRatio/At);let{width:ga,height:Sa,anchor:Oa,textOffset:vn,textBoxScale:Xn}=Dt,Hn=Mf(Oa,ga,Sa,vn,Xn,Qr),oi=br.getPitchedTextCorrection(Se,ur.add(new t.P(Ar[0],Ar[1])),Yr),Ti=wc(Er.point,mr,R,Hn,Se.angle,oi),Wi=Ne.allowVerticalPlacement&&wt.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let Bi=0;Bi<wt.numGlyphs;Bi++)t.aj(Je,Ti,Wi);$t&&wt.associatedIconIndex>=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;wt<Ct.length;wt++){let Dt=Ct.get(wt);if(Dt.hidden)rr(Dt.numGlyphs,lt);else{let ur=dt[wt];if(ur)for(let mr=0;mr<Dt.numGlyphs;mr++)t.aj(lt,ur.shiftedAnchor,ur.angle);else rr(Dt.numGlyphs,lt)}}Ne.icon.dynamicLayoutVertexBuffer.updateData(lt)}Ne.text.dynamicLayoutVertexBuffer.updateData(Je)}function Kl(Ne,R,ae){return ae.iconsInText&&R?"symbolTextAndIcon":Ne?"symbolSDF":"symbolIcon"}function Yf(Ne,R,ae,we,Se,Oe,pt,At,Bt,$t,br,Ar){let Yr=Ne.context,sa=Yr.gl,He=Ne.transform,Je=yn(),lt=At==="map",dt=Bt==="map",Ct=At!=="viewport"&&ae.layout.get("symbol-placement")!=="point",wt=lt&&!dt&&!Ct,Dt=!dt&&Ct,ur=!ae.layout.get("symbol-sort-key").isConstant(),mr=!1,Er=Ne.depthModeForSublayer(0,ls.ReadOnly),Br=ae._unevaluatedLayout.hasValue("text-variable-anchor")||ae._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Qr=[],ga=Je.getCircleRadiusCorrection(He);for(let Sa of we){let Oa=R.getTile(Sa),vn=Oa.getBucket(ae);if(!vn)continue;let Xn=Se?vn.text:vn.icon;if(!Xn||!Xn.segments.get().length||!Xn.hasVisibleVertices)continue;let Hn=Xn.programConfigurations.get(ae.id),oi=Se||vn.sdfIcons,Ti=Se?vn.textSizeData:vn.iconSizeData,Wi=dt||He.pitch!==0,Bi=Ne.useProgram(Kl(oi,Se,vn),Hn),Ao=t.ag(Ti,He.zoom),ss=Ne.style.map.terrain&&Ne.style.map.terrain.getTerrainData(Sa),So,Ko,hs,ll,Js=[0,0],es=null;if(Se)Ko=Oa.glyphAtlasTexture,hs=sa.LINEAR,So=Oa.glyphAtlasTexture.size,vn.iconsInText&&(Js=Oa.imageAtlasTexture.size,es=Oa.imageAtlasTexture,ll=Wi||Ne.options.rotating||Ne.options.zooming||Ti.kind==="composite"||Ti.kind==="camera"?sa.LINEAR:sa.NEAREST);else{let St=ae.layout.get("icon-size").constantOr(0)!==1||vn.iconsNeedLinear;Ko=Oa.imageAtlasTexture,hs=oi||Ne.options.rotating||Ne.options.zooming||St||Wi?sa.LINEAR:sa.NEAREST,So=Oa.imageAtlasTexture.size}let ts=Ua(Oa,1,Ne.transform.zoom),Pl=Dt?Sa.posMatrix:Ul,$l=wr(Pl,dt,lt,Ne.transform,ts),Ru=Ir(Pl,dt,lt,Ne.transform,ts),hu=Ir(Sa.posMatrix,dt,lt,Ne.transform,ts),wl=Je.translatePosition(Ne.transform,Oa,Oe,pt),su=Br&&vn.hasTextData(),uc=ae.layout.get("icon-text-fit")!=="none"&&su&&vn.hasIconData();if(Ct){let St=Ne.style.map.terrain?(zt,gr)=>Ne.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<Oe;At++)pt[At+Se]=new Ss({func:ae.GEQUAL,mask:255},At+this.nextStencilID,255,ae.KEEP,ae.KEEP,ae.REPLACE);return this.nextStencilID+=Oe,[pt,we]}return[{[Se]:Ss.disabled},we]}colorModeForRenderPass(){let R=this.context.gl;return this._showOverdrawInspector?new cl([R.CONSTANT_COLOR,R.ONE],new t.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?cl.unblended:cl.alphaBlended}depthModeForSublayer(R,ae,we){if(!this.opaquePassEnabledForLayer())return ls.disabled;let Se=1-((1+this.currentLayer)*this.numSublayers+R)*this.depthEpsilon;return new ls(we||this.context.gl.LEQUAL,ae,[Se,Se])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(R,ae){this.style=R,this.options=ae,this.lineAtlas=R.lineAtlas,this.imageManager=R.imageManager,this.glyphManager=R.glyphManager,this.symbolFadeChange=R.placement.symbolFadeChange(n.now()),this.imageManager.beginFrame();let we=this.style._order,Se=this.style.sourceCaches,Oe={},pt={},At={};for(let Bt in Se){let $t=Se[Bt];$t.used&&$t.prepare(this.context),Oe[Bt]=$t.getVisibleCoordinates(),pt[Bt]=Oe[Bt].slice().reverse(),At[Bt]=$t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Bt=0;Bt<we.length;Bt++)if(this.style._layers[we[Bt]].is3D()){this.opaquePassCutoff=Bt;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let Bt of we){let $t=this.style._layers[Bt];if(!$t.hasOffscreenPass()||$t.isHidden(this.transform.zoom))continue;let br=pt[$t.source];($t.type==="custom"||br.length)&&this.renderLayer(this,Se[$t.source],$t,br)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:ae.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(Bt,$t){let br=Bt.context,Ar=br.gl,Yr=((dt,Ct,wt)=>({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.currentLayer<we.length;this.currentLayer++){let Bt=this.style._layers[we[this.currentLayer]],$t=Se[Bt.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Bt))continue;let br=(Bt.type==="symbol"?At:pt)[Bt.source];this._renderTileClippingMasks(Bt,Oe[Bt.source]),this.renderLayer(this,$t,Bt,br)}if(this.options.showTileBoundaries){let Bt=function($t,br){let Ar=null,Yr=Object.values($t._layers).flatMap(lt=>lt.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().maxzoom<lt.getSource().maxzoom)&&(Ar=lt)};return sa.forEach(lt=>Je(lt)),Ar||He.forEach(lt=>Je(lt)),Ar}(this.style,this.transform.zoom);Bt&&function($t,br,Ar){for(let Yr=0;Yr<Ar.length;Yr++)Nf($t,br,Ar[Yr])}(this,Bt,Bt.getVisibleCoordinates())}this.options.showPadding&&function(Bt){let $t=Bt.transform.padding;Wc(Bt,Bt.transform.height-($t.top||0),3,Tc),Wc(Bt,$t.bottom||0,3,Gs),Kf(Bt,$t.left||0,3,Cf),Kf(Bt,Bt.transform.width-($t.right||0),3,lh);let br=Bt.transform.centerPoint;(function(Ar,Yr,sa,He){ku(Ar,Yr-1,sa-10,2,20,He),ku(Ar,Yr-10,sa-1,20,2,He)})(Bt,br.x,Bt.transform.height-br.y,Bf)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(R){if(!this.style||!this.style.map||!this.style.map.terrain)return;let ae=this.terrainFacilitator.matrix,we=this.transform.modelViewProjectionMatrix,Se=this.terrainFacilitator.dirty;Se||(Se=R?!t.a_(ae,we):!t.a$(ae,we)),Se||(Se=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),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;wt<Bt.length;wt++){let Dt=Bt[wt],ur=pt.getTile(Dt),mr=ur.getBucket(At);if(!mr)continue;let Er=mr.programConfigurations.get(At.id),Br=Oe.useProgram("circle",Er),Qr=mr.layoutVertexBuffer,ga=mr.indexBuffer,Sa=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(Dt),Oa={programConfiguration:Er,program:Br,layoutVertexBuffer:Qr,indexBuffer:ga,uniformValues:Ai(Oe,Dt,ur,At),terrainData:Sa};if(Yr){let vn=mr.segments.get();for(let Xn of vn)Ct.push({segments:new t.a0([Xn]),sortKey:Xn.sortKey,state:Oa})}else Ct.push({segments:mr.segments,sortKey:0,state:Oa})}Yr&&Ct.sort((wt,Dt)=>wt.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;Ct<sa.length;Ct++){let wt=sa[Ct];if(Ar.hasRenderableParent(wt))continue;let Dt=Ar.getTile(wt),ur=Dt.getBucket(Yr);if(!ur)continue;let mr=ur.programConfigurations.get(Yr.id),Er=br.useProgram("heatmap",mr),{zoom:Br}=br.transform;Er.draw(He,Je.TRIANGLES,ls.disabled,lt,dt,Qi.disabled,to(wt.posMatrix,Dt,Br,Yr.paint.get("heatmap-intensity")),null,Yr.id,ur.layoutVertexBuffer,ur.indexBuffer,ur.segments,Yr.paint,br.transform.zoom,mr)}He.viewport.set([0,0,br.width,br.height])}(Oe,pt,At,Bt):Oe.renderPass==="translucent"&&function(br,Ar){let Yr=br.context,sa=Yr.gl;Yr.setColorMode(br.colorModeForRenderPass());let He=Ar.heatmapFbos.get(t.aU);He&&(Yr.activeTexture.set(sa.TEXTURE0),sa.bindTexture(sa.TEXTURE_2D,He.colorAttachment.get()),Yr.activeTexture.set(sa.TEXTURE1),Of(Yr,Ar).bind(sa.LINEAR,sa.CLAMP_TO_EDGE),br.useProgram("heatmapTexture").draw(Yr,sa.TRIANGLES,ls.disabled,Ss.disabled,br.colorModeForRenderPass(),Qi.disabled,go(br,Ar,0,1),null,Ar.id,br.viewportBuffer,br.quadTriangleIndexBuffer,br.viewportSegments,Ar.paint,br.transform.zoom))}(Oe,At)})(R,ae,we,Se);break;case"line":(function(Oe,pt,At,Bt){if(Oe.renderPass!=="translucent")return;let $t=At.paint.get("line-opacity"),br=At.paint.get("line-width");if($t.constantOr(1)===0||br.constantOr(1)===0)return;let Ar=Oe.depthModeForSublayer(0,ls.ReadOnly),Yr=Oe.colorModeForRenderPass(),sa=At.paint.get("line-dasharray"),He=At.paint.get("line-pattern"),Je=He.constantOr(1),lt=At.paint.get("line-gradient"),dt=At.getCrossfadeParameters(),Ct=Je?"linePattern":sa?"lineSDF":lt?"lineGradient":"line",wt=Oe.context,Dt=wt.gl,ur=!0;for(let mr of Bt){let Er=pt.getTile(mr);if(Je&&!Er.patternsLoaded())continue;let Br=Er.getBucket(At);if(!Br)continue;let Qr=Br.programConfigurations.get(At.id),ga=Oe.context.program.get(),Sa=Oe.useProgram(Ct,Qr),Oa=ur||Sa.program!==ga,vn=Oe.style.map.terrain&&Oe.style.map.terrain.getTerrainData(mr),Xn=He.constantOr(null);if(Xn&&Er.imageAtlas){let Ti=Er.imageAtlas,Wi=Ti.patternPositions[Xn.to.toString()],Bi=Ti.patternPositions[Xn.from.toString()];Wi&&Bi&&Qr.setConstantPatternPositions(Wi,Bi)}let Hn=vn?mr:null,oi=Je?Ts(Oe,Er,At,dt,Hn):sa?Po(Oe,Er,At,sa,dt,Hn):lt?Xo(Oe,Er,At,Br.lineClipsArray.length,Hn):Jo(Oe,Er,At,Hn);if(Je)wt.activeTexture.set(Dt.TEXTURE0),Er.imageAtlasTexture.bind(Dt.LINEAR,Dt.CLAMP_TO_EDGE),Qr.updatePaintBuffers(dt);else if(sa&&(Oa||Oe.lineAtlas.dirty))wt.activeTexture.set(Dt.TEXTURE0),Oe.lineAtlas.bind(wt);else if(lt){let Ti=Br.gradients[At.id],Wi=Ti.texture;if(At.gradientVersion!==Ti.version){let Bi=256;if(At.stepInterpolant){let Ao=pt.getSource().maxzoom,ss=mr.canonical.z===Ao?Math.ceil(1<<Oe.transform.maxZoom-mr.canonical.z):1;Bi=t.ac(t.aV(Br.maxLineLength/t.X*1024*ss),256,wt.maxTextureSize)}Ti.gradient=t.aW({expression:At.gradientExpression(),evaluationKey:"lineProgress",resolution:Bi,image:Ti.gradient||void 0,clips:Br.lineClipsArray}),Ti.texture?Ti.texture.update(Ti.gradient):Ti.texture=new u(wt,Ti.gradient,Dt.RGBA),Ti.version=At.gradientVersion,Wi=Ti.texture}wt.activeTexture.set(Dt.TEXTURE0),Wi.bind(At.stepInterpolant?Dt.NEAREST:Dt.LINEAR,Dt.CLAMP_TO_EDGE)}Sa.draw(wt,Dt.TRIANGLES,Ar,Oe.stencilModeForClipping(mr),Yr,Qi.disabled,oi,vn,At.id,Br.layoutVertexBuffer,Br.indexBuffer,Br.segments,At.paint,Oe.transform.zoom,Qr,Br.layoutVertexBuffer2),ur=!1}})(R,ae,we,Se);break;case"fill":(function(Oe,pt,At,Bt){let $t=At.paint.get("fill-color"),br=At.paint.get("fill-opacity");if(br.constantOr(1)===0)return;let Ar=Oe.colorModeForRenderPass(),Yr=At.paint.get("fill-pattern"),sa=Oe.opaquePassEnabledForLayer()&&!Yr.constantOr(1)&&$t.constantOr(t.aM.transparent).a===1&&br.constantOr(0)===1?"opaque":"translucent";if(Oe.renderPass===sa){let He=Oe.depthModeForSublayer(1,Oe.renderPass==="opaque"?ls.ReadWrite:ls.ReadOnly);Ef(Oe,pt,At,Bt,He,Ar,!1)}if(Oe.renderPass==="translucent"&&At.paint.get("fill-antialias")){let He=Oe.depthModeForSublayer(At.getPaintProperty("fill-outline-color")?2:0,ls.ReadOnly);Ef(Oe,pt,At,Bt,He,Ar,!0)}})(R,ae,we,Se);break;case"fill-extrusion":(function(Oe,pt,At,Bt){let $t=At.paint.get("fill-extrusion-opacity");if($t!==0&&Oe.renderPass==="translucent"){let br=new ls(Oe.context.gl.LEQUAL,ls.ReadWrite,Oe.depthRangeFor3D);if($t!==1||At.paint.get("fill-extrusion-pattern").constantOr(1))oc(Oe,pt,At,Bt,br,Ss.disabled,cl.disabled),oc(Oe,pt,At,Bt,br,Oe.stencilModeFor3D(),Oe.colorModeForRenderPass());else{let Ar=Oe.colorModeForRenderPass();oc(Oe,pt,At,Bt,br,Ss.disabled,Ar)}}})(R,ae,we,Se);break;case"hillshade":(function(Oe,pt,At,Bt){if(Oe.renderPass!=="offscreen"&&Oe.renderPass!=="translucent")return;let $t=Oe.context,br=Oe.depthModeForSublayer(0,ls.ReadOnly),Ar=Oe.colorModeForRenderPass(),[Yr,sa]=Oe.renderPass==="translucent"?Oe.stencilConfigForOverlap(Bt):[{},Bt];for(let He of sa){let Je=pt.getTile(He);Je.needsHillshadePrepare!==void 0&&Je.needsHillshadePrepare&&Oe.renderPass==="offscreen"?Jl(Oe,Je,At,br,Ss.disabled,Ar):Oe.renderPass==="translucent"&&Hc(Oe,He,Je,At,br,Yr[He.overscaledZ],Ar)}$t.viewport.set([0,0,Oe.width,Oe.height])})(R,ae,we,Se);break;case"raster":(function(Oe,pt,At,Bt){if(Oe.renderPass!=="translucent"||At.paint.get("raster-opacity")===0||!Bt.length)return;let $t=Oe.context,br=$t.gl,Ar=pt.getSource(),Yr=Oe.useProgram("raster"),sa=Oe.colorModeForRenderPass(),[He,Je]=Ar instanceof it?[{},Bt]:Oe.stencilConfigForOverlap(Bt),lt=Je[Je.length-1].overscaledZ,dt=!Oe.options.moving;for(let Ct of Je){let wt=Oe.depthModeForSublayer(Ct.overscaledZ-lt,At.paint.get("raster-opacity")===1?ls.ReadWrite:ls.ReadOnly,br.LESS),Dt=pt.getTile(Ct);Dt.registerFadeDuration(At.paint.get("raster-fade-duration"));let ur=pt.findLoadedParent(Ct,0),mr=pt.findLoadedSibling(Ct),Er=Uc(Dt,ur||mr||null,pt,At,Oe.transform,Oe.style.map.terrain),Br,Qr,ga=At.paint.get("raster-resampling")==="nearest"?br.NEAREST:br.LINEAR;$t.activeTexture.set(br.TEXTURE0),Dt.texture.bind(ga,br.CLAMP_TO_EDGE,br.LINEAR_MIPMAP_NEAREST),$t.activeTexture.set(br.TEXTURE1),ur?(ur.texture.bind(ga,br.CLAMP_TO_EDGE,br.LINEAR_MIPMAP_NEAREST),Br=Math.pow(2,ur.tileID.overscaledZ-Dt.tileID.overscaledZ),Qr=[Dt.tileID.canonical.x*Br%1,Dt.tileID.canonical.y*Br%1]):Dt.texture.bind(ga,br.CLAMP_TO_EDGE,br.LINEAR_MIPMAP_NEAREST),Dt.texture.useMipmap&&$t.extTextureFilterAnisotropic&&Oe.transform.pitch>20&&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<ae.length;Oe++)we[Oe]=ae[Oe]?this.min[Oe]:this.center[Oe],Se[Oe]=ae[Oe]?this.center[Oe]:this.max[Oe];return Se[2]=this.max[2],new dc(we,Se)}distanceX(R){return Math.max(Math.min(this.max[0],R[0]),this.min[0])-R[0]}distanceY(R){return Math.max(Math.min(this.max[1],R[1]),this.min[1])-R[1]}intersects(R){let ae=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],we=!0;for(let Se=0;Se<R.planes.length;Se++){let Oe=R.planes[Se],pt=0;for(let At=0;At<ae.length;At++)t.b2(Oe,ae[At])>=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;At<R.points.length;At++){let Bt=R.points[At][Se]-this.min[Se];Oe=Math.min(Oe,Bt),pt=Math.max(pt,Bt)}if(pt<0||Oe>this.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&&Se<R.minzoom)return[];R.maxzoom!==void 0&&Se>R.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<<dt-wt.zoom)-2&&wt.zoom>=Yr){let Sa=dt-wt.zoom,Oa=$t[0]-.5-(Dt<<Sa),vn=$t[1]-.5-(ur<<Sa);lt.push({tileID:new t.S(wt.zoom===dt?Ct:wt.zoom,wt.wrap,wt.zoom,Dt,ur),distanceSq:g([br[0]-.5-Dt,br[1]-.5-ur]),tileDistanceToCamera:Math.sqrt(Oa*Oa+vn*vn)})}else for(let Sa=0;Sa<4;Sa++){let Oa=(Dt<<1)+Sa%2,vn=(ur<<1)+(Sa>>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-pt<sa&&(br=sa/(At-pt))}Se&&(Bt=t.b3(t.O(Se[0])*Oe,0,Oe),$t=t.b3(t.O(Se[1])*Oe,0,Oe),$t<Bt&&($t+=Oe),$t-Bt<Yr&&(Ar=Yr/($t-Bt)));let{x:He,y:Je}=this.project.call({worldSize:Oe},R),lt,dt,Ct=Math.max(Ar||0,br||0);if(Ct){let wt=new t.P(Ar?($t+Bt)/2:He,br?(At+pt)/2:Je);return we.center=this.unproject.call({worldSize:Oe},wt).wrap(),we.zoom+=this.scaleZoom(Ct),we}if(this.latRange){let wt=sa/2;Je-wt<pt&&(dt=pt+wt),Je+wt>At&&(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<Bt&&(lt=Bt+ur),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.duration<R.duration)&&(Ne.duration=R.duration,Ne.easing=R.easing)}function of(Ne,R,ae){let{maxSpeed:we,linearity:Se,deceleration:Oe}=ae,pt=t.ac(Ne*Se/(R/1e3),-we,we),At=Math.abs(pt)/(Oe*Se);return{easing:ae.easing,duration:1e3*At,amount:pt*(At/2)}}class tu extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(R,ae,we,Se={}){let Oe=o.mousePos(ae.getCanvas(),we),pt=ae.unproject(Oe);super(R,t.e({point:Oe,lngLat:pt,originalEvent:we},Se)),this._defaultPrevented=!1,this.target=ae}}class Xc extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(R,ae,we){let Se=R==="touchend"?we.changedTouches:we.touches,Oe=o.touchPos(ae.getCanvasContainer(),Se),pt=Oe.map(Bt=>ae.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)<this._clickTolerance)return;let Se=this._startPos;this._lastPos=we,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",R));let Oe=Math.min(Se.x,we.x),pt=Math.max(Se.x,we.x),At=Math.min(Se.y,we.y),Bt=Math.max(Se.y,we.y);o.setTransform(this._box,`translate(${Oe}px,${At}px)`),this._box.style.width=pt-Oe+"px",this._box.style.height=Bt-At+"px"}mouseupWindow(R,ae){if(!this._active||R.button!==0)return;let we=this._startPos,Se=ae;if(this.reset(),o.suppressClick(),we.x!==Se.x||we.y!==Se.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:R})),{cameraAnimation:Oe=>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;we<Ne.length;we++)ae[Ne[we].identifier]=R[we];return ae}class hl{constructor(R){this.reset(),this.numTouches=R.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(R,ae,we){(this.centroid||we.length>this.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)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=Se,this._move(we,Se))}dragEnd(R){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(R)&&(this._moved&&o.suppressClick(),this.reset(R))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let mf={0:1,2:2};class Wu{constructor(R){this._correctEvent=R.checkCorrectEvent}startMove(R){let ae=o.mouseButton(R);this._eventButton=ae}endMove(R){delete this._eventButton}isValidStartEvent(R){return this._correctEvent(R)}isValidMoveEvent(R){return!function(ae,we){let Se=mf[we];return ae.buttons===void 0||(ae.buttons&Se)!==Se}(R,this._eventButton)}isValidEndEvent(R){return o.mouseButton(R)===this._eventButton}}class Zc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(R){return R.targetTouches.length===1}_isSameTouchEvent(R){return R.targetTouches[0].identifier===this._firstTouch}startMove(R){this._firstTouch=R.targetTouches[0].identifier}endMove(R){delete this._firstTouch}isValidStartEvent(R){return this._isOneFingerTouch(R)}isValidMoveEvent(R){return this._isOneFingerTouch(R)&&this._isSameTouchEvent(R)}isValidEndEvent(R){return this._isOneFingerTouch(R)&&this._isSameTouchEvent(R)}}let Lf=Ne=>{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()<this._clickTolerance?void 0:{around:Oe.div(At),panDelta:Bt}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ec{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(R,ae,we){this._firstTwoTouches||we.length<2||(this._firstTwoTouches=[we[0].identifier,we[1].identifier],this._start([ae[0],ae[1]]))}touchmove(R,ae,we){if(!this._firstTwoTouches)return;R.preventDefault();let[Se,Oe]=this._firstTwoTouches,pt=mc(we,ae,Se),At=mc(we,ae,Oe);if(!pt||!At)return;let Bt=this._aroundCenter?null:pt.add(At).div(2);return this._move([pt,At],Bt,R)}touchend(R,ae,we){if(!this._firstTwoTouches)return;let[Se,Oe]=this._firstTwoTouches,pt=mc(we,ae,Se),At=mc(we,ae,Oe);pt&&At||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(R){this._enabled=!0,this._aroundCenter=!!R&&R.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function mc(Ne,R,ae){for(let we=0;we<Ne.length;we++)if(Ne[we].identifier===ae)return R[we]}function jl(Ne,R){return Math.log(Ne/R)/Math.LN2}class gu extends Ec{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(R){this._startDistance=this._distance=R[0].dist(R[1])}_move(R,ae){let we=this._distance;if(this._distance=R[0].dist(R[1]),this._active||!(Math.abs(jl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:jl(this._distance,we),pinchAround:ae}}}function Cc(Ne,R){return 180*Ne.angleWith(R)/Math.PI}class Yc extends Ec{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(R){this._startVector=this._vector=R[0].sub(R[1]),this._minDiameter=R[0].dist(R[1])}_move(R,ae,we){let Se=this._vector;if(this._vector=R[0].sub(R[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Cc(this._vector,Se),pinchAround:ae}}_isBelowThreshold(R){this._minDiameter=Math.min(this._minDiameter,R.mag());let ae=25/(Math.PI*this._minDiameter)*360,we=Cc(R,this._startVector);return Math.abs(we)<ae}}function sc(Ne){return Math.abs(Ne.y)>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<sa&&sa<this._bearingSnap;!Ar||!Ar.essential&&n.prefersReducedMotion?(this._map.fire(new t.k("moveend",{originalEvent:Bt})),Yr(this._map.getBearing())&&this._map.resetNorth()):(Yr(Ar.bearing||this._map.getBearing())&&(Ar.bearing=0),Ar.freezeElevation=!0,this._map.easeTo(Ar,{originalEvent:Bt})),this._updatingCamera=!1}}_fireEvent(R,ae){this._map.fire(new t.k(R,ae?{originalEvent:ae}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(R=>{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())<this._bearingSnap?this.resetNorth(R,ae):this}getPitch(){return this.transform.pitch}setPitch(R,ae){return this.jumpTo({pitch:R},ae),this}cameraForBounds(R,ae){R=re.convert(R).adjustAntiMeridian();let we=ae&&ae.bearing||0;return this._cameraForBoxAndBearing(R.getNorthWest(),R.getSouthEast(),we,ae)}_cameraForBoxAndBearing(R,ae,we,Se){let Oe={top:0,bottom:0,right:0,left:0};if(typeof(Se=t.e({padding:Oe,offset:[0,0],maxZoom:this.transform.maxZoom},Se)).padding=="number"){let Sa=Se.padding;Se.padding={top:Sa,bottom:Sa,right:Sa,left:Sa}}Se.padding=t.e(Oe,Se.padding);let pt=this.transform,At=pt.padding,Bt=new re(R,ae),$t=pt.project(Bt.getNorthWest()),br=pt.project(Bt.getNorthEast()),Ar=pt.project(Bt.getSouthEast()),Yr=pt.project(Bt.getSouthWest()),sa=t.ba(-we),He=$t.rotate(sa),Je=br.rotate(sa),lt=Ar.rotate(sa),dt=Yr.rotate(sa),Ct=new t.P(Math.max(He.x,Je.x,dt.x,lt.x),Math.max(He.y,Je.y,dt.y,lt.y)),wt=new t.P(Math.min(He.x,Je.x,dt.x,lt.x),Math.min(He.y,Je.y,dt.y,lt.y)),Dt=Ct.sub(wt),ur=(pt.width-(At.left+At.right+Se.padding.left+Se.padding.right))/Dt.x,mr=(pt.height-(At.top+At.bottom+Se.padding.top+Se.padding.bottom))/Dt.y;if(mr<0||ur<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let Er=Math.min(pt.scaleZoom(pt.scale*Math.min(ur,mr)),Se.maxZoom),Br=t.P.convert(Se.offset),Qr=new t.P((Se.padding.left-Se.padding.right)/2,(Se.padding.top-Se.padding.bottom)/2).rotate(t.ba(we)),ga=Br.add(Qr).mult(pt.scale/pt.zoomScale(Er));return{center:pt.unproject($t.add(Ar).div(2).sub(ga)),zoom:Er,bearing:we}}fitBounds(R,ae,we){return this._fitInternal(this.cameraForBounds(R,ae),ae,we)}fitScreenCoordinates(R,ae,we,Se,Oe){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(R)),this.transform.pointLocation(t.P.convert(ae)),we,Se),Se,Oe)}_fitInternal(R,ae,we){return R?(delete(ae=t.e(R,ae)).padding,ae.linear?this.easeTo(ae,we):this.flyTo(ae,we)):this}jumpTo(R,ae){this.stop();let we=this._getTransformForUpdate(),Se=!1,Oe=!1,pt=!1;return"zoom"in R&&we.zoom!==+R.zoom&&(Se=!0,we.zoom=+R.zoom),R.center!==void 0&&(we.center=t.N.convert(R.center)),"bearing"in R&&we.bearing!==+R.bearing&&(Oe=!0,we.bearing=+R.bearing),"pitch"in R&&we.pitch!==+R.pitch&&(pt=!0,we.pitch=+R.pitch),R.padding==null||we.isPaddingEqual(R.padding)||(we.padding=R.padding),this._applyUpdatedTransform(we),this.fire(new t.k("movestart",ae)).fire(new t.k("move",ae)),Se&&this.fire(new t.k("zoomstart",ae)).fire(new t.k("zoom",ae)).fire(new t.k("zoomend",ae)),Oe&&this.fire(new t.k("rotatestart",ae)).fire(new t.k("rotate",ae)).fire(new t.k("rotateend",ae)),pt&&this.fire(new t.k("pitchstart",ae)).fire(new t.k("pitch",ae)).fire(new t.k("pitchend",ae)),this.fire(new t.k("moveend",ae))}calculateCameraOptionsFromTo(R,ae,we,Se=0){let Oe=t.Z.fromLngLat(R,ae),pt=t.Z.fromLngLat(we,Se),At=pt.x-Oe.x,Bt=pt.y-Oe.y,$t=pt.z-Oe.z,br=Math.hypot(At,Bt,$t);if(br===0)throw new Error("Can't calculate camera options with same From and To");let Ar=Math.hypot(At,Bt),Yr=this.transform.scaleZoom(this.transform.cameraToCenterDistance/br/this.transform.tileSize),sa=180*Math.atan2(At,-Bt)/Math.PI,He=180*Math.acos(Ar/br)/Math.PI;return He=$t<0?90-He:90+He,{center:pt.toLngLat(),zoom:Yr,pitch:He,bearing:sa}}easeTo(R,ae){var we;this._stop(!1,R.easeId),((R=t.e({offset:[0,0],duration:500,easing:t.b9},R)).animate===!1||!R.essential&&n.prefersReducedMotion)&&(R.duration=0);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.project(He),Ct=Se.project(Je).sub(dt),wt=Se.zoomScale(lt-Oe),Dt,ur;R.around&&(Dt=t.N.convert(R.around),ur=Se.locationPoint(Dt));let mr={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||lt!==Oe,this._rotating=this._rotating||pt!==$t,this._pitching=this._pitching||br!==At,this._padding=!Se.isPaddingEqual(Ar),this._easeId=R.easeId,this._prepareEase(ae,R.noMoveStart,mr),this.terrain&&this._prepareElevation(Je),this._ease(Er=>{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.altitude<we){let Se=this.calculateCameraOptionsFromTo(ae.lngLat,we,R.center,R.elevation);return{pitch:Se.pitch,zoom:Se.zoom}}return{}}_applyUpdatedTransform(R){let ae=[];if(this.terrain&&ae.push(Se=>this._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=mr<ur?-1:1;Hn=Math.abs(Math.log(mr/ur))/Dt,Xn=()=>0,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)<we&&(R-=360),Math.abs(R+360-ae)<we&&(R+=360),R}_normalizeCenter(R,ae){if(!ae.renderWorldCopies||ae.lngRange)return;let we=R.lng-ae.center.lng;R.lng+=we>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:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};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<R.length;pt++)if(R[pt].indexOf(Se)>=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),Bt=Se.canonical.y-(Se.canonical.y>>pt<<pt),$t=t.X>>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),Bt=R.canonical.y-(R.canonical.y>>pt<<pt),$t=t.X>>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)return null;this._sourceTileCache[R.key]||(this._sourceTileCache[R.key]=R.scaledTo(Se).key);let Oe=this.sourceCache.getTileByID(this._sourceTileCache[R.key]);if((!Oe||!Oe.dem)&&ae)for(;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<Se&&we>=0&&we<Se))return 0;let pt=this.getTerrainData(R),At=(Oe=pt.tile)===null||Oe===void 0?void 0:Oe.dem;if(!At)return 0;let Bt=function(He,Je,lt){var dt=Je[0],Ct=Je[1];return He[0]=lt[0]*dt+lt[4]*Ct+lt[12],He[1]=lt[1]*dt+lt[5]*Ct+lt[13],He}([],[ae/Se*t.X,we/Se*t.X],pt.u_terrain_matrix),$t=[Bt[0]*At.dim,Bt[1]*At.dim],br=Math.floor($t[0]),Ar=Math.floor($t[1]),Yr=$t[0]-br,sa=$t[1]-Ar;return At.get(br,Ar)*(1-Yr)*(1-sa)+At.get(br+1,Ar)*Yr*(1-sa)+At.get(br,Ar+1)*(1-Yr)*sa+At.get(br+1,Ar+1)*Yr*sa}getElevationForLngLatZoom(R,ae){if(!t.bb(ae,R.wrap()))return 0;let{tileID:we,mercatorX:Se,mercatorY:Oe}=this._getOverscaledTileIDFromLngLatZoom(R,ae);return this.getElevation(we,Se%t.X,Oe%t.X,t.X)}getElevation(R,ae,we,Se=t.X){return this.getDEMElevation(R,ae,we,Se)*this.exaggeration}getTerrainData(R){if(!this._emptyDemTexture){let Se=this.painter.context,Oe=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new u(Se,Oe,Se.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new u(Se,new t.R({width:1,height:1}),Se.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(Se.gl.NEAREST,Se.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}let ae=this.sourceCache.getSourceTile(R,!0);if(ae&&ae.dem&&(!ae.demTexture||ae.needsTerrainPrepare)){let Se=this.painter.context;ae.demTexture=this.painter.getTileTexture(ae.dem.stride),ae.demTexture?ae.demTexture.update(ae.dem.getPixels(),{premultiply:!1}):ae.demTexture=new u(Se,ae.dem.getPixels(),Se.gl.RGBA,{premultiply:!1}),ae.demTexture.bind(Se.gl.NEAREST,Se.gl.CLAMP_TO_EDGE),ae.needsTerrainPrepare=!1}let we=ae&&ae+ae.tileID.key+R.key;if(we&&!this._demMatrixCache[we]){let Se=this.sourceCache.sourceCache._source.maxzoom,Oe=R.canonical.z-ae.tileID.canonical.z;R.overscaledZ>R.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),At=R.canonical.y-(R.canonical.y>>Oe<<Oe),Bt=t.bc(new Float64Array(16),[1/(t.X<<Oe),1/(t.X<<Oe),0]);t.J(Bt,Bt,[pt*t.X,At*t.X,0]),this._demMatrixCache[R.key]={matrix:Bt,coord:R}}return{u_depth:2,u_terrain:3,u_terrain_dim:ae&&ae.dem&&ae.dem.dim||1,u_terrain_matrix:we?this._demMatrixCache[R.key].matrix:this._emptyDemMatrix,u_terrain_unpack:ae&&ae.dem&&ae.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(ae&&ae.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:ae}}getFramebuffer(R){let ae=this.painter,we=ae.width/devicePixelRatio,Se=ae.height/devicePixelRatio;return!this._fbo||this._fbo.width===we&&this._fbo.height===Se||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new u(ae.context,{width:we,height:Se,data:null},ae.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(ae.context.gl.NEAREST,ae.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new u(ae.context,{width:we,height:Se,data:null},ae.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(ae.context.gl.NEAREST,ae.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=ae.context.createFramebuffer(we,Se,!0,!1),this._fbo.depthAttachment.set(ae.context.createRenderbuffer(ae.context.gl.DEPTH_COMPONENT16,we,Se))),this._fbo.colorAttachment.set(R==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let R=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let ae=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let Oe=0,pt=0;Oe<this._coordsTextureSize;Oe++)for(let At=0;At<this._coordsTextureSize;At++,pt+=4)ae[pt+0]=255&At,ae[pt+1]=255&Oe,ae[pt+2]=At>>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<<Ar.tileID.canonical.z)*Yr;return new t.Z((Ar.tileID.canonical.x*Yr+Bt)/sa+Ar.tileID.wrap,(Ar.tileID.canonical.y*Yr+$t)/sa,this.getElevation(Ar.tileID,Bt,$t,Yr))}depthAtPoint(R){let ae=new Uint8Array(4),we=this.painter.context,Se=we.gl;return we.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),Se.readPixels(R.x,this.painter.height/devicePixelRatio-R.y-1,1,1,Se.RGBA,Se.UNSIGNED_BYTE,ae),we.bindFramebuffer.set(null),(ae[0]/16777216+ae[1]/65536+ae[2]/256+ae[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let R=this.painter.context,ae=new t.bd,we=new t.aY,Se=this.meshSize,Oe=t.X/Se,pt=Se*Se;for(let Ar=0;Ar<=Se;Ar++)for(let Yr=0;Yr<=Se;Yr++)ae.emplaceBack(Yr*Oe,Ar*Oe,0);for(let Ar=0;Ar<pt;Ar+=Se+1)for(let Yr=0;Yr<Se;Yr++)we.emplaceBack(Yr+Ar,Se+Yr+Ar+1,Se+Yr+Ar+2),we.emplaceBack(Yr+Ar,Se+Yr+Ar+2,Yr+Ar+1);let At=ae.length,Bt=At+2*(Se+1);for(let Ar of[0,1])for(let Yr=0;Yr<=Se;Yr++)for(let sa of[0,1])ae.emplaceBack(Yr*Oe,Ar*t.X,sa);for(let Ar=0;Ar<2*Se;Ar+=2)we.emplaceBack(Bt+Ar,Bt+Ar+1,Bt+Ar+3),we.emplaceBack(Bt+Ar,Bt+Ar+3,Bt+Ar+2),we.emplaceBack(At+Ar,At+Ar+3,At+Ar+1),we.emplaceBack(At+Ar,At+Ar+2,At+Ar+3);let $t=ae.length,br=$t+2*(Se+1);for(let Ar of[0,1])for(let Yr=0;Yr<=Se;Yr++)for(let sa of[0,1])ae.emplaceBack(Ar*t.X,Yr*Oe,sa);for(let Ar=0;Ar<2*Se;Ar+=2)we.emplaceBack($t+Ar,$t+Ar+1,$t+Ar+3),we.emplaceBack($t+Ar,$t+Ar+3,$t+Ar+2),we.emplaceBack(br+Ar,br+Ar+3,br+Ar+1),we.emplaceBack(br+Ar,br+Ar+2,br+Ar+3);return this._mesh=new Lu(R.createVertexBuffer(ae,xo.members),R.createIndexBuffer(we),t.a0.simpleSegment(0,0,ae.length,we.length)),this._mesh}getMeshFrameDelta(R){return 2*Math.PI*t.be/Math.pow(2,R)/5}getMinTileElevationForLngLatZoom(R,ae){var we;let{tileID:Se}=this._getOverscaledTileIDFromLngLatZoom(R,ae);return(we=this.getMinMaxElevation(Se).minElevation)!==null&&we!==void 0?we:0}getMinMaxElevation(R){let ae=this.getTerrainData(R).tile,we={minElevation:null,maxElevation:null};return ae&&ae.dem&&(we.minElevation=ae.dem.min*this.exaggeration,we.maxElevation=ae.dem.max*this.exaggeration),we}_getOverscaledTileIDFromLngLatZoom(R,ae){let we=t.Z.fromLngLat(R.wrap()),Se=(1<<ae)*t.X,Oe=we.x*Se,pt=we.y*Se,At=Math.floor(Oe/t.X),Bt=Math.floor(pt/t.X);return{tileID:new t.S(ae,0,ae,At,Bt),mercatorX:Oe,mercatorY:pt}}}class Qs{constructor(R,ae,we){this._context=R,this._size=ae,this._tileSize=we,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let R of this._objects)R.texture.destroy(),R.fbo.destroy()}_createObject(R){let ae=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),we=new u(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return we.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),ae.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),ae.colorAttachment.set(we.texture),{id:R,fbo:ae,texture:we,stamp:-1,inUse:!1}}getObjectForId(R){return this._objects[R]}useObject(R){R.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(ae=>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<this._size)&&this._objects.some(R=>!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<pt.length;$t++){let br=we.style._layers[pt[$t]],Ar=br.source?this._coordsDescendingInv[br.source][At.tileID.key]:[At.tileID];we.context.viewport.set([0,0,Bt.fbo.width,Bt.fbo.height]),we._renderTileClippingMasks(br,Ar),we.renderLayer(we,we.style.sourceCaches[br.source],br,Ar),br.source&&(At.rttCoords[br.source]=this._coordsDescendingInvStr[br.source][At.tileID.key])}}return ml(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Rs[ae]}return!1}}let ys={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Fl=r,yl={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Ji,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},sl=Ne=>{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._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{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)<pt?Ne=Se:ae.locationPoint(Oe).distSqr(R)<pt&&(Ne=Oe)}for(;Math.abs(Ne.lng-ae.center.lng)>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.longitude<R.getWest()||ae.longitude>R.getEast()||ae.latitude<R.getSouth()||ae.latitude>R.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()<Ne&&this.setZoom(Ne),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(Ne){if((Ne=Ne??22)>=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()<Ne&&this.setPitch(Ne),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(Ne){if((Ne=Ne??60)>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;Se<we.length;Se++){let Oe=we[Se];if(Oe.listener===ae&&Oe.layers.length===R.length&&Oe.layers.every(pt=>R.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.y<Bt?["top"]:we.y>this._map.transform.height-Bt?["bottom"]:[],we.x<At/2?$t.push("left"):we.x>this._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;s<o.length;s++){var c=o[s].id;if(typeof c=="string"&&c.indexOf(M.traceLayerPrefix)===0){n=c;break}}return n},t.updateLayer=function(n){var o=this.subplot,s=i(n),c=this.lookupBelow(),h=this.findFollowingMapLayerId(c);this.removeLayer(),r(n)&&o.addLayer({id:this.idLayer,source:this.idSource,"source-layer":n.sourcelayer||"",type:n.type,minzoom:n.minzoom,maxzoom:n.maxzoom,layout:s.layout,paint:s.paint},h),this.layerType=n.type,this.below=c},t.updateStyle=function(n){if(r(n)){var o=i(n);this.subplot.setOptions(this.idLayer,"setLayoutProperty",o.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",o.paint)}},t.removeLayer=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer)},t.dispose=function(){var n=this.subplot.map;n.getLayer(this.idLayer)&&n.removeLayer(this.idLayer),n.getSource(this.idSource)&&n.removeSource(this.idSource)};function r(n){if(!n.visible)return!1;var o=n.source;if(Array.isArray(o)&&o.length>0){for(var s=0;s<o.length;s++)if(typeof o[s]!="string"||o[s].length===0)return!1;return!0}return v.isPlainObject(o)||typeof o=="string"&&o.length>0}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;y<g.length;y++){var z=g[y][0].trace,F=z._module;typeof z.below=="string"?f=z.below:F.getBelow&&(f=F.getBelow(z,this)),f===""&&(L=!0),P["trace-"+z.uid]=f||""}for(y=0;y<u.length;y++){var B=u[y];typeof B.below=="string"?f=B.below:L?f="traces":f="",P["layout-"+y]=f}var O={},I,N;for(I in P)f=P[I],O[f]?O[f].push(I):O[f]=[I];for(f in O){var U=O[f];if(U.length>1)for(y=0;y<U.length;y++)I=U[y],I.indexOf("trace-")===0?(N=I.split("trace-")[1],this.traceHash[N]&&(this.traceHash[N].below=null)):I.indexOf("layout-")===0&&(N=I.split("layout-")[1],this.layerList[N]&&(this.layerList[N].below=null))}};var _={choroplethmap:0,densitymap:1,scattermap:2};l.updateData=function(g){var b=this.traceHash,p,u,y,f,P=g.slice().sort(function(O,I){return _[O[0].trace.type]-_[I[0].trace.type]});for(y=0;y<P.length;y++){var L=P[y];u=L[0].trace,p=b[u.uid];var z=!1;p&&(p.type===u.type?(p.update(L),z=!0):p.dispose()),!z&&u._module&&(b[u.uid]=u._module.plot(this,L))}var F=Object.keys(b);e:for(y=0;y<F.length;y++){var B=F[y];for(f=0;f<g.length;f++)if(u=g[f][0].trace,B===u.uid)continue e;p=b[B],p.dispose(),delete b[B]}},l.updateLayout=function(g){var b=this.map,p=g[this.id];!this.dragging&&!this.wheeling&&(b.setCenter(E(p.center)),b.setZoom(p.zoom),b.setBearing(p.bearing),b.setPitch(p.pitch)),this.updateLayers(g),this.updateFramework(g),this.updateFx(g),this.map.resize(),this.gd._context._scrollZoom.map?b.scrollZoom.enable():b.scrollZoom.disable()},l.resolveOnRender=function(g){var b=this.map;b.on("render",function p(){b.loaded()&&(b.off("render",p),setTimeout(g,10))})},l.rejectOnError=function(g){var b=this.map;function p(){g(new Error(m.mapOnErrorMsg))}b.once("error",p),b.once("style.error",p),b.once("source.error",p),b.once("tile.error",p),b.once("layer.error",p)},l.createFramework=function(g){var b=this,p=b.div=document.createElement("div");p.id=b.uid,p.style.position="absolute",b.container.appendChild(p),b.xaxis={_id:"x",c2p:function(u){return b.project(u).x}},b.yaxis={_id:"y",c2p:function(u){return b.project(u).y}},b.updateFramework(g),b.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},e.setConvert(b.mockAxis,g)},l.initFx=function(g,b){var p=this,u=p.gd,y=p.map;y.on("moveend",function(L){if(p.map){var z=u._fullLayout;if(L.originalEvent||p.wheeling){var F=z[p.id];M.call("_storeDirectGUIEdit",u.layout,z._preGUI,p.getViewEdits(F));var B=p.getView();F._input.center=F.center=B.center,F._input.zoom=F.zoom=B.zoom,F._input.bearing=F.bearing=B.bearing,F._input.pitch=F.pitch=B.pitch,u.emit("plotly_relayout",p.getViewEditsWithDerived(B))}L.originalEvent&&L.originalEvent.type==="mouseup"?p.dragging=!1:p.wheeling&&(p.wheeling=!1),z&&z._rehover&&z._rehover()}}),y.on("wheel",function(){p.wheeling=!0}),y.on("mousemove",function(L){var z=p.div.getBoundingClientRect(),F=[L.originalEvent.offsetX,L.originalEvent.offsetY];L.target.getBoundingClientRect=function(){return z},p.xaxis.p2c=function(){return y.unproject(F).lng},p.yaxis.p2c=function(){return y.unproject(F).lat},u._fullLayout._rehover=function(){u._fullLayout._hoversubplot===p.id&&u._fullLayout[p.id]&&r.hover(u,L,p.id)},r.hover(u,L,p.id),u._fullLayout._hoversubplot=p.id});function f(){r.loneUnhover(b._hoverlayer)}y.on("dragstart",function(){p.dragging=!0,f()}),y.on("zoomstart",f),y.on("mouseout",function(){u._fullLayout._hoversubplot=null});function P(){var L=p.getView();u.emit("plotly_relayouting",p.getViewEditsWithDerived(L))}y.on("drag",P),y.on("zoom",P),y.on("dblclick",function(){var L=u._fullLayout[p.id];M.call("_storeDirectGUIEdit",u.layout,u._fullLayout._preGUI,p.getViewEdits(L));var z=p.viewInitial;y.setCenter(E(z.center)),y.setZoom(z.zoom),y.setBearing(z.bearing),y.setPitch(z.pitch);var F=p.getView();L._input.center=L.center=F.center,L._input.zoom=L.zoom=F.zoom,L._input.bearing=L.bearing=F.bearing,L._input.pitch=L.pitch=F.pitch,u.emit("plotly_doubleclick",null),u.emit("plotly_relayout",p.getViewEditsWithDerived(F))}),p.clearOutline=function(){c(p.dragOptions),s(p.dragOptions.gd)},p.onClickInPanFn=function(L){return function(z){var F=u._fullLayout.clickmode;F.indexOf("select")>-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;y<u.length;y++)u[y].dispose();for(u=this.layerList=[],y=0;y<p.length;y++)u.push(d(this,y,p[y]))}else for(y=0;y<p.length;y++)u[y].update(p[y])},l.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},l.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},l.setOptions=function(g,b,p){for(var u in p)this.map[b](g,u,p[u])},l.getMapLayers=function(){return this.map.getStyle().layers},l.addLayer=function(g,b){var p=this.map;if(typeof b=="string"){if(b===""){p.addLayer(g,b);return}for(var u=this.getMapLayers(),y=0;y<u.length;y++)if(b===u[y].id){p.addLayer(g,b);return}x.warn(["Trying to add layer with *below* value",b,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}p.addLayer(g)},l.project=function(g){return this.map.project(new v.LngLat(g[0],g[1]))},l.getView=function(){var g=this.map,b=g.getCenter(),p=b.lng,u=b.lat,y={lon:p,lat:u},f=g.getCanvas(),P=parseInt(f.style.width),L=parseInt(f.style.height);return{center:y,zoom:g.getZoom(),bearing:g.getBearing(),pitch:g.getPitch(),_derived:{coordinates:[g.unproject([0,0]).toArray(),g.unproject([P,0]).toArray(),g.unproject([P,L]).toArray(),g.unproject([0,L]).toArray()]}}},l.getViewEdits=function(g){for(var b=this.id,p=["center","zoom","bearing","pitch"],u={},y=0;y<p.length;y++){var f=p[y];u[b+"."+f]=g[f]}return u},l.getViewEditsWithDerived=function(g){var b=this.id,p=this.getViewEdits(g);return p[b+"._derived"]=g._derived,p};function w(g){var b={};return x.isPlainObject(g)?(b.id=g.id,b.style=g):typeof g=="string"?(b.id=g,m.stylesMap[g]?b.style=m.stylesMap[g]:b.style=g):(b.id=m.styleValueDflt,b.style=S(m.styleValueDflt)),b.transition={duration:0,delay:0},b}function S(g){return m.styleUrlPrefix+g+"-"+m.styleUrlSuffix}function E(g){return[g.lon,g.lat]}q.exports=T}}),Gq=Ze({"src/plots/map/layout_defaults.js"(Z,q){"use strict";var v=ca(),x=ng(),A=fp(),M=Ex();q.exports=function(i,a,n){x(i,a,n,{type:"map",attributes:M,handleDefaults:e,partition:"y"})};function e(r,i,a){a("style"),a("center.lon"),a("center.lat"),a("zoom"),a("bearing"),a("pitch");var n=a("bounds.west"),o=a("bounds.east"),s=a("bounds.south"),c=a("bounds.north");(n===void 0||o===void 0||s===void 0||c===void 0)&&delete i.bounds,A(r,i,{name:"layers",handleItemDefaults:t}),i._input=r}function t(r,i){function a(m,d){return v.coerce(r,i,M.layers,m,d)}var n=a("visible");if(n){var o=a("sourcetype"),s=o==="raster"||o==="image";a("source"),a("sourceattribution"),o==="vector"&&a("sourcelayer"),o==="image"&&a("coordinates");var c;s&&(c="raster");var h=a("type",c);s&&h!=="raster"&&(h=i.type="raster",v.log("Source types *raster* and *image* must drawn *raster* layer type.")),a("below"),a("color"),a("opacity"),a("minzoom"),a("maxzoom"),h==="circle"&&a("circle.radius"),h==="line"&&(a("line.width"),a("line.dash")),h==="fill"&&a("fill.outlinecolor"),h==="symbol"&&(a("symbol.icon"),a("symbol.iconsize"),a("symbol.text"),v.coerceFont(a,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),a("symbol.textposition"),a("symbol.placement"))}}}}),kT=Ze({"src/plots/map/index.js"(Z){"use strict";var q=ca(),v=q.strTranslate,x=q.strScale,A=Hh().getSubplotCalcData,M=vd(),e=Oi(),t=as(),r=fu(),i=qq(),a="map";Z.name=a,Z.attr="subplot",Z.idRoot=a,Z.idRegex=Z.attrRegex=q.counterRegex(a),Z.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},Z.layoutAttributes=Ex(),Z.supplyLayoutDefaults=Gq(),Z.plot=function(o){for(var s=o._fullLayout,c=o.calcdata,h=s._subplots[a],m=0;m<h.length;m++){var d=h[m],T=A(c,a,d),l=s[d],_=l._subplot;_||(_=new i(o,d),s[d]._subplot=_),_.viewInitial||(_.viewInitial={center:q.extendFlat({},l.center),zoom:l.zoom,bearing:l.bearing,pitch:l.pitch}),_.plot(T,s,o._promises)}},Z.clean=function(n,o,s,c){for(var h=c._subplots[a]||[],m=0;m<h.length;m++){var d=h[m];!o[d]&&c[d]._subplot&&c[d]._subplot.destroy()}},Z.toSVG=function(n){for(var o=n._fullLayout,s=o._subplots[a],c=o._size,h=0;h<s.length;h++){var m=o[s[h]],d=m.domain,T=m._subplot,l=T.toImage("png"),_=o._glimages.append("svg:image");_.attr({xmlns:M.svg,"xlink:href":l,x:c.l+c.w*d.x[0],y:c.t+c.h*(1-d.y[1]),width:c.w*(d.x[1]-d.x[0]),height:c.h*(d.y[1]-d.y[0]),preserveAspectRatio:"none"});var w=e.select(m._subplot.div),S=w.select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),E=o._glimages.append("g"),g=E.append("text");g.text(S).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":S});var b=t.bBox(g.node()),p=c.w*(d.x[1]-d.x[0]);if(b.width>p/2){var u=S.split("|").join("<br>");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<s.length;c++){var h=o[s[c]]._subplot;h.updateFx(o)}}}}),Hq=Ze({"src/traces/scattermap/index.js"(Z,q){"use strict";q.exports={attributes:ET(),supplyDefaults:Fq(),colorbar:hp(),formatLabels:IC(),calc:nT(),plot:Bq(),hoverPoints:CT().hoverPoints,eventData:Nq(),selectPoints:Uq(),styleOnSelect:function(v,x){if(x){var A=x[0].trace;A._glTrace.update(x)}},moduleType:"trace",name:"scattermap",basePlotModule:kT(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Wq=Ze({"lib/scattermap.js"(Z,q){"use strict";q.exports=Hq()}}),DC=Ze({"src/traces/choroplethmap/attributes.js"(Z,q){"use strict";var v=C1(),x=Mu(),A=Cs().hovertemplateAttrs,M=eu(),e=rs().extendFlat;q.exports=e({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:e({},v.featureidkey,{}),below:{valType:"string",editType:"plot"},text:v.text,hovertext:v.hovertext,marker:{line:{color:e({},v.marker.line.color,{editType:"plot"}),width:e({},v.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:e({},v.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:e({},v.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:e({},v.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:v.hoverinfo,hovertemplate:A({},{keys:["properties"]}),showlegend:e({},M.showlegend,{dflt:!1})},x("",{cLetter:"z",editTypeOverride:"calc"}))}}),Xq=Ze({"src/traces/choroplethmap/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=DC();q.exports=function(e,t,r,i){function a(h,m){return v.coerce(e,t,A,h,m)}var n=a("locations"),o=a("z"),s=a("geojson");if(!v.isArrayOrTypedArray(n)||!n.length||!v.isArrayOrTypedArray(o)||!o.length||!(typeof s=="string"&&s!==""||v.isPlainObject(s))){t.visible=!1;return}a("featureidkey"),t._length=Math.min(n.length,o.length),a("below"),a("text"),a("hovertext"),a("hovertemplate");var c=a("marker.line.width");c&&a("marker.line.color"),a("marker.opacity"),x(e,t,i,a,{prefix:"",cLetter:"z"}),v.coerceSelectionMarkerOpacity(t,a)}}}),zC=Ze({"src/traces/choroplethmap/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=rc(),M=as(),e=dg().makeBlank,t=vg();function r(a){var n=a[0].trace,o=n.visible===!0&&n._length!==0,s={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},h=n._opts={fill:s,line:c,geojson:e()};if(!o)return h;var m=t.extractTraceFeature(a);if(!m)return h;var d=A.makeColorScaleFuncFromTrace(n),T=n.marker,l=T.line||{},_;x.isArrayOrTypedArray(T.opacity)&&(_=function(y){var f=y.mo;return v(f)?+x.constrain(f,0,1):0});var w;x.isArrayOrTypedArray(l.color)&&(w=function(y){return y.mlc});var S;x.isArrayOrTypedArray(l.width)&&(S=function(y){return y.mlw});for(var E=0;E<a.length;E++){var g=a[E],b=g.fOut;if(b){var p=b.properties;p.fc=d(g.z),_&&(p.mo=_(g)),w&&(p.mlc=w(g)),S&&(p.mlw=S(g)),g.ct=p.ct,g._polygons=t.feature2polygons(b)}}var u=_?{type:"identity",property:"mo"}:T.opacity;return x.extendFlat(s.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":u}),x.extendFlat(c.paint,{"line-color":w?{type:"identity",property:"mlc"}:l.color,"line-width":S?{type:"identity",property:"mlw"}:l.width,"line-opacity":u}),s.layout.visibility="visible",c.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:m},i(a),h}function i(a){var n=a[0].trace,o=n._opts,s;if(n.selectedpoints){for(var c=M.makeSelectedPointStyleFns(n),h=0;h<a.length;h++){var m=a[h];m.fOut&&(m.fOut.properties.mo2=c.selectedOpacityFn(m))}s={type:"identity",property:"mo2"}}else s=x.isArrayOrTypedArray(n.marker.opacity)?{type:"identity",property:"mo"}:n.marker.opacity;return x.extendFlat(o.fill.paint,{"fill-opacity":s}),x.extendFlat(o.line.paint,{"line-opacity":s}),o}q.exports={convert:r,convertOnSelect:i}}}),Zq=Ze({"src/traces/choroplethmap/plot.js"(Z,q){"use strict";var v=zC().convert,x=zC().convertOnSelect,A=_g().traceLayerPrefix;function M(t,r){this.type="choroplethmap",this.subplot=t,this.uid=r,this.sourceId="source-"+r,this.layerList=[["fill",A+r+"-fill"],["line",A+r+"-line"]],this.below=null}var e=M.prototype;e.update=function(t){this._update(v(t)),t[0].trace._glTrace=this},e.updateOnSelect=function(t){this._update(x(t))},e._update=function(t){var r=this.subplot,i=this.layerList,a=r.belowLookup["trace-"+this.uid];r.map.getSource(this.sourceId).setData(t.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(t,a),this.below=a);for(var n=0;n<i.length;n++){var o=i[n],s=o[0],c=o[1],h=t[s];r.setOptions(c,"setLayoutProperty",h.layout),h.layout.visibility==="visible"&&r.setOptions(c,"setPaintProperty",h.paint)}},e._addLayers=function(t,r){for(var i=this.subplot,a=this.layerList,n=this.sourceId,o=0;o<a.length;o++){var s=a[o],c=s[0],h=t[c];i.addLayer({type:c,id:s[1],source:n,layout:h.layout,paint:h.paint},r)}},e._removeLayers=function(){for(var t=this.subplot.map,r=this.layerList,i=r.length-1;i>=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;t<A.length;t++)if(e=A[t].id,typeof e=="string"&&e.indexOf("plotly-")===-1)return e}}},moduleType:"trace",name:"choroplethmap",basePlotModule:kT(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),Kq=Ze({"lib/choroplethmap.js"(Z,q){"use strict";q.exports=Yq()}}),FC=Ze({"src/traces/densitymap/attributes.js"(Z,q){"use strict";var v=Mu(),x=Cs().hovertemplateAttrs,A=eu(),M=ET(),e=rs().extendFlat;q.exports=e({lon:M.lon,lat:M.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:M.text,hovertext:M.hovertext,hoverinfo:e({},A.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:x(),showlegend:e({},A.showlegend,{dflt:!1})},v("",{cLetter:"z",editTypeOverride:"calc"}))}}),Jq=Ze({"src/traces/densitymap/defaults.js"(Z,q){"use strict";var v=ca(),x=gh(),A=FC();q.exports=function(e,t,r,i){function a(c,h){return v.coerce(e,t,A,c,h)}var n=a("lon")||[],o=a("lat")||[],s=Math.min(n.length,o.length);if(!s){t.visible=!1;return}t._length=s,a("z"),a("radius"),a("below"),a("text"),a("hovertext"),a("hovertemplate"),x(e,t,i,a,{prefix:"",cLetter:"z"})}}}),$q=Ze({"src/traces/densitymap/calc.js"(Z,q){"use strict";var v=is(),x=ca().isArrayOrTypedArray,A=Vs().BADNUM,M=jp(),e=ca()._;q.exports=function(r,i){for(var a=i._length,n=new Array(a),o=i.z,s=x(o)&&o.length,c=0;c<a;c++){var h=n[c]={},m=i.lon[c],d=i.lat[c];if(h.lonlat=v(m)&&v(d)?[+m,+d]:[A,A],s){var T=o[c];h.z=v(T)?T:A}}return M(r,i,{vals:s?o:[0,1],containerStr:"",cLetter:"z"}),a&&(n[0].t={labels:{lat:e(r,"lat:")+" ",lon:e(r,"lon:")+" "}}),n}}}),Qq=Ze({"src/traces/densitymap/convert.js"(Z,q){"use strict";var v=is(),x=ca(),A=Yi(),M=rc(),e=Vs().BADNUM,t=dg().makeBlank;q.exports=function(i){var a=i[0].trace,n=a.visible===!0&&a._length!==0,o={layout:{visibility:"none"},paint:{}},s=a._opts={heatmap:o,geojson:t()};if(!n)return s;var c=[],h,m=a.z,d=a.radius,T=x.isArrayOrTypedArray(m)&&m.length,l=x.isArrayOrTypedArray(d);for(h=0;h<i.length;h++){var _=i[h],w=_.lonlat;if(w[0]!==e){var S={};if(T){var E=_.z;S.z=E!==e?E:0}l&&(S.r=v(d[h])&&d[h]>0?+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<b.length;h++)y.push(b[h][0],b[h][1]);var f=["interpolate",["linear"],["get","z"],g.min,0,g.max,1];return x.extendFlat(s.heatmap.paint,{"heatmap-weight":T?f:1/(g.max-g.min),"heatmap-color":y,"heatmap-radius":l?{type:"identity",property:"r"}:a.radius,"heatmap-opacity":a.opacity}),s.geojson={type:"FeatureCollection",features:c},s.heatmap.layout.visibility="visible",s}}}),eG=Ze({"src/traces/densitymap/plot.js"(Z,q){"use strict";var v=Qq(),x=_g().traceLayerPrefix;function A(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",x+t+"-heatmap"]],this.below=null}var M=A.prototype;M.update=function(e){var t=this.subplot,r=this.layerList,i=v(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var n=0;n<r.length;n++){var o=r[n],s=o[0],c=o[1],h=i[s];t.setOptions(c,"setLayoutProperty",h.layout),h.layout.visibility==="visible"&&t.setOptions(c,"setPaintProperty",h.paint)}},M._addLayers=function(e,t){for(var r=this.subplot,i=this.layerList,a=this.sourceId,n=0;n<i.length;n++){var o=i[n],s=o[0],c=e[s];r.addLayer({type:s,id:o[1],source:a,layout:c.layout,paint:c.paint},t)}},M._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=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;M<A.length;M++){var e=A[M],t=e.id;if(e.type==="symbol"&&typeof t=="string"&&t.indexOf("plotly-")===-1)return t}},moduleType:"trace",name:"densitymap",basePlotModule:kT(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),nG=Ze({"lib/densitymap.js"(Z,q){"use strict";q.exports=aG()}}),OC=Ze({"src/traces/sankey/attributes.js"(Z,q){"use strict";var v=tc(),x=eu(),A=oh(),M=Ky(),e=bc().attributes,t=Cs().hovertemplateAttrs,r=Mu(),i=Dl().templatedArray,a=Qc().descriptionOnlyNumbers,n=rs().extendFlat,o=pc().overrideAll,s=q.exports=o({hoverinfo:n({},x.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:M.hoverlabel,domain:e({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:a("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:v({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:A.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:M.hoverlabel,hovertemplate:t({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:A.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:M.hoverlabel,hovertemplate:t({},{keys:["value","label"]}),colorscales:i("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:n(r().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}}),iG=Ze({"src/traces/sankey/defaults.js"(Z,q){"use strict";var v=ca(),x=OC(),A=Yi(),M=Ch(),e=bc().defaults,t=E_(),r=Dl(),i=fp();q.exports=function(o,s,c,h){function m(L,z){return v.coerce(o,s,x,L,z)}var d=v.extendDeep(h.hoverlabel,o.hoverlabel),T=o.node,l=r.newContainer(s,"node");function _(L,z){return v.coerce(T,l,x.node,L,z)}_("label"),_("groups"),_("x"),_("y"),_("pad"),_("thickness"),_("line.color"),_("line.width"),_("hoverinfo",o.hoverinfo),t(T,l,_,d),_("hovertemplate"),_("align");var w=h.colorway,S=function(L){return w[L%w.length]};_("color",l.label.map(function(L,z){return A.addOpacity(S(z),.8)})),_("customdata");var E=o.link||{},g=r.newContainer(s,"link");function b(L,z){return v.coerce(E,g,x.link,L,z)}b("label"),b("arrowlen"),b("source"),b("target"),b("value"),b("line.color"),b("line.width"),b("hoverinfo",o.hoverinfo),t(E,g,b,d),b("hovertemplate");var p=M(h.paper_bgcolor).getLuminance()<.333,u=p?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",y=b("color",u);function f(L){var z=M(L);if(!z.isValid())return L;var F=z.getAlpha();return F<=.8?z.setAlpha(F+.2):z=p?z.brighten():z.darken(),z.toRgbString()}b("hovercolor",Array.isArray(y)?y.map(f):f(y)),b("customdata"),i(E,g,{name:"colorscales",handleItemDefaults:a}),e(s,h,m),m("orientation"),m("valueformat"),m("valuesuffix");var P;l.x.length&&l.y.length&&(P="freeform"),m("arrangement",P),v.coerceFont(m,"textfont",h.font,{autoShadowDflt:!0}),s._length=null};function a(n,o){function s(c,h){return v.coerce(n,o,x.link.colorscales,c,h)}s("label"),s("cmin"),s("cmax"),s("colorscale")}}}),BC=Ze({"node_modules/strongly-connected-components/scc.js"(Z,q){"use strict";q.exports=v;function v(x){for(var A=x.length,M=new Array(A),e=new Array(A),t=new Array(A),r=new Array(A),i=new Array(A),a=new Array(A),n=0;n<A;++n)M[n]=-1,e[n]=0,t[n]=!1,r[n]=0,i[n]=-1,a[n]=[];var o=0,s=[],c=[];function h(l){var _=[l],w=[l];for(M[l]=e[l]=o,t[l]=!0,o+=1;w.length>0;){l=w[w.length-1];var S=x[l];if(r[l]<S.length){for(var E=r[l];E<S.length;++E){var g=S[E];if(M[g]<0){M[g]=e[g]=o,t[g]=!0,o+=1,_.push(g),w.push(g);break}else t[g]&&(e[l]=Math.min(e[l],e[g])|0);i[g]>=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;E<p.length;E++)for(var P=0;P<p[E].length;P++)f[--u]=p[E][P];c.push(f)}w.pop()}}}for(var n=0;n<A;++n)M[n]<0&&h(n);for(var m,n=0;n<c.length;n++){var d=c[n];if(d.length!==0){d.sort(function(_,w){return _-w}),m=[d[0]];for(var T=1;T<d.length;T++)d[T]!==d[T-1]&&m.push(d[T]);c[n]=m}}return{components:s,adjacencyList:c}}}}),oG=Ze({"src/traces/sankey/calc.js"(Z,q){"use strict";var v=BC(),x=ca(),A=Cv().wrap,M=x.isArrayOrTypedArray,e=x.isIndex,t=rc();function r(a){var n=a.node,o=a.link,s=[],c=M(o.color),h=M(o.hovercolor),m=M(o.customdata),d={},T={},l=o.colorscales.length,_;for(_=0;_<l;_++){var w=o.colorscales[_],S=t.extractScale(w,{cLetter:"c"}),E=t.makeColorScaleFunc(S);T[w.label]=E}var g=0;for(_=0;_<o.value.length;_++)o.source[_]>g&&(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;_<u.length;_++){var f=u[_];for(p=0;p<f.length;p++){var P=f[p],L=b+_;y.hasOwnProperty(P)?x.warn("Node "+P+" is already part of a group."):y[P]=L}}var z={source:[],target:[]};for(_=0;_<o.value.length;_++){var F=o.value[_],B=o.source[_],O=o.target[_];if(F>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;_<U;_++)if(d[_]){var se=n.label[_];ue.push({group:_>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;c<Math.min(n.length,o.length);c++)if(x.isIndex(n[c],a)&&x.isIndex(o[c],a)){if(n[c]===o[c])return!0;s[n[c]].push(o[c])}var h=v(s);return h.components.some(function(m){return m.length>1})}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;u<y;++u)isNaN(f=+this._x.call(null,p=b[u]))||isNaN(P=+this._y.call(null,p))||(L[u]=f,z[u]=P,f<F&&(F=f),f>O&&(O=f),P<B&&(B=P),P>I&&(I=P));if(F>O||B>I)return this;for(this.cover(F,B).cover(O,I),u=0;u<y;++u)A(this,L[u],z[u],b[u]);return this}function e(b,p){if(isNaN(b=+b)||isNaN(p=+p))return this;var u=this._x0,y=this._y0,f=this._x1,P=this._y1;if(isNaN(u))f=(u=Math.floor(b))+1,P=(y=Math.floor(p))+1;else{for(var L=f-u,z=this._root,F,B;u>b||b>=f||y>p||p>=P;)switch(B=(p<y)<<1|b<u,F=new Array(4),F[B]=z,z=F,L*=2,B){case 0:f=u+L,P=y+L;break;case 1:u=f-L,P=y+L;break;case 2:f=u+L,y=P-L;break;case 3:u=f-L,y=P-L;break}this._root&&this._root.length&&(this._root=z)}return this._x0=u,this._y0=y,this._x1=f,this._y1=P,this}function t(){var b=[];return this.visit(function(p){if(!p.length)do b.push(p.data);while(p=p.next)}),b}function r(b){return arguments.length?this.cover(+b[0][0],+b[0][1]).cover(+b[1][0],+b[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function i(b,p,u,y,f){this.node=b,this.x0=p,this.y0=u,this.x1=y,this.y1=f}function a(b,p,u){var y,f=this._x0,P=this._y0,L,z,F,B,O=this._x1,I=this._y1,N=[],U=this._root,W,Q;for(U&&N.push(new i(U,f,P,O,I)),u==null?u=1/0:(f=b-u,P=p-u,O=b+u,I=p+u,u*=u);W=N.pop();)if(!(!(U=W.node)||(L=W.x0)>O||(z=W.y0)>I||(F=W.x1)<f||(B=W.y1)<P))if(U.length){var ue=(L+F)/2,se=(z+B)/2;N.push(new i(U[3],ue,se,F,B),new i(U[2],L,se,ue,B),new i(U[1],ue,z,F,se),new i(U[0],L,z,ue,se)),(Q=(p>=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($<u){var J=Math.sqrt(u=$);f=b-J,P=p-J,O=b+J,I=p+J,y=U.data}}return y}function n(b){if(isNaN(O=+this._x.call(null,b))||isNaN(I=+this._y.call(null,b)))return this;var p,u=this._root,y,f,P,L=this._x0,z=this._y0,F=this._x1,B=this._y1,O,I,N,U,W,Q,ue,se;if(!u)return this;if(u.length)for(;;){if((W=O>=(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<u;++p)this.remove(b[p]);return this}function s(){return this._root}function c(){var b=0;return this.visit(function(p){if(!p.length)do++b;while(p=p.next)}),b}function h(b){var p=[],u,y=this._root,f,P,L,z,F;for(y&&p.push(new i(y,this._x0,this._y0,this._x1,this._y1));u=p.pop();)if(!b(y=u.node,P=u.x0,L=u.y0,z=u.x1,F=u.y1)&&y.length){var B=(P+z)/2,O=(L+F)/2;(f=y[3])&&p.push(new i(f,B,O,z,F)),(f=y[2])&&p.push(new i(f,P,O,B,F)),(f=y[1])&&p.push(new i(f,B,L,z,O)),(f=y[0])&&p.push(new i(f,P,L,B,O))}return this}function m(b){var p=[],u=[],y;for(this._root&&p.push(new i(this._root,this._x0,this._y0,this._x1,this._y1));y=p.pop();){var f=y.node;if(f.length){var P,L=y.x0,z=y.y0,F=y.x1,B=y.y1,O=(L+F)/2,I=(z+B)/2;(P=f[0])&&p.push(new i(P,L,z,O,I)),(P=f[1])&&p.push(new i(P,O,z,F,I)),(P=f[2])&&p.push(new i(P,L,I,O,B)),(P=f[3])&&p.push(new i(P,O,I,F,B))}u.push(y)}for(;y=u.pop();)b(y.node,y.x0,y.y0,y.x1,y.y1);return this}function d(b){return b[0]}function T(b){return arguments.length?(this._x=b,this):this._x}function l(b){return b[1]}function _(b){return arguments.length?(this._y=b,this):this._y}function w(b,p,u){var y=new S(p??d,u??l,NaN,NaN,NaN,NaN);return b==null?y:y.addAll(b)}function S(b,p,u,y,f,P){this._x=b,this._y=p,this._x0=u,this._y0=y,this._x1=f,this._y1=P,this._root=void 0}function E(b){for(var p={data:b.data},u=p;b=b.next;)u=u.next={data:b.data};return p}var g=w.prototype=S.prototype;g.copy=function(){var b=new S(this._x,this._y,this._x0,this._y0,this._x1,this._y1),p=this._root,u,y;if(!p)return b;if(!p.length)return b._root=E(p),b;for(u=[{source:p,target:b._root=new Array(4)}];p=u.pop();)for(var f=0;f<4;++f)(y=p.source[f])&&(y.length?u.push({source:y,target:p.target[f]=new Array(4)}):p.target[f]=E(y));return b},g.add=x,g.addAll=M,g.cover=e,g.data=t,g.extent=r,g.find=a,g.remove=n,g.removeAll=o,g.root=s,g.size=c,g.visit=h,g.visitAfter=m,g.x=T,g.y=_,v.quadtree=w,Object.defineProperty(v,"__esModule",{value:!0})})}}),LT=Ze({"node_modules/d3-collection/dist/d3-collection.js"(Z,q){(function(v,x){x(typeof Z=="object"&&typeof q<"u"?Z:v.d3=v.d3||{})})(Z,function(v){"use strict";var x="$";function A(){}A.prototype=M.prototype={constructor:A,has:function(d){return x+d in this},get:function(d){return this[x+d]},set:function(d,T){return this[x+d]=T,this},remove:function(d){var T=x+d;return T in this&&delete this[T]},clear:function(){for(var d in this)d[0]===x&&delete this[d]},keys:function(){var d=[];for(var T in this)T[0]===x&&d.push(T.slice(1));return d},values:function(){var d=[];for(var T in this)T[0]===x&&d.push(this[T]);return d},entries:function(){var d=[];for(var T in this)T[0]===x&&d.push({key:T.slice(1),value:this[T]});return d},size:function(){var d=0;for(var T in this)T[0]===x&&++d;return d},empty:function(){for(var d in this)if(d[0]===x)return!1;return!0},each:function(d){for(var T in this)T[0]===x&&d(this[T],T.slice(1),this)}};function M(d,T){var l=new A;if(d instanceof A)d.each(function(g,b){l.set(b,g)});else if(Array.isArray(d)){var _=-1,w=d.length,S;if(T==null)for(;++_<w;)l.set(_,d[_]);else for(;++_<w;)l.set(T(S=d[_],_,d),S)}else if(d)for(var E in d)l.set(E,d[E]);return l}function e(){var d=[],T=[],l,_,w;function S(g,b,p,u){if(b>=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();++y<f;)(B=F.get(L=P(z=g[y])+""))?B.push(z):F.set(L,[z]);return F.each(function(I,N){u(O,N,S(I,b,p,u))}),O}function E(g,b){if(++b>d.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(;++_<w;)l.add(d[_]);else for(;++_<w;)l.add(T(d[_],_,d))}return l}function c(d){var T=[];for(var l in d)T.push(l);return T}function h(d){var T=[];for(var l in d)T.push(d[l]);return T}function m(d){var T=[];for(var l in d)T.push({key:l,value:d[l]});return T}v.nest=e,v.set=s,v.map=M,v.keys=c,v.values=h,v.entries=m,Object.defineProperty(v,"__esModule",{value:!0})})}}),lG=Ze({"node_modules/d3-dispatch/dist/d3-dispatch.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";var x={value:function(){}};function A(){for(var i=0,a=arguments.length,n={},o;i<a;++i){if(!(o=arguments[i]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new M(n)}function M(i){this._=i}function e(i,a){return i.trim().split(/^|\s+/).map(function(n){var o="",s=n.indexOf(".");if(s>=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(;++c<h;)if((s=(i=o[c]).type)&&(s=t(n[s],i.name)))return s;return}if(a!=null&&typeof a!="function")throw new Error("invalid callback: "+a);for(;++c<h;)if(s=(i=o[c]).type)n[s]=r(n[s],i.name,a);else if(a==null)for(s in n)n[s]=r(n[s],i.name,null);return this},copy:function(){var i={},a=this._;for(var n in a)i[n]=a[n].slice();return new M(i)},call:function(i,a){if((s=arguments.length-2)>0)for(var n=new Array(s),o=0,s,c;o<s;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(c=this._[i],o=0,s=c.length;o<s;++o)c[o].value.apply(a,n)},apply:function(i,a,n){if(!this._.hasOwnProperty(i))throw new Error("unknown type: "+i);for(var o=this._[i],s=0,c=o.length;s<c;++s)o[s].value.apply(a,n)}};function t(i,a){for(var n=0,o=i.length,s;n<o;++n)if((s=i[n]).name===a)return s.value}function r(i,a,n){for(var o=0,s=i.length;o<s;++o)if(i[o].name===a){i[o]=x,i=i.slice(0,o).concat(i.slice(o+1));break}return n!=null&&i.push({name:a,value:n}),i}v.dispatch=A,Object.defineProperty(v,"__esModule",{value:!0})})}}),uG=Ze({"node_modules/d3-timer/dist/d3-timer.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";var x=0,A=0,M=0,e=1e3,t,r,i=0,a=0,n=0,o=typeof performance=="object"&&performance.now?performance:Date,s=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(b){setTimeout(b,17)};function c(){return a||(s(h),a=o.now()+n)}function h(){a=0}function m(){this._call=this._time=this._next=null}m.prototype=d.prototype={constructor:m,restart:function(b,p,u){if(typeof b!="function")throw new TypeError("callback is not a function");u=(u==null?c():+u)+(p==null?0:+p),!this._next&&r!==this&&(r?r._next=this:t=this,r=this),this._call=b,this._time=u,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};function d(b,p,u){var y=new m;return y.restart(b,p,u),y}function T(){c(),++x;for(var b=t,p;b;)(p=a-b._time)>=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;f<P;++f)L=u[f],z+=L.x,F+=L.y;for(z=z/P-b,F=F/P-p,f=0;f<P;++f)L=u[f],L.x-=z,L.y-=F}return y.initialize=function(f){u=f},y.x=function(f){return arguments.length?(b=+f,y):b},y.y=function(f){return arguments.length?(p=+f,y):p},y}function r(b){return function(){return b}}function i(){return(Math.random()-.5)*1e-6}function a(b){return b.x+b.vx}function n(b){return b.y+b.vy}function o(b){var p,u,y=1,f=1;typeof b!="function"&&(b=r(b==null?1:+b));function P(){for(var F,B=p.length,O,I,N,U,W,Q,ue=0;ue<f;++ue)for(O=x.quadtree(p,a,n).visitAfter(L),F=0;F<B;++F)I=p[F],W=u[I.index],Q=W*W,N=I.x+I.vx,U=I.y+I.vy,O.visit(se);function se(he,H,$,J,X){var oe=he.data,ne=he.r,j=W+ne;if(oe){if(oe.index>I.index){var ee=N-oe.x-oe.vx,re=U-oe.y-oe.vy,ce=ee*ee+re*re;ce<j*j&&(ee===0&&(ee=i(),ce+=ee*ee),re===0&&(re=i(),ce+=re*re),ce=(j-(ce=Math.sqrt(ce)))/ce*y,I.vx+=(ee*=ce)*(j=(ne*=ne)/(Q+ne)),I.vy+=(re*=ce)*j,oe.vx-=ee*(j=1-j),oe.vy-=re*j)}return}return H>N+j||J<N-j||$>U+j||X<U-j}}function L(F){if(F.data)return F.r=u[F.data.index];for(var B=F.r=0;B<4;++B)F[B]&&F[B].r>F.r&&(F.r=F[B].r)}function z(){if(p){var F,B=p.length,O;for(u=new Array(B),F=0;F<B;++F)O=p[F],u[O.index]=+b(O,F,p)}}return P.initialize=function(F){p=F,z()},P.iterations=function(F){return arguments.length?(f=+F,P):f},P.strength=function(F){return arguments.length?(y=+F,P):y},P.radius=function(F){return arguments.length?(b=typeof F=="function"?F:r(+F),z(),P):b},P}function s(b){return b.index}function c(b,p){var u=b.get(p);if(!u)throw new Error("missing: "+p);return u}function h(b){var p=s,u=O,y,f=r(30),P,L,z,F,B=1;b==null&&(b=[]);function O(Q){return 1/Math.min(z[Q.source.index],z[Q.target.index])}function I(Q){for(var ue=0,se=b.length;ue<B;++ue)for(var he=0,H,$,J,X,oe,ne,j;he<se;++he)H=b[he],$=H.source,J=H.target,X=J.x+J.vx-$.x-$.vx||i(),oe=J.y+J.vy-$.y-$.vy||i(),ne=Math.sqrt(X*X+oe*oe),ne=(ne-P[he])/ne*Q*y[he],X*=ne,oe*=ne,J.vx-=X*(j=F[he]),J.vy-=oe*j,$.vx+=X*(j=1-j),$.vy+=oe*j}function N(){if(L){var Q,ue=L.length,se=b.length,he=A.map(L,p),H;for(Q=0,z=new Array(ue);Q<se;++Q)H=b[Q],H.index=Q,typeof H.source!="object"&&(H.source=c(he,H.source)),typeof H.target!="object"&&(H.target=c(he,H.target)),z[H.source.index]=(z[H.source.index]||0)+1,z[H.target.index]=(z[H.target.index]||0)+1;for(Q=0,F=new Array(se);Q<se;++Q)H=b[Q],F[Q]=z[H.source.index]/(z[H.source.index]+z[H.target.index]);y=new Array(se),U(),P=new Array(se),W()}}function U(){if(L)for(var Q=0,ue=b.length;Q<ue;++Q)y[Q]=+u(b[Q],Q,b)}function W(){if(L)for(var Q=0,ue=b.length;Q<ue;++Q)P[Q]=+f(b[Q],Q,b)}return I.initialize=function(Q){L=Q,N()},I.links=function(Q){return arguments.length?(b=Q,N(),I):b},I.id=function(Q){return arguments.length?(p=Q,I):p},I.iterations=function(Q){return arguments.length?(B=+Q,I):B},I.strength=function(Q){return arguments.length?(u=typeof Q=="function"?Q:r(+Q),U(),I):u},I.distance=function(Q){return arguments.length?(f=typeof Q=="function"?Q:r(+Q),W(),I):f},I}function m(b){return b.x}function d(b){return b.y}var T=10,l=Math.PI*(3-Math.sqrt(5));function _(b){var p,u=1,y=.001,f=1-Math.pow(y,1/300),P=0,L=.6,z=A.map(),F=e.timer(O),B=M.dispatch("tick","end");b==null&&(b=[]);function O(){I(),B.call("tick",p),u<y&&(F.stop(),B.call("end",p))}function I(W){var Q,ue=b.length,se;W===void 0&&(W=1);for(var he=0;he<W;++he)for(u+=(P-u)*f,z.each(function(H){H(u)}),Q=0;Q<ue;++Q)se=b[Q],se.fx==null?se.x+=se.vx*=L:(se.x=se.fx,se.vx=0),se.fy==null?se.y+=se.vy*=L:(se.y=se.fy,se.vy=0);return p}function N(){for(var W=0,Q=b.length,ue;W<Q;++W){if(ue=b[W],ue.index=W,ue.fx!=null&&(ue.x=ue.fx),ue.fy!=null&&(ue.y=ue.fy),isNaN(ue.x)||isNaN(ue.y)){var se=T*Math.sqrt(W),he=W*l;ue.x=se*Math.cos(he),ue.y=se*Math.sin(he)}(isNaN(ue.vx)||isNaN(ue.vy))&&(ue.vx=ue.vy=0)}}function U(W){return W.initialize&&W.initialize(b),W}return N(),p={tick:I,restart:function(){return F.restart(O),p},stop:function(){return F.stop(),p},nodes:function(W){return arguments.length?(b=W,N(),z.each(U),p):b},alpha:function(W){return arguments.length?(u=+W,p):u},alphaMin:function(W){return arguments.length?(y=+W,p):y},alphaDecay:function(W){return arguments.length?(f=+W,p):+f},alphaTarget:function(W){return arguments.length?(P=+W,p):P},velocityDecay:function(W){return arguments.length?(L=1-W,p):1-L},force:function(W,Q){return arguments.length>1?(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;se<he;++se)X=b[se],H=W-X.x,$=Q-X.y,J=H*H+$*$,J<ue&&(oe=X,ue=J);return oe},on:function(W,Q){return arguments.length>1?(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<W;++U)p=b[U],Q.visit(I)}function B(){if(b){var N,U=b.length,W;for(f=new Array(U),N=0;N<U;++N)W=b[N],f[W.index]=+y(W,N,b)}}function O(N){var U=0,W,Q,ue=0,se,he,H;if(N.length){for(se=he=H=0;H<4;++H)(W=N[H])&&(Q=Math.abs(W.value))&&(U+=W.value,ue+=Q,se+=Q*W.x,he+=Q*W.y);N.x=se/ue,N.y=he/ue}else{W=N,W.x=W.data.x,W.y=W.data.y;do U+=f[W.data.index];while(W=W.next)}N.value=U}function I(N,U,W,Q){if(!N.value)return!0;var ue=N.x-p.x,se=N.y-p.y,he=Q-U,H=ue*ue+se*se;if(he*he/z<H)return H<L&&(ue===0&&(ue=i(),H+=ue*ue),se===0&&(se=i(),H+=se*se),H<P&&(H=Math.sqrt(P*H)),p.vx+=ue*N.value*u/H,p.vy+=se*N.value*u/H),!0;if(N.length||H>=L)return;(N.data!==p||N.next)&&(ue===0&&(ue=i(),H+=ue*ue),se===0&&(se=i(),H+=se*se),H<P&&(H=Math.sqrt(P*H)));do N.data!==p&&(he=f[N.data.index]*u/H,p.vx+=ue*he,p.vy+=se*he);while(N=N.next)}return F.initialize=function(N){b=N,B()},F.strength=function(N){return arguments.length?(y=typeof N=="function"?N:r(+N),B(),F):y},F.distanceMin=function(N){return arguments.length?(P=N*N,F):Math.sqrt(P)},F.distanceMax=function(N){return arguments.length?(L=N*N,F):Math.sqrt(L)},F.theta=function(N){return arguments.length?(z=N*N,F):Math.sqrt(z)},F}function S(b,p,u){var y,f=r(.1),P,L;typeof b!="function"&&(b=r(+b)),p==null&&(p=0),u==null&&(u=0);function z(B){for(var O=0,I=y.length;O<I;++O){var N=y[O],U=N.x-p||1e-6,W=N.y-u||1e-6,Q=Math.sqrt(U*U+W*W),ue=(L[O]-Q)*P[O]*B/Q;N.vx+=U*ue,N.vy+=W*ue}}function F(){if(y){var B,O=y.length;for(P=new Array(O),L=new Array(O),B=0;B<O;++B)L[B]=+b(y[B],B,y),P[B]=isNaN(L[B])?0:+f(y[B],B,y)}}return z.initialize=function(B){y=B,F()},z.strength=function(B){return arguments.length?(f=typeof B=="function"?B:r(+B),F(),z):f},z.radius=function(B){return arguments.length?(b=typeof B=="function"?B:r(+B),F(),z):b},z.x=function(B){return arguments.length?(p=+B,z):p},z.y=function(B){return arguments.length?(u=+B,z):u},z}function E(b){var p=r(.1),u,y,f;typeof b!="function"&&(b=r(b==null?0:+b));function P(z){for(var F=0,B=u.length,O;F<B;++F)O=u[F],O.vx+=(f[F]-O.x)*y[F]*z}function L(){if(u){var z,F=u.length;for(y=new Array(F),f=new Array(F),z=0;z<F;++z)y[z]=isNaN(f[z]=+b(u[z],z,u))?0:+p(u[z],z,u)}}return P.initialize=function(z){u=z,L()},P.strength=function(z){return arguments.length?(p=typeof z=="function"?z:r(+z),L(),P):p},P.x=function(z){return arguments.length?(b=typeof z=="function"?z:r(+z),L(),P):b},P}function g(b){var p=r(.1),u,y,f;typeof b!="function"&&(b=r(b==null?0:+b));function P(z){for(var F=0,B=u.length,O;F<B;++F)O=u[F],O.vy+=(f[F]-O.y)*y[F]*z}function L(){if(u){var z,F=u.length;for(y=new Array(F),f=new Array(F),z=0;z<F;++z)y[z]=isNaN(f[z]=+b(u[z],z,u))?0:+p(u[z],z,u)}}return P.initialize=function(z){u=z,L()},P.strength=function(z){return arguments.length?(p=typeof z=="function"?z:r(+z),L(),P):p},P.y=function(z){return arguments.length?(b=typeof z=="function"?z:r(+z),L(),P):b},P}v.forceCenter=t,v.forceCollide=o,v.forceLink=h,v.forceManyBody=w,v.forceRadial=S,v.forceSimulation=_,v.forceX=E,v.forceY=g,Object.defineProperty(v,"__esModule",{value:!0})})}}),fG=Ze({"node_modules/d3-path/dist/d3-path.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";var x=Math.PI,A=2*x,M=1e-6,e=A-M;function t(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function r(){return new t}t.prototype=r.prototype={constructor:t,moveTo:function(i,a){this._+="M"+(this._x0=this._x1=+i)+","+(this._y0=this._y1=+a)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(i,a){this._+="L"+(this._x1=+i)+","+(this._y1=+a)},quadraticCurveTo:function(i,a,n,o){this._+="Q"+ +i+","+ +a+","+(this._x1=+n)+","+(this._y1=+o)},bezierCurveTo:function(i,a,n,o,s,c){this._+="C"+ +i+","+ +a+","+ +n+","+ +o+","+(this._x1=+s)+","+(this._y1=+c)},arcTo:function(i,a,n,o,s){i=+i,a=+a,n=+n,o=+o,s=+s;var c=this._x1,h=this._y1,m=n-i,d=o-a,T=c-i,l=h-a,_=T*T+l*l;if(s<0)throw new Error("negative radius: "+s);if(this._x1===null)this._+="M"+(this._x1=i)+","+(this._y1=a);else if(_>M)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*Ai<o))return Ai=(Pn*(dr-Fa)-fi*(It-Ca))/Ai,[It+Ai*Da,dr+Ai*Zn]}function g(It,dr,kr,na,Ca,Fa,Ya){var ha=It-kr,Da=dr-na,Zn=(Ya?Fa:-Fa)/n(ha*ha+Da*Da),Pn=Zn*Da,fi=-Zn*ha,Ai=It+Pn,ki=dr+fi,zi=kr+Pn,Xi=na+fi,to=(Ai+zi)/2,go=(ki+Xi)/2,pi=zi-Ai,Jo=Xi-ki,Xo=pi*pi+Jo*Jo,Ts=Ca-Fa,Po=Ai*Xi-zi*ki,so=(Jo<0?-1:1)*n(r(0,Ts*Ts*Xo-Po*Po)),qi=(Po*Jo-pi*so)/Xo,To=(-Po*pi-Jo*so)/Xo,Vo=(Po*Jo+pi*so)/Xo,Oo=(-Po*pi+Jo*so)/Xo,lo=qi-to,Co=To-go,os=Vo-to,Ys=Oo-go;return lo*lo+Co*Co>os*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()),Ai<fi&&(Pn=Ai,Ai=fi,fi=Pn),!(Ai>o))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(Xi<s&&(ms=E(Os,Yo,uo,$s,tl,Bs,jn,Ci))){var Is=Os-ms[0],rl=Yo-ms[1],Si=tl-ms[0],po=Bs-ms[1],ro=1/a(m((Is*Si+rl*po)/(n(Is*Is+rl*rl)*n(Si*Si+po*po)))/2),As=n(ms[0]*ms[0]+ms[1]*ms[1]);Vo=i(To,(fi-As)/(ro-1)),Oo=i(To,(Ai-As)/(ro+1))}}Po>o?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),Oo<To?ha.arc(lo.cx,lo.cy,Oo,e(lo.y01,lo.x01),e(Co.y01,Co.x01),!to):(ha.arc(lo.cx,lo.cy,Oo,e(lo.y01,lo.x01),e(lo.y11,lo.x11),!to),ha.arc(0,0,Ai,e(lo.cy+lo.y11,lo.cx+lo.x11),e(Co.cy+Co.y11,Co.cx+Co.x11),!to),ha.arc(Co.cx,Co.cy,Oo,e(Co.y11,Co.x11),e(Co.y01,Co.x01),!to))):(ha.moveTo(Os,Yo),ha.arc(0,0,Ai,go,pi,!to)):ha.moveTo(Os,Yo),!(fi>o)||!(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<To?ha.arc(lo.cx,lo.cy,Vo,e(lo.y01,lo.x01),e(Co.y01,Co.x01),!to):(ha.arc(lo.cx,lo.cy,Vo,e(lo.y01,lo.x01),e(lo.y11,lo.x11),!to),ha.arc(0,0,fi,e(lo.cy+lo.y11,lo.cx+lo.x11),e(Co.cy+Co.y11,Co.cx+Co.x11),to),ha.arc(Co.cx,Co.cy,Vo,e(Co.y11,Co.x11),e(Co.y01,Co.x01),!to))):ha.arc(0,0,fi,Xo,Jo,to)}if(ha.closePath(),Zn)return ha=null,Zn+""||null}return Da.centroid=function(){var Zn=(+It.apply(this,arguments)+ +dr.apply(this,arguments))/2,Pn=(+Ca.apply(this,arguments)+ +Fa.apply(this,arguments))/2-s/2;return[t(Pn)*Zn,a(Pn)*Zn]},Da.innerRadius=function(Zn){return arguments.length?(It=typeof Zn=="function"?Zn:A(+Zn),Da):It},Da.outerRadius=function(Zn){return arguments.length?(dr=typeof Zn=="function"?Zn:A(+Zn),Da):dr},Da.cornerRadius=function(Zn){return arguments.length?(kr=typeof Zn=="function"?Zn:A(+Zn),Da):kr},Da.padRadius=function(Zn){return arguments.length?(na=Zn==null?null:typeof Zn=="function"?Zn:A(+Zn),Da):na},Da.startAngle=function(Zn){return arguments.length?(Ca=typeof Zn=="function"?Zn:A(+Zn),Da):Ca},Da.endAngle=function(Zn){return arguments.length?(Fa=typeof Zn=="function"?Zn:A(+Zn),Da):Fa},Da.padAngle=function(Zn){return arguments.length?(Ya=typeof Zn=="function"?Zn:A(+Zn),Da):Ya},Da.context=function(Zn){return arguments.length?(ha=Zn??null,Da):ha},Da}function p(It){this._context=It}p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(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;default:this._context.lineTo(It,dr);break}}};function u(It){return new p(It)}function y(It){return It[0]}function f(It){return It[1]}function P(){var It=y,dr=f,kr=A(!0),na=null,Ca=u,Fa=null;function Ya(ha){var Da,Zn=ha.length,Pn,fi=!1,Ai;for(na==null&&(Fa=Ca(Ai=x.path())),Da=0;Da<=Zn;++Da)!(Da<Zn&&kr(Pn=ha[Da],Da,ha))===fi&&((fi=!fi)?Fa.lineStart():Fa.lineEnd()),fi&&Fa.point(+It(Pn,Da,ha),+dr(Pn,Da,ha));if(Ai)return Fa=null,Ai+""||null}return Ya.x=function(ha){return arguments.length?(It=typeof ha=="function"?ha:A(+ha),Ya):It},Ya.y=function(ha){return arguments.length?(dr=typeof ha=="function"?ha:A(+ha),Ya):dr},Ya.defined=function(ha){return arguments.length?(kr=typeof ha=="function"?ha:A(!!ha),Ya):kr},Ya.curve=function(ha){return arguments.length?(Ca=ha,na!=null&&(Fa=Ca(na)),Ya):Ca},Ya.context=function(ha){return arguments.length?(ha==null?na=Fa=null:Fa=Ca(na=ha),Ya):na},Ya}function L(){var It=y,dr=null,kr=A(0),na=f,Ca=A(!0),Fa=null,Ya=u,ha=null;function Da(Pn){var fi,Ai,ki,zi=Pn.length,Xi,to=!1,go,pi=new Array(zi),Jo=new Array(zi);for(Fa==null&&(ha=Ya(go=x.path())),fi=0;fi<=zi;++fi){if(!(fi<zi&&Ca(Xi=Pn[fi],fi,Pn))===to)if(to=!to)Ai=fi,ha.areaStart(),ha.lineStart();else{for(ha.lineEnd(),ha.lineStart(),ki=fi-1;ki>=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 dr<It?-1:dr>It?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;Da<Zn;++Da)(Xo=zi[ki[Da]=Da]=+It(ha[Da],Da,ha))>0&&(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;Da<Zn;++Da,Xi=go)Pn=ki[Da],Xo=zi[Pn],go=Xi+(Xo>0?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<kr;++Fa,++Ya)this._context.bezierCurveTo(na[0][Fa],Ca[0][Fa],na[1][Fa],Ca[1][Fa],It[Ya],dr[Ya]);(this._line||this._line!==0&&kr===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(It,dr){this._x.push(+It),this._y.push(+dr)}};function Pr(It){var dr,kr=It.length-1,na,Ca=new Array(kr),Fa=new Array(kr),Ya=new Array(kr);for(Ca[0]=0,Fa[0]=2,Ya[0]=It[0]+2*It[1],dr=1;dr<kr-1;++dr)Ca[dr]=1,Fa[dr]=4,Ya[dr]=4*It[dr]+2*It[dr+1];for(Ca[kr-1]=2,Fa[kr-1]=7,Ya[kr-1]=8*It[kr-1]+It[kr],dr=1;dr<kr;++dr)na=Ca[dr]/Fa[dr-1],Fa[dr]-=na,Ya[dr]-=na*Ya[dr-1];for(Ca[kr-1]=Ya[kr-1]/Fa[kr-1],dr=kr-2;dr>=0;--dr)Ca[dr]=(Ya[dr]-Ca[dr+1])/Fa[dr];for(Fa[kr-1]=(It[kr]+Ca[kr-1])/2,dr=0;dr<kr-1;++dr)Fa[dr]=2*It[dr+1]-Ca[dr+1];return[Ca,Fa]}function ta(It){return new Wt(It)}function ma(It,dr){this._context=It,this._t=dr}ma.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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<Ya;++kr)for(Ca=Fa,Fa=It[dr[kr]],na=0;na<ha;++na)Fa[na][1]+=Fa[na][0]=isNaN(Ca[na][1])?Ca[na][0]:Ca[na][1]}function nn(It){for(var dr=It.length,kr=new Array(dr);--dr>=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;ha<Zn;++ha){for(var Ai=Ya[ha],ki=Pn[ha]=new Array(Da),zi=0,Xi;zi<Da;++zi)ki[zi]=Xi=[0,+na(Fa[zi],Ai,zi,Fa)],Xi.data=Fa[zi];ki.key=Ai}for(ha=0,fi=dr(Pn);ha<Zn;++ha)Pn[fi[ha]].index=ha;return kr(Pn,fi),Pn}return Ca.keys=function(Fa){return arguments.length?(It=typeof Fa=="function"?Fa:A(se.call(Fa)),Ca):It},Ca.value=function(Fa){return arguments.length?(na=typeof Fa=="function"?Fa:A(+Fa),Ca):na},Ca.order=function(Fa){return arguments.length?(dr=Fa==null?nn:typeof Fa=="function"?Fa:A(se.call(Fa)),Ca):dr},Ca.offset=function(Fa){return arguments.length?(kr=Fa??rn,Ca):kr},Ca}function ct(It,dr){if((na=It.length)>0){for(var kr,na,Ca=0,Fa=It[0].length,Ya;Ca<Fa;++Ca){for(Ya=kr=0;kr<na;++kr)Ya+=It[kr][Ca][1]||0;if(Ya)for(kr=0;kr<na;++kr)It[kr][Ca][1]/=Ya}rn(It,dr)}}function Nr(It,dr){if((Da=It.length)>0)for(var kr,na=0,Ca,Fa,Ya,ha,Da,Zn=It[dr[0]].length;na<Zn;++na)for(Ya=ha=0,kr=0;kr<Da;++kr)(Fa=(Ca=It[dr[kr]][na])[1]-Ca[0])>0?(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;kr<Fa;++kr){for(var Ya=0,ha=0;Ya<Ca;++Ya)ha+=It[Ya][kr][1]||0;na[kr][1]+=na[kr][0]=-ha/2}rn(It,dr)}}function Rr(It,dr){if(!(!((Ya=It.length)>0)||!((Fa=(Ca=It[dr[0]]).length)>0))){for(var kr=0,na=1,Ca,Fa,Ya;na<Fa;++na){for(var ha=0,Da=0,Zn=0;ha<Ya;++ha){for(var Pn=It[dr[ha]],fi=Pn[na][1]||0,Ai=Pn[na-1][1]||0,ki=(fi-Ai)/2,zi=0;zi<ha;++zi){var Xi=It[dr[zi]],to=Xi[na][1]||0,go=Xi[na-1][1]||0;ki+=to-go}Da+=fi,Zn+=ki*fi}Ca[na-1][1]+=Ca[na-1][0]=kr,Da&&(kr-=Zn/Da)}Ca[na-1][1]+=Ca[na-1][0]=kr,rn(It,dr)}}function Lr(It){var dr=It.map(Gr);return nn(It).sort(function(kr,na){return dr[kr]-dr[na]})}function Gr(It){for(var dr=-1,kr=0,na=It.length,Ca,Fa=-1/0;++dr<na;)(Ca=+It[dr][1])>Fa&&(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;++kr<na;)(Ca=+It[kr][1])&&(dr+=Ca);return dr}function aa(It){return Kr(It).reverse()}function da(It){var dr=It.length,kr,na,Ca=It.map(Ur),Fa=Lr(It),Ya=0,ha=0,Da=[],Zn=[];for(kr=0;kr<dr;++kr)na=Fa[kr],Ya<ha?(Ya+=Ca[na],Da.push(na)):(ha+=Ca[na],Zn.push(na));return Zn.reverse().concat(Da)}function fa(It){return nn(It).reverse()}v.arc=b,v.area=L,v.areaRadial=Q,v.curveBasis=xr,v.curveBasisClosed=wr,v.curveBasisOpen=bt,v.curveBundle=Ke,v.curveCardinal=Ve,v.curveCardinalClosed=Te,v.curveCardinalOpen=at,v.curveCatmullRom=Ot,v.curveCatmullRomClosed=rr,v.curveCatmullRomOpen=Tr,v.curveLinear=u,v.curveLinearClosed=Ua,v.curveMonotoneX=Nt,v.curveMonotoneY=Kt,v.curveNatural=ta,v.curveStep=ra,v.curveStepAfter=Ha,v.curveStepBefore=Ia,v.line=P,v.lineRadial=W,v.linkHorizontal=ne,v.linkRadial=ee,v.linkVertical=j,v.pie=B,v.pointRadial=ue,v.radialArea=Q,v.radialLine=W,v.stack=xt,v.stackOffsetDiverging=Nr,v.stackOffsetExpand=ct,v.stackOffsetNone=rn,v.stackOffsetSilhouette=Or,v.stackOffsetWiggle=Rr,v.stackOrderAppearance=Lr,v.stackOrderAscending=Kr,v.stackOrderDescending=aa,v.stackOrderInsideOut=da,v.stackOrderNone=nn,v.stackOrderReverse=fa,v.symbol=kt,v.symbolCircle=re,v.symbolCross=ce,v.symbolDiamond=ze,v.symbolSquare=ut,v.symbolStar=tt,v.symbolTriangle=_e,v.symbolWye=Qe,v.symbols=Lt,Object.defineProperty(v,"__esModule",{value:!0})})}}),hG=Ze({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,yx(),LT(),NC()):x(v.d3=v.d3||{},v.d3,v.d3,v.d3)})(Z,function(v,x,A,M){"use strict";function e(u){return u.target.depth}function t(u){return u.depth}function r(u,y){return y-1-u.height}function i(u,y){return u.sourceLinks.length?u.depth:y-1}function a(u){return u.targetLinks.length?u.depth:u.sourceLinks.length?x.min(u.sourceLinks,e)-1:0}function n(u){return function(){return u}}function o(u,y){return c(u.source,y.source)||u.index-y.index}function s(u,y){return c(u.target,y.target)||u.index-y.index}function c(u,y){return u.y0-y.y0}function h(u){return u.value}function m(u){return(u.y0+u.y1)/2}function d(u){return m(u.source)*u.value}function T(u){return m(u.target)*u.value}function l(u){return u.index}function _(u){return u.nodes}function w(u){return u.links}function S(u,y){var f=u.get(y);if(!f)throw new Error("missing: "+y);return f}var E=function(){var u=0,y=0,f=1,P=1,L=24,z=8,F=l,B=i,O=_,I=w,N=32,U=2/3;function W(){var $={nodes:O.apply(null,arguments),links:I.apply(null,arguments)};return Q($),ue($),se($),he($,N),H($),$}W.update=function($){return H($),$},W.nodeId=function($){return arguments.length?(F=typeof $=="function"?$:n($),W):F},W.nodeAlign=function($){return arguments.length?(B=typeof $=="function"?$:n($),W):B},W.nodeWidth=function($){return arguments.length?(L=+$,W):L},W.nodePadding=function($){return arguments.length?(z=+$,W):z},W.nodes=function($){return arguments.length?(O=typeof $=="function"?$:n($),W):O},W.links=function($){return arguments.length?(I=typeof $=="function"?$:n($),W):I},W.size=function($){return arguments.length?(u=y=0,f=+$[0],P=+$[1],W):[f-u,P-y]},W.extent=function($){return arguments.length?(u=+$[0][0],f=+$[1][0],y=+$[0][1],P=+$[1][1],W):[[u,y],[f,P]]},W.iterations=function($){return arguments.length?(N=+$,W):N};function Q($){$.nodes.forEach(function(X,oe){X.index=oe,X.sourceLinks=[],X.targetLinks=[]});var J=A.map($.nodes,F);$.links.forEach(function(X,oe){X.index=oe;var ne=X.source,j=X.target;typeof ne!="object"&&(ne=X.source=S(J,ne)),typeof j!="object"&&(j=X.target=S(J,j)),ne.sourceLinks.push(X),j.targetLinks.push(X)})}function ue($){$.nodes.forEach(function(J){J.value=Math.max(x.sum(J.sourceLinks,h),x.sum(J.targetLinks,h))})}function se($){var J,X,oe;for(J=$.nodes,X=[],oe=0;J.length;++oe,J=X,X=[])J.forEach(function(j){j.depth=oe,j.sourceLinks.forEach(function(ee){X.indexOf(ee.target)<0&&X.push(ee.target)})});for(J=$.nodes,X=[],oe=0;J.length;++oe,J=X,X=[])J.forEach(function(j){j.height=oe,j.targetLinks.forEach(function(ee){X.indexOf(ee.source)<0&&X.push(ee.source)})});var ne=(f-u-L)/(oe-1);$.nodes.forEach(function(j){j.x1=(j.x0=u+Math.max(0,Math.min(oe-1,Math.floor(B.call(null,j,oe))))*ne)+L})}function he($){var J=A.nest().key(function(ce){return ce.x0}).sortKeys(x.ascending).entries($.nodes).map(function(ce){return ce.values});ne(),re();for(var X=1,oe=N;oe>0;--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;We<Re;++We)be=ce[We],Ae=ze-be.y0,Ae>0&&(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<a[S].length;g++)b=a[S][g],b===n?(c(n,t),E=!0):r[b]||(E=s(b));if(E)o(S);else for(g=0;g<a[S].length;g++){b=a[S][g];var p=i[b];p||(p={},i[b]=p),p[b]=!0}return t.pop(),E}function c(S,E){var g=[].concat(E).concat(S);M?M(s):e.push(g)}function h(S){for(var E=0;E<A.length;E++)E<S&&(A[E]=[]),A[E]=A[E].filter(function(g){return 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<b.length;y++)for(var f=0;f<b[y].length;f++)b[y][f]<p&&(p=b[y][f],u=y);var P=b[u];if(!P)return!1;var L=A.map(function(z,F){return P.indexOf(F)===-1?[]:z.filter(function(B){return P.indexOf(B)!==-1})});return{leastVertex:p,adjList:L}}n=0;for(var d=A.length;n<d;){var T=m(n);if(n=T.leastVertex,a=T.adjList,a){for(var l=0;l<a.length;l++)for(var _=0;_<a[l].length;_++){var w=a[l][_];r[+w]=!1,i[w]={}}s(n),n=n+1}else n=d}if(!M)return e}}}),dG=Ze({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(Z,q){(function(v,x){typeof Z=="object"&&typeof q<"u"?x(Z,yx(),LT(),NC(),pG()):x(v.d3=v.d3||{},v.d3,v.d3,v.d3,null)})(Z,function(v,x,A,M,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;function t(Re){return Re.target.depth}function r(Re){return Re.depth}function i(Re,We){return We-1-Re.height}function a(Re,We){return Re.sourceLinks.length?Re.depth:We-1}function n(Re){return Re.targetLinks.length?Re.depth:Re.sourceLinks.length?x.min(Re.sourceLinks,t)-1:0}function o(Re){return function(){return Re}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Re){return typeof Re}:function(Re){return Re&&typeof Symbol=="function"&&Re.constructor===Symbol&&Re!==Symbol.prototype?"symbol":typeof Re};function c(Re,We){return m(Re.source,We.source)||Re.index-We.index}function h(Re,We){return m(Re.target,We.target)||Re.index-We.index}function m(Re,We){return Re.partOfCycle===We.partOfCycle?Re.y0-We.y0:Re.circularLinkType==="top"||We.circularLinkType==="bottom"?-1:1}function d(Re){return Re.value}function T(Re){return(Re.y0+Re.y1)/2}function l(Re){return T(Re.source)}function _(Re){return T(Re.target)}function w(Re){return Re.index}function S(Re){return Re.nodes}function E(Re){return Re.links}function g(Re,We){var it=Re.get(We);if(!it)throw new Error("missing: "+We);return it}function b(Re,We){return We(Re)}var p=25,u=10,y=.3;function f(){var Re=0,We=0,it=1,ot=1,tt=24,ut,Me=w,_e=a,fe=S,Fe=E,rt=32,st=2,Qe,Lt=null;function kt(){var bt={nodes:fe.apply(null,arguments),links:Fe.apply(null,arguments)};qt(bt),P(bt,Me,Lt),Zt(bt),jr(bt),L(bt,Me),wr(bt,rt,Me),Ir(bt);for(var Be=4,Ke=0;Ke<Be;Ke++)ee(bt,ot,Me),re(bt,ot,Me),oe(bt,We,ot,Me),ee(bt,ot,Me),re(bt,ot,Me);return ze(bt,We,ot),N(bt,st,ot,Me),bt}kt.nodeId=function(bt){return arguments.length?(Me=typeof bt=="function"?bt:o(bt),kt):Me},kt.nodeAlign=function(bt){return arguments.length?(_e=typeof bt=="function"?bt:o(bt),kt):_e},kt.nodeWidth=function(bt){return arguments.length?(tt=+bt,kt):tt},kt.nodePadding=function(bt){return arguments.length?(ut=+bt,kt):ut},kt.nodes=function(bt){return arguments.length?(fe=typeof bt=="function"?bt:o(bt),kt):fe},kt.links=function(bt){return arguments.length?(Fe=typeof bt=="function"?bt:o(bt),kt):Fe},kt.size=function(bt){return arguments.length?(Re=We=0,it=+bt[0],ot=+bt[1],kt):[it-Re,ot-We]},kt.extent=function(bt){return arguments.length?(Re=+bt[0][0],it=+bt[1][0],We=+bt[0][1],ot=+bt[1][1],kt):[[Re,We],[it,ot]]},kt.iterations=function(bt){return arguments.length?(rt=+bt,kt):rt},kt.circularLinkGap=function(bt){return arguments.length?(st=+bt,kt):st},kt.nodePaddingRatio=function(bt){return arguments.length?(Qe=+bt,kt):Qe},kt.sortNodes=function(bt){return arguments.length?(Lt=bt,kt):Lt},kt.update=function(bt){return L(bt,Me),Ir(bt),bt.links.forEach(function(Be){Be.circular&&(Be.circularLinkType=Be.y0+Be.y1<ot?"top":"bottom",Be.source.circularLinkType=Be.circularLinkType,Be.target.circularLinkType=Be.circularLinkType)}),ee(bt,ot,Me,!1),re(bt,ot,Me),N(bt,st,ot,Me),bt};function qt(bt){bt.nodes.forEach(function(Ke,Ue){Ke.index=Ue,Ke.sourceLinks=[],Ke.targetLinks=[]});var Be=A.map(bt.nodes,Me);return bt.links.forEach(function(Ke,Ue){Ke.index=Ue;var Ee=Ke.source,Ve=Ke.target;(typeof Ee>"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=Qt<yt?Qt:yt}),ut=yt}var Tt=x.min(Ue,function(rr){return(ot-We-(rr.length-1)*ut)/x.sum(rr,d)});Tt=Tt*y,bt.links.forEach(function(rr){rr.width=rr.value*Tt});var Ot=Sr(bt),Gt=xr(bt,Ot);Tt=Tt*Gt,bt.links.forEach(function(rr){rr.width=rr.value*Tt}),Ue.forEach(function(rr){var Qt=rr.length;rr.forEach(function(Tr,la){Tr.depth==Ue.length-1&&Qt==1||Tr.depth==0&&Qt==1?(Tr.y0=ot/2-Tr.value*Tt,Tr.y1=Tr.y0+Tr.value*Tt):Tr.partOfCycle?B(Tr,at)==0?(Tr.y0=ot/2+la,Tr.y1=Tr.y0+Tr.value*Tt):Tr.circularLinkType=="top"?(Tr.y0=We+la,Tr.y1=Tr.y0+Tr.value*Tt):(Tr.y0=ot-Tr.value*Tt-la,Tr.y1=Tr.y0+Tr.value*Tt):Ot.top==0||Ot.bottom==0?(Tr.y0=(ot-We)/Qt*la,Tr.y1=Tr.y0+Tr.value*Tt):(Tr.y0=(ot-We)/2-Qt/2+la,Tr.y1=Tr.y0+Tr.value*Tt)})})}function Te(at,yt){var Tt=Ue.length;Ue.forEach(function(Ot){var Gt=Ot.length,rr=Ot[0].depth;Ot.forEach(function(Qt){var Tr;if((Qt.sourceLinks.length||Qt.targetLinks.length)&&!(Qt.partOfCycle&&B(Qt,yt)>0))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;rr<Gt;++rr)yt=at[rr],Tt=Ot-yt.y0,Tt>0&&(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;ut<Re.links.length;ut++){var Me=Re.links[ut],_e=Me.source.index,fe=Me.target.index;tt[_e]||(tt[_e]=[]),tt[fe]||(tt[fe]=[]),tt[_e].indexOf(fe)===-1&&tt[_e].push(fe)}var Fe=e(tt);Fe.sort(function(Lt,kt){return Lt.length-kt.length});var rt={};for(ut=0;ut<Fe.length;ut++){var st=Fe[ut],Qe=st.slice(-2);rt[Qe[0]]||(rt[Qe[0]]={}),rt[Qe[0]][Qe[1]]=!0}Re.links.forEach(function(Lt){var kt=Lt.target.index,qt=Lt.source.index;kt===qt||rt[qt]&&rt[qt][kt]?(Lt.circular=!0,Lt.circularLinkID=ot,ot=ot+1):Lt.circular=!1})}else Re.links.forEach(function(Lt){Lt.source[it]<Lt.target[it]?Lt.circular=!1:(Lt.circular=!0,Lt.circularLinkID=ot,ot=ot+1)})}function L(Re,We){var it=0,ot=0;Re.links.forEach(function(tt){tt.circular&&(tt.source.circularLinkType||tt.target.circularLinkType?tt.circularLinkType=tt.source.circularLinkType?tt.source.circularLinkType:tt.target.circularLinkType:tt.circularLinkType=it<ot?"top":"bottom",tt.circularLinkType=="top"?it=it+1:ot=ot+1,Re.nodes.forEach(function(ut){(b(ut,We)==b(tt.source,We)||b(ut,We)==b(tt.target,We))&&(ut.circularLinkType=tt.circularLinkType)}))}),Re.links.forEach(function(tt){tt.circular&&(tt.source.circularLinkType==tt.target.circularLinkType&&(tt.circularLinkType=tt.source.circularLinkType),Ae(tt,We)&&(tt.circularLinkType=tt.source.circularLinkType))})}function z(Re){var We=Math.abs(Re.y1-Re.y0),it=Math.abs(Re.target.x0-Re.source.x1);return Math.atan(it/We)}function F(Re,We){return Re.source.column<We.target.column?!1:!(Re.target.column>We.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;Me<tt;Me++)if(F(Re[tt],Re[Me])){var _e=Re[Me].circularPathData.verticalBuffer+Re[Me].width/2+We;ut=_e>ut?_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&&Zt<Fe.y1?(xr=Fe.y1-Zt+10,xr=Fe.circularLinkType=="bottom"?xr:-xr,Fe=j(Fe,xr,We,it),Re.nodes.forEach(function(jr){b(jr,ot)==b(Fe,ot)||jr.column!=Fe.column||ne(Fe,jr)&&j(jr,xr,We,it)})):Sr>Fe.y0&&Sr<Fe.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.y0<Fe.y1&&jr.y1>Fe.y1&&j(jr,xr,We,it)})):Zt<Fe.y0&&Sr>Fe.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.y0<Fe.y1&&jr.y1>Fe.y1&&j(jr,xr,We,it)}))}})}})}function ne(Re,We){return Re.y0>We.y0&&Re.y0<We.y1||Re.y1>We.y0&&Re.y1<We.y1?!0:Re.y0<We.y0&&Re.y1>We.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;rt<Me;rt++)st=st+ut[rt].width;fe.y0=tt.y1-st-fe.width/2}})})}function re(Re,We,it){Re.nodes.forEach(function(ot){var tt=Re.links.filter(function(_e){return b(_e.target,it)==b(ot,it)}),ut=tt.length;ut>1&&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.column<fe.source.column){var rt=J(_e,fe);return rt-fe.y0}}else return _e.y0-fe.y0}if(_e.circular&&!fe.circular)return _e.circularLinkType=="top"?-1:1;if(fe.circular&&!_e.circular)return fe.circularLinkType=="top"?1:-1;if(_e.circular&&fe.circular)return _e.circularLinkType===fe.circularLinkType&&_e.circularLinkType=="top"?_e.source.column===fe.source.column?_e.source.y1-fe.source.y1:_e.source.column-fe.source.column:_e.circularLinkType===fe.circularLinkType&&_e.circularLinkType=="bottom"?_e.source.column===fe.source.column?_e.source.y1-fe.source.y1:fe.source.column-_e.source.column:_e.circularLinkType=="top"?-1:1});var Me=ot.y0;tt.forEach(function(_e){_e.y1=Me+_e.width/2,Me=Me+_e.width}),tt.forEach(function(_e,fe){if(_e.circularLinkType=="bottom"){var Fe=fe+1,rt=0;for(Fe;Fe<ut;Fe++)rt=rt+tt[Fe].width;_e.y1=ot.y1-rt-_e.width/2}})})}function ce(Re,We){return be(Re)==be(We)}function be(Re){return Re.y0-Re.y1>0?"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()<ce&&n.warn("node.pad was reduced to ",tt.nodePadding()," to fit within the figure.");var Me,_e,fe;for(var Fe in ne._groupLookup){var rt=parseInt(ne._groupLookup[Fe]),st;for(Me=0;Me<ut.nodes.length;Me++)if(ut.nodes[Me].pointNumber===rt){st=ut.nodes[Me];break}if(st){var Qe={pointNumber:parseInt(Fe),x0:st.x0,x1:st.x1,y0:st.y0,y1:st.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};ut.nodes.unshift(Qe),st.childrenNodes.unshift(Qe)}}function Lt(){for(Me=0;Me<ut.nodes.length;Me++){var jr=ut.nodes[Me],wr={},Ir,bt;for(_e=0;_e<jr.targetLinks.length;_e++)bt=jr.targetLinks[_e],Ir=bt.source.pointNumber+":"+bt.target.pointNumber,wr.hasOwnProperty(Ir)||(wr[Ir]=[]),wr[Ir].push(bt);var Be=Object.keys(wr);for(_e=0;_e<Be.length;_e++){Ir=Be[_e];var Ke=wr[Ir],Ue=0,Ee={};for(fe=0;fe<Ke.length;fe++)bt=Ke[fe],Ee[bt.label]||(Ee[bt.label]=0),Ee[bt.label]+=bt.value,Ue+=bt.value;for(fe=0;fe<Ke.length;fe++)bt=Ke[fe],bt.flow={value:Ue,labelConcentration:Ee[bt.label]/Ue,concentration:bt.value/Ue,links:Ke},bt.concentrationscale&&(bt.color=r(bt.concentrationscale(bt.flow.labelConcentration)))}var Ve=0;for(_e=0;_e<jr.sourceLinks.length;_e++)Ve+=jr.sourceLinks[_e].value;for(_e=0;_e<jr.sourceLinks.length;_e++)bt=jr.sourceLinks[_e],bt.concentrationOut=bt.value/Ve;var Ce=0;for(_e=0;_e<jr.targetLinks.length;_e++)Ce+=jr.targetLinks[_e].value;for(_e=0;_e<jr.targetLinks.length;_e++)bt=jr.targetLinks[_e],bt.concenrationIn=bt.value/Ce}}Lt();function kt(jr){jr.forEach(function(wr){var Ir,bt,Be=0,Ke=wr.length,Ue;for(wr.sort(function(Ee,Ve){return Ee.y0-Ve.y0}),Ue=0;Ue<Ke;++Ue)Ir=wr[Ue],Ir.y0>=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;Me<wr.length;Me++){var Ee=jr[wr[Me].index];Ee.x0>Ke+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;Me<Math.min(j.node.x.length,j.node.y.length,ut.nodes.length);Me++)if(j.node.x[Me]&&j.node.y[Me]){var Zt=[j.node.x[Me]*ze,j.node.y[Me]*Re];ut.nodes[Me].x0=Zt[0]-be/2,ut.nodes[Me].x1=Zt[0]+be/2;var Sr=ut.nodes[Me].y1-ut.nodes[Me].y0;ut.nodes[Me].y0=Zt[1]-Sr/2,ut.nodes[Me].y1=Zt[1]+Sr/2}if(j.arrangement==="snap"){We=ut.nodes;var xr=qt(We);kt(xr)}tt.update(ut)}return{circular:ot,key:oe,trace:j,guid:n.randstr(),horizontal:re,width:ze,height:Re,nodePad:j.node.pad,nodeLineColor:j.node.line.color,nodeLineWidth:j.node.line.width,linkLineColor:j.link.line.color,linkLineWidth:j.link.line.width,linkArrowLength:j.link.arrowlen,valueFormat:j.valueformat,valueSuffix:j.valuesuffix,textFont:j.textfont,translateX:ee.x[0]*J.width+J.margin.l,translateY:J.height-ee.y[1]*J.height+J.margin.t,dragParallel:re?Re:ze,dragPerpendicular:re?ze:Re,arrangement:j.arrangement,sankey:tt,graph:ut,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function b(J,X,oe){var ne=r(X.color),j=r(X.hovercolor),ee=X.source.label+"|"+X.target.label,re=ee+"__"+oe;return X.trace=J.trace,X.curveNumber=J.trace.index,{circular:J.circular,key:re,traceId:J.key,pointNumber:X.pointNumber,link:X,tinyColorHue:i.tinyRGB(ne),tinyColorAlpha:ne.getAlpha(),tinyColorHoverHue:i.tinyRGB(j),tinyColorHoverAlpha:j.getAlpha(),linkPath:u,linkLineColor:J.linkLineColor,linkLineWidth:J.linkLineWidth,linkArrowLength:J.linkArrowLength,valueFormat:J.valueFormat,valueSuffix:J.valueSuffix,sankey:J.sankey,parent:J,interactionState:J.interactionState,flow:X.flow}}function p(J,X){var oe="",ne=J.width/2,j=J.circularPathData,ee=j.sourceX+j.verticalBuffer<j.targetX,re=j.rightFullExtent-j.rightLargeArcRadius-X<=j.leftFullExtent-ne,ce=Math.abs(j.rightFullExtent-j.leftFullExtent-ne)<ne;return J.circularLinkType==="top"?(oe="M "+(j.targetX-X)+" "+(j.targetY+ne)+" L "+(j.rightInnerExtent-X)+" "+(j.targetY+ne)+"A "+(j.rightLargeArcRadius+ne)+" "+(j.rightSmallArcRadius+ne)+" 0 0 1 "+(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 1 "+(j.rightFullExtent+ne-X-(j.rightLargeArcRadius-ne))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius+ne))+" L "+(j.rightFullExtent+ne-(j.rightLargeArcRadius-ne)-X)+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius+ne))+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftLargeArcRadius+ne)+" 0 0 1 "+(j.leftFullExtent+ne)+" "+j.verticalRightInnerExtent:ee?oe+=" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightLargeArcRadius-ne)+" 0 0 0 "+(j.rightFullExtent-ne-X-(j.rightLargeArcRadius-ne))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius-ne))+" L "+(j.leftFullExtent+ne+(j.rightLargeArcRadius-ne))+" "+(j.verticalRightInnerExtent-(j.rightLargeArcRadius-ne))+" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftLargeArcRadius-ne)+" 0 0 0 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent:oe+=" A "+(j.rightLargeArcRadius+ne)+" "+(j.rightLargeArcRadius+ne)+" 0 0 1 "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent-ne)+" L "+j.leftInnerExtent+" "+(j.verticalFullExtent-ne)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftLargeArcRadius+ne)+" 0 0 1 "+(j.leftFullExtent+ne)+" "+j.verticalLeftInnerExtent,oe+=" L "+(j.leftFullExtent+ne)+" "+(j.sourceY-j.leftSmallArcRadius)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 1 "+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 0 "+(j.leftFullExtent-ne)+" "+(j.sourceY-j.leftSmallArcRadius)+" L "+(j.leftFullExtent-ne)+" "+j.verticalLeftInnerExtent,ee&&re?oe+=" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 0 "+(j.leftFullExtent-ne)+" "+(j.verticalFullExtent+ne)+"L"+(j.rightFullExtent+ne-X)+" "+(j.verticalFullExtent+ne)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 0 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:ee?oe+=" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 1 "+(j.leftFullExtent+ne)+" "+(j.verticalFullExtent-ne)+" L "+(j.rightFullExtent-ne-X)+" "+(j.verticalFullExtent-ne)+" A "+(j.leftLargeArcRadius+ne)+" "+(j.leftSmallArcRadius+ne)+" 0 0 1 "+(j.rightFullExtent+ne-X)+" "+j.verticalRightInnerExtent:oe+=" A "+(j.leftLargeArcRadius-ne)+" "+(j.leftLargeArcRadius-ne)+" 0 0 0 "+j.leftInnerExtent+" "+(j.verticalFullExtent+ne)+" L "+(j.rightInnerExtent-X)+" "+(j.verticalFullExtent+ne)+" A "+(j.rightLargeArcRadius-ne)+" "+(j.rightLargeArcRadius-ne)+" 0 0 0 "+(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 0 "+(j.rightInnerExtent-X)+" "+(j.targetY-ne)+" L "+(j.targetX-X)+" "+(j.targetY-ne)+(X>0?" 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;re<ee.node.childrenNodes.length;re++)ee.node.childrenNodes[re].x=ee.node.x,ee.node.childrenNodes[re].y=ee.node.y;ee.arrangement!=="snap"&&Q(ee,ne)}});J.on(".drag",null).call(j)}function N(J,X,oe,ne){H(oe.graph.nodes);var j=oe.graph.nodes.filter(function(ee){return ee.originalX===oe.node.originalX}).filter(function(ee){return!ee.partOfGroup});oe.forceLayouts[X]=v.forceSimulation(j).alphaDecay(0).force("collide",v.forceCollide().radius(function(ee){return ee.dy/2+oe.nodePad/2}).strength(1).iterations(t.forceIterations)).force("constrain",W(J,X,j,oe,ne)).stop()}function U(J,X,oe,ne,j){window.requestAnimationFrame(function ee(){var re;for(re=0;re<t.forceTicksPerFrame;re++)oe.forceLayouts[ne].tick();var ce=oe.graph.nodes;if($(ce),oe.sankey.update(oe.graph),L(J.filter(he(oe)),X),oe.forceLayouts[ne].alpha()>0)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;re<oe.length;re++){var ce=oe[re];ce===ne.interactionState.dragInProgress?(ce.x=ce.lastDraggedX,ce.y=ce.lastDraggedY):(ce.vx=(ce.originalX-ce.x)/t.forceTicksPerFrame,ce.y=Math.min(ne.size-ce.dy/2,Math.max(ce.dy/2,ce.y))),ee=Math.max(ee,Math.abs(ce.vx),Math.abs(ce.vy))}!ne.interactionState.dragInProgress&&ee<.1&&ne.forceLayouts[X].alpha()>0&&ne.forceLayouts[X].alpha(0)}}function Q(J,X){for(var oe=[],ne=[],j=0;j<J.graph.nodes.length;j++){var ee=(J.graph.nodes[j].x0+J.graph.nodes[j].x1)/2,re=(J.graph.nodes[j].y0+J.graph.nodes[j].y1)/2;oe.push(ee/J.figure.width),ne.push(re/J.figure.height)}l.call("_guiRestyle",X,{"node.x":[oe],"node.y":[ne]},J.trace.index).then(function(){X._fullLayout._dragCover&&X._fullLayout._dragCover.remove()})}function ue(J){var X=[],oe;for(oe=0;oe<J.length;oe++)J[oe].originalX=(J[oe].x0+J[oe].x1)/2,J[oe].originalY=(J[oe].y0+J[oe].y1)/2,X.indexOf(J[oe].originalX)===-1&&X.push(J[oe].originalX);for(X.sort(function(ne,j){return ne-j}),oe=0;oe<J.length;oe++)J[oe].originalLayerIndex=X.indexOf(J[oe].originalX),J[oe].originalLayer=J[oe].originalLayerIndex/(X.length-1)}function se(J){J.lastDraggedX=J.x0+J.dx/2,J.lastDraggedY=J.y0+J.dy/2}function he(J){return function(X){return X.node.originalX===J.node.originalX}}function H(J){for(var X=0;X<J.length;X++)J[X].y=(J[X].y0+J[X].y1)/2,J[X].x=(J[X].x0+J[X].x1)/2}function $(J){for(var X=0;X<J.length;X++)J[X].y0=J[X].y-J[X].dy/2,J[X].y1=J[X].y0+J[X].dy,J[X].x0=J[X].x-J[X].dx/2,J[X].x1=J[X].x0+J[X].dx}q.exports=function(J,X,oe,ne,j){var ee=J._context.staticPlot,re=!1;n.ensureSingle(J._fullLayout._infolayer,"g","first-render",function(){re=!0});var ce=J._fullLayout._dragCover,be=oe.filter(function(ut){return d(ut).trace.visible}).map(g.bind(null,ne)),Ae=X.selectAll("."+t.cn.sankey).data(be,h);Ae.exit().remove(),Ae.enter().append("g").classed(t.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",ee?"none":"auto").attr("transform",B),Ae.each(function(ut,Me){J._fullData[Me]._sankey=ut;var _e="bgsankey-"+ut.trace.uid+"-"+Me;n.ensureSingle(J._fullLayout._draggers,"rect",_e),J._fullData[Me]._bgRect=A.select("."+_e),J._fullData[Me]._bgRect.style("pointer-events",ee?"none":"all").attr("width",ut.width).attr("height",ut.height).attr("x",ut.translateX).attr("y",ut.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),Ae.transition().ease(t.ease).duration(t.duration).attr("transform",B);var ze=Ae.selectAll("."+t.cn.sankeyLinks).data(m,h);ze.enter().append("g").classed(t.cn.sankeyLinks,!0).style("fill","none");var Re=ze.selectAll("."+t.cn.sankeyLink).data(function(ut){var Me=ut.graph.links;return Me.filter(function(_e){return _e.value}).map(b.bind(null,ut))},h);Re.enter().append("path").classed(t.cn.sankeyLink,!0).call(O,Ae,j.linkEvents),Re.style("stroke",function(ut){return F(ut)?i.tinyRGB(r(ut.linkLineColor)):ut.tinyColorHue}).style("stroke-opacity",function(ut){return F(ut)?i.opacity(ut.linkLineColor):ut.tinyColorAlpha}).style("fill",function(ut){return ut.tinyColorHue}).style("fill-opacity",function(ut){return ut.tinyColorAlpha}).style("stroke-width",function(ut){return F(ut)?ut.linkLineWidth:1}).attr("d",u()),Re.style("opacity",function(){return J._context.staticPlot||re||ce?1:0}).transition().ease(t.ease).duration(t.duration).style("opacity",1),Re.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var We=Ae.selectAll("."+t.cn.sankeyNodeSet).data(m,h);We.enter().append("g").classed(t.cn.sankeyNodeSet,!0),We.style("cursor",function(ut){switch(ut.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var it=We.selectAll("."+t.cn.sankeyNode).data(function(ut){var Me=ut.graph.nodes;return ue(Me),Me.map(y.bind(null,ut))},h);it.enter().append("g").classed(t.cn.sankeyNode,!0).call(f).style("opacity",function(ut){return(J._context.staticPlot||re)&&!ut.partOfGroup?1:0}),it.call(O,Ae,j.nodeEvents).call(I,Re,j,J),it.transition().ease(t.ease).duration(t.duration).call(f).style("opacity",function(ut){return ut.partOfGroup?0:1}),it.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var ot=it.selectAll("."+t.cn.nodeRect).data(m);ot.enter().append("rect").classed(t.cn.nodeRect,!0).call(z),ot.style("stroke-width",function(ut){return ut.nodeLineWidth}).style("stroke",function(ut){return i.tinyRGB(r(ut.nodeLineColor))}).style("stroke-opacity",function(ut){return i.opacity(ut.nodeLineColor)}).style("fill",function(ut){return ut.tinyColorHue}).style("fill-opacity",function(ut){return ut.tinyColorAlpha}),ot.transition().ease(t.ease).duration(t.duration).call(z);var tt=it.selectAll("."+t.cn.nodeLabel).data(m);tt.enter().append("text").classed(t.cn.nodeLabel,!0).style("cursor","default"),tt.attr("data-notex",1).text(function(ut){return ut.node.label}).each(function(ut){var Me=A.select(this);a.font(Me,ut.textFont),T.convertToTspans(Me,J)}).attr("text-anchor",function(ut){return ut.horizontal&&ut.left?"end":"start"}).attr("transform",function(ut){var Me=A.select(this),_e=T.lineCount(Me),fe=ut.textFont.size*((_e-1)*S-w),Fe=ut.nodeLineWidth/2+E,rt=((ut.horizontal?ut.visibleHeight:ut.visibleWidth)-fe)/2;ut.horizontal&&(ut.left?Fe=-Fe:Fe+=ut.visibleWidth);var st=ut.horizontal?"":"scale(-1,1)"+s(90);return o(ut.horizontal?Fe:rt,ut.horizontal?rt:Fe)+st}),tt.transition().ease(t.ease).duration(t.duration)}}}),jC=Ze({"src/traces/sankey/plot.js"(Z,q){"use strict";var v=Oi(),x=ca(),A=x.numberFormat,M=vG(),e=ef(),t=Yi(),r=UC().cn,i=x._;function a(w){return w!==""}function n(w,S){return w.filter(function(E){return E.key===S.traceId})}function o(w,S){v.select(w).select("path").style("fill-opacity",S),v.select(w).select("rect").style("fill-opacity",S)}function s(w){v.select(w).select("text.name").style("fill","black")}function c(w){return function(S){return w.node.sourceLinks.indexOf(S.link)!==-1||w.node.targetLinks.indexOf(S.link)!==-1}}function h(w){return function(S){return S.node.sourceLinks.indexOf(w.link)!==-1||S.node.targetLinks.indexOf(w.link)!==-1}}function m(w,S,E){S&&E&&n(E,S).selectAll("."+r.sankeyLink).filter(c(S)).call(T.bind(0,S,E,!1))}function d(w,S,E){S&&E&&n(E,S).selectAll("."+r.sankeyLink).filter(c(S)).call(l.bind(0,S,E,!1))}function T(w,S,E,g){g.style("fill",function(b){if(!b.link.concentrationscale)return b.tinyColorHoverHue}).style("fill-opacity",function(b){if(!b.link.concentrationscale)return b.tinyColorHoverAlpha}),g.each(function(b){var p=b.link.label;p!==""&&n(S,w).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverHue}).style("fill-opacity",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverAlpha})}),E&&n(S,w).selectAll("."+r.sankeyNode).filter(h(w)).call(m)}function l(w,S,E,g){g.style("fill",function(b){return b.tinyColorHue}).style("fill-opacity",function(b){return b.tinyColorAlpha}),g.each(function(b){var p=b.link.label;p!==""&&n(S,w).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){return u.tinyColorHue}).style("fill-opacity",function(u){return u.tinyColorAlpha})}),E&&n(S,w).selectAll(r.sankeyNode).filter(h(w)).call(d)}function _(w,S){var E=w.hoverlabel||{},g=x.nestedProperty(E,S).get();return Array.isArray(g)?!1:g}q.exports=function(S,E){for(var g=S._fullLayout,b=g._paper,p=g._size,u=0;u<S._fullData.length;u++)if(S._fullData[u].visible&&S._fullData[u].type===r.sankey&&!S._fullData[u]._viewInitial){var y=S._fullData[u].node;S._fullData[u]._viewInitial={node:{groups:y.groups.slice(),x:y.x.slice(),y:y.y.slice()}}}var f=function(se,he){var H=he.link;H.originalEvent=v.event,S._hoverdata=[H],e.click(S,{target:!0})},P=function(se,he,H){S._fullLayout.hovermode!==!1&&(v.select(se).call(T.bind(0,he,H,!0)),he.link.trace.link.hoverinfo!=="skip"&&(he.link.fullData=he.link.trace,S.emit("plotly_hover",{event:v.event,points:[he.link]})))},L=i(S,"source:")+" ",z=i(S,"target:")+" ",F=i(S,"concentration:")+" ",B=i(S,"incoming flow count:")+" ",O=i(S,"outgoing flow count:")+" ",I=function(se,he){if(S._fullLayout.hovermode===!1)return;var H=he.link.trace.link;if(H.hoverinfo==="none"||H.hoverinfo==="skip")return;var $=[];function J(ce){var be,Ae;ce.circular?(be=(ce.circularPathData.leftInnerExtent+ce.circularPathData.rightInnerExtent)/2,Ae=ce.circularPathData.verticalFullExtent):(be=(ce.source.x1+ce.target.x0)/2,Ae=(ce.y0+ce.y1)/2);var ze=[be,Ae];return ce.trace.orientation==="v"&&ze.reverse(),ze[0]+=he.parent.translateX,ze[1]+=he.parent.translateY,ze}for(var X=0,oe=0;oe<he.flow.links.length;oe++){var ne=he.flow.links[oe];if(!(S._fullLayout.hovermode==="closest"&&he.link.pointNumber!==ne.pointNumber)){he.link.pointNumber===ne.pointNumber&&(X=oe),ne.fullData=ne.trace,H=he.link.trace.link;var j=J(ne),ee={valueLabel:A(he.valueFormat)(ne.value)+he.valueSuffix};$.push({x:j[0],y:j[1],name:ee.valueLabel,text:[ne.label||"",L+ne.source.label,z+ne.target.label,ne.concentrationscale?F+A("%0.2f")(ne.flow.labelConcentration):""].filter(a).join("<br>"),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<j[0]?"right":"left",hovertemplate:H.hovertemplate,hovertemplateLabels:ee,eventData:[ne]})}}var re=e.loneHover($,{container:g._hoverlayer.node(),outerContainer:g._paper.node(),gd:S,anchorIndex:X});re.each(function(){var ce=this;he.link.concentrationscale||o(ce,.65),s(ce)})},N=function(se,he,H){S._fullLayout.hovermode!==!1&&(v.select(se).call(l.bind(0,he,H,!0)),he.link.trace.link.hoverinfo!=="skip"&&(he.link.fullData=he.link.trace,S.emit("plotly_unhover",{event:v.event,points:[he.link]})),e.loneUnhover(g._hoverlayer.node()))},U=function(se,he,H){var $=he.node;$.originalEvent=v.event,S._hoverdata=[$],v.select(se).call(d,he,H),e.click(S,{target:!0})},W=function(se,he,H){S._fullLayout.hovermode!==!1&&(v.select(se).call(m,he,H),he.node.trace.node.hoverinfo!=="skip"&&(he.node.fullData=he.node.trace,S.emit("plotly_hover",{event:v.event,points:[he.node]})))},Q=function(se,he){if(S._fullLayout.hovermode!==!1){var H=he.node.trace.node;if(!(H.hoverinfo==="none"||H.hoverinfo==="skip")){var $=v.select(se).select("."+r.nodeRect),J=S._fullLayout._paperdiv.node().getBoundingClientRect(),X=$.node().getBoundingClientRect(),oe=X.left-2-J.left,ne=X.right+2-J.left,j=X.top+X.height/4-J.top,ee={valueLabel:A(he.valueFormat)(he.node.value)+he.valueSuffix};he.node.fullData=he.node.trace,S._fullLayout._calcInverseTransform(S);var re=S._fullLayout._invScaleX,ce=S._fullLayout._invScaleY,be=e.loneHover({x0:re*oe,x1:re*ne,y:ce*j,name:A(he.valueFormat)(he.node.value)+he.valueSuffix,text:[he.node.label,B+he.node.targetLinks.length,O+he.node.sourceLinks.length].filter(a).join("<br>"),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;s<o._fullData.length;s++)n(o,s)};function n(o,s){var c=o._fullData[s],h=o._fullLayout,m=h.dragmode,d=h.dragmode==="pan"?"move":"crosshair",T=c._bgRect;if(T&&!(m==="pan"||m==="zoom")){M(T,d);var l={_id:"x",c2p:r.identity,_offset:c._sankey.translateX,_length:c._sankey.width},_={_id:"y",c2p:r.identity,_offset:c._sankey.translateY,_length:c._sankey.height},w={gd:o,element:T.node(),plotinfo:{id:s,xaxis:l,yaxis:_,fillRangeItems:r.noop},subplot:s,xaxes:[l],yaxes:[_],doneFnCompleted:function(S){var E=o._fullData[s],g,b=E.node.groups.slice(),p=[];function u(L){for(var z=E._sankey.graph.nodes,F=0;F<z.length;F++)if(z[F].pointNumber===L)return z[F]}for(var y=0;y<S.length;y++){var f=u(S[y].pointNumber);if(f)if(f.group){for(var P=0;P<f.childrenNodes.length;P++)p.push(f.childrenNodes[P].pointNumber);b[f.pointNumber-E.node._count]=!1}else p.push(f.pointNumber)}g=b.filter(Boolean).concat([p]),i.call("_guiRestyle",o,{"node.groups":[g]},s)}};w.prepFn=function(S,E,g){t(S,E,g,w,m)},e.init(w)}}}}),gG=Ze({"src/traces/sankey/select.js"(Z,q){"use strict";q.exports=function(x,A){for(var M=x.cd,e=[],t=M[0].trace,r=t._sankey.graph.nodes,i=0;i<r.length;i++){var a=r[i];if(!a.partOfGroup){var n=[(a.x0+a.x1)/2,(a.y0+a.y1)/2];t.orientation==="v"&&n.reverse(),A&&A.contains(n,!1,i,x)&&e.push({pointNumber:a.pointNumber})}}return e}}}),yG=Ze({"src/traces/sankey/index.js"(Z,q){"use strict";q.exports={attributes:OC(),supplyDefaults:iG(),calc:oG(),plot:jC(),moduleType:"trace",name:"sankey",basePlotModule:mG(),selectPoints:gG(),categories:["noOpacity"],meta:{}}}}),_G=Ze({"lib/sankey.js"(Z,q){"use strict";q.exports=yG()}}),xG=Ze({"src/traces/indicator/base_plot.js"(Z){"use strict";var q=xc();Z.name="indicator",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)}}}),VC=Ze({"src/traces/indicator/attributes.js"(Z,q){"use strict";var v=rs().extendFlat,x=rs().extendDeep,A=pc().overrideAll,M=tc(),e=oh(),t=bc().attributes,r=Wh(),i=Dl().templatedArray,a=d1(),n=Qc().descriptionOnlyNumbers,o=M({editType:"plot",colorEditType:"plot"}),s={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:e.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},c={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},h=i("step",x({},s,{range:c}));q.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:t({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:v({},o,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:n("value")},font:v({},o,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:n("value")},increasing:{symbol:{valType:"string",dflt:a.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:a.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:a.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:a.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:v({},o,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:x({},s,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:e.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:A({range:c,visible:v({},r.visible,{dflt:!0}),tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:v({},r.ticks,{dflt:"outside"}),ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:M({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,editType:"plot"},"plot"),steps:h,threshold:{line:{color:v({},s.line.color,{}),width:v({},s.line.width,{dflt:1}),editType:"plot"},thickness:v({},s.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}}),qC=Ze({"src/traces/indicator/constants.js"(Z,q){"use strict";q.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),bG=Ze({"src/traces/indicator/defaults.js"(Z,q){"use strict";var v=ca(),x=VC(),A=bc().defaults,M=Dl(),e=fp(),t=qC(),r=Xg(),i=t1(),a=$m(),n=Qm();function o(c,h,m,d){function T(I,N){return v.coerce(c,h,x,I,N)}A(h,d,T),T("mode"),h._hasNumber=h.mode.indexOf("number")!==-1,h._hasDelta=h.mode.indexOf("delta")!==-1,h._hasGauge=h.mode.indexOf("gauge")!==-1;var l=T("value");h._range=[0,typeof l=="number"?1.5*l:1];var _=new Array(2),w;if(h._hasNumber){T("number.valueformat");var S=v.extendFlat({},d.font);S.size=void 0,v.coerceFont(T,"number.font",S),h.number.font.size===void 0&&(h.number.font.size=t.defaultNumberFontSize,_[0]=!0),T("number.prefix"),T("number.suffix"),w=h.number.font.size}var E;if(h._hasDelta){var g=v.extendFlat({},d.font);g.size=void 0,v.coerceFont(T,"delta.font",g),h.delta.font.size===void 0&&(h.delta.font.size=(h._hasNumber?.5:1)*(w||t.defaultNumberFontSize),_[1]=!0),T("delta.reference",h.value),T("delta.relative"),T("delta.valueformat",h.delta.relative?"2%":""),T("delta.increasing.symbol"),T("delta.increasing.color"),T("delta.decreasing.symbol"),T("delta.decreasing.color"),T("delta.position"),T("delta.prefix"),T("delta.suffix"),E=h.delta.font.size}h._scaleNumbers=(!h._hasNumber||_[0])&&(!h._hasDelta||_[1])||!1;var b=v.extendFlat({},d.font);b.size=.25*(w||E||t.defaultNumberFontSize),v.coerceFont(T,"title.font",b),T("title.text");var p,u,y,f;function P(I,N){return v.coerce(p,u,x.gauge,I,N)}function L(I,N){return v.coerce(y,f,x.gauge.axis,I,N)}if(h._hasGauge){p=c.gauge,p||(p={}),u=M.newContainer(h,"gauge"),P("shape");var z=h._isBullet=h.gauge.shape==="bullet";z||T("title.align","center");var F=h._isAngular=h.gauge.shape==="angular";F||T("align","center"),P("bgcolor",d.paper_bgcolor),P("borderwidth"),P("bordercolor"),P("bar.color"),P("bar.line.color"),P("bar.line.width");var B=t.valueThickness*(h.gauge.shape==="bullet"?.5:1);P("bar.thickness",B),e(p,u,{name:"steps",handleItemDefaults:s}),P("threshold.value"),P("threshold.thickness"),P("threshold.line.width"),P("threshold.line.color"),y={},p&&(y=p.axis||{}),f=M.newContainer(u,"axis"),L("visible"),h._range=L("range",h._range);var O={font:d.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};r(y,f,L,"linear"),n(y,f,L,"linear",O),a(y,f,L,"linear",O),i(y,f,L,O)}else T("title.align","center"),T("align","center"),h._isAngular=h._isBullet=!1;h._length=null}function s(c,h){function m(d,T){return v.coerce(c,h,x.gauge.steps,d,T)}m("color"),m("line.color"),m("line.width"),m("range"),m("thickness")}q.exports={supplyDefaults:o}}}),wG=Ze({"src/traces/indicator/calc.js"(Z,q){"use strict";function v(x,A){var M=[],e=A.value;typeof A._lastValue!="number"&&(A._lastValue=A.value);var t=A._lastValue,r=t;return A._hasDelta&&typeof A.delta.reference=="number"&&(r=A.delta.reference),M[0]={y:e,lastY:t,delta:e-r,relativeDelta:(e-r)/r},M}q.exports={calc:v}}}),TG=Ze({"src/traces/indicator/plot.js"(Z,q){"use strict";var v=Oi(),x=(h0(),ih(fg)).interpolate,A=(h0(),ih(fg)).interpolateNumber,M=ca(),e=M.strScale,t=M.strTranslate,r=M.rad2deg,i=mh().MID_SHIFT,a=as(),n=qC(),o=fu(),s=Wo(),c=z_(),h=R2(),m=Wh(),d=Yi(),T={left:"start",center:"middle",right:"end"},l={left:0,center:.5,right:1},_=/[yzafpnµmkMGTPEZY]/;function w(z){return z&&z.duration>0}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<i;s++)o.push(s);t("columnorder",o)}q.exports=function(t,r,i,a){function n(o,s){return v.coerce(t,r,x,o,s)}A(r,a,n),n("columnwidth"),n("header.values"),n("header.format"),n("header.align"),n("header.prefix"),n("header.suffix"),n("header.height"),n("header.line.width"),n("header.line.color"),n("header.fill.color"),v.coerceFont(n,"header.font",a.font),M(r,n),n("cells.values"),n("cells.format"),n("cells.align"),n("cells.prefix"),n("cells.suffix"),n("cells.height"),n("cells.line.width"),n("cells.line.color"),n("cells.fill.color"),v.coerceFont(n,"cells.font",a.font),r._length=null}}}),EG=Ze({"src/traces/table/calc.js"(Z,q){"use strict";var v=Cv().wrap;q.exports=function(){return v({})}}}),HC=Ze({"src/traces/table/constants.js"(Z,q){"use strict";q.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",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<h.length;d++)m=Math.max(m,t(h[d]));return m}return h}function r(h,m){return h+m}function i(h){var m=h.slice(),d=1/0,T=0,l;for(l=0;l<m.length;l++)M(m[l])?m[l]=Array.from(m[l]):e(m[l])||(m[l]=[m[l]]),d=Math.min(d,m[l].length),T=Math.max(T,m[l].length);if(d!==T)for(l=0;l<m.length;l++){var _=T-m[l].length;_&&(m[l]=m[l].concat(a(_)))}return m}function a(h){for(var m=new Array(h),d=0;d<h;d++)m[d]="";return m}function n(h){return h.calcdata.columns.reduce(function(m,d){return d.xIndex<h.xIndex?m+d.columnWidth:m},0)}function o(h,m){var d=Object.keys(h);return d.map(function(T){return x({},h[T],{auxiliaryBlocks:m})})}function s(h,m){for(var d={},T,l=0,_=0,w=c(),S=0,E=0,g=0;g<h.length;g++)T=h[g],w.rows.push({rowIndex:g,rowHeight:T}),_+=T,(_>=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(/<br>/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(/<a href=/ig,"<a_href="):Fe,Lt=Qe.split(v.wrapSplitCharacter),kt=v.wrapSplitCharacter===" "?Lt.map(function(qt){return qt.replace(/<a_href=/ig,"<a href=")}):Lt;Ae.fragments=kt.map(function(qt){return{text:qt,width:null}}),Ae.fragments.push({fragment:v.wrapSpacer,width:null}),st=kt.join(v.lineBreaker)+v.lineBreaker+v.wrapSpacer}else delete Ae.fragments,st=Fe;return st}).attr("dy",function(Ae){return Ae.needsConvertToTspans?0:"0.75em"}).each(function(Ae){var ze=this,Re=x.select(ze),We=Ae.wrappingNeeded?se:he;Ae.needsConvertToTspans?r.convertToTspans(Re,be,We(ce,ze,re,be,Ae)):x.select(ze.parentNode).attr("transform",function(it){return a(H(it),v.cellPad)}).attr("text-anchor",function(it){return{left:"start",center:"middle",right:"end"}[it.align]})})}function P(ee){return typeof ee=="string"&&ee.match(v.latexCheck)}function L(ee){return ee.indexOf(v.wrapSplitCharacter)!==-1}function z(ee,re,ce){var be=re.gdColumnsOriginalOrder;re.gdColumns.sort(function(Ae,ze){return ce[be.indexOf(Ae)]-ce[be.indexOf(ze)]}),re.columnorder=ce,ee.emit("plotly_restyle")}function F(ee,re,ce){if(A.isArrayOrTypedArray(ee)){var be=ee[Math.min(re,ee.length-1)];return A.isArrayOrTypedArray(be)?be[Math.min(ce,be.length-1)]:be}else return ee}function B(ee,re,ce){ee.transition().ease(v.releaseTransitionEase).duration(v.releaseTransitionDuration).attr("transform",a(re.x,ce))}function O(ee){return ee.type==="cells"}function I(ee){return ee.type==="header"}function N(ee){var re=ee.rowBlocks.length?ee.rowBlocks[0].auxiliaryBlocks:[];return re.reduce(function(ce,be){return ce+X(be,1/0)},0)}function U(ee,re,ce){for(var be=[],Ae=0,ze=0;ze<ee.length;ze++){for(var Re=ee[ze],We=Re.rows,it=0,ot=0;ot<We.length;ot++)it+=We[ot].rowHeight;Re.allRowsHeight=it;var tt=Ae+it,ut=re,Me=ut+ce;ut<tt&&Me>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;be<ee.rows.length&&ee.rows[be].rowIndex<re;be++)ce+=ee.rows[be].rowHeight;return ce}function oe(ee){var re=ee.allRowsHeight;if(re!==void 0)return re;for(var ce=0,be=0;be<ee.rows.length;be++)ce+=ee.rows[be].rowHeight;return ee.allRowsHeight=ce,ce}function ne(ee){return ee.rowBlocks[ee.page]}function j(ee,re){return ee.rows[re-ee.firstRowIndex]}}}),LG=Ze({"src/traces/table/base_plot.js"(Z){"use strict";var q=Hh().getModuleCalcData,v=WC(),x="table";Z.name=x,Z.plot=function(A){var M=q(A.calcdata,x)[0];M.length&&v(A,M)},Z.clean=function(A,M,e,t){var r=t._has&&t._has(x),i=M._has&&M._has(x);r&&!i&&t._paperdiv.selectAll(".table").remove()}}}),PG=Ze({"src/traces/table/index.js"(Z,q){"use strict";q.exports={attributes:GC(),supplyDefaults:MG(),calc:EG(),plot:WC(),moduleType:"trace",name:"table",basePlotModule:LG(),categories:["noOpacity"],meta:{}}}}),IG=Ze({"lib/table.js"(Z,q){"use strict";q.exports=PG()}}),RG=Ze({"src/traces/carpet/axis_attributes.js"(Z,q){"use strict";var v=tc(),x=oh(),A=Wh(),M=Qc().descriptionWithDates,e=pc().overrideAll,t=Gh().dash,r=rs().extendFlat;q.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:v({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:A.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:r({},A.labelalias,{editType:"calc"}),tickfont:v({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:M("tick label")},tickformatstops:e(A.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:x.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:r({},t,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:r({},t,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:x.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}}),PT=Ze({"src/traces/carpet/attributes.js"(Z,q){"use strict";var v=tc(),x=RG(),A=oh(),M=v({editType:"calc"}),e=tf().zorder;M.family.dflt='"Open Sans", verdana, arial, sans-serif',M.size.dflt=12,M.color.dflt=A.defaultLine,q.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:x,baxis:x,font:M,color:{valType:"color",dflt:A.defaultLine,editType:"plot"},zorder:e}}}),DG=Ze({"src/traces/carpet/xy_defaults.js"(Z,q){"use strict";var v=ca().isArray1D;q.exports=function(A,M,e){var t=e("x"),r=t&&t.length,i=e("y"),a=i&&i.length;if(!r&&!a)return!1;if(M._cheater=!t,(!r||v(t))&&(!a||v(i))){var n=r?t.length:1/0;a&&(n=Math.min(n,i.length)),M.a&&M.a.length&&(n=Math.min(n,M.a.length)),M.b&&M.b.length&&(n=Math.min(n,M.b.length)),M._length=n}else M._length=null;return!0}}}),zG=Ze({"src/traces/carpet/axis_defaults.js"(Z,q){"use strict";var v=PT(),x=Yi().addOpacity,A=oo(),M=ca(),e=Xg(),t=$m(),r=Qm(),i=I2(),a=wv(),n=a1();q.exports=function(c,h,m){var d=m.letter,T=m.font||{},l=v[d+"axis"];function _(U,W){return M.coerce(c,h,l,U,W)}function w(U,W){return M.coerce2(c,h,l,U,W)}m.name&&(h._name=m.name,h._id=m.name),_("autotypenumbers",m.autotypenumbersDflt);var S=_("type");if(S==="-"&&(m.data&&o(h,m.data),h.type==="-"?h.type="linear":S=c.type=h.type),_("smoothing"),_("cheatertype"),_("showticklabels"),_("labelprefix",d+" = "),_("labelsuffix"),_("showtickprefix"),_("showticksuffix"),_("separatethousands"),_("tickformat"),_("exponentformat"),_("minexponent"),_("showexponent"),_("categoryorder"),_("tickmode"),_("tickvals"),_("ticktext"),_("tick0"),_("dtick"),h.tickmode==="array"&&(_("arraytick0"),_("arraydtick")),_("labelpadding"),h._hovertitle=d,S==="date"){var E=A.getComponentMethod("calendars","handleDefaults");E(c,h,"calendar",m.calendar)}a(h,m.fullLayout),h.c2p=M.identity;var g=_("color",m.dfltColor),b=g===c.color?g:T.color,p=_("title.text");p&&(M.coerceFont(_,"title.font",T,{overrideDflt:{size:M.bigFont(T.size),color:b}}),_("title.offset")),_("tickangle");var u=_("autorange",!h.isValidRange(c.range));u&&_("rangemode"),_("range"),h.cleanRange(),_("fixedrange"),e(c,h,_,S),r(c,h,_,S,m),t(c,h,_,S,m),i(c,h,_,{data:m.data,dataAttr:d});var y=w("gridcolor",x(g,.3)),f=w("gridwidth"),P=w("griddash"),L=_("showgrid");L||(delete h.gridcolor,delete h.gridwidth,delete h.griddash);var z=w("startlinecolor",g),F=w("startlinewidth",f),B=_("startline",h.showgrid||!!z||!!F);B||(delete h.startlinecolor,delete h.startlinewidth);var O=w("endlinecolor",g),I=w("endlinewidth",f),N=_("endline",h.showgrid||!!O||!!I);return N||(delete h.endlinecolor,delete h.endlinewidth),L?(_("minorgridcount"),_("minorgridwidth",f),_("minorgriddash",P),_("minorgridcolor",x(y,.06)),h.minorgridcount||(delete h.minorgridwidth,delete h.minorgriddash,delete h.minorgridcolor)):(delete h.gridcolor,delete h.gridwidth,delete h.griddash),h.showticklabels==="none"&&(delete h.tickfont,delete h.tickangle,delete h.showexponent,delete h.exponentformat,delete h.minexponent,delete h.tickformat,delete h.showticksuffix,delete h.showtickprefix),h.showticksuffix||delete h.ticksuffix,h.showtickprefix||delete h.tickprefix,_("tickmode"),h};function o(s,c){if(s.type==="-"){var h=s._id,m=h.charAt(0),d=m+"calendar",T=s[d];s.type=n(c,T,{autotypenumbers:s.autotypenumbers})}}}}),FG=Ze({"src/traces/carpet/ab_defaults.js"(Z,q){"use strict";var v=zG(),x=Dl();q.exports=function(e,t,r,i,a){var n=i("a");n||(i("da"),i("a0"));var o=i("b");o||(i("db"),i("b0")),A(e,t,r,a)};function A(M,e,t,r){var i=["aaxis","baxis"];i.forEach(function(a){var n=a.charAt(0),o=M[a]||{},s=x.newContainer(e,a),c={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:n+"axis",letter:n,font:e.font,name:a,data:M[n],calendar:e.calendar,dfltColor:r,bgColor:t.paper_bgcolor,autotypenumbersDflt:t.autotypenumbers,fullLayout:t};v(o,s,c),s._categories=s._categories||[],!M[a]&&o.type!=="-"&&(M[a]={type:o.type})})}}}),OG=Ze({"src/traces/carpet/defaults.js"(Z,q){"use strict";var v=ca(),x=DG(),A=FG(),M=PT(),e=oh();q.exports=function(r,i,a,n){function o(h,m){return v.coerce(r,i,M,h,m)}i._clipPathId="clip"+i.uid+"carpet";var s=o("color",e.defaultLine);if(v.coerceFont(o,"font",n.font),o("carpet"),A(r,i,n,o,s),!i.a||!i.b){i.visible=!1;return}i.a.length<3&&(i.aaxis.smoothing=0),i.b.length<3&&(i.baxis.smoothing=0);var c=x(r,i,o);c||(i.visible=!1),i._cheater&&o("cheaterslope"),o("zorder")}}}),XC=Ze({"src/traces/carpet/map_1d_array.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray;q.exports=function(A,M,e){var t;for(v(A)?A.length>M.length&&(A=A.slice(0,M.length)):A=[],t=0;t<M.length;t++)A[t]=e(M[t]);return A}}}),ZC=Ze({"src/traces/carpet/makepath.js"(Z,q){"use strict";q.exports=function(x,A,M){if(x.length===0)return"";var e,t=[],r=M?3:1;for(e=0;e<x.length;e+=r)t.push(x[e]+","+A[e]),M&&e<x.length-r&&(t.push("C"),t.push([x[e+1]+","+A[e+1],x[e+2]+","+A[e+2]+" "].join(" ")));return t.join(M?"":"L")}}}),BG=Ze({"src/traces/carpet/orient_text.js"(Z,q){"use strict";q.exports=function(x,A,M,e,t,r){var i=t[0]*x.dpdx(A),a=t[1]*x.dpdy(M),n=1,o=1;if(r){var s=Math.sqrt(t[0]*t[0]+t[1]*t[1]),c=Math.sqrt(r[0]*r[0]+r[1]*r[1]),h=(t[0]*r[0]+t[1]*r[1])/s/c;o=Math.max(0,h)}var m=Math.atan2(a,i)*180/Math.PI;return m<-90?(m+=180,n=-n):m>90&&(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;u<P.length;u++)g=P[u],b=A([],g.x,S.c2p),p=A([],g.y,E.c2p),L.push(M(b,p,g.bicubic));var z="M"+L.join("L")+"Z";y.attr("id",l._clipPathId),f.attr("d",z)}function s(l,_,w,S,E,g,b){var p="const-"+E+"-lines",u=w.selectAll("."+p).data(g);u.enter().append("path").classed(p,!0).style("vector-effect",b?"none":"non-scaling-stroke"),u.each(function(y){var f=y,P=f.x,L=f.y,z=A([],P,l.c2p),F=A([],L,_.c2p),B="M"+M(z,F,f.smoothing),O=v.select(this);O.attr("d",B).style("stroke-width",f.width).style("stroke",f.color).style("stroke-dasharray",x.dashStyle(f.dash,f.width)).style("fill","none")}),u.exit().remove()}function c(l,_,w,S,E,g,b,p){var u=g.selectAll("text."+p).data(b);u.enter().append("text").classed(p,!0);var y=0,f={};return u.each(function(P,L){var z;if(P.axis.tickangle==="auto")z=e(S,_,w,P.xy,P.dxy);else{var F=(P.axis.tickangle+180)*Math.PI/180;z=e(S,_,w,P.xy,[Math.cos(F),Math.sin(F)])}L||(f={angle:z.angle,flip:z.flip});var B=(P.endAnchor?-1:1)*z.flip,O=v.select(this).attr({"text-anchor":B>0?"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<c;t++)for(o[t]=[],n=m?(m[t]-m[0])*i:t/(c-1),e=0;e<s;e++)a=h?(h[e]-h[0])*r:e/(s-1),d=a-n*M,T=Math.min(d,T),l=Math.max(d,l),o[t][e]=d;var _=1/(l-T),w=-T*_;for(t=0;t<c;t++)for(e=0;e<s;e++)o[t][e]=_*o[t][e]+w;return o}}}),jG=Ze({"src/traces/carpet/array_minmax.js"(Z,q){"use strict";var v=ca().isArrayOrTypedArray;q.exports=function(A){return x(A,0)};function x(A,M){if(!v(A)||M>=10)return null;for(var e=1/0,t=-1/0,r=A.length,i=0;i<r;i++){var a=A[i];if(v(a)){var n=x(a,M+1);n&&(e=Math.min(n[0],e),t=Math.max(n[1],t))}else e=Math.min(a,e),t=Math.max(a,t)}return[e,t]}}}),VG=Ze({"src/traces/carpet/calc_gridlines.js"(Z,q){"use strict";var v=Wo(),x=rs().extendFlat;q.exports=function(M,e,t){var r,i,a,n,o,s,c,h,m,d,T,l,_,w,S=M["_"+e],E=M[e+"axis"],g=E._gridlines=[],b=E._minorgridlines=[],p=E._boundarylines=[],u=M["_"+t],y=M[t+"axis"];E.tickmode==="array"&&(E.tickvals=S.slice());var f=M._xctrl,P=M._yctrl,L=f[0].length,z=f.length,F=M._a.length,B=M._b.length;v.prepTicks(E),E.tickmode==="array"&&delete E.tickvals;var O=E.smoothing?3:1;function I(U){var W,Q,ue,se,he,H,$,J,X,oe,ne,j,ee=[],re=[],ce={};if(e==="b")for(Q=M.b2j(U),ue=Math.floor(Math.max(0,Math.min(B-2,Q))),se=Q-ue,ce.length=B,ce.crossLength=F,ce.xy=function(be){return M.evalxy([],be,Q)},ce.dxy=function(be,Ae){return M.dxydi([],be,ue,Ae,se)},W=0;W<F;W++)H=Math.min(F-2,W),$=W-H,J=M.evalxy([],W,Q),y.smoothing&&W>0&&(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;Q<B;Q++)ue=Math.min(B-2,Q),se=Q-ue,J=M.evalxy([],W,Q),y.smoothing&&Q>0&&(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;W<L;W++)H[W]=f[U*O][W],$[W]=P[U*O][W];else for(Q=Math.max(0,Math.min(F-2,U)),se=Math.min(1,Math.max(0,U-Q)),J.xy=function(X){return M.evalxy([],U,X)},J.dxy=function(X,oe){return M.dxydj([],Q,X,se,oe)},W=0;W<z;W++)H[W]=f[W][U*O],$[W]=P[W][U*O];return J.axisLetter=e,J.axis=E,J.crossAxis=y,J.value=S[U],J.constvar=t,J.index=U,J.x=H,J.y=$,J.smoothing=y.smoothing,J}if(E.tickmode==="array"){for(n=5e-15,o=[Math.floor((S.length-1-E.arraytick0)/E.arraydtick*(1+n)),Math.ceil(-E.arraytick0/E.arraydtick/(1+n))].sort(function(U,W){return U-W}),s=o[0]-1,c=o[1]+1,h=s;h<c;h++)i=E.arraytick0+E.arraydtick*h,!(i<0||i>S.length-1)&&g.push(x(N(i),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(h=s;h<c;h++)if(a=E.arraytick0+E.arraydtick*h,T=Math.min(a+E.arraydtick,S.length-1),!(a<0||a>S.length-1)&&!(T<0||T>S.length-1))for(l=S[a],_=S[T],r=0;r<E.minorgridcount;r++)w=T-a,!(w<=0)&&(d=l+(_-l)*(r+1)/(E.minorgridcount+1)*(E.arraydtick/w),!(d<S[0]||d>S[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;h<c+1;h++)for(m=E.tick0+E.dtick*h,r=0;r<E.minorgridcount;r++)d=m+E.dtick*(r+1)/(E.minorgridcount+1),!(d<S[0]||d>S[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<s.length;t++)n=s[t],["start","both"].indexOf(e.showticklabels)!==-1&&(r=v.tickText(e,n.value),x(r,{prefix:i,suffix:a,endAnchor:!0,xy:n.xy(0),dxy:n.dxy(0,0),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===s.length-1}),o.push(r)),["end","both"].indexOf(e.showticklabels)!==-1&&(r=v.tickText(e,n.value),x(r,{endAnchor:!1,xy:n.xy(n.crossLength-1),dxy:n.dxy(n.crossLength-2,1),axis:n.axis,length:n.crossAxis.length,font:n.axis.tickfont,isFirst:t===0,isLast:t===s.length-1}),o.push(r))}}}),GG=Ze({"src/traces/carpet/calc_clippath.js"(Z,q){"use strict";q.exports=function(x,A,M,e){var t,r,i,a=[],n=!!M.smoothing,o=!!e.smoothing,s=x[0].length-1,c=x.length-1;for(t=0,r=[],i=[];t<=s;t++)r[t]=x[0][t],i[t]=A[0][t];for(a.push({x:r,y:i,bicubic:n}),t=0,r=[],i=[];t<=c;t++)r[t]=x[t][s],i[t]=A[t][s];for(a.push({x:r,y:i,bicubic:o}),t=s,r=[],i=[];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),Q<o-1&&(he=A[ue][Q+1])!==void 0&&(H++,se+=he),ue>0&&(he=A[ue-1][Q])!==void 0&&(H++,se+=he),ue<s-1&&(he=A[ue+1][Q])!==void 0&&(H++,se+=he),se/Math.max(1,H)}var h=0;for(t=0;t<o;t++)for(r=0;r<s;r++)A[r][t]===void 0&&(a.push(t),n.push(r),A[r][t]=c(t,r)),h=Math.max(h,Math.abs(A[r][t]));if(!a.length)return A;var m,d,T,l,_,w,S,E,g,b,p,u=1e-5,y=0,f=100,P=0,L=a.length;do{for(y=0,i=0;i<L;i++){t=a[i],r=n[i];var z=0,F=0,B,O,I,N,U,W;t===0?(U=Math.min(o-1,2),I=M[U],N=M[1],B=A[r][U],O=A[r][1],F+=O+(O-B)*(M[0]-N)/(N-I),z++):t===o-1&&(U=Math.max(0,o-3),I=M[U],N=M[o-2],B=A[r][U],O=A[r][o-2],F+=O+(O-B)*(M[o-1]-N)/(N-I),z++),(t===0||t===o-1)&&r>0&&r<s-1&&(m=e[r+1]-e[r],d=e[r]-e[r-1],F+=(d*A[r+1][t]+m*A[r-1][t])/(d+m),z++),r===0?(W=Math.min(s-1,2),I=e[W],N=e[1],B=A[W][t],O=A[1][t],F+=O+(O-B)*(e[0]-N)/(N-I),z++):r===s-1&&(W=Math.max(0,s-3),I=e[W],N=e[s-2],B=A[W][t],O=A[s-2][t],F+=O+(O-B)*(e[s-1]-N)/(N-I),z++),(r===0||r===s-1)&&t>0&&t<o-1&&(m=M[t+1]-M[t],d=M[t]-M[t-1],F+=(d*A[r][t+1]+m*A[r][t-1])/(d+m),z++),z?F/=z:(T=M[t+1]-M[t],l=M[t]-M[t-1],_=e[r+1]-e[r],w=e[r]-e[r-1],S=T*l*(T+l),E=_*w*(_+w),F=(S*(w*A[r+1][t]+_*A[r-1][t])+E*(l*A[r][t+1]+T*A[r][t-1]))/(E*(l+T)+S*(w+_))),g=F-A[r][t],b=g/h,y+=b*b,p=z?0:.85,A[r][t]+=g*(1+p)}y=Math.sqrt(y)}while(P++<f&&y>u);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;c<b;c++)e[c]=x(e[c],g),t[c]=x(t[c],g);for(s=0,h=0;s<E;s++,h+=n?3:1)for(m=e[h],d=t[h],T=r[s],l=i[s],o=0,c=0;o<S;o++,c+=a?3:1)m[c]=T[o],d[c]=l[o];if(a)for(s=0,h=0;s<E;s++,h+=n?3:1){for(o=1,c=3;o<S-1;o++,c+=3)_=v([r[s][o-1],i[s][o-1]],[r[s][o],i[s][o]],[r[s][o+1],i[s][o+1]],a),e[h][c-1]=_[0][0],t[h][c-1]=_[0][1],e[h][c+1]=_[1][0],t[h][c+1]=_[1][1];w=A([e[h][0],t[h][0]],[e[h][2],t[h][2]],[e[h][3],t[h][3]]),e[h][1]=w[0],t[h][1]=w[1],w=A([e[h][g-1],t[h][g-1]],[e[h][g-3],t[h][g-3]],[e[h][g-4],t[h][g-4]]),e[h][g-2]=w[0],t[h][g-2]=w[1]}if(n)for(c=0;c<g;c++){for(h=3;h<b-3;h+=3)_=v([e[h-3][c],t[h-3][c]],[e[h][c],t[h][c]],[e[h+3][c],t[h+3][c]],n),e[h-1][c]=_[0][0],t[h-1][c]=_[0][1],e[h+1][c]=_[1][0],t[h+1][c]=_[1][1];w=A([e[0][c],t[0][c]],[e[2][c],t[2][c]],[e[3][c],t[3][c]]),e[1][c]=w[0],t[1][c]=w[1],w=A([e[b-1][c],t[b-1][c]],[e[b-3][c],t[b-3][c]],[e[b-4][c],t[b-4][c]]),e[b-2][c]=w[0],t[b-2][c]=w[1]}if(a&&n)for(h=1;h<b;h+=(h+1)%3===0?2:1){for(c=3;c<g-3;c+=3)_=v([e[h][c-3],t[h][c-3]],[e[h][c],t[h][c]],[e[h][c+3],t[h][c+3]],a),e[h][c-1]=.5*(e[h][c-1]+_[0][0]),t[h][c-1]=.5*(t[h][c-1]+_[0][1]),e[h][c+1]=.5*(e[h][c+1]+_[1][0]),t[h][c+1]=.5*(t[h][c+1]+_[1][1]);w=A([e[h][0],t[h][0]],[e[h][2],t[h][2]],[e[h][3],t[h][3]]),e[h][1]=.5*(e[h][1]+w[0]),t[h][1]=.5*(t[h][1]+w[1]),w=A([e[h][g-1],t[h][g-1]],[e[h][g-3],t[h][g-3]],[e[h][g-4],t[h][g-4]]),e[h][g-2]=.5*(e[h][g-2]+w[0]),t[h][g-2]=.5*(t[h][g-2]+w[1])}return[e,t]}}}),YG=Ze({"src/traces/carpet/create_spline_evaluator.js"(Z,q){"use strict";q.exports=function(v,x,A,M,e){var t=x-2,r=A-2;return M&&e?function(i,a,n){i||(i=[]);var o,s,c,h,m,d,T=Math.max(0,Math.min(Math.floor(a),t)),l=Math.max(0,Math.min(Math.floor(n),r)),_=Math.max(0,Math.min(1,a-T)),w=Math.max(0,Math.min(1,n-l));T*=3,l*=3;var S=_*_,E=S*_,g=1-_,b=g*g,p=b*g,u=w*w,y=u*w,f=1-w,P=f*f,L=P*f;for(d=0;d<v.length;d++)m=v[d],o=p*m[l][T]+3*(b*_*m[l][T+1]+g*S*m[l][T+2])+E*m[l][T+3],s=p*m[l+1][T]+3*(b*_*m[l+1][T+1]+g*S*m[l+1][T+2])+E*m[l+1][T+3],c=p*m[l+2][T]+3*(b*_*m[l+2][T+1]+g*S*m[l+2][T+2])+E*m[l+2][T+3],h=p*m[l+3][T]+3*(b*_*m[l+3][T+1]+g*S*m[l+3][T+2])+E*m[l+3][T+3],i[d]=L*o+3*(P*w*s+f*u*c)+y*h;return i}:M?function(i,a,n){i||(i=[]);var o=Math.max(0,Math.min(Math.floor(a),t)),s=Math.max(0,Math.min(Math.floor(n),r)),c=Math.max(0,Math.min(1,a-o)),h=Math.max(0,Math.min(1,n-s)),m,d,T,l,_,w;o*=3;var S=c*c,E=S*c,g=1-c,b=g*g,p=b*g,u=1-h;for(_=0;_<v.length;_++)w=v[_],m=u*w[s][o]+h*w[s+1][o],d=u*w[s][o+1]+h*w[s+1][o+1],T=u*w[s][o+2]+h*w[s+1][o+1],l=u*w[s][o+3]+h*w[s+1][o+1],i[_]=p*m+3*(b*c*d+g*S*T)+E*l;return i}:e?function(i,a,n){i||(i=[]);var o=Math.max(0,Math.min(Math.floor(a),t)),s=Math.max(0,Math.min(Math.floor(n),r)),c=Math.max(0,Math.min(1,a-o)),h=Math.max(0,Math.min(1,n-s)),m,d,T,l,_,w;s*=3;var S=h*h,E=S*h,g=1-h,b=g*g,p=b*g,u=1-c;for(_=0;_<v.length;_++)w=v[_],m=u*w[s][o]+c*w[s][o+1],d=u*w[s+1][o]+c*w[s+1][o+1],T=u*w[s+2][o]+c*w[s+2][o+1],l=u*w[s+3][o]+c*w[s+3][o+1],i[_]=p*m+3*(b*h*d+g*S*T)+E*l;return i}:function(i,a,n){i||(i=[]);var o=Math.max(0,Math.min(Math.floor(a),t)),s=Math.max(0,Math.min(Math.floor(n),r)),c=Math.max(0,Math.min(1,a-o)),h=Math.max(0,Math.min(1,n-s)),m,d,T,l,_=1-h,w=1-c;for(T=0;T<v.length;T++)l=v[T],m=w*l[s][o]+c*l[s][o+1],d=w*l[s+1][o]+c*l[s+1][o+1],i[T]=_*m+h*d;return i}}}}),KG=Ze({"src/traces/carpet/create_i_derivative_evaluator.js"(Z,q){"use strict";q.exports=function(v,x,A){return x&&A?function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c,h;e*=3,t*=3;var m=r*r,d=1-r,T=d*d,l=d*r*2,_=-3*T,w=3*(T-l),S=3*(l-m),E=3*m,g=i*i,b=g*i,p=1-i,u=p*p,y=u*p;for(h=0;h<v.length;h++)c=v[h],a=_*c[t][e]+w*c[t][e+1]+S*c[t][e+2]+E*c[t][e+3],n=_*c[t+1][e]+w*c[t+1][e+1]+S*c[t+1][e+2]+E*c[t+1][e+3],o=_*c[t+2][e]+w*c[t+2][e+1]+S*c[t+2][e+2]+E*c[t+2][e+3],s=_*c[t+3][e]+w*c[t+3][e+1]+S*c[t+3][e+2]+E*c[t+3][e+3],M[h]=y*a+3*(u*i*n+p*g*o)+b*s;return M}:x?function(M,e,t,r,i){M||(M=[]);var a,n,o,s;e*=3;var c=r*r,h=1-r,m=h*h,d=h*r*2,T=-3*m,l=3*(m-d),_=3*(d-c),w=3*c,S=1-i;for(o=0;o<v.length;o++)s=v[o],a=T*s[t][e]+l*s[t][e+1]+_*s[t][e+2]+w*s[t][e+3],n=T*s[t+1][e]+l*s[t+1][e+1]+_*s[t+1][e+2]+w*s[t+1][e+3],M[o]=S*a+i*n;return M}:A?function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c,h;t*=3;var m=i*i,d=m*i,T=1-i,l=T*T,_=l*T;for(c=0;c<v.length;c++)h=v[c],a=h[t][e+1]-h[t][e],n=h[t+1][e+1]-h[t+1][e],o=h[t+2][e+1]-h[t+2][e],s=h[t+3][e+1]-h[t+3][e],M[c]=_*a+3*(l*i*n+T*m*o)+d*s;return M}:function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c=1-i;for(o=0;o<v.length;o++)s=v[o],a=s[t][e+1]-s[t][e],n=s[t+1][e+1]-s[t+1][e],M[o]=c*a+i*n;return M}}}}),JG=Ze({"src/traces/carpet/create_j_derivative_evaluator.js"(Z,q){"use strict";q.exports=function(v,x,A){return x&&A?function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c,h;e*=3,t*=3;var m=r*r,d=m*r,T=1-r,l=T*T,_=l*T,w=i*i,S=1-i,E=S*S,g=S*i*2,b=-3*E,p=3*(E-g),u=3*(g-w),y=3*w;for(h=0;h<v.length;h++)c=v[h],a=b*c[t][e]+p*c[t+1][e]+u*c[t+2][e]+y*c[t+3][e],n=b*c[t][e+1]+p*c[t+1][e+1]+u*c[t+2][e+1]+y*c[t+3][e+1],o=b*c[t][e+2]+p*c[t+1][e+2]+u*c[t+2][e+2]+y*c[t+3][e+2],s=b*c[t][e+3]+p*c[t+1][e+3]+u*c[t+2][e+3]+y*c[t+3][e+3],M[h]=_*a+3*(l*r*n+T*m*o)+d*s;return M}:x?function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c,h;e*=3;var m=i*i,d=m*i,T=1-i,l=T*T,_=l*T;for(c=0;c<v.length;c++)h=v[c],a=h[t+1][e]-h[t][e],n=h[t+1][e+1]-h[t][e+1],o=h[t+1][e+2]-h[t][e+2],s=h[t+1][e+3]-h[t][e+3],M[c]=_*a+3*(l*i*n+T*m*o)+d*s;return M}:A?function(M,e,t,r,i){M||(M=[]);var a,n,o,s;t*=3;var c=1-r,h=i*i,m=1-i,d=m*m,T=m*i*2,l=-3*d,_=3*(d-T),w=3*(T-h),S=3*h;for(o=0;o<v.length;o++)s=v[o],a=l*s[t][e]+_*s[t+1][e]+w*s[t+2][e]+S*s[t+3][e],n=l*s[t][e+1]+_*s[t+1][e+1]+w*s[t+2][e+1]+S*s[t+3][e+1],M[o]=c*a+r*n;return M}:function(M,e,t,r,i){M||(M=[]);var a,n,o,s,c=1-r;for(o=0;o<v.length;o++)s=v[o],a=s[t+1][e]-s[t][e],n=s[t+1][e+1]-s[t][e+1],M[o]=c*a+r*n;return M}}}}),$G=Ze({"src/traces/carpet/set_convert.js"(Z,q){"use strict";var v=WG(),x=m2().findBin,A=ZG(),M=YG(),e=KG(),t=JG();q.exports=function(i){var a=i._a,n=i._b,o=a.length,s=n.length,c=i.aaxis,h=i.baxis,m=a[0],d=a[o-1],T=n[0],l=n[s-1],_=a[a.length-1]-a[0],w=n[n.length-1]-n[0],S=_*v.RELATIVE_CULL_TOLERANCE,E=w*v.RELATIVE_CULL_TOLERANCE;m-=S,d+=S,T-=E,l+=E,i.isVisible=function(g,b){return g>m&&g<d&&b>T&&b<l},i.isOccluded=function(g,b){return g<m||g>d||b<T||b>l},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&&(g<a[0]||g>a[o-1]|b<n[0]||b>n[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;g<a[0]?(F=0,B=0,P=(g-a[0])/(a[1]-a[0])):g>a[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),b<n[0]?(O=0,I=0,L=(b-n[0])/(n[1]-n[0])):b>n[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 _=l<x.PTS_LINESONLY?"lines+markers":"lines";m("mode",_),A.hasMarkers(s)&&M(o,s,c,h,m,{gradient:!0}),A.hasLines(s)&&(e(o,s,c,h,m,{backoff:!0}),t(o,s,m),m("connectgaps")),A.hasText(s)&&r(o,s,h,m);var w=[];(A.hasMarkers(s)||A.hasText(s))&&(m("marker.maxdisplayed"),w.push("points")),m("fill"),s.fill!=="none"&&(i(o,s,c,m),A.hasLines(s)||t(o,s,m)),(s.fill==="tonext"||s.fill==="toself")&&w.push("fills");var S=m("hoveron",w.join("+")||"points");S!=="fills"&&m("hovertemplate"),m("zorder"),v.coerceSelectionMarkerOpacity(s,m)}}}),aH=Ze({"src/traces/scattercarpet/format_labels.js"(Z,q){"use strict";q.exports=function(x,A){var M={},e=A._carpet,t=e.ab2ij([x.a,x.b]),r=Math.floor(t[0]),i=t[0]-r,a=Math.floor(t[1]),n=t[1]-a,o=e.evalxy([],r,a,i,n);return M.yLabel=o[1].toFixed(3),M}}}),IT=Ze({"src/traces/carpet/lookup_carpetid.js"(Z,q){"use strict";q.exports=function(v,x){for(var A=v._fullData.length,M,e=0;e<A;e++){var t=v._fullData[e];if(t.index!==x.index&&t.type==="carpet"&&(M||(M=t),t.carpet===x.carpet))return t}return M}}}),nH=Ze({"src/traces/scattercarpet/calc.js"(Z,q){"use strict";var v=is(),x=Fd(),A=Av(),M=Od(),e=Bd().calcMarkerSize,t=IT();q.exports=function(i,a){var n=a._carpetTrace=t(i,a);if(!(!n||!n.visible||n.visible==="legendonly")){var o;a.xaxis=n.xaxis,a.yaxis=n.yaxis;var s=a._length,c=new Array(s),h,m,d=!1;for(o=0;o<s;o++)if(h=a.a[o],m=a.b[o],v(h)&&v(m)){var T=n.ab2xy(+h,+m,!0),l=n.isVisible(+h,+m);l||(d=!0),c[o]={x:T[0],y:T[1],a:h,b:m,vis:l}}else c[o]={x:!1,y:!1};return a._needsCull=d,c[0].carpet=n,c[0].trace=a,e(a,s),x(i,a),A(c,a),M(c,a),c}}}}),iH=Ze({"src/traces/scattercarpet/plot.js"(Z,q){"use strict";var v=s1(),x=Wo(),A=as();q.exports=function(e,t,r,i){var a,n,o,s=r[0][0].carpet,c=x.getFromId(e,s.xaxis||"x"),h=x.getFromId(e,s.yaxis||"y"),m={xaxis:c,yaxis:h,plot:t.plot};for(a=0;a<r.length;a++)n=r[a][0].trace,n._xA=c,n._yA=h;for(v(e,m,r,i),a=0;a<r.length;a++)n=r[a][0].trace,o=i.selectAll("g.trace"+n.uid+" .js-line"),A.setClipUrl(o,r[a][0].carpet._clipPathId,e)}}}),oH=Ze({"src/traces/scattercarpet/hover.js"(Z,q){"use strict";var v=u1(),x=ca().fillText;q.exports=function(M,e,t,r){var i=v(M,e,t,r);if(!i||i[0].index===!1)return;var a=i[0];if(a.index===void 0){var n=1-a.y0/M.ya._length,o=M.xa._length,s=o*n/2,c=o-s;return a.x0=Math.max(Math.min(a.x0,c),s),a.x1=Math.max(Math.min(a.x1,c),s),i}var h=a.cd[a.index];a.a=h.a,a.b=h.b,a.xLabelVal=void 0,a.yLabelVal=void 0;var m=a.trace,d=m._carpet,T=m._module.formatLabels(h,m);a.yLabel=T.yLabel,delete a.text;var l=[];function _(E,g){var b;E.labelprefix&&E.labelprefix.length>0?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("<br>")}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=P<L?1:-1,F=(L-P)*1e-8,B=z>0?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<W*z;t+=z)n=[],d=N(P,t),T=I(L,t+z),l=T-d,o=Math.max(0,Math.min(p-2,Math.floor(.5*(d+T)))),c=f(T),S&&(h=r(o,d-o),m=r(o,T-o),n.push([s[0]+h[0]/3*l,s[1]+h[1]/3*l]),n.push([c[0]-m[0]/3*l,c[1]-m[1]/3*l])),n.push(c),Q.push(n),s=c;return Q}}}),hH=Ze({"src/traces/contourcarpet/plot.js"(Z,q){"use strict";var v=Oi(),x=XC(),A=ZC(),M=as(),e=ca(),t=vM(),r=mM(),i=u3(),a=G_(),n=yM(),o=gM(),s=_M(),c=IT(),h=fH();q.exports=function(p,u,y,f){var P=u.xaxis,L=u.yaxis;e.makeTraceGroups(f,y,"contour").each(function(z){var F=v.select(this),B=z[0],O=B.trace,I=O._carpetTrace=c(p,O),N=p.calcdata[I.index][0];if(!I.visible||I.visible==="legendonly")return;var U=B.a,W=B.b,Q=O.contours,ue=o(Q,u,B),se=Q.type==="constraint",he=Q._operation,H=se?he==="="?"lines":"fill":Q.coloring;function $(ze){var Re=I.ab2xy(ze[0],ze[1],!0);return[P.c2p(Re[0]),L.c2p(Re[1])]}var J=[[U[0],W[W.length-1]],[U[U.length-1],W[W.length-1]],[U[U.length-1],W[0]],[U[0],W[0]]];t(ue);var X=(U[U.length-1]-U[0])*1e-8,oe=(W[W.length-1]-W[0])*1e-8;r(ue,X,oe);var ne=ue;Q.type==="constraint"&&(ne=n(ue,he)),m(ue,$);var j,ee,re,ce,be=[];for(ce=N.clipsegments.length-1;ce>=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;u<b.length;u++){for(P=b[u],L=P.pedgepaths=[],z=P.ppaths=[],y=0;y<P.edgepaths.length;y++){for(O=P.edgepaths[y],F=[],f=0;f<O.length;f++)F[f]=p(O[f]);L.push(F)}for(y=0;y<P.paths.length;y++){for(O=P.paths[y],B=[],f=0;f<O.length;f++)B[f]=p(O[f]);z.push(B)}}}function d(b,p,u,y,f,P,L){var z=u._context.staticPlot,F=e.ensureSingle(b,"g","contourlines"),B=f.showlines!==!1,O=f.showlabels,I=B&&O,N=i.createLines(F,B||O,p,z),U=i.createLineClip(F,I,u,y.trace.uid),W=b.selectAll("g.contourlabels").data(O?[0]:[]);if(W.exit().remove(),W.enter().append("g").classed("contourlabels",!0),O){var Q=P.xaxis,ue=P.yaxis,se=Q._length,he=ue._length,H=[[[0,0],[se,0],[se,he],[0,he]]],$=[];e.clearLocationCache();var J=i.labelFormatter(u,y),X=M.tester.append("text").attr("data-notex",1).call(M.font,f.labelfont),oe={left:0,right:se,center:se/2,top:0,bottom:he,middle:he/2},ne=Math.sqrt(se*se+he*he),j=a.LABELDISTANCE*ne/Math.max(1,p.length/a.LABELINCREASE);N.each(function(ee){var re=i.calcTextOpts(ee.level,J,X,u);v.select(this).selectAll("path").each(function(ce){var be=this,Ae=e.getVisibleSegment(be,oe,re.height/2);if(Ae&&(T(be,ce,ee,Ae,L,re.height),!(Ae.len<(re.width+re.height)*a.LABELMIN)))for(var ze=Math.min(Math.ceil(Ae.len/j),a.LABELMAX),Re=0;Re<ze;Re++){var We=i.findBestTextLocation(be,Ae,re,$,oe);if(!We)break;i.addLabelData(We,re,$,H)}})}),X.remove(),i.drawLabels(W,$,u,U,I?H:null)}O&&!B&&N.remove()}function T(b,p,u,y,f,P){for(var L,z=0;z<u.pedgepaths.length;z++)p===u.pedgepaths[z]&&(L=u.edgepaths[z]);if(!L)return;var F=f.a[0],B=f.a[f.a.length-1],O=f.b[0],I=f.b[f.b.length-1];function N(se,he){var H=0,$,J=.1;return(Math.abs(se[0]-F)<J||Math.abs(se[0]-B)<J)&&($=_(f.dxydb_rough(se[0],se[1],J)),H=Math.max(H,P*w(he,$)/2)),(Math.abs(se[1]-O)<J||Math.abs(se[1]-I)<J)&&($=_(f.dxyda_rough(se[0],se[1],J)),H=Math.max(H,P*w(he,$)/2)),H}var U=l(b,0,1),W=l(b,y.total,y.total-1),Q=N(L[0],U),ue=y.total-N(L[L.length-1],W);y.min<Q&&(y.min=Q),y.max>ue&&(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<p.length;B++)L=p[B],z=x([],L.x,u.c2p),F=x([],L.y,y.c2p),N.push(A(z,F,L.bicubic));I.attr("d","M"+N.join("L")+"Z").style("stroke","none")}function E(b,p,u,y,f,P,L,z,F,B,O){var I=B==="fill";I&&s(f,b.contours);var N=e.ensureSingle(p,"g","contourfill"),U=N.selectAll("path").data(I?f:[]);U.enter().append("path"),U.exit().remove(),U.each(function(W){var Q=(W.prefixBoundary?O:"")+g(b,W,P,L,z,F,u,y);Q?v.select(this).attr("d",Q).style("stroke","none"):v.select(this).remove()})}function g(b,p,u,y,f,P,L,z){var F,B="",O=p.edgepaths.map(function(re,ce){return ce}),I=!0,N,U,W,Q,ue,se,he=Math.abs(u[0][0]-u[2][0])*1e-4,H=Math.abs(u[0][1]-u[2][1])*1e-4;function $(re){return Math.abs(re[1]-u[0][1])<H}function J(re){return Math.abs(re[1]-u[2][1])<H}function X(re){return Math.abs(re[0]-u[0][0])<he}function oe(re){return Math.abs(re[0]-u[2][0])<he}function ne(re,ce){var be,Ae,ze,Re,We="";for($(re)&&!oe(re)||J(re)&&!X(re)?(Re=f.aaxis,ze=h(f,P,[re[0],ce[0]],.5*(re[1]+ce[1]))):(Re=f.baxis,ze=h(f,P,.5*(re[0]+ce[0]),[re[1],ce[1]])),be=1;be<ze.length;be++)for(We+=Re.smoothing?"C":"L",Ae=0;Ae<ze[be].length;Ae++){var it=ze[be][Ae];We+=[L.c2p(it[0]),z.c2p(it[1])]+" "}return We}for(F=0,N=null;O.length;){var j=p.edgepaths[F][0];for(N&&(B+=ne(N,j)),se=M.smoothopen(p.edgepaths[F].map(y),p.smoothing),B+=I?se:se.replace(/^M/,"L"),O.splice(O.indexOf(F),1),N=p.edgepaths[F][p.edgepaths[F].length-1],Q=-1,W=0;W<4;W++){if(!N){e.log("Missing end?",F,p);break}for($(N)&&!oe(N)?U=u[1]:X(N)?U=u[0]:J(N)?U=u[3]:oe(N)&&(U=u[2]),ue=0;ue<p.edgepaths.length;ue++){var ee=p.edgepaths[ue][0];Math.abs(N[0]-U[0])<he?Math.abs(N[0]-ee[0])<he&&(ee[1]-N[1])*(U[1]-ee[1])>=0&&(U=ee,Q=ue):Math.abs(N[1]-U[1])<H?Math.abs(N[1]-ee[1])<H&&(ee[0]-N[0])*(U[0]-ee[0])>=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;F<p.paths.length;F++)B+=M.smoothclosed(p.paths[F].map(y),p.smoothing);return B}}}),pH=Ze({"src/traces/contourcarpet/index.js"(Z,q){"use strict";q.exports={attributes:KC(),supplyDefaults:JC(),colorbar:f3(),calc:cH(),plot:hH(),style:c3(),moduleType:"trace",name:"contourcarpet",basePlotModule:Zf(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),dH=Ze({"lib/contourcarpet.js"(Z,q){"use strict";q.exports=pH()}}),RT=Ze({"src/traces/ohlc/attributes.js"(Z,q){"use strict";var v=ca().extendFlat,x=tf(),A=Qc().axisHoverFormat,M=Gh().dash,e=Ky(),t=d1(),r=t.INCREASING.COLOR,i=t.DECREASING.COLOR,a=x.line;function n(o){return{line:{color:v({},a.color,{dflt:o}),width:a.width,dash:M,editType:"style"},editType:"style"}}q.exports={xperiod:x.xperiod,xperiod0:x.xperiod0,xperiodalignment:x.xperiodalignment,xhoverformat:A("x"),yhoverformat:A("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:v({},a.width,{}),dash:v({},M,{}),editType:"style"},increasing:n(r),decreasing:n(i),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:v({},e.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:x.zorder}}}),$C=Ze({"src/traces/ohlc/ohlc_defaults.js"(Z,q){"use strict";var v=oo(),x=ca();q.exports=function(M,e,t,r){var i=t("x"),a=t("open"),n=t("high"),o=t("low"),s=t("close");t("hoverlabel.split");var c=v.getComponentMethod("calendars","handleTraceDefaults");if(c(M,e,["x"],r),!!(a&&n&&o&&s)){var h=Math.min(a.length,n.length,o.length,s.length);return i&&(h=Math.min(h,x.minRowLength(i))),e._length=h,h}}}}),vH=Ze({"src/traces/ohlc/defaults.js"(Z,q){"use strict";var v=ca(),x=$C(),A=Qd(),M=RT();q.exports=function(r,i,a,n){function o(c,h){return v.coerce(r,i,M,c,h)}var s=x(r,i,o,n);if(!s){i.visible=!1;return}A(r,i,n,o,{x:!0}),o("xhoverformat"),o("yhoverformat"),o("line.width"),o("line.dash"),e(r,i,o,"increasing"),e(r,i,o,"decreasing"),o("text"),o("hovertext"),o("tickwidth"),n._requestRangeslider[i.xaxis]=!0,o("zorder")};function e(t,r,i,a){i(a+".line.color"),i(a+".line.width",r.line.width),i(a+".line.dash",r.line.dash)}}}),QC=Ze({"src/traces/ohlc/calc.js"(Z,q){"use strict";var v=ca(),x=v._,A=Wo(),M=tv(),e=Vs().BADNUM;function t(n,o){var s=A.getFromId(n,o.xaxis),c=A.getFromId(n,o.yaxis),h=a(n,s,o),m=o._minDiff;o._minDiff=null;var d=o._origX;o._origX=null;var T=o._xcalc;o._xcalc=null;var l=i(n,o,d,T,c,r);return o._extremes[s._id]=A.findExtremes(s,T,{vpad:m/2}),l.length?(v.extendFlat(l[0].t,{wHover:m/2,tickLen:h}),l):[{t:{empty:!0}}]}function r(n,o,s,c){return{o:n,h:o,l:s,c}}function i(n,o,s,c,h,m){for(var d=h.makeCalcdata(o,"open"),T=h.makeCalcdata(o,"high"),l=h.makeCalcdata(o,"low"),_=h.makeCalcdata(o,"close"),w=v.isArrayOrTypedArray(o.text),S=v.isArrayOrTypedArray(o.hovertext),E=!0,g=null,b=!!o.xperiodalignment,p=[],u=0;u<c.length;u++){var y=c[u],f=d[u],P=T[u],L=l[u],z=_[u];if(y!==e&&f!==e&&P!==e&&L!==e&&z!==e){z===f?g!==null&&z!==g&&(E=z>g):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<h.length;d++){var T=h[d];if(T.type==="ohlc"&&T.visible===!0&&T.xaxis===o._id){m.push(T);var l=o.makeCalcdata(T,"x");T._origX=l;var _=M(s,o,"x",l).vals;T._xcalc=_;var w=v.distinctVals(_).minDiff;w&&isFinite(w)&&(c=Math.min(c,w))}}for(c===1/0&&(c=1),d=0;d<m.length;d++)m[d]._minDiff=c}return c*s.tickwidth}q.exports={calc:t,calcCommon:i}}}),mH=Ze({"src/traces/ohlc/plot.js"(Z,q){"use strict";var v=Oi(),x=ca();q.exports=function(M,e,t,r){var i=e.yaxis,a=e.xaxis,n=!!a.rangebreaks;x.makeTraceGroups(r,t,"trace ohlc").each(function(o){var s=v.select(this),c=o[0],h=c.t,m=c.trace;if(m.visible!==!0||h.empty){s.remove();return}var d=h.tickLen,T=s.selectAll("path").data(x.identity);T.enter().append("path"),T.exit().remove(),T.attr("d",function(l){if(l.empty)return"M0,0Z";var _=a.c2p(l.pos-d,!0),w=a.c2p(l.pos+d,!0),S=n?(_+w)/2:a.c2p(l.pos,!0),E=i.c2p(l.o,!0),g=i.c2p(l.h,!0),b=i.c2p(l.l,!0),p=i.c2p(l.c,!0);return"M"+_+","+E+"H"+S+"M"+S+","+g+"V"+b+"M"+w+","+p+"H"+S})})}}}),gH=Ze({"src/traces/ohlc/style.js"(Z,q){"use strict";var v=Oi(),x=as(),A=Yi();q.exports=function(e,t,r){var i=r||v.select(e).selectAll("g.ohlclayer").selectAll("g.trace");i.style("opacity",function(a){return a[0].trace.opacity}),i.each(function(a){var n=a[0].trace;v.select(this).selectAll("path").each(function(o){if(!o.empty){var s=n[o.dir].line;v.select(this).style("fill","none").call(A.stroke,s.color).call(x.dashLine,s.dash,s.width).style("opacity",n.selectedpoints&&!o.selected?.3:1)}})})}}}),ek=Ze({"src/traces/ohlc/hover.js"(Z,q){"use strict";var v=Wo(),x=ca(),A=ef(),M=Yi(),e=ca().fillText,t=d1(),r={increasing:t.INCREASING.SYMBOL,decreasing:t.DECREASING.SYMBOL};function i(s,c,h,m){var d=s.cd,T=d[0].trace;return T.hoverlabel.split?n(s,c,h,m):o(s,c,h,m)}function a(s,c,h,m){var d=s.cd,T=s.xa,l=d[0].trace,_=d[0].t,w=l.type,S=w==="ohlc"?"l":"min",E=w==="ohlc"?"h":"max",g,b,p=_.bPos||0,u=function(W){return W.pos+p-c},y=_.bdPos||_.tickLen,f=_.wHover,P=Math.min(1,y/Math.abs(T.r2c(T.range[1])-T.r2c(T.range[0])));g=s.maxHoverDistance-P,b=s.maxSpikeDistance-P;function L(W){var Q=u(W);return A.inbox(Q-f,Q+f,g)}function z(W){var Q=W[S],ue=W[E];return Q===ue||A.inbox(Q-h,ue-h,g)}function F(W){return(L(W)+z(W))/2}var B=A.getDistanceFunction(m,L,z,F);if(A.getClosest(d,B,s),s.index===!1)return null;var O=d[s.index];if(O.empty)return null;var I=O.dir,N=l[I],U=N.line.color;return M.opacity(U)&&N.line.width?s.color=U:s.color=N.fillcolor,s.x0=T.c2p(O.pos+p-y,!0),s.x1=T.c2p(O.pos+p+y,!0),s.xLabelVal=O.orig_p!==void 0?O.orig_p:O.pos,s.spikeDistance=F(O)*b/g,s.xSpike=T.c2p(O.pos,!0),s}function n(s,c,h,m){var d=s.cd,T=s.ya,l=d[0].trace,_=d[0].t,w=[],S=a(s,c,h,m);if(!S)return[];var E=S.index,g=d[E],b=g.hi||l.hoverinfo,p=b.split("+"),u=b==="all",y=u||p.indexOf("y")!==-1;if(!y)return[];for(var f=["high","open","close","low"],P={},L=0;L<f.length;L++){var z=f[L],F=l[z][S.index],B=T.c2p(F,!0),O;F in P?(O=P[F],O.yLabel+="<br>"+_.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("<br>"),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;i<M.length;i++)M[i].selected=0;else for(i=0;i<M.length;i++){var n=M[i];A.contains([e.c2p(n.pos+a),t.c2p(n.yc)],null,n.i,x)?(r.push({pointNumber:n.i,x:e.c2d(n.pos),y:t.c2d(n.yc)}),n.selected=1):n.selected=0}return r}}}),yH=Ze({"src/traces/ohlc/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"ohlc",basePlotModule:Zf(),categories:["cartesian","svg","showLegend"],meta:{},attributes:RT(),supplyDefaults:vH(),calc:QC().calc,plot:mH(),style:gH(),hoverPoints:ek().hoverPoints,selectPoints:tk()}}}),_H=Ze({"lib/ohlc.js"(Z,q){"use strict";q.exports=yH()}}),rk=Ze({"src/traces/candlestick/attributes.js"(Z,q){"use strict";var v=ca().extendFlat,x=Qc().axisHoverFormat,A=RT(),M=B_();function e(t){return{line:{color:v({},M.line.color,{dflt:t}),width:M.line.width,editType:"style"},fillcolor:M.fillcolor,editType:"style"}}q.exports={xperiod:A.xperiod,xperiod0:A.xperiod0,xperiodalignment:A.xperiodalignment,xhoverformat:x("x"),yhoverformat:x("y"),x:A.x,open:A.open,high:A.high,low:A.low,close:A.close,line:{width:v({},M.line.width,{}),editType:"style"},increasing:e(A.increasing.line.color.dflt),decreasing:e(A.decreasing.line.color.dflt),text:A.text,hovertext:A.hovertext,whiskerwidth:v({},M.whiskerwidth,{dflt:0}),hoverlabel:A.hoverlabel,zorder:M.zorder}}}),xH=Ze({"src/traces/candlestick/defaults.js"(Z,q){"use strict";var v=ca(),x=Yi(),A=$C(),M=Qd(),e=rk();q.exports=function(i,a,n,o){function s(h,m){return v.coerce(i,a,e,h,m)}var c=A(i,a,s,o);if(!c){a.visible=!1;return}M(i,a,o,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),t(i,a,s,"increasing"),t(i,a,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),o._requestRangeslider[a.xaxis]=!0,s("zorder")};function t(r,i,a,n){var o=a(n+".line.color");a(n+".line.width",i.line.width),a(n+".fillcolor",x.addOpacity(o,.5))}}}),bH=Ze({"src/traces/candlestick/calc.js"(Z,q){"use strict";var v=ca(),x=Wo(),A=tv(),M=QC().calcCommon;q.exports=function(t,r){var i=t._fullLayout,a=x.getFromId(t,r.xaxis),n=x.getFromId(t,r.yaxis),o=a.makeCalcdata(r,"x"),s=A(r,a,"x",o).vals,c=M(t,r,o,s,n,e);return c.length?(v.extendFlat(c[0].t,{num:i._numBoxes,dPos:v.distinctVals(s).minDiff/2,posLetter:"x",valLetter:"y"}),i._numBoxes++,c):[{t:{empty:!0}}]};function e(t,r,i,a){return{min:i,q1:Math.min(t,a),med:a,q3:Math.max(t,a),max:r}}}}),wH=Ze({"src/traces/candlestick/index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"candlestick",basePlotModule:Zf(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:rk(),layoutAttributes:N_(),supplyLayoutDefaults:q2().supplyLayoutDefaults,crossTraceCalc:G2().crossTraceCalc,supplyDefaults:xH(),calc:bH(),plot:H2().plot,layerName:"boxlayer",style:W2().style,hoverPoints:ek().hoverPoints,selectPoints:tk()}}}),TH=Ze({"lib/candlestick.js"(Z,q){"use strict";q.exports=wH()}}),ak=Ze({"src/plots/polar/set_convert.js"(Z,q){"use strict";var v=ca(),x=wv(),A=v.deg2rad,M=v.rad2deg;q.exports=function(n,o,s){switch(x(n,s),n._id){case"x":case"radialaxis":e(n,o);break;case"angularaxis":i(n,o);break}};function e(a,n){var o=n._subplot;a.setGeometry=function(){var s=a._rl[0],c=a._rl[1],h=o.innerRadius,m=(o.radius-h)/(c-s),d=h/m,T=s>c?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;_<T;_++)l[_]=w(d[_]);else{var S=m+"0",E="d"+m,g=S in h?w(h[S]):0,b=h[E]?w(h[E]):(a.period||2*Math.PI)/T;for(l=new Array(T),_=0;_<T;_++)l[_]=g+_*b}return l},a.setGeometry=function(){var h=n.sector,m=h.map(A),d={clockwise:-1,counterclockwise:1}[a.direction],T=A(a.rotation),l=function(u){return d*u+T},_=function(u){return(u-T)/d},w,S,E,g;switch(o){case"linear":S=w=v.identity,g=A,E=M,a.range=v.isFullCircle(m)?[h[0],h[0]+360]:m.map(_).map(M);break;case"category":var b=a._categories.length,p=a.period?Math.max(a.period,b):b;p===0&&(p=1),S=g=function(u){return u*2*Math.PI/p},w=E=function(u){return u*p/Math.PI/2},a.range=[0,p];break}a.c2g=function(u){return l(S(u))},a.g2c=function(u){return w(_(u))},a.t2g=function(u){return l(g(u))},a.g2t=function(u){return E(_(u))}}}}}),DT=Ze({"src/plots/polar/constants.js"(Z,q){"use strict";q.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}}),zT=Ze({"src/plots/polar/helpers.js"(Z,q){"use strict";var v=ca(),x=P_().tester,A=v.findIndexOfMin,M=v.isAngleInsideSector,e=v.angleDelta,t=v.angleDist;function r(_,w,S,E,g){if(!M(w,E))return!1;var b,p;S[0]<S[1]?(b=S[0],p=S[1]):(b=S[1],p=S[0]);var u=x(s(b,E[0],E[1],g)),y=x(s(p,E[0],E[1],g)),f=[_*Math.cos(w),_*Math.sin(w)];return y.contains(f)&&!u.contains(f)}function i(_,w,S,E){var g,b,p=E[0],u=E[1],y=m(Math.sin(w)-Math.sin(_)),f=m(Math.cos(w)-Math.cos(_)),P=Math.tan(S),L=m(1/P),z=y/f,F=u-z*p;return L?y&&f?(g=F/(P-z),b=P*g):f?(g=u*L,b=u):(g=p,b=p*P):y&&f?(g=0,b=F):f?(g=0,b=u):g=b=NaN,[g,b]}function a(_,w,S,E){var g=-w*S,b=w*w+1,p=2*(w*g-S),u=g*g+S*S-_*_,y=Math.sqrt(p*p-4*b*u),f=(-p+y)/(2*b),P=(-p-y)/(2*b);return[[f,w*f+g+E],[P,w*P+g+E]]}function n(_,w){var S=w.length,E=new Array(S+1),g;for(g=0;g<S;g++){var b=w[g];E[g]=[_*Math.cos(b),_*Math.sin(b)]}return E[g]=E[0].slice(),E}function o(_,w,S,E){var g=E.length,b=[],p,u;function y(N){return[_*Math.cos(N),_*Math.sin(N)]}function f(N,U,W){return i(N,U,W,y(N))}function P(N){return v.mod(N,g)}function L(N){return M(N,[w,S])}var z=A(E,function(N){return L(N)?t(N,w):1/0}),F=f(E[z],E[P(z-1)],w);for(b.push(F),p=z,u=0;u<g;p++,u++){var B=E[P(p)];if(!L(B))break;b.push(y(B))}var O=A(E,function(N){return L(N)?t(N,S):1/0}),I=f(E[O],E[P(O+1)],S);return b.push(I),b.push([0,0]),b.push(b[0].slice()),b}function s(_,w,S,E){return v.isFullCircle([w,S])?n(_,E):o(_,w,S,E)}function c(_,w,S,E){for(var g=1/0,b=1/0,p=s(_,w,S,E),u=0;u<p.length;u++){var y=p[u];g=Math.min(g,y[0]),b=Math.min(b,-y[1])}return[g,b]}function h(_,w){var S=function(b){var p=e(b,_);return p>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;b<E;b++){var p=_[b];g[b]=[w+p[0],S-p[1]]}return g}function T(_,w,S,E,g,b){var p=s(_,w,S,E);return"M"+d(p,g,b).join("L")}function l(_,w,S,E,g,b,p){var u,y;_<w?(u=_,y=w):(u=w,y=_);var f=d(s(u,S,E,g),b,p),P=d(s(y,S,E,g),b,p);return"M"+P.reverse().join("L")+"M"+f.join("L")}q.exports={isPtInsidePolygon:r,findPolygonOffset:c,findEnclosingVertexAngles:h,findIntersectionXY:i,findXYatLength:a,clampTiny:m,pathPolygon:T,pathPolygonAnnulus:l}}}),nk=Ze({"src/plots/smith/helpers.js"(Z,q){"use strict";function v(r){return r<0?-1:r>0?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,"+(0<a?0:1)+" "+_+","+w,"A"+o+","+o+" 0 0,"+(n<0?0:1)+d+","+T].join(" ")}return["M"+c+","+h,"A"+o+","+o+" 0 0,"+(n<a?0:1)+" "+d+","+T].join(" ")}q.exports={smith:x,reactanceArc:e,resistanceArc:t,smithTransform:A}}}),ik=Ze({"src/plots/polar/polar.js"(Z,q){"use strict";var v=Oi(),x=Ch(),A=oo(),M=ca(),e=M.strRotate,t=M.strTranslate,r=Yi(),i=as(),a=xc(),n=Wo(),o=wv(),s=ak(),c=Yd().doAutoRange,h=LS(),m=bp(),d=ef(),T=Zg(),l=Tf().prepSelect,_=Tf().selectOnClick,w=Tf().clearOutline,S=Kd(),E=C_(),g=L_().redrawReglTraces,b=mh().MID_SHIFT,p=DT(),u=zT(),y=nk(),f=y.smith,P=y.reactanceArc,L=y.resistanceArc,z=y.smithTransform,F=M._,B=M.mod,O=M.deg2rad,I=M.rad2deg;function N(he,H,$){this.isSmith=$||!1,this.id=H,this.gd=he,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var J=he._fullLayout,X="clip"+J._uid+H;this.clipIds.forTraces=X+"-for-traces",this.clipPaths.forTraces=J._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=J["_"+($?"smith":"polar")+"layer"].append("g").attr("class",H),this.getHole=function(oe){return this.isSmith?0:oe.hole},this.getSector=function(oe){return this.isSmith?[0,360]:oe.sector},this.getRadial=function(oe){return this.isSmith?oe.realaxis:oe.radialaxis},this.getAngular=function(oe){return this.isSmith?oe.imaginaryaxis:oe.angularaxis},$||(this.radialTickLayout=null,this.angularTickLayout=null)}var U=N.prototype;q.exports=function(H,$,J){return new N(H,$,J)},U.plot=function(he,H){for(var $=this,J=H[$.id],X=!1,oe=0;oe<he.length;oe++){var ne=he[oe][0].trace;if(ne.cliponaxis===!1){X=!0;break}}$._hasClipOnAxisFalse=X,$.updateLayers(H,J),$.updateLayout(H,J),a.generalUpdatePerTraceModule($.gd,$,he,J),$.updateFx(H,J),$.isSmith&&(delete J.realaxis.range,delete J.imaginaryaxis.range)},U.updateLayers=function(he,H){var $=this,J=$.isSmith,X=$.layers,oe=$.getRadial(H),ne=$.getAngular(H),j=p.layerNames,ee=j.indexOf("frontplot"),re=j.slice(0,ee),ce=ne.layer==="below traces",be=oe.layer==="below traces";ce&&re.push("angular-line"),be&&re.push("radial-line"),ce&&re.push("angular-axis"),be&&re.push("radial-axis"),re.push("frontplot"),ce||re.push("angular-line"),be||re.push("radial-line"),ce||re.push("angular-axis"),be||re.push("radial-axis");var Ae=(J?"smith":"polar")+"sublayer",ze=$.framework.selectAll("."+Ae).data(re,String);ze.enter().append("g").attr("class",function(Re){return Ae+" "+Re}).each(function(Re){var We=X[Re]=v.select(this);switch(Re){case"frontplot":J||We.append("g").classed("barlayer",!0),We.append("g").classed("scatterlayer",!0);break;case"backplot":We.append("g").classed("maplayer",!0);break;case"plotbg":X.bg=We.append("path");break;case"radial-grid":We.style("fill","none");break;case"angular-grid":We.style("fill","none");break;case"radial-line":We.append("line").style("fill","none");break;case"angular-line":We.append("path").style("fill","none");break}}),ze.order()},U.updateLayout=function(he,H){var $=this,J=$.layers,X=he._size,oe=$.getRadial(H),ne=$.getAngular(H),j=H.domain.x,ee=H.domain.y;$.xOffset=X.l+X.w*j[0],$.yOffset=X.t+X.h*(1-ee[1]);var re=$.xLength=X.w*(j[1]-j[0]),ce=$.yLength=X.h*(ee[1]-ee[0]),be=$.getSector(H);$.sectorInRad=be.map(O);var Ae=$.sectorBBox=Q(be),ze=Ae[2]-Ae[0],Re=Ae[3]-Ae[1],We=ce/re,it=Math.abs(Re/ze),ot,tt,ut,Me,_e;We>it?(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]<X._rl[1]?X._rl[1]=Math.min(X._rl[1],ee):X._rl[0]=Math.min(X._rl[0],ee)}},U.updateRadialAxis=function(he,H){var $=this,J=$.gd,X=$.layers,oe=$.radius,ne=$.innerRadius,j=$.cx,ee=$.cy,re=$.getRadial(H),ce=B($.getSector(H)[0],360),be=$.radialAxis,Ae=ne<oe,ze=$.isSmith;ze||($.fillViewInitialKey("radialaxis.angle",re.angle),$.fillViewInitialKey("radialaxis.range",be.range.slice()),be.setGeometry()),be.tickangle==="auto"&&ce>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),rr<j?rr=0:ee-rr<j?rr=ee:Qt<j?Qt=0:ee-Qt<j&&(Qt=ee),Math.abs(Qt-rr)>ne?(rr<Qt?(kt=rr,qt=Qt):(kt=Qt,qt=rr),!0):(kt=null,qt=null,!1)}function Te(rr,Qt){rr=rr||Zt,Qt=Qt||"M0,0Z",jr.attr("d",rr),wr.attr("d",Qt),h.transitionZoombox(jr,wr,Sr,xr),Sr=!0;var Tr={};Ot(Tr),J.emit("plotly_relayouting",Tr)}function Pe(rr,Qt){rr=rr*fe,Qt=Qt*Fe;var Tr=Qe+rr,la=Lt+Qt,Ua=bt(Qe,Lt),Ba=Math.min(bt(Tr,la),ee),Ra=Be(Qe,Lt),Qa,za;Ce(Ua,Ba)&&(Qa=Zt+H.pathSector(qt),kt&&(Qa+=H.pathSector(kt)),za=Ue(kt,Ra)+Ue(qt,Ra)),Te(Qa,za)}function at(rr,Qt,Tr,la){var Ua=u.findIntersectionXY(Tr,la,Tr,[rr-Ae,ze-Qt]);return Ir(Ua[0],Ua[1])}function yt(rr,Qt){var Tr=Qe+rr,la=Lt+Qt,Ua=Be(Qe,Lt),Ba=Be(Tr,la),Ra=ut(Ua,We),Qa=ut(Ba,We),za=at(Qe,Lt,Ra[0],Ra[1]),en=Math.min(at(Tr,la,Qa[0],Qa[1]),ee),kn,Jt;Ce(za,en)&&(kn=Zt+H.pathSector(qt),kt&&(kn+=H.pathSector(kt)),Jt=[Ee(kt,Ra[0],Ra[1]),Ee(qt,Ra[0],Ra[1])].join(" ")),Te(kn,Jt)}function Tt(){if(h.removeZoombox(J),!(kt===null||qt===null)){var rr={};Ot(rr),h.showDoubleClickNotifier(J),A.call("_guiRelayout",J,rr)}}function Ot(rr){var Qt=it._rl,Tr=(Qt[1]-Qt[0])/(1-re/ee)/ee,la=[Qt[0]+(kt-re)*Tr,Qt[0]+(qt-re)*Tr];rr[H.id+".radialaxis.range"]=la}function Gt(rr,Qt){var Tr=J._fullLayout.clickmode;if(h.removeZoombox(J),rr===2){var la={};for(var Ua in H.viewInitial)la[H.id+"."+Ua]=H.viewInitial[Ua];J.emit("plotly_doubleclick",null),A.call("_guiRelayout",J,la)}Tr.indexOf("select")>-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&&j<ne,{transform:t(ut,Me)});var rt,st,Qe;function Lt(xr,jr){if(rt)rt(xr,jr);else{var wr=[xr,-jr],Ir=[Math.cos(ze),Math.sin(ze)],bt=Math.abs(M.dot(wr,Ir)/Math.sqrt(M.dot(wr,wr)));isNaN(bt)||(rt=bt<.5?Zt:Sr)}var Be={};kt(Be),X.emit("plotly_relayouting",Be)}function kt(xr){st!==null?xr[J.id+".radialaxis.angle"]=st:Qe!==null&&(xr[J.id+".radialaxis.range["+$+"]"]=Qe)}function qt(){st!==null?A.call("_guiRelayout",X,J.id+".radialaxis.angle",st):Qe!==null&&A.call("_guiRelayout",X,J.id+".radialaxis.range["+$+"]",Qe)}function Zt(xr,jr){if($!==0){var wr=ut+xr,Ir=Me+jr;st=Math.atan2(re-Ir,wr-ee),J.vangles&&(st=ue(st,J.vangles)),st=I(st);var bt=t(ee,re)+e(-st);oe["radial-axis"].attr("transform",bt),oe["radial-line"].select("line").attr("transform",bt);var Be=J.gd._fullLayout,Ke=Be[J.id];J.updateRadialAxisTitle(Be,Ke,st)}}function Sr(xr,jr){var wr=M.dot([xr,-jr],[Math.cos(ze),Math.sin(ze)]);if(Qe=ot-tt*wr,tt>0!=($?Qe>We:Qe<it)){Qe=null;return}var Ir=X._fullLayout,bt=Ir[J.id];ce.range[$]=Qe,ce._rl[$]=Qe,J.updateRadialAxis(Ir,bt),J.xaxis.setRange(),J.xaxis.setScale(),J.yaxis.setRange(),J.yaxis.setScale();var Be=!1;for(var Ke in J.traceHash){var Ue=J.traceHash[Ke],Ee=M.filterVisible(Ue),Ve=Ue[0][0].trace._module;Ve.plot(X,J,Ee,bt),A.traceIs(Ke,"gl")&&Ee.length&&(Be=!0)}Be&&(E(X),g(X))}Fe.prepFn=function(){rt=null,st=null,Qe=null,Fe.moveFn=Lt,Fe.doneFn=qt,w(X)},Fe.clampFn=function(xr,jr){return Math.sqrt(xr*xr+jr*jr)<p.MINDRAG&&(xr=0,jr=0),[xr,jr]},m.init(Fe)},U.updateAngularDrag=function(he){var H=this,$=H.gd,J=H.layers,X=H.radius,oe=H.angularAxis,ne=H.cx,j=H.cy,ee=H.cxx,re=H.cyy,ce=p.angularDragBoxSize,be=h.makeDragger(J,"path","angulardrag",he.dragmode===!1?"none":"move"),Ae={element:be,gd:$};he.dragmode===!1?Ae.dragmode=!1:v.select(be).attr("d",H.pathAnnulus(X,X+ce)).attr("transform",t(ne,j)).call(S,"move");function ze(Qe,Lt){return Math.atan2(re+ce-Lt,Qe-ee-ce)}var Re=J.frontplot.select(".scatterlayer").selectAll(".trace"),We=Re.selectAll(".point"),it=Re.selectAll(".textpoint"),ot,tt,ut,Me,_e,fe;function Fe(Qe,Lt){var kt=H.gd._fullLayout,qt=kt[H.id],Zt=ot+Qe*he._invScaleX,Sr=tt+Lt*he._invScaleY,xr=ze(Zt,Sr),jr=I(xr-fe);if(Me=ut+jr,J.frontplot.attr("transform",t(H.xOffset2,H.yOffset2)+e([-jr,ee,re])),H.vangles){_e=H.radialAxisAngle+jr;var wr=t(ne,j)+e(-jr),Ir=t(ne,j)+e(-_e);J.bg.attr("transform",wr),J["radial-grid"].attr("transform",wr),J["radial-axis"].attr("transform",Ir),J["radial-line"].select("line").attr("transform",Ir),H.updateRadialAxisTitle(kt,qt,_e)}else H.clipPaths.forTraces.select("path").attr("transform",t(ee,re)+e(jr));We.each(function(){var Ce=v.select(this),Te=i.getTranslate(Ce);Ce.attr("transform",t(Te.x,Te.y)+e([jr]))}),it.each(function(){var Ce=v.select(this),Te=Ce.select("text"),Pe=i.getTranslate(Ce);Ce.attr("transform",e([jr,Te.attr("x"),Te.attr("y")])+t(Pe.x,Pe.y))}),oe.rotation=M.modHalf(Me,360),H.updateAngularAxis(kt,qt),H._hasClipOnAxisFalse&&!M.isFullCircle(H.sectorInRad)&&Re.call(i.hideOutsideRangePoints,H);var bt=!1;for(var Be in H.traceHash)if(A.traceIs(Be,"gl")){var Ke=H.traceHash[Be],Ue=M.filterVisible(Ke),Ee=Ke[0][0].trace._module;Ee.plot($,H,Ue,qt),Ue.length&&(bt=!0)}bt&&(E($),g($));var Ve={};rt(Ve),$.emit("plotly_relayouting",Ve)}function rt(Qe){Qe[H.id+".angularaxis.rotation"]=Me,H.vangles&&(Qe[H.id+".radialaxis.angle"]=_e)}function st(){it.select("text").attr("transform",null);var Qe={};rt(Qe),A.call("_guiRelayout",$,Qe)}Ae.prepFn=function(Qe,Lt,kt){var qt=he[H.id];ut=qt.angularaxis.rotation;var Zt=be.getBoundingClientRect();ot=Lt-Zt.left,tt=kt-Zt.top,$._fullLayout._calcInverseTransform($);var Sr=M.apply3DTransform(he._invTransform)(ot,tt);ot=Sr[0],tt=Sr[1],fe=ze(ot,tt),Ae.moveFn=Fe,Ae.doneFn=st,w($)},H.vangles&&!M.isFullCircle(H.sectorInRad)&&(Ae.prepFn=M.noop,S(v.select(be),null)),m.init(Ae)},U.isPtInside=function(he){if(this.isSmith)return!0;var H=this.sectorInRad,$=this.vangles,J=this.angularAxis.c2g(he.theta),X=this.radialAxis,oe=X.c2l(he.r),ne=X._rl,j=$?u.isPtInsidePolygon:M.isPtInsideSector;return j(oe,J,ne,H,$)},U.pathArc=function(he){var H=this.sectorInRad,$=this.vangles,J=$?u.pathPolygon:M.pathArc;return J(he,H[0],H[1],$)},U.pathSector=function(he){var H=this.sectorInRad,$=this.vangles,J=$?u.pathPolygon:M.pathSector;return J(he,H[0],H[1],$)},U.pathAnnulus=function(he,H){var $=this.sectorInRad,J=this.vangles,X=J?u.pathPolygonAnnulus:M.pathAnnulus;return X(he,H,$[0],$[1],J)},U.pathSubplot=function(){var he=this.innerRadius,H=this.radius;return he?this.pathAnnulus(he,H):this.pathSector(H)},U.fillViewInitialKey=function(he,H){he in this.viewInitial||(this.viewInitial[he]=H)};function W(he){var H=he.ticks+String(he.ticklen)+String(he.showticklabels);return"side"in he&&(H+=he.side),H}function Q(he){var H=he[0],$=he[1],J=$-H,X=B(H,360),oe=X+J,ne=Math.cos(O(X)),j=Math.sin(O(X)),ee=Math.cos(O(oe)),re=Math.sin(O(oe)),ce,be,Ae,ze;return X<=90&&oe>=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<T.length;L++){f=T[L],v.isPlainObject(w[f])||(w[f]={});var z=w[f],F=A.newContainer(S,f);F._id=F._name=f,F._attr=g.id+"."+f,F._traceIndices=u.map(function(be){return be.index});var B=d.axisName2dataArray[f],O=_(z,F,P,u,B,g);n(z,F,P,{axData:u,dataAttr:B});var I=P("visible");switch(m(F,S,y),P("uirevision",S.uirevision),F._m=1,f){case"radialaxis":P("minallowed"),P("maxallowed");var N=P("range"),U=F.getAutorangeDflt(N),W=P("autorange",U),Q;N&&(N[0]===null&&N[1]===null||(N[0]===null||N[1]===null)&&(W==="reversed"||W===!0)||N[0]!==null&&(W==="min"||W==="max reversed")||N[1]!==null&&(W==="max"||W==="min reversed"))&&(N=void 0,delete F.range,F.autorange=!0,Q=!0),Q||(U=F.getAutorangeDflt(N),W=P("autorange",U)),z.autorange=W,W&&(s(P,W,N),(O==="linear"||O==="-")&&P("rangemode"),F.isReversed()&&(F._m=-1)),F.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if(O==="date"){v.log("Polar plots do not support date angular axes yet.");for(var ue=0;ue<u.length;ue++)u[ue].visible=!1;O=z.type=F.type="linear"}P(O==="linear"?"thetaunit":"period");var se=P("direction");P("rotation",{counterclockwise:0,clockwise:90}[se]);break}if(a(z,F,P,F.type,{tickSuffixDflt:F.thetaunit==="degrees"?"\xB0":void 0}),I){var he,H,$,J,X,oe,ne,j,ee,re,ce=g.font||{};he=P("color"),H=he===z.color?he:ce.color,$=ce.size,J=ce.family,X=ce.weight,oe=ce.style,ne=ce.variant,j=ce.textcase,ee=ce.lineposition,re=ce.shadow,t(z,F,P,F.type),i(z,F,P,F.type,{font:{weight:X,style:oe,variant:ne,textcase:j,lineposition:ee,shadow:re,color:H,size:$,family:J},noAutotickangles:f==="angularaxis",noTicklabelshift:!0,noTicklabelstandoff:!0}),r(z,F,P,{outerTicks:!0}),o(z,F,P,{dfltColor:he,bgColor:g.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:h[f]}),P("layer"),f==="radialaxis"&&(P("side"),P("angle",p[0]),P("title.text"),v.coerceFont(P,"title.font",{weight:X,style:oe,variant:ne,textcase:j,lineposition:ee,shadow:re,color:H,size:v.bigFont($),family:J}))}O!=="category"&&P("hoverformat"),F._input=z}S.angularaxis.type==="category"&&E("gridshape")}function _(w,S,E,g,b,p){var u=E("autotypenumbers",p.autotypenumbersDflt),y=E("type");if(y==="-"){for(var f,P=0;P<g.length;P++)if(g[P].visible){f=g[P];break}f&&f[b]&&(S.type=c(f[b],"gregorian",{noMultiCategory:!0,autotypenumbers:u})),S.type==="-"?S.type="linear":w.type=S.type}return S.type}q.exports=function(S,E,g){M(S,E,g,{type:d.name,attributes:h,handleDefaults:l,font:E.font,autotypenumbersDflt:E.autotypenumbers,paper_bgcolor:E.paper_bgcolor,fullData:g,layoutOut:E})}}}),FT=Ze({"src/plots/polar/index.js"(Z,q){"use strict";var v=Hh().getSubplotCalcData,x=ca().counterRegex,A=ik(),M=DT(),e=M.attr,t=M.name,r=x(t),i={};i[e]={valType:"subplotid",dflt:t,editType:"calc"};function a(o){for(var s=o._fullLayout,c=o.calcdata,h=s._subplots[t],m=0;m<h.length;m++){var d=h[m],T=v(c,t,d),l=s[d]._subplot;l||(l=A(o,d),s[d]._subplot=l),l.plot(T,s,o._promises)}}function n(o,s,c,h){for(var m=h._subplots[t]||[],d=h._has&&h._has("gl"),T=s._has&&s._has("gl"),l=d&&!T,_=0;_<m.length;_++){var w=m[_],S=h[w]._subplot;if(!s[w]&&S){S.framework.remove(),S.layers["radial-axis-title"].remove();for(var E in S.clipPaths)S.clipPaths[E].remove()}l&&S._scene&&(S._scene.destroy(),S._scene=null)}}q.exports={attr:e,name:t,idRoot:t,idRegex:r,attrRegex:r,attributes:i,layoutAttributes:ok(),supplyLayoutDefaults:AH(),plot:a,clean:n,toSVG:Zf().toSVG}}}),Cx=Ze({"src/traces/scatterpolar/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=rs().extendFlat,M=$d(),e=tf(),t=eu(),r=e.line;q.exports={mode:e.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:x({editType:"plot"},{keys:["r","theta","text"]}),hovertext:e.hovertext,line:{color:r.color,width:r.width,dash:r.dash,backoff:r.backoff,shape:A({},r.shape,{values:["linear","spline"]}),smoothing:r.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:M(),hoverinfo:A({},t.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:e.hoveron,hovertemplate:v(),selected:e.selected,unselected:e.unselected}}}),OT=Ze({"src/traces/scatterpolar/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=md(),M=Dd(),e=o1(),t=zd(),r=ev(),i=Tv().PTS_LINESONLY,a=Cx();function n(s,c,h,m){function d(_,w){return v.coerce(s,c,a,_,w)}var T=o(s,c,m,d);if(!T){c.visible=!1;return}d("thetaunit"),d("mode",T<i?"lines+markers":"lines"),d("text"),d("hovertext"),c.hoveron!=="fills"&&d("hovertemplate"),x.hasMarkers(c)&&A(s,c,h,m,d,{gradient:!0}),x.hasLines(c)&&(M(s,c,h,m,d,{backoff:!0}),e(s,c,d),d("connectgaps")),x.hasText(c)&&(d("texttemplate"),t(s,c,m,d));var l=[];(x.hasMarkers(c)||x.hasText(c))&&(d("cliponaxis"),d("marker.maxdisplayed"),l.push("points")),d("fill"),c.fill!=="none"&&(r(s,c,h,d),x.hasLines(c)||e(s,c,d)),(c.fill==="tonext"||c.fill==="toself")&&l.push("fills"),d("hoveron",l.join("+")||"points"),v.coerceSelectionMarkerOpacity(c,d)}function o(s,c,h,m){var d=m("r"),T=m("theta");v.isTypedArray(d)&&(c.r=d=Array.from(d)),v.isTypedArray(T)&&(c.theta=T=Array.from(T));var l;if(d)T?l=Math.min(d.length,T.length):(l=d.length,m("theta0"),m("dtheta"));else{if(!T)return 0;l=c.theta.length,m("r0"),m("dr")}return c._length=l,l}q.exports={handleRThetaDefaults:o,supplyDefaults:n}}}),BT=Ze({"src/traces/scatterpolar/format_labels.js"(Z,q){"use strict";var v=ca(),x=Wo();q.exports=function(M,e,t){var r={},i=t[e.subplot]._subplot,a,n;i?(a=i.radialAxis,n=i.angularAxis):(i=t[e.subplot],a=i.radialaxis,n=i.angularaxis);var o=a.c2l(M.r);r.rLabel=x.tickText(a,o,!0).text;var s=n.thetaunit==="degrees"?v.rad2deg(M.theta):M.theta;return r.thetaLabel=x.tickText(n,s,!0).text,r}}}),SH=Ze({"src/traces/scatterpolar/calc.js"(Z,q){"use strict";var v=is(),x=Vs().BADNUM,A=Wo(),M=Fd(),e=Av(),t=Od(),r=Bd().calcMarkerSize;q.exports=function(a,n){for(var o=a._fullLayout,s=n.subplot,c=o[s].radialaxis,h=o[s].angularaxis,m=c.makeCalcdata(n,"r"),d=h.makeCalcdata(n,"theta"),T=n._length,l=new Array(T),_=0;_<T;_++){var w=m[_],S=d[_],E=l[_]={};v(w)&&v(S)?(E.r=w,E.theta=S):E.r=x}var g=r(n,T);return n._extremes.x=A.findExtremes(c,m,{ppad:g}),M(a,n),e(l,n),t(l,n),l}}}),MH=Ze({"src/traces/scatterpolar/plot.js"(Z,q){"use strict";var v=s1(),x=Vs().BADNUM;q.exports=function(M,e,t){for(var r=e.layers.frontplot.select("g.scatterlayer"),i=e.xaxis,a=e.yaxis,n={xaxis:i,yaxis:a,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},o=e.radialAxis,s=e.angularAxis,c=0;c<t.length;c++)for(var h=t[c],m=0;m<h.length;m++){m===0&&(h[0].trace._xA=i,h[0].trace._yA=a);var d=h[m],T=d.r;if(T===x)d.x=d.y=x;else{var l=o.c2g(T),_=s.c2g(d.theta);d.x=l*Math.cos(_),d.y=l*Math.sin(_)}}v(M,n,t,r)}}}),NT=Ze({"src/traces/scatterpolar/hover.js"(Z,q){"use strict";var v=u1();function x(M,e,t,r){var i=v(M,e,t,r);if(!(!i||i[0].index===!1)){var a=i[0];if(a.index===void 0)return i;var n=M.subplot,o=a.cd[a.index],s=a.trace;if(n.isPtInside(o))return a.xLabelVal=void 0,a.yLabelVal=void 0,A(o,s,n,a),a.hovertemplate=s.hovertemplate,i}}function A(M,e,t,r){var i=t.radialAxis,a=t.angularAxis;i._hovertitle="r",a._hovertitle="\u03B8";var n={};n[e.subplot]={_subplot:t};var o=e._module.formatLabels(M,e,n);r.rLabel=o.rLabel,r.thetaLabel=o.thetaLabel;var s=M.hi||e.hoverinfo,c=[];function h(d,T){c.push(d._hovertitle+": "+T)}if(!e.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["r","theta","text"]),m.indexOf("r")!==-1&&h(i,r.rLabel),m.indexOf("theta")!==-1&&h(a,r.thetaLabel),m.indexOf("text")!==-1&&r.text&&(c.push(r.text),delete r.text),r.extraText=c.join("<br>")}}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<i?"lines+markers":"lines"),m("text"),m("hovertext"),s.hoveron!=="fills"&&m("hovertemplate"),x.hasMarkers(s)&&M(o,s,c,h,m,{noAngleRef:!0,noStandOff:!0}),x.hasLines(s)&&(e(o,s,c,h,m),m("connectgaps")),x.hasText(s)&&(m("texttemplate"),t(o,s,h,m,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),m("fill"),s.fill!=="none"&&r(o,s,c,m),v.coerceSelectionMarkerOpacity(s,m)}}}),LH=Ze({"src/traces/scatterpolargl/format_labels.js"(Z,q){"use strict";var v=BT();q.exports=function(A,M,e){var t=A.i;return"r"in A||(A.r=M._r[t]),"theta"in A||(A.theta=M._theta[t]),v(A,M,e)}}}),PH=Ze({"src/traces/scatterpolargl/calc.js"(Z,q){"use strict";var v=Fd(),x=Bd().calcMarkerSize,A=g0(),M=Wo(),e=mg().TOO_MANY_POINTS;q.exports=function(r,i){var a=r._fullLayout,n=i.subplot,o=a[n].radialaxis,s=a[n].angularaxis,c=i._r=o.makeCalcdata(i,"r"),h=i._theta=s.makeCalcdata(i,"theta"),m=i._length,d={};m<c.length&&(c=c.slice(0,m)),m<h.length&&(h=h.slice(0,m)),d.r=c,d.theta=h,v(r,i);var T=d.opts=A.style(r,i),l;return m<e?l=x(i,m):T.marker&&(l=2*(T.marker.sizeAvg||Math.max(T.marker.size,3))),i._extremes.x=M.findExtremes(o,c,{ppad:l}),[{x:!1,y:!1,t:d,trace:i}]}}}),IH=Ze({"src/traces/scatterpolargl/hover.js"(Z,q){"use strict";var v=pT(),x=NT().makeHoverPointText;function A(M,e,t,r){var i=M.cd,a=i[0].t,n=a.r,o=a.theta,s=v.hoverPoints(M,e,t,r);if(!(!s||s[0].index===!1)){var c=s[0];if(c.index===void 0)return s;var h=M.subplot,m=c.cd[c.index],d=c.trace;if(m.r=n[c.index],m.theta=o[c.index],!!h.isPtInside(m))return c.xLabelVal=void 0,c.yLabelVal=void 0,x(m,d,h,c),s}}q.exports={hoverPoints:A}}}),RH=Ze({"src/traces/scatterpolargl/base_index.js"(Z,q){"use strict";q.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:FT(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:sk(),supplyDefaults:kH(),colorbar:hp(),formatLabels:LH(),calc:PH(),hoverPoints:IH().hoverPoints,selectPoints:V5(),meta:{}}}}),DH=Ze({"src/traces/scatterpolargl/plot.js"(Z,q){"use strict";var v=vT(),x=is(),A=hC(),M=U5(),e=g0(),t=ca(),r=mg().TOO_MANY_POINTS,i={};q.exports=function(n,o,s){if(s.length){var c=o.radialAxis,h=o.angularAxis,m=M(n,o);return s.forEach(function(d){if(!(!d||!d[0]||!d[0].trace)){var T=d[0],l=T.trace,_=T.t,w=l._length,S=_.r,E=_.theta,g=_.opts,b,p=S.slice(),u=E.slice();for(b=0;b<S.length;b++)o.isPtInside({r:S[b],theta:E[b]})||(p[b]=NaN,u[b]=NaN);var y=new Array(w*2),f=Array(w),P=Array(w);for(b=0;b<w;b++){var L=p[b],z,F;if(x(L)){var B=c.c2g(L),O=h.c2g(u[b],l.thetaunit);z=B*Math.cos(O),F=B*Math.sin(O)}else z=F=NaN;f[b]=y[b*2]=z,P[b]=y[b*2+1]=F}_.tree=v(y),g.marker&&w>=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;a<e.length;a++){var n=e[a];n.type==="barpolar"&&n.visible===!0&&(r=n.subplot,t[r]||(i("barmode"),i("bargap"),t[r]=1))}}}}),ck=Ze({"src/traces/barpolar/calc.js"(Z,q){"use strict";var v=Up().hasColorscale,x=jp(),A=ca().isArrayOrTypedArray,M=O_(),e=$g().setGroupPositions,t=Od(),r=oo().traceIs,i=ca().extendFlat;function a(o,s){for(var c=o._fullLayout,h=s.subplot,m=c[h].radialaxis,d=c[h].angularaxis,T=m.makeCalcdata(s,"r"),l=d.makeCalcdata(s,"theta"),_=s._length,w=new Array(_),S=T,E=l,g=0;g<_;g++)w[g]={p:E[g],s:S[g]};function b(p){var u=s[p];u!==void 0&&(s["_"+p]=A(u)?d.makeCalcdata(s,p):d.d2c(u,s.thetaunit))}return d.type==="linear"&&(b("width"),b("offset")),v(s,"marker")&&x(o,s,{vals:s.marker.color,containerStr:"marker",cLetter:"c"}),v(s,"marker.line")&&x(o,s,{vals:s.marker.line.color,containerStr:"marker.line",cLetter:"c"}),M(w,s),t(w,s),w}function n(o,s,c){for(var h=o.calcdata,m=[],d=0;d<h.length;d++){var T=h[d],l=T[0].trace;l.visible===!0&&r(l,"bar")&&l.subplot===c&&m.push(T)}var _=i({},s.radialaxis,{_id:"x"}),w=s.angularaxis;e(o,w,_,m,{mode:s.barmode,norm:s.barnorm,gap:s.bargap,groupgap:s.bargroupgap})}q.exports={calc:a,crossTraceCalc:n}}}),NH=Ze({"src/traces/barpolar/plot.js"(Z,q){"use strict";var v=Oi(),x=is(),A=ca(),M=as(),e=zT();q.exports=function(i,a,n){var o=i._context.staticPlot,s=a.xaxis,c=a.yaxis,h=a.radialAxis,m=a.angularAxis,d=t(a),T=a.layers.frontplot.select("g.barlayer");A.makeTraceGroups(T,n,"trace bars").each(function(){var l=v.select(this),_=A.ensureSingle(l,"g","points"),w=_.selectAll("g.point").data(A.identity);w.enter().append("g").style("vector-effect",o?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),w.exit().remove(),w.each(function(S){var E=v.select(this),g=S.rp0=h.c2p(S.s0),b=S.rp1=h.c2p(S.s1),p=S.thetag0=m.c2g(S.p0),u=S.thetag1=m.c2g(S.p1),y;if(!x(g)||!x(b)||!x(p)||!x(u)||g===b||p===u)y="M0,0Z";else{var f=h.c2g(S.s1),P=(p+u)/2;S.ct=[s.c2p(f*Math.cos(P)),c.c2p(f*Math.sin(P))],y=d(g,b,p,u)}A.ensureSingle(E,"path").attr("d",y)}),M.setClipUrl(l,a._hasClipOnAxisFalse?a.clipIds.forTraces:null,i)})};function t(r){var i=r.cxx,a=r.cyy;return r.vangles?function(n,o,s,c){var h,m;A.angleDelta(s,c)>0?(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<s.length;p++){g=s[p],v.isPlainObject(d[g])||(d[g]={});var u=d[g],y=A.newContainer(T,g);y._id=y._name=g,y._attr=_.id+"."+g,y._traceIndices=S.map(function(U){return U.index});var f=b("visible");if(y.type="linear",a(y,E),t(u,y,b,y.type),f){var P=g==="realaxis";if(P&&b("side"),P)b("tickvals");else{var L=c(T.realaxis.tickvals||n.realaxis.tickvals.dflt);b("tickvals",L)}v.isTypedArray(y.tickvals)&&(y.tickvals=Array.from(y.tickvals));var z,F,B,O,I=_.font||{};f&&(z=b("color"),F=z===u.color?z:I.color,B=I.size,O=I.family),r(u,y,b,y.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!P,noExp:!0,font:{color:F,size:B,family:O}}),v.coerce2(d,T,n,g+".ticklen"),v.coerce2(d,T,n,g+".tickwidth"),v.coerce2(d,T,n,g+".tickcolor",T.color);var N=b("ticks");N||(delete T[g].ticklen,delete T[g].tickwidth,delete T[g].tickcolor),i(u,y,b,{dfltColor:z,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:n[g]}),b("layer")}b("hoverformat"),delete y.type,y._input=u}}q.exports=function(T,l,_){M(T,l,_,{noUirevision:!0,type:o.name,attributes:n,handleDefaults:h,font:l.font,paper_bgcolor:l.paper_bgcolor,fullData:_,layoutOut:l})};function m(d,T){var l={};return function(_){var w=T?T(_):_;if(w in l)return l[w];var S=d(_);return l[w]=S,S}}}}),GH=Ze({"src/plots/smith/index.js"(Z,q){"use strict";var v=Hh().getSubplotCalcData,x=ca().counterRegex,A=ik(),M=fk(),e=M.attr,t=M.name,r=x(t),i={};i[e]={valType:"subplotid",dflt:t,editType:"calc"};function a(o){for(var s=o._fullLayout,c=o.calcdata,h=s._subplots[t],m=0;m<h.length;m++){var d=h[m],T=v(c,t,d),l=s[d]._subplot;l||(l=A(o,d,!0),s[d]._subplot=l),l.plot(T,s,o._promises)}}function n(o,s,c,h){for(var m=h._subplots[t]||[],d=0;d<m.length;d++){var T=m[d],l=h[T]._subplot;if(!s[T]&&l){l.framework.remove();for(var _ in l.clipPaths)l.clipPaths[_].remove()}}}q.exports={attr:e,name:t,idRoot:t,idRegex:r,attrRegex:r,attributes:i,layoutAttributes:hk(),supplyLayoutDefaults:qH(),plot:a,clean:n,toSVG:Zf().toSVG}}}),pk=Ze({"src/traces/scattersmith/attributes.js"(Z,q){"use strict";var v=Cs().hovertemplateAttrs,x=Cs().texttemplateAttrs,A=rs().extendFlat,M=$d(),e=tf(),t=eu(),r=e.line;q.exports={mode:e.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:e.text,texttemplate:x({editType:"plot"},{keys:["real","imag","text"]}),hovertext:e.hovertext,line:{color:r.color,width:r.width,dash:r.dash,backoff:r.backoff,shape:A({},r.shape,{values:["linear","spline"]}),smoothing:r.smoothing,editType:"calc"},connectgaps:e.connectgaps,marker:e.marker,cliponaxis:A({},e.cliponaxis,{dflt:!1}),textposition:e.textposition,textfont:e.textfont,fill:A({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:M(),hoverinfo:A({},t.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:e.hoveron,hovertemplate:v(),selected:e.selected,unselected:e.unselected}}}),HH=Ze({"src/traces/scattersmith/defaults.js"(Z,q){"use strict";var v=ca(),x=Fu(),A=md(),M=Dd(),e=o1(),t=zd(),r=ev(),i=Tv().PTS_LINESONLY,a=pk();q.exports=function(s,c,h,m){function d(_,w){return v.coerce(s,c,a,_,w)}var T=n(s,c,m,d);if(!T){c.visible=!1;return}d("mode",T<i?"lines+markers":"lines"),d("text"),d("hovertext"),c.hoveron!=="fills"&&d("hovertemplate"),x.hasMarkers(c)&&A(s,c,h,m,d,{gradient:!0}),x.hasLines(c)&&(M(s,c,h,m,d,{backoff:!0}),e(s,c,d),d("connectgaps")),x.hasText(c)&&(d("texttemplate"),t(s,c,m,d));var l=[];(x.hasMarkers(c)||x.hasText(c))&&(d("cliponaxis"),d("marker.maxdisplayed"),l.push("points")),d("fill"),c.fill!=="none"&&(r(s,c,h,d),x.hasLines(c)||e(s,c,d)),(c.fill==="tonext"||c.fill==="toself")&&l.push("fills"),d("hoveron",l.join("+")||"points"),v.coerceSelectionMarkerOpacity(c,d)};function n(o,s,c,h){var m=h("real"),d=h("imag"),T;return m&&d&&(T=Math.min(m.length,d.length)),v.isTypedArray(m)&&(s.real=m=Array.from(m)),v.isTypedArray(d)&&(s.imag=d=Array.from(d)),s._length=T,T}}}),WH=Ze({"src/traces/scattersmith/format_labels.js"(Z,q){"use strict";var v=Wo();q.exports=function(A,M,e){var t={},r=e[M.subplot]._subplot;return t.realLabel=v.tickText(r.radialAxis,A.real,!0).text,t.imagLabel=v.tickText(r.angularAxis,A.imag,!0).text,t}}}),XH=Ze({"src/traces/scattersmith/calc.js"(Z,q){"use strict";var v=is(),x=Vs().BADNUM,A=Fd(),M=Av(),e=Od(),t=Bd().calcMarkerSize;q.exports=function(i,a){for(var n=i._fullLayout,o=a.subplot,s=n[o].realaxis,c=n[o].imaginaryaxis,h=s.makeCalcdata(a,"real"),m=c.makeCalcdata(a,"imag"),d=a._length,T=new Array(d),l=0;l<d;l++){var _=h[l],w=m[l],S=T[l]={};v(_)&&v(w)?(S.real=_,S.imag=w):S.real=x}return t(a,d),A(i,a),M(T,a),e(T,a),T}}}),ZH=Ze({"src/traces/scattersmith/plot.js"(Z,q){"use strict";var v=s1(),x=Vs().BADNUM,A=nk(),M=A.smith;q.exports=function(t,r,i){for(var a=r.layers.frontplot.select("g.scatterlayer"),n=r.xaxis,o=r.yaxis,s={xaxis:n,yaxis:o,plot:r.framework,layerClipId:r._hasClipOnAxisFalse?r.clipIds.forTraces:null},c=0;c<i.length;c++)for(var h=i[c],m=0;m<h.length;m++){m===0&&(h[0].trace._xA=n,h[0].trace._yA=o);var d=h[m],T=d.real;if(T===x)d.x=d.y=x;else{var l=M([T,d.imag]);d.x=l[0],d.y=l[1]}}v(t,s,i,a)}}}),YH=Ze({"src/traces/scattersmith/hover.js"(Z,q){"use strict";var v=u1();function x(M,e,t,r){var i=v(M,e,t,r);if(!(!i||i[0].index===!1)){var a=i[0];if(a.index===void 0)return i;var n=M.subplot,o=a.cd[a.index],s=a.trace;if(n.isPtInside(o))return a.xLabelVal=void 0,a.yLabelVal=void 0,A(o,s,n,a),a.hovertemplate=s.hovertemplate,i}}function A(M,e,t,r){var i=t.radialAxis,a=t.angularAxis;i._hovertitle="real",a._hovertitle="imag";var n={};n[e.subplot]={_subplot:t};var o=e._module.formatLabels(M,e,n);r.realLabel=o.realLabel,r.imagLabel=o.imagLabel;var s=M.hi||e.hoverinfo,c=[];function h(d,T){c.push(d._hovertitle+": "+T)}if(!e.hovertemplate){var m=s.split("+");m.indexOf("all")!==-1&&(m=["real","imag","text"]),m.indexOf("real")!==-1&&h(i,r.realLabel),m.indexOf("imag")!==-1&&h(a,r.imagLabel),m.indexOf("text")!==-1&&r.text&&(c.push(r.text),delete r.text),r.extraText=c.join("<br>")}}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<l.minMonth;)c--,h+=l.monthsInYear(c);for(var _=l.monthsInYear(c);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.monthsInYear(s)&&n>=this.minDay&&n-this.minDay<this.daysInMonth(s)}return this._validateLevel--,o},toJSDate:function(i,a,n){var o=this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);return r.instance().fromJD(this.toJD(o)).toJSDate()},fromJSDate:function(i){return this.fromJD(r.instance().fromJSDate(i).toJD())},_validate:function(i,a,n,o){if(i.year){if(this._validateLevel===0&&this.name!==i.calendar().name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,i.calendar().local.name);return i}try{if(this._validateLevel++,this._validateLevel===1&&!this.isValid(i,a,n))throw o.replace(/\{0\}/,this.local.name);var s=this.newDate(i,a,n);return this._validateLevel--,s}catch(c){throw this._validateLevel--,c}}});function t(i){this.local=this.regionalOptions[i]||this.regionalOptions[""]}t.prototype=new e,v(t.prototype,{name:"Gregorian",jdEpoch:17214255e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],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(n){var a=this._validate(n,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),n=a.year()+(a.year()<0?1:0);return n%4===0&&(n%100!==0||n%400===0)},weekOfYear:function(i,a,n){var o=this.newDate(i,a,n);return o.add(4-(o.dayOfWeek()||7),"d"),Math.floor((o.dayOfYear()-1)/7)+1},daysInMonth:function(i,a){var n=this._validate(i,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(i,a,n){return(this.dayOfWeek(i,a,n)||7)<6},toJD:function(i,a,n){var o=this._validate(i,a,n,r.local.invalidDate||r.regionalOptions[""].invalidDate);i=o.year(),a=o.month(),n=o.day(),i<0&&i++,a<3&&(a+=12,i--);var s=Math.floor(i/100),c=2-s+Math.floor(s/4);return Math.floor(365.25*(i+4716))+Math.floor(30.6001*(a+1))+n+c-1524.5},fromJD:function(i){var a=Math.floor(i+.5),n=Math.floor((a-186721625e-2)/36524.25);n=a+1+n-Math.floor(n/4);var o=n+1524,s=Math.floor((o-122.1)/365.25),c=Math.floor(365.25*s),h=Math.floor((o-c)/30.6001),m=o-c-Math.floor(h*30.6001),d=h-(h>13.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+g<v.length&&v.charAt(w+g)===S;)g++;return w+=g-1,Math.floor(g/(E||1))>1},o=function(S,E,g,b){var p=""+E;if(n(S,b))for(;p.length<g;)p="0"+p;return p},s=function(S,E,g,b){return n(S)?b[E]:g[E]},c=this,h=function(S){return typeof t=="function"?t.call(c,S,n("m")):T(o("m",S.month(),2))},m=function(S,E){return E?typeof i=="function"?i.call(c,S):i[S.month()-c.minMonth]:typeof r=="function"?r.call(c,S):r[S.month()-c.minMonth]},d=this.local.digits,T=function(S){return A.localNumbers&&d?d(S):S},l="",_=!1,w=0;w<v.length;w++)if(_)v.charAt(w)==="'"&&!n("'")?_=!1:l+=v.charAt(w);else switch(v.charAt(w)){case"d":l+=T(o("d",x.day(),2));break;case"D":l+=s("D",x.dayOfWeek(),M,e);break;case"o":l+=o("o",x.dayOfYear(),3);break;case"w":l+=o("w",x.weekOfYear(),2);break;case"m":l+=h(x);break;case"M":l+=m(x,n("M"));break;case"y":l+=n("y",2)?x.year():(x.year()%100<10?"0":"")+x.year()%100;break;case"Y":n("Y",2),l+=x.formatYear();break;case"J":l+=x.toJD();break;case"@":l+=(x.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":l+=(x.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":n("'")?l+="'":_=!0;break;default:l+=v.charAt(w)}return l},parseDate:function(v,x,A){if(x==null)throw q.local.invalidArguments||q.regionalOptions[""].invalidArguments;if(x=typeof x=="object"?x.toString():x+"",x==="")return null;v=v||this.local.dateFormat,A=A||{};var M=A.shortYearCutoff||this.shortYearCutoff;M=typeof M!="string"?M:this.today().year()%100+parseInt(M,10);for(var e=A.dayNamesShort||this.local.dayNamesShort,t=A.dayNames||this.local.dayNames,r=A.parseMonth||this.local.parseMonth,i=A.monthNumbers||this.local.monthNumbers,a=A.monthNamesShort||this.local.monthNamesShort,n=A.monthNames||this.local.monthNames,o=-1,s=-1,c=-1,h=-1,m=-1,d=!1,T=!1,l=function(P,L){for(var z=1;u+z<v.length&&v.charAt(u+z)===P;)z++;return u+=z-1,Math.floor(z/(L||1))>1},_=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<B.length;O++)if(x.substr(p,B[O].length).toLowerCase()===B[O].toLowerCase())return p+=B[O].length,O+w.minMonth;throw(q.local.unknownNameAt||q.regionalOptions[""].unknownNameAt).replace(/\{0\}/,p)},g=function(){if(typeof n=="function"){var P=l("M")?n.call(w,x.substring(p)):a.call(w,x.substring(p));return p+=P.length,P}return E("M",a,n)},b=function(){if(x.charAt(p)!==v.charAt(u))throw(q.local.unexpectedLiteralAt||q.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,p);p++},p=0,u=0;u<v.length;u++)if(T)v.charAt(u)==="'"&&!l("'")?T=!1:b();else switch(v.charAt(u)){case"d":h=_("d");break;case"D":E("D",e,t);break;case"o":m=_("o");break;case"w":_("w");break;case"m":c=S();break;case"M":c=g();break;case"y":var y=u;d=!l("y",2),u=y,s=_("y",2);break;case"Y":s=_("Y",2);break;case"J":o=_("J")+.5,x.charAt(p)==="."&&(p++,_("J"));break;case"@":o=_("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":o=_("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":p=x.length;break;case"'":l("'")?b():T=!0;break;default:b()}if(p<x.length)throw q.local.unexpectedText||q.regionalOptions[""].unexpectedText;if(s===-1?s=this.today().year():s<100&&d&&(s+=M===-1?1900:this.today().year()-this.today().year()%100-(s<=M?0:100)),typeof c=="string"&&(c=r.call(this,s,c)),m>-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<c?m=s+1:m=s:m=s+1,m},intercalaryMonth:function(o){o=this._validateYear(o);var s=r[o-r[0]],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<L)break;p-=L}var z=f>>13;return!z||P<z?(d.isIntercalary=!1,d.month=1+P):P===z?(d.isIntercalary=!0,d.month=P):(d.isIntercalary=!1,d.month=P),d.day=1+p,d}function n(o,s,c,h,m){var d,T;if(typeof o=="object")T=o,d=s||{};else{var l=typeof o=="number"&&o>=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<p;u++){var y=g&1<<12-u?30:29;E+=y}var f=i[T.year-i[0]],P=f>>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<M;a++)i+=this.daysInMonth(A,a)}else for(var a=7;a<M;a++)i+=this.daysInMonth(A,a);return i},_delay1:function(A){var M=Math.floor((235*A-234)/19),e=12084+13753*M,t=M*29+Math.floor(e/25920);return x(3*(t+1),7)<3&&t++,t},_delay2:function(A){var M=this._delay1(A-1),e=this._delay1(A),t=this._delay1(A+1);return t-e===356?2:e-M===382?1:0},fromJD:function(A){A=Math.floor(A)+.5;for(var M=Math.floor((A-this.jdEpoch)*98496/35975351)-1;A>=this.toJD(M===-1?1:M+1,7,1);)M++;for(var e=A<this.toJD(M,1,1)?7:1;A>this.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;t<M.length;t++){var r=parseInt(M[t],10);if(Math.abs(r)>19||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<t.month();a++)i+=this.daysPerMonth[a-1];return i+x.toJD(r+1468,3,13)},fromJD:function(A){A=Math.floor(A+.5);for(var M=Math.floor((A-(this.jdEpoch-1))/366);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<x+2;M++)typeof this.NEPALI_CALENDAR_DATA[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;i<A;i++)x(i)&&r++;else if(A<0)for(var i=A;i<0;i++)x(i)&&r--;return e+(M<=7?(M-1)*31:(M-1)*30+6)+(A>0?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;i<x.length;i++){if(x[i]>t)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;t<x.length&&!(x[t]>M);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;y<p.length;y++)r(g,b,p[y]+"calendar",u.calendar)},a={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},n={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},o={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},s="##",c={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:s,w:s,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}};function h(g,b,p){for(var u=Math.floor((b+.05)/e)+M,y=d(p).fromJD(u),f=0,P,L,z,F,B;(f=g.indexOf("%",f))!==-1;)P=g.charAt(f+1),P==="0"||P==="-"||P==="_"?(z=3,L=g.charAt(f+2),P==="_"&&(P="-")):(L=P,P="0",z=2),F=c[L],F?(F===s?B=s:B=y.formatDate(F[P]),g=g.substr(0,f)+B+g.substr(f+z),f+=B.length):f+=z;return g}var m={};function d(g){var b=m[g];return b||(b=m[g]=v.instance(g),b)}function T(g){return x.extendFlat({},t,{description:g})}function l(g){return"Sets the calendar system to use with `"+g+"` date data."}var _={xcalendar:T(l("x"))},w=x.extendFlat({},_,{ycalendar:T(l("y"))}),S=x.extendFlat({},w,{zcalendar:T(l("z"))}),E=T(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));q.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:w,bar:w,box:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:S,surface:S,mesh3d:S,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:T(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:E},yaxis:{calendar:E},scene:{xaxis:{calendar:E},yaxis:{calendar:E},zaxis:{calendar:E}},polar:{radialaxis:{calendar:E}}}},layoutAttributes:t,handleDefaults:r,handleTraceDefaults:i,CANONICAL_SUNDAY:n,CANONICAL_TICK:a,DFLTRANGE:o,getCal:d,worldCalFmt:h}}}),vW=Ze({"lib/calendars.js"(Z,q){"use strict";q.exports=dW()}}),mW=Ze({"lib/index.js"(Z,q){var v=XB();v.register([JB(),e4(),n4(),u4(),p4(),g4(),x4(),P4(),U4(),J4(),s7(),E9(),R9(),_N(),CN(),FN(),qN(),oU(),cU(),hU(),mU(),bU(),MU(),LU(),HU(),ZU(),PV(),WV(),iq(),fq(),bq(),Sq(),Rq(),Wq(),Kq(),nG(),_G(),SG(),IG(),tH(),uH(),dH(),_H(),TH(),CH(),FH(),VH(),JH(),vW()]),q.exports=v}});return mW()})();return window.Plotly=le,le})});var cX=typeof global=="object"&&global&&global.Object===Object&&global,_b=cX;var fX=typeof self=="object"&&self&&self.Object===Object&&self,hX=_b||fX||Function("return this")(),_u=hX;var pX=_u.Symbol,If=pX;var Wk=Object.prototype,dX=Wk.hasOwnProperty,vX=Wk.toString,a_=If?If.toStringTag:void 0;function mX(le){var ge=dX.call(le,a_),Ye=le[a_];try{le[a_]=void 0;var Pt=!0}catch{}var vr=vX.call(le);return Pt&&(ge?le[a_]=Ye:delete le[a_]),vr}var Xk=mX;var gX=Object.prototype,yX=gX.toString;function _X(le){return yX.call(le)}var Zk=_X;var xX="[object Null]",bX="[object Undefined]",Yk=If?If.toStringTag:void 0;function wX(le){return le==null?le===void 0?bX:xX:Yk&&Yk in Object(le)?Xk(le):Zk(le)}var zc=wX;function TX(le){return le!=null&&typeof le=="object"}var Rl=TX;var AX="[object Symbol]";function SX(le){return typeof le=="symbol"||Rl(le)&&zc(le)==AX}var Rf=SX;var MX=NaN;function EX(le){return typeof le=="number"?le:Rf(le)?MX:+le}var wA=EX;function CX(le,ge){for(var Ye=-1,Pt=le==null?0:le.length,vr=Array(Pt);++Ye<Pt;)vr[Ye]=ge(le[Ye],Ye,le);return vr}var Sl=CX;var kX=Array.isArray,Do=kX;var LX=1/0,Kk=If?If.prototype:void 0,Jk=Kk?Kk.toString:void 0;function $k(le){if(typeof le=="string")return le;if(Do(le))return Sl(le,$k)+"";if(Rf(le))return Jk?Jk.call(le):"";var ge=le+"";return ge=="0"&&1/le==-LX?"-0":ge}var ah=$k;function PX(le,ge){return function(Ye,Pt){var vr;if(Ye===void 0&&Pt===void 0)return ge;if(Ye!==void 0&&(vr=Ye),Pt!==void 0){if(vr===void 0)return Pt;typeof Ye=="string"||typeof Pt=="string"?(Ye=ah(Ye),Pt=ah(Pt)):(Ye=wA(Ye),Pt=wA(Pt)),vr=le(Ye,Pt)}return vr}}var bm=PX;var IX=bm(function(le,ge){return le+ge},0),Qk=IX;var RX=/\s/;function DX(le){for(var ge=le.length;ge--&&RX.test(le.charAt(ge)););return ge}var xb=DX;var zX=/^\s+/;function FX(le){return le&&le.slice(0,xb(le)+1).replace(zX,"")}var bb=FX;function OX(le){var ge=typeof le;return le!=null&&(ge=="object"||ge=="function")}var kl=OX;var eL=NaN,BX=/^[-+]0x[0-9a-f]+$/i,NX=/^0b[01]+$/i,UX=/^0o[0-7]+$/i,jX=parseInt;function VX(le){if(typeof le=="number")return le;if(Rf(le))return eL;if(kl(le)){var ge=typeof le.valueOf=="function"?le.valueOf():le;le=kl(ge)?ge+"":ge}if(typeof le!="string")return le===0?le:+le;le=bb(le);var Ye=NX.test(le);return Ye||UX.test(le)?jX(le.slice(2),Ye?2:8):BX.test(le)?eL:+le}var Th=VX;var tL=1/0,qX=17976931348623157e292;function GX(le){if(!le)return le===0?le:0;if(le=Th(le),le===tL||le===-tL){var ge=le<0?-1:1;return ge*qX}return le===le?le:0}var sd=GX;function HX(le){var ge=sd(le),Ye=ge%1;return ge===ge?Ye?ge-Ye:ge:0}var Go=HX;var WX="Expected a function";function XX(le,ge){if(typeof ge!="function")throw new TypeError(WX);return le=Go(le),function(){if(--le<1)return ge.apply(this,arguments)}}var rL=XX;function ZX(le){return le}var Fc=ZX;var YX="[object AsyncFunction]",KX="[object Function]",JX="[object GeneratorFunction]",$X="[object Proxy]";function QX(le){if(!kl(le))return!1;var ge=zc(le);return ge==KX||ge==JX||ge==YX||ge==$X}var ap=QX;var eZ=_u["__core-js_shared__"],X0=eZ;var aL=function(){var le=/[^.]+$/.exec(X0&&X0.keys&&X0.keys.IE_PROTO||"");return le?"Symbol(src)_1."+le:""}();function tZ(le){return!!aL&&aL in le}var nL=tZ;var rZ=Function.prototype,aZ=rZ.toString;function nZ(le){if(le!=null){try{return aZ.call(le)}catch{}try{return le+""}catch{}}return""}var jv=nZ;var iZ=/[\\^$.*+?()[\]{}|]/g,oZ=/^\[object .+?Constructor\]$/,sZ=Function.prototype,lZ=Object.prototype,uZ=sZ.toString,cZ=lZ.hasOwnProperty,fZ=RegExp("^"+uZ.call(cZ).replace(iZ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hZ(le){if(!kl(le)||nL(le))return!1;var ge=ap(le)?fZ:oZ;return ge.test(jv(le))}var wb=hZ;function pZ(le,ge){return le?.[ge]}var iL=pZ;function dZ(le,ge){var Ye=iL(le,ge);return wb(Ye)?Ye:void 0}var ld=dZ;var vZ=ld(_u,"WeakMap"),Ug=vZ;var mZ=Ug&&new Ug,Z0=mZ;var gZ=Z0?function(le,ge){return Z0.set(le,ge),le}:Fc,Tb=gZ;var oL=Object.create,yZ=function(){function le(){}return function(ge){if(!kl(ge))return{};if(oL)return oL(ge);le.prototype=ge;var Ye=new le;return le.prototype=void 0,Ye}}(),Td=yZ;function _Z(le){return function(){var ge=arguments;switch(ge.length){case 0:return new le;case 1:return new le(ge[0]);case 2:return new le(ge[0],ge[1]);case 3:return new le(ge[0],ge[1],ge[2]);case 4:return new le(ge[0],ge[1],ge[2],ge[3]);case 5:return new le(ge[0],ge[1],ge[2],ge[3],ge[4]);case 6:return new le(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5]);case 7:return new le(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6])}var Ye=Td(le.prototype),Pt=le.apply(Ye,ge);return kl(Pt)?Pt:Ye}}var Vv=_Z;var xZ=1;function bZ(le,ge,Ye){var Pt=ge&xZ,vr=Vv(le);function Zr(){var ka=this&&this!==_u&&this instanceof Zr?vr:le;return ka.apply(Pt?Ye:this,arguments)}return Zr}var sL=bZ;function wZ(le,ge,Ye){switch(Ye.length){case 0:return le.call(ge);case 1:return le.call(ge,Ye[0]);case 2:return le.call(ge,Ye[0],Ye[1]);case 3:return le.call(ge,Ye[0],Ye[1],Ye[2])}return le.apply(ge,Ye)}var _f=wZ;var TZ=Math.max;function AZ(le,ge,Ye,Pt){for(var vr=-1,Zr=le.length,ka=Ye.length,sn=-1,fn=ge.length,Li=TZ(Zr-ka,0),bi=Array(fn+Li),Fi=!Pt;++sn<fn;)bi[sn]=ge[sn];for(;++vr<ka;)(Fi||vr<Zr)&&(bi[Ye[vr]]=le[vr]);for(;Li--;)bi[sn++]=le[vr++];return bi}var Ab=AZ;var SZ=Math.max;function MZ(le,ge,Ye,Pt){for(var vr=-1,Zr=le.length,ka=-1,sn=Ye.length,fn=-1,Li=ge.length,bi=SZ(Zr-sn,0),Fi=Array(bi+Li),Uo=!Pt;++vr<bi;)Fi[vr]=le[vr];for(var ws=vr;++fn<Li;)Fi[ws+fn]=ge[fn];for(;++ka<sn;)(Uo||vr<Zr)&&(Fi[ws+Ye[ka]]=le[vr++]);return Fi}var Sb=MZ;function EZ(le,ge){for(var Ye=le.length,Pt=0;Ye--;)le[Ye]===ge&&++Pt;return Pt}var lL=EZ;function CZ(){}var wm=CZ;var kZ=4294967295;function Mb(le){this.__wrapped__=le,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=kZ,this.__views__=[]}Mb.prototype=Td(wm.prototype);Mb.prototype.constructor=Mb;var Bl=Mb;function LZ(){}var Y0=LZ;var PZ=Z0?function(le){return Z0.get(le)}:Y0,K0=PZ;var IZ={},Tm=IZ;var RZ=Object.prototype,DZ=RZ.hasOwnProperty;function zZ(le){for(var ge=le.name+"",Ye=Tm[ge],Pt=DZ.call(Tm,ge)?Ye.length:0;Pt--;){var vr=Ye[Pt],Zr=vr.func;if(Zr==null||Zr==le)return vr.name}return ge}var J0=zZ;function Eb(le,ge){this.__wrapped__=le,this.__actions__=[],this.__chain__=!!ge,this.__index__=0,this.__values__=void 0}Eb.prototype=Td(wm.prototype);Eb.prototype.constructor=Eb;var Ip=Eb;function FZ(le,ge){var Ye=-1,Pt=le.length;for(ge||(ge=Array(Pt));++Ye<Pt;)ge[Ye]=le[Ye];return ge}var ff=FZ;function OZ(le){if(le instanceof Bl)return le.clone();var ge=new Ip(le.__wrapped__,le.__chain__);return ge.__actions__=ff(le.__actions__),ge.__index__=le.__index__,ge.__values__=le.__values__,ge}var Cb=OZ;var BZ=Object.prototype,NZ=BZ.hasOwnProperty;function kb(le){if(Rl(le)&&!Do(le)&&!(le instanceof Bl)){if(le instanceof Ip)return le;if(NZ.call(le,"__wrapped__"))return Cb(le)}return new Ip(le)}kb.prototype=wm.prototype;kb.prototype.constructor=kb;var _a=kb;function UZ(le){var ge=J0(le),Ye=_a[ge];if(typeof Ye!="function"||!(ge in Bl.prototype))return!1;if(le===Ye)return!0;var Pt=K0(Ye);return!!Pt&&le===Pt[0]}var n_=UZ;var jZ=800,VZ=16,qZ=Date.now;function GZ(le){var ge=0,Ye=0;return function(){var Pt=qZ(),vr=VZ-(Pt-Ye);if(Ye=Pt,vr>0){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<Pt&&ge(le[Ye],Ye,le)!==!1;);return le}var Nh=tY;function rY(le,ge,Ye,Pt){for(var vr=le.length,Zr=Ye+(Pt?1:-1);Pt?Zr--:++Zr<vr;)if(ge(le[Zr],Zr,le))return Zr;return-1}var Am=rY;function aY(le){return le!==le}var Ib=aY;function nY(le,ge,Ye){for(var Pt=Ye-1,vr=le.length;++Pt<vr;)if(le[Pt]===ge)return Pt;return-1}var hL=nY;function iY(le,ge,Ye){return ge===ge?hL(le,ge,Ye):Am(le,Ib,Ye)}var Ad=iY;function oY(le,ge){var Ye=le==null?0:le.length;return!!Ye&&Ad(le,ge,0)>-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&&le<ge}var np=EY;var CY=Math.min;function kY(le,ge){for(var Ye=le.length,Pt=CY(ge.length,Ye),vr=ff(le);Pt--;){var Zr=ge[Pt];le[Pt]=np(Zr,Ye)?vr[Zr]:void 0}return le}var mL=kY;var gL="__lodash_placeholder__";function LY(le,ge){for(var Ye=-1,Pt=le.length,vr=0,Zr=[];++Ye<Pt;){var ka=le[Ye];(ka===ge||ka===gL)&&(le[Ye]=gL,Zr[vr++]=Ye)}return Zr}var Yp=LY;var PY=1,IY=2,RY=8,DY=16,zY=128,FY=512;function yL(le,ge,Ye,Pt,vr,Zr,ka,sn,fn,Li){var bi=ge&zY,Fi=ge&PY,Uo=ge&IY,ws=ge&(RY|DY),mo=ge&FY,Ze=Uo?void 0:Vv(le);function Ws(){for(var Yl=arguments.length,cu=Array(Yl),ih=Yl;ih--;)cu[ih]=arguments[ih];if(ws)var Eh=Sd(Ws),Bp=lL(cu,Eh);if(Pt&&(cu=Ab(cu,Pt,vr,ws)),Zr&&(cu=Sb(cu,Zr,ka,ws)),Yl-=Bp,ws&&Yl<Li){var Oi=Yp(cu,Eh);return Db(le,ge,yL,Ws.placeholder,Ye,cu,Oi,sn,fn,Li-Yl)}var $p=Fi?Ye:this,Np=Uo?$p[le]:le;return Yl=cu.length,sn?cu=mL(cu,sn):mo&&Yl>1&&cu.reverse(),bi&&fn<Yl&&(cu.length=fn),this&&this!==_u&&this instanceof Ws&&(Np=Ze||Vv(Np)),Np.apply($p,cu)}return Ws}var ty=yL;function OY(le,ge,Ye){var Pt=Vv(le);function vr(){for(var Zr=arguments.length,ka=Array(Zr),sn=Zr,fn=Sd(vr);sn--;)ka[sn]=arguments[sn];var Li=Zr<3&&ka[0]!==fn&&ka[Zr-1]!==fn?[]:Yp(ka,fn);if(Zr-=Li.length,Zr<Ye)return Db(le,ge,ty,vr.placeholder,void 0,ka,Li,void 0,void 0,Ye-Zr);var bi=this&&this!==_u&&this instanceof vr?Pt:le;return _f(bi,this,ka)}return vr}var _L=OY;var BY=1;function NY(le,ge,Ye,Pt){var vr=ge&BY,Zr=Vv(le);function ka(){for(var sn=-1,fn=arguments.length,Li=-1,bi=Pt.length,Fi=Array(bi+fn),Uo=this&&this!==_u&&this instanceof ka?Zr:le;++Li<bi;)Fi[Li]=Pt[Li];for(;fn--;)Fi[Li++]=arguments[++sn];return _f(Uo,vr?Ye:this,Fi)}return ka}var xL=NY;var bL="__lodash_placeholder__",TA=1,UY=2,jY=4,wL=8,i_=128,TL=256,VY=Math.min;function qY(le,ge){var Ye=le[1],Pt=ge[1],vr=Ye|Pt,Zr=vr<(TA|UY|i_),ka=Pt==i_&&Ye==wL||Pt==i_&&Ye==TL&&le[7].length<=ge[8]||Pt==(i_|TL)&&ge[7].length<=ge[8]&&Ye==wL;if(!(Zr||ka))return le;Pt&TA&&(le[2]=ge[2],vr|=Ye&TA?0:jY);var sn=ge[3];if(sn){var fn=le[3];le[3]=fn?Ab(fn,sn,ge[4]):sn,le[4]=fn?Yp(le[3],bL):ge[4]}return sn=ge[5],sn&&(fn=le[5],le[5]=fn?Sb(fn,sn,ge[6]):sn,le[6]=fn?Yp(le[5],bL):ge[6]),sn=ge[7],sn&&(le[7]=sn),Pt&i_&&(le[8]=le[8]==null?ge[8]:VY(le[8],ge[8])),le[9]==null&&(le[9]=ge[9]),le[0]=ge[0],le[1]=vr,le}var AL=qY;var GY="Expected a function",SL=1,HY=2,AA=8,SA=16,MA=32,ML=64,EL=Math.max;function WY(le,ge,Ye,Pt,vr,Zr,ka,sn){var fn=ge&HY;if(!fn&&typeof le!="function")throw new TypeError(GY);var Li=Pt?Pt.length:0;if(Li||(ge&=~(MA|ML),Pt=vr=void 0),ka=ka===void 0?ka:EL(Go(ka),0),sn=sn===void 0?sn:Go(sn),Li-=vr?vr.length:0,ge&ML){var bi=Pt,Fi=vr;Pt=vr=void 0}var Uo=fn?void 0:K0(le),ws=[le,ge,Ye,Pt,vr,bi,Fi,Zr,ka,sn];if(Uo&&AL(ws,Uo),le=ws[0],ge=ws[1],Ye=ws[2],Pt=ws[3],vr=ws[4],sn=ws[9]=ws[9]===void 0?fn?0:le.length:EL(ws[9]-Li,0),!sn&&ge&(AA|SA)&&(ge&=~(AA|SA)),!ge||ge==SL)var mo=sL(le,ge,Ye);else ge==AA||ge==SA?mo=_L(le,ge,sn):(ge==MA||ge==(SL|MA))&&!vr.length?mo=xL(le,ge,Ye,Pt):mo=ty.apply(void 0,ws);var Ze=Uo?Tb:Pb;return Rb(Ze(mo,ws),le,ge)}var ip=WY;var XY=128;function ZY(le,ge,Ye){return ge=Ye?void 0:ge,ge=le&&ge==null?le.length:ge,ip(le,XY,void 0,void 0,void 0,void 0,ge)}var zb=ZY;function YY(le,ge,Ye){ge=="__proto__"&&Q0?Q0(le,ge,{configurable:!0,enumerable:!0,value:Ye,writable:!0}):le[ge]=Ye}var op=YY;function KY(le,ge){return le===ge||le!==le&&ge!==ge}var nh=KY;var JY=Object.prototype,$Y=JY.hasOwnProperty;function QY(le,ge,Ye){var Pt=le[ge];(!($Y.call(le,ge)&&nh(Pt,Ye))||Ye===void 0&&!(ge in le))&&op(le,ge,Ye)}var vv=QY;function eK(le,ge,Ye,Pt){var vr=!Ye;Ye||(Ye={});for(var Zr=-1,ka=ge.length;++Zr<ka;){var sn=ge[Zr],fn=Pt?Pt(Ye[sn],le[sn],sn,Ye,le):void 0;fn===void 0&&(fn=le[sn]),vr?op(Ye,sn,fn):vv(Ye,sn,fn)}return Ye}var Ah=eK;var CL=Math.max;function tK(le,ge,Ye){return ge=CL(ge===void 0?le.length-1:ge,0),function(){for(var Pt=arguments,vr=-1,Zr=CL(Pt.length-ge,0),ka=Array(Zr);++vr<Zr;)ka[vr]=Pt[ge+vr];vr=-1;for(var sn=Array(ge+1);++vr<ge;)sn[vr]=Pt[vr];return sn[ge]=Ye(ka),_f(le,this,sn)}}var Fb=tK;function rK(le,ge){return ey(Fb(le,ge,Fc),le+"")}var Ho=rK;var aK=9007199254740991;function nK(le){return typeof le=="number"&&le>-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<vr;){var sn=Ye[Pt];sn&&le(ge,sn,Pt,Zr)}return ge})}var Md=sK;var lK=Object.prototype;function uK(le){var ge=le&&le.constructor,Ye=typeof ge=="function"&&ge.prototype||lK;return le===Ye}var mv=uK;function cK(le,ge){for(var Ye=-1,Pt=Array(le);++Ye<le;)Pt[Ye]=ge(Ye);return Pt}var ry=cK;var fK="[object Arguments]";function hK(le){return Rl(le)&&zc(le)==fK}var EA=hK;var kL=Object.prototype,pK=kL.hasOwnProperty,dK=kL.propertyIsEnumerable,vK=EA(function(){return arguments}())?EA:function(le){return Rl(le)&&pK.call(le,"callee")&&!dK.call(le,"callee")},dd=vK;function mK(){return!1}var ay=mK;var IL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,LL=IL&&typeof module=="object"&&module&&!module.nodeType&&module,gK=LL&&LL.exports===IL,PL=gK?_u.Buffer:void 0,yK=PL?PL.isBuffer:void 0,_K=yK||ay,Kp=_K;var xK="[object Arguments]",bK="[object Array]",wK="[object Boolean]",TK="[object Date]",AK="[object Error]",SK="[object Function]",MK="[object Map]",EK="[object Number]",CK="[object Object]",kK="[object RegExp]",LK="[object Set]",PK="[object String]",IK="[object WeakMap]",RK="[object ArrayBuffer]",DK="[object DataView]",zK="[object Float32Array]",FK="[object Float64Array]",OK="[object Int8Array]",BK="[object Int16Array]",NK="[object Int32Array]",UK="[object Uint8Array]",jK="[object Uint8ClampedArray]",VK="[object Uint16Array]",qK="[object Uint32Array]",xf={};xf[zK]=xf[FK]=xf[OK]=xf[BK]=xf[NK]=xf[UK]=xf[jK]=xf[VK]=xf[qK]=!0;xf[xK]=xf[bK]=xf[RK]=xf[wK]=xf[DK]=xf[TK]=xf[AK]=xf[SK]=xf[MK]=xf[EK]=xf[CK]=xf[kK]=xf[LK]=xf[PK]=xf[IK]=!1;function GK(le){return Rl(le)&&Mm(le.length)&&!!xf[zc(le)]}var RL=GK;function HK(le){return function(ge){return le(ge)}}var bf=HK;var DL=typeof exports=="object"&&exports&&!exports.nodeType&&exports,o_=DL&&typeof module=="object"&&module&&!module.nodeType&&module,WK=o_&&o_.exports===DL,CA=WK&&_b.process,XK=function(){try{var le=o_&&o_.require&&o_.require("util").types;return le||CA&&CA.binding&&CA.binding("util")}catch{}}(),sp=XK;var zL=sp&&sp.isTypedArray,ZK=zL?bf(zL):RL,Ed=ZK;var YK=Object.prototype,KK=YK.hasOwnProperty;function JK(le,ge){var Ye=Do(le),Pt=!Ye&&dd(le),vr=!Ye&&!Pt&&Kp(le),Zr=!Ye&&!Pt&&!vr&&Ed(le),ka=Ye||Pt||vr||Zr,sn=ka?ry(le.length,String):[],fn=sn.length;for(var Li in le)(ge||KK.call(le,Li))&&!(ka&&(Li=="length"||vr&&(Li=="offset"||Li=="parent")||Zr&&(Li=="buffer"||Li=="byteLength"||Li=="byteOffset")||np(Li,fn)))&&sn.push(Li);return sn}var Ob=JK;function $K(le,ge){return function(Ye){return le(ge(Ye))}}var Bb=$K;var QK=Bb(Object.keys,Object),FL=QK;var eJ=Object.prototype,tJ=eJ.hasOwnProperty;function rJ(le){if(!mv(le))return FL(le);var ge=[];for(var Ye in Object(le))tJ.call(le,Ye)&&Ye!="constructor"&&ge.push(Ye);return ge}var ny=rJ;function aJ(le){return jc(le)?Ob(le):ny(le)}var du=aJ;var nJ=Object.prototype,iJ=nJ.hasOwnProperty,oJ=Md(function(le,ge){if(mv(ge)||jc(ge)){Ah(ge,du(ge),le);return}for(var Ye in ge)iJ.call(ge,Ye)&&vv(le,Ye,ge[Ye])}),OL=oJ;function sJ(le){var ge=[];if(le!=null)for(var Ye in Object(le))ge.push(Ye);return ge}var BL=sJ;var lJ=Object.prototype,uJ=lJ.hasOwnProperty;function cJ(le){if(!kl(le))return BL(le);var ge=mv(le),Ye=[];for(var Pt in le)Pt=="constructor"&&(ge||!uJ.call(le,Pt))||Ye.push(Pt);return Ye}var NL=cJ;function fJ(le){return jc(le)?Ob(le,!0):NL(le)}var Vc=fJ;var hJ=Md(function(le,ge){Ah(ge,Vc(ge),le)}),s_=hJ;var pJ=Md(function(le,ge,Ye,Pt){Ah(ge,Vc(ge),le,Pt)}),Em=pJ;var dJ=Md(function(le,ge,Ye,Pt){Ah(ge,du(ge),le,Pt)}),UL=dJ;var vJ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mJ=/^\w*$/;function gJ(le,ge){if(Do(le))return!1;var Ye=typeof le;return Ye=="number"||Ye=="symbol"||Ye=="boolean"||le==null||Rf(le)?!0:mJ.test(le)||!vJ.test(le)||ge!=null&&le in Object(ge)}var iy=gJ;var yJ=ld(Object,"create"),qv=yJ;function _J(){this.__data__=qv?qv(null):{},this.size=0}var jL=_J;function xJ(le){var ge=this.has(le)&&delete this.__data__[le];return this.size-=ge?1:0,ge}var VL=xJ;var bJ="__lodash_hash_undefined__",wJ=Object.prototype,TJ=wJ.hasOwnProperty;function AJ(le){var ge=this.__data__;if(qv){var Ye=ge[le];return Ye===bJ?void 0:Ye}return TJ.call(ge,le)?ge[le]:void 0}var qL=AJ;var SJ=Object.prototype,MJ=SJ.hasOwnProperty;function EJ(le){var ge=this.__data__;return qv?ge[le]!==void 0:MJ.call(ge,le)}var GL=EJ;var CJ="__lodash_hash_undefined__";function kJ(le,ge){var Ye=this.__data__;return this.size+=this.has(le)?0:1,Ye[le]=qv&&ge===void 0?CJ:ge,this}var HL=kJ;function oy(le){var ge=-1,Ye=le==null?0:le.length;for(this.clear();++ge<Ye;){var Pt=le[ge];this.set(Pt[0],Pt[1])}}oy.prototype.clear=jL;oy.prototype.delete=VL;oy.prototype.get=qL;oy.prototype.has=GL;oy.prototype.set=HL;var kA=oy;function LJ(){this.__data__=[],this.size=0}var WL=LJ;function PJ(le,ge){for(var Ye=le.length;Ye--;)if(nh(le[Ye][0],ge))return Ye;return-1}var Cm=PJ;var IJ=Array.prototype,RJ=IJ.splice;function DJ(le){var ge=this.__data__,Ye=Cm(ge,le);if(Ye<0)return!1;var Pt=ge.length-1;return Ye==Pt?ge.pop():RJ.call(ge,Ye,1),--this.size,!0}var XL=DJ;function zJ(le){var ge=this.__data__,Ye=Cm(ge,le);return Ye<0?void 0:ge[Ye][1]}var ZL=zJ;function FJ(le){return Cm(this.__data__,le)>-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();++ge<Ye;){var Pt=le[ge];this.set(Pt[0],Pt[1])}}sy.prototype.clear=WL;sy.prototype.delete=XL;sy.prototype.get=ZL;sy.prototype.has=YL;sy.prototype.set=KL;var km=sy;var BJ=ld(_u,"Map"),Lm=BJ;function NJ(){this.size=0,this.__data__={hash:new kA,map:new(Lm||km),string:new kA}}var JL=NJ;function UJ(le){var ge=typeof le;return ge=="string"||ge=="number"||ge=="symbol"||ge=="boolean"?le!=="__proto__":le===null}var $L=UJ;function jJ(le,ge){var Ye=le.__data__;return $L(ge)?Ye[typeof ge=="string"?"string":"hash"]:Ye.map}var Pm=jJ;function VJ(le){var ge=Pm(this,le).delete(le);return this.size-=ge?1:0,ge}var QL=VJ;function qJ(le){return Pm(this,le).get(le)}var eP=qJ;function GJ(le){return Pm(this,le).has(le)}var tP=GJ;function HJ(le,ge){var Ye=Pm(this,le),Pt=Ye.size;return Ye.set(le,ge),this.size+=Ye.size==Pt?0:1,this}var rP=HJ;function ly(le){var ge=-1,Ye=le==null?0:le.length;for(this.clear();++ge<Ye;){var Pt=le[ge];this.set(Pt[0],Pt[1])}}ly.prototype.clear=JL;ly.prototype.delete=QL;ly.prototype.get=eP;ly.prototype.has=tP;ly.prototype.set=rP;var jg=ly;var WJ="Expected a function";function LA(le,ge){if(typeof le!="function"||ge!=null&&typeof ge!="function")throw new TypeError(WJ);var Ye=function(){var Pt=arguments,vr=ge?ge.apply(this,Pt):Pt[0],Zr=Ye.cache;if(Zr.has(vr))return Zr.get(vr);var ka=le.apply(this,Pt);return Ye.cache=Zr.set(vr,ka)||Zr,ka};return Ye.cache=new(LA.Cache||jg),Ye}LA.Cache=jg;var Nb=LA;var XJ=500;function ZJ(le){var ge=Nb(le,function(Pt){return Ye.size===XJ&&Ye.clear(),Pt}),Ye=ge.cache;return ge}var aP=ZJ;var YJ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,KJ=/\\(\\)?/g,JJ=aP(function(le){var ge=[];return le.charCodeAt(0)===46&&ge.push(""),le.replace(YJ,function(Ye,Pt,vr,Zr){ge.push(vr?Zr.replace(KJ,"$1"):Pt||Ye)}),ge}),Ub=JJ;function $J(le){return le==null?"":ah(le)}var Ds=$J;function QJ(le,ge){return Do(le)?le:iy(le,ge)?[le]:Ub(Ds(le))}var Rp=QJ;var e$=1/0;function t$(le){if(typeof le=="string"||Rf(le))return le;var ge=le+"";return ge=="0"&&1/le==-e$?"-0":ge}var Sh=t$;function r$(le,ge){ge=Rp(ge,le);for(var Ye=0,Pt=ge.length;le!=null&&Ye<Pt;)le=le[Sh(ge[Ye++])];return Ye&&Ye==Pt?le:void 0}var ud=r$;function a$(le,ge,Ye){var Pt=le==null?void 0:ud(le,ge);return Pt===void 0?Ye:Pt}var uy=a$;function n$(le,ge){for(var Ye=-1,Pt=ge.length,vr=Array(Pt),Zr=le==null;++Ye<Pt;)vr[Ye]=Zr?void 0:uy(le,ge[Ye]);return vr}var cy=n$;function i$(le,ge){for(var Ye=-1,Pt=ge.length,vr=le.length;++Ye<Pt;)le[vr+Ye]=ge[Ye];return le}var Dp=i$;var nP=If?If.isConcatSpreadable:void 0;function o$(le){return Do(le)||dd(le)||!!(nP&&le&&le[nP])}var iP=o$;function oP(le,ge,Ye,Pt,vr){var Zr=-1,ka=le.length;for(Ye||(Ye=iP),vr||(vr=[]);++Zr<ka;){var sn=le[Zr];ge>0&&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<vr;)Zr[Pt]=le[Pt+ge];return Zr}var Xf=k$;function L$(le,ge,Ye){var Pt=le.length;return Ye=Ye===void 0?Pt:Ye,!ge&&Ye>=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<Zr;)Ye=ge(Ye,le[vr],vr,le);return Ye}var py=nQ;function iQ(le){return function(ge){return le?.[ge]}}var dy=iQ;var oQ={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},sQ=dy(oQ),_P=sQ;var lQ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,uQ="\\u0300-\\u036f",cQ="\\ufe20-\\ufe2f",fQ="\\u20d0-\\u20ff",hQ=uQ+cQ+fQ,pQ="["+hQ+"]",dQ=RegExp(pQ,"g");function vQ(le){return le=Ds(le),le&&le.replace(lQ,_P).replace(dQ,"")}var Xb=vQ;var mQ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function gQ(le){return le.match(mQ)||[]}var xP=gQ;var yQ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function _Q(le){return yQ.test(le)}var bP=_Q;var MP="\\ud800-\\udfff",xQ="\\u0300-\\u036f",bQ="\\ufe20-\\ufe2f",wQ="\\u20d0-\\u20ff",TQ=xQ+bQ+wQ,EP="\\u2700-\\u27bf",CP="a-z\\xdf-\\xf6\\xf8-\\xff",AQ="\\xac\\xb1\\xd7\\xf7",SQ="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",MQ="\\u2000-\\u206f",EQ=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",kP="A-Z\\xc0-\\xd6\\xd8-\\xde",CQ="\\ufe0e\\ufe0f",LP=AQ+SQ+MQ+EQ,PP="['\u2019]",wP="["+LP+"]",kQ="["+TQ+"]",IP="\\d+",LQ="["+EP+"]",RP="["+CP+"]",DP="[^"+MP+LP+IP+EP+CP+kP+"]",PQ="\\ud83c[\\udffb-\\udfff]",IQ="(?:"+kQ+"|"+PQ+")",RQ="[^"+MP+"]",zP="(?:\\ud83c[\\udde6-\\uddff]){2}",FP="[\\ud800-\\udbff][\\udc00-\\udfff]",vy="["+kP+"]",DQ="\\u200d",TP="(?:"+RP+"|"+DP+")",zQ="(?:"+vy+"|"+DP+")",AP="(?:"+PP+"(?:d|ll|m|re|s|t|ve))?",SP="(?:"+PP+"(?:D|LL|M|RE|S|T|VE))?",OP=IQ+"?",BP="["+CQ+"]?",FQ="(?:"+DQ+"(?:"+[RQ,zP,FP].join("|")+")"+BP+OP+")*",OQ="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",BQ="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",NQ=BP+OP+FQ,UQ="(?:"+[LQ,zP,FP].join("|")+")"+NQ,jQ=RegExp([vy+"?"+RP+"+"+AP+"(?="+[wP,vy,"$"].join("|")+")",zQ+"+"+SP+"(?="+[wP,vy+TP,"$"].join("|")+")",vy+"?"+TP+"+"+AP,vy+"+"+SP,BQ,OQ,IP,UQ].join("|"),"g");function VQ(le){return le.match(jQ)||[]}var NP=VQ;function qQ(le,ge,Ye){return le=Ds(le),ge=Ye?void 0:ge,ge===void 0?bP(le)?NP(le):xP(le):le.match(ge)||[]}var Zb=qQ;var GQ="['\u2019]",HQ=RegExp(GQ,"g");function WQ(le){return function(ge){return py(Zb(Xb(ge).replace(HQ,"")),le,"")}}var kd=WQ;var XQ=kd(function(le,ge,Ye){return ge=ge.toLowerCase(),le+(Ye?Wb(ge):ge)}),UP=XQ;function ZQ(){if(!arguments.length)return[];var le=arguments[0];return Do(le)?le:[le]}var jP=ZQ;var YQ=_u.isFinite,KQ=Math.min;function JQ(le){var ge=Math[le];return function(Ye,Pt){if(Ye=Th(Ye),Pt=Pt==null?0:KQ(Go(Pt),292),Pt&&YQ(Ye)){var vr=(Ds(Ye)+"e").split("e"),Zr=ge(vr[0]+"e"+(+vr[1]+Pt));return vr=(Ds(Zr)+"e").split("e"),+(vr[0]+"e"+(+vr[1]-Pt))}return ge(Ye)}}var my=JQ;var $Q=my("ceil"),VP=$Q;function QQ(le){var ge=_a(le);return ge.__chain__=!0,ge}var Yb=QQ;var eee=Math.ceil,tee=Math.max;function ree(le,ge,Ye){(Ye?Oc(le,ge,Ye):ge===void 0)?ge=1:ge=tee(Go(ge),0);var Pt=le==null?0:le.length;if(!Pt||ge<1)return[];for(var vr=0,Zr=0,ka=Array(eee(Pt/ge));vr<Pt;)ka[Zr++]=Xf(le,vr,vr+=ge);return ka}var qP=ree;function aee(le,ge,Ye){return le===le&&(Ye!==void 0&&(le=le<=Ye?le:Ye),ge!==void 0&&(le=le>=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.length<uee-1)return Pt.push([le,ge]),this.size=++Ye.size,this;Ye=this.__data__=new jg(Pt)}return Ye.set(le,ge),this.size=Ye.size,this}var YP=cee;function gy(le){var ge=this.__data__=new km(le);this.size=ge.size}gy.prototype.clear=HP;gy.prototype.delete=WP;gy.prototype.get=XP;gy.prototype.has=ZP;gy.prototype.set=YP;var yv=gy;function fee(le,ge){return le&&Ah(ge,du(ge),le)}var Kb=fee;function hee(le,ge){return le&&Ah(ge,Vc(ge),le)}var KP=hee;var e6=typeof exports=="object"&&exports&&!exports.nodeType&&exports,JP=e6&&typeof module=="object"&&module&&!module.nodeType&&module,pee=JP&&JP.exports===e6,$P=pee?_u.Buffer:void 0,QP=$P?$P.allocUnsafe:void 0;function dee(le,ge){if(ge)return le.slice();var Ye=le.length,Pt=QP?QP(Ye):new le.constructor(Ye);return le.copy(Pt),Pt}var Jb=dee;function vee(le,ge){for(var Ye=-1,Pt=le==null?0:le.length,vr=0,Zr=[];++Ye<Pt;){var ka=le[Ye];ge(ka,Ye,le)&&(Zr[vr++]=ka)}return Zr}var Fp=vee;function mee(){return[]}var yy=mee;var gee=Object.prototype,yee=gee.propertyIsEnumerable,t6=Object.getOwnPropertySymbols,_ee=t6?function(le){return le==null?[]:(le=Object(le),Fp(t6(le),function(ge){return yee.call(le,ge)}))}:yy,_y=_ee;function xee(le,ge){return Ah(le,_y(le),ge)}var r6=xee;var bee=Object.getOwnPropertySymbols,wee=bee?function(le){for(var ge=[];le;)Dp(ge,_y(le)),le=Im(le);return ge}:yy,$b=wee;function Tee(le,ge){return Ah(le,$b(le),ge)}var a6=Tee;function Aee(le,ge,Ye){var Pt=ge(le);return Do(le)?Pt:Dp(Pt,Ye(le))}var Qb=Aee;function See(le){return Qb(le,du,_y)}var l_=See;function Mee(le){return Qb(le,Vc,$b)}var xy=Mee;var Eee=ld(_u,"DataView"),ew=Eee;var Cee=ld(_u,"Promise"),tw=Cee;var kee=ld(_u,"Set"),Rm=kee;var n6="[object Map]",Lee="[object Object]",i6="[object Promise]",o6="[object Set]",s6="[object WeakMap]",l6="[object DataView]",Pee=jv(ew),Iee=jv(Lm),Ree=jv(tw),Dee=jv(Rm),zee=jv(Ug),Vg=zc;(ew&&Vg(new ew(new ArrayBuffer(1)))!=l6||Lm&&Vg(new Lm)!=n6||tw&&Vg(tw.resolve())!=i6||Rm&&Vg(new Rm)!=o6||Ug&&Vg(new Ug)!=s6)&&(Vg=function(le){var ge=zc(le),Ye=ge==Lee?le.constructor:void 0,Pt=Ye?jv(Ye):"";if(Pt)switch(Pt){case Pee:return l6;case Iee:return n6;case Ree:return i6;case Dee:return o6;case zee:return s6}return ge});var jh=Vg;var Fee=Object.prototype,Oee=Fee.hasOwnProperty;function Bee(le){var ge=le.length,Ye=new le.constructor(ge);return ge&&typeof le[0]=="string"&&Oee.call(le,"index")&&(Ye.index=le.index,Ye.input=le.input),Ye}var u6=Bee;var Nee=_u.Uint8Array,by=Nee;function Uee(le){var ge=new le.constructor(le.byteLength);return new by(ge).set(new by(le)),ge}var wy=Uee;function jee(le,ge){var Ye=ge?wy(le.buffer):le.buffer;return new le.constructor(Ye,le.byteOffset,le.byteLength)}var c6=jee;var Vee=/\w*$/;function qee(le){var ge=new le.constructor(le.source,Vee.exec(le));return ge.lastIndex=le.lastIndex,ge}var f6=qee;var h6=If?If.prototype:void 0,p6=h6?h6.valueOf:void 0;function Gee(le){return p6?Object(p6.call(le)):{}}var d6=Gee;function Hee(le,ge){var Ye=ge?wy(le.buffer):le.buffer;return new le.constructor(Ye,le.byteOffset,le.length)}var rw=Hee;var Wee="[object Boolean]",Xee="[object Date]",Zee="[object Map]",Yee="[object Number]",Kee="[object RegExp]",Jee="[object Set]",$ee="[object String]",Qee="[object Symbol]",ete="[object ArrayBuffer]",tte="[object DataView]",rte="[object Float32Array]",ate="[object Float64Array]",nte="[object Int8Array]",ite="[object Int16Array]",ote="[object Int32Array]",ste="[object Uint8Array]",lte="[object Uint8ClampedArray]",ute="[object Uint16Array]",cte="[object Uint32Array]";function fte(le,ge,Ye){var Pt=le.constructor;switch(ge){case ete:return wy(le);case Wee:case Xee:return new Pt(+le);case tte:return c6(le,Ye);case rte:case ate:case nte:case ite:case ote:case ste:case lte:case ute:case cte:return rw(le,Ye);case Zee:return new Pt;case Yee:case $ee:return new Pt(le);case Kee:return f6(le);case Jee:return new Pt;case Qee:return d6(le)}}var v6=fte;function hte(le){return typeof le.constructor=="function"&&!mv(le)?Td(Im(le)):{}}var aw=hte;var pte="[object Map]";function dte(le){return Rl(le)&&jh(le)==pte}var m6=dte;var g6=sp&&sp.isMap,vte=g6?bf(g6):m6,nw=vte;var mte="[object Set]";function gte(le){return Rl(le)&&jh(le)==mte}var y6=gte;var _6=sp&&sp.isSet,yte=_6?bf(_6):y6,iw=yte;var _te=1,xte=2,bte=4,x6="[object Arguments]",wte="[object Array]",Tte="[object Boolean]",Ate="[object Date]",Ste="[object Error]",b6="[object Function]",Mte="[object GeneratorFunction]",Ete="[object Map]",Cte="[object Number]",w6="[object Object]",kte="[object RegExp]",Lte="[object Set]",Pte="[object String]",Ite="[object Symbol]",Rte="[object WeakMap]",Dte="[object ArrayBuffer]",zte="[object DataView]",Fte="[object Float32Array]",Ote="[object Float64Array]",Bte="[object Int8Array]",Nte="[object Int16Array]",Ute="[object Int32Array]",jte="[object Uint8Array]",Vte="[object Uint8ClampedArray]",qte="[object Uint16Array]",Gte="[object Uint32Array]",hf={};hf[x6]=hf[wte]=hf[Dte]=hf[zte]=hf[Tte]=hf[Ate]=hf[Fte]=hf[Ote]=hf[Bte]=hf[Nte]=hf[Ute]=hf[Ete]=hf[Cte]=hf[w6]=hf[kte]=hf[Lte]=hf[Pte]=hf[Ite]=hf[jte]=hf[Vte]=hf[qte]=hf[Gte]=!0;hf[Ste]=hf[b6]=hf[Rte]=!1;function ow(le,ge,Ye,Pt,vr,Zr){var ka,sn=ge&_te,fn=ge&xte,Li=ge&bte;if(Ye&&(ka=vr?Ye(le,Pt,vr,Zr):Ye(le)),ka!==void 0)return ka;if(!kl(le))return le;var bi=Do(le);if(bi){if(ka=u6(le),!sn)return ff(le,ka)}else{var Fi=jh(le),Uo=Fi==b6||Fi==Mte;if(Kp(le))return Jb(le,sn);if(Fi==w6||Fi==x6||Uo&&!vr){if(ka=fn||Uo?{}:aw(le),!sn)return fn?a6(le,KP(ka,le)):r6(le,Kb(ka,le))}else{if(!hf[Fi])return vr?le:{};ka=v6(le,Fi,sn)}}Zr||(Zr=new yv);var ws=Zr.get(le);if(ws)return ws;Zr.set(le,ka),iw(le)?le.forEach(function(Ws){ka.add(ow(Ws,ge,Ye,Ws,le,Zr))}):nw(le)&&le.forEach(function(Ws,Yl){ka.set(Yl,ow(Ws,ge,Ye,Yl,le,Zr))});var mo=Li?fn?xy:l_:fn?Vc:du,Ze=bi?void 0:mo(le);return Nh(Ze||le,function(Ws,Yl){Ze&&(Yl=Ws,Ws=le[Yl]),vv(ka,Yl,ow(Ws,ge,Ye,Yl,le,Zr))}),ka}var up=ow;var Hte=4;function Wte(le){return up(le,Hte)}var T6=Wte;var Xte=1,Zte=4;function Yte(le){return up(le,Xte|Zte)}var A6=Yte;var Kte=1,Jte=4;function $te(le,ge){return ge=typeof ge=="function"?ge:void 0,up(le,Kte|Jte,ge)}var S6=$te;var Qte=4;function ere(le,ge){return ge=typeof ge=="function"?ge:void 0,up(le,Qte,ge)}var M6=ere;function tre(){return new Ip(this.value(),this.__chain__)}var E6=tre;function rre(le){for(var ge=-1,Ye=le==null?0:le.length,Pt=0,vr=[];++ge<Ye;){var Zr=le[ge];Zr&&(vr[Pt++]=Zr)}return vr}var C6=rre;function are(){var le=arguments.length;if(!le)return[];for(var ge=Array(le-1),Ye=arguments[0],Pt=le;Pt--;)ge[Pt-1]=arguments[Pt];return Dp(Do(Ye)?ff(Ye):[Ye],Qu(ge,1))}var k6=are;var nre="__lodash_hash_undefined__";function ire(le){return this.__data__.set(le,nre),this}var L6=ire;function ore(le){return this.__data__.has(le)}var P6=ore;function sw(le){var ge=-1,Ye=le==null?0:le.length;for(this.__data__=new jg;++ge<Ye;)this.add(le[ge])}sw.prototype.add=sw.prototype.push=L6;sw.prototype.has=P6;var Dm=sw;function sre(le,ge){for(var Ye=-1,Pt=le==null?0:le.length;++Ye<Pt;)if(ge(le[Ye],Ye,le))return!0;return!1}var Ty=sre;function lre(le,ge){return le.has(ge)}var Gv=lre;var ure=1,cre=2;function fre(le,ge,Ye,Pt,vr,Zr){var ka=Ye&ure,sn=le.length,fn=ge.length;if(sn!=fn&&!(ka&&fn>sn))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<sn;){var mo=le[Fi],Ze=ge[Fi];if(Pt)var Ws=ka?Pt(Ze,mo,Fi,ge,le,Zr):Pt(mo,Ze,Fi,le,ge,Zr);if(Ws!==void 0){if(Ws)continue;Uo=!1;break}if(ws){if(!Ty(ge,function(Yl,cu){if(!Gv(ws,cu)&&(mo===Yl||vr(mo,Yl,Ye,Pt,Zr)))return ws.push(cu)})){Uo=!1;break}}else if(!(mo===Ze||vr(mo,Ze,Ye,Pt,Zr))){Uo=!1;break}}return Zr.delete(le),Zr.delete(ge),Uo}var lw=fre;function hre(le){var ge=-1,Ye=Array(le.size);return le.forEach(function(Pt,vr){Ye[++ge]=[vr,Pt]}),Ye}var Ay=hre;function pre(le){var ge=-1,Ye=Array(le.size);return le.forEach(function(Pt){Ye[++ge]=Pt}),Ye}var zm=pre;var dre=1,vre=2,mre="[object Boolean]",gre="[object Date]",yre="[object Error]",_re="[object Map]",xre="[object Number]",bre="[object RegExp]",wre="[object Set]",Tre="[object String]",Are="[object Symbol]",Sre="[object ArrayBuffer]",Mre="[object DataView]",I6=If?If.prototype:void 0,zA=I6?I6.valueOf:void 0;function Ere(le,ge,Ye,Pt,vr,Zr,ka){switch(Ye){case Mre:if(le.byteLength!=ge.byteLength||le.byteOffset!=ge.byteOffset)return!1;le=le.buffer,ge=ge.buffer;case Sre:return!(le.byteLength!=ge.byteLength||!Zr(new by(le),new by(ge)));case mre:case gre:case xre:return nh(+le,+ge);case yre:return le.name==ge.name&&le.message==ge.message;case bre:case Tre:return le==ge+"";case _re:var sn=Ay;case wre:var fn=Pt&dre;if(sn||(sn=zm),le.size!=ge.size&&!fn)return!1;var Li=ka.get(le);if(Li)return Li==ge;Pt|=vre,ka.set(le,ge);var bi=lw(sn(le),sn(ge),Pt,vr,Zr,ka);return ka.delete(le),bi;case Are:if(zA)return zA.call(le)==zA.call(ge)}return!1}var R6=Ere;var Cre=1,kre=Object.prototype,Lre=kre.hasOwnProperty;function Pre(le,ge,Ye,Pt,vr,Zr){var ka=Ye&Cre,sn=l_(le),fn=sn.length,Li=l_(ge),bi=Li.length;if(fn!=bi&&!ka)return!1;for(var Fi=fn;Fi--;){var Uo=sn[Fi];if(!(ka?Uo in ge:Lre.call(ge,Uo)))return!1}var ws=Zr.get(le),mo=Zr.get(ge);if(ws&&mo)return ws==ge&&mo==le;var Ze=!0;Zr.set(le,ge),Zr.set(ge,le);for(var Ws=ka;++Fi<fn;){Uo=sn[Fi];var Yl=le[Uo],cu=ge[Uo];if(Pt)var ih=ka?Pt(cu,Yl,Uo,ge,le,Zr):Pt(Yl,cu,Uo,le,ge,Zr);if(!(ih===void 0?Yl===cu||vr(Yl,cu,Ye,Pt,Zr):ih)){Ze=!1;break}Ws||(Ws=Uo=="constructor")}if(Ze&&!Ws){var Eh=le.constructor,Bp=ge.constructor;Eh!=Bp&&"constructor"in le&&"constructor"in ge&&!(typeof Eh=="function"&&Eh instanceof Eh&&typeof Bp=="function"&&Bp instanceof Bp)&&(Ze=!1)}return Zr.delete(le),Zr.delete(ge),Ze}var D6=Pre;var Ire=1,z6="[object Arguments]",F6="[object Array]",uw="[object Object]",Rre=Object.prototype,O6=Rre.hasOwnProperty;function Dre(le,ge,Ye,Pt,vr,Zr){var ka=Do(le),sn=Do(ge),fn=ka?F6:jh(le),Li=sn?F6:jh(ge);fn=fn==z6?uw:fn,Li=Li==z6?uw:Li;var bi=fn==uw,Fi=Li==uw,Uo=fn==Li;if(Uo&&Kp(le)){if(!Kp(ge))return!1;ka=!0,bi=!1}if(Uo&&!bi)return Zr||(Zr=new yv),ka||Ed(le)?lw(le,ge,Ye,Pt,vr,Zr):R6(le,ge,fn,Ye,Pt,vr,Zr);if(!(Ye&Ire)){var ws=bi&&O6.call(le,"__wrapped__"),mo=Fi&&O6.call(ge,"__wrapped__");if(ws||mo){var Ze=ws?le.value():le,Ws=mo?ge.value():ge;return Zr||(Zr=new yv),vr(Ze,Ws,Ye,Pt,Zr)}}return Uo?(Zr||(Zr=new yv),D6(le,ge,Ye,Pt,vr,Zr)):!1}var B6=Dre;function N6(le,ge,Ye,Pt,vr){return le===ge?!0:le==null||ge==null||!Rl(le)&&!Rl(ge)?le!==le&&ge!==ge:B6(le,ge,Ye,Pt,N6,vr)}var Fm=N6;var zre=1,Fre=2;function Ore(le,ge,Ye,Pt){var vr=Ye.length,Zr=vr,ka=!Pt;if(le==null)return!Zr;for(le=Object(le);vr--;){var sn=Ye[vr];if(ka&&sn[2]?sn[1]!==le[sn[0]]:!(sn[0]in le))return!1}for(;++vr<Zr;){sn=Ye[vr];var fn=sn[0],Li=le[fn],bi=sn[1];if(ka&&sn[2]){if(Li===void 0&&!(fn in le))return!1}else{var Fi=new yv;if(Pt)var Uo=Pt(Li,bi,fn,le,ge,Fi);if(!(Uo===void 0?Fm(bi,Li,zre|Fre,Pt,Fi):Uo))return!1}}return!0}var Sy=Ore;function Bre(le){return le===le&&!kl(le)}var cw=Bre;function Nre(le){for(var ge=du(le),Ye=ge.length;Ye--;){var Pt=ge[Ye],vr=le[Pt];ge[Ye]=[Pt,vr,cw(vr)]}return ge}var My=Nre;function Ure(le,ge){return function(Ye){return Ye==null?!1:Ye[le]===ge&&(ge!==void 0||le in Object(Ye))}}var fw=Ure;function jre(le){var ge=My(le);return ge.length==1&&ge[0][2]?fw(ge[0][0],ge[0][1]):function(Ye){return Ye===le||Sy(Ye,le,ge)}}var hw=jre;function Vre(le,ge){return le!=null&&ge in Object(le)}var U6=Vre;function qre(le,ge,Ye){ge=Rp(ge,le);for(var Pt=-1,vr=ge.length,Zr=!1;++Pt<vr;){var ka=Sh(ge[Pt]);if(!(Zr=le!=null&&Ye(le,ka)))break;le=le[ka]}return Zr||++Pt!=vr?Zr:(vr=le==null?0:le.length,!!vr&&Mm(vr)&&np(ka,vr)&&(Do(le)||dd(le)))}var pw=qre;function Gre(le,ge){return le!=null&&pw(le,ge,U6)}var Ey=Gre;var Hre=1,Wre=2;function Xre(le,ge){return iy(le)&&cw(ge)?fw(Sh(le),ge):function(Ye){var Pt=uy(Ye,le);return Pt===void 0&&Pt===ge?Ey(Ye,le):Fm(ge,Pt,Hre|Wre)}}var dw=Xre;function Zre(le){return function(ge){return ge?.[le]}}var Cy=Zre;function Yre(le){return function(ge){return ud(ge,le)}}var j6=Yre;function Kre(le){return iy(le)?Cy(Sh(le)):j6(le)}var vw=Kre;function Jre(le){return typeof le=="function"?le:le==null?Fc:typeof le=="object"?Do(le)?dw(le[0],le[1]):hw(le):vw(le)}var wo=Jre;var $re="Expected a function";function Qre(le){var ge=le==null?0:le.length,Ye=wo;return le=ge?Sl(le,function(Pt){if(typeof Pt[1]!="function")throw new TypeError($re);return[Ye(Pt[0]),Pt[1]]}):[],Ho(function(Pt){for(var vr=-1;++vr<ge;){var Zr=le[vr];if(_f(Zr[0],this,Pt))return _f(Zr[1],this,Pt)}})}var V6=Qre;function eae(le,ge,Ye){var Pt=Ye.length;if(le==null)return!Pt;for(le=Object(le);Pt--;){var vr=Ye[Pt],Zr=ge[vr],ka=le[vr];if(ka===void 0&&!(vr in le)||!Zr(ka))return!1}return!0}var mw=eae;function tae(le){var ge=du(le);return function(Ye){return mw(Ye,le,ge)}}var q6=tae;var rae=1;function aae(le){return q6(up(le,rae))}var G6=aae;function nae(le,ge){return ge==null||mw(le,ge,du(ge))}var H6=nae;function iae(le,ge,Ye,Pt){for(var vr=-1,Zr=le==null?0:le.length;++vr<Zr;){var ka=le[vr];ge(Pt,ka,Ye(ka),le)}return Pt}var W6=iae;function oae(le){return function(ge,Ye,Pt){for(var vr=-1,Zr=Object(ge),ka=Pt(ge),sn=ka.length;sn--;){var fn=ka[le?sn:++vr];if(Ye(Zr[fn],fn,Zr)===!1)break}return ge}}var gw=oae;var sae=gw(),ky=sae;function lae(le,ge){return le&&ky(le,ge,du)}var cp=lae;function uae(le,ge){return function(Ye,Pt){if(Ye==null)return Ye;if(!jc(Ye))return le(Ye,Pt);for(var vr=Ye.length,Zr=ge?vr:-1,ka=Object(Ye);(ge?Zr--:++Zr<vr)&&Pt(ka[Zr],Zr,ka)!==!1;);return Ye}}var yw=uae;var cae=yw(cp),Op=cae;function fae(le,ge,Ye,Pt){return Op(le,function(vr,Zr,ka){ge(Pt,vr,Ye(vr),ka)}),Pt}var X6=fae;function hae(le,ge){return function(Ye,Pt){var vr=Do(Ye)?W6:X6,Zr=ge?ge():{};return vr(Ye,le,wo(Pt,2),Zr)}}var Om=hae;var pae=Object.prototype,dae=pae.hasOwnProperty,vae=Om(function(le,ge,Ye){dae.call(le,Ye)?++le[Ye]:op(le,Ye,1)}),Z6=vae;function mae(le,ge){var Ye=Td(le);return ge==null?Ye:Kb(Ye,ge)}var Y6=mae;var gae=8;function FA(le,ge,Ye){ge=Ye?void 0:ge;var Pt=ip(le,gae,void 0,void 0,void 0,void 0,void 0,ge);return Pt.placeholder=FA.placeholder,Pt}FA.placeholder={};var K6=FA;var yae=16;function OA(le,ge,Ye){ge=Ye?void 0:ge;var Pt=ip(le,yae,void 0,void 0,void 0,void 0,void 0,ge);return Pt.placeholder=OA.placeholder,Pt}OA.placeholder={};var J6=OA;var _ae=function(){return _u.Date.now()},Ly=_ae;var xae="Expected a function",bae=Math.max,wae=Math.min;function Tae(le,ge,Ye){var Pt,vr,Zr,ka,sn,fn,Li=0,bi=!1,Fi=!1,Uo=!0;if(typeof le!="function")throw new TypeError(xae);ge=Th(ge)||0,kl(Ye)&&(bi=!!Ye.leading,Fi="maxWait"in Ye,Zr=Fi?bae(Th(Ye.maxWait)||0,ge):Zr,Uo="trailing"in Ye?!!Ye.trailing:Uo);function ws(Oi){var $p=Pt,Np=vr;return Pt=vr=void 0,Li=Oi,ka=le.apply(Np,$p),ka}function mo(Oi){return Li=Oi,sn=setTimeout(Yl,ge),bi?ws(Oi):ka}function Ze(Oi){var $p=Oi-fn,Np=Oi-Li,Zy=ge-$p;return Fi?wae(Zy,Zr-Np):Zy}function Ws(Oi){var $p=Oi-fn,Np=Oi-Li;return fn===void 0||$p>=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<Pt;)for(var Zr=ge[Ye],ka=Vc(Zr),sn=-1,fn=ka.length;++sn<fn;){var Li=ka[sn],bi=le[Li];(bi===void 0||nh(bi,Q6[Li])&&!Sae.call(le,Li))&&(le[Li]=Zr[Li])}return le}),eI=Mae;function Eae(le,ge,Ye){(Ye!==void 0&&!nh(le[ge],Ye)||Ye===void 0&&!(ge in le))&&op(le,ge,Ye)}var u_=Eae;function Cae(le){return Rl(le)&&jc(le)}var Su=Cae;function kae(le,ge){if(!(ge==="constructor"&&typeof le[ge]=="function")&&ge!="__proto__")return le[ge]}var c_=kae;function Lae(le){return Ah(le,Vc(le))}var xw=Lae;function Pae(le,ge,Ye,Pt,vr,Zr,ka){var sn=c_(le,Ye),fn=c_(ge,Ye),Li=ka.get(fn);if(Li){u_(le,Ye,Li);return}var bi=Zr?Zr(sn,fn,Ye+"",le,ge,ka):void 0,Fi=bi===void 0;if(Fi){var Uo=Do(fn),ws=!Uo&&Kp(fn),mo=!Uo&&!ws&&Ed(fn);bi=fn,Uo||ws||mo?Do(sn)?bi=sn:Su(sn)?bi=ff(sn):ws?(Fi=!1,bi=Jb(fn,!0)):mo?(Fi=!1,bi=rw(fn,!0)):bi=[]:gv(fn)||dd(fn)?(bi=sn,dd(sn)?bi=xw(sn):(!kl(sn)||ap(sn))&&(bi=aw(fn))):Fi=!1}Fi&&(ka.set(fn,bi),vr(bi,fn,Pt,Zr,ka),ka.delete(fn)),u_(le,Ye,bi)}var tI=Pae;function rI(le,ge,Ye,Pt,vr){le!==ge&&ky(ge,function(Zr,ka){if(vr||(vr=new yv),kl(Zr))tI(le,ge,ka,Ye,rI,Pt,vr);else{var sn=Pt?Pt(c_(le,ka),Zr,ka+"",le,ge,vr):void 0;sn===void 0&&(sn=Zr),u_(le,ka,sn)}},Vc)}var Py=rI;function aI(le,ge,Ye,Pt,vr,Zr){return kl(le)&&kl(ge)&&(Zr.set(ge,le),Py(le,ge,void 0,aI,Zr),Zr.delete(ge)),le}var nI=aI;var Iae=Md(function(le,ge,Ye,Pt){Py(le,ge,Ye,Pt)}),bw=Iae;var Rae=Ho(function(le){return le.push(void 0,nI),_f(bw,void 0,le)}),iI=Rae;var Dae="Expected a function";function zae(le,ge,Ye){if(typeof le!="function")throw new TypeError(Dae);return setTimeout(function(){le.apply(void 0,Ye)},ge)}var ww=zae;var Fae=Ho(function(le,ge){return ww(le,1,ge)}),oI=Fae;var Oae=Ho(function(le,ge,Ye){return ww(le,Th(ge)||0,Ye)}),sI=Oae;function Bae(le,ge,Ye){for(var Pt=-1,vr=le==null?0:le.length;++Pt<vr;)if(Ye(ge,le[Pt]))return!0;return!1}var Iy=Bae;var Nae=200;function Uae(le,ge,Ye,Pt){var vr=-1,Zr=Sm,ka=!0,sn=le.length,fn=[],Li=ge.length;if(!sn)return fn;Ye&&(ge=Sl(ge,bf(Ye))),Pt?(Zr=Iy,ka=!1):ge.length>=Nae&&(Zr=Gv,ka=!1,ge=new Dm(ge));e:for(;++vr<sn;){var bi=le[vr],Fi=Ye==null?bi:Ye(bi);if(bi=Pt||bi!==0?bi:0,ka&&Fi===Fi){for(var Uo=Li;Uo--;)if(ge[Uo]===Fi)continue e;fn.push(bi)}else Zr(ge,Fi,Pt)||fn.push(bi)}return fn}var _v=Uae;var jae=Ho(function(le,ge){return Su(le)?_v(le,Qu(ge,1,Su,!0)):[]}),lI=jae;function Vae(le){var ge=le==null?0:le.length;return ge?le[ge-1]:void 0}var wf=Vae;var qae=Ho(function(le,ge){var Ye=wf(ge);return Su(Ye)&&(Ye=void 0),Su(le)?_v(le,Qu(ge,1,Su,!0),wo(Ye,2)):[]}),uI=qae;var Gae=Ho(function(le,ge){var Ye=wf(ge);return Su(Ye)&&(Ye=void 0),Su(le)?_v(le,Qu(ge,1,Su,!0),void 0,Ye):[]}),cI=Gae;var Hae=bm(function(le,ge){return le/ge},1),fI=Hae;function Wae(le,ge,Ye){var Pt=le==null?0:le.length;return Pt?(ge=Ye||ge===void 0?1:Go(ge),Xf(le,ge<0?0:ge,Pt)):[]}var hI=Wae;function Xae(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,0,ge<0?0:ge)):[]}var pI=Xae;function Zae(le,ge,Ye,Pt){for(var vr=le.length,Zr=Pt?vr:-1;(Pt?Zr--:++Zr<vr)&&ge(le[Zr],Zr,le););return Ye?Xf(le,Pt?0:Zr,Pt?Zr+1:vr):Xf(le,Pt?Zr+1:0,Pt?vr:Zr)}var Bm=Zae;function Yae(le,ge){return le&&le.length?Bm(le,wo(ge,3),!0,!0):[]}var dI=Yae;function Kae(le,ge){return le&&le.length?Bm(le,wo(ge,3),!0):[]}var vI=Kae;function Jae(le){return typeof le=="function"?le:Fc}var Mh=Jae;function $ae(le,ge){var Ye=Do(le)?Nh:Op;return Ye(le,Mh(ge))}var f_=$ae;function Qae(le,ge){for(var Ye=le==null?0:le.length;Ye--&&ge(le[Ye],Ye,le)!==!1;);return le}var mI=Qae;var ene=gw(!0),Tw=ene;function tne(le,ge){return le&&Tw(le,ge,du)}var Ry=tne;var rne=yw(Ry,!0),Aw=rne;function ane(le,ge){var Ye=Do(le)?mI:Aw;return Ye(le,Mh(ge))}var h_=ane;function nne(le,ge,Ye){le=Ds(le),ge=ah(ge);var Pt=le.length;Ye=Ye===void 0?Pt:cd(Go(Ye),0,Pt);var vr=Ye;return Ye-=ge.length,Ye>=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;++Ye<Pt;)if(!ge(le[Ye],Ye,le))return!1;return!0}var Ew=yne;function _ne(le,ge){var Ye=!0;return Op(le,function(Pt,vr,Zr){return Ye=!!ge(Pt,vr,Zr),Ye}),Ye}var AI=_ne;function xne(le,ge,Ye){var Pt=Do(le)?Ew:AI;return Ye&&Oc(le,ge,Ye)&&(ge=void 0),Pt(le,wo(ge,3))}var SI=xne;var bne=4294967295;function wne(le){return le?cd(Go(le),0,bne):0}var Cw=wne;function Tne(le,ge,Ye,Pt){var vr=le.length;for(Ye=Go(Ye),Ye<0&&(Ye=-Ye>vr?0:vr+Ye),Pt=Pt===void 0||Pt>vr?vr:Go(Pt),Pt<0&&(Pt+=vr),Pt=Ye>Pt?0:Cw(Pt);Ye<Pt;)le[Ye++]=ge;return le}var MI=Tne;function Ane(le,ge,Ye,Pt){var vr=le==null?0:le.length;return vr?(Ye&&typeof Ye!="number"&&Oc(le,ge,Ye)&&(Ye=0,Pt=vr),MI(le,ge,Ye,Pt)):[]}var EI=Ane;function Sne(le,ge){var Ye=[];return Op(le,function(Pt,vr,Zr){ge(Pt,vr,Zr)&&Ye.push(Pt)}),Ye}var kw=Sne;function Mne(le,ge){var Ye=Do(le)?Fp:kw;return Ye(le,wo(ge,3))}var CI=Mne;function Ene(le){return function(ge,Ye,Pt){var vr=Object(ge);if(!jc(ge)){var Zr=wo(Ye,3);ge=du(ge),Ye=function(sn){return Zr(vr[sn],sn,vr)}}var ka=le(ge,Ye,Pt);return ka>-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;++Pt<Ye;){Zr=ge[Pt];var sn=J0(Zr),fn=sn=="wrapper"?K0(Zr):void 0;fn&&n_(fn[0])&&fn[1]==(eie|$ne|Qne|tie)&&!fn[4].length&&fn[9]==1?ka=ka[J0(fn[0])].apply(ka,fn[3]):ka=Zr.length==1&&n_(Zr)?ka[sn]():ka.thru(Zr)}return function(){var Li=arguments,bi=Li[0];if(ka&&Li.length==1&&Do(bi))return ka.plant(bi).value();for(var Fi=0,Uo=Ye?ge[Fi].apply(this,Li):bi;++Fi<Ye;)Uo=ge[Fi].call(this,Uo);return Uo}})}var zw=rie;var aie=zw(),UI=aie;var nie=zw(!0),jI=nie;function iie(le,ge){return le==null?le:ky(le,Mh(ge),Vc)}var VI=iie;function oie(le,ge){return le==null?le:Tw(le,Mh(ge),Vc)}var qI=oie;function sie(le,ge){return le&&cp(le,Mh(ge))}var GI=sie;function lie(le,ge){return le&&Ry(le,Mh(ge))}var HI=lie;function uie(le){for(var ge=-1,Ye=le==null?0:le.length,Pt={};++ge<Ye;){var vr=le[ge];Pt[vr[0]]=vr[1]}return Pt}var WI=uie;function cie(le,ge){return Fp(ge,function(Ye){return ap(le[Ye])})}var Um=cie;function fie(le){return le==null?[]:Um(le,du(le))}var XI=fie;function hie(le){return le==null?[]:Um(le,Vc(le))}var ZI=hie;var pie=Object.prototype,die=pie.hasOwnProperty,vie=Om(function(le,ge,Ye){die.call(le,Ye)?le[Ye].push(ge):op(le,Ye,[ge])}),YI=vie;function mie(le,ge){return le>ge}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<Aie(ge,Ye)}var eR=Mie;function Eie(le,ge,Ye){return ge=sd(ge),Ye===void 0?(Ye=ge,ge=0):Ye=sd(Ye),le=Th(le),eR(le,ge,Ye)}var tR=Eie;var Cie="[object String]";function kie(le){return typeof le=="string"||!Do(le)&&Rl(le)&&zc(le)==Cie}var Vm=kie;function Lie(le,ge){return Sl(ge,function(Ye){return le[Ye]})}var zy=Lie;function Pie(le){return le==null?[]:zy(le,du(le))}var Ld=Pie;var Iie=Math.max;function Rie(le,ge,Ye,Pt){le=jc(le)?le:Ld(le),Ye=Ye&&!Pt?Go(Ye):0;var vr=le.length;return Ye<0&&(Ye=Iie(vr+Ye,0)),Vm(le)?Ye<=vr&&le.indexOf(ge,Ye)>-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<vr&&Li.length<fn;){var ws=bi[Fi],mo=ge?ge(ws):ws;if(ws=Ye||ws!==0?ws:0,!(Uo?Gv(Uo,mo):Pt(Li,mo,Ye))){for(ka=Zr;--ka;){var Ze=sn[ka];if(!(Ze?Gv(Ze,mo):Pt(le[ka],mo,Ye)))continue e}Uo&&Uo.push(mo),Li.push(ws)}}return Li}var Fy=Bie;function Nie(le){return Su(le)?le:[]}var Oy=Nie;var Uie=Ho(function(le){var ge=Sl(le,Oy);return ge.length&&ge[0]===le[0]?Fy(ge):[]}),iR=Uie;var jie=Ho(function(le){var ge=wf(le),Ye=Sl(le,Oy);return ge===wf(Ye)?ge=void 0:Ye.pop(),Ye.length&&Ye[0]===le[0]?Fy(Ye,wo(ge,2)):[]}),oR=jie;var Vie=Ho(function(le){var ge=wf(le),Ye=Sl(le,Oy);return ge=typeof ge=="function"?ge:void 0,ge&&Ye.pop(),Ye.length&&Ye[0]===le[0]?Fy(Ye,void 0,ge):[]}),sR=Vie;function qie(le,ge,Ye,Pt){return cp(le,function(vr,Zr,ka){ge(Pt,Ye(vr),Zr,ka)}),Pt}var lR=qie;function Gie(le,ge){return function(Ye,Pt){return lR(Ye,le,ge(Pt),{})}}var Fw=Gie;var Hie=Object.prototype,Wie=Hie.toString,Xie=Fw(function(le,ge,Ye){ge!=null&&typeof ge.toString!="function"&&(ge=Wie.call(ge)),le[ge]=Ye},$0(Fc)),uR=Xie;var cR=Object.prototype,Zie=cR.hasOwnProperty,Yie=cR.toString,Kie=Fw(function(le,ge,Ye){ge!=null&&typeof ge.toString!="function"&&(ge=Yie.call(ge)),Zie.call(le,ge)?le[ge].push(Ye):le[ge]=[Ye]},wo),fR=Kie;function Jie(le,ge){return ge.length<2?le:ud(le,Xf(ge,0,-1))}var Ow=Jie;function $ie(le,ge,Ye){ge=Rp(ge,le),le=Ow(le,ge);var Pt=le==null?le:le[Sh(wf(ge))];return Pt==null?void 0:_f(Pt,le,Ye)}var xv=$ie;var Qie=Ho(xv),hR=Qie;var eoe=Ho(function(le,ge,Ye){var Pt=-1,vr=typeof ge=="function",Zr=jc(le)?Array(le.length):[];return Op(le,function(ka){Zr[++Pt]=vr?_f(ge,ka,Ye):xv(ka,ge,Ye)}),Zr}),pR=eoe;var toe="[object ArrayBuffer]";function roe(le){return Rl(le)&&zc(le)==toe}var dR=roe;var vR=sp&&sp.isArrayBuffer,aoe=vR?bf(vR):dR,mR=aoe;var noe="[object Boolean]";function ioe(le){return le===!0||le===!1||Rl(le)&&zc(le)==noe}var gR=ioe;var ooe="[object Date]";function soe(le){return Rl(le)&&zc(le)==ooe}var yR=soe;var _R=sp&&sp.isDate,loe=_R?bf(_R):yR,xR=loe;function uoe(le){return Rl(le)&&le.nodeType===1&&!gv(le)}var bR=uoe;var coe="[object Map]",foe="[object Set]",hoe=Object.prototype,poe=hoe.hasOwnProperty;function doe(le){if(le==null)return!0;if(jc(le)&&(Do(le)||typeof le=="string"||typeof le.splice=="function"||Kp(le)||Ed(le)||dd(le)))return!le.length;var ge=jh(le);if(ge==coe||ge==foe)return!le.size;if(mv(le))return!ny(le).length;for(var Ye in le)if(poe.call(le,Ye))return!1;return!0}var wR=doe;function voe(le,ge){return Fm(le,ge)}var TR=voe;function moe(le,ge,Ye){Ye=typeof Ye=="function"?Ye:void 0;var Pt=Ye?Ye(le,ge):void 0;return Pt===void 0?Fm(le,ge,void 0,Ye):!!Pt}var AR=moe;var goe=_u.isFinite;function yoe(le){return typeof le=="number"&&goe(le)}var SR=yoe;function _oe(le){return typeof le=="number"&&le==Go(le)}var Bw=_oe;function xoe(le,ge){return le===ge||Sy(le,ge,My(ge))}var MR=xoe;function boe(le,ge,Ye){return Ye=typeof Ye=="function"?Ye:void 0,Sy(le,ge,My(ge),Ye)}var ER=boe;var woe="[object Number]";function Toe(le){return typeof le=="number"||Rl(le)&&zc(le)==woe}var Nw=Toe;function Aoe(le){return Nw(le)&&le!=+le}var CR=Aoe;var Soe=X0?ap:ay,kR=Soe;var Moe="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function Eoe(le){if(kR(le))throw new Error(Moe);return wb(le)}var LR=Eoe;function Coe(le){return le==null}var PR=Coe;function koe(le){return le===null}var IR=koe;var Loe="[object RegExp]";function Poe(le){return Rl(le)&&zc(le)==Loe}var RR=Poe;var DR=sp&&sp.isRegExp,Ioe=DR?bf(DR):RR,By=Ioe;var zR=9007199254740991;function Roe(le){return Bw(le)&&le>=-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<ge}var Ny=$oe;var Qoe=jm(Ny),ZR=Qoe;var ese=jm(function(le,ge){return le<=ge}),YR=ese;function tse(le,ge){var Ye={};return ge=wo(ge,3),cp(le,function(Pt,vr,Zr){op(Ye,ge(Pt,vr,Zr),Pt)}),Ye}var KR=tse;function rse(le,ge){var Ye={};return ge=wo(ge,3),cp(le,function(Pt,vr,Zr){op(Ye,vr,ge(Pt,vr,Zr))}),Ye}var JR=rse;var ase=1;function nse(le){return hw(up(le,ase))}var $R=nse;var ise=1;function ose(le,ge){return dw(le,up(ge,ise))}var QR=ose;function sse(le,ge,Ye){for(var Pt=-1,vr=le.length;++Pt<vr;){var Zr=le[Pt],ka=ge(Zr);if(ka!=null&&(sn===void 0?ka===ka&&!Rf(ka):Ye(ka,sn)))var sn=ka,fn=Zr}return fn}var qm=sse;function lse(le){return le&&le.length?qm(le,Fc,Dy):void 0}var eD=lse;function use(le,ge){return le&&le.length?qm(le,wo(ge,2),Dy):void 0}var tD=use;function cse(le,ge){for(var Ye,Pt=-1,vr=le.length;++Pt<vr;){var Zr=ge(le[Pt]);Zr!==void 0&&(Ye=Ye===void 0?Zr:Ye+Zr)}return Ye}var Uy=cse;var fse=NaN;function hse(le,ge){var Ye=le==null?0:le.length;return Ye?Uy(le,ge)/Ye:fse}var Uw=hse;function pse(le){return Uw(le,Fc)}var rD=pse;function dse(le,ge){return Uw(le,wo(ge,2))}var aD=dse;var vse=Md(function(le,ge,Ye){Py(le,ge,Ye)}),nD=vse;var mse=Ho(function(le,ge){return function(Ye){return xv(Ye,le,ge)}}),iD=mse;var gse=Ho(function(le,ge){return function(Ye){return xv(le,Ye,ge)}}),oD=gse;function yse(le){return le&&le.length?qm(le,Fc,Ny):void 0}var sD=yse;function _se(le,ge){return le&&le.length?qm(le,wo(ge,2),Ny):void 0}var lD=_se;function xse(le,ge,Ye){var Pt=du(ge),vr=Um(ge,Pt),Zr=!(kl(Ye)&&"chain"in Ye)||!!Ye.chain,ka=ap(le);return Nh(vr,function(sn){var fn=ge[sn];le[sn]=fn,ka&&(le.prototype[sn]=function(){var Li=this.__chain__;if(Zr||Li){var bi=le(this.__wrapped__),Fi=bi.__actions__=ff(this.__actions__);return Fi.push({func:fn,args:arguments,thisArg:le}),bi.__chain__=Li,bi}return fn.apply(le,Dp([this.value()],arguments))})}),le}var jw=xse;var bse=bm(function(le,ge){return le*ge},1),uD=bse;var wse="Expected a function";function Tse(le){if(typeof le!="function")throw new TypeError(wse);return function(){var ge=arguments;switch(ge.length){case 0:return!le.call(this);case 1:return!le.call(this,ge[0]);case 2:return!le.call(this,ge[0],ge[1]);case 3:return!le.call(this,ge[0],ge[1],ge[2])}return!le.apply(this,ge)}}var Hv=Tse;function Ase(le){for(var ge,Ye=[];!(ge=le.next()).done;)Ye.push(ge.value);return Ye}var cD=Ase;var Sse="[object Map]",Mse="[object Set]",BA=If?If.iterator:void 0;function Ese(le){if(!le)return[];if(jc(le))return Vm(le)?Uh(le):ff(le);if(BA&&le[BA])return cD(le[BA]());var ge=jh(le),Ye=ge==Sse?Ay:ge==Mse?zm:Ld;return Ye(le)}var Vw=Ese;function Cse(){this.__values__===void 0&&(this.__values__=Vw(this.value()));var le=this.__index__>=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&&++vr<Zr;){var fn=Sh(ge[vr]),Li=Ye;if(fn==="__proto__"||fn==="constructor"||fn==="prototype")return le;if(vr!=ka){var bi=sn[fn];Li=Pt?Pt(bi,fn,sn):void 0,Li===void 0&&(Li=kl(bi)?bi:np(ge[vr+1])?[]:{})}vv(sn,fn,Li),sn=sn[fn]}return le}var bv=Bse;function Nse(le,ge,Ye){for(var Pt=-1,vr=ge.length,Zr={};++Pt<vr;){var ka=ge[Pt],sn=ud(le,ka);Ye(sn,ka)&&bv(Zr,Rp(ka,le),sn)}return Zr}var Gw=Nse;function Use(le,ge){if(le==null)return{};var Ye=Sl(xy(le),function(Pt){return[Pt]});return ge=wo(ge),Gw(le,Ye,function(Pt,vr){return ge(Pt,vr[0])})}var Hw=Use;function jse(le,ge){return Hw(le,Hv(wo(ge)))}var mD=jse;function Vse(le){return qb(2,le)}var gD=Vse;function qse(le,ge){var Ye=le.length;for(le.sort(ge);Ye--;)le[Ye]=le[Ye].value;return le}var yD=qse;function Gse(le,ge){if(le!==ge){var Ye=le!==void 0,Pt=le===null,vr=le===le,Zr=Rf(le),ka=ge!==void 0,sn=ge===null,fn=ge===ge,Li=Rf(ge);if(!sn&&!Li&&!Zr&&le>ge||Zr&&ka&&fn&&!sn&&!Li||Pt&&ka&&fn||!Ye&&fn||!vr)return 1;if(!Pt&&!Zr&&!Li&&le<ge||Li&&Ye&&vr&&!Pt&&!Zr||sn&&Ye&&vr||!ka&&vr||!fn)return-1}return 0}var Ww=Gse;function Hse(le,ge,Ye){for(var Pt=-1,vr=le.criteria,Zr=ge.criteria,ka=vr.length,sn=Ye.length;++Pt<ka;){var fn=Ww(vr[Pt],Zr[Pt]);if(fn){if(Pt>=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);++vr<Zr;)Pt[vr]=ge[vr].call(this,Pt[vr]);return _f(le,this,Pt)})}),TD=$se;var Qse=Vy(Ew),AD=Qse;var ele=Vy(Ty),SD=ele;var tle=9007199254740991,rle=Math.floor;function ale(le,ge){var Ye="";if(!le||ge<1||ge>tle)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<ge?le+qg(ge-Pt,Ye):le}var FD=Tle;function Ale(le,ge,Ye){le=Ds(le),ge=Go(ge);var Pt=ge?Pd(le):0;return ge&&Pt<ge?qg(ge-Pt,Ye)+le:le}var OD=Ale;var Sle=/^\s+/,Mle=_u.parseInt;function Ele(le,ge,Ye){return Ye||ge==null?ge=0:ge&&(ge=+ge),Mle(Ds(le).replace(Sle,""),ge||0)}var BD=Ele;var Cle=32,jA=Ho(function(le,ge){var Ye=Yp(ge,Sd(jA));return ip(le,Cle,void 0,ge,Ye)});jA.placeholder={};var Zw=jA;var kle=64,VA=Ho(function(le,ge){var Ye=Yp(ge,Sd(VA));return ip(le,kle,void 0,ge,Ye)});VA.placeholder={};var ND=VA;var Lle=Om(function(le,ge,Ye){le[Ye?0:1].push(ge)},function(){return[[],[]]}),UD=Lle;function Ple(le,ge){return Gw(le,ge,function(Ye,Pt){return Ey(le,Pt)})}var jD=Ple;var Ile=lp(function(le,ge){return le==null?{}:jD(le,ge)}),VD=Ile;function Rle(le){for(var ge,Ye=this;Ye instanceof wm;){var Pt=Cb(Ye);Pt.__index__=0,Pt.__values__=void 0,ge?vr.__wrapped__=Pt:ge=Pt;var vr=Pt;Ye=Ye.__wrapped__}return vr.__wrapped__=le,ge}var qD=Rle;function Dle(le){return function(ge){return le==null?void 0:ud(le,ge)}}var GD=Dle;function zle(le,ge,Ye,Pt){for(var vr=Ye-1,Zr=le.length;++vr<Zr;)if(Pt(le[vr],ge))return vr;return-1}var HD=zle;var Fle=Array.prototype,WD=Fle.splice;function Ole(le,ge,Ye,Pt){var vr=Pt?HD:Ad,Zr=-1,ka=ge.length,sn=le;for(le===ge&&(ge=ff(ge)),Ye&&(sn=Sl(le,bf(Ye)));++Zr<ka;)for(var fn=0,Li=ge[Zr],bi=Ye?Ye(Li):Li;(fn=vr(sn,bi,fn,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?ge<Ye?1:-1:sd(Pt),$D(ge,Ye,Pt,le)}}var Jw=rue;var aue=Jw(),QD=aue;var nue=Jw(!0),ez=nue;var iue=256,oue=lp(function(le,ge){return ip(le,iue,void 0,void 0,void 0,ge)}),tz=oue;function sue(le,ge,Ye,Pt,vr){return vr(le,function(Zr,ka,sn){Ye=Pt?(Pt=!1,Zr):ge(Ye,Zr,ka,sn)}),Ye}var $w=sue;function lue(le,ge,Ye){var Pt=Do(le)?py:$w,vr=arguments.length<3;return Pt(le,wo(ge,4),Ye,vr,Op)}var rz=lue;function uue(le,ge,Ye,Pt){var vr=le==null?0:le.length;for(Pt&&vr&&(Ye=le[--vr]);vr--;)Ye=ge(Ye,le[vr],vr,le);return Ye}var az=uue;function cue(le,ge,Ye){var Pt=Do(le)?az:$w,vr=arguments.length<3;return Pt(le,wo(ge,4),Ye,vr,Aw)}var nz=cue;function fue(le,ge){var Ye=Do(le)?Fp:kw;return Ye(le,Hv(wo(ge,3)))}var iz=fue;function hue(le,ge){var Ye=[];if(!(le&&le.length))return Ye;var Pt=-1,vr=[],Zr=le.length;for(ge=wo(ge,3);++Pt<Zr;){var ka=le[Pt];ge(ka,Pt,le)&&(Ye.push(ka),vr.push(Pt))}return Kw(le,vr),Ye}var oz=hue;function pue(le,ge,Ye){return(Ye?Oc(le,ge,Ye):ge===void 0)?ge=1:ge=Go(ge),m_(Ds(le),ge)}var sz=pue;function due(){var le=arguments,ge=Ds(le[0]);return le.length<3?ge:ge.replace(le[1],le[2])}var lz=due;var vue="Expected a function";function mue(le,ge){if(typeof le!="function")throw new TypeError(vue);return ge=ge===void 0?ge:Go(ge),Ho(le,ge)}var uz=mue;function gue(le,ge,Ye){ge=Rp(ge,le);var Pt=-1,vr=ge.length;for(vr||(vr=1,le=void 0);++Pt<vr;){var Zr=le?.[Sh(ge[Pt])];Zr===void 0&&(Pt=vr,Zr=Ye),le=ap(Zr)?Zr.call(le):Zr}return le}var cz=gue;var yue=Array.prototype,_ue=yue.reverse;function xue(le){return le==null?le:_ue.call(le)}var g_=xue;var bue=my("round"),fz=bue;function wue(le){var ge=le.length;return ge?le[Gy(0,ge-1)]:void 0}var Qw=wue;function Tue(le){return Qw(Ld(le))}var hz=Tue;function Aue(le){var ge=Do(le)?Qw:hz;return ge(le)}var pz=Aue;function Sue(le,ge){var Ye=-1,Pt=le.length,vr=Pt-1;for(ge=ge===void 0?Pt:ge;++Ye<ge;){var Zr=Gy(Ye,vr),ka=le[Zr];le[Zr]=le[Ye],le[Ye]=ka}return le.length=ge,le}var Gm=Sue;function Mue(le,ge){return Gm(ff(le),cd(ge,0,le.length))}var dz=Mue;function Eue(le,ge){var Ye=Ld(le);return Gm(Ye,cd(ge,0,Ye.length))}var vz=Eue;function Cue(le,ge,Ye){(Ye?Oc(le,ge,Ye):ge===void 0)?ge=1:ge=Go(ge);var Pt=Do(le)?dz:vz;return Pt(le,ge)}var mz=Cue;function kue(le,ge,Ye){return le==null?le:bv(le,ge,Ye)}var gz=kue;function Lue(le,ge,Ye,Pt){return Pt=typeof Pt=="function"?Pt:void 0,le==null?le:bv(le,ge,Ye,Pt)}var yz=Lue;function Pue(le){return Gm(ff(le))}var _z=Pue;function Iue(le){return Gm(Ld(le))}var xz=Iue;function Rue(le){var ge=Do(le)?_z:xz;return ge(le)}var bz=Rue;var Due="[object Map]",zue="[object Set]";function Fue(le){if(le==null)return 0;if(jc(le))return Vm(le)?Pd(le):le.length;var ge=jh(le);return ge==Due||ge==zue?le.size:ny(le).length}var wz=Fue;function Oue(le,ge,Ye){var Pt=le==null?0:le.length;return Pt?(Ye&&typeof Ye!="number"&&Oc(le,ge,Ye)?(ge=0,Ye=Pt):(ge=ge==null?0:Go(ge),Ye=Ye===void 0?Pt:Go(Ye)),Xf(le,ge,Ye)):[]}var Tz=Oue;var Bue=kd(function(le,ge,Ye){return le+(Ye?"_":"")+ge.toLowerCase()}),Az=Bue;function Nue(le,ge){var Ye;return Op(le,function(Pt,vr,Zr){return Ye=ge(Pt,vr,Zr),!Ye}),!!Ye}var Sz=Nue;function Uue(le,ge,Ye){var Pt=Do(le)?Ty:Sz;return Ye&&Oc(le,ge,Ye)&&(ge=void 0),Pt(le,wo(ge,3))}var Mz=Uue;var jue=Ho(function(le,ge){if(le==null)return[];var Ye=ge.length;return Ye>1&&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<Zr;){var bi=Gue((vr+Zr)/2),Fi=Ye(le[bi]),Uo=Fi!==void 0,ws=Fi===null,mo=Fi===Fi,Ze=Rf(Fi);if(ka)var Ws=Pt||mo;else Li?Ws=mo&&(Pt||Uo):sn?Ws=mo&&Uo&&(Pt||!ws):fn?Ws=mo&&Uo&&!ws&&(Pt||!Ze):ws||Ze?Ws=!1:Ws=Pt?Fi<=ge:Fi<ge;Ws?vr=bi+1:Zr=bi}return Hue(Zr,que)}var Hy=Wue;var Xue=4294967295,Zue=Xue>>>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<vr;){var Zr=Pt+vr>>>1,ka=le[Zr];ka!==null&&!Rf(ka)&&(Ye?ka<=ge:ka<ge)?Pt=Zr+1:vr=Zr}return vr}return Hy(le,ge,Fc,Ye)}var Hm=Yue;function Kue(le,ge){return Hm(le,ge)}var Cz=Kue;function Jue(le,ge,Ye){return Hy(le,ge,wo(Ye,2))}var kz=Jue;function $ue(le,ge){var Ye=le==null?0:le.length;if(Ye){var Pt=Hm(le,ge);if(Pt<Ye&&nh(le[Pt],ge))return Pt}return-1}var Lz=$ue;function Que(le,ge){return Hm(le,ge,!0)}var Pz=Que;function ece(le,ge,Ye){return Hy(le,ge,wo(Ye,2),!0)}var Iz=ece;function tce(le,ge){var Ye=le==null?0:le.length;if(Ye){var Pt=Hm(le,ge,!0)-1;if(nh(le[Pt],ge))return Pt}return-1}var Rz=tce;function rce(le,ge){for(var Ye=-1,Pt=le.length,vr=0,Zr=[];++Ye<Pt;){var ka=le[Ye],sn=ge?ge(ka):ka;if(!Ye||!nh(sn,fn)){var fn=sn;Zr[vr++]=ka===0?0:ka}}return Zr}var e2=rce;function ace(le){return le&&le.length?e2(le):[]}var Dz=ace;function nce(le,ge){return le&&le.length?e2(le,wo(ge,2)):[]}var zz=nce;var ice=4294967295;function oce(le,ge,Ye){return Ye&&typeof Ye!="number"&&Oc(le,ge,Ye)&&(ge=Ye=void 0),Ye=Ye===void 0?ice:Ye>>>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<le;)ge(Ye);return vr}var i8=Wce;function Xce(){return this}var o8=Xce;function Zce(le,ge){var Ye=le;return Ye instanceof Bl&&(Ye=Ye.value()),py(ge,function(Pt,vr){return vr.func.apply(vr.thisArg,Dp([Pt],vr.args))},Ye)}var a2=Zce;function Yce(){return a2(this.__wrapped__,this.__actions__)}var Wm=Yce;function Kce(le){return Ds(le).toLowerCase()}var s8=Kce;function Jce(le){return Do(le)?Sl(le,Sh):Rf(le)?[le]:ff(Ub(Ds(le)))}var l8=Jce;var u8=9007199254740991;function $ce(le){return le?cd(Go(le),-u8,u8):le===0?le:0}var c8=$ce;function Qce(le){return Ds(le).toUpperCase()}var f8=Qce;function efe(le,ge,Ye){var Pt=Do(le),vr=Pt||Kp(le)||Ed(le);if(ge=wo(ge,4),Ye==null){var Zr=le&&le.constructor;vr?Ye=Pt?new Zr:[]:kl(le)?Ye=ap(Zr)?Td(Im(le)):{}:Ye={}}return(vr?Nh:cp)(le,function(ka,sn,fn){return ge(Ye,ka,sn,fn)}),Ye}var h8=efe;function tfe(le,ge){for(var Ye=le.length;Ye--&&Ad(ge,le[Ye],0)>-1;);return Ye}var n2=tfe;function rfe(le,ge){for(var Ye=-1,Pt=le.length;++Ye<Pt&&Ad(ge,le[Ye],0)>-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(;++Pt<Zr;){var bi=le[Pt],Fi=ge?ge(bi):bi;if(bi=Ye||bi!==0?bi:0,ka&&Fi===Fi){for(var Uo=fn.length;Uo--;)if(fn[Uo]===Fi)continue e;ge&&fn.push(Fi),sn.push(bi)}else vr(fn,Fi,Ye)||(fn!==sn&&fn.push(Fi),sn.push(bi))}return sn}var Jp=_fe;var xfe=Ho(function(le){return Jp(Qu(le,1,Su,!0))}),w8=xfe;var bfe=Ho(function(le){var ge=wf(le);return Su(ge)&&(ge=void 0),Jp(Qu(le,1,Su,!0),wo(ge,2))}),T8=bfe;var wfe=Ho(function(le){var ge=wf(le);return ge=typeof ge=="function"?ge:void 0,Jp(Qu(le,1,Su,!0),void 0,ge)}),A8=wfe;function Tfe(le){return le&&le.length?Jp(le):[]}var S8=Tfe;function Afe(le,ge){return le&&le.length?Jp(le,wo(ge,2)):[]}var M8=Afe;function Sfe(le,ge){return ge=typeof ge=="function"?ge:void 0,le&&le.length?Jp(le,void 0,ge):[]}var E8=Sfe;var Mfe=0;function Efe(le){var ge=++Mfe;return Ds(le)+ge}var C8=Efe;function Cfe(le,ge){return le==null?!0:jy(le,ge)}var k8=Cfe;var kfe=Math.max;function Lfe(le){if(!(le&&le.length))return[];var ge=0;return le=Fp(le,function(Ye){if(Su(Ye))return ge=kfe(Ye.length,ge),!0}),ry(ge,function(Ye){return Sl(le,Cy(Ye))})}var Wy=Lfe;function Pfe(le,ge){if(!(le&&le.length))return[];var Ye=Wy(le);return ge==null?Ye:Sl(Ye,function(Pt){return _f(ge,void 0,Pt)})}var o2=Pfe;function Ife(le,ge,Ye,Pt){return bv(le,ge,Ye(ud(le,ge)),Pt)}var s2=Ife;function Rfe(le,ge,Ye){return le==null?le:s2(le,ge,Mh(Ye))}var L8=Rfe;function Dfe(le,ge,Ye,Pt){return Pt=typeof Pt=="function"?Pt:void 0,le==null?le:s2(le,ge,Mh(Ye),Pt)}var P8=Dfe;var zfe=kd(function(le,ge,Ye){return le+(Ye?" ":"")+ge.toUpperCase()}),I8=zfe;function Ffe(le){return le==null?[]:zy(le,Vc(le))}var R8=Ffe;var Ofe=Ho(function(le,ge){return Su(le)?_v(le,ge):[]}),D8=Ofe;function Bfe(le,ge){return Zw(Mh(ge),le)}var z8=Bfe;var Nfe=lp(function(le){var ge=le.length,Ye=ge?le[0]:0,Pt=this.__wrapped__,vr=function(Zr){return cy(Zr,le)};return ge>1||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);++vr<Pt;)for(var ka=le[vr],sn=-1;++sn<Pt;)sn!=vr&&(Zr[vr]=_v(Zr[vr]||ka,le[sn],ge,Ye));return Jp(Qu(Zr,1),ge,Ye)}var Xy=Vfe;var qfe=Ho(function(le){return Xy(Fp(le,Su))}),N8=qfe;var Gfe=Ho(function(le){var ge=wf(le);return Su(ge)&&(ge=void 0),Xy(Fp(le,Su),wo(ge,2))}),U8=Gfe;var Hfe=Ho(function(le){var ge=wf(le);return ge=typeof ge=="function"?ge:void 0,Xy(Fp(le,Su),void 0,ge)}),j8=Hfe;var Wfe=Ho(Wy),V8=Wfe;function Xfe(le,ge,Ye){for(var Pt=-1,vr=le.length,Zr=ge.length,ka={};++Pt<vr;){var sn=Pt<Zr?ge[Pt]:void 0;Ye(ka,le[Pt],sn)}return ka}var l2=Xfe;function Zfe(le,ge){return l2(le||[],ge||[],vv)}var q8=Zfe;function Yfe(le,ge){return l2(le||[],ge||[],bv)}var G8=Yfe;var Kfe=Ho(function(le){var ge=le.length,Ye=ge>1?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;++Pt<vr;){var Zr=Ye[Pt],ka=Zr.size;switch(Zr.type){case"drop":le+=ka;break;case"dropRight":ge-=ka;break;case"take":ge=ehe(ge,le+ka);break;case"takeRight":le=Qfe(le,ge-ka);break}}return{start:le,end:ge}}var Z8=the;var rhe=1,ahe=2,nhe=Math.min;function ihe(){var le=this.__wrapped__.value(),ge=this.__dir__,Ye=Do(le),Pt=ge<0,vr=Ye?le.length:0,Zr=Z8(0,vr,this.__views__),ka=Zr.start,sn=Zr.end,fn=sn-ka,Li=Pt?sn:ka-1,bi=this.__iteratees__,Fi=bi.length,Uo=0,ws=nhe(fn,this.__takeCount__);if(!Ye||!Pt&&vr==fn&&ws==fn)return a2(le,this.__actions__);var mo=[];e:for(;fn--&&Uo<ws;){Li+=ge;for(var Ze=-1,Ws=le[Li];++Ze<Fi;){var Yl=bi[Ze],cu=Yl.iteratee,ih=Yl.type,Eh=cu(Ws);if(ih==ahe)Ws=Eh;else if(!Eh){if(ih==rhe)continue e;break e}}mo[Uo++]=Ws}return mo}var Y8=ihe;var ohe="4.17.21",she=2,lhe=1,uhe=3,$8=4294967295,che=Array.prototype,fhe=Object.prototype,Q8=fhe.hasOwnProperty,K8=If?If.iterator:void 0,hhe=Math.max,J8=Math.min,WA=function(le){return function(ge,Ye,Pt){if(Pt==null){var vr=kl(Ye),Zr=vr&&du(Ye),ka=Zr&&Zr.length&&Um(Ye,Zr);(ka?ka.length:vr)||(Pt=Ye,Ye=ge,ge=this)}return le(ge,Ye,Pt)}}(jw);_a.after=Df.after;_a.ary=Df.ary;_a.assign=dl.assign;_a.assignIn=dl.assignIn;_a.assignInWith=dl.assignInWith;_a.assignWith=dl.assignWith;_a.at=dl.at;_a.before=Df.before;_a.bind=Df.bind;_a.bindAll=ec.bindAll;_a.bindKey=Df.bindKey;_a.castArray=js.castArray;_a.chain=Id.chain;_a.chunk=ds.chunk;_a.compact=ds.compact;_a.concat=ds.concat;_a.cond=ec.cond;_a.conforms=ec.conforms;_a.constant=ec.constant;_a.countBy=_c.countBy;_a.create=dl.create;_a.curry=Df.curry;_a.curryRight=Df.curryRight;_a.debounce=Df.debounce;_a.defaults=dl.defaults;_a.defaultsDeep=dl.defaultsDeep;_a.defer=Df.defer;_a.delay=Df.delay;_a.difference=ds.difference;_a.differenceBy=ds.differenceBy;_a.differenceWith=ds.differenceWith;_a.drop=ds.drop;_a.dropRight=ds.dropRight;_a.dropRightWhile=ds.dropRightWhile;_a.dropWhile=ds.dropWhile;_a.fill=ds.fill;_a.filter=_c.filter;_a.flatMap=_c.flatMap;_a.flatMapDeep=_c.flatMapDeep;_a.flatMapDepth=_c.flatMapDepth;_a.flatten=ds.flatten;_a.flattenDeep=ds.flattenDeep;_a.flattenDepth=ds.flattenDepth;_a.flip=Df.flip;_a.flow=ec.flow;_a.flowRight=ec.flowRight;_a.fromPairs=ds.fromPairs;_a.functions=dl.functions;_a.functionsIn=dl.functionsIn;_a.groupBy=_c.groupBy;_a.initial=ds.initial;_a.intersection=ds.intersection;_a.intersectionBy=ds.intersectionBy;_a.intersectionWith=ds.intersectionWith;_a.invert=dl.invert;_a.invertBy=dl.invertBy;_a.invokeMap=_c.invokeMap;_a.iteratee=ec.iteratee;_a.keyBy=_c.keyBy;_a.keys=du;_a.keysIn=dl.keysIn;_a.map=_c.map;_a.mapKeys=dl.mapKeys;_a.mapValues=dl.mapValues;_a.matches=ec.matches;_a.matchesProperty=ec.matchesProperty;_a.memoize=Df.memoize;_a.merge=dl.merge;_a.mergeWith=dl.mergeWith;_a.method=ec.method;_a.methodOf=ec.methodOf;_a.mixin=WA;_a.negate=Hv;_a.nthArg=ec.nthArg;_a.omit=dl.omit;_a.omitBy=dl.omitBy;_a.once=Df.once;_a.orderBy=_c.orderBy;_a.over=ec.over;_a.overArgs=Df.overArgs;_a.overEvery=ec.overEvery;_a.overSome=ec.overSome;_a.partial=Df.partial;_a.partialRight=Df.partialRight;_a.partition=_c.partition;_a.pick=dl.pick;_a.pickBy=dl.pickBy;_a.property=ec.property;_a.propertyOf=ec.propertyOf;_a.pull=ds.pull;_a.pullAll=ds.pullAll;_a.pullAllBy=ds.pullAllBy;_a.pullAllWith=ds.pullAllWith;_a.pullAt=ds.pullAt;_a.range=ec.range;_a.rangeRight=ec.rangeRight;_a.rearg=Df.rearg;_a.reject=_c.reject;_a.remove=ds.remove;_a.rest=Df.rest;_a.reverse=ds.reverse;_a.sampleSize=_c.sampleSize;_a.set=dl.set;_a.setWith=dl.setWith;_a.shuffle=_c.shuffle;_a.slice=ds.slice;_a.sortBy=_c.sortBy;_a.sortedUniq=ds.sortedUniq;_a.sortedUniqBy=ds.sortedUniqBy;_a.split=ju.split;_a.spread=Df.spread;_a.tail=ds.tail;_a.take=ds.take;_a.takeRight=ds.takeRight;_a.takeRightWhile=ds.takeRightWhile;_a.takeWhile=ds.takeWhile;_a.tap=Id.tap;_a.throttle=Df.throttle;_a.thru=Wv;_a.toArray=js.toArray;_a.toPairs=dl.toPairs;_a.toPairsIn=dl.toPairsIn;_a.toPath=ec.toPath;_a.toPlainObject=js.toPlainObject;_a.transform=dl.transform;_a.unary=Df.unary;_a.union=ds.union;_a.unionBy=ds.unionBy;_a.unionWith=ds.unionWith;_a.uniq=ds.uniq;_a.uniqBy=ds.uniqBy;_a.uniqWith=ds.uniqWith;_a.unset=dl.unset;_a.unzip=ds.unzip;_a.unzipWith=ds.unzipWith;_a.update=dl.update;_a.updateWith=dl.updateWith;_a.values=dl.values;_a.valuesIn=dl.valuesIn;_a.without=ds.without;_a.words=ju.words;_a.wrap=Df.wrap;_a.xor=ds.xor;_a.xorBy=ds.xorBy;_a.xorWith=ds.xorWith;_a.zip=ds.zip;_a.zipObject=ds.zipObject;_a.zipObjectDeep=ds.zipObjectDeep;_a.zipWith=ds.zipWith;_a.entries=dl.toPairs;_a.entriesIn=dl.toPairsIn;_a.extend=dl.assignIn;_a.extendWith=dl.assignInWith;WA(_a,_a);_a.add=_p.add;_a.attempt=ec.attempt;_a.camelCase=ju.camelCase;_a.capitalize=ju.capitalize;_a.ceil=_p.ceil;_a.clamp=__.clamp;_a.clone=js.clone;_a.cloneDeep=js.cloneDeep;_a.cloneDeepWith=js.cloneDeepWith;_a.cloneWith=js.cloneWith;_a.conformsTo=js.conformsTo;_a.deburr=ju.deburr;_a.defaultTo=ec.defaultTo;_a.divide=_p.divide;_a.endsWith=ju.endsWith;_a.eq=js.eq;_a.escape=ju.escape;_a.escapeRegExp=ju.escapeRegExp;_a.every=_c.every;_a.find=_c.find;_a.findIndex=ds.findIndex;_a.findKey=dl.findKey;_a.findLast=_c.findLast;_a.findLastIndex=ds.findLastIndex;_a.findLastKey=dl.findLastKey;_a.floor=_p.floor;_a.forEach=_c.forEach;_a.forEachRight=_c.forEachRight;_a.forIn=dl.forIn;_a.forInRight=dl.forInRight;_a.forOwn=dl.forOwn;_a.forOwnRight=dl.forOwnRight;_a.get=dl.get;_a.gt=js.gt;_a.gte=js.gte;_a.has=dl.has;_a.hasIn=dl.hasIn;_a.head=ds.head;_a.identity=Fc;_a.includes=_c.includes;_a.indexOf=ds.indexOf;_a.inRange=__.inRange;_a.invoke=dl.invoke;_a.isArguments=js.isArguments;_a.isArray=Do;_a.isArrayBuffer=js.isArrayBuffer;_a.isArrayLike=js.isArrayLike;_a.isArrayLikeObject=js.isArrayLikeObject;_a.isBoolean=js.isBoolean;_a.isBuffer=js.isBuffer;_a.isDate=js.isDate;_a.isElement=js.isElement;_a.isEmpty=js.isEmpty;_a.isEqual=js.isEqual;_a.isEqualWith=js.isEqualWith;_a.isError=js.isError;_a.isFinite=js.isFinite;_a.isFunction=js.isFunction;_a.isInteger=js.isInteger;_a.isLength=js.isLength;_a.isMap=js.isMap;_a.isMatch=js.isMatch;_a.isMatchWith=js.isMatchWith;_a.isNaN=js.isNaN;_a.isNative=js.isNative;_a.isNil=js.isNil;_a.isNull=js.isNull;_a.isNumber=js.isNumber;_a.isObject=kl;_a.isObjectLike=js.isObjectLike;_a.isPlainObject=js.isPlainObject;_a.isRegExp=js.isRegExp;_a.isSafeInteger=js.isSafeInteger;_a.isSet=js.isSet;_a.isString=js.isString;_a.isSymbol=js.isSymbol;_a.isTypedArray=js.isTypedArray;_a.isUndefined=js.isUndefined;_a.isWeakMap=js.isWeakMap;_a.isWeakSet=js.isWeakSet;_a.join=ds.join;_a.kebabCase=ju.kebabCase;_a.last=wf;_a.lastIndexOf=ds.lastIndexOf;_a.lowerCase=ju.lowerCase;_a.lowerFirst=ju.lowerFirst;_a.lt=js.lt;_a.lte=js.lte;_a.max=_p.max;_a.maxBy=_p.maxBy;_a.mean=_p.mean;_a.meanBy=_p.meanBy;_a.min=_p.min;_a.minBy=_p.minBy;_a.stubArray=ec.stubArray;_a.stubFalse=ec.stubFalse;_a.stubObject=ec.stubObject;_a.stubString=ec.stubString;_a.stubTrue=ec.stubTrue;_a.multiply=_p.multiply;_a.nth=ds.nth;_a.noop=ec.noop;_a.now=HA.now;_a.pad=ju.pad;_a.padEnd=ju.padEnd;_a.padStart=ju.padStart;_a.parseInt=ju.parseInt;_a.random=__.random;_a.reduce=_c.reduce;_a.reduceRight=_c.reduceRight;_a.repeat=ju.repeat;_a.replace=ju.replace;_a.result=dl.result;_a.round=_p.round;_a.sample=_c.sample;_a.size=_c.size;_a.snakeCase=ju.snakeCase;_a.some=_c.some;_a.sortedIndex=ds.sortedIndex;_a.sortedIndexBy=ds.sortedIndexBy;_a.sortedIndexOf=ds.sortedIndexOf;_a.sortedLastIndex=ds.sortedLastIndex;_a.sortedLastIndexBy=ds.sortedLastIndexBy;_a.sortedLastIndexOf=ds.sortedLastIndexOf;_a.startCase=ju.startCase;_a.startsWith=ju.startsWith;_a.subtract=_p.subtract;_a.sum=_p.sum;_a.sumBy=_p.sumBy;_a.template=ju.template;_a.times=ec.times;_a.toFinite=js.toFinite;_a.toInteger=Go;_a.toLength=js.toLength;_a.toLower=ju.toLower;_a.toNumber=js.toNumber;_a.toSafeInteger=js.toSafeInteger;_a.toString=js.toString;_a.toUpper=ju.toUpper;_a.trim=ju.trim;_a.trimEnd=ju.trimEnd;_a.trimStart=ju.trimStart;_a.truncate=ju.truncate;_a.unescape=ju.unescape;_a.uniqueId=ec.uniqueId;_a.upperCase=ju.upperCase;_a.upperFirst=ju.upperFirst;_a.each=_c.forEach;_a.eachRight=_c.forEachRight;_a.first=ds.head;WA(_a,function(){var le={};return cp(_a,function(ge,Ye){Q8.call(_a.prototype,Ye)||(le[Ye]=ge)}),le}(),{chain:!1});_a.VERSION=ohe;(_a.templateSettings=ju.templateSettings).imports._=_a;Nh(["bind","bindKey","curry","curryRight","partial","partialRight"],function(le){_a[le].placeholder=_a});Nh(["drop","take"],function(le,ge){Bl.prototype[le]=function(Ye){Ye=Ye===void 0?1:hhe(Go(Ye),0);var Pt=this.__filtered__&&!ge?new Bl(this):this.clone();return Pt.__filtered__?Pt.__takeCount__=J8(Ye,Pt.__takeCount__):Pt.__views__.push({size:J8(Ye,$8),type:le+(Pt.__dir__<0?"Right":"")}),Pt},Bl.prototype[le+"Right"]=function(Ye){return this.reverse()[le](Ye).reverse()}});Nh(["filter","map","takeWhile"],function(le,ge){var Ye=ge+1,Pt=Ye==lhe||Ye==uhe;Bl.prototype[le]=function(vr){var Zr=this.clone();return Zr.__iteratees__.push({iteratee:wo(vr,3),type:Ye}),Zr.__filtered__=Zr.__filtered__||Pt,Zr}});Nh(["head","last"],function(le,ge){var Ye="take"+(ge?"Right":"");Bl.prototype[le]=function(){return this[Ye](1).value()[0]}});Nh(["initial","tail"],function(le,ge){var Ye="drop"+(ge?"":"Right");Bl.prototype[le]=function(){return this.__filtered__?new Bl(this):this[Ye](1)}});Bl.prototype.compact=function(){return this.filter(Fc)};Bl.prototype.find=function(le){return this.filter(le).head()};Bl.prototype.findLast=function(le){return this.reverse().find(le)};Bl.prototype.invokeMap=Ho(function(le,ge){return typeof le=="function"?new Bl(this):this.map(function(Ye){return xv(Ye,le,ge)})});Bl.prototype.reject=function(le){return this.filter(Hv(wo(le)))};Bl.prototype.slice=function(le,ge){le=Go(le);var Ye=this;return Ye.__filtered__&&(le>0||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;Zr<Ye.length;Zr++){var ka=Ye[Zr],sn=vr[Zr],fn=this.model.get("_widget_data")[sn];c2(fn,ka)}c2(this.model.get("_widget_layout"),Pt)}}do_removeLayoutProps(){var ge=this.model.get("_py2js_removeLayoutProps");if(ge!==null){var Ye=ge.remove_props,Pt=this.model.get("_widget_layout");iF(Pt,Ye)}}do_removeTraceProps(){var ge=this.model.get("_py2js_removeTraceProps");if(ge!==null){var Ye=ge.remove_props,Pt=ge.remove_trace,vr=this.model.get("_widget_data")[Pt];iF(vr,Ye)}}},phe={_widget_data:{deserialize:qh,serialize:Vh},_widget_layout:{deserialize:qh,serialize:Vh},_py2js_addTraces:{deserialize:qh,serialize:Vh},_py2js_deleteTraces:{deserialize:qh,serialize:Vh},_py2js_moveTraces:{deserialize:qh,serialize:Vh},_py2js_restyle:{deserialize:qh,serialize:Vh},_py2js_relayout:{deserialize:qh,serialize:Vh},_py2js_update:{deserialize:qh,serialize:Vh},_py2js_animate:{deserialize:qh,serialize:Vh},_py2js_removeLayoutProps:{deserialize:qh,serialize:Vh},_py2js_removeTraceProps:{deserialize:qh,serialize:Vh},_js2py_restyle:{deserialize:qh,serialize:Vh},_js2py_relayout:{deserialize:qh,serialize:Vh},_js2py_update:{deserialize:qh,serialize:Vh},_js2py_layoutDelta:{deserialize:qh,serialize:Vh},_js2py_traceDeltas:{deserialize:qh,serialize:Vh},_js2py_pointsCallback:{deserialize:qh,serialize:Vh}},ZA=class{constructor(ge,Ye){this.model=ge,this.el=Ye}perform_render(){var ge=this;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()),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<vr&&(Zr=Zr&&Pt[bi].hasOwnProperty("pointNumbers"),!!Zr);bi++);var ka=vr;if(Zr){ka=0;for(let bi=0;bi<vr;bi++)ka+=Pt[bi].pointNumbers.length}if(Ye={trace_indexes:new Array(ka),point_indexes:new Array(ka),xs:new Array(ka),ys:new Array(ka)},Zr){for(var sn=0,fn=0;fn<vr;fn++)for(let Fi=0;Fi<Pt[fn].pointNumbers.length;Fi++,sn++)Ye.point_indexes[sn]=Pt[fn].pointNumbers[Fi],Ye.xs[sn]=Pt[fn].x,Ye.ys[sn]=Pt[fn].y,Ye.trace_indexes[sn]=Pt[fn].curveNumber;let bi=!0;for(let Fi=1;Fi<ka&&(bi=bi&&Ye.trace_indexes[Fi-1]===Ye.trace_indexes[Fi],!!bi);Fi++);bi&&Ye.point_indexes.sort(function(Fi,Uo){return Fi-Uo})}else for(var fn=0;fn<vr;fn++)Ye.trace_indexes[fn]=Pt[fn].curveNumber,Ye.point_indexes[fn]=Pt[fn].pointNumber,Ye.xs[fn]=Pt[fn].x,Ye.ys[fn]=Pt[fn].y;var Li=Pt[0]!==void 0&&Pt[0].hasOwnProperty("z");if(Li)for(Ye.zs=new Array(vr),fn=0;fn<vr;fn++)Ye.zs[fn]=Pt[fn].z;return Ye}else return null}buildInputDeviceStateObject(ge){var Ye=ge.event;if(Ye===void 0)return null;var Pt={alt:Ye.altKey,ctrl:Ye.ctrlKey,meta:Ye.metaKey,shift:Ye.shiftKey,button:Ye.button,buttons:Ye.buttons};return Pt}buildSelectorObject(ge){var Ye;return ge.hasOwnProperty("range")?Ye={type:"box",selector_state:{xrange:ge.range.x,yrange:ge.range.y}}:ge.hasOwnProperty("lassoPoints")?Ye={type:"lasso",selector_state:{xs:ge.lassoPoints.x,ys:ge.lassoPoints.y}}:Ye=null,Ye}handle_plotly_restyle(ge){if(ge!=null&&!(ge[0]&&ge[0].hasOwnProperty("_doNotReportToPy"))){var Ye=ge[0],Pt=ge[1],vr={style_data:Ye,style_traces:Pt,source_view_id:this.viewID};this.model.set("_js2py_restyle",vr),this.touch()}}touch(){this.model.save_changes()}handle_plotly_relayout(ge){if(ge!=null&&!ge.hasOwnProperty("_doNotReportToPy")){var Ye={relayout_data:ge,source_view_id:this.viewID};this.model.set("_js2py_relayout",Ye),this.touch()}}handle_plotly_update(ge){if(ge!=null&&!(ge.data&&ge.data[0].hasOwnProperty("_doNotReportToPy"))){var Ye={style_data:ge.data[0],style_traces:ge.data[1],layout_data:ge.layout,source_view_id:this.viewID};this.model.set("_js2py_update",Ye),this.touch()}}handle_plotly_click(ge){this._send_points_callback_message(ge,"plotly_click")}handle_plotly_hover(ge){this._send_points_callback_message(ge,"plotly_hover")}handle_plotly_unhover(ge){this._send_points_callback_message(ge,"plotly_unhover")}handle_plotly_selected(ge){this._send_points_callback_message(ge,"plotly_selected")}handle_plotly_deselect(ge){ge={points:[]},this._send_points_callback_message(ge,"plotly_deselect")}_send_points_callback_message(ge,Ye){if(ge!=null){var Pt={event_type:Ye,points:this.buildPointsObject(ge),device_state:this.buildInputDeviceStateObject(ge),selector:this.buildSelectorObject(ge)};Pt.points!==null&&Pt.points!==void 0&&(this.model.set("_js2py_pointsCallback",Pt),this.touch())}}handle_plotly_doubleclick(ge){}do_addTraces(){var ge=this.model.get("_py2js_addTraces");if(ge!==null){var Ye=this;Rd.default.addTraces(this.el,ge.trace_data).then(function(){Ye._sendTraceDeltas(ge.trace_edit_id);var Pt=ge.layout_edit_id;Ye._sendLayoutDelta(Pt)})}}do_deleteTraces(){var ge=this.model.get("_py2js_deleteTraces");if(ge!==null){var Ye=ge.delete_inds,Pt=this;Rd.default.deleteTraces(this.el,Ye).then(function(){var vr=ge.trace_edit_id;Pt._sendTraceDeltas(vr);var Zr=ge.layout_edit_id;Pt._sendLayoutDelta(Zr)})}}do_moveTraces(){var ge=this.model.get("_py2js_moveTraces");if(ge!==null){var Ye=ge.current_trace_inds,Pt=ge.new_trace_inds,vr=Jc.isEqual(Ye,Pt);vr||Rd.default.moveTraces(this.el,Ye,Pt)}}do_restyle(){var ge=this.model.get("_py2js_restyle");if(ge!==null){var Ye=ge.restyle_data,Pt=this.model._normalize_trace_indexes(ge.restyle_traces);Ye._doNotReportToPy=!0,Rd.default.restyle(this.el,Ye,Pt),this._sendTraceDeltas(ge.trace_edit_id);var vr=ge.layout_edit_id;this._sendLayoutDelta(vr)}}do_relayout(){var ge=this.model.get("_py2js_relayout");if(ge!==null){if(ge.source_view_id!==this.viewID){var Ye=ge.relayout_data;Ye._doNotReportToPy=!0,Rd.default.relayout(this.el,ge.relayout_data)}var Pt=ge.layout_edit_id;this._sendLayoutDelta(Pt)}}do_update(){var ge=this.model.get("_py2js_update");if(ge!==null){var Ye=ge.style_data||{},Pt=ge.layout_data||{},vr=this.model._normalize_trace_indexes(ge.style_traces);Ye._doNotReportToPy=!0,Rd.default.update(this.el,Ye,Pt,vr),this._sendTraceDeltas(ge.trace_edit_id);var Zr=ge.layout_edit_id;this._sendLayoutDelta(Zr)}}do_animate(){var ge=this.model.get("_py2js_animate");if(ge!==null){var Ye=ge.animation_opts,Pt=ge.style_data,vr=ge.layout_data,Zr=this.model._normalize_trace_indexes(ge.style_traces),ka={data:Pt,layout:vr,traces:Zr};ka._doNotReportToPy=!0;var sn=this;Rd.default.animate(this.el,ka,Ye).then(function(){sn._sendTraceDeltas(ge.trace_edit_id);var fn=ge.layout_edit_id;sn._sendLayoutDelta(fn)})}}_sendLayoutDelta(ge){var Ye=x_(this.getFullLayout(),this.model.get("_widget_layout")),Pt={layout_delta:Ye,layout_edit_id:ge};this.model.set("_js2py_widget_layoutDelta",Pt),this.touch()}_sendTraceDeltas(ge){for(var Ye=this.model.get("_widget_data"),Pt=Jc.range(Ye.length),vr=new Array(Pt.length),Zr=this.getFullData(),ka=0;ka<Pt.length;ka++){var sn=Pt[ka];vr[ka]=x_(Zr[sn],Ye[sn])}var fn={trace_deltas:vr,trace_edit_id:ge};this.model.set("_js2py_traceDeltas",fn),this.touch()}},dhe={int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array};function vhe(le){var ge;if(le instanceof Int8Array)ge="int8";else if(le instanceof Int16Array)ge="int16";else if(le instanceof Int32Array)ge="int32";else if(le instanceof Uint8Array)ge="uint8";else if(le instanceof Uint16Array)ge="uint16";else if(le instanceof Uint32Array)ge="uint32";else if(le instanceof Float32Array)ge="float32";else if(le instanceof Float64Array)ge="float64";else return le;var Ye={dtype:ge,shape:[le.length],value:le.buffer};return Ye}function Vh(le,ge){var Ye;if(Jc.isTypedArray(le))Ye=vhe(le);else if(Array.isArray(le)){Ye=new Array(le.length);for(var Pt=0;Pt<le.length;Pt++)Ye[Pt]=Vh(le[Pt])}else if(Jc.isObject(le)){Ye={};for(var vr in le)le.hasOwnProperty(vr)&&(Ye[vr]=Vh(le[vr]))}else le===void 0?Ye="_undefined_":Ye=le;return Ye}function qh(le,ge){var Ye;if(Array.isArray(le)){Ye=new Array(le.length);for(var Pt=0;Pt<le.length;Pt++)Ye[Pt]=qh(le[Pt])}else if(Jc.isObject(le))if((Jc.has(le,"value")||Jc.has(le,"buffer"))&&Jc.has(le,"dtype")&&Jc.has(le,"shape")){var vr=dhe[le.dtype],Zr=Jc.has(le,"value")?le.value.buffer:le.buffer.buffer;Ye=new vr(Zr)}else{Ye={};for(var ka in le)le.hasOwnProperty(ka)&&(Ye[ka]=qh(le[ka]))}else le==="_undefined_"?Ye=void 0:Ye=le;return Ye}function mhe(le){return ArrayBuffer.isView(le)&&!(le instanceof DataView)}function aF(le,ge,Ye){if(Ye[0]==="_")return null;if(mhe(ge))return ge}function c2(le,ge){for(var Ye in ge)if(ge.hasOwnProperty(Ye)){var Pt=ge[Ye];Pt===null?Jc.unset(le,Ye):Jc.set(le,Ye,Pt)}}function nF(le,ge,Ye){for(var Pt in ge)if(ge.hasOwnProperty(Pt)){var vr=ge[Pt];Array.isArray(vr)||(vr=[vr]);for(var Zr=0;Zr<Ye.length;Zr++){var ka=Ye[Zr],sn=le[ka],fn=vr[Zr%vr.length];fn===null?Jc.unset(sn,Pt):fn!==void 0&&Jc.set(sn,Pt,fn)}}}function ghe(le,ge,Ye){for(var Pt=[],vr=ge.length-1;vr>=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;ka<Ye.length;ka++)le.splice(Ye[ka],0,Pt[ka])}function iF(le,ge){for(var Ye=0;Ye<ge.length;Ye++){var Pt=ge[Ye];Jc.unset(le,Pt)}}function x_(le,ge){var Ye;Array.isArray(le)?Ye=new Array(le.length):Ye={},ge==null&&(ge={});for(var Pt in le)if(Pt[0]!=="_"&&le.hasOwnProperty(Pt)&&le[Pt]!==null){var vr;if(vr=Jc.isEqual(le[Pt],ge[Pt]),!vr||Pt==="uid"){var Zr=le[Pt];if(ge.hasOwnProperty(Pt)&&typeof Zr=="object")if(Array.isArray(Zr))if(Zr.length>0&&typeof Zr[0]=="object"){Ye[Pt]=new Array(Zr.length);for(var ka=0;ka<Zr.length;ka++)!Array.isArray(ge[Pt])||ge[Pt].length<=ka?Ye[Pt][ka]=Zr[ka]:Ye[Pt][ka]=x_(Zr[ka],ge[Pt][ka])}else Ye[Pt]=Zr;else{var sn=x_(Zr,ge[Pt]);Object.keys(sn).length>0&&(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.floor(vr);ka++)fn=Math.floor(Math.random()*Ye).toString(Ye),Zr=fn+Zr;Li&&(sn=Math.pow(Ye,Li),fn=Math.floor(Math.random()*sn).toString(Ye),Zr=fn+Zr);var bi=parseInt(Zr,Ye);return le&&le[Zr]||bi!==1/0&&bi>=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 <https://feross.org>
|
||
* @license MIT
|
||
*)
|
||
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||
(*!
|
||
* Determine if an object is a Buffer
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*)
|
||
(*!
|
||
* pad-left <https://github.com/jonschlinkert/pad-left>
|
||
*
|
||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||
* Licensed under the MIT license.
|
||
*)
|
||
(*!
|
||
* repeat-string <https://github.com/jonschlinkert/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 <https://feross.org/opensource> *)
|
||
|
||
buffer/index.js:
|
||
(*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <https://feross.org>
|
||
* @license MIT
|
||
*)
|
||
|
||
safe-buffer/index.js:
|
||
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||
|
||
assert/build/internal/util/comparisons.js:
|
||
(*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @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) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*)
|
||
|
||
lodash-es/lodash.js:
|
||
(**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*)
|
||
*/
|