diff --git "a/dist/assets/index-BC9hsUFb.js" "b/dist/assets/index-BC9hsUFb.js" new file mode 100644--- /dev/null +++ "b/dist/assets/index-BC9hsUFb.js" @@ -0,0 +1,3846 @@ +(function(){const ht=document.createElement("link").relList;if(ht&&ht.supports&&ht.supports("modulepreload"))return;for(const lr of document.querySelectorAll('link[rel="modulepreload"]'))wt(lr);new MutationObserver(lr=>{for(const vr of lr)if(vr.type==="childList")for(const Cr of vr.addedNodes)Cr.tagName==="LINK"&&Cr.rel==="modulepreload"&&wt(Cr)}).observe(document,{childList:!0,subtree:!0});function St(lr){const vr={};return lr.integrity&&(vr.integrity=lr.integrity),lr.referrerPolicy&&(vr.referrerPolicy=lr.referrerPolicy),lr.crossOrigin==="use-credentials"?vr.credentials="include":lr.crossOrigin==="anonymous"?vr.credentials="omit":vr.credentials="same-origin",vr}function wt(lr){if(lr.ep)return;lr.ep=!0;const vr=St(lr);fetch(lr.href,vr)}})();function uk(Ie){return Ie&&Ie.__esModule&&Object.prototype.hasOwnProperty.call(Ie,"default")?Ie.default:Ie}var M6={exports:{}},_T={};var QL;function pO(){if(QL)return _T;QL=1;var Ie=Symbol.for("react.transitional.element"),ht=Symbol.for("react.fragment");function St(wt,lr,vr){var Cr=null;if(vr!==void 0&&(Cr=""+vr),lr.key!==void 0&&(Cr=""+lr.key),"key"in lr){vr={};for(var nn in lr)nn!=="key"&&(vr[nn]=lr[nn])}else vr=lr;return lr=vr.ref,{$$typeof:Ie,type:wt,key:Cr,ref:lr!==void 0?lr:null,props:vr}}return _T.Fragment=ht,_T.jsx=St,_T.jsxs=St,_T}var e8;function mO(){return e8||(e8=1,M6.exports=pO()),M6.exports}var Fo=mO(),E6={exports:{}},Tu={};var t8;function gO(){if(t8)return Tu;t8=1;var Ie=Symbol.for("react.transitional.element"),ht=Symbol.for("react.portal"),St=Symbol.for("react.fragment"),wt=Symbol.for("react.strict_mode"),lr=Symbol.for("react.profiler"),vr=Symbol.for("react.consumer"),Cr=Symbol.for("react.context"),nn=Symbol.for("react.forward_ref"),bn=Symbol.for("react.suspense"),Jr=Symbol.for("react.memo"),Tn=Symbol.for("react.lazy"),zn=Symbol.for("react.activity"),_a=Symbol.iterator;function Qn(qa){return qa===null||typeof qa!="object"?null:(qa=_a&&qa[_a]||qa["@@iterator"],typeof qa=="function"?qa:null)}var fo={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},So=Object.assign,Io={};function bi(qa,ro,$n){this.props=qa,this.context=ro,this.refs=Io,this.updater=$n||fo}bi.prototype.isReactComponent={},bi.prototype.setState=function(qa,ro){if(typeof qa!="object"&&typeof qa!="function"&&qa!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,qa,ro,"setState")},bi.prototype.forceUpdate=function(qa){this.updater.enqueueForceUpdate(this,qa,"forceUpdate")};function Ge(){}Ge.prototype=bi.prototype;function ko(qa,ro,$n){this.props=qa,this.context=ro,this.refs=Io,this.updater=$n||fo}var Tl=ko.prototype=new Ge;Tl.constructor=ko,So(Tl,bi.prototype),Tl.isPureReactComponent=!0;var Mo=Array.isArray;function yi(){}var Fi={H:null,A:null,T:null,S:null},Ts=Object.prototype.hasOwnProperty;function Mi(qa,ro,$n){var xs=$n.ref;return{$$typeof:Ie,type:qa,key:ro,ref:xs!==void 0?xs:null,props:$n}}function rl(qa,ro){return Mi(qa.type,ro,qa.props)}function ji(qa){return typeof qa=="object"&&qa!==null&&qa.$$typeof===Ie}function Bo(qa){var ro={"=":"=0",":":"=2"};return"$"+qa.replace(/[=:]/g,function($n){return ro[$n]})}var tu=/\/+/g;function Pi(qa,ro){return typeof qa=="object"&&qa!==null&&qa.key!=null?Bo(""+qa.key):ro.toString(36)}function zi(qa){switch(qa.status){case"fulfilled":return qa.value;case"rejected":throw qa.reason;default:switch(typeof qa.status=="string"?qa.then(yi,yi):(qa.status="pending",qa.then(function(ro){qa.status==="pending"&&(qa.status="fulfilled",qa.value=ro)},function(ro){qa.status==="pending"&&(qa.status="rejected",qa.reason=ro)})),qa.status){case"fulfilled":return qa.value;case"rejected":throw qa.reason}}throw qa}function Si(qa,ro,$n,xs,Bs){var Qi=typeof qa;(Qi==="undefined"||Qi==="boolean")&&(qa=null);var Hs=!1;if(qa===null)Hs=!0;else switch(Qi){case"bigint":case"string":case"number":Hs=!0;break;case"object":switch(qa.$$typeof){case Ie:case ht:Hs=!0;break;case Tn:return Hs=qa._init,Si(Hs(qa._payload),ro,$n,xs,Bs)}}if(Hs)return Bs=Bs(qa),Hs=xs===""?"."+Pi(qa,0):xs,Mo(Bs)?($n="",Hs!=null&&($n=Hs.replace(tu,"$&/")+"/"),Si(Bs,ro,$n,"",function(ed){return ed})):Bs!=null&&(ji(Bs)&&(Bs=rl(Bs,$n+(Bs.key==null||qa&&qa.key===Bs.key?"":(""+Bs.key).replace(tu,"$&/")+"/")+Hs)),ro.push(Bs)),1;Hs=0;var Ef=xs===""?".":xs+":";if(Mo(qa))for(var cc=0;cc>>1,wa=Si[Au];if(0>>1;Aulr($n,As))xslr(Bs,$n)?(Si[Au]=Bs,Si[xs]=As,Au=xs):(Si[Au]=$n,Si[ro]=As,Au=ro);else if(xslr(Bs,As))Si[Au]=Bs,Si[xs]=As,Au=xs;else break e}}return wo}function lr(Si,wo){var As=Si.sortIndex-wo.sortIndex;return As!==0?As:Si.id-wo.id}if(Ie.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var vr=performance;Ie.unstable_now=function(){return vr.now()}}else{var Cr=Date,nn=Cr.now();Ie.unstable_now=function(){return Cr.now()-nn}}var bn=[],Jr=[],Tn=1,zn=null,_a=3,Qn=!1,fo=!1,So=!1,Io=!1,bi=typeof setTimeout=="function"?setTimeout:null,Ge=typeof clearTimeout=="function"?clearTimeout:null,ko=typeof setImmediate<"u"?setImmediate:null;function Tl(Si){for(var wo=St(Jr);wo!==null;){if(wo.callback===null)wt(Jr);else if(wo.startTime<=Si)wt(Jr),wo.sortIndex=wo.expirationTime,ht(bn,wo);else break;wo=St(Jr)}}function Mo(Si){if(So=!1,Tl(Si),!fo)if(St(bn)!==null)fo=!0,yi||(yi=!0,Bo());else{var wo=St(Jr);wo!==null&&zi(Mo,wo.startTime-Si)}}var yi=!1,Fi=-1,Ts=5,Mi=-1;function rl(){return Io?!0:!(Ie.unstable_now()-MiSi&&rl());){var Au=zn.callback;if(typeof Au=="function"){zn.callback=null,_a=zn.priorityLevel;var wa=Au(zn.expirationTime<=Si);if(Si=Ie.unstable_now(),typeof wa=="function"){zn.callback=wa,Tl(Si),wo=!0;break t}zn===St(bn)&&wt(bn),Tl(Si)}else wt(bn);zn=St(bn)}if(zn!==null)wo=!0;else{var qa=St(Jr);qa!==null&&zi(Mo,qa.startTime-Si),wo=!1}}break e}finally{zn=null,_a=As,Qn=!1}wo=void 0}}finally{wo?Bo():yi=!1}}}var Bo;if(typeof ko=="function")Bo=function(){ko(ji)};else if(typeof MessageChannel<"u"){var tu=new MessageChannel,Pi=tu.port2;tu.port1.onmessage=ji,Bo=function(){Pi.postMessage(null)}}else Bo=function(){bi(ji,0)};function zi(Si,wo){Fi=bi(function(){Si(Ie.unstable_now())},wo)}Ie.unstable_IdlePriority=5,Ie.unstable_ImmediatePriority=1,Ie.unstable_LowPriority=4,Ie.unstable_NormalPriority=3,Ie.unstable_Profiling=null,Ie.unstable_UserBlockingPriority=2,Ie.unstable_cancelCallback=function(Si){Si.callback=null},Ie.unstable_forceFrameRate=function(Si){0>Si||125Au?(Si.sortIndex=As,ht(Jr,Si),St(bn)===null&&Si===St(Jr)&&(So?(Ge(Fi),Fi=-1):So=!0,zi(Mo,As-Au))):(Si.sortIndex=wa,ht(bn,Si),fo||Qn||(fo=!0,yi||(yi=!0,Bo()))),Si},Ie.unstable_shouldYield=rl,Ie.unstable_wrapCallback=function(Si){var wo=_a;return function(){var As=_a;_a=wo;try{return Si.apply(this,arguments)}finally{_a=As}}}})(L6)),L6}var a8;function _O(){return a8||(a8=1,C6.exports=yO()),C6.exports}var P6={exports:{}},Yd={};var i8;function xO(){if(i8)return Yd;i8=1;var Ie=nM();function ht(bn){var Jr="https://react.dev/errors/"+bn;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ie)}catch(ht){console.error(ht)}}return Ie(),P6.exports=xO(),P6.exports}var s8;function wO(){if(s8)return xT;s8=1;var Ie=_O(),ht=nM(),St=bO();function wt(O){var W="https://react.dev/errors/"+O;if(1wa||(O.current=Au[wa],Au[wa]=null,wa--)}function $n(O,W){wa++,Au[wa]=O.current,O.current=W}var xs=qa(null),Bs=qa(null),Qi=qa(null),Hs=qa(null);function Ef(O,W){switch($n(Qi,W),$n(Bs,O),$n(xs,null),W.nodeType){case 9:case 11:O=(O=W.documentElement)&&(O=O.namespaceURI)?p3(O):0;break;default:if(O=W.tagName,W=W.namespaceURI)W=p3(W),O=m3(W,O);else switch(O){case"svg":O=1;break;case"math":O=2;break;default:O=0}}ro(xs),$n(xs,O)}function cc(){ro(xs),ro(Bs),ro(Qi)}function ed(O){O.memoizedState!==null&&$n(Hs,O);var W=xs.current,de=m3(W,O.type);W!==de&&($n(Bs,O),$n(xs,de))}function ru(O){Bs.current===O&&(ro(xs),ro(Bs)),Hs.current===O&&(ro(Hs),Ny._currentValue=As)}var n0,th;function _o(O){if(n0===void 0)try{throw Error()}catch(de){var W=de.stack.trim().match(/\n( *(at )?)/);n0=W&&W[1]||"",th=-1)":-1ut||Sa[Re]!==wi[ut]){var eo=` +`+Sa[Re].replace(" at new "," at ");return O.displayName&&eo.includes("")&&(eo=eo.replace("",O.displayName)),eo}while(1<=Re&&0<=ut);break}}}finally{cp=!1,Error.prepareStackTrace=de}return(de=O?O.displayName||O.name:"")?_o(de):""}function J_(O,W){switch(O.tag){case 26:case 27:case 5:return _o(O.type);case 16:return _o("Lazy");case 13:return O.child!==W&&W!==null?_o("Suspense Fallback"):_o("Suspense");case 19:return _o("SuspenseList");case 0:case 15:return a0(O.type,!1);case 11:return a0(O.type.render,!1);case 1:return a0(O.type,!0);case 31:return _o("Activity");default:return""}}function S0(O){try{var W="",de=null;do W+=J_(O,de),de=O,O=O.return;while(O);return W}catch(Re){return` +Error generating stack: `+Re.message+` +`+Re.stack}}var Km=Object.prototype.hasOwnProperty,fp=Ie.unstable_scheduleCallback,$m=Ie.unstable_cancelCallback,Q_=Ie.unstable_shouldYield,Dw=Ie.unstable_requestPaint,md=Ie.unstable_now,zw=Ie.unstable_getCurrentPriorityLevel,ao=Ie.unstable_ImmediatePriority,us=Ie.unstable_UserBlockingPriority,Jl=Ie.unstable_NormalPriority,$u=Ie.unstable_LowPriority,Zc=Ie.unstable_IdlePriority,Wd=Ie.log,M0=Ie.unstable_setDisableYieldValue,gd=null,cv=null;function Td(O){if(typeof Wd=="function"&&M0(O),cv&&typeof cv.setStrictMode=="function")try{cv.setStrictMode(gd,O)}catch{}}var kf=Math.clz32?Math.clz32:sM,em=Math.log,Cp=Math.LN2;function sM(O){return O>>>=0,O===0?32:31-(em(O)/Cp|0)|0}var ex=256,tx=262144,rx=4194304;function Jm(O){var W=O&42;if(W!==0)return W;switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return O&261888;case 262144:case 524288:case 1048576:case 2097152:return O&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return O&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return O}}function nx(O,W,de){var Re=O.pendingLanes;if(Re===0)return 0;var ut=0,Pt=O.suspendedLanes,Rr=O.pingedLanes;O=O.warmLanes;var xn=Re&134217727;return xn!==0?(Re=xn&~Pt,Re!==0?ut=Jm(Re):(Rr&=xn,Rr!==0?ut=Jm(Rr):de||(de=xn&~O,de!==0&&(ut=Jm(de))))):(xn=Re&~Pt,xn!==0?ut=Jm(xn):Rr!==0?ut=Jm(Rr):de||(de=Re&~O,de!==0&&(ut=Jm(de)))),ut===0?0:W!==0&&W!==ut&&(W&Pt)===0&&(Pt=ut&-ut,de=W&-W,Pt>=de||Pt===32&&(de&4194048)!==0)?W:ut}function g1(O,W){return(O.pendingLanes&~(O.suspendedLanes&~O.pingedLanes)&W)===0}function lM(O,W){switch(O){case 1:case 2:case 4:case 8:case 64:return W+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return W+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function RT(){var O=rx;return rx<<=1,(rx&62914560)===0&&(rx=4194304),O}function Ow(O){for(var W=[],de=0;31>de;de++)W.push(O);return W}function y1(O,W){O.pendingLanes|=W,W!==268435456&&(O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0)}function uM(O,W,de,Re,ut,Pt){var Rr=O.pendingLanes;O.pendingLanes=de,O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0,O.expiredLanes&=de,O.entangledLanes&=de,O.errorRecoveryDisabledLanes&=de,O.shellSuspendCounter=0;var xn=O.entanglements,Sa=O.expirationTimes,wi=O.hiddenUpdates;for(de=Rr&~de;0"u")return null;try{return O.activeElement||O.body}catch{return O.body}}var b1=/[\n"\\]/g;function vp(O){return O.replace(b1,function(W){return"\\"+W.charCodeAt(0).toString(16)+" "})}function sx(O,W,de,Re,ut,Pt,Rr,xn){O.name="",Rr!=null&&typeof Rr!="function"&&typeof Rr!="symbol"&&typeof Rr!="boolean"?O.type=Rr:O.removeAttribute("type"),W!=null?Rr==="number"?(W===0&&O.value===""||O.value!=W)&&(O.value=""+hp(W)):O.value!==""+hp(W)&&(O.value=""+hp(W)):Rr!=="submit"&&Rr!=="reset"||O.removeAttribute("value"),W!=null?pu(O,Rr,hp(W)):de!=null?pu(O,Rr,hp(de)):Re!=null&&O.removeAttribute("value"),ut==null&&Pt!=null&&(O.defaultChecked=!!Pt),ut!=null&&(O.checked=ut&&typeof ut!="function"&&typeof ut!="symbol"),xn!=null&&typeof xn!="function"&&typeof xn!="symbol"&&typeof xn!="boolean"?O.name=""+hp(xn):O.removeAttribute("name")}function Qg(O,W,de,Re,ut,Pt,Rr,xn){if(Pt!=null&&typeof Pt!="function"&&typeof Pt!="symbol"&&typeof Pt!="boolean"&&(O.type=Pt),W!=null||de!=null){if(!(Pt!=="submit"&&Pt!=="reset"||W!=null)){ox(O);return}de=de!=null?""+hp(de):"",W=W!=null?""+hp(W):de,xn||W===O.value||(O.value=W),O.defaultValue=W}Re=Re??ut,Re=typeof Re!="function"&&typeof Re!="symbol"&&!!Re,O.checked=xn?O.checked:!!Re,O.defaultChecked=!!Re,Rr!=null&&typeof Rr!="function"&&typeof Rr!="symbol"&&typeof Rr!="boolean"&&(O.name=Rr),ox(O)}function pu(O,W,de){W==="number"&&P0(O.ownerDocument)===O||O.defaultValue===""+de||(O.defaultValue=""+de)}function rh(O,W,de,Re){if(O=O.options,W){W={};for(var ut=0;ut"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vv=!1;if(i0)try{var Pp={};Object.defineProperty(Pp,"passive",{get:function(){vv=!0}}),window.addEventListener("test",Pp,Pp),window.removeEventListener("test",Pp,Pp)}catch{vv=!1}var Sd=null,ux=null,vh=null;function UT(){if(vh)return vh;var O,W=ux,de=W.length,Re,ut="value"in Sd?Sd.value:Sd.textContent,Pt=ut.length;for(O=0;O=A1),S1=" ",hx=!1;function vx(O,W){switch(O){case"keyup":return bM.indexOf(W.keyCode)!==-1;case"keydown":return W.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dx(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var dp=!1;function Zw(O,W){switch(O){case"compositionend":return dx(W);case"keypress":return W.which!==32?null:(hx=!0,S1);case"textInput":return O=W.data,O===S1&&hx?null:O;default:return null}}function $T(O,W){if(dp)return O==="compositionend"||!Yw&&vx(O,W)?(O=UT(),vh=ux=Sd=null,dp=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(W.ctrlKey||W.altKey||W.metaKey)||W.ctrlKey&&W.altKey){if(W.char&&1=W)return{node:de,offset:W-O};O=Re}e:{for(;de;){if(de.nextSibling){de=de.nextSibling;break e}de=de.parentNode}de=void 0}de=t5(de)}}function n5(O,W){return O&&W?O===W?!0:O&&O.nodeType===3?!1:W&&W.nodeType===3?n5(O,W.parentNode):"contains"in O?O.contains(W):O.compareDocumentPosition?!!(O.compareDocumentPosition(W)&16):!1:!1}function a5(O){O=O!=null&&O.ownerDocument!=null&&O.ownerDocument.defaultView!=null?O.ownerDocument.defaultView:window;for(var W=P0(O.document);W instanceof O.HTMLIFrameElement;){try{var de=typeof W.contentWindow.location.href=="string"}catch{de=!1}if(de)O=W.contentWindow;else break;W=P0(O.document)}return W}function ey(O){var W=O&&O.nodeName&&O.nodeName.toLowerCase();return W&&(W==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||W==="textarea"||O.contentEditable==="true")}var SM=i0&&"documentMode"in document&&11>=document.documentMode,ty=null,gx=null,lm=null,um=!1;function o0(O,W,de){var Re=de.window===de?de.document:de.nodeType===9?de:de.ownerDocument;um||ty==null||ty!==P0(Re)||(Re=ty,"selectionStart"in Re&&ey(Re)?Re={start:Re.selectionStart,end:Re.selectionEnd}:(Re=(Re.ownerDocument&&Re.ownerDocument.defaultView||window).getSelection(),Re={anchorNode:Re.anchorNode,anchorOffset:Re.anchorOffset,focusNode:Re.focusNode,focusOffset:Re.focusOffset}),lm&&E1(lm,Re)||(lm=Re,Re=v_(gx,"onSelect"),0>=Rr,ut-=Rr,qf=1<<32-kf(W)+ut|de<mu?(qu=Ns,Ns=null):qu=Ns.sibling;var kc=Ci(oi,Ns,gi[mu],to);if(kc===null){Ns===null&&(Ns=qu);break}O&&Ns&&kc.alternate===null&&W(oi,Ns),Ga=Pt(kc,Ga,mu),mc===null?_l=kc:mc.sibling=kc,mc=kc,Ns=qu}if(mu===gi.length)return de(oi,Ns),Nu&&Mh(oi,mu),_l;if(Ns===null){for(;mumu?(qu=Ns,Ns=null):qu=Ns.sibling;var zm=Ci(oi,Ns,kc.value,to);if(zm===null){Ns===null&&(Ns=qu);break}O&&Ns&&zm.alternate===null&&W(oi,Ns),Ga=Pt(zm,Ga,mu),mc===null?_l=zm:mc.sibling=zm,mc=zm,Ns=qu}if(kc.done)return de(oi,Ns),Nu&&Mh(oi,mu),_l;if(Ns===null){for(;!kc.done;mu++,kc=gi.next())kc=so(oi,kc.value,to),kc!==null&&(Ga=Pt(kc,Ga,mu),mc===null?_l=kc:mc.sibling=kc,mc=kc);return Nu&&Mh(oi,mu),_l}for(Ns=Re(Ns);!kc.done;mu++,kc=gi.next())kc=Ni(Ns,oi,mu,kc.value,to),kc!==null&&(O&&kc.alternate!==null&&Ns.delete(kc.key===null?mu:kc.key),Ga=Pt(kc,Ga,mu),mc===null?_l=kc:mc.sibling=kc,mc=kc);return O&&Ns.forEach(function(tE){return W(oi,tE)}),Nu&&Mh(oi,mu),_l}function _f(oi,Ga,gi,to){if(typeof gi=="object"&&gi!==null&&gi.type===So&&gi.key===null&&(gi=gi.props.children),typeof gi=="object"&&gi!==null){switch(gi.$$typeof){case Qn:e:{for(var _l=gi.key;Ga!==null;){if(Ga.key===_l){if(_l=gi.type,_l===So){if(Ga.tag===7){de(oi,Ga.sibling),to=ut(Ga,gi.props.children),to.return=oi,oi=to;break e}}else if(Ga.elementType===_l||typeof _l=="object"&&_l!==null&&_l.$$typeof===Ts&&hg(_l)===Ga.type){de(oi,Ga.sibling),to=ut(Ga,gi.props),O1(to,gi),to.return=oi,oi=to;break e}de(oi,Ga);break}else W(oi,Ga);Ga=Ga.sibling}gi.type===So?(to=cm(gi.props.children,oi.mode,to,gi.key),to.return=oi,oi=to):(to=I0(gi.type,gi.key,gi.props,null,oi.mode,to),O1(to,gi),to.return=oi,oi=to)}return Rr(oi);case fo:e:{for(_l=gi.key;Ga!==null;){if(Ga.key===_l)if(Ga.tag===4&&Ga.stateNode.containerInfo===gi.containerInfo&&Ga.stateNode.implementation===gi.implementation){de(oi,Ga.sibling),to=ut(Ga,gi.children||[]),to.return=oi,oi=to;break e}else{de(oi,Ga);break}else W(oi,Ga);Ga=Ga.sibling}to=tp(gi,oi.mode,to),to.return=oi,oi=to}return Rr(oi);case Ts:return gi=hg(gi),_f(oi,Ga,gi,to)}if(zi(gi))return Ws(oi,Ga,gi,to);if(Bo(gi)){if(_l=Bo(gi),typeof _l!="function")throw Error(wt(150));return gi=_l.call(gi),Bl(oi,Ga,gi,to)}if(typeof gi.then=="function")return _f(oi,Ga,kx(gi),to);if(gi.$$typeof===ko)return _f(oi,Ga,Tx(oi,gi),to);Ac(oi,gi)}return typeof gi=="string"&&gi!==""||typeof gi=="number"||typeof gi=="bigint"?(gi=""+gi,Ga!==null&&Ga.tag===6?(de(oi,Ga.sibling),to=ut(Ga,gi),to.return=oi,oi=to):(de(oi,Ga),to=a2(gi,oi.mode,to),to.return=oi,oi=to),Rr(oi)):de(oi,Ga)}return function(oi,Ga,gi,to){try{z1=0;var _l=_f(oi,Ga,gi,to);return cy=null,_l}catch(Ns){if(Ns===dm||Ns===uy)throw Ns;var mc=Gv(29,Ns,null,oi.mode);return mc.lanes=to,mc.return=oi,mc}}}var pm=v2(!0),g5=v2(!1),F0=!1;function d2(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function p2(O,W){O=O.updateQueue,W.updateQueue===O&&(W.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,callbacks:null})}function mm(O){return{lane:O,tag:0,payload:null,callback:null,next:null}}function gm(O,W,de){var Re=O.updateQueue;if(Re===null)return null;if(Re=Re.shared,(Mc&2)!==0){var ut=Re.pending;return ut===null?W.next=W:(W.next=ut.next,ut.next=W),Re.pending=W,W=bx(O),Fp(O,null,de),W}return xx(O,Re,W,de),bx(O)}function F1(O,W,de){if(W=W.updateQueue,W!==null&&(W=W.shared,(de&4194048)!==0)){var Re=W.lanes;Re&=O.pendingLanes,de|=Re,W.lanes=de,Fw(O,de)}}function m2(O,W){var de=O.updateQueue,Re=O.alternate;if(Re!==null&&(Re=Re.updateQueue,de===Re)){var ut=null,Pt=null;if(de=de.firstBaseUpdate,de!==null){do{var Rr={lane:de.lane,tag:de.tag,payload:de.payload,callback:null,next:null};Pt===null?ut=Pt=Rr:Pt=Pt.next=Rr,de=de.next}while(de!==null);Pt===null?ut=Pt=W:Pt=Pt.next=W}else ut=Pt=W;de={baseState:Re.baseState,firstBaseUpdate:ut,lastBaseUpdate:Pt,shared:Re.shared,callbacks:Re.callbacks},O.updateQueue=de;return}O=de.lastBaseUpdate,O===null?de.firstBaseUpdate=W:O.next=W,de.lastBaseUpdate=W}var g2=!1;function B1(){if(g2){var O=ly;if(O!==null)throw O}}function N1(O,W,de,Re){g2=!1;var ut=O.updateQueue;F0=!1;var Pt=ut.firstBaseUpdate,Rr=ut.lastBaseUpdate,xn=ut.shared.pending;if(xn!==null){ut.shared.pending=null;var Sa=xn,wi=Sa.next;Sa.next=null,Rr===null?Pt=wi:Rr.next=wi,Rr=Sa;var eo=O.alternate;eo!==null&&(eo=eo.updateQueue,xn=eo.lastBaseUpdate,xn!==Rr&&(xn===null?eo.firstBaseUpdate=wi:xn.next=wi,eo.lastBaseUpdate=Sa))}if(Pt!==null){var so=ut.baseState;Rr=0,eo=wi=Sa=null,xn=Pt;do{var Ci=xn.lane&-536870913,Ni=Ci!==xn.lane;if(Ni?(ec&Ci)===Ci:(Re&Ci)===Ci){Ci!==0&&Ci===fg&&(g2=!0),eo!==null&&(eo=eo.next={lane:0,tag:xn.tag,payload:xn.payload,callback:null,next:null});e:{var Ws=O,Bl=xn;Ci=W;var _f=de;switch(Bl.tag){case 1:if(Ws=Bl.payload,typeof Ws=="function"){so=Ws.call(_f,so,Ci);break e}so=Ws;break e;case 3:Ws.flags=Ws.flags&-65537|128;case 0:if(Ws=Bl.payload,Ci=typeof Ws=="function"?Ws.call(_f,so,Ci):Ws,Ci==null)break e;so=zn({},so,Ci);break e;case 2:F0=!0}}Ci=xn.callback,Ci!==null&&(O.flags|=64,Ni&&(O.flags|=8192),Ni=ut.callbacks,Ni===null?ut.callbacks=[Ci]:Ni.push(Ci))}else Ni={lane:Ci,tag:xn.tag,payload:xn.payload,callback:xn.callback,next:null},eo===null?(wi=eo=Ni,Sa=so):eo=eo.next=Ni,Rr|=Ci;if(xn=xn.next,xn===null){if(xn=ut.shared.pending,xn===null)break;Ni=xn,xn=Ni.next,Ni.next=null,ut.lastBaseUpdate=Ni,ut.shared.pending=null}}while(!0);eo===null&&(Sa=so),ut.baseState=Sa,ut.firstBaseUpdate=wi,ut.lastBaseUpdate=eo,Pt===null&&(ut.shared.lanes=0),G0|=Rr,O.lanes=Rr,O.memoizedState=so}}function y5(O,W){if(typeof O!="function")throw Error(wt(191,O));O.call(W)}function y2(O,W){var de=O.callbacks;if(de!==null)for(O.callbacks=null,O=0;OPt?Pt:8;var Rr=Si.T,xn={};Si.T=xn,Z1(O,!1,W,de);try{var Sa=ut(),wi=Si.S;if(wi!==null&&wi(xn,Sa),Sa!==null&&typeof Sa=="object"&&typeof Sa.then=="function"){var eo=PM(Sa,Re);my(O,W,eo,id(O))}else my(O,W,Re,id(O))}catch(so){my(O,W,{then:function(){},status:"rejected",reason:so},id())}finally{wo.p=Pt,Rr!==null&&xn.types!==null&&(Rr.types=xn.types),Si.T=Rr}}function Jx(){}function Qx(O,W,de,Re){if(O.tag!==5)throw Error(wt(476));var ut=Y1(O).queue;C2(O,ut,W,As,de===null?Jx:function(){return L2(O),de(Re)})}function Y1(O){var W=O.memoizedState;if(W!==null)return W;W={memoizedState:As,baseState:As,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:c0,lastRenderedState:As},next:null};var de={};return W.next={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:c0,lastRenderedState:de},next:null},O.memoizedState=W,O=O.alternate,O!==null&&(O.memoizedState=W),W}function L2(O){var W=Y1(O);W.next===null&&(W=O.alternate.memoizedState),my(O,W.next.queue,{},id())}function eb(){return zv(Ny)}function C5(){return mh().memoizedState}function P2(){return mh().memoizedState}function L5(O){for(var W=O.return;W!==null;){switch(W.tag){case 24:case 3:var de=id();O=mm(de);var Re=gm(W,O,de);Re!==null&&(Id(Re,W,de),F1(Re,W,de)),W={cache:c2()},O.payload=W;return}W=W.return}}function P5(O,W,de){var Re=id();de={lane:Re,revertLane:0,gesture:null,action:de,hasEagerState:!1,eagerState:null,next:null},gy(O)?R2(W,de):(de=n2(O,W,de,Re),de!==null&&(Id(de,O,Re),R5(de,W,Re)))}function tb(O,W,de){var Re=id();my(O,W,de,Re)}function my(O,W,de,Re){var ut={lane:Re,revertLane:0,gesture:null,action:de,hasEagerState:!1,eagerState:null,next:null};if(gy(O))R2(W,ut);else{var Pt=O.alternate;if(O.lanes===0&&(Pt===null||Pt.lanes===0)&&(Pt=W.lastRenderedReducer,Pt!==null))try{var Rr=W.lastRenderedState,xn=Pt(Rr,de);if(ut.hasEagerState=!0,ut.eagerState=xn,$d(xn,Rr))return xx(O,W,ut,0),Pf===null&&C1(),!1}catch{}if(de=n2(O,W,ut,Re),de!==null)return Id(de,O,Re),R5(de,W,Re),!0}return!1}function Z1(O,W,de,Re){if(Re={lane:2,revertLane:Ly(),gesture:null,action:Re,hasEagerState:!1,eagerState:null,next:null},gy(O)){if(W)throw Error(wt(479))}else W=n2(O,de,Re,2),W!==null&&Id(W,O,2)}function gy(O){var W=O.alternate;return O===nu||W!==null&&W===nu}function R2(O,W){vy=_m=!0;var de=O.pending;de===null?W.next=W:(W.next=de.next,de.next=W),O.pending=W}function R5(O,W,de){if((de&4194048)!==0){var Re=W.lanes;Re&=O.pendingLanes,de|=Re,W.lanes=de,Fw(O,de)}}var W1={readContext:zv,use:Rx,useCallback:ph,useContext:ph,useEffect:ph,useImperativeHandle:ph,useLayoutEffect:ph,useInsertionEffect:ph,useMemo:ph,useReducer:ph,useRef:ph,useState:ph,useDebugValue:ph,useDeferredValue:ph,useTransition:ph,useSyncExternalStore:ph,useId:ph,useHostTransitionStatus:ph,useFormState:ph,useActionState:ph,useOptimistic:ph,useMemoCache:ph,useCacheRefresh:ph};W1.useEffectEvent=ph;var I2={readContext:zv,use:Rx,useCallback:function(O,W){return mv().memoizedState=[O,W===void 0?null:W],O},useContext:zv,useEffect:Yx,useImperativeHandle:function(O,W,de){de=de!=null?de.concat([O]):null,Gx(4194308,4,Wx.bind(null,W,O),de)},useLayoutEffect:function(O,W){return Gx(4194308,4,O,W)},useInsertionEffect:function(O,W){Gx(4,2,O,W)},useMemo:function(O,W){var de=mv();W=W===void 0?null:W;var Re=O();if(dg){Td(!0);try{O()}finally{Td(!1)}}return de.memoizedState=[Re,W],Re},useReducer:function(O,W,de){var Re=mv();if(de!==void 0){var ut=de(W);if(dg){Td(!0);try{de(W)}finally{Td(!1)}}}else ut=W;return Re.memoizedState=Re.baseState=ut,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:ut},Re.queue=O,O=O.dispatch=P5.bind(null,nu,O),[Re.memoizedState,O]},useRef:function(O){var W=mv();return O={current:O},W.memoizedState=O},useState:function(O){O=V1(O);var W=O.queue,de=tb.bind(null,nu,W);return W.dispatch=de,[O.memoizedState,de]},useDebugValue:Kx,useDeferredValue:function(O,W){var de=mv();return X1(de,O,W)},useTransition:function(){var O=V1(!1);return O=C2.bind(null,nu,O.queue,!0,!1),mv().memoizedState=O,[!1,O]},useSyncExternalStore:function(O,W,de){var Re=nu,ut=mv();if(Nu){if(de===void 0)throw Error(wt(407));de=de()}else{if(de=W(),Pf===null)throw Error(wt(349));(ec&127)!==0||Ox(Re,W,de)}ut.memoizedState=de;var Pt={value:de,getSnapshot:W};return ut.queue=Pt,Yx(Bx.bind(null,Re,Pt,O),[O]),Re.flags|=2048,py(9,{destroy:void 0},Fx.bind(null,Re,Pt,de,W),null),de},useId:function(){var O=mv(),W=Pf.identifierPrefix;if(Nu){var de=mp,Re=qf;de=(Re&~(1<<32-kf(Re)-1)).toString(32)+de,W="_"+W+"R_"+de,de=pg++,0<\/script>",Pt=Pt.removeChild(Pt.firstChild);break;case"select":Pt=typeof Re.is=="string"?Rr.createElement("select",{is:Re.is}):Rr.createElement("select"),Re.multiple?Pt.multiple=!0:Re.size&&(Pt.size=Re.size);break;default:Pt=typeof Re.is=="string"?Rr.createElement(ut,{is:Re.is}):Rr.createElement(ut)}}Pt[Al]=W,Pt[td]=Re;e:for(Rr=W.child;Rr!==null;){if(Rr.tag===5||Rr.tag===6)Pt.appendChild(Rr.stateNode);else if(Rr.tag!==4&&Rr.tag!==27&&Rr.child!==null){Rr.child.return=Rr,Rr=Rr.child;continue}if(Rr===W)break e;for(;Rr.sibling===null;){if(Rr.return===null||Rr.return===W)break e;Rr=Rr.return}Rr.sibling.return=Rr.return,Rr=Rr.sibling}W.stateNode=Pt;e:switch(iv(Pt,ut,Re),ut){case"button":case"input":case"select":case"textarea":Re=!!Re.autoFocus;break e;case"img":Re=!0;break e;default:Re=!1}Re&&f0(W)}}return Zf(W),Z2(W,W.type,O===null?null:O.memoizedProps,W.pendingProps,de),null;case 6:if(O&&W.stateNode!=null)O.memoizedProps!==Re&&f0(W);else{if(typeof Re!="string"&&W.stateNode===null)throw Error(wt(166));if(O=Qi.current,oy(W)){if(O=W.stateNode,de=W.memoizedProps,Re=null,ut=Dv,ut!==null)switch(ut.tag){case 27:case 5:Re=ut.memoizedProps}O[Al]=W,O=!!(O.nodeValue===de||Re!==null&&Re.suppressHydrationWarning===!0||wb(O.nodeValue,de)),O||fm(W,!0)}else O=Dd(O).createTextNode(Re),O[Al]=W,W.stateNode=O}return Zf(W),null;case 31:if(de=W.memoizedState,O===null||O.memoizedState!==null){if(Re=oy(W),de!==null){if(O===null){if(!Re)throw Error(wt(318));if(O=W.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(wt(557));O[Al]=W}else z0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;Zf(W),O=!1}else de=o2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=de),O=!0;if(!O)return W.flags&256?(ap(W),W):(ap(W),null);if((W.flags&128)!==0)throw Error(wt(558))}return Zf(W),null;case 13:if(Re=W.memoizedState,O===null||O.memoizedState!==null&&O.memoizedState.dehydrated!==null){if(ut=oy(W),Re!==null&&Re.dehydrated!==null){if(O===null){if(!ut)throw Error(wt(318));if(ut=W.memoizedState,ut=ut!==null?ut.dehydrated:null,!ut)throw Error(wt(317));ut[Al]=W}else z0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;Zf(W),ut=!1}else ut=o2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=ut),ut=!0;if(!ut)return W.flags&256?(ap(W),W):(ap(W),null)}return ap(W),(W.flags&128)!==0?(W.lanes=de,W):(de=Re!==null,O=O!==null&&O.memoizedState!==null,de&&(Re=W.child,ut=null,Re.alternate!==null&&Re.alternate.memoizedState!==null&&Re.alternate.memoizedState.cachePool!==null&&(ut=Re.alternate.memoizedState.cachePool.pool),Pt=null,Re.memoizedState!==null&&Re.memoizedState.cachePool!==null&&(Pt=Re.memoizedState.cachePool.pool),Pt!==ut&&(Re.flags|=2048)),de!==O&&de&&(W.child.flags|=8192),ub(W,W.updateQueue),Zf(W),null);case 4:return cc(),O===null&&Dy(W.stateNode.containerInfo),Zf(W),null;case 10:return jp(W.type),Zf(W),null;case 19:if(ro(ic),Re=W.memoizedState,Re===null)return Zf(W),null;if(ut=(W.flags&128)!==0,Pt=Re.rendering,Pt===null)if(ut)$1(Re,!1);else{if(kh!==0||O!==null&&(O.flags&128)!==0)for(O=W.child;O!==null;){if(Pt=hy(O),Pt!==null){for(W.flags|=128,$1(Re,!1),O=Pt.updateQueue,W.updateQueue=O,ub(W,O),W.subtreeFlags=0,O=de,de=W.child;de!==null;)l5(de,O),de=de.sibling;return $n(ic,ic.current&1|2),Nu&&Mh(W,Re.treeForkCount),W.child}O=O.sibling}Re.tail!==null&&md()>hb&&(W.flags|=128,ut=!0,$1(Re,!1),W.lanes=4194304)}else{if(!ut)if(O=hy(Pt),O!==null){if(W.flags|=128,ut=!0,O=O.updateQueue,W.updateQueue=O,ub(W,O),$1(Re,!0),Re.tail===null&&Re.tailMode==="hidden"&&!Pt.alternate&&!Nu)return Zf(W),null}else 2*md()-Re.renderingStartTime>hb&&de!==536870912&&(W.flags|=128,ut=!0,$1(Re,!1),W.lanes=4194304);Re.isBackwards?(Pt.sibling=W.child,W.child=Pt):(O=Re.last,O!==null?O.sibling=Pt:W.child=Pt,Re.last=Pt)}return Re.tail!==null?(O=Re.tail,Re.rendering=O,Re.tail=O.sibling,Re.renderingStartTime=md(),O.sibling=null,de=ic.current,$n(ic,ut?de&1|2:de&1),Nu&&Mh(W,Re.treeForkCount),O):(Zf(W),null);case 22:case 23:return ap(W),ym(),Re=W.memoizedState!==null,O!==null?O.memoizedState!==null!==Re&&(W.flags|=8192):Re&&(W.flags|=8192),Re?(de&536870912)!==0&&(W.flags&128)===0&&(Zf(W),W.subtreeFlags&6&&(W.flags|=8192)):Zf(W),de=W.updateQueue,de!==null&&ub(W,de.retryQueue),de=null,O!==null&&O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(de=O.memoizedState.cachePool.pool),Re=null,W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(Re=W.memoizedState.cachePool.pool),Re!==de&&(W.flags|=2048),O!==null&&ro(vm),null;case 24:return de=null,O!==null&&(de=O.memoizedState.cache),W.memoizedState.cache!==de&&(W.flags|=2048),jp(tv),Zf(W),null;case 25:return null;case 30:return null}throw Error(wt(156,W.tag))}function BM(O,W){switch(sg(W),W.tag){case 1:return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 3:return jp(tv),cc(),O=W.flags,(O&65536)!==0&&(O&128)===0?(W.flags=O&-65537|128,W):null;case 26:case 27:case 5:return ru(W),null;case 31:if(W.memoizedState!==null){if(ap(W),W.alternate===null)throw Error(wt(340));z0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 13:if(ap(W),O=W.memoizedState,O!==null&&O.dehydrated!==null){if(W.alternate===null)throw Error(wt(340));z0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 19:return ro(ic),null;case 4:return cc(),null;case 10:return jp(W.type),null;case 22:case 23:return ap(W),ym(),O!==null&&ro(vm),O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 24:return jp(tv),null;case 25:return null;default:return null}}function $5(O,W){switch(sg(W),W.tag){case 3:jp(tv),cc();break;case 26:case 27:case 5:ru(W);break;case 4:cc();break;case 31:W.memoizedState!==null&&ap(W);break;case 13:ap(W);break;case 19:ro(ic);break;case 10:jp(W.type);break;case 22:case 23:ap(W),ym(),O!==null&&ro(vm);break;case 24:jp(tv)}}function J1(O,W){try{var de=W.updateQueue,Re=de!==null?de.lastEffect:null;if(Re!==null){var ut=Re.next;de=ut;do{if((de.tag&O)===O){Re=void 0;var Pt=de.create,Rr=de.inst;Re=Pt(),Rr.destroy=Re}de=de.next}while(de!==ut)}}catch(xn){of(W,W.return,xn)}}function gp(O,W,de){try{var Re=W.updateQueue,ut=Re!==null?Re.lastEffect:null;if(ut!==null){var Pt=ut.next;Re=Pt;do{if((Re.tag&O)===O){var Rr=Re.inst,xn=Rr.destroy;if(xn!==void 0){Rr.destroy=void 0,ut=W;var Sa=de,wi=xn;try{wi()}catch(eo){of(ut,Sa,eo)}}}Re=Re.next}while(Re!==Pt)}}catch(eo){of(W,W.return,eo)}}function W2(O){var W=O.updateQueue;if(W!==null){var de=O.stateNode;try{y2(W,de)}catch(Re){of(O,O.return,Re)}}}function J5(O,W,de){de.props=gg(O.type,O.memoizedProps),de.state=O.memoizedState;try{de.componentWillUnmount()}catch(Re){of(O,W,Re)}}function yp(O,W){try{var de=O.ref;if(de!==null){switch(O.tag){case 26:case 27:case 5:var Re=O.stateNode;break;case 30:Re=O.stateNode;break;default:Re=O.stateNode}typeof de=="function"?O.refCleanup=de(Re):de.current=Re}}catch(ut){of(O,W,ut)}}function Vp(O,W){var de=O.ref,Re=O.refCleanup;if(de!==null)if(typeof Re=="function")try{Re()}catch(ut){of(O,W,ut)}finally{O.refCleanup=null,O=O.alternate,O!=null&&(O.refCleanup=null)}else if(typeof de=="function")try{de(null)}catch(ut){of(O,W,ut)}else de.current=null}function Q5(O){var W=O.type,de=O.memoizedProps,Re=O.stateNode;try{e:switch(W){case"button":case"input":case"select":case"textarea":de.autoFocus&&Re.focus();break e;case"img":de.src?Re.src=de.src:de.srcSet&&(Re.srcset=de.srcSet)}}catch(ut){of(O,O.return,ut)}}function K2(O,W,de){try{var Re=O.stateNode;d3(Re,O.type,de,W),Re[td]=W}catch(ut){of(O,O.return,ut)}}function yg(O){return O.tag===5||O.tag===3||O.tag===26||O.tag===27&&g0(O.type)||O.tag===4}function Q1(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||yg(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.tag===27&&g0(O.type)||O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function _y(O,W,de){var Re=O.tag;if(Re===5||Re===6)O=O.stateNode,W?(de.nodeType===9?de.body:de.nodeName==="HTML"?de.ownerDocument.body:de).insertBefore(O,W):(W=de.nodeType===9?de.body:de.nodeName==="HTML"?de.ownerDocument.body:de,W.appendChild(O),de=de._reactRootContainer,de!=null||W.onclick!==null||(W.onclick=fc));else if(Re!==4&&(Re===27&&g0(O.type)&&(de=O.stateNode,W=null),O=O.child,O!==null))for(_y(O,W,de),O=O.sibling;O!==null;)_y(O,W,de),O=O.sibling}function e_(O,W,de){var Re=O.tag;if(Re===5||Re===6)O=O.stateNode,W?de.insertBefore(O,W):de.appendChild(O);else if(Re!==4&&(Re===27&&g0(O.type)&&(de=O.stateNode),O=O.child,O!==null))for(e_(O,W,de),O=O.sibling;O!==null;)e_(O,W,de),O=O.sibling}function eA(O){var W=O.stateNode,de=O.memoizedProps;try{for(var Re=O.type,ut=W.attributes;ut.length;)W.removeAttributeNode(ut[0]);iv(W,Re,de),W[Al]=O,W[td]=de}catch(Pt){of(O,O.return,Pt)}}var j0=!1,nv=!1,$2=!1,J2=typeof WeakSet=="function"?WeakSet:Set,Eh=null;function NM(O,W){if(O=O.containerInfo,Z0=M_,O=a5(O),ey(O)){if("selectionStart"in O)var de={start:O.selectionStart,end:O.selectionEnd};else e:{de=(de=O.ownerDocument)&&de.defaultView||window;var Re=de.getSelection&&de.getSelection();if(Re&&Re.rangeCount!==0){de=Re.anchorNode;var ut=Re.anchorOffset,Pt=Re.focusNode;Re=Re.focusOffset;try{de.nodeType,Pt.nodeType}catch{de=null;break e}var Rr=0,xn=-1,Sa=-1,wi=0,eo=0,so=O,Ci=null;t:for(;;){for(var Ni;so!==de||ut!==0&&so.nodeType!==3||(xn=Rr+ut),so!==Pt||Re!==0&&so.nodeType!==3||(Sa=Rr+Re),so.nodeType===3&&(Rr+=so.nodeValue.length),(Ni=so.firstChild)!==null;)Ci=so,so=Ni;for(;;){if(so===O)break t;if(Ci===de&&++wi===ut&&(xn=Rr),Ci===Pt&&++eo===Re&&(Sa=Rr),(Ni=so.nextSibling)!==null)break;so=Ci,Ci=so.parentNode}so=Ni}de=xn===-1||Sa===-1?null:{start:xn,end:Sa}}else de=null}de=de||{start:0,end:0}}else de=null;for(Lm={focusedElem:O,selectionRange:de},M_=!1,Eh=W;Eh!==null;)if(W=Eh,O=W.child,(W.subtreeFlags&1028)!==0&&O!==null)O.return=W,Eh=O;else for(;Eh!==null;){switch(W=Eh,Pt=W.alternate,O=W.flags,W.tag){case 0:if((O&4)!==0&&(O=W.updateQueue,O=O!==null?O.events:null,O!==null))for(de=0;de title"))),iv(Pt,Re,de),Pt[Al]=O,Pv(Pt),Re=Pt;break e;case"link":var Rr=OA("link","href",ut).get(Re+(de.href||""));if(Rr){for(var xn=0;xn_f&&(Rr=_f,_f=Bl,Bl=Rr);var oi=r5(xn,Bl),Ga=r5(xn,_f);if(oi&&Ga&&(Ni.rangeCount!==1||Ni.anchorNode!==oi.node||Ni.anchorOffset!==oi.offset||Ni.focusNode!==Ga.node||Ni.focusOffset!==Ga.offset)){var gi=so.createRange();gi.setStart(oi.node,oi.offset),Ni.removeAllRanges(),Bl>_f?(Ni.addRange(gi),Ni.extend(Ga.node,Ga.offset)):(gi.setEnd(Ga.node,Ga.offset),Ni.addRange(gi))}}}}for(so=[],Ni=xn;Ni=Ni.parentNode;)Ni.nodeType===1&&so.push({element:Ni,left:Ni.scrollLeft,top:Ni.scrollTop});for(typeof xn.focus=="function"&&xn.focus(),xn=0;xnde?32:de,Si.T=null,de=a3,a3=null;var Pt=Mm,Rr=X0;if(av=0,bg=Mm=null,X0=0,(Mc&6)!==0)throw Error(wt(331));var xn=Mc;if(Mc|=4,wy(Pt.current),sA(Pt,Pt.current,Rr,de),Mc=xn,o_(0,!1),cv&&typeof cv.onPostCommitFiberRoot=="function")try{cv.onPostCommitFiberRoot(gd,Pt)}catch{}return!0}finally{wo.p=ut,Si.T=Re,AA(O,W)}}function MA(O,W,de){W=Sh(de,W),W=N0(O.stateNode,W,2),O=gm(O,W,2),O!==null&&(y1(O,2),p0(O))}function of(O,W,de){if(O.tag===3)MA(O,O,de);else for(;W!==null;){if(W.tag===3){MA(W,O,de);break}else if(W.tag===1){var Re=W.stateNode;if(typeof W.type.getDerivedStateFromError=="function"||typeof Re.componentDidCatch=="function"&&(xp===null||!xp.has(Re))){O=Sh(de,O),de=N5(2),Re=gm(W,de,2),Re!==null&&(U5(de,Re,W,O),y1(Re,2),p0(Re));break}}W=W.return}}function s3(O,W,de){var Re=O.pingCache;if(Re===null){Re=O.pingCache=new cA;var ut=new Set;Re.set(W,ut)}else ut=Re.get(W),ut===void 0&&(ut=new Set,Re.set(W,ut));ut.has(de)||(Am=!0,ut.add(de),O=XM.bind(null,O,W,de),W.then(O,O))}function XM(O,W,de){var Re=O.pingCache;Re!==null&&Re.delete(W),O.pingedLanes|=O.suspendedLanes&de,O.warmLanes&=~de,Pf===O&&(ec&de)===de&&(kh===4||kh===3&&(ec&62914560)===ec&&300>md()-n_?(Mc&2)===0&&Sy(O,0):n3|=de,Sm===ec&&(Sm=0)),p0(O)}function EA(O,W){W===0&&(W=RT()),O=Op(O,W),O!==null&&(y1(O,W),p0(O))}function Ey(O){var W=O.memoizedState,de=0;W!==null&&(de=W.retryLane),EA(O,de)}function ky(O,W){var de=0;switch(O.tag){case 31:case 13:var Re=O.stateNode,ut=O.memoizedState;ut!==null&&(de=ut.retryLane);break;case 19:Re=O.stateNode;break;case 22:Re=O.stateNode._retryCache;break;default:throw Error(wt(314))}Re!==null&&Re.delete(W),EA(O,de)}function l3(O,W){return fp(O,W)}var _b=null,d0=null,u3=!1,Cy=!1,c3=!1,km=0;function p0(O){O!==d0&&O.next===null&&(d0===null?_b=d0=O:d0=d0.next=O),Cy=!0,u3||(u3=!0,ZM())}function o_(O,W){if(!c3&&Cy){c3=!0;do for(var de=!1,Re=_b;Re!==null;){if(O!==0){var ut=Re.pendingLanes;if(ut===0)var Pt=0;else{var Rr=Re.suspendedLanes,xn=Re.pingedLanes;Pt=(1<<31-kf(42|O)+1)-1,Pt&=ut&~(Rr&~xn),Pt=Pt&201326741?Pt&201326741|1:Pt?Pt|2:0}Pt!==0&&(de=!0,kA(Re,Pt))}else Pt=ec,Pt=nx(Re,Re===Pf?Pt:0,Re.cancelPendingCommit!==null||Re.timeoutHandle!==-1),(Pt&3)===0||g1(Re,Pt)||(de=!0,kA(Re,Pt));Re=Re.next}while(de);c3=!1}}function YM(){f3()}function f3(){Cy=u3=!1;var O=0;km!==0&&RA()&&(O=km);for(var W=md(),de=null,Re=_b;Re!==null;){var ut=Re.next,Pt=s_(Re,W);Pt===0?(Re.next=null,de===null?_b=ut:de.next=ut,ut===null&&(d0=de)):(de=Re,(O!==0||(Pt&3)!==0)&&(Cy=!0)),Re=ut}av!==0&&av!==5||o_(O),km!==0&&(km=0)}function s_(O,W){for(var de=O.suspendedLanes,Re=O.pingedLanes,ut=O.expirationTimes,Pt=O.pendingLanes&-62914561;0xn)break;var eo=Sa.transferSize,so=Sa.initiatorType;eo&&Y0(so)&&(Sa=Sa.responseEnd,Rr+=eo*(Sa"u"?null:document;function Lb(O,W,de){var Re=Oy;if(Re&&typeof W=="string"&&W){var ut=vp(W);ut='link[rel="'+O+'"][href="'+ut+'"]',typeof de=="string"&&(ut+='[crossorigin="'+de+'"]'),Cb.has(ut)||(Cb.add(ut),O={rel:O,crossOrigin:de,href:W},Re.querySelector(ut)===null&&(W=Re.createElement("link"),iv(W,"link",O),Pv(W),Re.head.appendChild(W)))}}function Mg(O){Yp.D(O),Lb("dns-prefetch",O,null)}function A3(O,W){Yp.C(O,W),Lb("preconnect",O,W)}function Pb(O,W,de){Yp.L(O,W,de);var Re=Oy;if(Re&&O&&W){var ut='link[rel="preload"][as="'+vp(W)+'"]';W==="image"&&de&&de.imageSrcSet?(ut+='[imagesrcset="'+vp(de.imageSrcSet)+'"]',typeof de.imageSizes=="string"&&(ut+='[imagesizes="'+vp(de.imageSizes)+'"]')):ut+='[href="'+vp(O)+'"]';var Pt=ut;switch(W){case"style":Pt=Pm(O);break;case"script":Pt=kg(O)}Od.has(Pt)||(O=zn({rel:"preload",href:W==="image"&&de&&de.imageSrcSet?void 0:O,as:W},de),Od.set(Pt,O),Re.querySelector(ut)!==null||W==="style"&&Re.querySelector(y_(Pt))||W==="script"&&Re.querySelector(Cg(Pt))||(W=Re.createElement("link"),iv(W,"link",O),Pv(W),Re.head.appendChild(W)))}}function Rb(O,W){Yp.m(O,W);var de=Oy;if(de&&O){var Re=W&&typeof W.as=="string"?W.as:"script",ut='link[rel="modulepreload"][as="'+vp(Re)+'"][href="'+vp(O)+'"]',Pt=ut;switch(Re){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":Pt=kg(O)}if(!Od.has(Pt)&&(O=zn({rel:"modulepreload",href:O},W),Od.set(Pt,O),de.querySelector(ut)===null)){switch(Re){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(de.querySelector(Cg(Pt)))return}Re=de.createElement("link"),iv(Re,"link",O),Pv(Re),de.head.appendChild(Re)}}}function g_(O,W,de){Yp.S(O,W,de);var Re=Oy;if(Re&&O){var ut=$g(Re).hoistableStyles,Pt=Pm(O);W=W||"default";var Rr=ut.get(Pt);if(!Rr){var xn={loading:0,preload:null};if(Rr=Re.querySelector(y_(Pt)))xn.loading=5;else{O=zn({rel:"stylesheet",href:O,"data-precedence":W},de),(de=Od.get(Pt))&&Lg(O,de);var Sa=Rr=Re.createElement("link");Pv(Sa),iv(Sa,"link",O),Sa._p=new Promise(function(wi,eo){Sa.onload=wi,Sa.onerror=eo}),Sa.addEventListener("load",function(){xn.loading|=1}),Sa.addEventListener("error",function(){xn.loading|=2}),xn.loading|=4,__(Rr,W,Re)}Rr={type:"stylesheet",instance:Rr,count:1,state:xn},ut.set(Pt,Rr)}}}function Fy(O,W){Yp.X(O,W);var de=Oy;if(de&&O){var Re=$g(de).hoistableScripts,ut=kg(O),Pt=Re.get(ut);Pt||(Pt=de.querySelector(Cg(ut)),Pt||(O=zn({src:O,async:!0},W),(W=Od.get(ut))&&Db(O,W),Pt=de.createElement("script"),Pv(Pt),iv(Pt,"link",O),de.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Re.set(ut,Pt))}}function S3(O,W){Yp.M(O,W);var de=Oy;if(de&&O){var Re=$g(de).hoistableScripts,ut=kg(O),Pt=Re.get(ut);Pt||(Pt=de.querySelector(Cg(ut)),Pt||(O=zn({src:O,async:!0,type:"module"},W),(W=Od.get(ut))&&Db(O,W),Pt=de.createElement("script"),Pv(Pt),iv(Pt,"link",O),de.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Re.set(ut,Pt))}}function Ib(O,W,de,Re){var ut=(ut=Qi.current)?_0(ut):null;if(!ut)throw Error(wt(446));switch(O){case"meta":case"title":return null;case"style":return typeof de.precedence=="string"&&typeof de.href=="string"?(W=Pm(de.href),de=$g(ut).hoistableStyles,Re=de.get(W),Re||(Re={type:"style",instance:null,count:0,state:null},de.set(W,Re)),Re):{type:"void",instance:null,count:0,state:null};case"link":if(de.rel==="stylesheet"&&typeof de.href=="string"&&typeof de.precedence=="string"){O=Pm(de.href);var Pt=$g(ut).hoistableStyles,Rr=Pt.get(O);if(Rr||(ut=ut.ownerDocument||ut,Rr={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},Pt.set(O,Rr),(Pt=ut.querySelector(y_(O)))&&!Pt._p&&(Rr.instance=Pt,Rr.state.loading=5),Od.has(O)||(de={rel:"preload",as:"style",href:de.href,crossOrigin:de.crossOrigin,integrity:de.integrity,media:de.media,hrefLang:de.hrefLang,referrerPolicy:de.referrerPolicy},Od.set(O,de),Pt||zA(ut,O,de,Rr.state))),W&&Re===null)throw Error(wt(528,""));return Rr}if(W&&Re!==null)throw Error(wt(529,""));return null;case"script":return W=de.async,de=de.src,typeof de=="string"&&W&&typeof W!="function"&&typeof W!="symbol"?(W=kg(de),de=$g(ut).hoistableScripts,Re=de.get(W),Re||(Re={type:"script",instance:null,count:0,state:null},de.set(W,Re)),Re):{type:"void",instance:null,count:0,state:null};default:throw Error(wt(444,O))}}function Pm(O){return'href="'+vp(O)+'"'}function y_(O){return'link[rel="stylesheet"]['+O+"]"}function Eg(O){return zn({},O,{"data-precedence":O.precedence,precedence:null})}function zA(O,W,de,Re){O.querySelector('link[rel="preload"][as="style"]['+W+"]")?Re.loading=1:(W=O.createElement("link"),Re.preload=W,W.addEventListener("load",function(){return Re.loading|=1}),W.addEventListener("error",function(){return Re.loading|=2}),iv(W,"link",de),Pv(W),O.head.appendChild(W))}function kg(O){return'[src="'+vp(O)+'"]'}function Cg(O){return"script[async]"+O}function M3(O,W,de){if(W.count++,W.instance===null)switch(W.type){case"style":var Re=O.querySelector('style[data-href~="'+vp(de.href)+'"]');if(Re)return W.instance=Re,Pv(Re),Re;var ut=zn({},de,{"data-href":de.href,"data-precedence":de.precedence,href:null,precedence:null});return Re=(O.ownerDocument||O).createElement("style"),Pv(Re),iv(Re,"style",ut),__(Re,de.precedence,O),W.instance=Re;case"stylesheet":ut=Pm(de.href);var Pt=O.querySelector(y_(ut));if(Pt)return W.state.loading|=4,W.instance=Pt,Pv(Pt),Pt;Re=Eg(de),(ut=Od.get(ut))&&Lg(Re,ut),Pt=(O.ownerDocument||O).createElement("link"),Pv(Pt);var Rr=Pt;return Rr._p=new Promise(function(xn,Sa){Rr.onload=xn,Rr.onerror=Sa}),iv(Pt,"link",Re),W.state.loading|=4,__(Pt,de.precedence,O),W.instance=Pt;case"script":return Pt=kg(de.src),(ut=O.querySelector(Cg(Pt)))?(W.instance=ut,Pv(ut),ut):(Re=de,(ut=Od.get(Pt))&&(Re=zn({},de),Db(Re,ut)),O=O.ownerDocument||O,ut=O.createElement("script"),Pv(ut),iv(ut,"link",Re),O.head.appendChild(ut),W.instance=ut);case"void":return null;default:throw Error(wt(443,W.type))}else W.type==="stylesheet"&&(W.state.loading&4)===0&&(Re=W.instance,W.state.loading|=4,__(Re,de.precedence,O));return W.instance}function __(O,W,de){for(var Re=de.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),ut=Re.length?Re[Re.length-1]:null,Pt=ut,Rr=0;Rr title"):null)}function JM(O,W,de){if(de===1||W.itemProp!=null)return!1;switch(O){case"meta":case"title":return!0;case"style":if(typeof W.precedence!="string"||typeof W.href!="string"||W.href==="")break;return!0;case"link":if(typeof W.rel!="string"||typeof W.href!="string"||W.href===""||W.onLoad||W.onError)break;return W.rel==="stylesheet"?(O=W.disabled,typeof W.precedence=="string"&&O==null):!0;case"script":if(W.async&&typeof W.async!="function"&&typeof W.async!="symbol"&&!W.onLoad&&!W.onError&&W.src&&typeof W.src=="string")return!0}return!1}function yv(O){return!(O.type==="stylesheet"&&(O.state.loading&3)===0)}function By(O,W,de,Re){if(de.type==="stylesheet"&&(typeof Re.media!="string"||matchMedia(Re.media).matches!==!1)&&(de.state.loading&4)===0){if(de.instance===null){var ut=Pm(Re.href),Pt=W.querySelector(y_(ut));if(Pt){W=Pt._p,W!==null&&typeof W=="object"&&typeof W.then=="function"&&(O.count++,O=w_.bind(O),W.then(O,O)),de.state.loading|=4,de.instance=Pt,Pv(Pt);return}Pt=W.ownerDocument||W,Re=Eg(Re),(ut=Od.get(ut))&&Lg(Re,ut),Pt=Pt.createElement("link"),Pv(Pt);var Rr=Pt;Rr._p=new Promise(function(xn,Sa){Rr.onload=xn,Rr.onerror=Sa}),iv(Pt,"link",Re),de.instance=Pt}O.stylesheets===null&&(O.stylesheets=new Map),O.stylesheets.set(de,W),(W=de.state.preload)&&(de.state.loading&3)===0&&(O.count++,de=w_.bind(O),W.addEventListener("load",de),W.addEventListener("error",de))}}var zb=0;function Ob(O,W){return O.stylesheets&&O.count===0&&A_(O,O.stylesheets),0zb?50:800)+W);return O.unsuspend=de,function(){O.unsuspend=null,clearTimeout(Re),clearTimeout(ut)}}:null}function w_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)A_(this,this.stylesheets);else if(this.unsuspend){var O=this.unsuspend;this.unsuspend=null,O()}}}var T_=null;function A_(O,W){O.stylesheets=null,O.unsuspend!==null&&(O.count++,T_=new Map,W.forEach(E3,O),T_=null,w_.call(O))}function E3(O,W){if(!(W.state.loading&4)){var de=T_.get(O);if(de)var Re=de.get(null);else{de=new Map,T_.set(O,de);for(var ut=O.querySelectorAll("link[data-precedence],style[data-precedence]"),Pt=0;Pt"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ie)}catch(ht){console.error(ht)}}return Ie(),k6.exports=wO(),k6.exports}var AO=TO(),R6={},I6={},D6={exports:{}},z6,u8;function SO(){if(u8)return z6;u8=1;var Ie="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return z6=Ie,z6}var O6,c8;function MO(){if(c8)return O6;c8=1;var Ie=SO();function ht(){}function St(){}return St.resetWarningCache=ht,O6=function(){function wt(Cr,nn,bn,Jr,Tn,zn){if(zn!==Ie){var _a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _a.name="Invariant Violation",_a}}wt.isRequired=wt;function lr(){return wt}var vr={array:wt,bigint:wt,bool:wt,func:wt,number:wt,object:wt,string:wt,symbol:wt,any:wt,arrayOf:lr,element:wt,elementType:wt,instanceOf:lr,node:wt,objectOf:lr,oneOf:lr,oneOfType:lr,shape:lr,exact:lr,checkPropTypes:St,resetWarningCache:ht};return vr.PropTypes=vr,vr},O6}var f8;function EO(){return f8||(f8=1,D6.exports=MO()()),D6.exports}var h8;function kO(){return h8||(h8=1,(function(Ie){function ht(Mo){"@babel/helpers - typeof";return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(yi){return typeof yi}:function(yi){return yi&&typeof Symbol=="function"&&yi.constructor===Symbol&&yi!==Symbol.prototype?"symbol":typeof yi},ht(Mo)}Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=Tl;var St=Cr(nM()),wt=lr(EO());function lr(Mo){return Mo&&Mo.__esModule?Mo:{default:Mo}}function vr(Mo){if(typeof WeakMap!="function")return null;var yi=new WeakMap,Fi=new WeakMap;return(vr=function(Mi){return Mi?Fi:yi})(Mo)}function Cr(Mo,yi){if(Mo&&Mo.__esModule)return Mo;if(Mo===null||ht(Mo)!=="object"&&typeof Mo!="function")return{default:Mo};var Fi=vr(yi);if(Fi&&Fi.has(Mo))return Fi.get(Mo);var Ts={},Mi=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var rl in Mo)if(rl!=="default"&&Object.prototype.hasOwnProperty.call(Mo,rl)){var ji=Mi?Object.getOwnPropertyDescriptor(Mo,rl):null;ji&&(ji.get||ji.set)?Object.defineProperty(Ts,rl,ji):Ts[rl]=Mo[rl]}return Ts.default=Mo,Fi&&Fi.set(Mo,Ts),Ts}function nn(Mo,yi){if(!(Mo instanceof yi))throw new TypeError("Cannot call a class as a function")}function bn(Mo,yi){for(var Fi=0;Fi"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 Io(Mo){return Io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Fi){return Fi.__proto__||Object.getPrototypeOf(Fi)},Io(Mo)}var bi=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],Ge=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],ko=typeof window<"u";function Tl(Mo){var yi=(function(Fi){Tn(Mi,Fi);var Ts=_a(Mi);function Mi(rl){var ji;return nn(this,Mi),ji=Ts.call(this,rl),ji.p=Promise.resolve(),ji.resizeHandler=null,ji.handlers={},ji.syncWindowResize=ji.syncWindowResize.bind(fo(ji)),ji.syncEventHandlers=ji.syncEventHandlers.bind(fo(ji)),ji.attachUpdateEvents=ji.attachUpdateEvents.bind(fo(ji)),ji.getRef=ji.getRef.bind(fo(ji)),ji.handleUpdate=ji.handleUpdate.bind(fo(ji)),ji.figureCallback=ji.figureCallback.bind(fo(ji)),ji.updatePlotly=ji.updatePlotly.bind(fo(ji)),ji}return Jr(Mi,[{key:"updatePlotly",value:function(ji,Bo,tu){var Pi=this;this.p=this.p.then(function(){if(!Pi.unmounting){if(!Pi.el)throw new Error("Missing element reference");return Mo.react(Pi.el,{data:Pi.props.data,layout:Pi.props.layout,config:Pi.props.config,frames:Pi.props.frames})}}).then(function(){Pi.unmounting||(Pi.syncWindowResize(ji),Pi.syncEventHandlers(),Pi.figureCallback(Bo),tu&&Pi.attachUpdateEvents())}).catch(function(zi){Pi.props.onError&&Pi.props.onError(zi)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(ji){this.unmounting=!1;var Bo=ji.frames&&ji.frames.length?ji.frames.length:0,tu=this.props.frames&&this.props.frames.length?this.props.frames.length:0,Pi=!(ji.layout===this.props.layout&&ji.data===this.props.data&&ji.config===this.props.config&&tu===Bo),zi=ji.revision!==void 0,Si=ji.revision!==this.props.revision;!Pi&&(!zi||zi&&!Si)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&ko&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Mo.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var ji=this;!this.el||!this.el.removeListener||Ge.forEach(function(Bo){ji.el.on(Bo,ji.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var ji=this;!this.el||!this.el.removeListener||Ge.forEach(function(Bo){ji.el.removeListener(Bo,ji.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(ji){if(typeof ji=="function"){var Bo=this.el,tu=Bo.data,Pi=Bo.layout,zi=this.el._transitionData?this.el._transitionData._frames:null,Si={data:tu,layout:Pi,frames:zi};ji(Si,this.el)}}},{key:"syncWindowResize",value:function(ji){var Bo=this;ko&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Mo.Plots.resize(Bo.el)},window.addEventListener("resize",this.resizeHandler),ji&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(ji){this.el=ji,this.props.debug&&ko&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var ji=this;bi.forEach(function(Bo){var tu=ji.props["on"+Bo],Pi=ji.handlers[Bo],zi=!!Pi;tu&&!zi?ji.addEventHandler(Bo,tu):!tu&&zi?ji.removeEventHandler(Bo):tu&&zi&&tu!==Pi&&(ji.removeEventHandler(Bo),ji.addEventHandler(Bo,tu))})}},{key:"addEventHandler",value:function(ji,Bo){this.handlers[ji]=Bo,this.el.on(this.getPlotlyEventName(ji),this.handlers[ji])}},{key:"removeEventHandler",value:function(ji){this.el.removeListener(this.getPlotlyEventName(ji),this.handlers[ji]),delete this.handlers[ji]}},{key:"getPlotlyEventName",value:function(ji){return"plotly_"+ji.toLowerCase()}},{key:"render",value:function(){return St.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),Mi})(St.Component);return yi.propTypes={data:wt.default.arrayOf(wt.default.object),config:wt.default.object,layout:wt.default.object,frames:wt.default.arrayOf(wt.default.object),revision:wt.default.number,onInitialized:wt.default.func,onPurge:wt.default.func,onError:wt.default.func,onUpdate:wt.default.func,debug:wt.default.bool,style:wt.default.object,className:wt.default.string,useResizeHandler:wt.default.bool,divId:wt.default.string},bi.forEach(function(Fi){yi.propTypes["on"+Fi]=wt.default.func}),yi.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},yi}})(I6)),I6}var QS={exports:{}},CO=QS.exports,v8;function LO(){return v8||(v8=1,(function(Ie){var ht={};(function(St,wt){Ie.exports?Ie.exports=wt():St.moduleName=wt()})(typeof self<"u"?self:CO,()=>{var St=(()=>{var wt=Object.create,lr=Object.defineProperty,vr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptor,nn=Object.getOwnPropertyDescriptors,bn=Object.getOwnPropertyNames,Jr=Object.getOwnPropertySymbols,Tn=Object.getPrototypeOf,zn=Object.prototype.hasOwnProperty,_a=Object.prototype.propertyIsEnumerable,Qn=($,G,h)=>G in $?lr($,G,{enumerable:!0,configurable:!0,writable:!0,value:h}):$[G]=h,fo=($,G)=>{for(var h in G||(G={}))zn.call(G,h)&&Qn($,h,G[h]);if(Jr)for(var h of Jr(G))_a.call(G,h)&&Qn($,h,G[h]);return $},So=($,G)=>vr($,nn(G)),Io=($,G)=>{var h={};for(var b in $)zn.call($,b)&&G.indexOf(b)<0&&(h[b]=$[b]);if($!=null&&Jr)for(var b of Jr($))G.indexOf(b)<0&&_a.call($,b)&&(h[b]=$[b]);return h},bi=($,G)=>function(){return $&&(G=(0,$[bn($)[0]])($=0)),G},Ge=($,G)=>function(){return G||(0,$[bn($)[0]])((G={exports:{}}).exports,G),G.exports},ko=($,G)=>{for(var h in G)lr($,h,{get:G[h],enumerable:!0})},Tl=($,G,h,b)=>{if(G&&typeof G=="object"||typeof G=="function")for(let S of bn(G))!zn.call($,S)&&S!==h&&lr($,S,{get:()=>G[S],enumerable:!(b=Cr(G,S))||b.enumerable});return $},Mo=($,G,h)=>(h=$!=null?wt(Tn($)):{},Tl(lr(h,"default",{value:$,enumerable:!0}),$)),yi=$=>Tl(lr({},"__esModule",{value:!0}),$),Fi=Ge({"src/version.js"($){$.version="3.3.1"}}),Ts=Ge({"node_modules/native-promise-only/lib/npo.src.js"($,G){(function(b,S,E){S[b]=S[b]||E(),typeof G<"u"&&G.exports&&(G.exports=S[b])})("Promise",typeof window<"u"?window:$,function(){var b,S,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(g){return setImmediate(g)}:setTimeout;try{Object.defineProperty({},"x",{}),b=function(g,x,A,M){return Object.defineProperty(g,x,{value:A,writable:!0,configurable:M!==!1})}}catch{b=function(x,A,M){return x[A]=M,x}}E=(function(){var g,x,A;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,m){A=new M(w,m),x?x.next=A:g=A,x=A,A=void 0},drain:function(){var w=g;for(g=x=S=void 0;w;)w.fn.call(w.self),w=w.next}}})();function r(l,g){E.add(l,g),S||(S=t(E.drain))}function o(l){var g,x=typeof l;return l!=null&&(x=="object"||x=="function")&&(g=l.then),typeof g=="function"?g:!1}function n(){for(var l=0;l0&&r(n,x))}catch(A){s.call(new c(x),A)}}}function s(l){var g=this;g.triggered||(g.triggered=!0,g.def&&(g=g.def),g.msg=l,g.state=2,g.chain.length>0&&r(n,g))}function f(l,g,x,A){for(var M=0;MOe?1:ge>=Oe?0:NaN}h.descending=function(ge,Oe){return Oege?1:Oe>=ge?0:NaN},h.min=function(ge,Oe){var tt=-1,xt=ge.length,At,It;if(arguments.length===1){for(;++tt=It){At=It;break}for(;++ttIt&&(At=It)}else{for(;++tt=It){At=It;break}for(;++ttIt&&(At=It)}return At},h.max=function(ge,Oe){var tt=-1,xt=ge.length,At,It;if(arguments.length===1){for(;++tt=It){At=It;break}for(;++ttAt&&(At=It)}else{for(;++tt=It){At=It;break}for(;++ttAt&&(At=It)}return At},h.extent=function(ge,Oe){var tt=-1,xt=ge.length,At,It,Qt;if(arguments.length===1){for(;++tt=It){At=Qt=It;break}for(;++ttIt&&(At=It),Qt=It){At=Qt=It;break}for(;++ttIt&&(At=It),Qt1)return Qt/(yr-1)},h.deviation=function(){var ge=h.variance.apply(this,arguments);return ge&&Math.sqrt(ge)};function p(ge){return{left:function(Oe,tt,xt,At){for(arguments.length<3&&(xt=0),arguments.length<4&&(At=Oe.length);xt>>1;ge(Oe[It],tt)<0?xt=It+1:At=It}return xt},right:function(Oe,tt,xt,At){for(arguments.length<3&&(xt=0),arguments.length<4&&(At=Oe.length);xt>>1;ge(Oe[It],tt)>0?At=It:xt=It+1}return xt}}}var d=p(s);h.bisectLeft=d.left,h.bisect=h.bisectRight=d.right,h.bisector=function(ge){return p(ge.length===1?function(Oe,tt){return s(ge(Oe),tt)}:ge)},h.shuffle=function(ge,Oe,tt){(xt=arguments.length)<3&&(tt=ge.length,xt<2&&(Oe=0));for(var xt=tt-Oe,At,It;xt;)It=Math.random()*xt--|0,At=ge[xt+Oe],ge[xt+Oe]=ge[It+Oe],ge[It+Oe]=At;return ge},h.permute=function(ge,Oe){for(var tt=Oe.length,xt=new Array(tt);tt--;)xt[tt]=ge[Oe[tt]];return xt},h.pairs=function(ge){for(var Oe=0,tt=ge.length-1,xt=ge[0],At=new Array(tt<0?0:tt);Oe=0;)for(Qt=ge[Oe],tt=Qt.length;--tt>=0;)It[--At]=Qt[tt];return It};var l=Math.abs;h.range=function(ge,Oe,tt){if(arguments.length<3&&(tt=1,arguments.length<2&&(Oe=ge,ge=0)),(Oe-ge)/tt===1/0)throw new Error("infinite range");var xt=[],At=g(l(tt)),It=-1,Qt;if(ge*=At,Oe*=At,tt*=At,tt<0)for(;(Qt=ge+tt*++It)>Oe;)xt.push(Qt/At);else for(;(Qt=ge+tt*++It)=Oe.length)return At?At.call(ge,yr):xt?yr.sort(xt):yr;for(var Hr=-1,fn=yr.length,Sn=Oe[Xr++],kn,Ca,Dn,Jn=new A,oa;++Hr=Oe.length)return Jt;var Xr=[],Hr=tt[yr++];return Jt.forEach(function(fn,Sn){Xr.push({key:fn,values:Qt(Sn,yr)})}),Hr?Xr.sort(function(fn,Sn){return Hr(fn.key,Sn.key)}):Xr}return ge.map=function(Jt,yr){return It(yr,Jt,0)},ge.entries=function(Jt){return Qt(It(h.map,Jt,0),0)},ge.key=function(Jt){return Oe.push(Jt),ge},ge.sortKeys=function(Jt){return tt[Oe.length-1]=Jt,ge},ge.sortValues=function(Jt){return xt=Jt,ge},ge.rollup=function(Jt){return At=Jt,ge},ge},h.set=function(ge){var Oe=new z;if(ge)for(var tt=0,xt=ge.length;tt=0&&(xt=ge.slice(tt+1),ge=ge.slice(0,tt)),ge)return arguments.length<2?this[ge].on(xt):this[ge].on(xt,Oe);if(arguments.length===2){if(Oe==null)for(ge in this)this.hasOwnProperty(ge)&&this[ge].on(xt,null);return this}};function Z(ge){var Oe=[],tt=new A;function xt(){for(var At=Oe,It=-1,Qt=At.length,Jt;++It=0&&(tt=ge.slice(0,Oe))!=="xmlns"&&(ge=ge.slice(Oe+1)),ve.hasOwnProperty(tt)?{space:ve[tt],local:ge}:ge}},te.attr=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var tt=this.node();return ge=h.ns.qualify(ge),ge.local?tt.getAttributeNS(ge.space,ge.local):tt.getAttribute(ge)}for(Oe in ge)this.each(Ae(Oe,ge[Oe]));return this}return this.each(Ae(ge,Oe))};function Ae(ge,Oe){ge=h.ns.qualify(ge);function tt(){this.removeAttribute(ge)}function xt(){this.removeAttributeNS(ge.space,ge.local)}function At(){this.setAttribute(ge,Oe)}function It(){this.setAttributeNS(ge.space,ge.local,Oe)}function Qt(){var yr=Oe.apply(this,arguments);yr==null?this.removeAttribute(ge):this.setAttribute(ge,yr)}function Jt(){var yr=Oe.apply(this,arguments);yr==null?this.removeAttributeNS(ge.space,ge.local):this.setAttributeNS(ge.space,ge.local,yr)}return Oe==null?ge.local?xt:tt:typeof Oe=="function"?ge.local?Jt:Qt:ge.local?It:At}function Ce(ge){return ge.trim().replace(/\s+/g," ")}te.classed=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var tt=this.node(),xt=(ge=ze(ge)).length,At=-1;if(Oe=tt.classList){for(;++At=0;)(It=tt[xt])&&(At&&At!==It.nextSibling&&At.parentNode.insertBefore(It,At),At=It);return this},te.sort=function(ge){ge=Ne.apply(this,arguments);for(var Oe=-1,tt=this.length;++Oe=Oe&&(Oe=At+1);!(yr=Qt[Oe])&&++Oe0&&(ge=ge.slice(0,At));var Qt=$t.get(ge);Qt&&(ge=Qt,It=Mr);function Jt(){var Hr=this[xt];Hr&&(this.removeEventListener(ge,Hr,Hr.$),delete this[xt])}function yr(){var Hr=It(Oe,S(arguments));Jt.call(this),this.addEventListener(ge,this[xt]=Hr,Hr.$=tt),Hr._=Oe}function Xr(){var Hr=new RegExp("^__on([^.]+)"+h.requote(ge)+"$"),fn;for(var Sn in this)if(fn=Sn.match(Hr)){var kn=this[Sn];this.removeEventListener(fn[1],kn,kn.$),delete this[Sn]}}return At?Oe?yr:Jt:Oe?U:Xr}var $t=h.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&$t.forEach(function(ge){"on"+ge in E&&$t.remove(ge)});function rr(ge,Oe){return function(tt){var xt=h.event;h.event=tt,Oe[0]=this.__data__;try{ge.apply(this,Oe)}finally{h.event=xt}}}function Mr(ge,Oe){var tt=rr(ge,Oe);return function(xt){var At=this,It=xt.relatedTarget;(!It||It!==At&&!(It.compareDocumentPosition(At)&8))&&tt.call(At,xt)}}var Sr,Zr=0;function Ar(ge){var Oe=".dragsuppress-"+ ++Zr,tt="click"+Oe,xt=h.select(t(ge)).on("touchmove"+Oe,re).on("dragstart"+Oe,re).on("selectstart"+Oe,re);if(Sr==null&&(Sr="onselectstart"in ge?!1:B(ge.style,"userSelect")),Sr){var At=e(ge).style,It=At[Sr];At[Sr]="none"}return function(Qt){if(xt.on(Oe,null),Sr&&(At[Sr]=It),Qt){var Jt=function(){xt.on(tt,null)};xt.on(tt,function(){re(),Jt()},!0),setTimeout(Jt,0)}}}h.mouse=function(ge){return Mt(ge,fe())};var Br=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Mt(ge,Oe){Oe.changedTouches&&(Oe=Oe.changedTouches[0]);var tt=ge.ownerSVGElement||ge;if(tt.createSVGPoint){var xt=tt.createSVGPoint();if(Br<0){var At=t(ge);if(At.scrollX||At.scrollY){tt=h.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var It=tt[0][0].getScreenCTM();Br=!(It.f||It.e),tt.remove()}}return Br?(xt.x=Oe.pageX,xt.y=Oe.pageY):(xt.x=Oe.clientX,xt.y=Oe.clientY),xt=xt.matrixTransform(ge.getScreenCTM().inverse()),[xt.x,xt.y]}var Qt=ge.getBoundingClientRect();return[Oe.clientX-Qt.left-ge.clientLeft,Oe.clientY-Qt.top-ge.clientTop]}h.touch=function(ge,Oe,tt){if(arguments.length<3&&(tt=Oe,Oe=fe().changedTouches),Oe){for(var xt=0,At=Oe.length,It;xt1?Xe:ge<-1?-Xe:Math.asin(ge)}function Wt(ge){return((ge=Math.exp(ge))-1/ge)/2}function _r(ge){return((ge=Math.exp(ge))+1/ge)/2}function pr(ge){return((ge=Math.exp(2*ge))-1)/(ge+1)}var hr=Math.SQRT2,Fr=2,En=4;h.interpolateZoom=function(ge,Oe){var tt=ge[0],xt=ge[1],At=ge[2],It=Oe[0],Qt=Oe[1],Jt=Oe[2],yr=It-tt,Xr=Qt-xt,Hr=yr*yr+Xr*Xr,fn,Sn;if(Hr0&&(oo=oo.transition().duration(Qt)),oo.call(Pa.event)}function mo(){Jn&&Jn.domain(Dn.range().map(function(oo){return(oo-ge.x)/ge.k}).map(Dn.invert)),Aa&&Aa.domain(oa.range().map(function(oo){return(oo-ge.y)/ge.k}).map(oa.invert))}function To(oo){Jt++||oo({type:"zoomstart"})}function Zs(oo){mo(),oo({type:"zoom",scale:ge.k,translate:[ge.x,ge.y]})}function Co(oo){--Jt||(oo({type:"zoomend"}),tt=null)}function os(){var oo=this,Ps=Ca.of(oo,arguments),Js=0,Xl=h.select(t(oo)).on(Xr,Ml).on(Hr,Yl),Dl=ia(h.mouse(oo)),xc=Ar(oo);ba.call(oo),To(Ps);function Ml(){Js=1,Ri(h.mouse(oo),Dl),Zs(Ps)}function Yl(){Xl.on(Xr,null).on(Hr,null),xc(Js),Co(Ps)}}function tl(){var oo=this,Ps=Ca.of(oo,arguments),Js={},Xl=0,Dl,xc=".zoom-"+h.event.changedTouches[0].identifier,Ml="touchmove"+xc,Yl="touchend"+xc,Xc=[],Eu=h.select(oo),dt=Ar(oo);br(),To(Ps),Eu.on(yr,null).on(Sn,br);function gr(){var mn=h.touches(oo);return Dl=ge.k,mn.forEach(function(dn){dn.identifier in Js&&(Js[dn.identifier]=ia(dn))}),mn}function br(){var mn=h.event.target;h.select(mn).on(Ml,Cn).on(Yl,ua),Xc.push(mn);for(var dn=h.event.changedTouches,Da=0,Ra=dn.length;Da1){var Oi=Ia[0],pi=Ia[1],Ha=Oi[0]-pi[0],pa=Oi[1]-pi[1];Xl=Ha*Ha+pa*pa}}function Cn(){var mn=h.touches(oo),dn,Da,Ra,Ia;ba.call(oo);for(var Ya=0,Oi=mn.length;Ya1?1:Oe,tt=tt<0?0:tt>1?1:tt,At=tt<=.5?tt*(1+Oe):tt+Oe-tt*Oe,xt=2*tt-At;function It(Jt){return Jt>360?Jt-=360:Jt<0&&(Jt+=360),Jt<60?xt+(At-xt)*Jt/60:Jt<180?At:Jt<240?xt+(At-xt)*(240-Jt)/60:xt}function Qt(Jt){return Math.round(It(Jt)*255)}return new hi(Qt(ge+120),Qt(ge),Qt(ge-120))}h.hcl=ir;function ir(ge,Oe,tt){return this instanceof ir?(this.h=+ge,this.c=+Oe,void(this.l=+tt)):arguments.length<2?ge instanceof ir?new ir(ge.h,ge.c,ge.l):ge instanceof sr?fa(ge.l,ge.a,ge.b):fa((ge=Ir((ge=h.rgb(ge)).r,ge.g,ge.b)).l,ge.a,ge.b):new ir(ge,Oe,tt)}var qt=ir.prototype=new ra;qt.brighter=function(ge){return new ir(this.h,this.c,Math.min(100,this.l+Vr*(arguments.length?ge:1)))},qt.darker=function(ge){return new ir(this.h,this.c,Math.max(0,this.l-Vr*(arguments.length?ge:1)))},qt.rgb=function(){return ar(this.h,this.c,this.l).rgb()};function ar(ge,Oe,tt){return isNaN(ge)&&(ge=0),isNaN(Oe)&&(Oe=0),new sr(tt,Math.cos(ge*=Je)*Oe,Math.sin(ge)*Oe)}h.lab=sr;function sr(ge,Oe,tt){return this instanceof sr?(this.l=+ge,this.a=+Oe,void(this.b=+tt)):arguments.length<2?ge instanceof sr?new sr(ge.l,ge.a,ge.b):ge instanceof ir?ar(ge.h,ge.c,ge.l):Ir((ge=hi(ge)).r,ge.g,ge.b):new sr(ge,Oe,tt)}var Vr=18,on=.95047,pn=1,wn=1.08883,Kn=sr.prototype=new ra;Kn.brighter=function(ge){return new sr(Math.min(100,this.l+Vr*(arguments.length?ge:1)),this.a,this.b)},Kn.darker=function(ge){return new sr(Math.max(0,this.l-Vr*(arguments.length?ge:1)),this.a,this.b)},Kn.rgb=function(){return da(this.l,this.a,this.b)};function da(ge,Oe,tt){var xt=(ge+16)/116,At=xt+Oe/500,It=xt-tt/200;return At=ga(At)*on,xt=ga(xt)*pn,It=ga(It)*wn,new hi(Vn(3.2404542*At-1.5371385*xt-.4985314*It),Vn(-.969266*At+1.8760108*xt+.041556*It),Vn(.0556434*At-.2040259*xt+1.0572252*It))}function fa(ge,Oe,tt){return ge>0?new ir(Math.atan2(tt,Oe)*Lt,Math.sqrt(Oe*Oe+tt*tt),ge):new ir(NaN,NaN,ge)}function ga(ge){return ge>.206893034?ge*ge*ge:(ge-4/29)/7.787037}function ka(ge){return ge>.008856?Math.pow(ge,1/3):7.787037*ge+4/29}function Vn(ge){return Math.round(255*(ge<=.00304?12.92*ge:1.055*Math.pow(ge,1/2.4)-.055))}h.rgb=hi;function hi(ge,Oe,tt){return this instanceof hi?(this.r=~~ge,this.g=~~Oe,void(this.b=~~tt)):arguments.length<2?ge instanceof hi?new hi(ge.r,ge.g,ge.b):Nr(""+ge,hi,ja):new hi(ge,Oe,tt)}function Ti(ge){return new hi(ge>>16,ge>>8&255,ge&255)}function Dt(ge){return Ti(ge)+""}var yt=hi.prototype=new ra;yt.brighter=function(ge){ge=Math.pow(.7,arguments.length?ge:1);var Oe=this.r,tt=this.g,xt=this.b,At=30;return!Oe&&!tt&&!xt?new hi(At,At,At):(Oe&&Oe>4,xt=xt>>4|xt,At=yr&240,At=At>>4|At,It=yr&15,It=It<<4|It):ge.length===7&&(xt=(yr&16711680)>>16,At=(yr&65280)>>8,It=yr&255)),Oe(xt,At,It))}function jr(ge,Oe,tt){var xt=Math.min(ge/=255,Oe/=255,tt/=255),At=Math.max(ge,Oe,tt),It=At-xt,Qt,Jt,yr=(At+xt)/2;return It?(Jt=yr<.5?It/(At+xt):It/(2-At-xt),ge==At?Qt=(Oe-tt)/It+(Oe0&&yr<1?0:Qt),new Nn(Qt,Jt,yr)}function Ir(ge,Oe,tt){ge=Ur(ge),Oe=Ur(Oe),tt=Ur(tt);var xt=ka((.4124564*ge+.3575761*Oe+.1804375*tt)/on),At=ka((.2126729*ge+.7151522*Oe+.072175*tt)/pn),It=ka((.0193339*ge+.119192*Oe+.9503041*tt)/wn);return sr(116*At-16,500*(xt-At),200*(At-It))}function Ur(ge){return(ge/=255)<=.04045?ge/12.92:Math.pow((ge+.055)/1.055,2.4)}function sn(ge){var Oe=parseFloat(ge);return ge.charAt(ge.length-1)==="%"?Math.round(Oe*2.55):Oe}var Kr=h.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(ge,Oe){Kr.set(ge,Ti(Oe))});function Tt(ge){return typeof ge=="function"?ge:function(){return ge}}h.functor=Tt,h.xhr=or(F);function or(ge){return function(Oe,tt,xt){return arguments.length===2&&typeof tt=="function"&&(xt=tt,tt=null),Dr(Oe,tt,ge,xt)}}function Dr(ge,Oe,tt,xt){var At={},It=h.dispatch("beforesend","progress","load","error"),Qt={},Jt=new XMLHttpRequest,yr=null;self.XDomainRequest&&!("withCredentials"in Jt)&&/^(http(s)?:)?\/\//.test(ge)&&(Jt=new XDomainRequest),"onload"in Jt?Jt.onload=Jt.onerror=Xr:Jt.onreadystatechange=function(){Jt.readyState>3&&Xr()};function Xr(){var Hr=Jt.status,fn;if(!Hr&&Pn(Jt)||Hr>=200&&Hr<300||Hr===304){try{fn=tt.call(At,Jt)}catch(Sn){It.error.call(At,Sn);return}It.load.call(At,fn)}else It.error.call(At,Jt)}return Jt.onprogress=function(Hr){var fn=h.event;h.event=Hr;try{It.progress.call(At,Jt)}finally{h.event=fn}},At.header=function(Hr,fn){return Hr=(Hr+"").toLowerCase(),arguments.length<2?Qt[Hr]:(fn==null?delete Qt[Hr]:Qt[Hr]=fn+"",At)},At.mimeType=function(Hr){return arguments.length?(Oe=Hr==null?null:Hr+"",At):Oe},At.responseType=function(Hr){return arguments.length?(yr=Hr,At):yr},At.response=function(Hr){return tt=Hr,At},["get","post"].forEach(function(Hr){At[Hr]=function(){return At.send.apply(At,[Hr].concat(S(arguments)))}}),At.send=function(Hr,fn,Sn){if(arguments.length===2&&typeof fn=="function"&&(Sn=fn,fn=null),Jt.open(Hr,ge,!0),Oe!=null&&!("accept"in Qt)&&(Qt.accept=Oe+",*/*"),Jt.setRequestHeader)for(var kn in Qt)Jt.setRequestHeader(kn,Qt[kn]);return Oe!=null&&Jt.overrideMimeType&&Jt.overrideMimeType(Oe),yr!=null&&(Jt.responseType=yr),Sn!=null&&At.on("error",Sn).on("load",function(Ca){Sn(null,Ca)}),It.beforesend.call(At,Jt),Jt.send(fn??null),At},At.abort=function(){return Jt.abort(),At},h.rebind(At,It,"on"),xt==null?At:At.get(ln(xt))}function ln(ge){return ge.length===1?function(Oe,tt){ge(Oe==null?tt:null)}:ge}function Pn(ge){var Oe=ge.responseType;return Oe&&Oe!=="text"?ge.response:ge.responseText}h.dsv=function(ge,Oe){var tt=new RegExp('["'+ge+` +]`),xt=ge.charCodeAt(0);function At(Xr,Hr,fn){arguments.length<3&&(fn=Hr,Hr=null);var Sn=Dr(Xr,Oe,Hr==null?It:Qt(Hr),fn);return Sn.row=function(kn){return arguments.length?Sn.response((Hr=kn)==null?It:Qt(kn)):Hr},Sn}function It(Xr){return At.parse(Xr.responseText)}function Qt(Xr){return function(Hr){return At.parse(Hr.responseText,Xr)}}At.parse=function(Xr,Hr){var fn;return At.parseRows(Xr,function(Sn,kn){if(fn)return fn(Sn,kn-1);var Ca=function(Dn){for(var Jn={},oa=Sn.length,Aa=0;Aa=Ca)return Sn;if(Aa)return Aa=!1,fn;var ni=Dn;if(Xr.charCodeAt(ni)===34){for(var Xi=ni;Xi++24?(isFinite(Oe)&&(clearTimeout(Rn),Rn=setTimeout(Ei,Oe)),un=0):(un=1,di(Ei))}h.timer.flush=function(){Hi(),io()};function Hi(){for(var ge=Date.now(),Oe=jn;Oe;)ge>=Oe.t&&Oe.c(ge-Oe.t)&&(Oe.c=null),Oe=Oe.n;return ge}function io(){for(var ge,Oe=jn,tt=1/0;Oe;)Oe.c?(Oe.t=0;--Jt)Dn.push(At[Xr[fn[Jt]][2]]);for(Jt=+kn;Jt1&&Ct(ge[tt[xt-2]],ge[tt[xt-1]],ge[At])<=0;)--xt;tt[xt++]=At}return tt.slice(0,xt)}function ts(ge,Oe){return ge[0]-Oe[0]||ge[1]-Oe[1]}h.geom.polygon=function(ge){return V(ge,Ho),ge};var Ho=h.geom.polygon.prototype=[];Ho.area=function(){for(var ge=-1,Oe=this.length,tt,xt=this[Oe-1],At=0;++ge$e)Jt=Jt.L;else if(Qt=Oe-Ji(Jt,tt),Qt>$e){if(!Jt.R){xt=Jt;break}Jt=Jt.R}else{It>-$e?(xt=Jt.P,At=Jt):Qt>-$e?(xt=Jt,At=Jt.N):xt=At=Jt;break}var yr=sl(ge);if(js.insert(xt,yr),!(!xt&&!At)){if(xt===At){ll(xt),At=sl(xt.site),js.insert(yr,At),yr.edge=At.edge=ql(xt.site,yr.site),Ys(xt),Ys(At);return}if(!At){yr.edge=ql(xt.site,yr.site);return}ll(xt),ll(At);var Xr=xt.site,Hr=Xr.x,fn=Xr.y,Sn=ge.x-Hr,kn=ge.y-fn,Ca=At.site,Dn=Ca.x-Hr,Jn=Ca.y-fn,oa=2*(Sn*Jn-kn*Dn),Aa=Sn*Sn+kn*kn,Pa=Dn*Dn+Jn*Jn,ia={x:(Jn*Aa-kn*Pa)/oa+Hr,y:(Sn*Pa-Dn*Aa)/oa+fn};Po(At.edge,Xr,Ca,ia),yr.edge=ql(Xr,ge,null,ia),At.edge=ql(ge,Ca,null,ia),Ys(xt),Ys(At)}}function ci(ge,Oe){var tt=ge.site,xt=tt.x,At=tt.y,It=At-Oe;if(!It)return xt;var Qt=ge.P;if(!Qt)return-1/0;tt=Qt.site;var Jt=tt.x,yr=tt.y,Xr=yr-Oe;if(!Xr)return Jt;var Hr=Jt-xt,fn=1/It-1/Xr,Sn=Hr/Xr;return fn?(-Sn+Math.sqrt(Sn*Sn-2*fn*(Hr*Hr/(-2*Xr)-yr+Xr/2+At-It/2)))/fn+xt:(xt+Jt)/2}function Ji(ge,Oe){var tt=ge.N;if(tt)return ci(tt,Oe);var xt=ge.site;return xt.y===Oe?xt.x:1/0}function kl(ge){this.site=ge,this.edges=[]}kl.prototype.prepare=function(){for(var ge=this.edges,Oe=ge.length,tt;Oe--;)tt=ge[Oe].edge,(!tt.b||!tt.a)&&ge.splice(Oe,1);return ge.sort(zo),ge.length};function Rs(ge){for(var Oe=ge[0][0],tt=ge[1][0],xt=ge[0][1],At=ge[1][1],It,Qt,Jt,yr,Xr=Xs,Hr=Xr.length,fn,Sn,kn,Ca,Dn,Jn;Hr--;)if(fn=Xr[Hr],!(!fn||!fn.prepare()))for(kn=fn.edges,Ca=kn.length,Sn=0;Sn$e||l(yr-Qt)>$e)&&(kn.splice(Sn,0,new ou(Vl(fn.site,Jn,l(Jt-Oe)<$e&&At-yr>$e?{x:Oe,y:l(It-Oe)<$e?Qt:At}:l(yr-At)<$e&&tt-Jt>$e?{x:l(Qt-At)<$e?It:tt,y:At}:l(Jt-tt)<$e&&yr-xt>$e?{x:tt,y:l(It-tt)<$e?Qt:xt}:l(yr-xt)<$e&&Jt-Oe>$e?{x:l(Qt-xt)<$e?It:Oe,y:xt}:null),fn.site,null)),++Ca)}function zo(ge,Oe){return Oe.angle-ge.angle}function Pl(){zs(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ys(ge){var Oe=ge.P,tt=ge.N;if(!(!Oe||!tt)){var xt=Oe.site,At=ge.site,It=tt.site;if(xt!==It){var Qt=At.x,Jt=At.y,yr=xt.x-Qt,Xr=xt.y-Jt,Hr=It.x-Qt,Jn=It.y-Jt,fn=2*(yr*Jn-Xr*Hr);if(!(fn>=-Ee)){var Sn=yr*yr+Xr*Xr,kn=Hr*Hr+Jn*Jn,Ca=(Jn*Sn-Xr*kn)/fn,Dn=(yr*kn-Hr*Sn)/fn,Jn=Dn+Jt,oa=ho.pop()||new Pl;oa.arc=ge,oa.site=At,oa.x=Ca+Qt,oa.y=Jn+Math.sqrt(Ca*Ca+Dn*Dn),oa.cy=Jn,ge.circle=oa;for(var Aa=null,Pa=Zo._;Pa;)if(oa.y0)){if(Dn/=kn,kn<0){if(Dn0){if(Dn>Sn)return;Dn>fn&&(fn=Dn)}if(Dn=tt-Jt,!(!kn&&Dn<0)){if(Dn/=kn,kn<0){if(Dn>Sn)return;Dn>fn&&(fn=Dn)}else if(kn>0){if(Dn0)){if(Dn/=Ca,Ca<0){if(Dn0){if(Dn>Sn)return;Dn>fn&&(fn=Dn)}if(Dn=xt-yr,!(!Ca&&Dn<0)){if(Dn/=Ca,Ca<0){if(Dn>Sn)return;Dn>fn&&(fn=Dn)}else if(Ca>0){if(Dn0&&(At.a={x:Jt+fn*kn,y:yr+fn*Ca}),Sn<1&&(At.b={x:Jt+Sn*kn,y:yr+Sn*Ca}),At}}}}}}function Ki(ge){for(var Oe=Uo,tt=_u(ge[0][0],ge[0][1],ge[1][0],ge[1][1]),xt=Oe.length,At;xt--;)At=Oe[xt],(!ms(At,ge)||!tt(At)||l(At.a.x-At.b.x)<$e&&l(At.a.y-At.b.y)<$e)&&(At.a=At.b=null,Oe.splice(xt,1))}function ms(ge,Oe){var tt=ge.b;if(tt)return!0;var xt=ge.a,At=Oe[0][0],It=Oe[1][0],Qt=Oe[0][1],Jt=Oe[1][1],yr=ge.l,Xr=ge.r,Hr=yr.x,fn=yr.y,Sn=Xr.x,kn=Xr.y,Ca=(Hr+Sn)/2,Dn=(fn+kn)/2,Jn,oa;if(kn===fn){if(Ca=It)return;if(Hr>Sn){if(!xt)xt={x:Ca,y:Qt};else if(xt.y>=Jt)return;tt={x:Ca,y:Jt}}else{if(!xt)xt={x:Ca,y:Jt};else if(xt.y1)if(Hr>Sn){if(!xt)xt={x:(Qt-oa)/Jn,y:Qt};else if(xt.y>=Jt)return;tt={x:(Jt-oa)/Jn,y:Jt}}else{if(!xt)xt={x:(Jt-oa)/Jn,y:Jt};else if(xt.y=It)return;tt={x:It,y:Jn*It+oa}}else{if(!xt)xt={x:It,y:Jn*It+oa};else if(xt.x=Hr&&oa.x<=Sn&&oa.y>=fn&&oa.y<=kn?[[Hr,kn],[Sn,kn],[Sn,fn],[Hr,fn]]:[];Aa.point=yr[Dn]}),Xr}function Jt(yr){return yr.map(function(Xr,Hr){return{x:Math.round(xt(Xr,Hr)/$e)*$e,y:Math.round(At(Xr,Hr)/$e)*$e,i:Hr}})}return Qt.links=function(yr){return Vu(Jt(yr)).edges.filter(function(Xr){return Xr.l&&Xr.r}).map(function(Xr){return{source:yr[Xr.l.i],target:yr[Xr.r.i]}})},Qt.triangles=function(yr){var Xr=[];return Vu(Jt(yr)).cells.forEach(function(Hr,fn){for(var Sn=Hr.site,kn=Hr.edges.sort(zo),Ca=-1,Dn=kn.length,Jn,oa=kn[Dn-1].edge,Aa=oa.l===Sn?oa.r:oa.l;++CaPa&&(Pa=Hr.x),Hr.y>ia&&(ia=Hr.y),kn.push(Hr.x),Ca.push(Hr.y);else for(Dn=0;DnPa&&(Pa=ni),Xi>ia&&(ia=Xi),kn.push(ni),Ca.push(Xi)}var Ri=Pa-oa,Vi=ia-Aa;Ri>Vi?ia=Aa+Ri:Pa=oa+Vi;function mo(Co,os,tl,Cu,Kl,oo,Ps,Js){if(!(isNaN(tl)||isNaN(Cu)))if(Co.leaf){var Xl=Co.x,Dl=Co.y;if(Xl!=null)if(l(Xl-tl)+l(Dl-Cu)<.01)To(Co,os,tl,Cu,Kl,oo,Ps,Js);else{var xc=Co.point;Co.x=Co.y=Co.point=null,To(Co,xc,Xl,Dl,Kl,oo,Ps,Js),To(Co,os,tl,Cu,Kl,oo,Ps,Js)}else Co.x=tl,Co.y=Cu,Co.point=os}else To(Co,os,tl,Cu,Kl,oo,Ps,Js)}function To(Co,os,tl,Cu,Kl,oo,Ps,Js){var Xl=(Kl+Ps)*.5,Dl=(oo+Js)*.5,xc=tl>=Xl,Ml=Cu>=Dl,Yl=Ml<<1|xc;Co.leaf=!1,Co=Co.nodes[Yl]||(Co.nodes[Yl]=bl()),xc?Kl=Xl:Ps=Xl,Ml?oo=Dl:Js=Dl,mo(Co,os,tl,Cu,Kl,oo,Ps,Js)}var Zs=bl();if(Zs.add=function(Co){mo(Zs,Co,+fn(Co,++Dn),+Sn(Co,Dn),oa,Aa,Pa,ia)},Zs.visit=function(Co){Cc(Co,Zs,oa,Aa,Pa,ia)},Zs.find=function(Co){return Lh(Zs,Co[0],Co[1],oa,Aa,Pa,ia)},Dn=-1,Oe==null){for(;++DnIt||Sn>Qt||kn=ni,Vi=tt>=Xi,mo=Vi<<1|Ri,To=mo+4;mott&&(It=Oe.slice(tt,It),Jt[Qt]?Jt[Qt]+=It:Jt[++Qt]=It),(xt=xt[0])===(At=At[0])?Jt[Qt]?Jt[Qt]+=At:Jt[++Qt]=At:(Jt[++Qt]=null,yr.push({i:Qt,x:rc(xt,At)})),tt=Gu.lastIndex;return tt=0&&!(xt=h.interpolators[tt](ge,Oe)););return xt}h.interpolators=[function(ge,Oe){var tt=typeof Oe;return(tt==="string"?Kr.has(Oe.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Oe)?tc:Jc:Oe instanceof ra?tc:Array.isArray(Oe)?Rl:tt==="object"&&isNaN(Oe)?Hu:rc)(ge,Oe)}],h.interpolateArray=Rl;function Rl(ge,Oe){var tt=[],xt=[],At=ge.length,It=Oe.length,Qt=Math.min(ge.length,Oe.length),Jt;for(Jt=0;Jt=0?ge.slice(0,Oe):ge,xt=Oe>=0?ge.slice(Oe+1):"in";return tt=gc.get(tt)||xf,xt=Rf.get(xt)||F,su(xt(tt.apply(null,b.call(arguments,1))))};function su(ge){return function(Oe){return Oe<=0?0:Oe>=1?1:ge(Oe)}}function xv(ge){return function(Oe){return 1-ge(1-Oe)}}function Os(ge){return function(Oe){return .5*(Oe<.5?ge(2*Oe):2-ge(2-2*Oe))}}function Fv(ge){return ge*ge}function vl(ge){return ge*ge*ge}function Do(ge){if(ge<=0)return 0;if(ge>=1)return 1;var Oe=ge*ge,tt=Oe*ge;return 4*(ge<.5?tt:3*(ge-Oe)+tt-.75)}function Wf(ge){return function(Oe){return Math.pow(Oe,ge)}}function Qc(ge){return 1-Math.cos(ge*Xe)}function Ru(ge){return Math.pow(2,10*(ge-1))}function Ph(ge){return 1-Math.sqrt(1-ge*ge)}function If(ge,Oe){var tt;return arguments.length<2&&(Oe=.45),arguments.length?tt=Oe/ye*Math.asin(1/ge):(ge=1,tt=Oe/4),function(xt){return 1+ge*Math.pow(2,-10*xt)*Math.sin((xt-tt)*ye/Oe)}}function ah(ge){return ge||(ge=1.70158),function(Oe){return Oe*Oe*((ge+1)*Oe-ge)}}function Xu(ge){return ge<1/2.75?7.5625*ge*ge:ge<2/2.75?7.5625*(ge-=1.5/2.75)*ge+.75:ge<2.5/2.75?7.5625*(ge-=2.25/2.75)*ge+.9375:7.5625*(ge-=2.625/2.75)*ge+.984375}h.interpolateHcl=ov;function ov(ge,Oe){ge=h.hcl(ge),Oe=h.hcl(Oe);var tt=ge.h,xt=ge.c,At=ge.l,It=Oe.h-tt,Qt=Oe.c-xt,Jt=Oe.l-At;return isNaN(Qt)&&(Qt=0,xt=isNaN(xt)?Oe.c:xt),isNaN(It)?(It=0,tt=isNaN(tt)?Oe.h:tt):It>180?It-=360:It<-180&&(It+=360),function(yr){return ar(tt+It*yr,xt+Qt*yr,At+Jt*yr)+""}}h.interpolateHsl=Nh;function Nh(ge,Oe){ge=h.hsl(ge),Oe=h.hsl(Oe);var tt=ge.h,xt=ge.s,At=ge.l,It=Oe.h-tt,Qt=Oe.s-xt,Jt=Oe.l-At;return isNaN(Qt)&&(Qt=0,xt=isNaN(xt)?Oe.s:xt),isNaN(It)?(It=0,tt=isNaN(tt)?Oe.h:tt):It>180?It-=360:It<-180&&(It+=360),function(yr){return ja(tt+It*yr,xt+Qt*yr,At+Jt*yr)+""}}h.interpolateLab=ih;function ih(ge,Oe){ge=h.lab(ge),Oe=h.lab(Oe);var tt=ge.l,xt=ge.a,At=ge.b,It=Oe.l-tt,Qt=Oe.a-xt,Jt=Oe.b-At;return function(yr){return da(tt+It*yr,xt+Qt*yr,At+Jt*yr)+""}}h.interpolateRound=Df;function Df(ge,Oe){return Oe-=ge,function(tt){return Math.round(ge+Oe*tt)}}h.transform=function(ge){var Oe=E.createElementNS(h.ns.prefix.svg,"g");return(h.transform=function(tt){if(tt!=null){Oe.setAttribute("transform",tt);var xt=Oe.transform.baseVal.consolidate()}return new Rh(xt?xt.matrix:bf)})(ge)};function Rh(ge){var Oe=[ge.a,ge.b],tt=[ge.c,ge.d],xt=ef(Oe),At=Ih(Oe,tt),It=ef(Uh(tt,Oe,-At))||0;Oe[0]*tt[1]180?Oe+=360:Oe-ge>180&&(ge+=360),xt.push({i:tt.push(lf(tt)+"rotate(",null,")")-2,x:rc(ge,Oe)})):Oe&&tt.push(lf(tt)+"rotate("+Oe+")")}function Dh(ge,Oe,tt,xt){ge!==Oe?xt.push({i:tt.push(lf(tt)+"skewX(",null,")")-2,x:rc(ge,Oe)}):Oe&&tt.push(lf(tt)+"skewX("+Oe+")")}function Fl(ge,Oe,tt,xt){if(ge[0]!==Oe[0]||ge[1]!==Oe[1]){var At=tt.push(lf(tt)+"scale(",null,",",null,")");xt.push({i:At-4,x:rc(ge[0],Oe[0])},{i:At-2,x:rc(ge[1],Oe[1])})}else(Oe[0]!==1||Oe[1]!==1)&&tt.push(lf(tt)+"scale("+Oe+")")}function yh(ge,Oe){var tt=[],xt=[];return ge=h.transform(ge),Oe=h.transform(Oe),Yu(ge.translate,Oe.translate,tt,xt),Vf(ge.rotate,Oe.rotate,tt,xt),Dh(ge.skew,Oe.skew,tt,xt),Fl(ge.scale,Oe.scale,tt,xt),ge=Oe=null,function(At){for(var It=-1,Qt=xt.length,Jt;++It0?It=ia:(tt.c=null,tt.t=NaN,tt=null,Oe.end({type:"end",alpha:It=0})):ia>0&&(Oe.start({type:"start",alpha:It=ia}),tt=Ma(ge.tick)),ge):It},ge.start=function(){var ia,ni=kn.length,Xi=Ca.length,Ri=xt[0],Vi=xt[1],mo,To;for(ia=0;ia=0;)It.push(Hr=Xr[yr]),Hr.parent=Jt,Hr.depth=Jt.depth+1;tt&&(Jt.value=0),Jt.children=Xr}else tt&&(Jt.value=+tt.call(xt,Jt,Jt.depth)||0),delete Jt.children;return uf(At,function(fn){var Sn,kn;ge&&(Sn=fn.children)&&Sn.sort(ge),tt&&(kn=fn.parent)&&(kn.value+=fn.value)}),Qt}return xt.sort=function(At){return arguments.length?(ge=At,xt):ge},xt.children=function(At){return arguments.length?(Oe=At,xt):Oe},xt.value=function(At){return arguments.length?(tt=At,xt):tt},xt.revalue=function(At){return tt&&(Kf(At,function(It){It.children&&(It.value=0)}),uf(At,function(It){var Qt;It.children||(It.value=+tt.call(xt,It,It.depth)||0),(Qt=It.parent)&&(Qt.value+=It.value)})),At},xt};function lu(ge,Oe){return h.rebind(ge,Oe,"sort","children","value"),ge.nodes=ge,ge.links=Yv,ge}function Kf(ge,Oe){for(var tt=[ge];(ge=tt.pop())!=null;)if(Oe(ge),(At=ge.children)&&(xt=At.length))for(var xt,At;--xt>=0;)tt.push(At[xt])}function uf(ge,Oe){for(var tt=[ge],xt=[];(ge=tt.pop())!=null;)if(xt.push(ge),(Qt=ge.children)&&(It=Qt.length))for(var At=-1,It,Qt;++AtAt&&(At=Jt),xt.push(Jt)}for(Qt=0;Qtxt&&(tt=Oe,xt=At);return tt}function Ic(ge){return ge.reduce(tf,0)}function tf(ge,Oe){return ge+Oe[1]}h.layout.histogram=function(){var ge=!0,Oe=Number,tt=sh,xt=zh;function At(It,Sn){for(var Jt=[],yr=It.map(Oe,this),Xr=tt.call(this,yr,Sn),Hr=xt.call(this,Xr,yr,Sn),fn,Sn=-1,kn=yr.length,Ca=Hr.length-1,Dn=ge?1:1/kn,Jn;++Sn0)for(Sn=-1;++Sn=Xr[0]&&Jn<=Xr[1]&&(fn=Jt[h.bisect(Hr,Jn,1,Ca)-1],fn.y+=Dn,fn.push(It[Sn]));return Jt}return At.value=function(It){return arguments.length?(Oe=It,At):Oe},At.range=function(It){return arguments.length?(tt=Tt(It),At):tt},At.bins=function(It){return arguments.length?(xt=typeof It=="number"?function(Qt){return au(Qt,It)}:Tt(It),At):xt},At.frequency=function(It){return arguments.length?(ge=!!It,At):ge},At};function zh(ge,Oe){return au(ge,Math.ceil(Math.log(Oe.length)/Math.LN2+1))}function au(ge,Oe){for(var tt=-1,xt=+ge[0],At=(ge[1]-xt)/Oe,It=[];++tt<=Oe;)It[tt]=At*tt+xt;return It}function sh(ge){return[h.min(ge),h.max(ge)]}h.layout.pack=function(){var ge=h.layout.hierarchy().sort(Ff),Oe=0,tt=[1,1],xt;function At(It,Qt){var Jt=ge.call(this,It,Qt),yr=Jt[0],Xr=tt[0],Hr=tt[1],fn=xt==null?Math.sqrt:typeof xt=="function"?xt:function(){return xt};if(yr.x=yr.y=0,uf(yr,function(kn){kn.r=+fn(kn.value)}),uf(yr,uh),Oe){var Sn=Oe*(xt?1:Math.max(2*yr.r/Xr,2*yr.r/Hr))/2;uf(yr,function(kn){kn.r+=Sn}),uf(yr,uh),uf(yr,function(kn){kn.r-=Sn})}return Gh(yr,Xr/2,Hr/2,xt?1:1/Math.max(2*yr.r/Xr,2*yr.r/Hr)),Jt}return At.size=function(It){return arguments.length?(tt=It,At):tt},At.radius=function(It){return arguments.length?(xt=It==null||typeof It=="function"?It:+It,At):xt},At.padding=function(It){return arguments.length?(Oe=+It,At):Oe},lu(At,ge)};function Ff(ge,Oe){return ge.value-Oe.value}function Vc(ge,Oe){var tt=ge._pack_next;ge._pack_next=Oe,Oe._pack_prev=ge,Oe._pack_next=tt,tt._pack_prev=Oe}function lh(ge,Oe){ge._pack_next=Oe,Oe._pack_prev=ge}function cf(ge,Oe){var tt=Oe.x-ge.x,xt=Oe.y-ge.y,At=ge.r+Oe.r;return .999*At*At>tt*tt+xt*xt}function uh(ge){if(!(Oe=ge.children)||!(Sn=Oe.length))return;var Oe,tt=1/0,xt=-1/0,At=1/0,It=-1/0,Qt,Jt,yr,Xr,Hr,fn,Sn;function kn(ia){tt=Math.min(ia.x-ia.r,tt),xt=Math.max(ia.x+ia.r,xt),At=Math.min(ia.y-ia.r,At),It=Math.max(ia.y+ia.r,It)}if(Oe.forEach(Tv),Qt=Oe[0],Qt.x=-Qt.r,Qt.y=0,kn(Qt),Sn>1&&(Jt=Oe[1],Jt.x=Jt.r,Jt.y=0,kn(Jt),Sn>2))for(yr=Oe[2],Hc(Qt,Jt,yr),kn(yr),Vc(Qt,yr),Qt._pack_prev=yr,Vc(yr,Jt),Jt=Qt._pack_next,Xr=3;XrJn.x&&(Jn=ni),ni.depth>oa.depth&&(oa=ni)});var Aa=Oe(Dn,Jn)/2-Dn.x,Pa=tt[0]/(Jn.x+Oe(Jn,Dn)/2+Aa),ia=tt[1]/(oa.depth||1);Kf(kn,function(ni){ni.x=(ni.x+Aa)*Pa,ni.y=ni.depth*ia})}return Sn}function It(Hr){for(var fn={A:null,children:[Hr]},Sn=[fn],kn;(kn=Sn.pop())!=null;)for(var Ca=kn.children,Dn,Jn=0,oa=Ca.length;Jn0&&(yc(Bf(Dn,Hr,Sn),Hr,ni),oa+=ni,Aa+=ni),Pa+=Dn.m,oa+=kn.m,ia+=Jn.m,Aa+=Ca.m;Dn&&!xu(Ca)&&(Ca.t=Dn,Ca.m+=Pa-Aa),kn&&!ff(Jn)&&(Jn.t=kn,Jn.m+=oa-ia,Sn=Hr)}return Sn}function Xr(Hr){Hr.x*=tt[0],Hr.y=Hr.depth*tt[1]}return At.separation=function(Hr){return arguments.length?(Oe=Hr,At):Oe},At.size=function(Hr){return arguments.length?(xt=(tt=Hr)==null?Xr:null,At):xt?null:tt},At.nodeSize=function(Hr){return arguments.length?(xt=(tt=Hr)==null?null:Xr,At):xt?tt:null},lu(At,ge)};function Tf(ge,Oe){return ge.parent==Oe.parent?1:2}function ff(ge){var Oe=ge.children;return Oe.length?Oe[0]:ge.t}function xu(ge){var Oe=ge.children,tt;return(tt=Oe.length)?Oe[tt-1]:ge.t}function yc(ge,Oe,tt){var xt=tt/(Oe.i-ge.i);Oe.c-=xt,Oe.s+=tt,ge.c+=xt,Oe.z+=tt,Oe.m+=tt}function fu(ge){for(var Oe=0,tt=0,xt=ge.children,At=xt.length,It;--At>=0;)It=xt[At],It.z+=Oe,It.m+=Oe,Oe+=It.s+(tt+=It.c)}function Bf(ge,Oe,tt){return ge.a.parent===Oe.parent?ge.a:tt}h.layout.cluster=function(){var ge=h.layout.hierarchy().sort(null).value(null),Oe=Tf,tt=[1,1],xt=!1;function At(It,Qt){var Jt=ge.call(this,It,Qt),yr=Jt[0],Xr,Hr=0;uf(yr,function(Dn){var Jn=Dn.children;Jn&&Jn.length?(Dn.x=Oh(Jn),Dn.y=hf(Jn)):(Dn.x=Xr?Hr+=Oe(Dn,Xr):0,Dn.y=0,Xr=Dn)});var fn=ur(yr),Sn=Pr(yr),kn=fn.x-Oe(fn,Sn)/2,Ca=Sn.x+Oe(Sn,fn)/2;return uf(yr,xt?function(Dn){Dn.x=(Dn.x-yr.x)*tt[0],Dn.y=(yr.y-Dn.y)*tt[1]}:function(Dn){Dn.x=(Dn.x-kn)/(Ca-kn)*tt[0],Dn.y=(1-(yr.y?Dn.y/yr.y:1))*tt[1]}),Jt}return At.separation=function(It){return arguments.length?(Oe=It,At):Oe},At.size=function(It){return arguments.length?(xt=(tt=It)==null,At):xt?null:tt},At.nodeSize=function(It){return arguments.length?(xt=(tt=It)!=null,At):xt?tt:null},lu(At,ge)};function hf(ge){return 1+h.max(ge,function(Oe){return Oe.y})}function Oh(ge){return ge.reduce(function(Oe,tt){return Oe+tt.x},0)/ge.length}function ur(ge){var Oe=ge.children;return Oe&&Oe.length?ur(Oe[0]):ge}function Pr(ge){var Oe=ge.children,tt;return Oe&&(tt=Oe.length)?Pr(Oe[tt-1]):ge}h.layout.treemap=function(){var ge=h.layout.hierarchy(),Oe=Math.round,tt=[1,1],xt=null,At=vn,It=!1,Qt,Jt="squarify",yr=.5*(1+Math.sqrt(5));function Xr(Dn,Jn){for(var oa=-1,Aa=Dn.length,Pa,ia;++oa0;)Aa.push(ia=Pa[Vi-1]),Aa.area+=ia.area,Jt!=="squarify"||(Xi=Sn(Aa,Ri))<=ni?(Pa.pop(),ni=Xi):(Aa.area-=Aa.pop().area,kn(Aa,Ri,oa,!1),Ri=Math.min(oa.dx,oa.dy),Aa.length=Aa.area=0,ni=1/0);Aa.length&&(kn(Aa,Ri,oa,!0),Aa.length=Aa.area=0),Jn.forEach(Hr)}}function fn(Dn){var Jn=Dn.children;if(Jn&&Jn.length){var oa=At(Dn),Aa=Jn.slice(),Pa,ia=[];for(Xr(Aa,oa.dx*oa.dy/Dn.value),ia.area=0;Pa=Aa.pop();)ia.push(Pa),ia.area+=Pa.area,Pa.z!=null&&(kn(ia,Pa.z?oa.dx:oa.dy,oa,!Aa.length),ia.length=ia.area=0);Jn.forEach(fn)}}function Sn(Dn,Jn){for(var oa=Dn.area,Aa,Pa=0,ia=1/0,ni=-1,Xi=Dn.length;++niPa&&(Pa=Aa));return oa*=oa,Jn*=Jn,oa?Math.max(Jn*Pa*yr/oa,oa/(Jn*ia*yr)):1/0}function kn(Dn,Jn,oa,Aa){var Pa=-1,ia=Dn.length,ni=oa.x,Xi=oa.y,Ri=Jn?Oe(Dn.area/Jn):0,Vi;if(Jn==oa.dx){for((Aa||Ri>oa.dy)&&(Ri=oa.dy);++Paoa.dx)&&(Ri=oa.dx);++Pa1);return ge+Oe*xt*Math.sqrt(-2*Math.log(It)/It)}},logNormal:function(){var ge=h.random.normal.apply(h,arguments);return function(){return Math.exp(ge())}},bates:function(ge){var Oe=h.random.irwinHall(ge);return function(){return Oe()/ge}},irwinHall:function(ge){return function(){for(var Oe=0,tt=0;tt2?Va:ya,Xr=xt?jh:bv;return At=yr(ge,Oe,Xr,tt),It=yr(Oe,ge,Xr,qs),Jt}function Jt(yr){return At(yr)}return Jt.invert=function(yr){return It(yr)},Jt.domain=function(yr){return arguments.length?(ge=yr.map(Number),Qt()):ge},Jt.range=function(yr){return arguments.length?(Oe=yr,Qt()):Oe},Jt.rangeRound=function(yr){return Jt.range(yr).interpolate(Df)},Jt.clamp=function(yr){return arguments.length?(xt=yr,Qt()):xt},Jt.interpolate=function(yr){return arguments.length?(tt=yr,Qt()):tt},Jt.ticks=function(yr){return No(ge,yr)},Jt.tickFormat=function(yr,Xr){return d3_scale_linearTickFormat(ge,yr,Xr)},Jt.nice=function(yr){return Ba(ge,yr),Qt()},Jt.copy=function(){return _i(ge,Oe,tt,xt)},Qt()}function Ja(ge,Oe){return h.rebind(ge,Oe,"range","rangeRound","interpolate","clamp")}function Ba(ge,Oe){return ei(ge,si(Gi(ge,Oe)[2])),ei(ge,si(Gi(ge,Oe)[2])),ge}function Gi(ge,Oe){Oe==null&&(Oe=10);var tt=On(ge),xt=tt[1]-tt[0],At=Math.pow(10,Math.floor(Math.log(xt/Oe)/Math.LN10)),It=Oe/xt*At;return It<=.15?At*=10:It<=.35?At*=5:It<=.75&&(At*=2),tt[0]=Math.ceil(tt[0]/At)*At,tt[1]=Math.floor(tt[1]/At)*At+At*.5,tt[2]=At,tt}function No(ge,Oe){return h.range.apply(h,Gi(ge,Oe))}h.scale.log=function(){return Ro(h.scale.linear().domain([0,1]),10,!0,[1,10])};function Ro(ge,Oe,tt,xt){function At(Jt){return(tt?Math.log(Jt<0?0:Jt):-Math.log(Jt>0?0:-Jt))/Math.log(Oe)}function It(Jt){return tt?Math.pow(Oe,Jt):-Math.pow(Oe,-Jt)}function Qt(Jt){return ge(At(Jt))}return Qt.invert=function(Jt){return It(ge.invert(Jt))},Qt.domain=function(Jt){return arguments.length?(tt=Jt[0]>=0,ge.domain((xt=Jt.map(Number)).map(At)),Qt):xt},Qt.base=function(Jt){return arguments.length?(Oe=+Jt,ge.domain(xt.map(At)),Qt):Oe},Qt.nice=function(){var Jt=ei(xt.map(At),tt?Math:Go);return ge.domain(Jt),xt=Jt.map(It),Qt},Qt.ticks=function(){var Jt=On(xt),yr=[],Xr=Jt[0],Hr=Jt[1],fn=Math.floor(At(Xr)),Sn=Math.ceil(At(Hr)),kn=Oe%1?2:Oe;if(isFinite(Sn-fn)){if(tt){for(;fn0;Ca--)yr.push(It(fn)*Ca);for(fn=0;yr[fn]Hr;Sn--);yr=yr.slice(fn,Sn)}return yr},Qt.copy=function(){return Ro(ge.copy(),Oe,tt,xt)},Ja(Qt,ge)}var Go={floor:function(ge){return-Math.ceil(-ge)},ceil:function(ge){return-Math.floor(-ge)}};h.scale.pow=function(){return jo(h.scale.linear(),1,[0,1])};function jo(ge,Oe,tt){var xt=Yi(Oe),At=Yi(1/Oe);function It(Qt){return ge(xt(Qt))}return It.invert=function(Qt){return At(ge.invert(Qt))},It.domain=function(Qt){return arguments.length?(ge.domain((tt=Qt.map(Number)).map(xt)),It):tt},It.ticks=function(Qt){return No(tt,Qt)},It.tickFormat=function(Qt,Jt){return d3_scale_linearTickFormat(tt,Qt,Jt)},It.nice=function(Qt){return It.domain(Ba(tt,Qt))},It.exponent=function(Qt){return arguments.length?(xt=Yi(Oe=Qt),At=Yi(1/Oe),ge.domain(tt.map(xt)),It):Oe},It.copy=function(){return jo(ge.copy(),Oe,tt)},Ja(It,ge)}function Yi(ge){return function(Oe){return Oe<0?-Math.pow(-Oe,ge):Math.pow(Oe,ge)}}h.scale.sqrt=function(){return h.scale.pow().exponent(.5)},h.scale.ordinal=function(){return ki([],{t:"range",a:[[]]})};function ki(ge,Oe){var tt,xt,At;function It(Jt){return xt[((tt.get(Jt)||(Oe.t==="range"?tt.set(Jt,ge.push(Jt)):NaN))-1)%xt.length]}function Qt(Jt,yr){return h.range(ge.length).map(function(Xr){return Jt+yr*Xr})}return It.domain=function(Jt){if(!arguments.length)return ge;ge=[],tt=new A;for(var yr=-1,Xr=Jt.length,Hr;++yr0?tt[It-1]:ge[0],ItSn?0:1;if(Hr=Me)return yr(Hr,Ca)+(Xr?yr(Xr,1-Ca):"")+"Z";var Dn,Jn,oa,Aa,Pa=0,ia=0,ni,Xi,Ri,Vi,mo,To,Zs,Co,os=[];if((Aa=(+Qt.apply(this,arguments)||0)/2)&&(oa=xt===Ul?Math.sqrt(Xr*Xr+Hr*Hr):+xt.apply(this,arguments),Ca||(ia*=-1),Hr&&(ia=Ot(oa/Hr*Math.sin(Aa))),Xr&&(Pa=Ot(oa/Xr*Math.sin(Aa)))),Hr){ni=Hr*Math.cos(fn+ia),Xi=Hr*Math.sin(fn+ia),Ri=Hr*Math.cos(Sn-ia),Vi=Hr*Math.sin(Sn-ia);var tl=Math.abs(Sn-fn-2*ia)<=xe?0:1;if(ia&&dc(ni,Xi,Ri,Vi)===Ca^tl){var Cu=(fn+Sn)/2;ni=Hr*Math.cos(Cu),Xi=Hr*Math.sin(Cu),Ri=Vi=null}}else ni=Xi=0;if(Xr){mo=Xr*Math.cos(Sn-Pa),To=Xr*Math.sin(Sn-Pa),Zs=Xr*Math.cos(fn+Pa),Co=Xr*Math.sin(fn+Pa);var Kl=Math.abs(fn-Sn+2*Pa)<=xe?0:1;if(Pa&&dc(mo,To,Zs,Co)===1-Ca^Kl){var oo=(fn+Sn)/2;mo=Xr*Math.cos(oo),To=Xr*Math.sin(oo),Zs=Co=null}}else mo=To=0;if(kn>$e&&(Dn=Math.min(Math.abs(Hr-Xr)/2,+tt.apply(this,arguments)))>.001){Jn=Xr0?0:1}function _c(ge,Oe,tt,xt,At){var It=ge[0]-Oe[0],Qt=ge[1]-Oe[1],Jt=(At?xt:-xt)/Math.sqrt(It*It+Qt*Qt),yr=Jt*Qt,Xr=-Jt*It,Hr=ge[0]+yr,fn=ge[1]+Xr,Sn=Oe[0]+yr,kn=Oe[1]+Xr,Ca=(Hr+Sn)/2,Dn=(fn+kn)/2,Jn=Sn-Hr,oa=kn-fn,Aa=Jn*Jn+oa*oa,Pa=tt-xt,ia=Hr*kn-Sn*fn,ni=(oa<0?-1:1)*Math.sqrt(Math.max(0,Pa*Pa*Aa-ia*ia)),Xi=(ia*oa-Jn*ni)/Aa,Ri=(-ia*Jn-oa*ni)/Aa,Vi=(ia*oa+Jn*ni)/Aa,mo=(-ia*Jn+oa*ni)/Aa,To=Xi-Ca,Zs=Ri-Dn,Co=Vi-Ca,os=mo-Dn;return To*To+Zs*Zs>Co*Co+os*os&&(Xi=Vi,Ri=mo),[[Xi-yr,Ri-Xr],[Xi*tt/Pa,Ri*tt/Pa]]}function Hf(){return!0}function pc(ge){var Oe=no,tt=bo,xt=Hf,At=Mu,It=At.key,Qt=.7;function Jt(yr){var Xr=[],Hr=[],fn=-1,Sn=yr.length,kn,Ca=Tt(Oe),Dn=Tt(tt);function Jn(){Xr.push("M",At(ge(Hr),Qt))}for(;++fn1?ge.join("L"):ge+"Z"}function Sf(ge){return ge.join("L")+"Z"}function Xo(ge){for(var Oe=0,tt=ge.length,xt=ge[0],At=[xt[0],",",xt[1]];++Oe1&&At.push("H",xt[0]),At.join("")}function as(ge){for(var Oe=0,tt=ge.length,xt=ge[0],At=[xt[0],",",xt[1]];++Oe1){Jt=Oe[1],It=ge[yr],yr++,xt+="C"+(At[0]+Qt[0])+","+(At[1]+Qt[1])+","+(It[0]-Jt[0])+","+(It[1]-Jt[1])+","+It[0]+","+It[1];for(var Xr=2;Xr9&&(It=tt*3/Math.sqrt(It),Qt[Jt]=It*xt,Qt[Jt+1]=It*At));for(Jt=-1;++Jt<=yr;)It=(ge[Math.min(yr,Jt+1)][0]-ge[Math.max(0,Jt-1)][0])/(6*(1+Qt[Jt]*Qt[Jt])),Oe.push([It||0,Qt[Jt]*It||0]);return Oe}function et(ge){return ge.length<3?Mu(ge):ge[0]+P(ge,Ze(ge))}h.svg.line.radial=function(){var ge=pc(ft);return ge.radius=ge.x,delete ge.x,ge.angle=ge.y,delete ge.y,ge};function ft(ge){for(var Oe,tt=-1,xt=ge.length,At,It;++ttxe)+",1 "+fn}function Xr(Hr,fn,Sn,kn){return"Q 0,0 "+kn}return It.radius=function(Hr){return arguments.length?(tt=Tt(Hr),It):tt},It.source=function(Hr){return arguments.length?(ge=Tt(Hr),It):ge},It.target=function(Hr){return arguments.length?(Oe=Tt(Hr),It):Oe},It.startAngle=function(Hr){return arguments.length?(xt=Tt(Hr),It):xt},It.endAngle=function(Hr){return arguments.length?(At=Tt(Hr),It):At},It};function Ut(ge){return ge.radius}h.svg.diagonal=function(){var ge=zt,Oe=Et,tt=mr;function xt(At,It){var Qt=ge.call(this,At,It),Jt=Oe.call(this,At,It),yr=(Qt.y+Jt.y)/2,Xr=[Qt,{x:Qt.x,y:yr},{x:Jt.x,y:yr},Jt];return Xr=Xr.map(tt),"M"+Xr[0]+"C"+Xr[1]+" "+Xr[2]+" "+Xr[3]}return xt.source=function(At){return arguments.length?(ge=Tt(At),xt):ge},xt.target=function(At){return arguments.length?(Oe=Tt(At),xt):Oe},xt.projection=function(At){return arguments.length?(tt=At,xt):tt},xt};function mr(ge){return[ge.x,ge.y]}h.svg.diagonal.radial=function(){var ge=h.svg.diagonal(),Oe=mr,tt=ge.projection;return ge.projection=function(xt){return arguments.length?tt(wr(Oe=xt)):Oe},ge};function wr(ge){return function(){var Oe=ge.apply(this,arguments),tt=Oe[0],xt=Oe[1]-Xe;return[tt*Math.cos(xt),tt*Math.sin(xt)]}}h.svg.symbol=function(){var ge=Gr,Oe=Lr;function tt(xt,At){return(Mn.get(ge.call(this,xt,At))||an)(Oe.call(this,xt,At))}return tt.type=function(xt){return arguments.length?(ge=Tt(xt),tt):ge},tt.size=function(xt){return arguments.length?(Oe=Tt(xt),tt):Oe},tt};function Lr(){return 64}function Gr(){return"circle"}function an(ge){var Oe=Math.sqrt(ge/xe);return"M0,"+Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+-Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+Oe+"Z"}var Mn=h.map({circle:an,cross:function(ge){var Oe=Math.sqrt(ge/5)/2;return"M"+-3*Oe+","+-Oe+"H"+-Oe+"V"+-3*Oe+"H"+Oe+"V"+-Oe+"H"+3*Oe+"V"+Oe+"H"+Oe+"V"+3*Oe+"H"+-Oe+"V"+Oe+"H"+-3*Oe+"Z"},diamond:function(ge){var Oe=Math.sqrt(ge/(2*Gn)),tt=Oe*Gn;return"M0,"+-Oe+"L"+tt+",0 0,"+Oe+" "+-tt+",0Z"},square:function(ge){var Oe=Math.sqrt(ge)/2;return"M"+-Oe+","+-Oe+"L"+Oe+","+-Oe+" "+Oe+","+Oe+" "+-Oe+","+Oe+"Z"},"triangle-down":function(ge){var Oe=Math.sqrt(ge/Ln),tt=Oe*Ln/2;return"M0,"+tt+"L"+Oe+","+-tt+" "+-Oe+","+-tt+"Z"},"triangle-up":function(ge){var Oe=Math.sqrt(ge/Ln),tt=Oe*Ln/2;return"M0,"+-tt+"L"+Oe+","+tt+" "+-Oe+","+tt+"Z"}});h.svg.symbolTypes=Mn.keys();var Ln=Math.sqrt(3),Gn=Math.tan(30*Je);te.transition=function(ge){for(var Oe=yo||++Zi,tt=$s(ge),xt=[],At,It,Qt=co||{time:Date.now(),ease:Do,delay:0,duration:250},Jt=-1,yr=this.length;++Jt0;)fn[--Aa].call(ge,oa);if(Jn>=1)return Qt.event&&Qt.event.end.call(ge,ge.__data__,Oe),--It.count?delete It[xt]:delete ge[tt],1}Qt||(Jt=At.time,yr=Ma(Sn,0,Jt),Qt=It[xt]={tween:new A,time:Jt,timer:yr,delay:At.delay,duration:At.duration,ease:At.ease,index:Oe},At=null,++It.count)}h.svg.axis=function(){var ge=h.scale.linear(),Oe=nl,tt=6,xt=6,At=3,It=[10],Qt=null,Jt;function yr(Xr){Xr.each(function(){var Hr=h.select(this),fn=this.__chart__||ge,Sn=this.__chart__=ge.copy(),kn=Qt??(Sn.ticks?Sn.ticks.apply(Sn,It):Sn.domain()),Ca=Jt??(Sn.tickFormat?Sn.tickFormat.apply(Sn,It):F),Dn=Hr.selectAll(".tick").data(kn,Sn),Jn=Dn.enter().insert("g",".domain").attr("class","tick").style("opacity",$e),oa=h.transition(Dn.exit()).style("opacity",$e).remove(),Aa=h.transition(Dn.order()).style("opacity",1),Pa=Math.max(tt,0)+At,ia,ni=Ta(Sn),Xi=Hr.selectAll(".domain").data([0]),Ri=(Xi.enter().append("path").attr("class","domain"),h.transition(Xi));Jn.append("line"),Jn.append("text");var Vi=Jn.select("line"),mo=Aa.select("line"),To=Dn.select("text").text(Ca),Zs=Jn.select("text"),Co=Aa.select("text"),os=Oe==="top"||Oe==="left"?-1:1,tl,Cu,Kl,oo;if(Oe==="bottom"||Oe==="top"?(ia=eu,tl="x",Kl="y",Cu="x2",oo="y2",To.attr("dy",os<0?"0em":".71em").style("text-anchor","middle"),Ri.attr("d","M"+ni[0]+","+os*xt+"V0H"+ni[1]+"V"+os*xt)):(ia=Cs,tl="y",Kl="x",Cu="y2",oo="x2",To.attr("dy",".32em").style("text-anchor",os<0?"end":"start"),Ri.attr("d","M"+os*xt+","+ni[0]+"H0V"+ni[1]+"H"+os*xt)),Vi.attr(oo,os*tt),Zs.attr(Kl,os*Pa),mo.attr(Cu,0).attr(oo,os*tt),Co.attr(tl,0).attr(Kl,os*Pa),Sn.rangeBand){var Ps=Sn,Js=Ps.rangeBand()/2;fn=Sn=function(Xl){return Ps(Xl)+Js}}else fn.rangeBand?fn=Sn:oa.call(ia,Sn,fn);Jn.call(ia,fn,Sn),Aa.call(ia,Sn,Sn)})}return yr.scale=function(Xr){return arguments.length?(ge=Xr,yr):ge},yr.orient=function(Xr){return arguments.length?(Oe=Xr in hu?Xr+"":nl,yr):Oe},yr.ticks=function(){return arguments.length?(It=S(arguments),yr):It},yr.tickValues=function(Xr){return arguments.length?(Qt=Xr,yr):Qt},yr.tickFormat=function(Xr){return arguments.length?(Jt=Xr,yr):Jt},yr.tickSize=function(Xr){var Hr=arguments.length;return Hr?(tt=+Xr,xt=+arguments[Hr-1],yr):tt},yr.innerTickSize=function(Xr){return arguments.length?(tt=+Xr,yr):tt},yr.outerTickSize=function(Xr){return arguments.length?(xt=+Xr,yr):xt},yr.tickPadding=function(Xr){return arguments.length?(At=+Xr,yr):At},yr.tickSubdivide=function(){return arguments.length&&yr},yr};var nl="bottom",hu={top:1,right:1,bottom:1,left:1};function eu(ge,Oe,tt){ge.attr("transform",function(xt){var At=Oe(xt);return"translate("+(isFinite(At)?At:tt(xt))+",0)"})}function Cs(ge,Oe,tt){ge.attr("transform",function(xt){var At=Oe(xt);return"translate(0,"+(isFinite(At)?At:tt(xt))+")"})}h.svg.brush=function(){var ge=le(Hr,"brushstart","brush","brushend"),Oe=null,tt=null,xt=[0,0],At=[0,0],It,Qt,Jt=!0,yr=!0,Xr=ku[0];function Hr(Dn){Dn.each(function(){var Jn=h.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Ca).on("touchstart.brush",Ca),oa=Jn.selectAll(".background").data([0]);oa.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Jn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Aa=Jn.selectAll(".resize").data(Xr,F);Aa.exit().remove(),Aa.enter().append("g").attr("class",function(Xi){return"resize "+Xi}).style("cursor",function(Xi){return Ls[Xi]}).append("rect").attr("x",function(Xi){return/[ew]$/.test(Xi)?-3:null}).attr("y",function(Xi){return/^[ns]/.test(Xi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Aa.style("display",Hr.empty()?"none":null);var Pa=h.transition(Jn),ia=h.transition(oa),ni;Oe&&(ni=Ta(Oe),ia.attr("x",ni[0]).attr("width",ni[1]-ni[0]),Sn(Pa)),tt&&(ni=Ta(tt),ia.attr("y",ni[0]).attr("height",ni[1]-ni[0]),kn(Pa)),fn(Pa)})}Hr.event=function(Dn){Dn.each(function(){var Jn=ge.of(this,arguments),oa={x:xt,y:At,i:It,j:Qt},Aa=this.__chart__||oa;this.__chart__=oa,yo?h.select(this).transition().each("start.brush",function(){It=Aa.i,Qt=Aa.j,xt=Aa.x,At=Aa.y,Jn({type:"brushstart"})}).tween("brush:brush",function(){var Pa=Rl(xt,oa.x),ia=Rl(At,oa.y);return It=Qt=null,function(ni){xt=oa.x=Pa(ni),At=oa.y=ia(ni),Jn({type:"brush",mode:"resize"})}}).each("end.brush",function(){It=oa.i,Qt=oa.j,Jn({type:"brush",mode:"resize"}),Jn({type:"brushend"})}):(Jn({type:"brushstart"}),Jn({type:"brush",mode:"resize"}),Jn({type:"brushend"}))})};function fn(Dn){Dn.selectAll(".resize").attr("transform",function(Jn){return"translate("+xt[+/e$/.test(Jn)]+","+At[+/^s/.test(Jn)]+")"})}function Sn(Dn){Dn.select(".extent").attr("x",xt[0]),Dn.selectAll(".extent,.n>rect,.s>rect").attr("width",xt[1]-xt[0])}function kn(Dn){Dn.select(".extent").attr("y",At[0]),Dn.selectAll(".extent,.e>rect,.w>rect").attr("height",At[1]-At[0])}function Ca(){var Dn=this,Jn=h.select(h.event.target),oa=ge.of(Dn,arguments),Aa=h.select(Dn),Pa=Jn.datum(),ia=!/^(n|s)$/.test(Pa)&&Oe,ni=!/^(e|w)$/.test(Pa)&&tt,Xi=Jn.classed("extent"),Ri=Ar(Dn),Vi,mo=h.mouse(Dn),To,Zs=h.select(t(Dn)).on("keydown.brush",tl).on("keyup.brush",Cu);if(h.event.changedTouches?Zs.on("touchmove.brush",Kl).on("touchend.brush",Ps):Zs.on("mousemove.brush",Kl).on("mouseup.brush",Ps),Aa.interrupt().selectAll("*").interrupt(),Xi)mo[0]=xt[0]-mo[0],mo[1]=At[0]-mo[1];else if(Pa){var Co=+/w$/.test(Pa),os=+/^n/.test(Pa);To=[xt[1-Co]-mo[0],At[1-os]-mo[1]],mo[0]=xt[Co],mo[1]=At[os]}else h.event.altKey&&(Vi=mo.slice());Aa.style("pointer-events","none").selectAll(".resize").style("display",null),h.select("body").style("cursor",Jn.style("cursor")),oa({type:"brushstart"}),Kl();function tl(){h.event.keyCode==32&&(Xi||(Vi=null,mo[0]-=xt[1],mo[1]-=At[1],Xi=2),re())}function Cu(){h.event.keyCode==32&&Xi==2&&(mo[0]+=xt[1],mo[1]+=At[1],Xi=0,re())}function Kl(){var Js=h.mouse(Dn),Xl=!1;To&&(Js[0]+=To[0],Js[1]+=To[1]),Xi||(h.event.altKey?(Vi||(Vi=[(xt[0]+xt[1])/2,(At[0]+At[1])/2]),mo[0]=xt[+(Js[0]0))return rr;do rr.push(Mr=new Date(+Ft)),Ne(Ft,$t),pe(Ft);while(Mr=Nt)for(;pe(Nt),!Ft(Nt);)Nt.setTime(Nt-1)},function(Nt,$t){if(Nt>=Nt)if($t<0)for(;++$t<=0;)for(;Ne(Nt,-1),!Ft(Nt););else for(;--$t>=0;)for(;Ne(Nt,1),!Ft(Nt););})},ot&&(rt.count=function(Ft,Nt){return b.setTime(+Ft),S.setTime(+Nt),pe(b),pe(S),Math.floor(ot(b,S))},rt.every=function(Ft){return Ft=Math.floor(Ft),!isFinite(Ft)||!(Ft>0)?null:Ft>1?rt.filter(ct?function(Nt){return ct(Nt)%Ft===0}:function(Nt){return rt.count(0,Nt)%Ft===0}):rt}),rt}var e=E(function(){},function(pe,Ne){pe.setTime(+pe+Ne)},function(pe,Ne){return Ne-pe});e.every=function(pe){return pe=Math.floor(pe),!isFinite(pe)||!(pe>0)?null:pe>1?E(function(Ne){Ne.setTime(Math.floor(Ne/pe)*pe)},function(Ne,ot){Ne.setTime(+Ne+ot*pe)},function(Ne,ot){return(ot-Ne)/pe}):e};var t=e.range,r=1e3,o=6e4,n=36e5,i=864e5,a=6048e5,s=E(function(pe){pe.setTime(pe-pe.getMilliseconds())},function(pe,Ne){pe.setTime(+pe+Ne*r)},function(pe,Ne){return(Ne-pe)/r},function(pe){return pe.getUTCSeconds()}),f=s.range,c=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getMinutes()}),p=c.range,d=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r-pe.getMinutes()*o)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getHours()}),T=d.range,l=E(function(pe){pe.setHours(0,0,0,0)},function(pe,Ne){pe.setDate(pe.getDate()+Ne)},function(pe,Ne){return(Ne-pe-(Ne.getTimezoneOffset()-pe.getTimezoneOffset())*o)/i},function(pe){return pe.getDate()-1}),g=l.range;function x(pe){return E(function(Ne){Ne.setDate(Ne.getDate()-(Ne.getDay()+7-pe)%7),Ne.setHours(0,0,0,0)},function(Ne,ot){Ne.setDate(Ne.getDate()+ot*7)},function(Ne,ot){return(ot-Ne-(ot.getTimezoneOffset()-Ne.getTimezoneOffset())*o)/a})}var A=x(0),M=x(1),_=x(2),w=x(3),m=x(4),u=x(5),v=x(6),y=A.range,I=M.range,L=_.range,z=w.range,F=m.range,N=u.range,B=v.range,R=E(function(pe){pe.setDate(1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setMonth(pe.getMonth()+Ne)},function(pe,Ne){return Ne.getMonth()-pe.getMonth()+(Ne.getFullYear()-pe.getFullYear())*12},function(pe){return pe.getMonth()}),U=R.range,j=E(function(pe){pe.setMonth(0,1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setFullYear(pe.getFullYear()+Ne)},function(pe,Ne){return Ne.getFullYear()-pe.getFullYear()},function(pe){return pe.getFullYear()});j.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setFullYear(Math.floor(Ne.getFullYear()/pe)*pe),Ne.setMonth(0,1),Ne.setHours(0,0,0,0)},function(Ne,ot){Ne.setFullYear(Ne.getFullYear()+ot*pe)})};var Z=j.range,re=E(function(pe){pe.setUTCSeconds(0,0)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getUTCMinutes()}),fe=re.range,le=E(function(pe){pe.setUTCMinutes(0,0,0)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getUTCHours()}),ce=le.range,V=E(function(pe){pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCDate(pe.getUTCDate()+Ne)},function(pe,Ne){return(Ne-pe)/i},function(pe){return pe.getUTCDate()-1}),ee=V.range;function ne(pe){return E(function(Ne){Ne.setUTCDate(Ne.getUTCDate()-(Ne.getUTCDay()+7-pe)%7),Ne.setUTCHours(0,0,0,0)},function(Ne,ot){Ne.setUTCDate(Ne.getUTCDate()+ot*7)},function(Ne,ot){return(ot-Ne)/a})}var K=ne(0),ue=ne(1),te=ne(2),H=ne(3),ae=ne(4),ie=ne(5),ve=ne(6),Ae=K.range,Ce=ue.range,Fe=te.range,ze=H.range,Ye=ae.range,it=ie.range,st=ve.range,nt=E(function(pe){pe.setUTCDate(1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCMonth(pe.getUTCMonth()+Ne)},function(pe,Ne){return Ne.getUTCMonth()-pe.getUTCMonth()+(Ne.getUTCFullYear()-pe.getUTCFullYear())*12},function(pe){return pe.getUTCMonth()}),Qe=nt.range,Le=E(function(pe){pe.setUTCMonth(0,1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCFullYear(pe.getUTCFullYear()+Ne)},function(pe,Ne){return Ne.getUTCFullYear()-pe.getUTCFullYear()},function(pe){return pe.getUTCFullYear()});Le.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setUTCFullYear(Math.floor(Ne.getUTCFullYear()/pe)*pe),Ne.setUTCMonth(0,1),Ne.setUTCHours(0,0,0,0)},function(Ne,ot){Ne.setUTCFullYear(Ne.getUTCFullYear()+ot*pe)})};var Te=Le.range;h.timeDay=l,h.timeDays=g,h.timeFriday=u,h.timeFridays=N,h.timeHour=d,h.timeHours=T,h.timeInterval=E,h.timeMillisecond=e,h.timeMilliseconds=t,h.timeMinute=c,h.timeMinutes=p,h.timeMonday=M,h.timeMondays=I,h.timeMonth=R,h.timeMonths=U,h.timeSaturday=v,h.timeSaturdays=B,h.timeSecond=s,h.timeSeconds=f,h.timeSunday=A,h.timeSundays=y,h.timeThursday=m,h.timeThursdays=F,h.timeTuesday=_,h.timeTuesdays=L,h.timeWednesday=w,h.timeWednesdays=z,h.timeWeek=A,h.timeWeeks=y,h.timeYear=j,h.timeYears=Z,h.utcDay=V,h.utcDays=ee,h.utcFriday=ie,h.utcFridays=it,h.utcHour=le,h.utcHours=ce,h.utcMillisecond=e,h.utcMilliseconds=t,h.utcMinute=re,h.utcMinutes=fe,h.utcMonday=ue,h.utcMondays=Ce,h.utcMonth=nt,h.utcMonths=Qe,h.utcSaturday=ve,h.utcSaturdays=st,h.utcSecond=s,h.utcSeconds=f,h.utcSunday=K,h.utcSundays=Ae,h.utcThursday=ae,h.utcThursdays=Ye,h.utcTuesday=te,h.utcTuesdays=Fe,h.utcWednesday=H,h.utcWednesdays=ze,h.utcWeek=K,h.utcWeeks=Ae,h.utcYear=Le,h.utcYears=Te,Object.defineProperty(h,"__esModule",{value:!0})})}}),ji=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,rl()):(h=h||self,b(h.d3=h.d3||{},h.d3))})($,function(h,b){function S(je){if(0<=je.y&&je.y<100){var $e=new Date(-1,je.m,je.d,je.H,je.M,je.S,je.L);return $e.setFullYear(je.y),$e}return new Date(je.y,je.m,je.d,je.H,je.M,je.S,je.L)}function E(je){if(0<=je.y&&je.y<100){var $e=new Date(Date.UTC(-1,je.m,je.d,je.H,je.M,je.S,je.L));return $e.setUTCFullYear(je.y),$e}return new Date(Date.UTC(je.y,je.m,je.d,je.H,je.M,je.S,je.L))}function e(je,$e,Ee){return{y:je,m:$e,d:Ee,H:0,M:0,S:0,L:0}}function t(je){var $e=je.dateTime,Ee=je.date,xe=je.time,ye=je.periods,Me=je.days,Xe=je.shortDays,Je=je.months,Lt=je.shortMonths,Ct=f(ye),Ot=c(ye),Wt=f(Me),_r=c(Me),pr=f(Xe),hr=c(Xe),Fr=f(Je),En=c(Je),Zn=f(Lt),qn=c(Lt),ta={a:da,A:fa,b:ga,B:ka,c:null,d:R,e:R,f:fe,H:U,I:j,j:Z,L:re,m:le,M:ce,p:Vn,q:hi,Q:Nt,s:$t,S:V,u:ee,U:ne,V:K,w:ue,W:te,x:null,X:null,y:H,Y:ae,Z:ie,"%":Ft},ra={a:Ti,A:Dt,b:yt,B:Er,c:null,d:ve,e:ve,f:Ye,H:Ae,I:Ce,j:Fe,L:ze,m:it,M:st,p:Nr,q:jr,Q:Nt,s:$t,S:nt,u:Qe,U:Le,V:Te,w:pe,W:Ne,x:null,X:null,y:ot,Y:ct,Z:rt,"%":Ft},Nn={a:ar,A:sr,b:Vr,B:on,c:pn,d:m,e:m,f:z,H:v,I:v,j:u,L,m:w,M:y,p:qt,q:_,Q:N,s:B,S:I,u:d,U:T,V:l,w:p,W:g,x:wn,X:Kn,y:A,Y:x,Z:M,"%":F};ta.x=Ea(Ee,ta),ta.X=Ea(xe,ta),ta.c=Ea($e,ta),ra.x=Ea(Ee,ra),ra.X=Ea(xe,ra),ra.c=Ea($e,ra);function Ea(Ir,Ur){return function(sn){var Kr=[],Tt=-1,or=0,Dr=Ir.length,ln,Pn,jn;for(sn instanceof Date||(sn=new Date(+sn));++Tt53)return null;"w"in Kr||(Kr.w=1),"Z"in Kr?(or=E(e(Kr.y,0,1)),Dr=or.getUTCDay(),or=Dr>4||Dr===0?b.utcMonday.ceil(or):b.utcMonday(or),or=b.utcDay.offset(or,(Kr.V-1)*7),Kr.y=or.getUTCFullYear(),Kr.m=or.getUTCMonth(),Kr.d=or.getUTCDate()+(Kr.w+6)%7):(or=S(e(Kr.y,0,1)),Dr=or.getDay(),or=Dr>4||Dr===0?b.timeMonday.ceil(or):b.timeMonday(or),or=b.timeDay.offset(or,(Kr.V-1)*7),Kr.y=or.getFullYear(),Kr.m=or.getMonth(),Kr.d=or.getDate()+(Kr.w+6)%7)}else("W"in Kr||"U"in Kr)&&("w"in Kr||(Kr.w="u"in Kr?Kr.u%7:"W"in Kr?1:0),Dr="Z"in Kr?E(e(Kr.y,0,1)).getUTCDay():S(e(Kr.y,0,1)).getDay(),Kr.m=0,Kr.d="W"in Kr?(Kr.w+6)%7+Kr.W*7-(Dr+5)%7:Kr.w+Kr.U*7-(Dr+6)%7);return"Z"in Kr?(Kr.H+=Kr.Z/100|0,Kr.M+=Kr.Z%100,E(Kr)):S(Kr)}}function ir(Ir,Ur,sn,Kr){for(var Tt=0,or=Ur.length,Dr=sn.length,ln,Pn;Tt=Dr)return-1;if(ln=Ur.charCodeAt(Tt++),ln===37){if(ln=Ur.charAt(Tt++),Pn=Nn[ln in r?Ur.charAt(Tt++):ln],!Pn||(Kr=Pn(Ir,sn,Kr))<0)return-1}else if(ln!=sn.charCodeAt(Kr++))return-1}return Kr}function qt(Ir,Ur,sn){var Kr=Ct.exec(Ur.slice(sn));return Kr?(Ir.p=Ot[Kr[0].toLowerCase()],sn+Kr[0].length):-1}function ar(Ir,Ur,sn){var Kr=pr.exec(Ur.slice(sn));return Kr?(Ir.w=hr[Kr[0].toLowerCase()],sn+Kr[0].length):-1}function sr(Ir,Ur,sn){var Kr=Wt.exec(Ur.slice(sn));return Kr?(Ir.w=_r[Kr[0].toLowerCase()],sn+Kr[0].length):-1}function Vr(Ir,Ur,sn){var Kr=Zn.exec(Ur.slice(sn));return Kr?(Ir.m=qn[Kr[0].toLowerCase()],sn+Kr[0].length):-1}function on(Ir,Ur,sn){var Kr=Fr.exec(Ur.slice(sn));return Kr?(Ir.m=En[Kr[0].toLowerCase()],sn+Kr[0].length):-1}function pn(Ir,Ur,sn){return ir(Ir,$e,Ur,sn)}function wn(Ir,Ur,sn){return ir(Ir,Ee,Ur,sn)}function Kn(Ir,Ur,sn){return ir(Ir,xe,Ur,sn)}function da(Ir){return Xe[Ir.getDay()]}function fa(Ir){return Me[Ir.getDay()]}function ga(Ir){return Lt[Ir.getMonth()]}function ka(Ir){return Je[Ir.getMonth()]}function Vn(Ir){return ye[+(Ir.getHours()>=12)]}function hi(Ir){return 1+~~(Ir.getMonth()/3)}function Ti(Ir){return Xe[Ir.getUTCDay()]}function Dt(Ir){return Me[Ir.getUTCDay()]}function yt(Ir){return Lt[Ir.getUTCMonth()]}function Er(Ir){return Je[Ir.getUTCMonth()]}function Nr(Ir){return ye[+(Ir.getUTCHours()>=12)]}function jr(Ir){return 1+~~(Ir.getUTCMonth()/3)}return{format:function(Ir){var Ur=Ea(Ir+="",ta);return Ur.toString=function(){return Ir},Ur},parse:function(Ir){var Ur=ja(Ir+="",!1);return Ur.toString=function(){return Ir},Ur},utcFormat:function(Ir){var Ur=Ea(Ir+="",ra);return Ur.toString=function(){return Ir},Ur},utcParse:function(Ir){var Ur=ja(Ir+="",!0);return Ur.toString=function(){return Ir},Ur}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,n=/^%/,i=/[\\^$*+?|[\]().{}]/g;function a(je,$e,Ee){var xe=je<0?"-":"",ye=(xe?-je:je)+"",Me=ye.length;return xe+(Me68?1900:2e3),Ee+xe[0].length):-1}function M(je,$e,Ee){var xe=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec($e.slice(Ee,Ee+6));return xe?(je.Z=xe[1]?0:-(xe[2]+(xe[3]||"00")),Ee+xe[0].length):-1}function _(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+1));return xe?(je.q=xe[0]*3-3,Ee+xe[0].length):-1}function w(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.m=xe[0]-1,Ee+xe[0].length):-1}function m(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.d=+xe[0],Ee+xe[0].length):-1}function u(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+3));return xe?(je.m=0,je.d=+xe[0],Ee+xe[0].length):-1}function v(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.H=+xe[0],Ee+xe[0].length):-1}function y(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.M=+xe[0],Ee+xe[0].length):-1}function I(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.S=+xe[0],Ee+xe[0].length):-1}function L(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+3));return xe?(je.L=+xe[0],Ee+xe[0].length):-1}function z(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+6));return xe?(je.L=Math.floor(xe[0]/1e3),Ee+xe[0].length):-1}function F(je,$e,Ee){var xe=n.exec($e.slice(Ee,Ee+1));return xe?Ee+xe[0].length:-1}function N(je,$e,Ee){var xe=o.exec($e.slice(Ee));return xe?(je.Q=+xe[0],Ee+xe[0].length):-1}function B(je,$e,Ee){var xe=o.exec($e.slice(Ee));return xe?(je.s=+xe[0],Ee+xe[0].length):-1}function R(je,$e){return a(je.getDate(),$e,2)}function U(je,$e){return a(je.getHours(),$e,2)}function j(je,$e){return a(je.getHours()%12||12,$e,2)}function Z(je,$e){return a(1+b.timeDay.count(b.timeYear(je),je),$e,3)}function re(je,$e){return a(je.getMilliseconds(),$e,3)}function fe(je,$e){return re(je,$e)+"000"}function le(je,$e){return a(je.getMonth()+1,$e,2)}function ce(je,$e){return a(je.getMinutes(),$e,2)}function V(je,$e){return a(je.getSeconds(),$e,2)}function ee(je){var $e=je.getDay();return $e===0?7:$e}function ne(je,$e){return a(b.timeSunday.count(b.timeYear(je)-1,je),$e,2)}function K(je,$e){var Ee=je.getDay();return je=Ee>=4||Ee===0?b.timeThursday(je):b.timeThursday.ceil(je),a(b.timeThursday.count(b.timeYear(je),je)+(b.timeYear(je).getDay()===4),$e,2)}function ue(je){return je.getDay()}function te(je,$e){return a(b.timeMonday.count(b.timeYear(je)-1,je),$e,2)}function H(je,$e){return a(je.getFullYear()%100,$e,2)}function ae(je,$e){return a(je.getFullYear()%1e4,$e,4)}function ie(je){var $e=je.getTimezoneOffset();return($e>0?"-":($e*=-1,"+"))+a($e/60|0,"0",2)+a($e%60,"0",2)}function ve(je,$e){return a(je.getUTCDate(),$e,2)}function Ae(je,$e){return a(je.getUTCHours(),$e,2)}function Ce(je,$e){return a(je.getUTCHours()%12||12,$e,2)}function Fe(je,$e){return a(1+b.utcDay.count(b.utcYear(je),je),$e,3)}function ze(je,$e){return a(je.getUTCMilliseconds(),$e,3)}function Ye(je,$e){return ze(je,$e)+"000"}function it(je,$e){return a(je.getUTCMonth()+1,$e,2)}function st(je,$e){return a(je.getUTCMinutes(),$e,2)}function nt(je,$e){return a(je.getUTCSeconds(),$e,2)}function Qe(je){var $e=je.getUTCDay();return $e===0?7:$e}function Le(je,$e){return a(b.utcSunday.count(b.utcYear(je)-1,je),$e,2)}function Te(je,$e){var Ee=je.getUTCDay();return je=Ee>=4||Ee===0?b.utcThursday(je):b.utcThursday.ceil(je),a(b.utcThursday.count(b.utcYear(je),je)+(b.utcYear(je).getUTCDay()===4),$e,2)}function pe(je){return je.getUTCDay()}function Ne(je,$e){return a(b.utcMonday.count(b.utcYear(je)-1,je),$e,2)}function ot(je,$e){return a(je.getUTCFullYear()%100,$e,2)}function ct(je,$e){return a(je.getUTCFullYear()%1e4,$e,4)}function rt(){return"+0000"}function Ft(){return"%"}function Nt(je){return+je}function $t(je){return Math.floor(+je/1e3)}var rr;Mr({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 Mr(je){return rr=t(je),h.timeFormat=rr.format,h.timeParse=rr.parse,h.utcFormat=rr.utcFormat,h.utcParse=rr.utcParse,rr}var Sr="%Y-%m-%dT%H:%M:%S.%LZ";function Zr(je){return je.toISOString()}var Ar=Date.prototype.toISOString?Zr:h.utcFormat(Sr);function Br(je){var $e=new Date(je);return isNaN($e)?null:$e}var Mt=+new Date("2000-01-01T00:00:00.000Z")?Br:h.utcParse(Sr);h.isoFormat=Ar,h.isoParse=Mt,h.timeFormatDefaultLocale=Mr,h.timeFormatLocale=t,Object.defineProperty(h,"__esModule",{value:!0})})}}),Bo=Ge({"node_modules/d3-format/dist/d3-format.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=typeof globalThis<"u"?globalThis:h||self,b(h.d3=h.d3||{}))})($,function(h){function b(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function S(w,m){if((u=(w=m?w.toExponential(m-1):w.toExponential()).indexOf("e"))<0)return null;var u,v=w.slice(0,u);return[v.length>1?v[0]+v.slice(2):v,+w.slice(u+1)]}function E(w){return w=S(Math.abs(w)),w?w[1]:NaN}function e(w,m){return function(u,v){for(var y=u.length,I=[],L=0,z=w[0],F=0;y>0&&z>0&&(F+z+1>v&&(z=Math.max(1,v-F)),I.push(u.substring(y-=z,y+z)),!((F+=z+1)>v));)z=w[L=(L+1)%w.length];return I.reverse().join(m)}}function t(w){return function(m){return m.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(m=r.exec(w)))throw new Error("invalid format: "+w);var m;return new n({fill:m[1],align:m[2],sign:m[3],symbol:m[4],zero:m[5],width:m[6],comma:m[7],precision:m[8]&&m[8].slice(1),trim:m[9],type:m[10]})}o.prototype=n.prototype;function n(w){this.fill=w.fill===void 0?" ":w.fill+"",this.align=w.align===void 0?">":w.align+"",this.sign=w.sign===void 0?"-":w.sign+"",this.symbol=w.symbol===void 0?"":w.symbol+"",this.zero=!!w.zero,this.width=w.width===void 0?void 0:+w.width,this.comma=!!w.comma,this.precision=w.precision===void 0?void 0:+w.precision,this.trim=!!w.trim,this.type=w.type===void 0?"":w.type+""}n.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i(w){e:for(var m=w.length,u=1,v=-1,y;u0&&(v=0);break}return v>0?w.slice(0,v)+w.slice(y+1):w}var a;function s(w,m){var u=S(w,m);if(!u)return w+"";var v=u[0],y=u[1],I=y-(a=Math.max(-8,Math.min(8,Math.floor(y/3)))*3)+1,L=v.length;return I===L?v:I>L?v+new Array(I-L+1).join("0"):I>0?v.slice(0,I)+"."+v.slice(I):"0."+new Array(1-I).join("0")+S(w,Math.max(0,m+I-1))[0]}function f(w,m){var u=S(w,m);if(!u)return w+"";var v=u[0],y=u[1];return y<0?"0."+new Array(-y).join("0")+v:v.length>y+1?v.slice(0,y+1)+"."+v.slice(y+1):v+new Array(y-v.length+2).join("0")}var c={"%":function(w,m){return(w*100).toFixed(m)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:b,e:function(w,m){return w.toExponential(m)},f:function(w,m){return w.toFixed(m)},g:function(w,m){return w.toPrecision(m)},o:function(w){return Math.round(w).toString(8)},p:function(w,m){return f(w*100,m)},r:f,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function p(w){return w}var d=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var m=w.grouping===void 0||w.thousands===void 0?p:e(d.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",v=w.currency===void 0?"":w.currency[1]+"",y=w.decimal===void 0?".":w.decimal+"",I=w.numerals===void 0?p:t(d.call(w.numerals,String)),L=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function N(R){R=o(R);var U=R.fill,j=R.align,Z=R.sign,re=R.symbol,fe=R.zero,le=R.width,ce=R.comma,V=R.precision,ee=R.trim,ne=R.type;ne==="n"?(ce=!0,ne="g"):c[ne]||(V===void 0&&(V=12),ee=!0,ne="g"),(fe||U==="0"&&j==="=")&&(fe=!0,U="0",j="=");var K=re==="$"?u:re==="#"&&/[boxX]/.test(ne)?"0"+ne.toLowerCase():"",ue=re==="$"?v:/[%p]/.test(ne)?L:"",te=c[ne],H=/[defgprs%]/.test(ne);V=V===void 0?6:/[gprs]/.test(ne)?Math.max(1,Math.min(21,V)):Math.max(0,Math.min(20,V));function ae(ie){var ve=K,Ae=ue,Ce,Fe,ze;if(ne==="c")Ae=te(ie)+Ae,ie="";else{ie=+ie;var Ye=ie<0||1/ie<0;if(ie=isNaN(ie)?F:te(Math.abs(ie),V),ee&&(ie=i(ie)),Ye&&+ie==0&&Z!=="+"&&(Ye=!1),ve=(Ye?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+ve,Ae=(ne==="s"?T[8+a/3]:"")+Ae+(Ye&&Z==="("?")":""),H){for(Ce=-1,Fe=ie.length;++Ceze||ze>57){Ae=(ze===46?y+ie.slice(Ce+1):ie.slice(Ce))+Ae,ie=ie.slice(0,Ce);break}}}ce&&!fe&&(ie=m(ie,1/0));var it=ve.length+ie.length+Ae.length,st=it>1)+ve+ie+Ae+st.slice(it);break;default:ie=st+ve+ie+Ae;break}return I(ie)}return ae.toString=function(){return R+""},ae}function B(R,U){var j=N((R=o(R),R.type="f",R)),Z=Math.max(-8,Math.min(8,Math.floor(E(U)/3)))*3,re=Math.pow(10,-Z),fe=T[8+Z/3];return function(le){return j(re*le)+fe}}return{format:N,formatPrefix:B}}var g;x({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function x(w){return g=l(w),h.format=g.format,h.formatPrefix=g.formatPrefix,g}function A(w){return Math.max(0,-E(Math.abs(w)))}function M(w,m){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(m)/3)))*3-E(Math.abs(w)))}function _(w,m){return w=Math.abs(w),m=Math.abs(m)-w,Math.max(0,E(m)-E(w))+1}h.FormatSpecifier=n,h.formatDefaultLocale=x,h.formatLocale=l,h.formatSpecifier=o,h.precisionFixed=A,h.precisionPrefix=M,h.precisionRound=_,Object.defineProperty(h,"__esModule",{value:!0})})}}),tu=Ge({"node_modules/is-string-blank/index.js"($,G){G.exports=function(h){for(var b=h.length,S,E=0;E13)&&S!==32&&S!==133&&S!==160&&S!==5760&&S!==6158&&(S<8192||S>8205)&&S!==8232&&S!==8233&&S!==8239&&S!==8287&&S!==8288&&S!==12288&&S!==65279)return!1;return!0}}}),Pi=Ge({"node_modules/fast-isnumeric/index.js"($,G){var h=tu();G.exports=function(b){var S=typeof b;if(S==="string"){var E=b;if(b=+b,b===0&&h(E))return!1}else if(S!=="number")return!1;return b-b<1}}}),zi=Ge({"src/constants/numerical.js"($,G){G.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:"−"}}}),Si=Ge({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=typeof globalThis<"u"?globalThis:h||self,b(h["base64-arraybuffer"]={}))})($,function(h){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],a+=b[(o[n]&3)<<4|o[n+1]>>4],a+=b[(o[n+1]&15)<<2|o[n+2]>>6],a+=b[o[n+2]&63];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},t=function(r){var o=r.length*.75,n=r.length,i,a=0,s,f,c,p;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var d=new ArrayBuffer(o),T=new Uint8Array(d);for(i=0;i>4,T[a++]=(f&15)<<4|c>>2,T[a++]=(c&3)<<6|p&63;return d};h.decode=t,h.encode=e,Object.defineProperty(h,"__esModule",{value:!0})})}}),wo=Ge({"src/lib/is_plain_object.js"($,G){G.exports=function(b){return window&&window.process&&window.process.versions?Object.prototype.toString.call(b)==="[object Object]":Object.prototype.toString.call(b)==="[object Object]"&&Object.getPrototypeOf(b).hasOwnProperty("hasOwnProperty")}}}),As=Ge({"src/lib/array.js"($){var G=Si().decode,h=wo(),b=Array.isArray,S=ArrayBuffer,E=DataView;function e(s){return S.isView(s)&&!(s instanceof E)}$.isTypedArray=e;function t(s){return b(s)||e(s)}$.isArrayOrTypedArray=t;function r(s){return!t(s[0])}$.isArray1D=r,$.ensureArray=function(s,f){return b(s)||(s=[]),s.length=f,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function n(s){return s.constructor===ArrayBuffer}$.isArrayBuffer=n,$.decodeTypedArraySpec=function(s){var f=[],c=i(s),p=c.dtype,d=o[p];if(!d)throw new Error('Error in dtype: "'+p+'"');var T=d.BYTES_PER_ELEMENT,l=c.bdata;n(l)||(l=G(l));var g=c.shape===void 0?[l.byteLength/T]:(""+c.shape).split(",");g.reverse();var x=g.length,A,M,_=+g[0],w=T*_,m=0;if(x===1)f=new d(l);else if(x===2)for(A=+g[1],M=0;M2)return d[A]=d[A]|e,g.set(x,null);if(l){for(f=A;f0)return Math.log(S)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return h(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),$n=Ge({"src/lib/relink_private.js"($,G){var h=As().isArrayOrTypedArray,b=wo();G.exports=function S(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(h(r)&&h(o)&&b(r[0])){if(t==="customdata"||t==="ids")continue;for(var n=Math.min(r.length,o.length),i=0;iE/2?S-Math.round(S/E)*E:S}G.exports={mod:h,modHalf:b}}}),Bs=Ge({"node_modules/tinycolor2/tinycolor.js"($,G){(function(h){var b=/^\s+/,S=/\s+$/,E=0,e=h.round,t=h.min,r=h.max,o=h.random;function n(H,ae){if(H=H||"",ae=ae||{},H instanceof n)return H;if(!(this instanceof n))return new n(H,ae);var ie=i(H);this._originalInput=H,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.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=ie.ok,this._tc_id=E++}n.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 H=this.toRgb();return(H.r*299+H.g*587+H.b*114)/1e3},getLuminance:function(){var H=this.toRgb(),ae,ie,ve,Ae,Ce,Fe;return ae=H.r/255,ie=H.g/255,ve=H.b/255,ae<=.03928?Ae=ae/12.92:Ae=h.pow((ae+.055)/1.055,2.4),ie<=.03928?Ce=ie/12.92:Ce=h.pow((ie+.055)/1.055,2.4),ve<=.03928?Fe=ve/12.92:Fe=h.pow((ve+.055)/1.055,2.4),.2126*Ae+.7152*Ce+.0722*Fe},setAlpha:function(H){return this._a=R(H),this._roundA=e(100*this._a)/100,this},toHsv:function(){var H=c(this._r,this._g,this._b);return{h:H.h*360,s:H.s,v:H.v,a:this._a}},toHsvString:function(){var H=c(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),ve=e(H.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+ve+"%)":"hsva("+ae+", "+ie+"%, "+ve+"%, "+this._roundA+")"},toHsl:function(){var H=s(this._r,this._g,this._b);return{h:H.h*360,s:H.s,l:H.l,a:this._a}},toHslString:function(){var H=s(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),ve=e(H.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+ve+"%)":"hsla("+ae+", "+ie+"%, "+ve+"%, "+this._roundA+")"},toHex:function(H){return d(this._r,this._g,this._b,H)},toHexString:function(H){return"#"+this.toHex(H)},toHex8:function(H){return T(this._r,this._g,this._b,this._a,H)},toHex8String:function(H){return"#"+this.toHex8(H)},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(U(this._r,255)*100)+"%",g:e(U(this._g,255)*100)+"%",b:e(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%)":"rgba("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[d(this._r,this._g,this._b,!0)]||!1},toFilter:function(H){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,ve=this._gradientType?"GradientType = 1, ":"";if(H){var Ae=n(H);ie="#"+l(Ae._r,Ae._g,Ae._b,Ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+ve+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(H){var ae=!!H;H=H||this._format;var ie=!1,ve=this._a<1&&this._a>=0,Ae=!ae&&ve&&(H==="hex"||H==="hex6"||H==="hex3"||H==="hex4"||H==="hex8"||H==="name");return Ae?H==="name"&&this._a===0?this.toName():this.toRgbString():(H==="rgb"&&(ie=this.toRgbString()),H==="prgb"&&(ie=this.toPercentageRgbString()),(H==="hex"||H==="hex6")&&(ie=this.toHexString()),H==="hex3"&&(ie=this.toHexString(!0)),H==="hex4"&&(ie=this.toHex8String(!0)),H==="hex8"&&(ie=this.toHex8String()),H==="name"&&(ie=this.toName()),H==="hsl"&&(ie=this.toHslString()),H==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(H,ae){var ie=H.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(H,ae){return H.apply(null,[this].concat([].slice.call(ae)))},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(I,arguments)},triad:function(){return this._applyCombination(v,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},n.fromRatio=function(H,ae){if(typeof H=="object"){var ie={};for(var ve in H)H.hasOwnProperty(ve)&&(ve==="a"?ie[ve]=H[ve]:ie[ve]=ce(H[ve]));H=ie}return n(H,ae)};function i(H){var ae={r:0,g:0,b:0},ie=1,ve=null,Ae=null,Ce=null,Fe=!1,ze=!1;return typeof H=="string"&&(H=ue(H)),typeof H=="object"&&(K(H.r)&&K(H.g)&&K(H.b)?(ae=a(H.r,H.g,H.b),Fe=!0,ze=String(H.r).substr(-1)==="%"?"prgb":"rgb"):K(H.h)&&K(H.s)&&K(H.v)?(ve=ce(H.s),Ae=ce(H.v),ae=p(H.h,ve,Ae),Fe=!0,ze="hsv"):K(H.h)&&K(H.s)&&K(H.l)&&(ve=ce(H.s),Ce=ce(H.l),ae=f(H.h,ve,Ce),Fe=!0,ze="hsl"),H.hasOwnProperty("a")&&(ie=H.a)),ie=R(ie),{ok:Fe,format:H.format||ze,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function a(H,ae,ie){return{r:U(H,255)*255,g:U(ae,255)*255,b:U(ie,255)*255}}function s(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var ve=r(H,ae,ie),Ae=t(H,ae,ie),Ce,Fe,ze=(ve+Ae)/2;if(ve==Ae)Ce=Fe=0;else{var Ye=ve-Ae;switch(Fe=ze>.5?Ye/(2-ve-Ae):Ye/(ve+Ae),ve){case H:Ce=(ae-ie)/Ye+(ae1&&(nt-=1),nt<1/6?it+(st-it)*6*nt:nt<1/2?st:nt<2/3?it+(st-it)*(2/3-nt)*6:it}if(ae===0)ve=Ae=Ce=ie;else{var ze=ie<.5?ie*(1+ae):ie+ae-ie*ae,Ye=2*ie-ze;ve=Fe(Ye,ze,H+1/3),Ae=Fe(Ye,ze,H),Ce=Fe(Ye,ze,H-1/3)}return{r:ve*255,g:Ae*255,b:Ce*255}}function c(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var ve=r(H,ae,ie),Ae=t(H,ae,ie),Ce,Fe,ze=ve,Ye=ve-Ae;if(Fe=ve===0?0:Ye/ve,ve==Ae)Ce=0;else{switch(ve){case H:Ce=(ae-ie)/Ye+(ae>1)+720)%360;--ae;)ve.h=(ve.h+Ae)%360,Ce.push(n(ve));return Ce}function z(H,ae){ae=ae||6;for(var ie=n(H).toHsv(),ve=ie.h,Ae=ie.s,Ce=ie.v,Fe=[],ze=1/ae;ae--;)Fe.push(n({h:ve,s:Ae,v:Ce})),Ce=(Ce+ze)%1;return Fe}n.mix=function(H,ae,ie){ie=ie===0?0:ie||50;var ve=n(H).toRgb(),Ae=n(ae).toRgb(),Ce=ie/100,Fe={r:(Ae.r-ve.r)*Ce+ve.r,g:(Ae.g-ve.g)*Ce+ve.g,b:(Ae.b-ve.b)*Ce+ve.b,a:(Ae.a-ve.a)*Ce+ve.a};return n(Fe)},n.readability=function(H,ae){var ie=n(H),ve=n(ae);return(h.max(ie.getLuminance(),ve.getLuminance())+.05)/(h.min(ie.getLuminance(),ve.getLuminance())+.05)},n.isReadable=function(H,ae,ie){var ve=n.readability(H,ae),Ae,Ce;switch(Ce=!1,Ae=te(ie),Ae.level+Ae.size){case"AAsmall":case"AAAlarge":Ce=ve>=4.5;break;case"AAlarge":Ce=ve>=3;break;case"AAAsmall":Ce=ve>=7;break}return Ce},n.mostReadable=function(H,ae,ie){var ve=null,Ae=0,Ce,Fe,ze,Ye;ie=ie||{},Fe=ie.includeFallbackColors,ze=ie.level,Ye=ie.size;for(var it=0;itAe&&(Ae=Ce,ve=n(ae[it]));return n.isReadable(H,ve,{level:ze,size:Ye})||!Fe?ve:(ie.includeFallbackColors=!1,n.mostReadable(H,["#fff","#000"],ie))};var F=n.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"},N=n.hexNames=B(F);function B(H){var ae={};for(var ie in H)H.hasOwnProperty(ie)&&(ae[H[ie]]=ie);return ae}function R(H){return H=parseFloat(H),(isNaN(H)||H<0||H>1)&&(H=1),H}function U(H,ae){re(H)&&(H="100%");var ie=fe(H);return H=t(ae,r(0,parseFloat(H))),ie&&(H=parseInt(H*ae,10)/100),h.abs(H-ae)<1e-6?1:H%ae/parseFloat(ae)}function j(H){return t(1,r(0,H))}function Z(H){return parseInt(H,16)}function re(H){return typeof H=="string"&&H.indexOf(".")!=-1&&parseFloat(H)===1}function fe(H){return typeof H=="string"&&H.indexOf("%")!=-1}function le(H){return H.length==1?"0"+H:""+H}function ce(H){return H<=1&&(H=H*100+"%"),H}function V(H){return h.round(parseFloat(H)*255).toString(16)}function ee(H){return Z(H)/255}var ne=(function(){var H="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+H+")",ve="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",Ae="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+Ae),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+Ae),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+Ae),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 K(H){return!!ne.CSS_UNIT.exec(H)}function ue(H){H=H.replace(b,"").replace(S,"").toLowerCase();var ae=!1;if(F[H])H=F[H],ae=!0;else if(H=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=ne.rgb.exec(H))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=ne.rgba.exec(H))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=ne.hsl.exec(H))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=ne.hsla.exec(H))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=ne.hsv.exec(H))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=ne.hsva.exec(H))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=ne.hex8.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:ee(ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex6.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=ne.hex4.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:ee(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex3.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function te(H){var ae,ie;return H=H||{level:"AA",size:"small"},ae=(H.level||"AA").toUpperCase(),ie=(H.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=n:window.tinycolor=n})(Math)}}),Qi=Ge({"src/lib/extend.js"($){var G=wo(),h=Array.isArray;function b(E,e){var t,r;for(t=0;t=0)))return n;if(c===3)s[c]>1&&(s[c]=1);else if(s[c]>=1)return n}var p=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+p+", "+s[3]+")":"rgb("+p+")"}}}),cp=Ge({"src/constants/interactions.js"($,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),a0=Ge({"src/lib/regex.js"($){$.counter=function(G,h,b,S){var E=(h||"")+(b?"":"$"),e=S===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),J_=Ge({"src/lib/coerce.js"($){var G=Pi(),h=Bs(),b=Qi().extendFlat,S=ru(),E=n0(),e=_o(),t=cp().DESELECTDIM,r=Au(),o=a0().counter,n=xs().modHalf,i=As().isArrayOrTypedArray,a=As().isTypedArraySpec,s=As().decodeTypedArraySpec;$.valObjectMeta={data_array:{coerceFunction:function(c,p,d){p.set(i(c)?c:a(c)?s(c):d)}},enumerated:{coerceFunction:function(c,p,d,T){T.coerceNumber&&(c=+c),T.values.indexOf(c)===-1?p.set(d):p.set(c)},validateFunction:function(c,p){p.coerceNumber&&(c=+c);for(var d=p.values,T=0;Tg===!0||g===!1;l(c)||T.arrayOk&&Array.isArray(c)&&c.length>0&&c.every(l)?p.set(c):p.set(d)}},number:{coerceFunction:function(c,p,d,T){a(c)&&(c=s(c)),!G(c)||T.min!==void 0&&cT.max?p.set(d):p.set(+c)}},integer:{coerceFunction:function(c,p,d,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}a(c)&&(c=s(c)),c%1||!G(c)||T.min!==void 0&&cT.max?p.set(d):p.set(+c)}},string:{coerceFunction:function(c,p,d,T){if(typeof c!="string"){var l=typeof c=="number";T.strict===!0||!l?p.set(d):p.set(String(c))}else T.noBlank&&!c?p.set(d):p.set(c)}},color:{coerceFunction:function(c,p,d){a(c)&&(c=s(c)),h(c).isValid()?p.set(c):p.set(d)}},colorlist:{coerceFunction:function(c,p,d){function T(l){return h(l).isValid()}!Array.isArray(c)||!c.length?p.set(d):c.every(T)?p.set(c):p.set(d)}},colorscale:{coerceFunction:function(c,p,d){p.set(E.get(c,d))}},angle:{coerceFunction:function(c,p,d){a(c)&&(c=s(c)),c==="auto"?p.set("auto"):G(c)?p.set(n(+c,360)):p.set(d)}},subplotid:{coerceFunction:function(c,p,d,T){var l=T.regex||o(d);const g=x=>typeof x=="string"&&l.test(x);g(c)||T.arrayOk&&i(c)&&c.length>0&&c.every(g)?p.set(c):p.set(d)},validateFunction:function(c,p){var d=p.dflt;return c===d?!0:typeof c!="string"?!1:!!o(d).test(c)}},flaglist:{coerceFunction:function(c,p,d,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}if(typeof c!="string"){p.set(d);return}for(var l=c.split("+"),g=0;g/g),c=0;c1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},S.warn=function(){var E;if(h.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},S.error=function(){var E;if(h.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),$m=Ge({"src/lib/noop.js"($,G){G.exports=function(){}}}),Q_=Ge({"src/lib/push_unique.js"($,G){G.exports=function(b,S){if(S instanceof RegExp){for(var E=S.toString(),e=0;efo({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),$.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>fo({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),$.shapeTexttemplateAttrs=({editType:E="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:E}),$.templatefallbackAttrs=({editType:E="none"}={})=>({valType:"any",dflt:"-",editType:E})}}),td=Ge({"src/components/shapes/label_texttemplate.js"($,G){function h(g,x){return x?x.d2l(g):g}function b(g,x){return x?x.l2d(g):g}function S(g){return g.x0}function E(g){return g.x1}function e(g){return g.y0}function t(g){return g.y1}function r(g){return g.x0shift||0}function o(g){return g.x1shift||0}function n(g){return g.y0shift||0}function i(g){return g.y1shift||0}function a(g,x){return h(g.x1,x)+o(g)-h(g.x0,x)-r(g)}function s(g,x,A){return h(g.y1,A)+i(g)-h(g.y0,A)-n(g)}function f(g,x){return Math.abs(a(g,x))}function c(g,x,A){return Math.abs(s(g,x,A))}function p(g,x,A){return g.type!=="line"?void 0:Math.sqrt(Math.pow(a(g,x),2)+Math.pow(s(g,x,A),2))}function d(g,x){return b((h(g.x1,x)+o(g)+h(g.x0,x)+r(g))/2,x)}function T(g,x,A){return b((h(g.y1,A)+i(g)+h(g.y0,A)+n(g))/2,A)}function l(g,x,A){return g.type!=="line"?void 0:s(g,x,A)/a(g,x)}G.exports={x0:S,x1:E,y0:e,y1:t,slope:l,dx:a,dy:s,width:f,height:c,length:p,xcenter:d,ycenter:T}}}),Kg=Ge({"src/components/shapes/draw_newshape/attributes.js"($,G){var h=Nc().overrideAll,b=ru(),S=Hs(),E=fv().dash,e=Qi().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Al(),o=td();G.exports=h({newshape:{visible:e({},b.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},b.legend,{}),legendgroup:e({},b.legendgroup,{}),legendgrouptitle:{text:e({},b.legendgrouptitle.text,{}),font:S({})},legendrank:e({},b.legendrank,{}),legendwidth:e({},b.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},E,{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({},b.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(o)}),texttemplatefallback:r({editType:"arraydraw"}),font:S({}),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)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),Bw=Ge({"src/components/selections/draw_newselection/attributes.js"($,G){var h=fv().dash,b=Qi().extendFlat;G.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:b({},h,{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"}}}}),Nw=Ge({"src/plots/pad_attributes.js"($,G){G.exports=function(h){var b=h.editType;return{t:{valType:"number",dflt:0,editType:b},r:{valType:"number",dflt:0,editType:b},b:{valType:"number",dflt:0,editType:b},l:{valType:"number",dflt:0,editType:b},editType:b}}}}),_1=Ge({"src/plots/layout_attributes.js"($,G){var h=Hs(),b=Wg(),S=th(),E=Kg(),e=Bw(),t=Nw(),r=Qi().extendFlat,o=h({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=S.defaultLine,G.exports={font:o,title:{text:{valType:"string",editType:"layoutstyle"},font:h({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:h({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:S.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:S.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:S.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:E.newshape,activeshape:E.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},b.transition,{editType:"none"})}}}),DT=Ge({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var $=document.createElement("style");$.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",$.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild($)}})()}}),Lo=Ge({"src/registry.js"($){var G=fp(),h=$m(),b=Q_(),S=wo(),E=Zg().addStyleRule,e=Qi(),t=ru(),r=_1(),o=e.extendFlat,n=e.extendDeepAll;$.modules={},$.allCategories={},$.allTypes=[],$.subplotsRegistry={},$.componentsRegistry={},$.layoutArrayContainers=[],$.layoutArrayRegexes=[],$.traceLayoutAttributes={},$.localeRegistry={},$.apiMethodRegistry={},$.collectableSubplotTypes=null,$.register=function(x){if($.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var A=0;A=l&&F<=g?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var j=d(N),Z=F.charAt(0);j&&(Z==="G"||Z==="g")&&(F=F.slice(1),N="");var re=j&&N.slice(0,7)==="chinese",fe=F.match(re?c:f);if(!fe)return e;var le=fe[1],ce=fe[3]||"1",V=Number(fe[5]||1),ee=Number(fe[7]||0),ne=Number(fe[9]||0),K=Number(fe[11]||0);if(j){if(le.length===2)return e;le=Number(le);var ue;try{var te=a.getComponentMethod("calendars","getCal")(N);if(re){var H=ce.charAt(ce.length-1)==="i";ce=parseInt(ce,10),ue=te.newDate(le,te.toMonthIndex(le,ce,H),V)}else ue=te.newDate(le,Number(ce),V)}catch{return e}return ue?(ue.toJD()-i)*t+ee*r+ne*o+K*n:e}le.length===2?le=(Number(le)+2e3-p)%100+p:le=Number(le),ce-=1;var ae=new Date(Date.UTC(2e3,ce,V,ee,ne));return ae.setUTCFullYear(le),ae.getUTCMonth()!==ce||ae.getUTCDate()!==V?e:ae.getTime()+K*n},l=$.MIN_MS=$.dateTime2ms("-9999"),g=$.MAX_MS=$.dateTime2ms("9999-12-31 23:59:59.9999"),$.isDateTime=function(F,N){return $.dateTime2ms(F,N)!==e};function x(F,N){return String(F+Math.pow(10,N)).slice(1)}var A=90*t,M=3*r,_=5*o;$.ms2DateTime=function(F,N,B){if(typeof F!="number"||!(F>=l&&F<=g))return e;N||(N=0);var R=Math.floor(S(F+.05,1)*10),U=Math.round(F-R/10),j,Z,re,fe,le,ce;if(d(B)){var V=Math.floor(U/t)+i,ee=Math.floor(S(F,t));try{j=a.getComponentMethod("calendars","getCal")(B).fromJD(V).formatDate("yyyy-mm-dd")}catch{j=s("G%Y-%m-%d")(new Date(U))}if(j.charAt(0)==="-")for(;j.length<11;)j="-0"+j.slice(1);else for(;j.length<10;)j="0"+j;Z=N=l+t&&F<=g-t))return e;var N=Math.floor(S(F+.05,1)*10),B=new Date(Math.round(F-N/10)),R=G("%Y-%m-%d")(B),U=B.getHours(),j=B.getMinutes(),Z=B.getSeconds(),re=B.getUTCMilliseconds()*10+N;return w(R,U,j,Z,re)};function w(F,N,B,R,U){if((N||B||R||U)&&(F+=" "+x(N,2)+":"+x(B,2),(R||U)&&(F+=":"+x(R,2),U))){for(var j=4;U%10===0;)j-=1,U/=10;F+="."+x(U,j)}return F}$.cleanDate=function(F,N,B){if(F===e)return N;if($.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(d(B))return b.error("JS Dates and milliseconds are incompatible with world calendars",F),N;if(F=$.ms2DateTimeLocal(+F),!F&&N!==void 0)return N}else if(!$.isDateTime(F,B))return b.error("unrecognized date",F),N;return F};var m=/%\d?f/g,u=/%h/g,v={1:"1",2:"1",3:"2",4:"2"};function y(F,N,B,R){F=F.replace(m,function(j){var Z=Math.min(+j.charAt(1)||6,6),re=(N/1e3%1+2).toFixed(Z).slice(2).replace(/0+$/,"")||"0";return re});var U=new Date(Math.floor(N+.05));if(F=F.replace(u,function(){return v[B("%q")(U)]}),d(R))try{F=a.getComponentMethod("calendars","worldCalFmt")(F,N,R)}catch{return"Invalid"}return B(F)(U)}var I=[59,59.9,59.99,59.999,59.9999];function L(F,N){var B=S(F+.05,t),R=x(Math.floor(B/r),2)+":"+x(S(Math.floor(B/o),60),2);if(N!=="M"){h(N)||(N=0);var U=Math.min(S(F/n,60),I[N]),j=(100+U).toFixed(N).slice(1);N>0&&(j=j.replace(/0+$/,"").replace(/[\.]$/,"")),R+=":"+j}return R}$.formatDate=function(F,N,B,R,U,j){if(U=d(U)&&U,!N)if(B==="y")N=j.year;else if(B==="m")N=j.month;else if(B==="d")N=j.dayMonth+` +`+j.year;else return L(F,B)+` +`+y(j.dayMonthYear,F,R,U);return y(N,F,R,U)};var z=3*t;$.incrementMonth=function(F,N,B){B=d(B)&&B;var R=S(F,t);if(F=Math.round(F-R),B)try{var U=Math.round(F/t)+i,j=a.getComponentMethod("calendars","getCal")(B),Z=j.fromJD(U);return N%12?j.add(Z,N,"m"):j.add(Z,N/12,"y"),(Z.toJD()-i)*t+R}catch{b.error("invalid ms "+F+" in calendar "+B)}var re=new Date(F+z);return re.setUTCMonth(re.getUTCMonth()+N)+R-z},$.findExactDates=function(F,N){for(var B=0,R=0,U=0,j=0,Z,re,fe=d(N)&&a.getComponentMethod("calendars","getCal")(N),le=0;le1?(i[f-1]-i[0])/(f-1):1,d,T;for(p>=0?T=a?e:t:T=a?o:r,n+=p*E*(a?-1:1)*(p>=0?1:-1);s90&&h.log("Long binary search..."),s-1};function e(n,i){return ni}function o(n,i){return n>=i}$.sorterAsc=function(n,i){return n-i},$.sorterDes=function(n,i){return i-n},$.distinctVals=function(n){var i=n.slice();i.sort($.sorterAsc);var a;for(a=i.length-1;a>-1&&i[a]===S;a--);for(var s=i[a]-i[0]||1,f=s/(a||1)/1e4,c=[],p,d=0;d<=a;d++){var T=i[d],l=T-p;p===void 0?(c.push(T),p=T):l>f&&(s=Math.min(s,l),c.push(T),p=T)}return{vals:c,minDiff:s}},$.roundUp=function(n,i,a){for(var s=0,f=i.length-1,c,p=0,d=a?0:1,T=a?1:0,l=a?Math.ceil:Math.floor;s0&&(s=1),a&&s)return n.sort(i)}return s?n:n.reverse()},$.findIndexOfMin=function(n,i){i=i||b;for(var a=1/0,s,f=0;fE.length)&&(e=E.length),G(S)||(S=!1),h(E[0])){for(r=new Array(e),t=0;tb.length-1)return b[b.length-1];var E=S%1;return E*b[Math.ceil(S)]+(1-E)*b[Math.floor(S)]}}}),Pv=Ge({"src/lib/angles.js"($,G){var h=xs(),b=h.mod,S=h.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function n(T,l){return S(l-T,e)}function i(T,l){return Math.abs(n(T,l))}function a(T,l){if(o(l))return!0;var g,x;l[0]x&&(x+=e);var A=b(T,e),M=A+e;return A>=g&&A<=x||M>=g&&M<=x}function s(T,l,g,x){if(!a(l,x))return!1;var A,M;return g[0]=A&&T<=M}function f(T,l,g,x,A,M,_){A=A||0,M=M||0;var w=o([g,x]),m,u,v,y,I;w?(m=0,u=E,v=e):g1/3&&h.x<2/3},$.isRightAnchor=function(h){return h.xanchor==="right"||h.xanchor==="auto"&&h.x>=2/3},$.isTopAnchor=function(h){return h.yanchor==="top"||h.yanchor==="auto"&&h.y>=2/3},$.isMiddleAnchor=function(h){return h.yanchor==="middle"||h.yanchor==="auto"&&h.y>1/3&&h.y<2/3},$.isBottomAnchor=function(h){return h.yanchor==="bottom"||h.yanchor==="auto"&&h.y<=1/3}}}),OT=Ge({"src/lib/geometry2d.js"($){var G=xs().mod;$.segmentsIntersect=h;function h(t,r,o,n,i,a,s,f){var c=o-t,p=i-t,d=s-i,T=n-r,l=a-r,g=f-a,x=c*g-d*T;if(x===0)return null;var A=(p*g-d*l)/x,M=(p*T-c*l)/x;return M<0||M>1||A<0||A>1?null:{x:t+c*A,y:r+T*A}}$.segmentDistance=function(r,o,n,i,a,s,f,c){if(h(r,o,n,i,a,s,f,c))return 0;var p=n-r,d=i-o,T=f-a,l=c-s,g=p*p+d*d,x=T*T+l*l,A=Math.min(b(p,d,g,a-r,s-o),b(p,d,g,f-r,c-o),b(T,l,x,r-a,o-s),b(T,l,x,n-a,i-s));return Math.sqrt(A)};function b(t,r,o,n,i){var a=n*t+i*r;if(a<0)return n*n+i*i;if(a>o){var s=n-t,f=i-r;return s*s+f*f}else{var c=n*r-i*t;return c*c/o}}var S,E,e;$.getTextLocation=function(r,o,n,i){if((r!==E||i!==e)&&(S={},E=r,e=i),S[n])return S[n];var a=r.getPointAtLength(G(n-i/2,o)),s=r.getPointAtLength(G(n+i/2,o)),f=Math.atan((s.y-a.y)/(s.x-a.x)),c=r.getPointAtLength(G(n,o)),p=(c.x*4+a.x+s.x)/6,d=(c.y*4+a.y+s.y)/6,T={x:p,y:d,theta:f};return S[n]=T,T},$.clearLocationCache=function(){E=null},$.getVisibleSegment=function(r,o,n){var i=o.left,a=o.right,s=o.top,f=o.bottom,c=0,p=r.getTotalLength(),d=p,T,l;function g(A){var M=r.getPointAtLength(A);A===0?T=M:A===p&&(l=M);var _=M.xa?M.x-a:0,w=M.yf?M.y-f:0;return Math.sqrt(_*_+w*w)}for(var x=g(c);x;){if(c+=x+n,c>d)return;x=g(c)}for(x=g(d);x;){if(d-=x+n,c>d)return;x=g(d)}return{min:c,max:d,len:d-c,total:p,isClosed:c===0&&d===p&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},$.findPointOnPath=function(r,o,n,i){i=i||{};for(var a=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,f=i.iterationLimit||30,c=r.getPointAtLength(0)[n]>r.getPointAtLength(a)[n]?-1:1,p=0,d=0,T=a,l,g,x;p0?T=l:d=l,p++}return g}}}),C0=Ge({"src/lib/throttle.js"($){var G={};$.throttle=function(S,E,e){var t=G[S],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){n();return}t.timer=setTimeout(function(){n(),t.timer=null},E)},$.done=function(b){var S=G[b];return!S||!S.timer?Promise.resolve():new Promise(function(E){var e=S.onDone;S.onDone=function(){e&&e(),E(),S.onDone=null}})},$.clear=function(b){if(b)h(G[b]),delete G[b];else for(var S in G)$.clear(S)};function h(b){b&&b.timer!==null&&(clearTimeout(b.timer),b.timer=null)}}}),Jg=Ge({"src/lib/clear_responsive.js"($,G){G.exports=function(b){b._responsiveChartHandler&&(window.removeEventListener("resize",b._responsiveChartHandler),delete b._responsiveChartHandler)}}}),cM=Ge({"node_modules/is-mobile/index.js"($,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var h=/(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,b=/CrOS/,S=/android|ipad|playbook|silk/i;function E(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=h.test(t)&&!b.test(t)||!!e.tablet&&S.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),FT=Ge({"src/lib/preserve_drawing_buffer.js"($,G){var h=Pi(),b=cM();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=S(),typeof t!="string")return!0;var r=b({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),n=1;n-1;a--){var s=o[a];if(s.slice(0,8)==="Version/"){var f=s.slice(8).split(".")[0];if(h(f)&&(f=+f),f>=13)return!0}}}return r};function S(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),BT=Ge({"src/lib/make_trace_groups.js"($,G){var h=Mi();G.exports=function(S,E,e){var t=S.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=S.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=h.select(this)}),t}}}),fM=Ge({"src/lib/localize.js"($,G){var h=Lo();G.exports=function(S,E){for(var e=S._context.locale,t=0;t<2;t++){for(var r=S._context.locales,o=0;o<2;o++){var n=(r[e]||{}).dictionary;if(n){var i=n[E];if(i)return i}r=h.localeRegistry}var a=e.split("-")[0];if(a===e)break;e=a}return E}}}),x1=Ge({"src/lib/filter_unique.js"($,G){G.exports=function(b){for(var S={},E=[],e=0,t=0;t1?(E*b+E*S)/E:b+S,t=String(e).length;if(t>16){var r=String(S).length,o=String(b).length;if(t>=o+r){var n=parseFloat(e).toPrecision(12);n.indexOf("e+")===-1&&(e=+n)}}return e}}}),hp=Ge({"src/lib/clean_number.js"($,G){var h=Pi(),b=zi().BADNUM,S=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(S,"")),h(e)?Number(e):b}}}),gn=Ge({"src/lib/index.js"($,G){var h=Mi(),b=ji().utcFormat,S=Bo().format,E=Pi(),e=zi(),t=e.FP_SAFE,r=-t,o=e.BADNUM,n=G.exports={};n.adjustFormat=function(H){return!H||/^\d[.]\df/.test(H)||/[.]\d%/.test(H)?H:H==="0.f"?"~f":/^\d%/.test(H)?"~%":/^\ds/.test(H)?"~s":!/^[~,.0$]/.test(H)&&/[&fps]/.test(H)?"~"+H:H};var i={};n.warnBadFormat=function(te){var H=String(te);i[H]||(i[H]=1,n.warn('encountered bad format: "'+H+'"'))},n.noFormat=function(te){return String(te)},n.numberFormat=function(te){var H;try{H=S(n.adjustFormat(te))}catch{return n.warnBadFormat(te),n.noFormat}return H},n.nestedProperty=Au(),n.keyedContainer=wa(),n.relativeAttr=qa(),n.isPlainObject=wo(),n.toLogRange=ro(),n.relinkPrivateKeys=$n();var a=As();n.isArrayBuffer=a.isArrayBuffer,n.isTypedArray=a.isTypedArray,n.isArrayOrTypedArray=a.isArrayOrTypedArray,n.isArray1D=a.isArray1D,n.ensureArray=a.ensureArray,n.concat=a.concat,n.maxRowLength=a.maxRowLength,n.minRowLength=a.minRowLength;var s=xs();n.mod=s.mod,n.modHalf=s.modHalf;var f=J_();n.valObjectMeta=f.valObjectMeta,n.coerce=f.coerce,n.coerce2=f.coerce2,n.coerceFont=f.coerceFont,n.coercePattern=f.coercePattern,n.coerceHoverinfo=f.coerceHoverinfo,n.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,n.validate=f.validate;var c=Uw();n.dateTime2ms=c.dateTime2ms,n.isDateTime=c.isDateTime,n.ms2DateTime=c.ms2DateTime,n.ms2DateTimeLocal=c.ms2DateTimeLocal,n.cleanDate=c.cleanDate,n.isJSDate=c.isJSDate,n.formatDate=c.formatDate,n.incrementMonth=c.incrementMonth,n.dateTick0=c.dateTick0,n.dfltRange=c.dfltRange,n.findExactDates=c.findExactDates,n.MIN_MS=c.MIN_MS,n.MAX_MS=c.MAX_MS;var p=tm();n.findBin=p.findBin,n.sorterAsc=p.sorterAsc,n.sorterDes=p.sorterDes,n.distinctVals=p.distinctVals,n.roundUp=p.roundUp,n.sort=p.sort,n.findIndexOfMin=p.findIndexOfMin,n.sortObjectKeys=Lp();var d=$g();n.aggNums=d.aggNums,n.len=d.len,n.mean=d.mean,n.geometricMean=d.geometricMean,n.median=d.median,n.midRange=d.midRange,n.variance=d.variance,n.stdev=d.stdev,n.interp=d.interp;var T=ax();n.init2dArray=T.init2dArray,n.transposeRagged=T.transposeRagged,n.dot=T.dot,n.translationMatrix=T.translationMatrix,n.rotationMatrix=T.rotationMatrix,n.rotationXYMatrix=T.rotationXYMatrix,n.apply3DTransform=T.apply3DTransform,n.apply2DTransform=T.apply2DTransform,n.apply2DTransform2=T.apply2DTransform2,n.convertCssMatrix=T.convertCssMatrix,n.inverseTransformMatrix=T.inverseTransformMatrix;var l=Pv();n.deg2rad=l.deg2rad,n.rad2deg=l.rad2deg,n.angleDelta=l.angleDelta,n.angleDist=l.angleDist,n.isFullCircle=l.isFullCircle,n.isAngleInsideSector=l.isAngleInsideSector,n.isPtInsideSector=l.isPtInsideSector,n.pathArc=l.pathArc,n.pathSector=l.pathSector,n.pathAnnulus=l.pathAnnulus;var g=zT();n.isLeftAnchor=g.isLeftAnchor,n.isCenterAnchor=g.isCenterAnchor,n.isRightAnchor=g.isRightAnchor,n.isTopAnchor=g.isTopAnchor,n.isMiddleAnchor=g.isMiddleAnchor,n.isBottomAnchor=g.isBottomAnchor;var x=OT();n.segmentsIntersect=x.segmentsIntersect,n.segmentDistance=x.segmentDistance,n.getTextLocation=x.getTextLocation,n.clearLocationCache=x.clearLocationCache,n.getVisibleSegment=x.getVisibleSegment,n.findPointOnPath=x.findPointOnPath;var A=Qi();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var M=fp();n.log=M.log,n.warn=M.warn,n.error=M.error;var _=a0();n.counterRegex=_.counter;var w=C0();n.throttle=w.throttle,n.throttleDone=w.done,n.clearThrottle=w.clear;var m=Zg();n.getGraphDiv=m.getGraphDiv,n.isPlotDiv=m.isPlotDiv,n.removeElement=m.removeElement,n.addStyleRule=m.addStyleRule,n.addRelatedStyleRule=m.addRelatedStyleRule,n.deleteRelatedStyleRule=m.deleteRelatedStyleRule,n.setStyleOnHover=m.setStyleOnHover,n.getFullTransformMatrix=m.getFullTransformMatrix,n.getElementTransformMatrix=m.getElementTransformMatrix,n.getElementAndAncestors=m.getElementAndAncestors,n.equalDomRects=m.equalDomRects,n.clearResponsive=Jg(),n.preserveDrawingBuffer=FT(),n.makeTraceGroups=BT(),n._=fM(),n.notifier=Km(),n.filterUnique=x1(),n.filterVisible=ix(),n.pushUnique=Q_(),n.increment=L0(),n.cleanNumber=hp(),n.ensureNumber=function(H){return E(H)?(H=Number(H),H>t||H=H?!1:E(te)&&te>=0&&te%1===0},n.noop=$m(),n.identity=k0(),n.repeat=function(te,H){for(var ae=new Array(H),ie=0;ieae?Math.max(ae,Math.min(H,te)):Math.max(H,Math.min(ae,te))},n.bBoxIntersect=function(te,H,ae){return ae=ae||0,te.left<=H.right+ae&&H.left<=te.right+ae&&te.top<=H.bottom+ae&&H.top<=te.bottom+ae},n.simpleMap=function(te,H,ae,ie,ve){for(var Ae=te.length,Ce=new Array(Ae),Fe=0;Fe=Math.pow(2,ae)?ve>10?(n.warn("randstr failed uniqueness"),Ce):te(H,ae,ie,(ve||0)+1):Ce},n.OptionControl=function(te,H){te||(te={}),H||(H="opt");var ae={};return ae.optionList=[],ae._newoption=function(ie){ie[H]=te,ae[ie.name]=ie,ae.optionList.push(ie)},ae["_"+H]=te,ae},n.smooth=function(te,H){if(H=Math.round(H)||0,H<2)return te;var ae=te.length,ie=2*ae,ve=2*H-1,Ae=new Array(ve),Ce=new Array(ae),Fe,ze,Ye,it;for(Fe=0;Fe=ie&&(Ye-=ie*Math.floor(Ye/ie)),Ye<0?Ye=-1-Ye:Ye>=ae&&(Ye=ie-1-Ye),it+=te[Ye]*Ae[ze];Ce[Fe]=it}return Ce},n.syncOrAsync=function(te,H,ae){var ie,ve;function Ae(){return n.syncOrAsync(te,H,ae)}for(;te.length;)if(ve=te.splice(0,1)[0],ie=ve(H),ie&&ie.then)return ie.then(Ae);return ae&&ae(H)},n.stripTrailingSlash=function(te){return te.slice(-1)==="/"?te.slice(0,-1):te},n.noneOrAll=function(te,H,ae){if(te){var ie=!1,ve=!0,Ae,Ce;for(Ae=0;Ae0?ve:0})},n.fillArray=function(te,H,ae,ie){if(ie=ie||n.identity,n.isArrayOrTypedArray(te))for(var ve=0;veL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var te=z.exec(window.navigator.userAgent);if(te&&te.length===2){var H=parseInt(te[1]);if(!isNaN(H))return H}return null},n.isD3Selection=function(te){return te instanceof h.selection},n.ensureSingle=function(te,H,ae,ie){var ve=te.select(H+(ae?"."+ae:""));if(ve.size())return ve;var Ae=te.append(H);return ae&&Ae.classed(ae,!0),ie&&Ae.call(ie),Ae},n.ensureSingleById=function(te,H,ae,ie){var ve=te.select(H+"#"+ae);if(ve.size())return ve;var Ae=te.append(H).attr("id",ae);return ie&&Ae.call(ie),Ae},n.objectFromPath=function(te,H){for(var ae=te.split("."),ie,ve=ie={},Ae=0;Ae1?ve+Ce[1]:"";if(Ae&&(Ce.length>1||Fe.length>4||ae))for(;ie.test(Fe);)Fe=Fe.replace(ie,"$1"+Ae+"$2");return Fe+ze},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;n.templateString=function(te,H){var ae={};return te.replace(n.TEMPLATE_STRING_REGEX,function(ie,ve){var Ae;return R.test(ve)?Ae=H[ve]:(ae[ve]=ae[ve]||n.nestedProperty(H,ve).get,Ae=ae[ve](!0)),Ae!==void 0?Ae:""})};var U={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=te=>ce(So(fo({},te),{opts:U}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=te=>ce(So(fo({},te),{opts:j}));var Z=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function re(te){var H=te.match(Z);return H?{key:H[1],op:H[2],number:Number(H[3])}:{key:te,op:null,number:null}}var fe={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=te=>ce(So(fo({},te),{opts:fe}));var le=/^[:|\|]/;function ce({data:te=[],locale:H,fallback:ae,labels:ie={},opts:ve,template:Ae}){return Ae.replace(n.TEMPLATE_STRING_REGEX,(Ce,Fe,ze)=>{const Ye=["xother","yother"].includes(Fe),it=["_xother","_yother"].includes(Fe),st=["_xother_","_yother_"].includes(Fe),nt=["xother_","yother_"].includes(Fe),Qe=Ye||it||nt||st;(it||st)&&(Fe=Fe.substring(1)),(nt||st)&&(Fe=Fe.substring(0,Fe.length-1));let Le=null,Te=null;if(ve.parseMultDiv){var pe=re(Fe);Fe=pe.key,Le=pe.op,Te=pe.number}let Ne;if(Qe){if(ie[Fe]===void 0)return"";Ne=ie[Fe]}else for(const Ft of te)if(Ft){if(Ft.hasOwnProperty(Fe)){Ne=Ft[Fe];break}if(R.test(Fe)||(Ne=n.nestedProperty(Ft,Fe).get(!0)),Ne!==void 0)break}if(Ne===void 0){const{count:Ft,max:Nt,name:$t}=ve,rr=ae===!1?Ce:ae;return Ft=V&&Ce<=ee,Ye=Fe>=V&&Fe<=ee;if(ze&&(ie=10*ie+Ce-V),Ye&&(ve=10*ve+Fe-V),!ze||!Ye){if(ie!==ve)return ie-ve;if(Ce!==Fe)return Ce-Fe}}return ve-ie};var ne=2e9;n.seedPseudoRandom=function(){ne=2e9},n.pseudoRandom=function(){var te=ne;return ne=(69069*ne+1)%4294967296,Math.abs(ne-te)<429496729?n.pseudoRandom():ne/4294967296},n.fillText=function(te,H,ae){var ie=Array.isArray(ae)?function(Ce){ae.push(Ce)}:function(Ce){ae.text=Ce},ve=n.extractOption(te,H,"htx","hovertext");if(n.isValidTextValue(ve))return ie(ve);var Ae=n.extractOption(te,H,"tx","text");if(n.isValidTextValue(Ae))return ie(Ae)},n.isValidTextValue=function(te){return te||te===0},n.formatPercent=function(te,H){H=H||0;for(var ae=(Math.round(100*te*Math.pow(10,H))*Math.pow(.1,H)).toFixed(H)+"%",ie=0;ie1&&(Ye=1):Ye=0,n.strTranslate(ve-Ye*(ae+Ce),Ae-Ye*(ie+Fe))+n.strScale(Ye)+(ze?"rotate("+ze+(H?"":" "+ae+" "+ie)+")":"")},n.setTransormAndDisplay=function(te,H){te.attr("transform",n.getTextTransform(H)),te.style("display",H.scale?null:"none")},n.ensureUniformFontSize=function(te,H){var ae=n.extendFlat({},H);return ae.size=Math.max(H.size,te._fullLayout.uniformtext.minsize||0),ae},n.join2=function(te,H,ae){var ie=te.length;return ie>1?te.slice(0,-1).join(H)+ae+te[ie-1]:te.join(H)},n.bigFont=function(te){return Math.round(1.2*te)};var K=n.getFirefoxVersion(),ue=K!==null&&K<86;n.getPositionFromD3Event=function(){return ue?[h.event.layerX,h.event.layerY]:[h.event.offsetX,h.event.offsetY]}}}),hM=Ge({"build/plotcss.js"(){var $=gn(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border: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(b in G)h=b.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),$.addStyleRule(h,G[b]);var h,b}}),ox=Ge({"node_modules/is-browser/client.js"($,G){G.exports=!0}}),jw=Ge({"node_modules/has-hover/index.js"($,G){var h=ox(),b;typeof window.matchMedia=="function"?b=!window.matchMedia("(hover: none)").matches:b=h,G.exports=b}}),P0=Ge({"node_modules/events/events.js"($,G){var h=typeof Reflect=="object"?Reflect:null,b=h&&typeof h.apply=="function"?h.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},S;h&&typeof h.ownKeys=="function"?S=h.ownKeys:Object.getOwnPropertySymbols?S=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:S=function(M){return Object.getOwnPropertyNames(M)};function E(A){console&&console.warn&&console.warn(A)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if(typeof A!="number"||A<0||e(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),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(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function n(A){return A._maxListeners===void 0?t.defaultMaxListeners:A._maxListeners}t.prototype.getMaxListeners=function(){return n(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(v=_[0]),v instanceof Error)throw v;var y=new Error("Unhandled error."+(v?" ("+v.message+")":""));throw y.context=v,y}var I=u[M];if(I===void 0)return!1;if(typeof I=="function")b(I,this,_);else for(var L=I.length,z=p(I,L),w=0;w0&&v.length>m&&!v.warned){v.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=A,y.type=M,y.count=v.length,E(y)}return A}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function a(){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(A,M,_){var w={fired:!1,wrapFn:void 0,target:A,type:M,listener:_},m=a.bind(w);return m.listener=_,w.wrapFn=m,m}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,m,u,v,y;if(o(_),m=this._events,m===void 0)return this;if(w=m[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete m[M],m.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,v=w.length-1;v>=0;v--)if(w[v]===_||w[v].listener===_){y=w[v].listener,u=v;break}if(u<0)return this;u===0?w.shift():d(w,u),w.length===1&&(m[M]=w[0]),m.removeListener!==void 0&&this.emit("removeListener",M,y||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,m;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),v;for(m=0;m=0;m--)this.removeListener(M,_[m]);return this};function f(A,M,_){var w=A._events;if(w===void 0)return[];var m=w[M];return m===void 0?[]:typeof m=="function"?_?[m.listener||m]:[m]:_?T(m):p(m,m.length)}t.prototype.listeners=function(M){return f(this,M,!0)},t.prototype.rawListeners=function(M){return f(this,M,!1)},t.listenerCount=function(A,M){return typeof A.listenerCount=="function"?A.listenerCount(M):c.call(A,M)},t.prototype.listenerCount=c;function c(A){var M=this._events;if(M!==void 0){var _=M[A];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?S(this._events):[]};function p(A,M){for(var _=new Array(M),w=0;w{},{passive:!0}),S},triggerHandler:function(S,E,e){var t,r=S._ev;if(!r)return;var o=r._events[E];if(!o)return;function n(a){if(a.listener){if(r.removeListener(E,a.listener),!a.fired)return a.fired=!0,a.listener.apply(r,[e])}else return a.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ib.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=R.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var U=z[F];if(!x(U))return!1;L=R[B][U]}else L=R[B]}else L=R}}return L}function x(L){return L===Math.round(L)&&L>=0}function A(L){var z,F;z=G.modules[L]._module,F=z.basePlotModule;var N={};N.type=null;var B=o({},b),R=o({},z.attributes);$.crawl(R,function(Z,re,fe,le,ce){a(B,ce).set(void 0),Z===void 0&&a(R,ce).set(void 0)}),o(N,B),G.traceIs(L,"noOpacity")&&delete N.opacity,G.traceIs(L,"showLegend")||(delete N.showlegend,delete N.legendgroup),G.traceIs(L,"noHover")&&(delete N.hoverinfo,delete N.hoverlabel),z.selectPoints||delete N.selectedpoints,o(N,R),F.attributes&&o(N,F.attributes),N.type=L;var U={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:w(N)};if(z.layoutAttributes){var j={};o(j,z.layoutAttributes),U.layoutAttributes=w(j)}return z.animatable||$.crawl(U,function(Z){$.isValObject(Z)&&"anim"in Z&&delete Z.anim}),U}function M(){var L={},z,F;o(L,S);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var N=0;N=n&&(o._input||{})._templateitemname;a&&(i=n);var s=r+"["+i+"]",f;function c(){f={},a&&(f[s]={},f[s][b]=a)}c();function p(g,x){f[g]=x}function d(g,x){a?G.nestedProperty(f[s],g).set(x):f[s+"."+g]=x}function T(){var g=f;return c(),g}function l(g,x){g&&d(g,x);var A=T();for(var M in A)G.nestedProperty(t,M).set(A[M])}return{modifyBase:p,modifyItem:d,getUpdateObj:T,applyUpdate:l}}}}),rh=Ge({"src/plots/cartesian/constants.js"($,G){var h=a0().counter;G.exports={idRegex:{x:h("x","( domain)?"),y:h("y","( domain)?")},attrRegex:h("[xy]axis"),xAxisMatch:h("xaxis"),yAxisMatch:h("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"}}}),Cf=Ge({"src/plots/cartesian/axis_ids.js"($){var G=Lo(),h=rh();$.id2name=function(E){if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))){var e=E.split(" ")[0].slice(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},$.name2id=function(E){if(E.match(h.AX_NAME_PATTERN)){var e=E.slice(5);return e==="1"&&(e=""),E.charAt(0)+e}},$.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},$.list=function(S,E,e){var t=S._fullLayout;if(!t)return[];var r=$.listIds(S,E),o=new Array(r.length),n;for(n=0;nt?1:-1:+(S.slice(1)||1)-+(E.slice(1)||1)},$.ref2id=function(S){return/^[xyz]/.test(S)?S.split(" ")[0]:!1};function b(S,E){if(E&&E.length){for(var e=0;e0?".":"")+a;h.isPlainObject(s)?t(s,o,f,i+1):o(f,a,s)}})}}}),Wc=Ge({"src/plots/plots.js"($,G){var h=Mi(),b=ji().timeFormatLocale,S=Bo().formatLocale,E=Pi(),e=Si(),t=Lo(),r=Qg(),o=pu(),n=gn(),i=_o(),a=zi().BADNUM,s=Cf(),f=rm().clearOutline,c=nm(),p=Wg(),d=sx(),T=Rv().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,x=G.exports={};n.extendFlat(x,t),x.attributes=ru(),x.attributes.type.values=x.allTypes,x.fontAttrs=Hs(),x.layoutAttributes=_1();var A=NT();x.executeAPICommand=A.executeAPICommand,x.computeAPICommandBindings=A.computeAPICommandBindings,x.manageCommandObserver=A.manageCommandObserver,x.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,x.redrawText=function(V){return V=n.getGraphDiv(V),new Promise(function(ee){setTimeout(function(){V._fullLayout&&(t.getComponentMethod("annotations","draw")(V),t.getComponentMethod("legend","draw")(V),t.getComponentMethod("colorbar","draw")(V),ee(x.previousPromises(V)))},300)})},x.resize=function(V){V=n.getGraphDiv(V);var ee,ne=new Promise(function(K,ue){(!V||n.isHidden(V))&&ue(new Error("Resize must be passed a displayed plot div element.")),V._redrawTimer&&clearTimeout(V._redrawTimer),V._resolveResize&&(ee=V._resolveResize),V._resolveResize=K,V._redrawTimer=setTimeout(function(){if(!V.layout||V.layout.width&&V.layout.height||n.isHidden(V)){K(V);return}delete V.layout.width,delete V.layout.height;var te=V.changed;V.autoplay=!0,t.call("relayout",V,{autosize:!0}).then(function(){V.changed=te,V._resolveResize===K&&(delete V._resolveResize,K(V))})},100)});return ee&&ee(ne),ne},x.previousPromises=function(V){if((V._promises||[]).length)return Promise.all(V._promises).then(function(){V._promises=[]})},x.addLinks=function(V){if(!(!V._context.showLink&&!V._context.showSources)){var ee=V._fullLayout,ne=n.ensureSingle(ee._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var ve=h.select(this);ve.append("tspan").classed("js-link-to-tool",!0),ve.append("tspan").classed("js-link-spacer",!0),ve.append("tspan").classed("js-sourcelinks",!0)})}),K=ne.node(),ue={y:ee._paper.attr("height")-9};document.body.contains(K)&&K.getComputedTextLength()>=ee.width-20?(ue["text-anchor"]="start",ue.x=5):(ue["text-anchor"]="end",ue.x=ee._paper.attr("width")-7),ne.attr(ue);var te=ne.select(".js-link-to-tool"),H=ne.select(".js-link-spacer"),ae=ne.select(".js-sourcelinks");V._context.showSources&&V._context.showSources(V),V._context.showLink&&M(V,te),H.text(te.text()&&ae.text()?" - ":"")}};function M(V,ee){ee.text("");var ne=ee.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(V._context.linkText+" »");if(V._context.sendData)ne.on("click",function(){x.sendDataToCloud(V)});else{var K=window.location.pathname.split("/"),ue=window.location.search;ne.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+K[2].split(".")[0]+"/"+K[1]+ue})}}x.sendDataToCloud=function(V){var ee=(window.PLOTLYENV||{}).BASE_URL||V._context.plotlyServerURL;if(ee){V.emit("plotly_beforeexport");var ne=h.select(V).append("div").attr("id","hiddenform").style("display","none"),K=ne.append("form").attr({action:ee+"/external",method:"post",target:"_blank"}),ue=K.append("input").attr({type:"text",name:"data"});return ue.node().value=x.graphJson(V,!1,"keepdata"),K.node().submit(),ne.remove(),V.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];x.supplyDefaults=function(V,ee){var ne=ee&&ee.skipUpdateCalc,K=V._fullLayout||{};if(K._skipDefaults){delete K._skipDefaults;return}var ue=V._fullLayout={},te=V.layout||{},H=V._fullData||[],ae=V._fullData=[],ie=V.data||[],ve=V.calcdata||[],Ae=V._context||{},Ce;V._transitionData||x.createTransitionData(V),ue._dfltTitle={plot:g(V,"Click to enter Plot title"),subtitle:g(V,"Click to enter Plot subtitle"),x:g(V,"Click to enter X axis title"),y:g(V,"Click to enter Y axis title"),colorbar:g(V,"Click to enter Colorscale title"),annotation:g(V,"new text")},ue._traceWord=g(V,"trace");var Fe=v(V,_);if(ue._mapboxAccessToken=Ae.mapboxAccessToken,K._initialAutoSizeIsDone){var ze=K.width,Ye=K.height;x.supplyLayoutGlobalDefaults(te,ue,Fe),te.width||(ue.width=ze),te.height||(ue.height=Ye),x.sanitizeMargins(ue)}else{x.supplyLayoutGlobalDefaults(te,ue,Fe);var it=!te.width||!te.height,st=ue.autosize,nt=Ae.autosizable,Qe=it&&(st||nt);Qe?x.plotAutoSize(V,te,ue):it&&x.sanitizeMargins(ue),!st&&it&&(te.width=ue.width,te.height=ue.height)}ue._d3locale=y(Fe,ue.separators),ue._extraFormat=v(V,w),ue._initialAutoSizeIsDone=!0,ue._dataLength=ie.length,ue._modules=[],ue._visibleModules=[],ue._basePlotModules=[];var Le=ue._subplots=u(),Te=ue._splomAxes={x:{},y:{}},pe=ue._splomSubplots={};ue._splomGridDflt={},ue._scatterStackOpts={},ue._firstScatter={},ue._alignmentOpts={},ue._colorAxes={},ue._requestRangeslider={},ue._traceUids=m(H,ie),x.supplyDataDefaults(ie,ae,te,ue);var Ne=Object.keys(Te.x),ot=Object.keys(Te.y);if(Ne.length>1&&ot.length>1){for(t.getComponentMethod("grid","sizeDefaults")(te,ue),Ce=0;Ce15&&ot.length>15&&ue.shapes.length===0&&ue.images.length===0,x.linkSubplots(ae,ue,H,K),x.cleanPlot(ae,ue,H,K);var $t=!!(K._has&&K._has("cartesian")),rr=!!(ue._has&&ue._has("cartesian")),Mr=$t,Sr=rr;Mr&&!Sr?K._bgLayer.remove():Sr&&!Mr&&(ue._shouldCreateBgLayer=!0),K._zoomlayer&&!V._dragging&&f({_fullLayout:K}),I(ae,ue),l(ue,K),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,ue),ue._preGUI||(ue._preGUI={}),ue._tracePreGUI||(ue._tracePreGUI={});var Zr=ue._tracePreGUI,Ar={},Br;for(Br in Zr)Ar[Br]="old";for(Ce=0;Ce0){var Ae=1-2*te;H=Math.round(Ae*H),ae=Math.round(Ae*ae)}}var Ce=x.layoutAttributes.width.min,Fe=x.layoutAttributes.height.min;H1,Ye=!ne.height&&Math.abs(K.height-ae)>1;(Ye||ze)&&(ze&&(K.width=H),Ye&&(K.height=ae)),ee._initialAutoSize||(ee._initialAutoSize={width:H,height:ae}),x.sanitizeMargins(K)},x.supplyLayoutModuleDefaults=function(V,ee,ne,K){var ue=t.componentsRegistry,te=ee._basePlotModules,H,ae,ie,ve=t.subplotsRegistry.cartesian;for(H in ue)ie=ue[H],ie.includeBasePlot&&ie.includeBasePlot(V,ee);te.length||te.push(ve),ee._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(V,ee),ve.finalizeSubplots(V,ee));for(var Ae in ee._subplots)ee._subplots[Ae].sort(n.subplotSort);for(ae=0;ae1&&(ne.l/=st,ne.r/=st)}if(Fe){var nt=(ne.t+ne.b)/Fe;nt>1&&(ne.t/=nt,ne.b/=nt)}var Qe=ne.xl!==void 0?ne.xl:ne.x,Le=ne.xr!==void 0?ne.xr:ne.x,Te=ne.yt!==void 0?ne.yt:ne.y,pe=ne.yb!==void 0?ne.yb:ne.y;ze[ee]={l:{val:Qe,size:ne.l+it},r:{val:Le,size:ne.r+it},b:{val:pe,size:ne.b+it},t:{val:Te,size:ne.t+it}},Ye[ee]=1}if(!K._replotting)return x.doAutoMargin(V)}};function R(V){if("_redrawFromAutoMarginCount"in V._fullLayout)return!1;var ee=s.list(V,"",!0);for(var ne in ee)if(ee[ne].autoshift||ee[ne].shift)return!0;return!1}x.doAutoMargin=function(V){var ee=V._fullLayout,ne=ee.width,K=ee.height;ee._size||(ee._size={}),F(ee);var ue=ee._size,te=ee.margin,H={t:0,b:0,l:0,r:0},ae=n.extendFlat({},ue),ie=te.l,ve=te.r,Ae=te.t,Ce=te.b,Fe=ee._pushmargin,ze=ee._pushmarginIds,Ye=ee.minreducedwidth,it=ee.minreducedheight;if(te.autoexpand!==!1){for(var st in Fe)ze[st]||delete Fe[st];var nt=V._fullLayout._reservedMargin;for(var Qe in nt)for(var Le in nt[Qe]){var Te=nt[Qe][Le];H[Le]=Math.max(H[Le],Te)}Fe.base={l:{val:0,size:ie},r:{val:1,size:ve},t:{val:1,size:Ae},b:{val:0,size:Ce}};for(var pe in H){var Ne=0;for(var ot in Fe)ot!=="base"&&E(Fe[ot][pe].size)&&(Ne=Fe[ot][pe].size>Ne?Fe[ot][pe].size:Ne);var ct=Math.max(0,te[pe]-Ne);H[pe]=Math.max(0,H[pe]-ct)}for(var rt in Fe){var Ft=Fe[rt].l||{},Nt=Fe[rt].b||{},$t=Ft.val,rr=Ft.size,Mr=Nt.val,Sr=Nt.size,Zr=ne-H.r-H.l,Ar=K-H.t-H.b;for(var Br in Fe){if(E(rr)&&Fe[Br].r){var Mt=Fe[Br].r.val,je=Fe[Br].r.size;if(Mt>$t){var $e=(rr*Mt+(je-Zr)*$t)/(Mt-$t),Ee=(je*(1-$t)+(rr-Zr)*(1-Mt))/(Mt-$t);$e+Ee>ie+ve&&(ie=$e,ve=Ee)}}if(E(Sr)&&Fe[Br].t){var xe=Fe[Br].t.val,ye=Fe[Br].t.size;if(xe>Mr){var Me=(Sr*xe+(ye-Ar)*Mr)/(xe-Mr),Xe=(ye*(1-Mr)+(Sr-Ar)*(1-xe))/(xe-Mr);Me+Xe>Ce+Ae&&(Ce=Me,Ae=Xe)}}}}}var Je=n.constrain(ne-te.l-te.r,N,Ye),Lt=n.constrain(K-te.t-te.b,B,it),Ct=Math.max(0,ne-Je),Ot=Math.max(0,K-Lt);if(Ct){var Wt=(ie+ve)/Ct;Wt>1&&(ie/=Wt,ve/=Wt)}if(Ot){var _r=(Ce+Ae)/Ot;_r>1&&(Ce/=_r,Ae/=_r)}if(ue.l=Math.round(ie)+H.l,ue.r=Math.round(ve)+H.r,ue.t=Math.round(Ae)+H.t,ue.b=Math.round(Ce)+H.b,ue.p=Math.round(te.pad),ue.w=Math.round(ne)-ue.l-ue.r,ue.h=Math.round(K)-ue.t-ue.b,!ee._replotting&&(x.didMarginChange(ae,ue)||R(V))){"_redrawFromAutoMarginCount"in ee?ee._redrawFromAutoMarginCount++:ee._redrawFromAutoMarginCount=1;var pr=3*(1+Object.keys(ze).length);if(ee._redrawFromAutoMarginCount1)return!0}return!1},x.graphJson=function(V,ee,ne,K,ue,te){(ue&&ee&&!V._fullData||ue&&!ee&&!V._fullLayout)&&x.supplyDefaults(V);var H=ue?V._fullData:V.data,ae=ue?V._fullLayout:V.layout,ie=(V._transitionData||{})._frames;function ve(Fe,ze){if(typeof Fe=="function")return ze?"_function_":null;if(n.isPlainObject(Fe)){var Ye={},it;return Object.keys(Fe).sort().forEach(function(Le){if(["_","["].indexOf(Le.charAt(0))===-1){if(typeof Fe[Le]=="function"){ze&&(Ye[Le]="_function");return}if(ne==="keepdata"){if(Le.slice(-3)==="src")return}else if(ne==="keepstream"){if(it=Fe[Le+"src"],typeof it=="string"&&it.indexOf(":")>0&&!n.isPlainObject(Fe.stream))return}else if(ne!=="keepall"&&(it=Fe[Le+"src"],typeof it=="string"&&it.indexOf(":")>0))return;Ye[Le]=ve(Fe[Le],ze)}}),Ye}var st=Array.isArray(Fe),nt=n.isTypedArray(Fe);if((st||nt)&&Fe.dtype&&Fe.shape){var Qe=Fe.bdata;return ve({dtype:Fe.dtype,shape:Fe.shape,bdata:n.isArrayBuffer(Qe)?e.encode(Qe):Qe},ze)}return st?Fe.map(function(Le){return ve(Le,ze)}):nt?n.simpleMap(Fe,n.identity):n.isJSDate(Fe)?n.ms2DateTimeLocal(+Fe):Fe}var Ae={data:(H||[]).map(function(Fe){var ze=ve(Fe);return ee&&delete ze.fit,ze})};if(!ee&&(Ae.layout=ve(ae),ue)){var Ce=ae._size;Ae.layout.computed={margin:{b:Ce.b,l:Ce.l,r:Ce.r,t:Ce.t}}}return ie&&(Ae.frames=ve(ie)),te&&(Ae.config=ve(V._context,!0)),K==="object"?Ae:JSON.stringify(Ae)},x.modifyFrames=function(V,ee){var ne,K,ue,te=V._transitionData._frames,H=V._transitionData._frameHash;for(ne=0;ne0&&(V._transitioningWithDuration=!0),V._transitionData._interruptCallbacks.push(function(){K=!0}),ne.redraw&&V._transitionData._interruptCallbacks.push(function(){return t.call("redraw",V)}),V._transitionData._interruptCallbacks.push(function(){V.emit("plotly_transitioninterrupted",[])});var Fe=0,ze=0;function Ye(){return Fe++,function(){ze++,!K&&ze===Fe&&ae(Ce)}}ne.runFn(Ye),setTimeout(Ye())})}function ae(Ce){if(V._transitionData)return te(V._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ne.redraw)return t.call("redraw",V)}).then(function(){V._transitioning=!1,V._transitioningWithDuration=!1,V.emit("plotly_transitioned",[])}).then(Ce)}function ie(){if(V._transitionData)return V._transitioning=!1,ue(V._transitionData._interruptCallbacks)}var ve=[x.previousPromises,ie,ne.prepareFn,x.rehover,x.reselect,H],Ae=n.syncOrAsync(ve,V);return(!Ae||!Ae.then)&&(Ae=Promise.resolve()),Ae.then(function(){return V})}x.doCalcdata=function(V,ee){var ne=s.list(V),K=V._fullData,ue=V._fullLayout,te,H,ae,ie,ve=new Array(K.length),Ae=(V.calcdata||[]).slice();for(V.calcdata=ve,ue._numBoxes=0,ue._numViolins=0,ue._violinScaleGroupStats={},V._hmpixcount=0,V._hmlumcount=0,ue._piecolormap={},ue._sunburstcolormap={},ue._treemapcolormap={},ue._iciclecolormap={},ue._funnelareacolormap={},ae=0;ae=0;ie--)if(pe[ie].enabled){te._indexToPoints=pe[ie]._indexToPoints;break}H&&H.calc&&(Te=H.calc(V,te))}(!Array.isArray(Te)||!Te[0])&&(Te=[{x:a,y:a}]),Te[0].t||(Te[0].t={}),Te[0].trace=te,ve[Qe]=Te}}for(le(ne,K,ue),ae=0;aeae||ze>ie)&&(te.style("overflow","hidden"),Ce=te.node().getBoundingClientRect(),Fe=Ce.width,ze=Ce.height);var Ye=+B.attr("x"),it=+B.attr("y"),st=V||B.node().getBoundingClientRect().height,nt=-st/4;if(fe[0]==="y")H.attr({transform:"rotate("+[-90,Ye,it]+")"+b(-Fe/2,nt-ze/2)});else if(fe[0]==="l")it=nt-ze/2;else if(fe[0]==="a"&&fe.indexOf("atitle")!==0)Ye=0,it=nt;else{var Qe=B.attr("text-anchor");Ye=Ye-Fe*(Qe==="middle"?.5:Qe==="end"?1:0),it=it+nt-ze/2}te.attr({x:Ye,y:it}),U&&U.call(B,H),ce(H)})})):le(),B};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(B){return B.replace(t,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function i(B,R,U){var j=parseInt((MathJax.version||"").split(".")[0]);if(j!==2&&j!==3){h.warn("No MathJax version:",MathJax.version);return}var Z,re,fe,le,ce=function(){return re=h.extendDeepAll({},MathJax.Hub.config),fe=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},V=function(){re=h.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ee=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},ne=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},K=function(){var ve="math-output-"+h.randstr({},64);le=G.select("body").append("div").attr({id:ve}).style({visibility:"hidden",position:"absolute","font-size":R.fontSize+"px"}).text(o(B));var Ae=le.node();return j===2?MathJax.Hub.Typeset(Ae):MathJax.typeset([Ae])},ue=function(){var ve=le.select(j===2?".MathJax_SVG":".MathJax"),Ae=!ve.empty()&&le.select("svg").node();if(!Ae)h.log("There was an error in the tex syntax.",B),U();else{var Ce=Ae.getBoundingClientRect(),Fe;j===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=ve.select("defs"),U(ve,Fe,Ce)}le.remove()},te=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},H=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return fe!==void 0&&(MathJax.Hub.processSectionDelay=fe),MathJax.Hub.Config(re)},ie=function(){MathJax.config=re};j===2?MathJax.Hub.Queue(ce,ee,K,ue,te,ae):j===3&&(V(),ne(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){K(),ue(),H(),ie()}))}var a={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"},f={sub:"-0.21em",sup:"0.42em"},c="​",p=["http:","https:","mailto:","",void 0,":"],d=$.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=//i;$.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(B,R){if(!B)return null;var U=B.match(R),j=U&&(U[3]||U[4]);return j&&y(j)}var m=/(^|;)\s*color:/;$.plainText=function(B,R){R=R||{};for(var U=R.len!==void 0&&R.len!==-1?R.len:1/0,j=R.allowedTags!==void 0?R.allowedTags:["br"],Z="...",re=Z.length,fe=B.split(T),le=[],ce="",V=0,ee=0;eere?le.push(ne.slice(0,Math.max(0,H-re))+Z):le.push(ne.slice(0,H));break}ce=""}}return le.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},v=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function y(B){return B.replace(v,function(R,U){var j;return U.charAt(0)==="#"?j=I(U.charAt(1)==="x"?parseInt(U.slice(2),16):parseInt(U.slice(1),10)):j=u[U],j||R})}$.convertEntities=y;function I(B){if(!(B>1114111)){var R=String.fromCodePoint;if(R)return R(B);var U=String.fromCharCode;return B<=65535?U(B):U((B>>10)+55232,B%1024+56320)}}function L(B,R){R=R.replace(d," ");var U=!1,j=[],Z,re=-1;function fe(){re++;var ze=document.createElementNS(S.svg,"tspan");G.select(ze).attr({class:"line",dy:re*E+"em"}),B.appendChild(ze),Z=ze;var Ye=j;if(j=[{node:ze}],Ye.length>1)for(var it=1;it.",R);return}var Ye=j.pop();ze!==Ye.type&&h.log("Start tag <"+Ye.type+"> doesnt match end tag <"+ze+">. Pretending it did match.",R),Z=j[j.length-1].node}var ee=g.test(R);ee?fe():(Z=B,j=[{node:B}]);for(var ne=R.split(T),K=0;K=0;g--,x++){var A=d[g];l[x]=[1-A[0],A[1]]}return l}function f(d,T){T=T||{};for(var l=d.domain,g=d.range,x=g.length,A=new Array(x),M=0;Md-c?c=d-(p-d):p-d=0?g=o.colorscale.sequential:g=o.colorscale.sequentialminus,s._sync("colorscale",g)}}}}),Tc=Ge({"src/components/colorscale/index.js"($,G){var h=n0(),b=hv();G.exports={moduleType:"component",name:"colorscale",attributes:Pu(),layoutAttributes:Qm(),supplyLayoutDefaults:UT(),handleDefaults:vh(),crossTraceDefaults:cx(),calc:dv(),scales:h.scales,defaultScale:h.defaultScale,getScale:h.get,isValidScale:h.isValid,hasColorscale:b.hasColorscale,extractOpts:b.extractOpts,extractScale:b.extractScale,flipScale:b.flipScale,makeColorScaleFunc:b.makeColorScaleFunc,makeColorScaleFuncFromTrace:b.makeColorScaleFuncFromTrace}}}),iu=Ge({"src/traces/scatter/subtypes.js"($,G){var h=gn(),b=As().isTypedArraySpec;G.exports={hasLines:function(S){return S.visible&&S.mode&&S.mode.indexOf("lines")!==-1},hasMarkers:function(S){return S.visible&&(S.mode&&S.mode.indexOf("markers")!==-1||S.type==="splom")},hasText:function(S){return S.visible&&S.mode&&S.mode.indexOf("text")!==-1},isBubble:function(S){var E=S.marker;return h.isPlainObject(E)&&(h.isArrayOrTypedArray(E.size)||b(E.size))}}}}),Rp=Ge({"src/traces/scatter/make_bubble_size_func.js"($,G){var h=Pi();G.exports=function(S,E){E||(E=2);var e=S.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(n){return Math.sqrt(n/t)}:function(n){return n/t};return function(n){var i=o(n/E);return h(i)&&i>0?Math.max(i,r):0}}}}),Vv=Ge({"src/components/fx/helpers.js"($){var G=gn();$.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},$.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],n=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([n].concat(i.splice(0,2))),a="l",n=n=="m"?"l":"L");;){if(i.length==h[a])return i.unshift(n),r.push(i);if(i.length0&&(Te=100,Le=Le.replace("-open","")),Le.indexOf("-dot")>0&&(Te+=200,Le=Le.replace("-dot","")),Le=l.symbolNames.indexOf(Le),Le>=0&&(Le+=Te)}return Le%100>=m||Le>=400?0:Math.floor(Math.max(Le,0))};function v(Le,Te,pe,Ne){var ot=Le%100;return l.symbolFuncs[ot](Te,pe,Ne)+(Le>=200?u:"")}var y=S("~f"),I={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(Le,Te,pe,Ne,ot,ct){var rt=I[Ne];return L(Le,Te,pe,rt.type,ot,ct,rt.start,rt.stop,!1,rt.reversed)};function L(Le,Te,pe,Ne,ot,ct,rt,Ft,Nt,$t){var rr=ot.length,Mr;Ne==="linear"?Mr={node:"linearGradient",attrs:{x1:rt.x,y1:rt.y,x2:Ft.x,y2:Ft.y,gradientUnits:Nt?"userSpaceOnUse":"objectBoundingBox"},reversed:$t}:Ne==="radial"&&(Mr={node:"radialGradient",reversed:$t});for(var Sr=new Array(rr),Zr=0;Zr=0&&Le.i===void 0&&(Le.i=ct.i),Te.style("opacity",Ne.selectedOpacityFn?Ne.selectedOpacityFn(Le):Le.mo===void 0?rt.opacity:Le.mo),Ne.ms2mrc){var Nt;Le.ms==="various"||rt.size==="various"?Nt=3:Nt=Ne.ms2mrc(Le.ms),Le.mrc=Nt,Ne.selectedSizeFn&&(Nt=Le.mrc=Ne.selectedSizeFn(Le));var $t=l.symbolNumber(Le.mx||rt.symbol)||0;Le.om=$t%200>=100;var rr=Qe(Le,pe),Mr=ae(Le,pe);Te.attr("d",v($t,Nt,rr,Mr))}var Sr=!1,Zr,Ar,Br;if(Le.so)Br=Ft.outlierwidth,Ar=Ft.outliercolor,Zr=rt.outliercolor;else{var Mt=(Ft||{}).width;Br=(Le.mlw+1||Mt+1||(Le.trace?(Le.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Le?Ar=Le.mlcc=Ne.lineScale(Le.mlc):b.isArrayOrTypedArray(Ft.color)?Ar=r.defaultLine:Ar=Ft.color,b.isArrayOrTypedArray(rt.color)&&(Zr=r.defaultLine,Sr=!0),"mc"in Le?Zr=Le.mcc=Ne.markerScale(Le.mc):Zr=rt.color||rt.colors||"rgba(0,0,0,0)",Ne.selectedColorFn&&(Zr=Ne.selectedColorFn(Le))}if(Le.om)Te.call(r.stroke,Zr).style({"stroke-width":(Br||1)+"px",fill:"none"});else{Te.style("stroke-width",(Le.isBlank?0:Br)+"px");var je=rt.gradient,$e=Le.mgt;$e?Sr=!0:$e=je&&je.type,b.isArrayOrTypedArray($e)&&($e=$e[0],I[$e]||($e=0));var Ee=rt.pattern,xe=l.getPatternAttr,ye=Ee&&(xe(Ee.shape,Le.i,"")||xe(Ee.path,Le.i,""));if($e&&$e!=="none"){var Me=Le.mgc;Me?Sr=!0:Me=je.color;var Xe=pe.uid;Sr&&(Xe+="-"+Le.i),l.gradient(Te,ot,Xe,$e,[[0,Me],[1,Zr]],"fill")}else if(ye){var Je=!1,Lt=Ee.fgcolor;!Lt&&ct&&ct.color&&(Lt=ct.color,Je=!0);var Ct=xe(Lt,Le.i,ct&&ct.color||null),Ot=xe(Ee.bgcolor,Le.i,null),Wt=Ee.fgopacity,_r=xe(Ee.size,Le.i,8),pr=xe(Ee.solidity,Le.i,.3);Je=Je||Le.mcc||b.isArrayOrTypedArray(Ee.shape)||b.isArrayOrTypedArray(Ee.path)||b.isArrayOrTypedArray(Ee.bgcolor)||b.isArrayOrTypedArray(Ee.fgcolor)||b.isArrayOrTypedArray(Ee.size)||b.isArrayOrTypedArray(Ee.solidity);var hr=pe.uid;Je&&(hr+="-"+Le.i),l.pattern(Te,"point",ot,hr,ye,_r,pr,Le.mcc,Ee.fillmode,Ot,Ct,Wt)}else b.isArrayOrTypedArray(Zr)?r.fill(Te,Zr[Le.i]):r.fill(Te,Zr);Br&&r.stroke(Te,Ar)}},l.makePointStyleFns=function(Le){var Te={},pe=Le.marker;return Te.markerScale=l.tryColorscale(pe,""),Te.lineScale=l.tryColorscale(pe,"line"),t.traceIs(Le,"symbols")&&(Te.ms2mrc=p.isBubble(Le)?d(Le):function(){return(pe.size||6)/2}),Le.selectedpoints&&b.extendFlat(Te,l.makeSelectedPointStyleFns(Le)),Te},l.makeSelectedPointStyleFns=function(Le){var Te={},pe=Le.selected||{},Ne=Le.unselected||{},ot=Le.marker||{},ct=pe.marker||{},rt=Ne.marker||{},Ft=ot.opacity,Nt=ct.opacity,$t=rt.opacity,rr=Nt!==void 0,Mr=$t!==void 0;(b.isArrayOrTypedArray(Ft)||rr||Mr)&&(Te.selectedOpacityFn=function(xe){var ye=xe.mo===void 0?ot.opacity:xe.mo;return xe.selected?rr?Nt:ye:Mr?$t:c*ye});var Sr=ot.color,Zr=ct.color,Ar=rt.color;(Zr||Ar)&&(Te.selectedColorFn=function(xe){var ye=xe.mcc||Sr;return xe.selected?Zr||ye:Ar||ye});var Br=ot.size,Mt=ct.size,je=rt.size,$e=Mt!==void 0,Ee=je!==void 0;return t.traceIs(Le,"symbols")&&($e||Ee)&&(Te.selectedSizeFn=function(xe){var ye=xe.mrc||Br/2;return xe.selected?$e?Mt/2:ye:Ee?je/2:ye}),Te},l.makeSelectedTextStyleFns=function(Le){var Te={},pe=Le.selected||{},Ne=Le.unselected||{},ot=Le.textfont||{},ct=pe.textfont||{},rt=Ne.textfont||{},Ft=ot.color,Nt=ct.color,$t=rt.color;return Te.selectedTextColorFn=function(rr){var Mr=rr.tc||Ft;return rr.selected?Nt||Mr:$t||(Nt?Mr:r.addOpacity(Mr,c))},Te},l.selectedPointStyle=function(Le,Te){if(!(!Le.size()||!Te.selectedpoints)){var pe=l.makeSelectedPointStyleFns(Te),Ne=Te.marker||{},ot=[];pe.selectedOpacityFn&&ot.push(function(ct,rt){ct.style("opacity",pe.selectedOpacityFn(rt))}),pe.selectedColorFn&&ot.push(function(ct,rt){r.fill(ct,pe.selectedColorFn(rt))}),pe.selectedSizeFn&&ot.push(function(ct,rt){var Ft=rt.mx||Ne.symbol||0,Nt=pe.selectedSizeFn(rt);ct.attr("d",v(l.symbolNumber(Ft),Nt,Qe(rt,Te),ae(rt,Te))),rt.mrc2=Nt}),ot.length&&Le.each(function(ct){for(var rt=h.select(this),Ft=0;Ft0?pe:0}l.textPointStyle=function(Le,Te,pe){if(Le.size()){var Ne;if(Te.selectedpoints){var ot=l.makeSelectedTextStyleFns(Te);Ne=ot.selectedTextColorFn}var ct=Te.texttemplate,rt=pe._fullLayout;Le.each(function(Ft){var Nt=h.select(this),$t=ct?b.extractOption(Ft,Te,"txt","texttemplate"):b.extractOption(Ft,Te,"tx","text");if(!$t&&$t!==0){Nt.remove();return}if(ct){var rr=Te._module.formatLabels,Mr=rr?rr(Ft,Te,rt):{},Sr={};T(Sr,Te,Ft.i),$t=b.texttemplateString({data:[Sr,Ft,Te._meta],fallback:Te.texttemplatefallback,labels:Mr,locale:rt._d3locale,template:$t})}var Zr=Ft.tp||Te.textposition,Ar=N(Ft,Te),Br=Ne?Ne(Ft):Ft.tc||Te.textfont.color;Nt.call(l.font,{family:Ft.tf||Te.textfont.family,weight:Ft.tw||Te.textfont.weight,style:Ft.ty||Te.textfont.style,variant:Ft.tv||Te.textfont.variant,textcase:Ft.tC||Te.textfont.textcase,lineposition:Ft.tE||Te.textfont.lineposition,shadow:Ft.tS||Te.textfont.shadow,size:Ar,color:Br}).text($t).call(i.convertToTspans,pe).call(F,Zr,Ar,Ft.mrc)})}},l.selectedTextStyle=function(Le,Te){if(!(!Le.size()||!Te.selectedpoints)){var pe=l.makeSelectedTextStyleFns(Te);Le.each(function(Ne){var ot=h.select(this),ct=pe.selectedTextColorFn(Ne),rt=Ne.tp||Te.textposition,Ft=N(Ne,Te);r.fill(ot,ct);var Nt=t.traceIs(Te,"bar-like");F(ot,rt,Ft,Ne.mrc2||Ne.mrc,Nt)})}};var B=.5;l.smoothopen=function(Le,Te){if(Le.length<3)return"M"+Le.join("L");var pe="M"+Le[0],Ne=[],ot;for(ot=1;ot=Nt||xe>=rr&&xe<=Nt)&&(ye<=Mr&&ye>=$t||ye>=Mr&&ye<=$t)&&(Le=[xe,ye])}return Le}l.applyBackoff=V,l.makeTester=function(){var Le=b.ensureSingleById(h.select("body"),"svg","js-plotly-tester",function(pe){pe.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Te=b.ensureSingle(Le,"path","js-reference-point",function(pe){pe.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Le,l.testref=Te},l.savedBBoxes={};var ee=0,ne=1e4;l.bBox=function(Le,Te,pe){pe||(pe=K(Le));var Ne;if(pe){if(Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}else if(Le.childNodes.length===1){var ot=Le.childNodes[0];if(pe=K(ot),pe){var ct=+ot.getAttribute("x")||0,rt=+ot.getAttribute("y")||0,Ft=ot.getAttribute("transform");if(!Ft){var Nt=l.bBox(ot,!1,pe);return ct&&(Nt.left+=ct,Nt.right+=ct),rt&&(Nt.top+=rt,Nt.bottom+=rt),Nt}if(pe+="~"+ct+"~"+rt+"~"+Ft,Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}}var $t,rr;Te?$t=Le:(rr=l.tester.node(),$t=Le.cloneNode(!0),rr.appendChild($t)),h.select($t).attr("transform",null).call(i.positionText,0,0);var Mr=$t.getBoundingClientRect(),Sr=l.testref.node().getBoundingClientRect();Te||rr.removeChild($t);var Zr={height:Mr.height,width:Mr.width,left:Mr.left-Sr.left,top:Mr.top-Sr.top,right:Mr.right-Sr.left,bottom:Mr.bottom-Sr.top};return ee>=ne&&(l.savedBBoxes={},ee=0),pe&&(l.savedBBoxes[pe]=Zr),ee++,b.extendFlat({},Zr)};function K(Le){var Te=Le.getAttribute("data-unformatted");if(Te!==null)return Te+Le.getAttribute("data-math")+Le.getAttribute("text-anchor")+Le.getAttribute("style")}l.setClipUrl=function(Le,Te,pe){Le.attr("clip-path",ue(Te,pe))};function ue(Le,Te){if(!Le)return null;var pe=Te._context,Ne=pe._exportedPlot?"":pe._baseUrl||"";return Ne?"url('"+Ne+"#"+Le+"')":"url(#"+Le+")"}l.getTranslate=function(Le){var Te=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,pe=Le.attr?"attr":"getAttribute",Ne=Le[pe]("transform")||"",ot=Ne.replace(Te,function(ct,rt,Ft){return[rt,Ft].join(" ")}).split(" ");return{x:+ot[0]||0,y:+ot[1]||0}},l.setTranslate=function(Le,Te,pe){var Ne=/(\btranslate\(.*?\);?)/,ot=Le.attr?"attr":"getAttribute",ct=Le.attr?"attr":"setAttribute",rt=Le[ot]("transform")||"";return Te=Te||0,pe=pe||0,rt=rt.replace(Ne,"").trim(),rt+=n(Te,pe),rt=rt.trim(),Le[ct]("transform",rt),rt},l.getScale=function(Le){var Te=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,pe=Le.attr?"attr":"getAttribute",Ne=Le[pe]("transform")||"",ot=Ne.replace(Te,function(ct,rt,Ft){return[rt,Ft].join(" ")}).split(" ");return{x:+ot[0]||1,y:+ot[1]||1}},l.setScale=function(Le,Te,pe){var Ne=/(\bscale\(.*?\);?)/,ot=Le.attr?"attr":"getAttribute",ct=Le.attr?"attr":"setAttribute",rt=Le[ot]("transform")||"";return Te=Te||1,pe=pe||1,rt=rt.replace(Ne,"").trim(),rt+="scale("+Te+","+pe+")",rt=rt.trim(),Le[ct]("transform",rt),rt};var te=/\s*sc.*/;l.setPointGroupScale=function(Le,Te,pe){if(Te=Te||1,pe=pe||1,!!Le){var Ne=Te===1&&pe===1?"":"scale("+Te+","+pe+")";Le.each(function(){var ot=(this.getAttribute("transform")||"").replace(te,"");ot+=Ne,ot=ot.trim(),this.setAttribute("transform",ot)})}};var H=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Le,Te,pe){Le&&Le.each(function(){var Ne,ot=h.select(this),ct=ot.select("text");if(ct.node()){var rt=parseFloat(ct.attr("x")||0),Ft=parseFloat(ct.attr("y")||0),Nt=(ot.attr("transform")||"").match(H);Te===1&&pe===1?Ne=[]:Ne=[n(rt,Ft),"scale("+Te+","+pe+")",n(-rt,-Ft)],Nt&&Ne.push(Nt),ot.attr("transform",Ne.join(""))}})};function ae(Le,Te){var pe;return Le&&(pe=Le.mf),pe===void 0&&(pe=Te.marker&&Te.marker.standoff||0),!Te._geo&&!Te._xA?-pe:pe}l.getMarkerStandoff=ae;var ie=Math.atan2,ve=Math.cos,Ae=Math.sin;function Ce(Le,Te){var pe=Te[0],Ne=Te[1];return[pe*ve(Le)-Ne*Ae(Le),pe*Ae(Le)+Ne*ve(Le)]}var Fe,ze,Ye,it,st,nt;function Qe(Le,Te){var pe=Le.ma;pe===void 0&&(pe=Te.marker.angle,(!pe||b.isArrayOrTypedArray(pe))&&(pe=0));var Ne,ot,ct=Te.marker.angleref;if(ct==="previous"||ct==="north"){if(Te._geo){var rt=Te._geo.project(Le.lonlat);Ne=rt[0],ot=rt[1]}else{var Ft=Te._xA,Nt=Te._yA;if(Ft&&Nt)Ne=Ft.c2p(Le.x),ot=Nt.c2p(Le.y);else return 90}if(Te._geo){var $t=Le.lonlat[0],rr=Le.lonlat[1],Mr=Te._geo.project([$t,rr+1e-5]),Sr=Te._geo.project([$t+1e-5,rr]),Zr=ie(Sr[1]-ot,Sr[0]-Ne),Ar=ie(Mr[1]-ot,Mr[0]-Ne),Br;if(ct==="north")Br=pe/180*Math.PI;else if(ct==="previous"){var Mt=$t/180*Math.PI,je=rr/180*Math.PI,$e=Fe/180*Math.PI,Ee=ze/180*Math.PI,xe=$e-Mt,ye=ve(Ee)*Ae(xe),Me=Ae(Ee)*ve(je)-ve(Ee)*Ae(je)*ve(xe);Br=-ie(ye,Me)-Math.PI,Fe=$t,ze=rr}var Xe=Ce(Zr,[ve(Br),0]),Je=Ce(Ar,[Ae(Br),0]);pe=ie(Xe[1]+Je[1],Xe[0]+Je[0])/Math.PI*180,ct==="previous"&&!(nt===Te.uid&&Le.i===st+1)&&(pe=null)}if(ct==="previous"&&!Te._geo)if(nt===Te.uid&&Le.i===st+1&&E(Ne)&&E(ot)){var Lt=Ne-Ye,Ct=ot-it,Ot=Te.line&&Te.line.shape||"",Wt=Ot.slice(Ot.length-1);Wt==="h"&&(Ct=0),Wt==="v"&&(Lt=0),pe+=ie(Ct,Lt)/Math.PI*180+90}else pe=null}return Ye=Ne,it=ot,st=Le.i,nt=Te.uid,pe}l.getMarkerAngle=Qe}}),im=Ge({"src/components/titles/index.js"($,G){var h=Mi(),b=Pi(),S=Wc(),E=Lo(),e=gn(),t=e.strTranslate,r=Ss(),o=_o(),n=Ju(),i=cp(),a=Qh().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,c=1.6;function p(d,T,l){var g=d._fullLayout,x=l.propContainer,A=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},m=l.attributes,u=l.transform,v=l.containerGroup,y=1,I=x.title,L=(I&&I.text?I.text:"").trim(),z=!1,F=I&&I.font?I.font:{},N=F.family,B=F.size,R=F.color,U=F.weight,j=F.style,Z=F.variant,re=F.textcase,fe=F.lineposition,le=F.shadow,ce=l.subtitlePropName,V=!!ce,ee=l.subtitlePlaceholder,ne=(x.title||{}).subtitle||{text:"",font:{}},K=(ne.text||"").trim(),ue=!1,te=1,H=ne.font,ae=H.family,ie=H.size,ve=H.color,Ae=H.weight,Ce=H.style,Fe=H.variant,ze=H.textcase,Ye=H.lineposition,it=H.shadow,st;A==="title.text"?st="titleText":A.indexOf("axis")!==-1?st="axisTitleText":A.indexOf("colorbar")!==-1&&(st="colorbarTitleText");var nt=d._context.edits[st];function Qe(Sr,Zr){return Sr===void 0||Zr===void 0?!1:Sr.replace(s," % ")===Zr.replace(s," % ")}L===""?y=0:Qe(L,M)&&(nt||(L=""),y=.2,z=!0),V&&(K===""?te=0:Qe(K,ee)&&(nt||(K=""),te=.2,ue=!0)),l._meta?L=e.templateString(L,l._meta):g._meta&&(L=e.templateString(L,g._meta));var Le=L||K||nt,Te;v||(v=e.ensureSingle(g._infolayer,"g","g-"+T),Te=g._hColorbarMoveTitle);var pe=v.selectAll("text."+T).data(Le?[0]:[]);pe.enter().append("text"),pe.text(L).attr("class",T),pe.exit().remove();var Ne=null,ot=T+"-subtitle",ct=K||nt;if(V&&(Ne=v.selectAll("text."+ot).data(ct?[0]:[]),Ne.enter().append("text"),Ne.text(K).attr("class",ot),Ne.exit().remove()),!Le)return v;function rt(Sr,Zr){e.syncOrAsync([Ft,Nt],{title:Sr,subtitle:Zr})}function Ft(Sr){var Zr=Sr.title,Ar=Sr.subtitle,Br;!u&&Te&&(u={}),u?(Br="",u.rotate&&(Br+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||Te)&&(Br+=t(0,(u.offset||0)-(Te||0)))):Br=null,Zr.attr("transform",Br);function Mt(Me){if(Me){var Xe=h.select(Me.node().parentNode).select("."+ot);if(!Xe.empty()){var Je=Me.node().getBBox();if(Je.height){var Lt=Je.y+Je.height+f*ie;Xe.attr("y",Lt)}}}}if(Zr.style("opacity",y*o.opacity(R)).call(r.font,{color:o.rgb(R),size:h.round(B,2),family:N,weight:U,style:j,variant:Z,textcase:re,shadow:le,lineposition:fe}).attr(m).call(n.convertToTspans,d,Mt),Ar&&!Ar.empty()){var je=v.select("."+T+"-math-group"),$e=Zr.node().getBBox(),Ee=je.node()?je.node().getBBox():void 0,xe=Ee?Ee.y+Ee.height+f*ie:$e.y+$e.height+c*ie,ye=e.extendFlat({},m,{y:xe});Ar.attr("transform",Br),Ar.style("opacity",te*o.opacity(ve)).call(r.font,{color:o.rgb(ve),size:h.round(ie,2),family:ae,weight:Ae,style:Ce,variant:Fe,textcase:ze,shadow:it,lineposition:Ye}).attr(ye).call(n.convertToTspans,d)}return S.previousPromises(d)}function Nt(Sr){var Zr=Sr.title,Ar=h.select(Zr.node().parentNode);if(w&&w.selection&&w.side&&L){Ar.attr("transform",null);var Br=a[w.side],Mt=w.side==="left"||w.side==="top"?-1:1,je=b(w.pad)?w.pad:2,$e=r.bBox(Ar.node()),Ee={t:0,b:0,l:0,r:0},xe=d._fullLayout._reservedMargin;for(var ye in xe)for(var Me in xe[ye]){var Xe=xe[ye][Me];Ee[Me]=Math.max(Ee[Me],Xe)}var Je={left:Ee.l,top:Ee.t,right:g.width-Ee.r,bottom:g.height-Ee.b},Lt=w.maxShift||Mt*(Je[w.side]-$e[w.side]),Ct=0;if(Lt<0)Ct=Lt;else{var Ot=w.offsetLeft||0,Wt=w.offsetTop||0;$e.left-=Ot,$e.right-=Ot,$e.top-=Wt,$e.bottom-=Wt,w.selection.each(function(){var pr=r.bBox(this);e.bBoxIntersect($e,pr,je)&&(Ct=Math.max(Ct,Mt*(pr[w.side]-$e[Br])+je))}),Ct=Math.min(Lt,Ct),x._titleScoot=Math.abs(Ct)}if(Ct>0||Lt<0){var _r={left:[-Ct,0],right:[Ct,0],top:[0,-Ct],bottom:[0,Ct]}[w.side];Ar.attr("transform",t(_r[0],_r[1]))}}}pe.call(rt,Ne);function $t(Sr,Zr){Sr.text(Zr).on("mouseover.opacity",function(){h.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){h.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(nt&&(L?pe.on(".opacity",null):($t(pe,M),z=!0),pe.call(n.makeEditable,{gd:d}).on("edit",function(Sr){_!==void 0?E.call("_guiRestyle",d,A,Sr,_):E.call("_guiRelayout",d,A,Sr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(rt)}).on("input",function(Sr){this.text(Sr||" ").call(n.positionText,m.x,m.y)}),V)){if(V&&!L){var rr=pe.node().getBBox(),Mr=rr.y+rr.height+c*ie;Ne.attr("y",Mr)}K?Ne.on(".opacity",null):($t(Ne,ee),ue=!0),Ne.call(n.makeEditable,{gd:d}).on("edit",function(Sr){E.call("_guiRelayout",d,"title.subtitle.text",Sr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(rt)}).on("input",function(Sr){this.text(Sr||" ").call(n.positionText,Ne.attr("x"),Ne.attr("y"))})}return pe.classed("js-placeholder",z),Ne&&!Ne.empty()&&Ne.classed("js-placeholder",ue),v}G.exports={draw:p,SUBTITLE_PADDING_EM:c,SUBTITLE_PADDING_MATHJAX_EM:f}}}),Kd=Ge({"src/plots/cartesian/set_convert.js"($,G){var h=Mi(),b=ji().utcFormat,S=gn(),E=S.numberFormat,e=Pi(),t=S.cleanNumber,r=S.ms2DateTime,o=S.dateTime2ms,n=S.ensureNumber,i=S.isArrayOrTypedArray,a=zi(),s=a.FP_SAFE,f=a.BADNUM,c=a.LOG_CLIP,p=a.ONEWEEK,d=a.ONEDAY,T=a.ONEHOUR,l=a.ONEMIN,g=a.ONESEC,x=Cf(),A=rh(),M=A.HOUR_PATTERN,_=A.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function m(u){return u!=null}G.exports=function(v,y){y=y||{};var I=v._id||"x",L=I.charAt(0);function z(K,ue){if(K>0)return Math.log(K)/Math.LN10;if(K<=0&&ue&&v.range&&v.range.length===2){var te=v.range[0],H=v.range[1];return .5*(te+H-2*c*Math.abs(te-H))}else return f}function F(K,ue,te,H){if((H||{}).msUTC&&e(K))return+K;var ae=o(K,te||v.calendar);if(ae===f)if(e(K)){K=+K;var ie=Math.floor(S.mod(K+.05,1)*10),ve=Math.round(K-ie/10);ae=o(new Date(ve))+ie/10}else return f;return ae}function N(K,ue,te){return r(K,ue,te||v.calendar)}function B(K){return v._categories[Math.round(K)]}function R(K){if(m(K)){if(v._categoriesMap===void 0&&(v._categoriesMap={}),v._categoriesMap[K]!==void 0)return v._categoriesMap[K];v._categories.push(typeof K=="number"?String(K):K);var ue=v._categories.length-1;return v._categoriesMap[K]=ue,ue}return f}function U(K,ue){for(var te=new Array(ue),H=0;Hv.range[1]&&(te=!te);for(var H=te?-1:1,ae=H*K,ie=0,ve=0;veCe)ie=ve+1;else{ie=ae<(Ae+Ce)/2?ve:ve+1;break}}var Fe=v._B[ie]||0;return isFinite(Fe)?fe(K,v._m2,Fe):0},V=function(K){var ue=v._rangebreaks.length;if(!ue)return le(K,v._m,v._b);for(var te=0,H=0;Hv._rangebreaks[H].pmax&&(te=H+1);return le(K,v._m2,v._B[te])}}v.c2l=v.type==="log"?z:n,v.l2c=v.type==="log"?w:n,v.l2p=ce,v.p2l=V,v.c2p=v.type==="log"?function(K,ue){return ce(z(K,ue))}:ce,v.p2c=v.type==="log"?function(K){return w(V(K))}:V,["linear","-"].indexOf(v.type)!==-1?(v.d2r=v.r2d=v.d2c=v.r2c=v.d2l=v.r2l=t,v.c2d=v.c2r=v.l2d=v.l2r=n,v.d2p=v.r2p=function(K){return v.l2p(t(K))},v.p2d=v.p2r=V,v.cleanPos=n):v.type==="log"?(v.d2r=v.d2l=function(K,ue){return z(t(K),ue)},v.r2d=v.r2c=function(K){return w(t(K))},v.d2c=v.r2l=t,v.c2d=v.l2r=n,v.c2r=z,v.l2d=w,v.d2p=function(K,ue){return v.l2p(v.d2r(K,ue))},v.p2d=function(K){return w(V(K))},v.r2p=function(K){return v.l2p(t(K))},v.p2r=V,v.cleanPos=n):v.type==="date"?(v.d2r=v.r2d=S.identity,v.d2c=v.r2c=v.d2l=v.r2l=F,v.c2d=v.c2r=v.l2d=v.l2r=N,v.d2p=v.r2p=function(K,ue,te){return v.l2p(F(K,0,te))},v.p2d=v.p2r=function(K,ue,te){return N(V(K),ue,te)},v.cleanPos=function(K){return S.cleanDate(K,f,v.calendar)}):v.type==="category"?(v.d2c=v.d2l=R,v.r2d=v.c2d=v.l2d=B,v.d2r=v.d2l_noadd=Z,v.r2c=function(K){var ue=re(K);return ue!==void 0?ue:v.fraction2r(.5)},v.l2r=v.c2r=n,v.r2l=re,v.d2p=function(K){return v.l2p(v.r2c(K))},v.p2d=function(K){return B(V(K))},v.r2p=v.d2p,v.p2r=V,v.cleanPos=function(K){return typeof K=="string"&&K!==""?K:n(K)}):v.type==="multicategory"&&(v.r2d=v.c2d=v.l2d=B,v.d2r=v.d2l_noadd=Z,v.r2c=function(K){var ue=Z(K);return ue!==void 0?ue:v.fraction2r(.5)},v.r2c_just_indices=j,v.l2r=v.c2r=n,v.r2l=Z,v.d2p=function(K){return v.l2p(v.r2c(K))},v.p2d=function(K){return B(V(K))},v.r2p=v.d2p,v.p2r=V,v.cleanPos=function(K){return Array.isArray(K)||typeof K=="string"&&K!==""?K:n(K)},v.setupMultiCategory=function(K){var ue=v._traceIndices,te,H,ae=v._matchGroup;if(ae&&v._categories.length===0){for(var ie in ae)if(ie!==I){var ve=y[x.id2name(ie)];ue=ue.concat(ve._traceIndices)}}var Ae=[[0,{}],[0,{}]],Ce=[];for(te=0;teve[1]&&(H[ie?0:1]=te),H[0]===H[1]){var Ae=v.l2r(ue),Ce=v.l2r(te);if(ue!==void 0){var Fe=Ae+1;te!==void 0&&(Fe=Math.min(Fe,Ce)),H[ie?1:0]=Fe}if(te!==void 0){var ze=Ce+1;ue!==void 0&&(ze=Math.max(ze,Ae)),H[ie?0:1]=ze}}}},v.cleanRange=function(K,ue){v._cleanRange(K,ue),v.limitRange(K)},v._cleanRange=function(K,ue){ue||(ue={}),K||(K="range");var te=S.nestedProperty(v,K).get(),H,ae;if(v.type==="date"?ae=S.dfltRange(v.calendar):L==="y"?ae=A.DFLTRANGEY:v._name==="realaxis"?ae=[0,1]:ae=ue.dfltRange||A.DFLTRANGEX,ae=ae.slice(),(v.rangemode==="tozero"||v.rangemode==="nonnegative")&&(ae[0]=0),!te||te.length!==2){S.nestedProperty(v,K).set(ae);return}var ie=te[0]===null,ve=te[1]===null;for(v.type==="date"&&!v.autorange&&(te[0]=S.cleanDate(te[0],f,v.calendar),te[1]=S.cleanDate(te[1],f,v.calendar)),H=0;H<2;H++)if(v.type==="date"){if(!S.isDateTime(te[H],v.calendar)){v[K]=ae;break}if(v.r2l(te[0])===v.r2l(te[1])){var Ae=S.constrain(v.r2l(te[0]),S.MIN_MS+1e3,S.MAX_MS-1e3);te[0]=v.l2r(Ae-1e3),te[1]=v.l2r(Ae+1e3);break}}else{if(!e(te[H]))if(!(ie||ve)&&e(te[1-H]))te[H]=te[1-H]*(H?10:.1);else{v[K]=ae;break}if(te[H]<-s?te[H]=-s:te[H]>s&&(te[H]=s),te[0]===te[1]){var Ce=Math.max(1,Math.abs(te[0]*1e-6));te[0]-=Ce,te[1]+=Ce}}},v.setScale=function(K){var ue=y._size;if(v.overlaying){var te=x.getFromId({_fullLayout:y},v.overlaying);v.domain=te.domain}var H=K&&v._r?"_r":"range",ae=v.calendar;v.cleanRange(H);var ie=v.r2l(v[H][0],ae),ve=v.r2l(v[H][1],ae),Ae=L==="y";if(Ae?(v._offset=ue.t+(1-v.domain[1])*ue.h,v._length=ue.h*(v.domain[1]-v.domain[0]),v._m=v._length/(ie-ve),v._b=-v._m*ve):(v._offset=ue.l+v.domain[0]*ue.w,v._length=ue.w*(v.domain[1]-v.domain[0]),v._m=v._length/(ve-ie),v._b=-v._m*ie),v._rangebreaks=[],v._lBreaks=0,v._m2=0,v._B=[],v.rangebreaks){var Ce,Fe;if(v._rangebreaks=v.locateBreaks(Math.min(ie,ve),Math.max(ie,ve)),v._rangebreaks.length){for(Ce=0;Ceve&&(ze=!ze),ze&&v._rangebreaks.reverse();var Ye=ze?-1:1;for(v._m2=Ye*v._length/(Math.abs(ve-ie)-v._lBreaks),v._B.push(-v._m2*(Ae?ve:ie)),Ce=0;Ceae&&(ae+=7,ieae&&(ae+=24,ie=H&&ie=H&&K=rt.min&&(pert.max&&(rt.max=Ne),ot=!1)}ot&&ve.push({min:pe,max:Ne})}};for(te=0;teg*2}function a(c){return Math.max(1,(c-1)/1e3)}function s(c,p){for(var d=c.length,T=a(d),l=0,g=0,x={},A=0;Al*2}function f(c){return E(c[0])&&E(c[1])}}}),Ip=Ge({"src/plots/cartesian/autorange.js"($,G){var h=Mi(),b=Pi(),S=gn(),E=zi().FP_SAFE,e=Lo(),t=Ss(),r=Cf(),o=r.getFromId,n=r.isLinked;G.exports={applyAutorangeOptions:v,getAutoRange:i,makePadFn:s,doAutoRange:d,findExtremes:T,concatExtremes:p};function i(y,I){var L,z,F=[],N=y._fullLayout,B=s(N,I,0),R=s(N,I,1),U=p(y,I),j=U.min,Z=U.max;if(j.length===0||Z.length===0)return S.simpleMap(I.range,I.r2l);var re=j[0].val,fe=Z[0].val;for(L=1;L0&&(Ce=ue-B(ae)-R(ie),Ce>te?Fe/Ce>H&&(ve=ae,Ae=ie,H=Fe/Ce):Fe/ue>H&&(ve={val:ae.val,nopad:1},Ae={val:ie.val,nopad:1},H=Fe/ue));function ze(Qe,Le){return Math.max(Qe,R(Le))}if(re===fe){var Ye=re-1,it=re+1;if(ne)if(re===0)F=[0,1];else{var st=(re>0?Z:j).reduce(ze,0),nt=re/(1-Math.min(.5,st/ue));F=re>0?[0,nt]:[nt,0]}else K?F=[Math.max(0,Ye),Math.max(1,it)]:F=[Ye,it]}else ne?(ve.val>=0&&(ve={val:0,nopad:1}),Ae.val<=0&&(Ae={val:0,nopad:1})):K&&(ve.val-H*B(ve)<0&&(ve={val:0,nopad:1}),Ae.val<=0&&(Ae={val:1,nopad:1})),H=(Ae.val-ve.val-a(I,ae.val,ie.val))/(ue-B(ve)-R(Ae)),F=[ve.val-H*B(ve),Ae.val+H*R(Ae)];return F=v(F,I),I.limitRange&&I.limitRange(),ce&&F.reverse(),S.simpleMap(F,I.l2r||Number)}function a(y,I,L){var z=0;if(y.rangebreaks)for(var F=y.locateBreaks(I,L),N=0;N0?L.ppadplus:L.ppadminus)||L.ppad||0),ae=te((y._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),ie=te(L.vpadplus||L.vpad),ve=te(L.vpadminus||L.vpad);if(!j){if(K=1/0,ue=-1/0,U)for(re=0;re0&&(K=fe),fe>ue&&fe-E&&(K=fe),fe>ue&&fe=Fe;re--)Ce(re);return{min:z,max:F,opts:L}}function l(y,I,L,z){x(y,I,L,z,M)}function g(y,I,L,z){x(y,I,L,z,_)}function x(y,I,L,z,F){for(var N=z.tozero,B=z.extrapad,R=!0,U=0;U=L&&(j.extrapad||!B)){R=!1;break}else F(I,j.val)&&j.pad<=L&&(B||!j.extrapad)&&(y.splice(U,1),U--)}if(R){var Z=N&&I===0;y.push({val:I,pad:Z?0:L,extrapad:Z?!1:B})}}function A(y){return b(y)&&Math.abs(y)=I}function w(y,I){var L=I.autorangeoptions;return L&&L.minallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(I,L.clipmin,L.clipmax)?Math.max(y,I.d2l(L.clipmin)):y}function m(y,I){var L=I.autorangeoptions;return L&&L.maxallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(I,L.clipmin,L.clipmax)?Math.min(y,I.d2l(L.clipmax)):y}function u(y,I,L){return I!==void 0&&L!==void 0?(I=y.d2l(I),L=y.d2l(L),I=U&&(N=U,L=U),B<=U&&(B=U,z=U)}}return L=w(L,I),z=m(z,I),[L,z]}}}),ws=Ge({"src/plots/cartesian/axes.js"($,G){var h=Mi(),b=Pi(),S=Wc(),E=Lo(),e=gn(),t=e.strTranslate,r=Ju(),o=im(),n=_o(),i=Ss(),a=ev(),s=lx(),f=zi(),c=f.ONEMAXYEAR,p=f.ONEAVGYEAR,d=f.ONEMINYEAR,T=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,g=f.ONEMINQUARTER,x=f.ONEMAXMONTH,A=f.ONEAVGMONTH,M=f.ONEMINMONTH,_=f.ONEWEEK,w=f.ONEDAY,m=w/2,u=f.ONEHOUR,v=f.ONEMIN,y=f.ONESEC,I=f.ONEMILLI,L=f.ONEMICROSEC,z=f.MINUS_SIGN,F=f.BADNUM,N={K:"zeroline"},B={K:"gridline",L:"path"},R={K:"minor-gridline",L:"path"},U={K:"tick",L:"path"},j={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},re=Qh(),fe=re.MID_SHIFT,le=re.CAP_SHIFT,ce=re.LINE_SPACING,V=re.OPPOSITE_SIDE,ee=3,ne=G.exports={};ne.setConvert=Kd();var K=om(),ue=Cf(),te=ue.idSort,H=ue.isLinked;ne.id2name=ue.id2name,ne.name2id=ue.name2id,ne.cleanId=ue.cleanId,ne.list=ue.list,ne.listIds=ue.listIds,ne.getFromId=ue.getFromId,ne.getFromTrace=ue.getFromTrace;var ae=Ip();ne.getAutoRange=ae.getAutoRange,ne.findExtremes=ae.findExtremes;var ie=1e-4;function ve(Dt){var yt=(Dt[1]-Dt[0])*ie;return[Dt[0]-yt,Dt[1]+yt]}ne.coerceRef=function(Dt,yt,Er,Nr,jr,Ir){var Ur=Nr.charAt(Nr.length-1),sn=Er._fullLayout._subplots[Ur+"axis"],Kr=Nr+"ref",Tt={};return jr||(jr=sn[0]||(typeof Ir=="string"?Ir:Ir[0])),Ir||(Ir=jr),sn=sn.concat(sn.map(function(or){return or+" domain"})),Tt[Kr]={valType:"enumerated",values:sn.concat(Ir?typeof Ir=="string"?[Ir]:Ir:[]),dflt:jr},e.coerce(Dt,yt,Tt,Kr)},ne.getRefType=function(Dt){return Dt===void 0?Dt:Dt==="paper"?"paper":Dt==="pixel"?"pixel":/( domain)$/.test(Dt)?"domain":"range"},ne.coercePosition=function(Dt,yt,Er,Nr,jr,Ir){var Ur,sn,Kr=ne.getRefType(Nr);if(Kr!=="range")Ur=e.ensureNumber,sn=Er(jr,Ir);else{var Tt=ne.getFromId(yt,Nr);Ir=Tt.fraction2r(Ir),sn=Er(jr,Ir),Ur=Tt.cleanPos}Dt[jr]=Ur(sn)},ne.cleanPosition=function(Dt,yt,Er){var Nr=Er==="paper"||Er==="pixel"?e.ensureNumber:ne.getFromId(yt,Er).cleanPos;return Nr(Dt)},ne.redrawComponents=function(Dt,yt){yt=yt||ne.listIds(Dt);var Er=Dt._fullLayout;function Nr(jr,Ir,Ur,sn){for(var Kr=E.getComponentMethod(jr,Ir),Tt={},or=0;or2e-6||((Er-Dt._forceTick0)/Dt._minDtick%1+1.000001)%1>2e-6)&&(Dt._minDtick=0))},ne.saveRangeInitial=function(Dt,yt){for(var Er=ne.list(Dt,"",!0),Nr=!1,jr=0;jrDr*.3||Tt(Nr)||Tt(jr))){var ln=Er.dtick/2;Dt+=Dt+lnUr){var sn=Number(Er.slice(1));Ir.exactYears>Ur&&sn%12===0?Dt=ne.tickIncrement(Dt,"M6","reverse")+w*1.5:Ir.exactMonths>Ur?Dt=ne.tickIncrement(Dt,"M1","reverse")+w*15.5:Dt-=m;var Kr=ne.tickIncrement(Dt,Er);if(Kr<=Nr)return Kr}return Dt}ne.prepMinorTicks=function(Dt,yt,Er){if(!yt.minor.dtick){delete Dt.dtick;var Nr=yt.dtick&&b(yt._tmin),jr;if(Nr){var Ir=ne.tickIncrement(yt._tmin,yt.dtick,!0);jr=[yt._tmin,Ir*.99+yt._tmin*.01]}else{var Ur=e.simpleMap(yt.range,yt.r2l);jr=[Ur[0],.8*Ur[0]+.2*Ur[1]]}if(Dt.range=e.simpleMap(jr,yt.l2r),Dt._isMinor=!0,ne.prepTicks(Dt,Er),Nr){var sn=b(yt.dtick),Kr=b(Dt.dtick),Tt=sn?yt.dtick:+yt.dtick.substring(1),or=Kr?Dt.dtick:+Dt.dtick.substring(1);sn&&Kr?it(Tt,or)?Tt===2*_&&or===2*w&&(Dt.dtick=_):Tt===2*_&&or===3*w?Dt.dtick=_:Tt===_&&!(yt._input.minor||{}).nticks?Dt.dtick=w:st(Tt/or,2.5)?Dt.dtick=Tt/2:Dt.dtick=Tt:String(yt.dtick).charAt(0)==="M"?Kr?Dt.dtick="M1":it(Tt,or)?Tt>=12&&or===2&&(Dt.dtick="M3"):Dt.dtick=yt.dtick:String(Dt.dtick).charAt(0)==="L"?String(yt.dtick).charAt(0)==="L"?it(Tt,or)||(Dt.dtick=st(Tt/or,2.5)?yt.dtick/2:yt.dtick):Dt.dtick="D1":Dt.dtick==="D2"&&+yt.dtick>1&&(Dt.dtick=1)}Dt.range=yt.range}yt.minor._tick0Init===void 0&&(Dt.tick0=yt.tick0)};function it(Dt,yt){return Math.abs((Dt/yt+.5)%1-.5)<.001}function st(Dt,yt){return Math.abs(Dt/yt-1)<.001}ne.prepTicks=function(Dt,yt){var Er=e.simpleMap(Dt.range,Dt.r2l,void 0,void 0,yt);if(Dt.tickmode==="auto"||!Dt.dtick){var Nr=Dt.nticks,jr;Nr||(Dt.type==="category"||Dt.type==="multicategory"?(jr=Dt.tickfont?e.bigFont(Dt.tickfont.size||12):15,Nr=Dt._length/jr):(jr=Dt._id.charAt(0)==="y"?40:80,Nr=e.constrain(Dt._length/jr,4,9)+1),Dt._name==="radialaxis"&&(Nr*=2)),Dt.minor&&Dt.minor.tickmode!=="array"||Dt.tickmode==="array"&&(Nr*=100),Dt._roughDTick=Math.abs(Er[1]-Er[0])/Nr,ne.autoTicks(Dt,Dt._roughDTick),Dt._minDtick>0&&Dt.dtick0?(Ir=Nr-1,Ur=Nr):(Ir=Nr,Ur=Nr);var sn=Dt[Ir].value,Kr=Dt[Ur].value,Tt=Math.abs(Kr-sn),or=Er||Tt,Dr=0;or>=d?Tt>=d&&Tt<=c?Dr=Tt:Dr=p:Er===l&&or>=g?Tt>=g&&Tt<=T?Dr=Tt:Dr=l:or>=M?Tt>=M&&Tt<=x?Dr=Tt:Dr=A:Er===_&&or>=_?Dr=_:or>=w?Dr=w:Er===m&&or>=m?Dr=m:Er===u&&or>=u&&(Dr=u);var ln;Dr>=Tt&&(Dr=Tt,ln=!0);var Pn=jr+Dr;if(yt.rangebreaks&&Dr>0){for(var jn=84,Un=0,un=0;un_&&(Dr=Tt)}(Dr>0||Nr===0)&&(Dt[Nr].periodX=jr+Dr/2)}}ne.calcTicks=function(yt,Er){for(var Nr=yt.type,jr=yt.calendar,Ir=yt.ticklabelstep,Ur=yt.ticklabelmode==="period",sn=yt.range[0]>yt.range[1],Kr=!yt.ticklabelindex||e.isArrayOrTypedArray(yt.ticklabelindex)?yt.ticklabelindex:[yt.ticklabelindex],Tt=e.simpleMap(yt.range,yt.r2l,void 0,void 0,Er),or=Tt[1]=(Ma?0:1);Ei--){var Hi=!Ei;Ei?(yt._dtickInit=yt.dtick,yt._tick0Init=yt.tick0):(yt.minor._dtickInit=yt.minor.dtick,yt.minor._tick0Init=yt.minor.tick0);var io=Ei?yt:e.extendFlat({},yt,yt.minor);if(Hi?ne.prepMinorTicks(io,yt,Er):ne.prepTicks(io,Er),io.tickmode==="array"){Ei?(un=[],jn=Ne(yt,!Hi)):(Rn=[],Un=Ne(yt,!Hi));continue}if(io.tickmode==="sync"){un=[],jn=pe(yt);continue}var no=ve(Tt),bo=no[0],li=no[1],ts=b(io.dtick),Ho=Nr==="log"&&!(ts||io.dtick.charAt(0)==="L"),Gs=ne.tickFirst(io,Er);if(Ei){if(yt._tmin=Gs,Gs=li:Jo<=li;Jo=ne.tickIncrement(Jo,js,or,jr)){if(Ei&&Uo++,io.rangebreaks&&!or){if(Jo=ln)break}if(un.length>Pn||Jo===cs)break;cs=Jo;var ol={value:Jo};Ei?(Ho&&Jo!==(Jo|0)&&(ol.simpleLabel=!0),Ir>1&&Uo%Ir&&(ol.skipLabel=!0),un.push(ol)):(ol.minor=!0,Rn.push(ol))}}if(!Rn||Rn.length<2)Kr=!1;else{var fs=(Rn[1].value-Rn[0].value)*(sn?-1:1);Ti(fs,yt.tickformat)||(Kr=!1)}if(!Kr)di=un;else{var Zo=un.concat(Rn);Ur&&un.length&&(Zo=Zo.slice(1)),Zo=Zo.sort(function(Po,ou){return Po.value-ou.value}).filter(function(Po,ou,cu){return ou===0||Po.value!==cu[ou-1].value});var ho=Zo.map(function(Po,ou){return Po.minor===void 0&&!Po.skipLabel?ou:null}).filter(function(Po){return Po!==null});ho.forEach(function(Po){Kr.map(function(ou){var cu=Po+ou;cu>=0&&cu-1;Rs--){if(un[Rs].drop){un.splice(Rs,1);continue}un[Rs].value=fa(un[Rs].value,yt);var ll=yt.c2p(un[Rs].value);(zo?Ys>ll-Pl:Ysln||zsln&&(cu.periodX=ln),zsjr&&lnp)yt/=p,Nr=jr(10),Dt.dtick="M"+12*Mr(yt,Nr,ot);else if(Ir>A)yt/=A,Dt.dtick="M"+Mr(yt,1,ct);else if(Ir>w){if(Dt.dtick=Mr(yt,w,Dt._hasDayOfWeekBreaks?[1,2,7,14]:Ft),!Er){var Ur=ne.getTickFormat(Dt),sn=Dt.ticklabelmode==="period";sn&&(Dt._rawTick0=Dt.tick0),/%[uVW]/.test(Ur)?Dt.tick0=e.dateTick0(Dt.calendar,2):Dt.tick0=e.dateTick0(Dt.calendar,1),sn&&(Dt._dowTick0=Dt.tick0)}}else Ir>u?Dt.dtick=Mr(yt,u,ct):Ir>v?Dt.dtick=Mr(yt,v,rt):Ir>y?Dt.dtick=Mr(yt,y,rt):(Nr=jr(10),Dt.dtick=Mr(yt,Nr,ot))}else if(Dt.type==="log"){Dt.tick0=0;var Kr=e.simpleMap(Dt.range,Dt.r2l);if(Dt._isMinor&&(yt*=1.5),yt>.7)Dt.dtick=Math.ceil(yt);else if(Math.abs(Kr[1]-Kr[0])<1){var Tt=1.5*Math.abs((Kr[1]-Kr[0])/yt);yt=Math.abs(Math.pow(10,Kr[1])-Math.pow(10,Kr[0]))/Tt,Nr=jr(10),Dt.dtick="L"+Mr(yt,Nr,ot)}else Dt.dtick=yt>.3?"D2":"D1"}else Dt.type==="category"||Dt.type==="multicategory"?(Dt.tick0=0,Dt.dtick=Math.ceil(Math.max(yt,1))):da(Dt)?(Dt.tick0=0,Nr=1,Dt.dtick=Mr(yt,Nr,rr)):(Dt.tick0=0,Nr=jr(10),Dt.dtick=Mr(yt,Nr,ot));if(Dt.dtick===0&&(Dt.dtick=1),!b(Dt.dtick)&&typeof Dt.dtick!="string"){var or=Dt.dtick;throw Dt.dtick=1,"ax.dtick error: "+String(or)}};function Sr(Dt){var yt=Dt.dtick;if(Dt._tickexponent=0,!b(yt)&&typeof yt!="string"&&(yt=1),(Dt.type==="category"||Dt.type==="multicategory")&&(Dt._tickround=null),Dt.type==="date"){var Er=Dt.r2l(Dt.tick0),Nr=Dt.l2r(Er).replace(/(^-|i)/g,""),jr=Nr.length;if(String(yt).charAt(0)==="M")jr>10||Nr.slice(5)!=="01-01"?Dt._tickround="d":Dt._tickround=+yt.slice(1)%12===0?"y":"m";else if(yt>=w&&jr<=10||yt>=w*15)Dt._tickround="d";else if(yt>=v&&jr<=16||yt>=u)Dt._tickround="M";else if(yt>=y&&jr<=19||yt>=v)Dt._tickround="S";else{var Ir=Dt.l2r(Er+yt).replace(/^-/,"").length;Dt._tickround=Math.max(jr,Ir)-20,Dt._tickround<0&&(Dt._tickround=4)}}else if(b(yt)||yt.charAt(0)==="L"){var Ur=Dt.range.map(Dt.r2d||Number);b(yt)||(yt=Number(yt.slice(1))),Dt._tickround=2-Math.floor(Math.log(yt)/Math.LN10+.01);var sn=Math.max(Math.abs(Ur[0]),Math.abs(Ur[1])),Kr=Math.floor(Math.log(sn)/Math.LN10+.01),Tt=Dt.minexponent===void 0?3:Dt.minexponent;Math.abs(Kr)>Tt&&(Xe(Dt.exponentformat)&&Dt.exponentformat!=="SI extended"&&!Je(Kr)||Xe(Dt.exponentformat)&&Dt.exponentformat==="SI extended"&&!Lt(Kr)?Dt._tickexponent=3*Math.round((Kr-1)/3):Dt._tickexponent=Kr)}else Dt._tickround=null}ne.tickIncrement=function(Dt,yt,Er,Nr){var jr=Er?-1:1;if(b(yt))return e.increment(Dt,jr*yt);var Ir=yt.charAt(0),Ur=jr*Number(yt.slice(1));if(Ir==="M")return e.incrementMonth(Dt,Ur,Nr);if(Ir==="L")return Math.log(Math.pow(10,Dt)+Ur)/Math.LN10;if(Ir==="D"){var sn=yt==="D2"?$t:Nt,Kr=Dt+jr*.01,Tt=e.roundUp(e.mod(Kr,1),sn,Er);return Math.floor(Kr)+Math.log(h.round(Math.pow(10,Tt),1))/Math.LN10}throw"unrecognized dtick "+String(yt)},ne.tickFirst=function(Dt,yt){var Er=Dt.r2l||Number,Nr=e.simpleMap(Dt.range,Er,void 0,void 0,yt),jr=Nr[1]=0&&Rn<=Dt._length?un:null};if(Ir&&e.isArrayOrTypedArray(Dt.ticktext)){var Dr=e.simpleMap(Dt.range,Dt.r2l),ln=(Math.abs(Dr[1]-Dr[0])-(Dt._lBreaks||0))/1e4;for(Tt=0;Tt"+sn;else{var Tt=ga(Dt),or=Dt._trueSide||Dt.side;(!Tt&&or==="top"||Tt&&or==="bottom")&&(Ur+="
")}yt.text=Ur}function Br(Dt,yt,Er,Nr,jr){var Ir=Dt.dtick,Ur=yt.x,sn=Dt.tickformat,Kr=typeof Ir=="string"&&Ir.charAt(0);if(jr==="never"&&(jr=""),Nr&&Kr!=="L"&&(Ir="L3",Kr="L"),sn||Kr==="L")yt.text=Ot(Math.pow(10,Ur),Dt,jr,Nr);else if(b(Ir)||Kr==="D"&&(Dt.minorloglabels==="complete"||e.mod(Ur+.01,1)<.1)){Dt.minorloglabels==="complete"&&!(e.mod(Ur+.01,1)<.1)&&(yt.fontSize*=.75);var Tt=Math.pow(10,Ur).toExponential(0),or=Tt.split("e"),Dr=+or[1],ln=Math.abs(Dr),Pn=Dt.exponentformat;Pn==="power"||Xe(Pn)&&Pn!=="SI extended"&&Je(Dr)||Xe(Pn)&&Pn==="SI extended"&&Lt(Dr)?(yt.text=or[0],ln>0&&(yt.text+="x10"),yt.text==="1x10"&&(yt.text="10"),Dr!==0&&Dr!==1&&(yt.text+=""+(Dr>0?"":z)+ln+""),yt.fontSize*=1.25):(Pn==="e"||Pn==="E")&&ln>2?yt.text=or[0]+Pn+(Dr>0?"+":z)+ln:(yt.text=Ot(Math.pow(10,Ur),Dt,"","fakehover"),Ir==="D1"&&Dt._id.charAt(0)==="y"&&(yt.dy-=yt.fontSize/6))}else if(Kr==="D")yt.text=Dt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Ur,1)))),yt.fontSize*=.75;else throw"unrecognized dtick "+String(Ir);if(Dt.dtick==="D1"){var jn=String(yt.text).charAt(0);(jn==="0"||jn==="1")&&(Dt._id.charAt(0)==="y"?yt.dx-=yt.fontSize/4:(yt.dy+=yt.fontSize/2,yt.dx+=(Dt.range[1]>Dt.range[0]?1:-1)*yt.fontSize*(Ur<0?.5:.25)))}}function Mt(Dt,yt){var Er=Dt._categories[Math.round(yt.x)];Er===void 0&&(Er=""),yt.text=String(Er)}function je(Dt,yt,Er){var Nr=Math.round(yt.x),jr=Dt._categories[Nr]||[],Ir=jr[1]===void 0?"":String(jr[1]),Ur=jr[0]===void 0?"":String(jr[0]);Er?yt.text=Ur+" - "+Ir:(yt.text=Ir,yt.text2=Ur)}function $e(Dt,yt,Er,Nr,jr){jr==="never"?jr="":Dt.showexponent==="all"&&Math.abs(yt.x/Dt.dtick)<1e-6&&(jr="hide"),yt.text=Ot(yt.x,Dt,jr,Nr)}function Ee(Dt,yt,Er,Nr,jr){if(Dt.thetaunit==="radians"&&!Er){var Ir=yt.x/180;if(Ir===0)yt.text="0";else{var Ur=xe(Ir);if(Ur[1]>=100)yt.text=Ot(e.deg2rad(yt.x),Dt,jr,Nr);else{var sn=yt.x<0;Ur[1]===1?Ur[0]===1?yt.text="π":yt.text=Ur[0]+"π":yt.text=["",Ur[0],"","⁄","",Ur[1],"","π"].join(""),sn&&(yt.text=z+yt.text)}}}else yt.text=Ot(yt.x,Dt,jr,Nr)}function xe(Dt){function yt(sn,Kr){return Math.abs(sn-Kr)<=1e-6}function Er(sn,Kr){return yt(Kr,0)?sn:Er(Kr,sn%Kr)}function Nr(sn){for(var Kr=1;!yt(Math.round(sn*Kr)/Kr,sn);)Kr*=10;return Kr}var jr=Nr(Dt),Ir=Dt*jr,Ur=Math.abs(Er(Ir,jr));return[Math.round(Ir/Ur),Math.round(jr/Ur)]}var ye=["f","p","n","μ","m","","k","M","G","T"],Me=["q","r","y","z","a",...ye,"P","E","Z","Y","R","Q"],Xe=Dt=>["SI","SI extended","B"].includes(Dt);function Je(Dt){return Dt>14||Dt<-15}function Lt(Dt){return Dt>32||Dt<-30}function Ct(Dt,yt){return Xe(yt)?!!(yt==="SI extended"&&Lt(Dt)||yt!=="SI extended"&&Je(Dt)):!1}function Ot(Dt,yt,Er,Nr){var jr=Dt<0,Ir=yt._tickround,Ur=Er||yt.exponentformat||"B",sn=yt._tickexponent,Kr=ne.getTickFormat(yt),Tt=yt.separatethousands;if(Nr){var or={exponentformat:Ur,minexponent:yt.minexponent,dtick:yt.showexponent==="none"?yt.dtick:b(Dt)&&Math.abs(Dt)||1,range:yt.showexponent==="none"?yt.range.map(yt.r2d):[0,Dt||1]};Sr(or),Ir=(Number(or._tickround)||0)+4,sn=or._tickexponent,yt.hoverformat&&(Kr=yt.hoverformat)}if(Kr)return yt._numFormat(Kr)(Dt).replace(/-/g,z);var Dr=Math.pow(10,-Ir)/2;if(Ur==="none"&&(sn=0),Dt=Math.abs(Dt),Dt"+jn+"":Ur==="B"&&sn===9?Dt+="B":Xe(Ur)&&(Dt+=Ur==="SI extended"?Me[sn/3+10]:ye[sn/3+5])}return jr?z+Dt:Dt}ne.getTickFormat=function(Dt){var yt;function Er(Kr){return typeof Kr!="string"?Kr:Number(Kr.replace("M",""))*A}function Nr(Kr,Tt){var or=["L","D"];if(typeof Kr==typeof Tt){if(typeof Kr=="number")return Kr-Tt;var Dr=or.indexOf(Kr.charAt(0)),ln=or.indexOf(Tt.charAt(0));return Dr===ln?Number(Kr.replace(/(L|D)/g,""))-Number(Tt.replace(/(L|D)/g,"")):Dr-ln}else return typeof Kr=="number"?1:-1}function jr(Kr,Tt,or){var Dr=or||function(jn){return jn},ln=Tt[0],Pn=Tt[1];return(!ln&&typeof ln!="number"||Dr(ln)<=Dr(Kr))&&(!Pn&&typeof Pn!="number"||Dr(Pn)>=Dr(Kr))}function Ir(Kr,Tt){var or=Tt[0]===null,Dr=Tt[1]===null,ln=Nr(Kr,Tt[0])>=0,Pn=Nr(Kr,Tt[1])<=0;return(or||ln)&&(Dr||Pn)}var Ur,sn;if(Dt.tickformatstops&&Dt.tickformatstops.length>0)switch(Dt.type){case"date":case"linear":{for(yt=0;yt=0&&jr.unshift(jr.splice(or,1).shift())}});var sn={false:{left:0,right:0}};return e.syncOrAsync(jr.map(function(Kr){return function(){if(Kr){var Tt=ne.getFromId(Dt,Kr);Er||(Er={}),Er.axShifts=sn,Er.overlayingShiftedAx=Ur;var or=ne.drawOne(Dt,Tt,Er);return Tt._shiftPusher&&Vn(Tt,Tt._fullDepth||0,sn,!0),Tt._r=Tt.range.slice(),Tt._rl=e.simpleMap(Tt._r,Tt.r2l),or}}}))},ne.drawOne=function(Dt,yt,Er){Er=Er||{};var Nr=Er.axShifts||{},jr=Er.overlayingShiftedAx||[],Ir,Ur,sn;yt.setScale();var Kr=Dt._fullLayout,Tt=yt._id,or=Tt.charAt(0),Dr=ne.counterLetter(Tt),ln=Kr._plots[yt._mainSubplot],Pn=yt.zerolinelayer==="above traces";if(!ln)return;if(yt._shiftPusher=yt.autoshift||jr.indexOf(yt._id)!==-1||jr.indexOf(yt.overlaying)!==-1,yt._shiftPusher&yt.anchor==="free"){var jn=yt.linewidth/2||0;yt.ticks==="inside"&&(jn+=yt.ticklen),Vn(yt,jn,Nr,!0),Vn(yt,yt.shift||0,Nr,!1)}(Er.skipTitle!==!0||yt._shift===void 0)&&(yt._shift=hi(yt,Nr));var Un=ln[or+"axislayer"],un=yt._mainLinePosition,Rn=un+=yt._shift,di=yt._mainMirrorPosition,Ma=yt._vals=ne.calcTicks(yt),Ei=[yt.mirror,Rn,di].join("_");for(Ir=0;Ir0?zs.bottom-ou:0,cu))));var Vu=0,sf=0;if(yt._shiftPusher&&(Vu=Math.max(cu,zs.height>0?Vl==="l"?ou-zs.left:zs.right-ou:0),yt.title.text!==Kr._dfltTitle[or]&&(sf=(yt._titleStandoff||0)+(yt._titleScoot||0),Vl==="l"&&(sf+=ra(yt))),yt._fullDepth=Math.max(Vu,sf)),yt.automargin){xl={x:0,y:0,r:0,l:0,t:0,b:0};var jc=[0,1],$c=typeof yt._shift=="number"?yt._shift:0;if(or==="x"){if(Vl==="b"?xl[Vl]=yt._depth:(xl[Vl]=yt._depth=Math.max(zs.width>0?ou-zs.top:0,cu),jc.reverse()),zs.width>0){var Ch=zs.right-(yt._offset+yt._length);Ch>0&&(xl.xr=1,xl.r=Ch);var gh=yt._offset-zs.left;gh>0&&(xl.xl=0,xl.l=gh)}}else if(Vl==="l"?(yt._depth=Math.max(zs.height>0?ou-zs.left:0,cu),xl[Vl]=yt._depth-$c):(yt._depth=Math.max(zs.height>0?zs.right-ou:0,cu),xl[Vl]=yt._depth+$c,jc.reverse()),zs.height>0){var bl=zs.bottom-(yt._offset+yt._length);bl>0&&(xl.yb=0,xl.b=bl);var Cc=yt._offset-zs.top;Cc>0&&(xl.yt=1,xl.t=Cc)}xl[Dr]=yt.anchor==="free"?yt.position:yt._anchorAxis.domain[jc[0]],yt.title.text!==Kr._dfltTitle[or]&&(xl[Vl]+=ra(yt)+(yt.title.standoff||0)),yt.mirror&&yt.anchor!=="free"&&(Ol={x:0,y:0,r:0,l:0,t:0,b:0},Ol[Po]=yt.linewidth,yt.mirror&&yt.mirror!==!0&&(Ol[Po]+=cu),yt.mirror===!0||yt.mirror==="ticks"?Ol[Dr]=yt._anchorAxis.domain[jc[1]]:(yt.mirror==="all"||yt.mirror==="allticks")&&(Ol[Dr]=[yt._counterDomainMin,yt._counterDomainMax][jc[1]]))}ql&&(Nl=E.getComponentMethod("rangeslider","autoMarginOpts")(Dt,yt)),typeof yt.automargin=="string"&&(Wt(xl,yt.automargin),Wt(Ol,yt.automargin)),S.autoMargin(Dt,ar(yt),xl),S.autoMargin(Dt,sr(yt),Ol),S.autoMargin(Dt,Vr(yt),Nl)}),e.syncOrAsync(ms)}};function Wt(Dt,yt){if(Dt){var Er=Object.keys(Z).reduce(function(Nr,jr){return yt.indexOf(jr)!==-1&&Z[jr].forEach(function(Ir){Nr[Ir]=1}),Nr},{});Object.keys(Dt).forEach(function(Nr){Er[Nr]||(Nr.length===1?Dt[Nr]=0:delete Dt[Nr])})}}function _r(Dt,yt){var Er=[],Nr,jr=function(Ir,Ur){var sn=Ir.xbnd[Ur];sn!==null&&Er.push(e.extendFlat({},Ir,{x:sn}))};if(yt.length){for(Nr=0;NrDt.range[1],sn=Dt.ticklabelposition&&Dt.ticklabelposition.indexOf("inside")!==-1,Kr=!sn;if(Er){var Tt=Ur?-1:1;Er=Er*Tt}if(Nr){var or=Dt.side,Dr=sn&&(or==="top"||or==="left")||Kr&&(or==="bottom"||or==="right")?1:-1;Nr=Nr*Dr}return Dt._id.charAt(0)==="x"?function(ln){return t(jr+Dt._offset+Dt.l2p(En(ln))+Er,Ir+Nr)}:function(ln){return t(Ir+Nr,jr+Dt._offset+Dt.l2p(En(ln))+Er)}};function En(Dt){return Dt.periodX!==void 0?Dt.periodX:Dt.x}function Zn(Dt){var yt=Dt.ticklabelposition||"",Er=Dt.tickson||"",Nr=function(jn){return yt.indexOf(jn)!==-1},jr=Nr("top"),Ir=Nr("left"),Ur=Nr("right"),sn=Nr("bottom"),Kr=Nr("inside"),Tt=Er!=="boundaries"&&(sn||Ir||jr||Ur);if(!Tt&&!Kr)return[0,0];var or=Dt.side,Dr=Tt?(Dt.tickwidth||0)/2:0,ln=ee,Pn=Dt.tickfont?Dt.tickfont.size:12;return(sn||jr)&&(Dr+=Pn*le,ln+=(Dt.linewidth||0)/2),(Ir||Ur)&&(Dr+=(Dt.linewidth||0)/2,ln+=ee),Kr&&or==="top"&&(ln-=Pn*(1-le)),(Ir||jr)&&(Dr=-Dr),(or==="bottom"||or==="right")&&(ln=-ln),[Tt?Dr:0,Kr?ln:0]}ne.makeTickPath=function(Dt,yt,Er,Nr){Nr||(Nr={});var jr=Nr.minor;if(jr&&!Dt.minor)return"";var Ir=Nr.len!==void 0?Nr.len:jr?Dt.minor.ticklen:Dt.ticklen,Ur=Dt._id.charAt(0),sn=(Dt.linewidth||1)/2;return Ur==="x"?"M0,"+(yt+sn*Er)+"v"+Ir*Er:"M"+(yt+sn*Er)+",0h"+Ir*Er},ne.makeLabelFns=function(Dt,yt,Er){var Nr=Dt.ticklabelposition||"",jr=Dt.tickson||"",Ir=function(cs){return Nr.indexOf(cs)!==-1},Ur=Ir("top"),sn=Ir("left"),Kr=Ir("right"),Tt=Ir("bottom"),or=jr!=="boundaries"&&(Tt||sn||Ur||Kr),Dr=Ir("inside"),ln=Nr==="inside"&&Dt.ticks==="inside"||!Dr&&Dt.ticks==="outside"&&jr!=="boundaries",Pn=0,jn=0,Un=ln?Dt.ticklen:0;if(Dr?Un*=-1:or&&(Un=0),ln&&(Pn+=Un,Er)){var un=e.deg2rad(Er);Pn=Un*Math.cos(un)+1,jn=Un*Math.sin(un)}Dt.showticklabels&&(ln||Dt.showline)&&(Pn+=.2*Dt.tickfont.size),Pn+=(Dt.linewidth||1)/2*(Dr?-1:1);var Rn={labelStandoff:Pn,labelShift:jn},di,Ma,Ei,Hi,io=0,no=Dt.side,bo=Dt._id.charAt(0),li=Dt.tickangle,ts;if(bo==="x")ts=!Dr&&no==="bottom"||Dr&&no==="top",Hi=ts?1:-1,Dr&&(Hi*=-1),di=jn*Hi,Ma=yt+Pn*Hi,Ei=ts?1:-.2,Math.abs(li)===90&&(Dr?Ei+=fe:li===-90&&no==="bottom"?Ei=le:li===90&&no==="top"?Ei=fe:Ei=.5,io=fe/2*(li/90)),Rn.xFn=function(cs){return cs.dx+di+io*cs.fontSize},Rn.yFn=function(cs){return cs.dy+Ma+cs.fontSize*Ei},Rn.anchorFn=function(cs,Jo){if(or){if(sn)return"end";if(Kr)return"start"}return!b(Jo)||Jo===0||Jo===180?"middle":Jo*Hi<0!==Dr?"end":"start"},Rn.heightFn=function(cs,Jo,Uo){return Jo<-60||Jo>60?-.5*Uo:Dt.side==="top"!==Dr?-Uo:0};else if(bo==="y"){if(ts=!Dr&&no==="left"||Dr&&no==="right",Hi=ts?1:-1,Dr&&(Hi*=-1),di=Pn,Ma=jn*Hi,Ei=0,!Dr&&Math.abs(li)===90&&(li===-90&&no==="left"||li===90&&no==="right"?Ei=le:Ei=.5),Dr){var Ho=b(li)?+li:0;if(Ho!==0){var Gs=e.deg2rad(Ho);io=Math.abs(Math.sin(Gs))*le*Hi,Ei=0}}Rn.xFn=function(cs){return cs.dx+yt-(di+cs.fontSize*Ei)*Hi+io*cs.fontSize},Rn.yFn=function(cs){return cs.dy+Ma+cs.fontSize*fe},Rn.anchorFn=function(cs,Jo){return b(Jo)&&Math.abs(Jo)===90?"middle":ts?"end":"start"},Rn.heightFn=function(cs,Jo,Uo){return Dt.side==="right"&&(Jo*=-1),Jo<-30?-Uo:Jo<30?-.5*Uo:0}}return Rn};function qn(Dt){return[Dt.text,Dt.x,Dt.axInfo,Dt.font,Dt.fontSize,Dt.fontColor].join("_")}ne.drawTicks=function(Dt,yt,Er){Er=Er||{};var Nr=yt._id+"tick",jr=[].concat(yt.minor&&yt.minor.ticks?Er.vals.filter(function(Ur){return Ur.minor&&!Ur.noTick}):[]).concat(yt.ticks?Er.vals.filter(function(Ur){return!Ur.minor&&!Ur.noTick}):[]),Ir=Er.layer.selectAll("path."+Nr).data(jr,qn);Ir.exit().remove(),Ir.enter().append("path").classed(Nr,1).classed("ticks",1).classed("crisp",Er.crisp!==!1).each(function(Ur){return n.stroke(h.select(this),Ur.minor?yt.minor.tickcolor:yt.tickcolor)}).style("stroke-width",function(Ur){return i.crispRound(Dt,Ur.minor?yt.minor.tickwidth:yt.tickwidth,1)+"px"}).attr("d",Er.path).style("display",null),ka(yt,[U]),Ir.attr("transform",Er.transFn)},ne.drawGrid=function(Dt,yt,Er){if(Er=Er||{},yt.tickmode!=="sync"){var Nr=yt._id+"grid",jr=yt.minor&&yt.minor.showgrid,Ir=jr?Er.vals.filter(function(Rn){return Rn.minor}):[],Ur=yt.showgrid?Er.vals.filter(function(Rn){return!Rn.minor}):[],sn=Er.counterAxis;if(sn&&ne.shouldShowZeroLine(Dt,yt,sn))for(var Kr=yt.tickmode==="array",Tt=0;Tt=0;jn--){var Un=jn?ln:Pn;if(Un){var un=Un.selectAll("path."+Nr).data(jn?Ur:Ir,qn);un.exit().remove(),un.enter().append("path").classed(Nr,1).classed("crisp",Er.crisp!==!1),un.attr("transform",Er.transFn).attr("d",Er.path).each(function(Rn){return n.stroke(h.select(this),Rn.minor?yt.minor.gridcolor:yt.gridcolor||"#ddd")}).style("stroke-dasharray",function(Rn){return i.dashStyle(Rn.minor?yt.minor.griddash:yt.griddash,Rn.minor?yt.minor.gridwidth:yt.gridwidth)}).style("stroke-width",function(Rn){return(Rn.minor?Dr:yt._gw)+"px"}).style("display",null),typeof Er.path=="function"&&un.attr("d",Er.path)}}ka(yt,[B,R])}},ne.drawZeroLine=function(Dt,yt,Er){Er=Er||Er;var Nr=yt._id+"zl",jr=ne.shouldShowZeroLine(Dt,yt,Er.counterAxis),Ir=Er.layer.selectAll("path."+Nr).data(jr?[{x:0,id:yt._id}]:[]);Ir.exit().remove(),Ir.enter().append("path").classed(Nr,1).classed("zl",1).classed("crisp",Er.crisp!==!1).each(function(){Er.layer.selectAll("path").sort(function(Ur,sn){return te(Ur.id,sn.id)})}),Ir.attr("transform",Er.transFn).attr("d",Er.path).call(n.stroke,yt.zerolinecolor||n.defaultLine).style("stroke-width",i.crispRound(Dt,yt.zerolinewidth,yt._gw||1)+"px").style("display",null),ka(yt,[N])},ne.drawLabels=function(Dt,yt,Er){Er=Er||{};var Nr=Dt._fullLayout,jr=yt._id,Ir=yt.zerolinelayer==="above traces",Ur=Er.cls||jr+"tick",sn=Er.vals.filter(function(fs){return fs.text}),Kr=Er.labelFns,Tt=Er.secondary?0:yt.tickangle,or=(yt._prevTickAngles||{})[Ur],Dr=Er.layer.selectAll("g."+Ur).data(yt.showticklabels?sn:[],qn),ln=[];Dr.enter().append("g").classed(Ur,1).append("text").attr("text-anchor","middle").each(function(fs){var Zo=h.select(this),ho=Dt._promises.length;Zo.call(r.positionText,Kr.xFn(fs),Kr.yFn(fs)).call(i.font,{family:fs.font,size:fs.fontSize,color:fs.fontColor,weight:fs.fontWeight,style:fs.fontStyle,variant:fs.fontVariant,textcase:fs.fontTextcase,lineposition:fs.fontLineposition,shadow:fs.fontShadow}).text(fs.text).call(r.convertToTspans,Dt),Dt._promises[ho]?ln.push(Dt._promises.pop().then(function(){Pn(Zo,Tt)})):Pn(Zo,Tt)}),ka(yt,[j]),Dr.exit().remove(),Er.repositionOnUpdate&&Dr.each(function(fs){h.select(this).select("text").call(r.positionText,Kr.xFn(fs),Kr.yFn(fs))});function Pn(fs,Zo){fs.each(function(ho){var hs=h.select(this),sl=hs.select(".text-math-group"),El=Kr.anchorFn(ho,Zo),Ll=Er.transFn.call(hs.node(),ho)+(b(Zo)&&+Zo!=0?" rotate("+Zo+","+Kr.xFn(ho)+","+(Kr.yFn(ho)-ho.fontSize/2)+")":""),Es=r.lineCount(hs),ci=ce*ho.fontSize,Ji=Kr.heightFn(ho,b(Zo)?+Zo:0,(Es-1)*ci);if(Ji&&(Ll+=t(0,Ji)),sl.empty()){var kl=hs.select("text");kl.attr({transform:Ll,"text-anchor":El}),kl.style("display",null),yt._adjustTickLabelsOverflow&&yt._adjustTickLabelsOverflow()}else{var Rs=i.bBox(sl.node()).width,zo=Rs*{end:-.5,start:.5}[El];sl.attr("transform",Ll+t(zo,0))}})}yt._adjustTickLabelsOverflow=function(){var fs=yt.ticklabeloverflow;if(!(!fs||fs==="allow")){var Zo=fs.indexOf("hide")!==-1,ho=yt._id.charAt(0)==="x",hs=0,sl=ho?Dt._fullLayout.width:Dt._fullLayout.height;if(fs.indexOf("domain")!==-1){var El=e.simpleMap(yt.range,yt.r2l);hs=yt.l2p(El[0])+yt._offset,sl=yt.l2p(El[1])+yt._offset}var Ll=Math.min(hs,sl),Es=Math.max(hs,sl),ci=yt.side,Ji=1/0,kl=-1/0;Dr.each(function(Ys){var ll=h.select(this),_u=ll.select(".text-math-group");if(_u.empty()){var Ki=i.bBox(ll.node()),ms=0;ho?(Ki.right>Es||Ki.leftEs||Ki.top+(yt.tickangle?0:Ys.fontSize/4)yt["_visibleLabelMin_"+El._id]?ll.style("display","none"):Es.K==="tick"&&!Ll&&ll.node().style.display!=="none"&&ll.style("display",null)})})})})},Pn(Dr,or+1?or:Tt);function jn(){return ln.length&&Promise.all(ln)}var Un=null;function un(){if(Pn(Dr,Tt),sn.length&&yt.autotickangles&&(yt.type!=="log"||String(yt.dtick).charAt(0)!=="D")){Un=yt.autotickangles[0];var fs=0,Zo=[],ho,hs=1;Dr.each(function(xl){fs=Math.max(fs,xl.fontSize);var Ol=yt.l2p(xl.x),Nl=qt(this),Vu=i.bBox(Nl.node());hs=Math.max(hs,r.lineCount(Nl)),Zo.push({top:0,bottom:10,height:10,left:Ol-Vu.width/2,right:Ol+Vu.width/2+2,width:Vu.width+2})});var sl=(yt.tickson==="boundaries"||yt.showdividers)&&!Er.secondary,El=sn.length,Ll=Math.abs((sn[El-1].x-sn[0].x)*yt._m)/(El-1),Es=sl?Ll/2:Ll,ci=sl?yt.ticklen:fs*1.25*hs,Ji=Math.sqrt(Math.pow(Es,2)+Math.pow(ci,2)),kl=Es/Ji,Rs=yt.autotickangles.map(function(xl){return xl*Math.PI/180}),zo=Rs.find(function(xl){return Math.abs(Math.cos(xl))<=kl});zo===void 0&&(zo=Rs.reduce(function(xl,Ol){return Math.abs(Math.cos(xl))Xs*Uo&&(Gs=Uo,li[bo]=ts[bo]=cs[bo])}var js=Math.abs(Gs-Ho);js-Hi>0?(js-=Hi,Hi*=1+Hi/js):Hi=0,yt._id.charAt(0)!=="y"&&(Hi=-Hi),li[no]=Ma.p2r(Ma.r2p(ts[no])+io*Hi),Ma.autorange==="min"||Ma.autorange==="max reversed"?(li[0]=null,Ma._rangeInitial0=void 0,Ma._rangeInitial1=void 0):(Ma.autorange==="max"||Ma.autorange==="min reversed")&&(li[1]=null,Ma._rangeInitial0=void 0,Ma._rangeInitial1=void 0),Nr._insideTickLabelsUpdaterange[Ma._name+".range"]=li}var ol=e.syncOrAsync(Rn);return ol&&ol.then&&Dt._promises.push(ol),ol};function ta(Dt,yt,Er){var Nr=yt._id+"divider",jr=Er.vals,Ir=Er.layer.selectAll("path."+Nr).data(jr,qn);Ir.exit().remove(),Ir.enter().insert("path",":first-child").classed(Nr,1).classed("crisp",1).call(n.stroke,yt.dividercolor).style("stroke-width",i.crispRound(Dt,yt.dividerwidth,1)+"px"),Ir.attr("transform",Er.transFn).attr("d",Er.path)}ne.getPxPosition=function(Dt,yt){var Er=Dt._fullLayout._size,Nr=yt._id.charAt(0),jr=yt.side,Ir;if(yt.anchor!=="free"?Ir=yt._anchorAxis:Nr==="x"?Ir={_offset:Er.t+(1-(yt.position||0))*Er.h,_length:0}:Nr==="y"&&(Ir={_offset:Er.l+(yt.position||0)*Er.w+yt._shift,_length:0}),jr==="top"||jr==="left")return Ir._offset;if(jr==="bottom"||jr==="right")return Ir._offset+Ir._length};function ra(Dt){var yt=Dt.title.font.size,Er=(Dt.title.text.match(r.BR_TAG_ALL)||[]).length;return Dt.title.hasOwnProperty("standoff")?yt*(le+Er*ce):Er?yt*(Er+1)*ce:yt}function Nn(Dt,yt){var Er=Dt._fullLayout,Nr=yt._id,jr=Nr.charAt(0),Ir=yt.title.font.size,Ur,sn=(yt.title.text.match(r.BR_TAG_ALL)||[]).length;if(yt.title.hasOwnProperty("standoff"))yt.side==="bottom"||yt.side==="right"?Ur=yt._depth+yt.title.standoff+Ir*le:(yt.side==="top"||yt.side==="left")&&(Ur=yt._depth+yt.title.standoff+Ir*(fe+sn*ce));else{var Kr=ga(yt);if(yt.type==="multicategory")Ur=yt._depth;else{var Tt=1.5*Ir;Kr&&(Tt=.5*Ir,yt.ticks==="outside"&&(Tt+=yt.ticklen)),Ur=10+Tt+(yt.linewidth?yt.linewidth-1:0)}Kr||(jr==="x"?Ur+=yt.side==="top"?Ir*(yt.showticklabels?1:0):Ir*(yt.showticklabels?1.5:.5):Ur+=yt.side==="right"?Ir*(yt.showticklabels?1:.5):Ir*(yt.showticklabels?.5:0))}var or=ne.getPxPosition(Dt,yt),Dr,ln,Pn;jr==="x"?(ln=yt._offset+yt._length/2,Pn=yt.side==="top"?or-Ur:or+Ur):(Pn=yt._offset+yt._length/2,ln=yt.side==="right"?or+Ur:or-Ur,Dr={rotate:"-90",offset:0});var jn;if(yt.type!=="multicategory"){var Un=yt._selections[yt._id+"tick"];if(jn={selection:Un,side:yt.side},Un&&Un.node()&&Un.node().parentNode){var un=i.getTranslate(Un.node().parentNode);jn.offsetLeft=un.x,jn.offsetTop=un.y}yt.title.hasOwnProperty("standoff")&&(jn.pad=0)}return yt._titleStandoff=Ur,o.draw(Dt,Nr+"title",{propContainer:yt,propName:yt._name+".title.text",placeholder:Er._dfltTitle[jr],avoid:jn,transform:Dr,attributes:{x:ln,y:Pn,"text-anchor":"middle"}})}ne.shouldShowZeroLine=function(Dt,yt,Er){var Nr=e.simpleMap(yt.range,yt.r2l);return Nr[0]*Nr[1]<=0&&yt.zeroline&&(yt.type==="linear"||yt.type==="-")&&!(yt.rangebreaks&&yt.maskBreaks(0)===F)&&(Ea(yt,0)||!ja(Dt,yt,Er,Nr)||ir(Dt,yt))},ne.clipEnds=function(Dt,yt){return yt.filter(function(Er){return Ea(Dt,Er.x)})};function Ea(Dt,yt){var Er=Dt.l2p(yt);return Er>1&&Er1)for(jr=1;jr=jr.min&&Dt=L:/%L/.test(yt)?Dt>=I:/%[SX]/.test(yt)?Dt>=y:/%M/.test(yt)?Dt>=v:/%[HI]/.test(yt)?Dt>=u:/%p/.test(yt)?Dt>=m:/%[Aadejuwx]/.test(yt)?Dt>=w:/%[UVW]/.test(yt)?Dt>=_:/%[Bbm]/.test(yt)?Dt>=M:/%[q]/.test(yt)?Dt>=g:/%[Yy]/.test(yt)?Dt>=d:!0}}}),jT=Ge({"src/plots/cartesian/autorange_options_defaults.js"($,G){G.exports=function(b,S,E){var e,t;if(E){var r=S==="reversed"||S==="min reversed"||S==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=b("autorangeoptions.minallowed",t===null?e:void 0),n=b("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&b("autorangeoptions.clipmin"),n===void 0&&b("autorangeoptions.clipmax"),b("autorangeoptions.include")}}}),qT=Ge({"src/plots/cartesian/range_defaults.js"($,G){var h=jT();G.exports=function(S,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var n=e("range");if(!n){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(n=e("range",i)))}var a=E.getAutorangeDflt(n,t),s=e("autorange",a),f;n&&(n[0]===null&&n[1]===null||(n[0]===null||n[1]===null)&&(s==="reversed"||s===!0)||n[0]!==null&&(s==="min"||s==="max reversed")||n[1]!==null&&(s==="max"||s==="min reversed"))&&(n=void 0,delete E.range,E.autorange=!0,f=!0),f||(a=E.getAutorangeDflt(n,t),s=e("autorange",a)),s&&(h(e,s,n),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),Vw=Ge({"node_modules/mouse-event-offset/index.js"($,G){var h={left:0,top:0};G.exports=b;function b(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,n=S(e);return t[0]=r-n.left,t[1]=o-n.top,t}function S(E){return E===window||E===document||E===document.body?h:E.getBoundingClientRect()}}}),Hw=Ge({"node_modules/has-passive-events/index.js"($,G){var h=ox();function b(){var S=!1;try{var E=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{S=!1}return S}G.exports=h&&b()}}),dM=Ge({"src/components/dragelement/align.js"($,G){G.exports=function(b,S,E,e,t){var r=(b-E)/(e-E),o=r+S/(e-E),n=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?n:t==="right"||t==="top"?o:r<2/3-n?r:o>4/3-n?o:n}}}),pM=Ge({"src/components/dragelement/cursor.js"($,G){var h=gn(),b=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=h.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=h.constrain(Math.floor(e*3),0,2),b[e][E]}}}),mM=Ge({"src/components/dragelement/unhover.js"($,G){var h=b1(),b=C0(),S=Zg().getGraphDiv,E=Ef(),e=G.exports={};e.wrapped=function(t,r,o){t=S(t),t._fullLayout&&b.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var n=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&h.triggerHandler(r,"plotly_beforehover",o)===!1)&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),rd=Ge({"src/components/dragelement/index.js"($,G){var h=Vw(),b=jw(),S=Hw(),E=gn().removeElement,e=rh(),t=G.exports={};t.align=dM(),t.getCursor=pM();var r=mM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(a){var s=a.gd,f=1,c=s._context.doubleClickDelay,p=a.element,d,T,l,g,x,A,M,_;s._mouseDownTime||(s._mouseDownTime=0),p.style.pointerEvents="all",p.onmousedown=u,S?(p._ontouchstart&&p.removeEventListener("touchstart",p._ontouchstart),p._ontouchstart=u,p.addEventListener("touchstart",u,{passive:!1})):p.ontouchstart=u;function w(I,L,z){return Math.abs(I)"u"&&typeof I.clientY>"u"&&(I.clientX=d,I.clientY=T),l=new Date().getTime(),l-s._mouseDownTimec&&(f=Math.max(f-1,1)),s._dragged)a.doneFn&&a.doneFn();else{var L;A.target===M?L=A:(L={target:M,srcElement:M,toElement:M},Object.keys(A).concat(Object.keys(A.__proto__)).forEach(z=>{var F=A[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),a.clickFn&&a.clickFn(f,L),_||M.dispatchEvent(new MouseEvent("click",I))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var a=i.style;return a.position="fixed",a.left=0,a.right=0,a.top=0,a.bottom=0,a.zIndex=999999999,a.background="none",document.body.appendChild(i),i}t.coverSlip=o;function n(i){return h(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),Dp=Ge({"src/lib/setcursor.js"($,G){G.exports=function(b,S){(b.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&b.classed(E,!1)}),S&&b.classed("cursor-"+S,!0)}}}),gM=Ge({"src/lib/override_cursor.js"($,G){var h=Dp(),b="data-savedcursor",S="!!";G.exports=function(e,t){var r=e.attr(b);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),n=0;nV.legend.length)for(var K=V.legend.length;K(n==="legend"?1:0));if(L===!1&&(a[n]=void 0),!(L===!1&&!f.uirevision)&&(p("uirevision",a.uirevision),L!==!1)){p("borderwidth");var z=p("orientation"),F=p("yref"),N=p("xref"),B=z==="h",R=F==="paper",U=N==="paper",j,Z,re,fe="left";B?(j=0,h.getComponentMethod("rangeslider","isVisible")(i.xaxis)?R?(Z=1.1,re="bottom"):(Z=1,re="top"):R?(Z=-.1,re="top"):(Z=0,re="bottom")):(Z=1,re="auto",U?j=1.02:(j=1,fe="right")),b.coerce(f,c,{x:{valType:"number",editType:"legend",min:U?-2:0,max:U?3:1,dflt:j}},"x"),b.coerce(f,c,{y:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:Z}},"y"),p("traceorder",w),r.isGrouped(a[n])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",fe),p("yanchor",re),p("maxheight"),p("valign"),b.noneOrAll(f,c,["x","y"]);var le=p("title.text");if(le){p("title.side",B?"left":"top");var ce=b.extendFlat({},d,{size:b.bigFont(d.size)});b.coerceFont(p,"title.font",ce)}}}G.exports=function(i,a,s){var f,c=s.slice(),p=a.shapes;if(p)for(f=0;fz&&(L=z)}y[d][0]._groupMinRank=L,y[d][0]._preGroupSort=d}var F=function(Z,re){return Z[0]._groupMinRank-re[0]._groupMinRank||Z[0]._preGroupSort-re[0]._preGroupSort},N=function(Z,re){return Z.trace.legendrank-re.trace.legendrank||Z._preSort-re._preSort};for(y.forEach(function(Z,re){Z[0]._preGroupSort=re}),y.sort(F),d=0;d0)ue=ee.width;else return 0;return m?K:Math.min(ue,ne)};A.each(function(V){var ee=h.select(this),ne=S.ensureSingle(ee,"g","layers");ne.style("opacity",V[0].trace.opacity);var K=_.indentation,ue=_.valign,te=V[0].lineHeight,H=V[0].height;if(ue==="middle"&&K===0||!te||!H)ne.attr("transform",null);else{var ae={top:1,bottom:-1}[ue],ie=ae*(.5*(te-H+3))||0,ve=_.indentation;ne.attr("transform",E(ve,ie))}var Ae=ne.selectAll("g.legendfill").data([V]);Ae.enter().append("g").classed("legendfill",!0);var Ce=ne.selectAll("g.legendlines").data([V]);Ce.enter().append("g").classed("legendlines",!0);var Fe=ne.selectAll("g.legendsymbols").data([V]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([V]).enter().append("g").classed("legendpoints",!0)}).each(ce).each(F).each(B).each(N).each(U).each(fe).each(re).each(L).each(z).each(j).each(Z);function L(V){var ee=l(V),ne=ee.showFill,K=ee.showLine,ue=ee.showGradientLine,te=ee.showGradientFill,H=ee.anyFill,ae=ee.anyLine,ie=V[0],ve=ie.trace,Ae,Ce,Fe=r(ve),ze=Fe.colorscale,Ye=Fe.reversescale,it=function(Ne){if(Ne.size())if(ne)e.fillGroupStyle(Ne,M,!0);else{var ot="legendfill-"+ve.uid;e.gradient(Ne,M,ot,T(Ye),ze,"fill")}},st=function(Ne){if(Ne.size()){var ot="legendline-"+ve.uid;e.lineGroupStyle(Ne),e.gradient(Ne,M,ot,T(Ye),ze,"stroke")}},nt=o.hasMarkers(ve)||!H?"M5,0":ae?"M5,-2":"M5,-3",Qe=h.select(this),Le=Qe.select(".legendfill").selectAll("path").data(ne||te?[V]:[]);if(Le.enter().append("path").classed("js-fill",!0),Le.exit().remove(),Le.attr("d",nt+"h"+u+"v6h-"+u+"z").call(it),K||ue){var Te=I(void 0,ve.line,p,f);Ce=S.minExtend(ve,{line:{width:Te}}),Ae=[S.minExtend(ie,{trace:Ce})]}var pe=Qe.select(".legendlines").selectAll("path").data(K||ue?[Ae]:[]);pe.enter().append("path").classed("js-line",!0),pe.exit().remove(),pe.attr("d",nt+(ue?"l"+u+",0.0001":"h"+u)).call(K?e.lineGroupStyle:st)}function z(V){var ee=l(V),ne=ee.anyFill,K=ee.anyLine,ue=ee.showLine,te=ee.showMarker,H=V[0],ae=H.trace,ie=!te&&!K&&!ne&&o.hasText(ae),ve,Ae;function Ce(Le,Te,pe,Ne){var ot=S.nestedProperty(ae,Le).get(),ct=S.isArrayOrTypedArray(ot)&&Te?Te(ot):ot;if(m&&ct&&Ne!==void 0&&(ct=Ne),pe){if(ctpe[1])return pe[1]}return ct}function Fe(Le){return H._distinct&&H.index&&Le[H.index]?Le[H.index]:Le[0]}if(te||ie||ue){var ze={},Ye={};if(te){ze.mc=Ce("marker.color",Fe),ze.mx=Ce("marker.symbol",Fe),ze.mo=Ce("marker.opacity",S.mean,[.2,1]),ze.mlc=Ce("marker.line.color",Fe),ze.mlw=Ce("marker.line.width",S.mean,[0,5],c),Ye.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var it=Ce("marker.size",S.mean,[2,16],s);ze.ms=it,Ye.marker.size=it}ue&&(Ye.line={width:Ce("line.width",Fe,[0,10],f)}),ie&&(ze.tx="Aa",ze.tp=Ce("textposition",Fe),ze.ts=10,ze.tc=Ce("textfont.color",Fe),ze.tf=Ce("textfont.family",Fe),ze.tw=Ce("textfont.weight",Fe),ze.ty=Ce("textfont.style",Fe),ze.tv=Ce("textfont.variant",Fe),ze.tC=Ce("textfont.textcase",Fe),ze.tE=Ce("textfont.lineposition",Fe),ze.tS=Ce("textfont.shadow",Fe)),ve=[S.minExtend(H,ze)],Ae=S.minExtend(ae,Ye),Ae.selectedpoints=null,Ae.texttemplate=null}var st=h.select(this).select("g.legendpoints"),nt=st.selectAll("path.scatterpts").data(te?ve:[]);nt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",y),nt.exit().remove(),nt.call(e.pointStyle,Ae,M),te&&(ve[0].mrc=3);var Qe=st.selectAll("g.pointtext").data(ie?ve:[]);Qe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",y),Qe.exit().remove(),Qe.selectAll("text").call(e.textPointStyle,Ae,M)}function F(V){var ee=V[0].trace,ne=ee.type==="waterfall";if(V[0]._distinct&&ne){var K=V[0].trace[V[0].dir].marker;return V[0].mc=K.color,V[0].mlw=K.line.width,V[0].mlc=K.line.color,R(V,this,"waterfall")}var ue=[];ee.visible&&ne&&(ue=V[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 te=h.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(ue);te.enter().append("path").classed("legendwaterfall",!0).attr("transform",y).style("stroke-miterlimit",1),te.exit().remove(),te.each(function(H){var ae=h.select(this),ie=ee[H[0]].marker,ve=I(void 0,ie.line,d,c);ae.attr("d",H[1]).style("stroke-width",ve+"px").call(t.fill,ie.color),ve&&ae.call(t.stroke,ie.line.color)})}function N(V){R(V,this)}function B(V){R(V,this,"funnel")}function R(V,ee,ne){var K=V[0].trace,ue=K.marker||{},te=ue.line||{},H=ue.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",ae=ne?K.visible&&K.type===ne:b.traceIs(K,"bar"),ie=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(ae?[V]:[]);ie.enter().append("path").classed("legend"+ne,!0).attr("d",H).attr("transform",y),ie.exit().remove(),ie.each(function(ve){var Ae=h.select(this),Ce=ve[0],Fe=I(Ce.mlw,ue.line,d,c);Ae.style("stroke-width",Fe+"px");var ze=Ce.mcc;if(!_._inHover&&"mc"in Ce){var Ye=r(ue),it=Ye.mid;it===void 0&&(it=(Ye.max+Ye.min)/2),ze=e.tryColorscale(ue,"")(it)}var st=ze||Ce.mc||ue.color,nt=ue.pattern,Qe=e.getPatternAttr,Le=nt&&(Qe(nt.shape,0,"")||Qe(nt.path,0,""));if(Le){var Te=Qe(nt.bgcolor,0,null),pe=Qe(nt.fgcolor,0,null),Ne=nt.fgopacity,ot=g(nt.size,8,10),ct=g(nt.solidity,.5,1),rt="legend-"+K.uid;Ae.call(e.pattern,"legend",M,rt,Le,ot,ct,ze,nt.fillmode,Te,pe,Ne)}else Ae.call(t.fill,st);Fe&&t.stroke(Ae,Ce.mlc||te.color)})}function U(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(ee.visible&&b.traceIs(ee,"box-violin")?[V]:[]);ne.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),ne.exit().remove(),ne.each(function(){var K=h.select(this);if((ee.boxpoints==="all"||ee.points==="all")&&t.opacity(ee.fillcolor)===0&&t.opacity((ee.line||{}).color)===0){var ue=S.minExtend(ee,{marker:{size:m?s:S.constrain(ee.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ne.call(e.pointStyle,ue,M)}else{var te=I(void 0,ee.line,d,c);K.style("stroke-width",te+"px").call(t.fill,ee.fillcolor),te&&t.stroke(K,ee.line.color)}})}function j(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(ee.visible&&ee.type==="candlestick"?[V,V]:[]);ne.enter().append("path").classed("legendcandle",!0).attr("d",function(K,ue){return ue?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(K,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,d,c);te.style("stroke-width",ae+"px").call(t.fill,H.fillcolor),ae&&t.stroke(te,H.line.color)})}function Z(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(ee.visible&&ee.type==="ohlc"?[V,V]:[]);ne.enter().append("path").classed("legendohlc",!0).attr("d",function(K,ue){return ue?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(K,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,d,c);te.style("fill","none").call(e.dashLine,H.line.dash,ae),ae&&t.stroke(te,H.line.color)})}function re(V){le(V,this,"pie")}function fe(V){le(V,this,"funnelarea")}function le(V,ee,ne){var K=V[0],ue=K.trace,te=ne?ue.visible&&ue.type===ne:b.traceIs(ue,ne),H=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(te?[V]:[]);if(H.enter().append("path").classed("legend"+ne,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),H.exit().remove(),H.size()){var ae=ue.marker||{},ie=I(i(ae.line.width,K.pts),ae.line,d,c),ve="pieLike",Ae=S.minExtend(ue,{marker:{line:{width:ie}}},ve),Ce=S.minExtend(K,{trace:Ae},ve);n(H,Ce,Ae,M)}}function ce(V){var ee=V[0].trace,ne,K=[];if(ee.visible)switch(ee.type){case"histogram2d":case"heatmap":K=[["M-15,-2V4H15V-2Z"]],ne=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":K=[["M-6,-6V6H6V-6Z"]],ne=!0;break;case"densitymapbox":case"densitymap":K=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ne="radial";break;case"cone":K=[["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"]],ne=!1;break;case"streamtube":K=[["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"]],ne=!1;break;case"surface":K=[["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"]],ne=!0;break;case"mesh3d":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!1;break;case"volume":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!0;break;case"isosurface":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ne=!1;break}var ue=h.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(K);ue.enter().append("path").classed("legend3dandfriends",!0).attr("transform",y).style("stroke-miterlimit",1),ue.exit().remove(),ue.each(function(te,H){var ae=h.select(this),ie=r(ee),ve=ie.colorscale,Ae=ie.reversescale,Ce=function(it){if(it.size()){var st="legendfill-"+ee.uid;e.gradient(it,M,st,T(Ae,ne==="radial"),ve,"fill")}},Fe;if(ve){if(!ne){var Ye=ve.length;Fe=H===0?ve[Ae?Ye-1:0][1]:H===1?ve[Ae?0:Ye-1][1]:ve[Math.floor((Ye-1)/2)][1]}}else{var ze=ee.vertexcolor||ee.facecolor||ee.color;Fe=S.isArrayOrTypedArray(ze)?ze[H]||ze[0]:ze}ae.attr("d",te[0]),Fe?ae.call(t.fill,Fe):ae.call(Ce)})}};function T(x,A){var M=A?"radial":"horizontal";return M+(x?"":"reversed")}function l(x){var A=x[0].trace,M=A.contours,_=o.hasLines(A),w=o.hasMarkers(A),m=A.visible&&A.fill&&A.fill!=="none",u=!1,v=!1;if(M){var y=M.coloring;y==="lines"?u=!0:_=y==="none"||y==="heatmap"||M.showlines,M.type==="constraint"?m=M._operation!=="=":(y==="fill"||y==="heatmap")&&(v=!0)}return{showMarker:w,showLine:_,showFill:m,showGradientLine:u,showGradientFill:v,anyLine:_||u,anyFill:m||v}}function g(x,A,M){return x&&S.isArrayOrTypedArray(x)?A:x>M?M:x}}}),ZT=Ge({"src/components/legend/draw.js"($,G){var h=Mi(),b=gn(),S=Wc(),E=Lo(),e=b1(),t=rd(),r=Ss(),o=_o(),n=Ju(),i=Xw(),a=GT(),s=Qh(),f=s.LINE_SPACING,c=s.FROM_TL,p=s.FROM_BR,d=yM(),T=YT(),l=Gw(),g=1,x=/^legend[0-9]*$/;G.exports=function(j,Z){if(Z)M(j,Z);else{var re=j._fullLayout,fe=re._legends,le=re._infolayer.selectAll('[class^="legend"]');le.each(function(){var ne=h.select(this),K=ne.attr("class"),ue=K.split(" ")[0];ue.match(x)&&fe.indexOf(ue)===-1&&ne.remove()});for(var ce=0;ce1)}var ae=re.hiddenlabels||[];if(!V&&(!re.showlegend||!ee.length))return ce.selectAll("."+fe).remove(),re._topdefs.select("#"+le).remove(),S.autoMargin(U,fe);var ie=b.ensureSingle(ce,"g",fe,function(nt){V||nt.attr("pointer-events","all")}),ve=b.ensureSingleById(re._topdefs,"clipPath",le,function(nt){nt.append("rect")}),Ae=b.ensureSingle(ie,"rect","bg",function(nt){nt.attr("shape-rendering","crispEdges")});Ae.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Ce=b.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var ze;Fe.text?(ze=b.ensureSingle(Ce,"text",fe+"titletext"),ze.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),y(ze,Ce,U,Z,g)):Ce.selectAll("."+fe+"titletext").remove();var Ye=b.ensureSingle(ie,"rect","scrollbar",function(nt){nt.attr(a.scrollBarEnterAttrs).call(o.fill,a.scrollBarColor)}),it=Ce.selectAll("g.groups").data(ee);it.enter().append("g").attr("class","groups"),it.exit().remove();var st=it.selectAll("g.traces").data(b.identity);st.enter().append("g").attr("class","traces"),st.exit().remove(),st.style("opacity",function(nt){var Qe=nt[0].trace;return E.traceIs(Qe,"pie-like")?ae.indexOf(nt[0].label)!==-1?.5:1:Qe.visible==="legendonly"?.5:1}).each(function(){h.select(this).call(m,U,Z)}).call(T,U,Z).each(function(){V||h.select(this).call(v,U,fe)}),b.syncOrAsync([S.previousPromises,function(){return z(U,it,st,Z)},function(){var nt=re._size,Qe=Z.borderwidth,Le=Z.xref==="paper",Te=Z.yref==="paper";if(Fe.text&&A(ze,Z,Qe),!V){var pe,Ne;Le?pe=nt.l+nt.w*Z.x-c[N(Z)]*Z._width:pe=re.width*Z.x-c[N(Z)]*Z._width,Te?Ne=nt.t+nt.h*(1-Z.y)-c[B(Z)]*Z._effHeight:Ne=re.height*(1-Z.y)-c[B(Z)]*Z._effHeight;var ot=F(U,fe,pe,Ne);if(ot)return;if(re.margin.autoexpand){var ct=pe,rt=Ne;pe=Le?b.constrain(pe,0,re.width-Z._width):ct,Ne=Te?b.constrain(Ne,0,re.height-Z._effHeight):rt,pe!==ct&&b.log("Constrain "+fe+".x to make legend fit inside graph"),Ne!==rt&&b.log("Constrain "+fe+".y to make legend fit inside graph")}r.setTranslate(ie,pe,Ne)}if(Ye.on(".drag",null),ie.on("wheel",null),V||Z._height<=Z._maxHeight||U._context.staticPlot){var Ft=Z._effHeight;V&&(Ft=Z._height),Ae.attr({width:Z._width-Qe,height:Ft-Qe,x:Qe/2,y:Qe/2}),r.setTranslate(Ce,0,0),ve.select("rect").attr({width:Z._width-2*Qe,height:Ft-2*Qe,x:Qe,y:Qe}),r.setClipUrl(Ce,le,U),r.setRect(Ye,0,0,0,0),delete Z._scrollY}else{var Nt=Math.max(a.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),$t=Z._effHeight-Nt-2*a.scrollBarMargin,rr=Z._height-Z._effHeight,Mr=$t/rr,Sr=Math.min(Z._scrollY||0,rr);Ae.attr({width:Z._width-2*Qe+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-Qe,x:Qe/2,y:Qe/2}),ve.select("rect").attr({width:Z._width-2*Qe+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-2*Qe,x:Qe,y:Qe+Sr}),r.setClipUrl(Ce,le,U),xe(Sr,Nt,Mr),ie.on("wheel",function(){Sr=b.constrain(Z._scrollY+h.event.deltaY/rr*$t,0,rr),xe(Sr,Nt,Mr),Sr!==0&&Sr!==rr&&h.event.preventDefault()});var Zr,Ar,Br,Mt=function(Lt,Ct,Ot){var Wt=(Ot-Ct)/Mr+Lt;return b.constrain(Wt,0,rr)},je=function(Lt,Ct,Ot){var Wt=(Ct-Ot)/Mr+Lt;return b.constrain(Wt,0,rr)},$e=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"?Zr=Lt.changedTouches[0].clientY:Zr=Lt.clientY,Br=Sr}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.buttons===2||Lt.ctrlKey||(Lt.type==="touchmove"?Ar=Lt.changedTouches[0].clientY:Ar=Lt.clientY,Sr=Mt(Br,Zr,Ar),xe(Sr,Nt,Mr))});Ye.call($e);var Ee=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"&&(Zr=Lt.changedTouches[0].clientY,Br=Sr)}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.type==="touchmove"&&(Ar=Lt.changedTouches[0].clientY,Sr=je(Br,Zr,Ar),xe(Sr,Nt,Mr))});Ce.call(Ee)}function xe(Lt,Ct,Ot){Z._scrollY=U._fullLayout[fe]._scrollY=Lt,r.setTranslate(Ce,0,-Lt),r.setRect(Ye,Z._width,a.scrollBarMargin+Lt*Ot,a.scrollBarWidth,Ct),ve.select("rect").attr("y",Qe+Lt)}if(U._context.edits.legendPosition){var ye,Me,Xe,Je;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:U,prepFn:function(Lt){if(Lt.target!==Ye.node()){var Ct=r.getTranslate(ie);Xe=Ct.x,Je=Ct.y}},moveFn:function(Lt,Ct){if(Xe!==void 0&&Je!==void 0){var Ot=Xe+Lt,Wt=Je+Ct;r.setTranslate(ie,Ot,Wt),ye=t.align(Ot,Z._width,nt.l,nt.l+nt.w,Z.xanchor),Me=t.align(Wt+Z._height,-Z._height,nt.t+nt.h,nt.t,Z.yanchor)}},doneFn:function(){if(ye!==void 0&&Me!==void 0){var Lt={};Lt[fe+".x"]=ye,Lt[fe+".y"]=Me,E.call("_guiRelayout",U,Lt)}},clickFn:function(Lt,Ct){var Ot=ce.selectAll("g.traces").filter(function(){var Wt=this.getBoundingClientRect();return Ct.clientX>=Wt.left&&Ct.clientX<=Wt.right&&Ct.clientY>=Wt.top&&Ct.clientY<=Wt.bottom});Ot.size()>0&&w(U,ie,Ot,Lt,Ct)}})}}],U)}}function _(U,j,Z){var re=U[0],fe=re.width,le=j.entrywidthmode,ce=re.trace.legendwidth||j.entrywidth;return le==="fraction"?j._maxWidth*ce:Z+(ce||fe)}function w(U,j,Z,re,fe){var le=Z.data()[0][0].trace,ce={event:fe,node:Z.node(),curveNumber:le.index,expandedIndex:le.index,data:U.data,layout:U.layout,frames:U._transitionData._frames,config:U._context,fullData:U._fullData,fullLayout:U._fullLayout};le._group&&(ce.group=le._group),E.traceIs(le,"pie-like")&&(ce.label=Z.datum()[0].label);var V=e.triggerHandler(U,"plotly_legendclick",ce);if(re===1){if(V===!1)return;j._clickTimeout=setTimeout(function(){U._fullLayout&&i(Z,U,re)},U._context.doubleClickDelay)}else if(re===2){j._clickTimeout&&clearTimeout(j._clickTimeout),U._legendMouseDownTime=0;var ee=e.triggerHandler(U,"plotly_legenddoubleclick",ce);ee!==!1&&V!==!1&&i(Z,U,re)}}function m(U,j,Z){var re=R(Z),fe=U.data()[0][0],le=fe.trace,ce=E.traceIs(le,"pie-like"),V=!Z._inHover&&j._context.edits.legendText&&!ce,ee=Z._maxNameLength,ne,K;fe.groupTitle?(ne=fe.groupTitle.text,K=fe.groupTitle.font):(K=Z.font,Z.entries?ne=fe.text:(ne=ce?fe.label:le.name,le._meta&&(ne=b.templateString(ne,le._meta))));var ue=b.ensureSingle(U,"text",re+"text");ue.attr("text-anchor","start").call(r.font,K).text(V?u(ne,ee):ne);var te=Z.indentation+Z.itemwidth+a.itemGap*2;n.positionText(ue,te,0),V?ue.call(n.makeEditable,{gd:j,text:ne}).call(y,U,j,Z).on("edit",function(H){this.text(u(H,ee)).call(y,U,j,Z);var ae=fe.trace._fullInput||{},ie={};return ie.name=H,ae._isShape?E.call("_guiRelayout",j,"shapes["+le.index+"].name",ie.name):E.call("_guiRestyle",j,ie,le.index)}):y(ue,U,j,Z)}function u(U,j){var Z=Math.max(4,j);if(U&&U.trim().length>=Z/2)return U;U=U||"";for(var re=Z-U.length;re>0;re--)U+=" ";return U}function v(U,j,Z){var re=j._context.doubleClickDelay,fe,le=1,ce=b.ensureSingle(U,"rect",Z+"toggle",function(V){j._context.staticPlot||V.style("cursor","pointer").attr("pointer-events","all"),V.call(o.fill,"rgba(0,0,0,0)")});j._context.staticPlot||(ce.on("mousedown",function(){fe=new Date().getTime(),fe-j._legendMouseDownTimere&&(le=Math.max(le-1,1)),w(j,V,U,le,h.event)}}))}function y(U,j,Z,re,fe){re._inHover&&U.attr("data-notex",!0),n.convertToTspans(U,Z,function(){I(j,Z,re,fe)})}function I(U,j,Z,re){var fe=U.data()[0][0],le=fe&&fe.trace.showlegend;if(Array.isArray(le)&&(le=le[fe.i]!==!1),!Z._inHover&&fe&&!le){U.remove();return}var ce=U.select("g[class*=math-group]"),V=ce.node(),ee=R(Z);Z||(Z=j._fullLayout[ee]);var ne=Z.borderwidth,K;re===g?K=Z.title.font:fe.groupTitle?K=fe.groupTitle.font:K=Z.font;var ue=K.size*f,te,H;if(V){var ae=r.bBox(V);te=ae.height,H=ae.width,re===g?r.setTranslate(ce,ne,ne+te*.75):r.setTranslate(ce,0,te*.25)}else{var ie="."+ee+(re===g?"title":"")+"text",ve=U.select(ie),Ae=n.lineCount(ve),Ce=ve.node();if(te=ue*Ae,H=Ce?r.bBox(Ce).width:0,re===g)Z.title.side==="left"&&(H+=a.itemGap*2),n.positionText(ve,ne+a.titlePad,ne+ue);else{var Fe=a.itemGap*2+Z.indentation+Z.itemwidth;fe.groupTitle&&(Fe=a.itemGap,H-=Z.indentation+Z.itemwidth),n.positionText(ve,Fe,-ue*((Ae-1)/2-.3))}}re===g?(Z._titleWidth=H,Z._titleHeight=te):(fe.lineHeight=ue,fe.height=Math.max(te,16)+3,fe.width=H)}function L(U){var j=0,Z=0,re=U.title.side;return re&&(re.indexOf("left")!==-1&&(j=U._titleWidth),re.indexOf("top")!==-1&&(Z=U._titleHeight)),[j,Z]}function z(U,j,Z,re){var fe=U._fullLayout,le=R(re);re||(re=fe[le]);var ce=fe._size,V=l.isVertical(re),ee=l.isGrouped(re),ne=re.entrywidthmode==="fraction",K=re.borderwidth,ue=2*K,te=a.itemGap,H=re.indentation+re.itemwidth+te*2,ae=2*(K+te),ie=B(re),ve=re.y<0||re.y===0&&ie==="top",Ae=re.y>1||re.y===1&&ie==="bottom",Ce=re.tracegroupgap,Fe={};const{orientation:ze,yref:Ye}=re;let{maxheight:it}=re;const st=ve||Ae||ze!=="v"||Ye!=="paper";it||(it=st?.5:1);const nt=st?fe.height:ce.h;re._maxHeight=Math.max(it>1?it:it*nt,30);var Qe=0;re._width=0,re._height=0;var Le=L(re);if(V)Z.each(function(xe){var ye=xe[0].height;r.setTranslate(this,K+Le[0],K+Le[1]+re._height+ye/2+te),re._height+=ye,re._width=Math.max(re._width,xe[0].width)}),Qe=H+re._width,re._width+=te+H+ue,re._height+=ae,ee&&(j.each(function(xe,ye){r.setTranslate(this,0,ye*re.tracegroupgap)}),re._height+=(re._lgroupsLength-1)*re.tracegroupgap);else{var Te=N(re),pe=re.x<0||re.x===0&&Te==="right",Ne=re.x>1||re.x===1&&Te==="left",ot=Ae||ve,ct=fe.width/2;re._maxWidth=Math.max(pe?ot&&Te==="left"?ce.l+ce.w:ct:Ne?ot&&Te==="right"?ce.r+ce.w:ct:ce.w,2*H);var rt=0,Ft=0;Z.each(function(xe){var ye=_(xe,re,H);rt=Math.max(rt,ye),Ft+=ye}),Qe=null;var Nt=0;if(ee){var $t=0,rr=0,Mr=0;j.each(function(){var xe=0,ye=0;h.select(this).selectAll("g.traces").each(function(Xe){var Je=_(Xe,re,H),Lt=Xe[0].height;r.setTranslate(this,Le[0],Le[1]+K+te+Lt/2+ye),ye+=Lt,xe=Math.max(xe,Je),Fe[Xe[0].trace.legendgroup]=xe});var Me=xe+te;rr>0&&Me+K+rr>re._maxWidth?(Nt=Math.max(Nt,rr),rr=0,Mr+=$t+Ce,$t=ye):$t=Math.max($t,ye),r.setTranslate(this,rr,Mr),rr+=Me}),re._width=Math.max(Nt,rr)+K,re._height=Mr+$t+ae}else{var Sr=Z.size(),Zr=Ft+ue+(Sr-1)*te=re._maxWidth&&(Nt=Math.max(Nt,je),Br=0,Mt+=Ar,re._height+=Ar,Ar=0),r.setTranslate(this,Le[0]+K+Br,Le[1]+K+Mt+ye/2+te),je=Br+Me+te,Br+=Xe,Ar=Math.max(Ar,ye)}),Zr?(re._width=Br+ue,re._height=Ar+ae):(re._width=Math.max(Nt,je)+ue,re._height+=Ar+ae)}}re._width=Math.ceil(Math.max(re._width+Le[0],re._titleWidth+2*(K+a.titlePad))),re._height=Math.ceil(Math.max(re._height+Le[1],re._titleHeight+2*(K+a.itemGap))),re._effHeight=Math.min(re._height,re._maxHeight);var $e=U._context.edits,Ee=$e.legendText||$e.legendPosition;Z.each(function(xe){var ye=h.select(this).select("."+le+"toggle"),Me=xe[0].height,Xe=xe[0].trace.legendgroup,Je=_(xe,re,H);ee&&Xe!==""&&(Je=Fe[Xe]);var Lt=Ee?H:Qe||Je;!V&&!ne&&(Lt+=te/2),r.setRect(ye,0,-Me/2,Lt,Me)})}function F(U,j,Z,re){var fe=U._fullLayout,le=fe[j],ce=N(le),V=B(le),ee=le.xref==="paper",ne=le.yref==="paper";U._fullLayout._reservedMargin[j]={};var K=le.y<.5?"b":"t",ue=le.x<.5?"l":"r",te={r:fe.width-Z,l:Z+le._width,b:fe.height-re,t:re+le._effHeight};if(ee&&ne)return S.autoMargin(U,j,{x:le.x,y:le.y,l:le._width*c[ce],r:le._width*p[ce],b:le._effHeight*p[V],t:le._effHeight*c[V]});ee?U._fullLayout._reservedMargin[j][K]=te[K]:ne||le.orientation==="v"?U._fullLayout._reservedMargin[j][ue]=te[ue]:U._fullLayout._reservedMargin[j][K]=te[K]}function N(U){return b.isRightAnchor(U)?"right":b.isCenterAnchor(U)?"center":"left"}function B(U){return b.isBottomAnchor(U)?"bottom":b.isMiddleAnchor(U)?"middle":"top"}function R(U){return U._id||"legend"}}}),WT=Ge({"src/components/fx/hover.js"($){var G=Mi(),h=Pi(),b=Bs(),S=gn(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=b1(),o=Ju(),n=gM(),i=Ss(),a=_o(),s=rd(),f=ws(),c=rh().zindexSeparator,p=Lo(),d=Vv(),T=Ef(),l=HT(),g=ZT(),x=T.YANGLE,A=Math.PI*x/180,M=1/Math.sin(A),_=Math.cos(A),w=Math.sin(A),m=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,v={box:!0,ohlc:!0,violin:!0,candlestick:!0},y={scatter:!0,scattergl:!0,splom:!0};function I(H,ae){return H.distance-ae.distance}$.hover=function(ae,ie,ve,Ae){ae=S.getGraphDiv(ae);var Ce=ie.target;S.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(ae,ie,ve,Ae,Ce)})},$.loneHover=function(ae,ie){var ve=!0;Array.isArray(ae)||(ve=!1,ae=[ae]);var Ae=ie.gd,Ce=K(Ae),Fe=ue(Ae),ze=ae.map(function(Ne){var ot=Ne._x0||Ne.x0||Ne.x||0,ct=Ne._x1||Ne.x1||Ne.x||0,rt=Ne._y0||Ne.y0||Ne.y||0,Ft=Ne._y1||Ne.y1||Ne.y||0,Nt=Ne.eventData;if(Nt){var $t=Math.min(ot,ct),rr=Math.max(ot,ct),Mr=Math.min(rt,Ft),Sr=Math.max(rt,Ft),Zr=Ne.trace;if(p.traceIs(Zr,"gl3d")){var Ar=Ae._fullLayout[Zr.scene]._scene.container,Br=Ar.offsetLeft,Mt=Ar.offsetTop;$t+=Br,rr+=Br,Mr+=Mt,Sr+=Mt}Nt.bbox={x0:$t+Fe,x1:rr+Fe,y0:Mr+Ce,y1:Sr+Ce},ie.inOut_bbox&&ie.inOut_bbox.push(Nt.bbox)}else Nt=!1;return{color:Ne.color||a.defaultLine,x0:Ne.x0||Ne.x||0,x1:Ne.x1||Ne.x||0,y0:Ne.y0||Ne.y||0,y1:Ne.y1||Ne.y||0,xLabel:Ne.xLabel,yLabel:Ne.yLabel,zLabel:Ne.zLabel,text:Ne.text,name:Ne.name,idealAlign:Ne.idealAlign,borderColor:Ne.borderColor,fontFamily:Ne.fontFamily,fontSize:Ne.fontSize,fontColor:Ne.fontColor,fontWeight:Ne.fontWeight,fontStyle:Ne.fontStyle,fontVariant:Ne.fontVariant,nameLength:Ne.nameLength,textAlign:Ne.textAlign,trace:Ne.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ne.hovertemplate||!1,hovertemplateLabels:Ne.hovertemplateLabels||!1,eventData:Nt}}),Ye=!1,it=N(ze,{gd:Ae,hovermode:"closest",rotateLabels:Ye,bgColor:ie.bgColor||a.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),st=it.hoverLabels,nt=5,Qe=0,Le=0;st.sort(function(Ne,ot){return Ne.y0-ot.y0}).each(function(Ne,ot){var ct=Ne.y0-Ne.by/2;ct-ntrr[0]._length||ra<0||ra>Mr[0]._length)return s.unhoverRaw(H,ae)}if(ae.pointerX=ta+rr[0]._offset,ae.pointerY=ra+Mr[0]._offset,"xval"in ae?Ee=d.flat(Ce,ae.xval):Ee=d.p2c(rr,ta),"yval"in ae?xe=d.flat(Ce,ae.yval):xe=d.p2c(Mr,ra),!h(Ee[0])||!h(xe[0]))return S.warn("Fx.hover failed",ae,H),s.unhoverRaw(H,ae)}var ja=1/0;function ir(li,ts){for(Me=0;Me<$e.length;Me++)if(Xe=$e[Me],!(!Xe||!Xe[0]||!Xe[0].trace)&&(Je=Xe[0].trace,!(Je.visible!==!0||Je._length===0)&&["carpet","contourcarpet"].indexOf(Je._module.name)===-1)){if(Ot=Qe,d.isUnifiedHover(Ot)&&(Ot=Ot.charAt(0)),Je.type==="splom"?(Ct=0,Lt=Ce[Ct]):(Lt=d.getSubplot(Je),Ct=Ce.indexOf(Lt)),pr={cd:Xe,trace:Je,xa:rr[Ct],ya:Mr[Ct],maxHoverDistance:Br,maxSpikeDistance:Mt,index:!1,distance:Math.min(ja,Br),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:a.defaultLine,name:Je.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},ze[Lt]&&(pr.subplot=ze[Lt]._subplot),ze._splomScenes&&ze._splomScenes[Je.uid]&&(pr.scene=ze._splomScenes[Je.uid]),Ot==="array"){var Ho=ae[Me];"pointNumber"in Ho?(pr.index=Ho.pointNumber,Ot="closest"):(Ot="","xval"in Ho&&(Wt=Ho.xval,Ot="x"),"yval"in Ho&&(_r=Ho.yval,Ot=Ot?"closest":"y"))}else li!==void 0&&ts!==void 0?(Wt=li,_r=ts):(Wt=Ee[Ct],_r=xe[Ct]);if(hr=je.length,Br!==0)if(Je._module&&Je._module.hoverPoints){var Gs=Je._module.hoverPoints(pr,Wt,_r,Ot,{finiteRange:!0,hoverLayer:ze._hoverlayer,hoversubplots:Ye,gd:H});if(Gs)for(var cs,Jo=0;Johr&&(je.splice(0,hr),ja=je[0].distance),nt&&Mt!==0&&je.length===0){pr.distance=Mt,pr.index=!1;var Uo=Je._module.hoverPoints(pr,Wt,_r,"closest",{hoverLayer:ze._hoverlayer});if(Uo&&(Uo=Uo.filter(function(ho){return ho.spikeDistance<=Mt})),Uo&&Uo.length){var Xs,js=Uo.filter(function(ho){return ho.xa.showspikes&&ho.xa.spikesnap!=="hovered data"});if(js.length){var ol=js[0];h(ol.x0)&&h(ol.y0)&&(Xs=ar(ol),(!Fr.vLinePoint||Fr.vLinePoint.spikeDistance>Xs.spikeDistance)&&(Fr.vLinePoint=Xs))}var fs=Uo.filter(function(ho){return ho.ya.showspikes&&ho.ya.spikesnap!=="hovered data"});if(fs.length){var Zo=fs[0];h(Zo.x0)&&h(Zo.y0)&&(Xs=ar(Zo),(!Fr.hLinePoint||Fr.hLinePoint.spikeDistance>Xs.spikeDistance)&&(Fr.hLinePoint=Xs))}}}}}ir();function qt(li,ts,Ho){for(var Gs=null,cs=1/0,Jo,Uo=0;Uoli.trace.index===Vn.trace.index):je=[Vn];var hi=je.length,Ti=ne("x",Vn,ze),Dt=ne("y",Vn,ze);ir(Ti,Dt);var yt=[],Er={},Nr=0,jr=function(li){var ts=v[li.trace.type]?z(li):li.trace.index;if(!Er[ts])Nr++,Er[ts]=Nr,yt.push(li);else{var Ho=Er[ts]-1,Gs=yt[Ho];Ho>0&&Math.abs(li.distance)hi-1;Ir--)jr(je[Ir]);je=yt,on()}var Ur=H._hoverdata,sn=[],Kr=K(H),Tt=ue(H);for(const li of je){var or=d.makeEventData(li,li.trace,li.cd);if(li.hovertemplate!==!1){var Dr=!1;li.cd[li.index]&&li.cd[li.index].ht&&(Dr=li.cd[li.index].ht),li.hovertemplate=Dr||li.trace.hovertemplate||!1}if(li.xa&&li.ya){var ln=li.x0+li.xa._offset,Pn=li.x1+li.xa._offset,jn=li.y0+li.ya._offset,Un=li.y1+li.ya._offset,un=Math.min(ln,Pn),Rn=Math.max(ln,Pn),di=Math.min(jn,Un),Ma=Math.max(jn,Un);or.bbox={x0:un+Tt,x1:Rn+Tt,y0:di+Kr,y1:Ma+Kr}}li.eventData=[or],sn.push(or)}H._hoverdata=sn;var Ei=Qe==="y"&&($e.length>1||je.length>1)||Qe==="closest"&&En&&je.length>1,Hi=a.combine(ze.plot_bgcolor||a.background,ze.paper_bgcolor),io=N(je,{gd:H,hovermode:Qe,rotateLabels:Ei,bgColor:Hi,container:ze._hoverlayer,outerContainer:ze._paper.node(),commonLabelOpts:ze.hoverlabel,hoverdistance:ze.hoverdistance}),no=io.hoverLabels;if(d.isUnifiedHover(Qe)||(R(no,Ei,ze,io.commonLabelBoundingBox),Z(no,Ei,ze._invScaleX,ze._invScaleY)),Ae&&Ae.tagName){var bo=p.getComponentMethod("annotations","hasClickToShow")(H,sn);n(G.select(Ae),bo?"pointer":"")}!Ae||ve||!le(H,ae,Ur)||(Ur&&H.emit("plotly_unhover",{event:ae,points:Ur}),H.emit("plotly_hover",{event:ae,points:H._hoverdata,xaxes:rr,yaxes:Mr,xvals:Ee,yvals:xe}))}function z(H){return[H.trace.index,H.index,H.x0,H.y0,H.name,H.attr,H.xa?H.xa._id:"",H.ya?H.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function N(H,ae){var ie=ae.gd,ve=ie._fullLayout,Ae=ae.hovermode,Ce=ae.rotateLabels,Fe=ae.bgColor,ze=ae.container,Ye=ae.outerContainer,it=ae.commonLabelOpts||{};if(H.length===0)return[[]];var st=ae.fontFamily||T.HOVERFONT,nt=ae.fontSize||T.HOVERFONTSIZE,Qe=ae.fontWeight||ve.font.weight,Le=ae.fontStyle||ve.font.style,Te=ae.fontVariant||ve.font.variant,pe=ae.fontTextcase||ve.font.textcase,Ne=ae.fontLineposition||ve.font.lineposition,ot=ae.fontShadow||ve.font.shadow,ct=H[0],rt=ct.xa,Ft=ct.ya,Nt=Ae.charAt(0),$t=Nt+"Label",rr=ct[$t];if(rr===void 0&&rt.type==="multicategory")for(var Mr=0;Mrve.width-Tt&&(or=ve.width-Tt),hi.attr("d","M"+(Ur-or)+",0L"+(Ur-or+m)+","+Kr+m+"H"+Tt+"v"+Kr+(u*2+Ir.height)+"H"+-Tt+"V"+Kr+m+"H"+(Ur-or-m)+"Z"),Ur=or,Me.minX=Ur-Tt,Me.maxX=Ur+Tt,rt.side==="top"?(Me.minY=sn-(u*2+Ir.height),Me.maxY=sn-u):(Me.minY=sn+u,Me.maxY=sn+(u*2+Ir.height))}else{var Dr,ln,Pn;Ft.side==="right"?(Dr="start",ln=1,Pn="",Ur=rt._offset+rt._length):(Dr="end",ln=-1,Pn="-",Ur=rt._offset),sn=Ft._offset+(ct.y0+ct.y1)/2,Ti.attr("text-anchor",Dr),hi.attr("d","M0,0L"+Pn+m+","+m+"V"+(u+Ir.height/2)+"h"+Pn+(u*2+Ir.width)+"V-"+(u+Ir.height/2)+"H"+Pn+m+"V-"+m+"Z"),Me.minY=sn-(u+Ir.height/2),Me.maxY=sn+(u+Ir.height/2),Ft.side==="right"?(Me.minX=Ur+m,Me.maxX=Ur+m+(u*2+Ir.width)):(Me.minX=Ur-m-(u*2+Ir.width),Me.maxX=Ur-m);var jn=Ir.height/2,Un=Zr-Ir.top-jn,un="clip"+ve._uid+"commonlabel"+Ft._id,Rn;if(Urhi.hoverinfo!=="none");if(Vn.length===0)return[];var Xe=ve.hoverlabel,Je=Xe.font,Lt=Vn[0],Ct=((Ae==="x unified"?Lt.xa:Lt.ya).unifiedhovertitle||{}).text,Ot=Ct?S.hovertemplateString({data:Ae==="x unified"?[{xa:Lt.xa,x:Lt.xVal}]:[{ya:Lt.ya,y:Lt.yVal}],fallback:Lt.trace.hovertemplatefallback,locale:ve._d3locale,template:Ct}):rr,Wt={showlegend:!0,legend:{title:{text:Ot,font:Je},font:Je,bgcolor:Xe.bgcolor,bordercolor:Xe.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:ve.legend?ve.legend.traceorder:void 0,orientation:"v"}},_r={font:Je};l(Wt,_r,ie._fullData);var pr=_r.legend;pr.entries=[];for(var hr=0;hr=0?fa=pn:wn+Ea=0?fa=wn:Kn+Ea=0?ga=Vr:on+ja=0?ga=on:da+ja=0,(Vn.idealAlign==="top"||!Ei)&&Hi?(Pn-=Un/2,Vn.anchor="end"):Ei?(Pn+=Un/2,Vn.anchor="start"):Vn.anchor="middle",Vn.crossPos=Pn;else{if(Vn.pos=Pn,Ei=ln+jn/2+Ma<=Ar,Hi=ln-jn/2-Ma>=0,(Vn.idealAlign==="left"||!Ei)&&Hi)ln-=jn/2,Vn.anchor="end";else if(Ei)ln+=jn/2,Vn.anchor="start";else{Vn.anchor="middle";var io=Ma/2,no=ln+io-Ar,bo=ln-io;no>0&&(ln-=no),bo<0&&(ln+=-bo)}Vn.crossPos=ln}sn.attr("text-anchor",Vn.anchor),Tt&&Kr.attr("text-anchor",Vn.anchor),hi.attr("transform",e(ln,Pn)+(Ce?t(x):""))}),{hoverLabels:ka,commonLabelBoundingBox:Me}}function B(H,ae,ie,ve,Ae,Ce){var Fe,ze,Ye="",it="";H.nameOverride!==void 0&&(H.name=H.nameOverride),H.name&&(H.trace._meta&&(H.name=S.templateString(H.name,H.trace._meta)),Ye=V(H.name,H.nameLength));var st=ie.charAt(0),nt=st==="x"?"y":"x";H.zLabel!==void 0?(H.xLabel!==void 0&&(it+="x: "+H.xLabel+"
"),H.yLabel!==void 0&&(it+="y: "+H.yLabel+"
"),H.trace.type!=="choropleth"&&H.trace.type!=="choroplethmapbox"&&H.trace.type!=="choroplethmap"&&(it+=(it?"z: ":"")+H.zLabel)):ae&&H[st+"Label"]===Ae?it=H[nt+"Label"]||"":H.xLabel===void 0?H.yLabel!==void 0&&H.trace.type!=="scattercarpet"&&(it=H.yLabel):H.yLabel===void 0?it=H.xLabel:it="("+H.xLabel+", "+H.yLabel+")",(H.text||H.text===0)&&!Array.isArray(H.text)&&(it+=(it?"
":"")+H.text),H.extraText!==void 0&&(it+=(it?"
":"")+H.extraText),Ce&&it===""&&!H.hovertemplate&&(Ye===""&&Ce.remove(),it=Ye),(ze=(Fe=H.trace)==null?void 0:Fe.hoverlabel)!=null&&ze.split&&(H.hovertemplate="");const{hovertemplate:Qe=!1}=H;if(Qe){const Le=H.hovertemplateLabels||H;H[st+"Label"]!==Ae&&(Le[st+"other"]=Le[st+"Val"],Le[st+"otherLabel"]=Le[st+"Label"]),it=S.hovertemplateString({data:[H.eventData[0]||{},H.trace._meta],fallback:H.trace.hovertemplatefallback,labels:Le,locale:ve._d3locale,template:Qe}),it=it.replace(F,(Te,pe)=>(Ye=V(pe,H.nameLength),""))}return[it,Ye]}function R(H,ae,ie,ve){var Ae=ae?"xa":"ya",Ce=ae?"ya":"xa",Fe=0,ze=1,Ye=H.size(),it=new Array(Ye),st=0,nt=ve.minX,Qe=ve.maxX,Le=ve.minY,Te=ve.maxY,pe=function(Ee){return Ee*ie._invScaleX},Ne=function(Ee){return Ee*ie._invScaleY};H.each(function(Ee){var xe=Ee[Ae],ye=Ee[Ce],Me=xe._id.charAt(0)==="x",Xe=xe.range;st===0&&Xe&&Xe[0]>Xe[1]!==Me&&(ze=-1);var Je=0,Lt=Me?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var Ct=U(Ee,ae),Ot=Ee.anchor,Wt=Ot==="end"?-1:1,_r,pr;if(Ot==="middle")_r=Ee.crossPos+(Me?Ne(Ct.y-Ee.by/2):pe(Ee.bx/2+Ee.tx2width/2)),pr=_r+(Me?Ne(Ee.by):pe(Ee.bx));else if(Me)_r=Ee.crossPos+Ne(m+Ct.y)-Ne(Ee.by/2-m),pr=_r+Ne(Ee.by);else{var hr=pe(Wt*m+Ct.x),Fr=hr+pe(Wt*Ee.bx);_r=Ee.crossPos+Math.min(hr,Fr),pr=Ee.crossPos+Math.max(hr,Fr)}Me?Le!==void 0&&Te!==void 0&&Math.min(pr,Te)-Math.max(_r,Le)>1&&(ye.side==="left"?(Je=ye._mainLinePosition,Lt=ie.width):Lt=ye._mainLinePosition):nt!==void 0&&Qe!==void 0&&Math.min(pr,Qe)-Math.max(_r,nt)>1&&(ye.side==="top"?(Je=ye._mainLinePosition,Lt=ie.height):Lt=ye._mainLinePosition)}it[st++]=[{datum:Ee,traceIndex:Ee.trace.index,dp:0,pos:Ee.pos,posref:Ee.posref,size:Ee.by*(Me?M:1)/2,pmin:Je,pmax:Lt}]}),it.sort(function(Ee,xe){return Ee[0].posref-xe[0].posref||ze*(xe[0].traceIndex-Ee[0].traceIndex)});var ot,ct,rt,Ft,Nt,$t,rr;function Mr(Ee){var xe=Ee[0],ye=Ee[Ee.length-1];if(ct=xe.pmin-xe.pos-xe.dp+xe.size,rt=ye.pos+ye.dp+ye.size-xe.pmax,ct>.01){for(Nt=Ee.length-1;Nt>=0;Nt--)Ee[Nt].dp+=ct;ot=!1}if(!(rt<.01)){if(ct<-.01){for(Nt=Ee.length-1;Nt>=0;Nt--)Ee[Nt].dp-=rt;ot=!1}if(ot){var Me=0;for(Ft=0;Ftxe.pmax&&Me++;for(Ft=Ee.length-1;Ft>=0&&!(Me<=0);Ft--)$t=Ee[Ft],$t.pos>xe.pmax-1&&($t.del=!0,Me--);for(Ft=0;Ft=0;Nt--)Ee[Nt].dp-=rt;for(Ft=Ee.length-1;Ft>=0&&!(Me<=0);Ft--)$t=Ee[Ft],$t.pos+$t.dp+$t.size>xe.pmax&&($t.del=!0,Me--)}}}for(;!ot&&Fe<=Ye;){for(Fe++,ot=!0,Ft=0;Ft.01){for(Nt=Zr.length-1;Nt>=0;Nt--)Zr[Nt].dp+=ct;for(Sr.push.apply(Sr,Zr),it.splice(Ft+1,1),rr=0,Nt=Sr.length-1;Nt>=0;Nt--)rr+=Sr[Nt].dp;for(rt=rr/Sr.length,Nt=Sr.length-1;Nt>=0;Nt--)Sr[Nt].dp-=rt;ot=!1}else Ft++}it.forEach(Mr)}for(Ft=it.length-1;Ft>=0;Ft--){var Mt=it[Ft];for(Nt=Mt.length-1;Nt>=0;Nt--){var je=Mt[Nt],$e=je.datum;$e.offset=je.dp,$e.del=je.del}}}function U(H,ae){var ie=0,ve=H.offset;return ae&&(ve*=-w,ie=H.offset*_),{x:ie,y:ve}}function j(H){var ae={start:1,end:-1,middle:0}[H.anchor],ie=ae*(m+u),ve=ie+ae*(H.txwidth+u),Ae=H.anchor==="middle";return Ae&&(ie-=H.tx2width/2,ve+=H.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:ve}}function Z(H,ae,ie,ve){var Ae=function(Fe){return Fe*ie},Ce=function(Fe){return Fe*ve};H.each(function(Fe){var ze=G.select(this);if(Fe.del)return ze.remove();var Ye=ze.select("text.nums"),it=Fe.anchor,st=it==="end"?-1:1,nt=j(Fe),Qe=U(Fe,ae),Le=Qe.x,Te=Qe.y,pe=it==="middle",Ne="hoverlabel"in Fe.trace?Fe.trace.hoverlabel.showarrow:!0,ot;pe?ot="M-"+Ae(Fe.bx/2+Fe.tx2width/2)+","+Ce(Te-Fe.by/2)+"h"+Ae(Fe.bx)+"v"+Ce(Fe.by)+"h-"+Ae(Fe.bx)+"Z":Ne?ot="M0,0L"+Ae(st*m+Le)+","+Ce(m+Te)+"v"+Ce(Fe.by/2-m)+"h"+Ae(st*Fe.bx)+"v-"+Ce(Fe.by)+"H"+Ae(st*m+Le)+"V"+Ce(Te-m)+"Z":ot="M"+Ae(st*m+Le)+","+Ce(Te-Fe.by/2)+"h"+Ae(st*Fe.bx)+"v"+Ce(Fe.by)+"h"+Ae(-st*Fe.bx)+"Z",ze.select("path").attr("d",ot);var ct=Le+nt.textShiftX,rt=Te+Fe.ty0-Fe.by/2+u,Ft=Fe.textAlign||"auto";Ft!=="auto"&&(Ft==="left"&&it!=="start"?(Ye.attr("text-anchor","start"),ct=pe?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):Ft==="right"&&it!=="end"&&(Ye.attr("text-anchor","end"),ct=pe?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),Ye.call(o.positionText,Ae(ct),Ce(rt)),Fe.tx2width&&(ze.select("text.name").call(o.positionText,Ae(nt.text2ShiftX+nt.alignShift*u+Le),Ce(Te+Fe.ty0-Fe.by/2+u)),ze.select("rect").call(i.setRect,Ae(nt.text2ShiftX+(nt.alignShift-1)*Fe.tx2width/2+Le),Ce(Te-Fe.by/2-1),Ae(Fe.tx2width),Ce(Fe.by+2)))})}function re(H,ae){var ie=H.index,ve=H.trace||{},Ae=H.cd[0],Ce=H.cd[ie]||{};function Fe(Qe){return Qe||h(Qe)&&Qe===0}var ze=Array.isArray(ie)?function(Qe,Le){var Te=S.castOption(Ae,ie,Qe);return Fe(Te)?Te:S.extractOption({},ve,"",Le)}:function(Qe,Le){return S.extractOption(Ce,ve,Qe,Le)};function Ye(Qe,Le,Te){var pe=ze(Le,Te);Fe(pe)&&(H[Qe]=pe)}if(Ye("hoverinfo","hi","hoverinfo"),Ye("bgcolor","hbg","hoverlabel.bgcolor"),Ye("borderColor","hbc","hoverlabel.bordercolor"),Ye("fontFamily","htf","hoverlabel.font.family"),Ye("fontSize","hts","hoverlabel.font.size"),Ye("fontColor","htc","hoverlabel.font.color"),Ye("fontWeight","htw","hoverlabel.font.weight"),Ye("fontStyle","hty","hoverlabel.font.style"),Ye("fontVariant","htv","hoverlabel.font.variant"),Ye("nameLength","hnl","hoverlabel.namelength"),Ye("textAlign","hta","hoverlabel.align"),H.posref=ae==="y"||ae==="closest"&&ve.orientation==="h"?H.xa._offset+(H.x0+H.x1)/2:H.ya._offset+(H.y0+H.y1)/2,H.x0=S.constrain(H.x0,0,H.xa._length),H.x1=S.constrain(H.x1,0,H.xa._length),H.y0=S.constrain(H.y0,0,H.ya._length),H.y1=S.constrain(H.y1,0,H.ya._length),H.xLabelVal!==void 0&&(H.xLabel="xLabel"in H?H.xLabel:f.hoverLabelText(H.xa,H.xLabelVal,ve.xhoverformat),H.xVal=H.xa.c2d(H.xLabelVal)),H.yLabelVal!==void 0&&(H.yLabel="yLabel"in H?H.yLabel:f.hoverLabelText(H.ya,H.yLabelVal,ve.yhoverformat),H.yVal=H.ya.c2d(H.yLabelVal)),H.zLabelVal!==void 0&&H.zLabel===void 0&&(H.zLabel=String(H.zLabelVal)),!isNaN(H.xerr)&&!(H.xa.type==="log"&&H.xerr<=0)){var it=f.tickText(H.xa,H.xa.c2l(H.xerr),"hover").text;H.xerrneg!==void 0?H.xLabel+=" +"+it+" / -"+f.tickText(H.xa,H.xa.c2l(H.xerrneg),"hover").text:H.xLabel+=" ± "+it,ae==="x"&&(H.distance+=1)}if(!isNaN(H.yerr)&&!(H.ya.type==="log"&&H.yerr<=0)){var st=f.tickText(H.ya,H.ya.c2l(H.yerr),"hover").text;H.yerrneg!==void 0?H.yLabel+=" +"+st+" / -"+f.tickText(H.ya,H.ya.c2l(H.yerrneg),"hover").text:H.yLabel+=" ± "+st,ae==="y"&&(H.distance+=1)}var nt=H.hoverinfo||H.trace.hoverinfo;return nt&&nt!=="all"&&(nt=Array.isArray(nt)?nt:nt.split("+"),nt.indexOf("x")===-1&&(H.xLabel=void 0),nt.indexOf("y")===-1&&(H.yLabel=void 0),nt.indexOf("z")===-1&&(H.zLabel=void 0),nt.indexOf("text")===-1&&(H.text=void 0),nt.indexOf("name")===-1&&(H.name=void 0)),H}function fe(H,ae,ie){var ve=ie.container,Ae=ie.fullLayout,Ce=Ae._size,Fe=ie.event,ze=!!ae.hLinePoint,Ye=!!ae.vLinePoint,it,st;if(ve.selectAll(".spikeline").remove(),!!(Ye||ze)){var nt=a.combine(Ae.plot_bgcolor,Ae.paper_bgcolor);if(ze){var Qe=ae.hLinePoint,Le,Te;it=Qe&&Qe.xa,st=Qe&&Qe.ya;var pe=st.spikesnap;pe==="cursor"?(Le=Fe.pointerX,Te=Fe.pointerY):(Le=it._offset+Qe.x,Te=st._offset+Qe.y);var Ne=b.readability(Qe.color,nt)<1.5?a.contrast(nt):Qe.color,ot=st.spikemode,ct=st.spikethickness,rt=st.spikecolor||Ne,Ft=f.getPxPosition(H,st),Nt,$t;if(ot.indexOf("toaxis")!==-1||ot.indexOf("across")!==-1){if(ot.indexOf("toaxis")!==-1&&(Nt=Ft,$t=Le),ot.indexOf("across")!==-1){var rr=st._counterDomainMin,Mr=st._counterDomainMax;st.anchor==="free"&&(rr=Math.min(rr,st.position),Mr=Math.max(Mr,st.position)),Nt=Ce.l+rr*Ce.w,$t=Ce.l+Mr*Ce.w}ve.insert("line",":first-child").attr({x1:Nt,x2:$t,y1:Te,y2:Te,"stroke-width":ct,stroke:rt,"stroke-dasharray":i.dashStyle(st.spikedash,ct)}).classed("spikeline",!0).classed("crisp",!0),ve.insert("line",":first-child").attr({x1:Nt,x2:$t,y1:Te,y2:Te,"stroke-width":ct+2,stroke:nt}).classed("spikeline",!0).classed("crisp",!0)}ot.indexOf("marker")!==-1&&ve.insert("circle",":first-child").attr({cx:Ft+(st.side!=="right"?ct:-ct),cy:Te,r:ct,fill:rt}).classed("spikeline",!0)}if(Ye){var Sr=ae.vLinePoint,Zr,Ar;it=Sr&&Sr.xa,st=Sr&&Sr.ya;var Br=it.spikesnap;Br==="cursor"?(Zr=Fe.pointerX,Ar=Fe.pointerY):(Zr=it._offset+Sr.x,Ar=st._offset+Sr.y);var Mt=b.readability(Sr.color,nt)<1.5?a.contrast(nt):Sr.color,je=it.spikemode,$e=it.spikethickness,Ee=it.spikecolor||Mt,xe=f.getPxPosition(H,it),ye,Me;if(je.indexOf("toaxis")!==-1||je.indexOf("across")!==-1){if(je.indexOf("toaxis")!==-1&&(ye=xe,Me=Ar),je.indexOf("across")!==-1){var Xe=it._counterDomainMin,Je=it._counterDomainMax;it.anchor==="free"&&(Xe=Math.min(Xe,it.position),Je=Math.max(Je,it.position)),ye=Ce.t+(1-Je)*Ce.h,Me=Ce.t+(1-Xe)*Ce.h}ve.insert("line",":first-child").attr({x1:Zr,x2:Zr,y1:ye,y2:Me,"stroke-width":$e,stroke:Ee,"stroke-dasharray":i.dashStyle(it.spikedash,$e)}).classed("spikeline",!0).classed("crisp",!0),ve.insert("line",":first-child").attr({x1:Zr,x2:Zr,y1:ye,y2:Me,"stroke-width":$e+2,stroke:nt}).classed("spikeline",!0).classed("crisp",!0)}je.indexOf("marker")!==-1&&ve.insert("circle",":first-child").attr({cx:Zr,cy:xe-(it.side!=="top"?$e:-$e),r:$e,fill:Ee}).classed("spikeline",!0)}}}function le(H,ae,ie){if(!ie||ie.length!==H._hoverdata.length)return!0;for(var ve=ie.length-1;ve>=0;ve--){var Ae=ie[ve],Ce=H._hoverdata[ve];if(Ae.curveNumber!==Ce.curveNumber||String(Ae.pointNumber)!==String(Ce.pointNumber)||String(Ae.pointNumbers)!==String(Ce.pointNumbers)||Ae.binNumber!==Ce.binNumber)return!0}return!1}function ce(H,ae){return!0}function V(H,ae){return o.plainText(H||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ee(H,ae){for(var ie=ae.charAt(0),ve=[],Ae=[],Ce=[],Fe=0;FeH.offsetTop+H.clientTop,ue=H=>H.offsetLeft+H.clientLeft;function te(H,ae){var ie=H._fullLayout,ve=ae.getBoundingClientRect(),Ae=ve.left,Ce=ve.top,Fe=Ae+ve.width,ze=Ce+ve.height,Ye=S.apply3DTransform(ie._invTransform)(Ae,Ce),it=S.apply3DTransform(ie._invTransform)(Fe,ze),st=Ye[0],nt=Ye[1],Qe=it[0],Le=it[1];return{x:st,y:nt,width:Qe-st,height:Le-nt,top:Math.min(nt,Le),left:Math.min(st,Qe),right:Math.max(st,Qe),bottom:Math.max(nt,Le)}}}}),fx=Ge({"src/components/fx/hoverlabel_defaults.js"($,G){var h=gn(),b=_o(),S=Vv().isUnifiedHover;G.exports=function(e,t,r,o){o=o||{};var n=t.legend;function i(a){o.font[a]||(o.font[a]=n?t.legend.font[a]:t.font[a])}t&&S(t.hovermode)&&(o.font||(o.font={}),i("size"),i("family"),i("color"),i("weight"),i("style"),i("variant"),n?(o.bgcolor||(o.bgcolor=b.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),r("hoverlabel.showarrow",o.showarrow),h.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}}}),_M=Ge({"src/components/fx/layout_global_defaults.js"($,G){var h=gn(),b=fx(),S=cc();G.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}b(e,t,r)}}}),xM=Ge({"src/components/fx/defaults.js"($,G){var h=gn(),b=ed(),S=fx();G.exports=function(e,t,r,o){function n(a,s){return h.coerce(e,t,b,a,s)}var i=h.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),S(e,t,n,i)}}}),KT=Ge({"src/components/fx/hovermode_defaults.js"($,G){var h=gn(),b=cc();G.exports=function(E,e){function t(r,o){return e[r]!==void 0?e[r]:h.coerce(E,e,b,r,o)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),bM=Ge({"src/components/fx/layout_defaults.js"($,G){var h=gn(),b=cc(),S=KT(),E=fx();G.exports=function(t,r){function o(p,d){return h.coerce(t,r,b,p,d)}var n=S(t,r);n&&(o("hoverdistance"),o("spikedistance"));var i=o("dragmode");i==="select"&&o("selectdirection");var a=r._has("mapbox"),s=r._has("map"),f=r._has("geo"),c=r._basePlotModules.length;r.dragmode==="zoom"&&((a||s||f)&&c===1||(a||s)&&f&&c===2)&&(r.dragmode="pan"),E(t,r,o),h.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),Yw=Ge({"src/components/fx/calc.js"($,G){var h=gn(),b=Lo();G.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(f){return function(c){return h.coerceHoverinfo({hoverinfo:c},{_module:f._module},r)}}for(var n=0;n"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),vx=Ge({"src/components/shapes/draw_newshape/constants.js"($,G){var h=32;G.exports={CIRCLE_SIDES:h,i000:0,i090:h/4,i180:h/2,i270:h/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),dx=Ge({"src/components/selections/helpers.js"($,G){var h=gn().strTranslate;function b(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 S(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 E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return b(t,o[r])}}function e(t){return h(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:b,r2p:S,axValue:E,getTransform:e}}}),dp=Ge({"src/components/shapes/draw_newshape/helpers.js"($){var G=am(),h=vx(),b=h.CIRCLE_SIDES,S=h.SQRT2,E=dx(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];$.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",c=0;c0&&gl&&(x="X"),x});return c>l&&(g=g.replace(/[\s,]*X.*/,""),h.log("Ignoring extra params in segment "+f)),p+g})}function E(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}}}),Ww=Ge({"src/components/shapes/display_labels.js"($,G){var h=gn(),b=ws(),S=Ju(),E=Ss(),e=dp().readPaths,t=sm(),r=t.getPathString,o=td(),n=Qh().FROM_TL;G.exports=function(f,c,p,d){if(d.selectAll(".shape-label").remove(),!!(p.label.text||p.label.texttemplate)){var T;if(p.label.texttemplate){var l={};if(p.type!=="path"){var g=b.getFromId(f,p.xref),x=b.getFromId(f,p.yref);for(var A in o){var M=o[A](p,g,x);M!==void 0&&(l[A]=M)}}T=h.texttemplateStringForShapes({data:[l],fallback:p.label.texttemplatefallback,locale:f._fullLayout._d3locale,template:p.label.texttemplate})}else T=p.label.text;var _={"data-index":c},w=p.label.font,m={"data-notex":1},u=d.append("g").attr(_).classed("shape-label",!0),v=u.append("text").attr(m).classed("shape-label-text",!0).text(T),y,I,L,z;if(p.path){var F=r(f,p),N=e(F,f);y=1/0,L=1/0,I=-1/0,z=-1/0;for(var B=0;B=s?d=f-p:d=p-f,-180/Math.PI*Math.atan2(d,T)}function a(s,f,c,p,d,T,l){var g=d.label.textposition,x=d.label.textangle,A=d.label.padding,M=d.type,_=Math.PI/180*T,w=Math.sin(_),m=Math.cos(_),u=d.label.xanchor,v=d.label.yanchor,y,I,L,z;if(M==="line"){g==="start"?(y=s,I=f):g==="end"?(y=c,I=p):(y=(s+c)/2,I=(f+p)/2),u==="auto"&&(g==="start"?x==="auto"?c>s?u="left":cs?u="right":cs?u="right":cs?u="left":c1&&!(nt.length===2&&nt[1][0]==="Z")&&(V===0&&(nt[0][0]="M"),y[ce]=nt,N(),B())}}function ve(nt,Qe){if(nt===2){ce=+Qe.srcElement.getAttribute("data-i"),V=+Qe.srcElement.getAttribute("data-j");var Le=y[ce];!T(Le)&&!l(Le)&&ie()}}function Ae(nt){fe=[];for(var Qe=0;QeN&&Xe>B&&!xe.shiftKey?s.getCursor(Je/Me,1-Lt/Xe):"move";f(y,Ct),Nt=Ct.split("-")[0]}}function Sr(xe){l(v)||(R&&(ee=pe(I.xanchor)),U&&(ne=Ne(I.yanchor)),I.type==="path"?Ce=I.path:(fe=R?I.x0:pe(I.x0),le=U?I.y0:Ne(I.y0),ce=R?I.x1:pe(I.x1),V=U?I.y1:Ne(I.y1)),feV?(K=le,ae="y0",ue=V,ie="y1"):(K=V,ae="y1",ue=le,ie="y0"),Mr(xe),je(z,I),Ee(y,I,v),Ft.moveFn=Nt==="move"?Br:Mt,Ft.altKey=xe.altKey)}function Zr(){l(v)||(f(y),$e(z),A(y,v,I),b.call("_guiRelayout",v,F.getUpdateObj()))}function Ar(){l(v)||$e(z)}function Br(xe,ye){if(I.type==="path"){var Me=function(Lt){return Lt},Xe=Me,Je=Me;R?re("xanchor",I.xanchor=ot(ee+xe)):(Xe=function(Ct){return ot(pe(Ct)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=ct(ne+ye)):(Je=function(Ct){return ct(Ne(Ct)+ye)},it&&it.type==="date"&&(Je=p.encodeDate(Je))),re("path",I.path=_(Ce,Xe,Je))}else R?re("xanchor",I.xanchor=ot(ee+xe)):(re("x0",I.x0=ot(fe+xe)),re("x1",I.x1=ot(ce+xe))),U?re("yanchor",I.yanchor=ct(ne+ye)):(re("y0",I.y0=ct(le+ye)),re("y1",I.y1=ct(V+ye)));y.attr("d",d(v,I)),je(z,I),r(v,L,I,Fe)}function Mt(xe,ye){if(Z){var Me=function(Nn){return Nn},Xe=Me,Je=Me;R?re("xanchor",I.xanchor=ot(ee+xe)):(Xe=function(Ea){return ot(pe(Ea)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=ct(ne+ye)):(Je=function(Ea){return ct(Ne(Ea)+ye)},it&&it.type==="date"&&(Je=p.encodeDate(Je))),re("path",I.path=_(Ce,Xe,Je))}else if(j){if(Nt==="resize-over-start-point"){var Lt=fe+xe,Ct=U?le-ye:le+ye;re("x0",I.x0=R?Lt:ot(Lt)),re("y0",I.y0=U?Ct:ct(Ct))}else if(Nt==="resize-over-end-point"){var Ot=ce+xe,Wt=U?V-ye:V+ye;re("x1",I.x1=R?Ot:ot(Ot)),re("y1",I.y1=U?Wt:ct(Wt))}}else{var _r=function(Nn){return Nt.indexOf(Nn)!==-1},pr=_r("n"),hr=_r("s"),Fr=_r("w"),En=_r("e"),Zn=pr?K+ye:K,qn=hr?ue+ye:ue,ta=Fr?te+xe:te,ra=En?H+xe:H;U&&(pr&&(Zn=K-ye),hr&&(qn=ue-ye)),(!U&&qn-Zn>B||U&&Zn-qn>B)&&(re(ae,I[ae]=U?Zn:ct(Zn)),re(ie,I[ie]=U?qn:ct(qn))),ra-ta>N&&(re(ve,I[ve]=R?ta:ot(ta)),re(Ae,I[Ae]=R?ra:ot(ra)))}y.attr("d",d(v,I)),je(z,I),r(v,L,I,Fe)}function je(xe,ye){(R||U)&&Me();function Me(){var Xe=ye.type!=="path",Je=xe.selectAll(".visual-cue").data([0]),Lt=1;Je.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Lt}).classed("visual-cue",!0);var Ct=pe(R?ye.xanchor:S.midRange(Xe?[ye.x0,ye.x1]:p.extractPathCoords(ye.path,c.paramIsX))),Ot=Ne(U?ye.yanchor:S.midRange(Xe?[ye.y0,ye.y1]:p.extractPathCoords(ye.path,c.paramIsY)));if(Ct=p.roundPositionForSharpStrokeRendering(Ct,Lt),Ot=p.roundPositionForSharpStrokeRendering(Ot,Lt),R&&U){var Wt="M"+(Ct-1-Lt)+","+(Ot-1-Lt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Je.attr("d",Wt)}else if(R){var _r="M"+(Ct-1-Lt)+","+(Ot-9-Lt)+"v18 h2 v-18 Z";Je.attr("d",_r)}else{var pr="M"+(Ct-9-Lt)+","+(Ot-1-Lt)+"h18 v2 h-18 Z";Je.attr("d",pr)}}}function $e(xe){xe.selectAll(".visual-cue").remove()}function Ee(xe,ye,Me){var Xe=ye.xref,Je=ye.yref,Lt=E.getFromId(Me,Xe),Ct=E.getFromId(Me,Je),Ot="";Xe!=="paper"&&!Lt.autorange&&(Ot+=Xe),Je!=="paper"&&!Ct.autorange&&(Ot+=Je),i.setClipUrl(xe,Ot?"clip"+Me._fullLayout._uid+Ot:null,Me)}}function _(v,y,I){return v.replace(c.segmentRE,function(L){var z=0,F=L.charAt(0),N=c.paramIsX[F],B=c.paramIsY[F],R=c.numParams[F],U=L.slice(1).replace(c.paramRE,function(j){return z>=R||(N[z]?j=y(j):B[z]&&(j=I(j)),z++),j});return F+U})}function w(v,y){if(g(v)){var I=y.node(),L=+I.getAttribute("data-index");if(L>=0){if(L===v._fullLayout._activeShapeIndex){m(v);return}v._fullLayout._activeShapeIndex=L,v._fullLayout._deactivateShape=m,T(v)}}}function m(v){if(g(v)){var y=v._fullLayout._activeShapeIndex;y>=0&&(o(v),delete v._fullLayout._activeShapeIndex,T(v))}}function u(v){if(g(v)){o(v);var y=v._fullLayout._activeShapeIndex,I=(v.layout||{}).shapes||[];if(y1?(le=["toggleHover"],ce=["resetViews"]):u?(fe=["zoomInGeo","zoomOutGeo"],le=["hoverClosestGeo"],ce=["resetGeo"]):m?(le=["hoverClosest3d"],ce=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(fe=["zoomInMapbox","zoomOutMapbox"],le=["toggleHover"],ce=["resetViewMapbox"]):z?(fe=["zoomInMap","zoomOutMap"],le=["toggleHover"],ce=["resetViewMap"]):v?le=["hoverClosestPie"]:B?(le=["hoverClosestCartesian","hoverCompareCartesian"],ce=["resetViewSankey"]):le=["toggleHover"],w&&le.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||U)&&(le=[]),w&&!R&&(fe=["zoomIn2d","zoomOut2d","autoScale2d"],ce[0]!=="resetViews"&&(ce=["resetScale2d"])),m?V=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!R||I?V=["zoom2d","pan2d"]:L||z||u?V=["pan2d"]:F&&(V=["zoom2d"]),a(T)&&V.push("select2d","lasso2d");var ee=[],ne=function(H){ee.indexOf(H)===-1&&le.indexOf(H)!==-1&&ee.push(H)};if(Array.isArray(M)){for(var K=[],ue=0;uex?T.slice(x):l.slice(g))+A}function f(p,d){for(var T=d._size,l=T.h/T.w,g={},x=Object.keys(p),A=0;At*I&&!N)){for(x=0;xV&&iele&&(le=ie);var Ae=(le-fe)/(2*ce);u/=Ae,fe=_.l2r(fe),le=_.l2r(le),_.range=_._input.range=j=B[1]||Z[1]<=B[0])&&re[0]R[0])return!0}return!1}function A(B){var R=B._fullLayout,U=R._size,j=U.p,Z=i.list(B,"",!0),re,fe,le,ce,V,ee;if(R._paperdiv.style({width:B._context.responsive&&R.autosize&&!B._context._hasZeroWidth&&!B.layout.width?"100%":R.width+"px",height:B._context.responsive&&R.autosize&&!B._context._hasZeroHeight&&!B.layout.height?"100%":R.height+"px"}).selectAll(".main-svg").call(r.setSize,R.width,R.height),B._context.setBackground(B,R.paper_bgcolor),$.drawMainTitle(B),n.manage(B),!R._has("cartesian"))return b.previousPromises(B);function ne(Ee,xe,ye){var Me=Ee._lw/2;if(Ee._id.charAt(0)==="x"){if(xe){if(ye==="top")return xe._offset-j-Me}else return U.t+U.h*(1-(Ee.position||0))+Me%1;return xe._offset+xe._length+j+Me}if(xe){if(ye==="right")return xe._offset+xe._length+j+Me}else return U.l+U.w*(Ee.position||0)+Me%1;return xe._offset-j-Me}for(re=0;re0){y(B,re,V,ce),le.attr({x:fe,y:re,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,re);var ee=(R.text.match(E.BR_TAG_ALL)||[]).length;if(ee){var ne=a.LINE_SPACING*ee+a.MID_SHIFT;R.y===0&&(ne=-ne),le.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-ne+"em";this.setAttribute("dy",ae)})}var K=G.select(B).selectAll(".gtitle-subtitle");if(K.node()){var ue=le.node().getBBox(),te=ue.y+ue.height,H=te+o.SUBTITLE_PADDING_EM*R.subtitle.font.size;K.attr({x:fe,y:H,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,H)}}}};function m(B,R,U,j,Z){var re=R.yref==="paper"?B._fullLayout._size.h:B._fullLayout.height,fe=S.isTopAnchor(R)?j:j-Z,le=U==="b"?re-fe:fe;return S.isTopAnchor(R)&&U==="t"||S.isBottomAnchor(R)&&U==="b"?!1:le.5?"t":"b",fe=B._fullLayout.margin[re],le=0;return R.yref==="paper"?le=U+R.pad.t+R.pad.b:R.yref==="container"&&(le=u(re,j,Z,B._fullLayout.height,U)+R.pad.t+R.pad.b),le>fe?le:0}function y(B,R,U,j){var Z="title.automargin",re=B._fullLayout.title,fe=re.y>.5?"t":"b",le={x:re.x,y:re.y,t:0,b:0},ce={};re.yref==="paper"&&m(B,re,fe,R,j)?le[fe]=U:re.yref==="container"&&(ce[fe]=U,B._fullLayout._reservedMargin[Z]=ce),b.allowAutoMargin(B,Z),b.autoMargin(B,Z,le)}function I(B,R){var U=B.title,j=B._size,Z=0;return R===d?Z=U.pad.l:R===l&&(Z=-U.pad.r),U.xref==="paper"?j.l+j.w*U.x+Z:B.width*U.x+Z}function L(B,R){var U=B.title,j=B._size,Z=0;return R==="0em"||!R?Z=-U.pad.b:R===a.CAP_SHIFT+"em"&&(Z=U.pad.t),U.y==="auto"?j.t/2:U.yref==="paper"?j.t+j.h-j.h*U.y+Z:B.height-B.height*U.y+Z}function z(B){return B==="top"?a.CAP_SHIFT+.3+"em":B==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function F(B){var R=B.title,U=T;return S.isRightAnchor(R)?U=l:S.isLeftAnchor(R)&&(U=d),U}function N(B){var R=B.title,U="0em";return S.isTopAnchor(R)?U=a.CAP_SHIFT+"em":S.isMiddleAnchor(R)&&(U=a.MID_SHIFT+"em"),U}$.doTraceStyle=function(B){var R=B.calcdata,U=[],j;for(j=0;j=0;F--){var N=M.append("path").attr(w).style("opacity",F?.1:m).call(E.stroke,v).call(E.fill,u).call(e.dashLine,F?"solid":I,F?4+y:y);if(s(N,d,g),L){var B=t(d.layout,"selections",g);N.style({cursor:"move"});var R={element:N.node(),plotinfo:x,gd:d,editHelpers:B,isActiveSelection:!0},U=h(_,d);b(U,N,R)}else N.style("pointer-events",F?"all":"none");z[F]=N}var j=z[0],Z=z[1];Z.node().addEventListener("click",function(){return f(d,j)})}}function s(d,T,l){var g=l.xref+l.yref;e.setClipUrl(d,"clip"+T._fullLayout._uid+g,T)}function f(d,T){if(i(d)){var l=T.node(),g=+l.getAttribute("data-index");if(g>=0){if(g===d._fullLayout._activeSelectionIndex){p(d);return}d._fullLayout._activeSelectionIndex=g,d._fullLayout._deactivateSelection=p,n(d)}}}function c(d){if(i(d)){var T=d._fullLayout.selections.length-1;d._fullLayout._activeSelectionIndex=T,d._fullLayout._deactivateSelection=p,n(d)}}function p(d){if(i(d)){var T=d._fullLayout._activeSelectionIndex;T>=0&&(S(d),delete d._fullLayout._activeSelectionIndex,n(d))}}}}),wM=Ge({"node_modules/polybooljs/lib/build-log.js"($,G){function h(){var b,S=0,E=!1;function e(t,r){return b.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),b}return b={list:[],segmentId:function(){return S++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?b:(E=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")}},b}G.exports=h}}),TM=Ge({"node_modules/polybooljs/lib/epsilon.js"($,G){function h(b){typeof b!="number"&&(b=1e-10);var S={epsilon:function(E){return typeof E=="number"&&(b=E),b},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],n=t[0],i=t[1],a=E[0],s=E[1];return(n-r)*(s-o)-(i-o)*(a-r)>=-b},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],n=E[0]-e[0],i=t[1]-e[1],a=n*o+r*i;if(a-b)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])b!=n-r>b&&(o-s)*(r-f)/(n-f)+s-t>b&&(i=!i),o=s,n=f}return i}};return S}G.exports=h}}),AM=Ge({"node_modules/polybooljs/lib/linked-list.js"($,G){var h={create:function(){var b={root:{root:!0,next:null},exists:function(S){return!(S===null||S===b.root)},isEmpty:function(){return b.root.next===null},getHead:function(){return b.root.next},insertBefore:function(S,E){for(var e=b.root,t=b.root.next;t!==null;){if(E(t)){S.prev=t.prev,S.next=t,t.prev.next=S,t.prev=S;return}e=t,t=t.next}e.next=S,S.prev=e,S.next=null},findTransition:function(S){for(var E=b.root,e=b.root.next;e!==null&&!S(e);)E=e,e=e.next;return{before:E===b.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return b},node:function(b){return b.prev=null,b.next=null,b.remove=function(){b.prev.next=b.next,b.next&&(b.next.prev=b.prev),b.prev=null,b.next=null},b}};G.exports=h}}),$d=Ge({"node_modules/polybooljs/lib/intersecter.js"($,G){var h=AM();function b(S,E,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,g){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:g.myFill.above,below:g.myFill.below},otherFill:null}}var o=h.create();function n(T,l,g,x,A,M){var _=E.pointsCompare(l,A);return _!==0?_:E.pointsSame(g,M)?0:T!==x?T?1:-1:E.pointAboveOrOnLine(g,x?A:M,x?M:A)?1:-1}function i(T,l){o.insertBefore(T,function(g){var x=n(T.isStart,T.pt,l,g.isStart,g.pt,g.other.pt);return x<0})}function a(T,l){var g=h.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(g,T.end),g}function s(T,l,g){var x=h.node({isStart:!1,pt:l.end,seg:l,primary:g,other:T,status:null});T.other=x,i(x,T.pt)}function f(T,l){var g=a(T,l);return s(g,T,l),g}function c(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function p(T,l){var g=r(l,T.seg.end,T.seg);return c(T,l),f(g,T.primary)}function d(T,l){var g=h.create();function x(N,B){var R=N.seg.start,U=N.seg.end,j=B.seg.start,Z=B.seg.end;return E.pointsCollinear(R,j,Z)?E.pointsCollinear(U,j,Z)||E.pointAboveOrOnLine(U,j,Z)?1:-1:E.pointAboveOrOnLine(R,j,Z)?1:-1}function A(N){return g.findTransition(function(B){var R=x(N,B.ev);return R>0})}function M(N,B){var R=N.seg,U=B.seg,j=R.start,Z=R.end,re=U.start,fe=U.end;e&&e.checkIntersection(R,U);var le=E.linesIntersect(j,Z,re,fe);if(le===!1){if(!E.pointsCollinear(j,Z,re)||E.pointsSame(j,fe)||E.pointsSame(Z,re))return!1;var ce=E.pointsSame(j,re),V=E.pointsSame(Z,fe);if(ce&&V)return B;var ee=!ce&&E.pointBetween(j,re,fe),ne=!V&&E.pointBetween(Z,re,fe);if(ce)return ne?p(B,Z):p(N,fe),B;ee&&(V||(ne?p(B,Z):p(N,fe)),p(B,j))}else le.alongA===0&&(le.alongB===-1?p(N,re):le.alongB===0?p(N,le.pt):le.alongB===1&&p(N,fe)),le.alongB===0&&(le.alongA===-1?p(B,j):le.alongA===0?p(B,le.pt):le.alongA===1&&p(B,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let N=function(){if(u){var B=M(w,u);if(B)return B}return v?M(w,v):!1};e&&e.segmentNew(w.seg,w.primary);var m=A(w),u=m.before?m.before.ev:null,v=m.after?m.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,v?v.seg:!1);var y=N();if(y){if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,I&&(y.seg.myFill.above=!y.seg.myFill.above)}else y.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(y.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,v?w.seg.myFill.below=v.seg.myFill.above:w.seg.myFill.below=T,I?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var L;v?w.primary===v.primary?L=v.seg.otherFill.above:L=v.seg.myFill.above:L=w.primary?l:T,w.seg.otherFill={above:L,below:L}}e&&e.status(w.seg,u?u.seg:!1,v?v.seg:!1),w.other.status=m.insert(h.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(g.exists(z.prev)&&g.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return S?{addRegion:function(T){for(var l,g=T[T.length-1],x=0;xr!=p>r&&t<(c-s)*(r-f)/(p-f)+s;d&&(o=!o)}return o}}}),ey=Ge({"src/lib/polygon.js"($,G){var h=ax().dot,b=zi().BADNUM,S=G.exports={};S.tester=function(e){var t=e.slice(),r=t[0][0],o=r,n=t[0][1],i=n,a;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),a=1;ao||A===b||Ai||g&&f(l))}function p(l,g){var x=l[0],A=l[1];if(x===b||xo||A===b||Ai)return!1;var M=t.length,_=t[0][0],w=t[0][1],m=0,u,v,y,I,L;for(u=1;uMath.max(v,_)||A>Math.max(y,w)))if(Aa||Math.abs(h(p,f))>o)return!0;return!1},S.filter=function(e,t){var r=[e[0]],o=0,n=0;function i(s){e.push(s);var f=r.length,c=o;r.splice(n+1);for(var p=c+1;p1){var a=e.pop();i(a)}return{addPt:i,raw:e,filtered:r}}}}),SM=Ge({"src/components/selections/constants.js"($,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),ty=Ge({"src/components/selections/select.js"($,G){var h=n5(),b=a5(),S=Lo(),E=Ss().dashStyle,e=_o(),t=jf(),r=Vv().makeEventData,o=zp(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=sm(),p=px(),d=rg(),T=rm().clearOutline,l=dp(),g=l.handleEllipse,x=l.readPaths,A=Zw().newShapes,M=$T(),_=e5().activateLastSelection,w=gn(),m=w.sorterAsc,u=ey(),v=C0(),y=Cf().getFromId,I=S1(),L=mx().redrawReglTraces,z=SM(),F=z.MINSELECT,N=u.filter,B=u.tester,R=dx(),U=R.p2r,j=R.axValue,Z=R.getTransform;function re(je){return je.subplot!==void 0}function fe(je,$e,Ee,xe,ye){var Me=!re(xe),Xe=n(ye),Je=i(ye),Lt=s(ye),Ct=a(ye),Ot=f(ye),Wt=ye==="drawline",_r=ye==="drawcircle",pr=Wt||_r,hr=xe.gd,Fr=hr._fullLayout,En=Ot&&Fr.newselection.mode==="immediate"&&Me,Zn=Fr._zoomlayer,qn=xe.element.getBoundingClientRect(),ta=xe.plotinfo,ra=Z(ta),Nn=$e-qn.left,Ea=Ee-qn.top;Fr._calcInverseTransform(hr);var ja=w.apply3DTransform(Fr._invTransform)(Nn,Ea);Nn=ja[0],Ea=ja[1];var ir=Fr._invScaleX,qt=Fr._invScaleY,ar=Nn,sr=Ea,Vr="M"+Nn+","+Ea,on=xe.xaxes[0],pn=xe.yaxes[0],wn=on._length,Kn=pn._length,da=je.altKey&&!(a(ye)&&Lt),fa,ga,ka,Vn,hi,Ti,Dt;K(je,hr,xe),Xe&&(fa=N([[Nn,Ea]],z.BENDPX));var yt=Zn.selectAll("path.select-outline-"+ta.id).data([1]),Er=Ct?Fr.newshape:Fr.newselection;Ct&&(xe.hasText=Er.label.text||Er.label.texttemplate);var Nr=Ct&&!Lt?Er.fillcolor:"rgba(0,0,0,0)",jr=Er.line.color||(Me?e.contrast(hr._fullLayout.plot_bgcolor):"#7f7f7f");yt.enter().append("path").attr("class","select-outline select-outline-"+ta.id).style({opacity:Ct?Er.opacity/2:1,"stroke-dasharray":E(Er.line.dash,Er.line.width),"stroke-width":Er.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,jr).call(e.fill,Nr).attr("fill-rule","evenodd").classed("cursor-move",!!Ct).attr("transform",ra).attr("d",Vr+"Z");var Ir=Zn.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",ra).attr("d","M0,0Z");if(Ct&&xe.hasText){var Ur=Zn.select(".label-temp");Ur.empty()&&(Ur=Zn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var sn=Fr._uid+z.SELECTID,Kr=[],Tt=ie(hr,xe.xaxes,xe.yaxes,xe.subplot);En&&!je.shiftKey&&(xe._clearSubplotSelections=function(){if(Me){var Dr=on._id,ln=pn._id;ct(hr,Dr,ln,Tt);for(var Pn=(hr.layout||{}).selections||[],jn=[],Un=!1,un=0;un=0){hr._fullLayout._deactivateShape(hr);return}if(!Ct){var Pn=Fr.clickmode;v.done(sn).then(function(){if(v.clear(sn),Dr===2){for(yt.remove(),hi=0;hi-1&&le(ln,hr,xe.xaxes,xe.yaxes,xe.subplot,xe,yt),Pn==="event"&&Br(hr,void 0);t.click(hr,ln,ta.id)}).catch(w.error)}},xe.doneFn=function(){Ir.remove(),v.done(sn).then(function(){v.clear(sn),!En&&Vn&&xe.selectionDefs&&(Vn.subtract=da,xe.selectionDefs.push(Vn),xe.mergedPolygons.length=0,[].push.apply(xe.mergedPolygons,ka)),(En||Ct)&&H(xe,En),xe.doneFnCompleted&&xe.doneFnCompleted(Kr),Ot&&Br(hr,Dt)}).catch(w.error)}}function le(je,$e,Ee,xe,ye,Me,Xe){var Je=$e._hoverdata,Lt=$e._fullLayout,Ct=Lt.clickmode,Ot=Ct.indexOf("event")>-1,Wt=[],_r,pr,hr,Fr,En,Zn,qn,ta,ra,Nn;if(Ae(Je)){K(je,$e,Me),_r=ie($e,Ee,xe,ye);var Ea=Ce(Je,_r),ja=Ea.pointNumbers.length>0;if(ja?ze(_r,Ea):Ye(_r)&&(qn=Fe(Ea))){for(Xe&&Xe.remove(),Nn=0;Nn<_r.length;Nn++)pr=_r[Nn],pr._module.selectPoints(pr,!1);it($e,_r),H(Me),Ot&&Mt($e)}else{ta=je.shiftKey&&(qn!==void 0?qn:Fe(Ea)),hr=ce(Ea.pointNumber,Ea.searchInfo,ta);var ir=Me.selectionDefs.concat([hr]);for(Fr=ne(ir),Nn=0;Nn<_r.length;Nn++)if(En=_r[Nn]._module.selectPoints(_r[Nn],Fr),Zn=Qe(En,_r[Nn]),Wt.length)for(var qt=0;qt=0}function te(je){return je._fullLayout._activeSelectionIndex>=0}function H(je,$e){var Ee=je.dragmode,xe=je.plotinfo,ye=je.gd;ue(ye)&&ye._fullLayout._deactivateShape(ye),te(ye)&&ye._fullLayout._deactivateSelection(ye);var Me=ye._fullLayout,Xe=Me._zoomlayer,Je=a(Ee),Lt=f(Ee);if(Je||Lt){var Ct=Xe.selectAll(".select-outline-"+xe.id);if(Ct&&ye._fullLayout._outlining){var Ot;Je&&(Ot=A(Ct,je)),Ot&&S.call("_guiRelayout",ye,{shapes:Ot});var Wt;Lt&&!re(je)&&(Wt=M(Ct,je)),Wt&&(ye._fullLayout._noEmitSelectedAtStart=!0,S.call("_guiRelayout",ye,{selections:Wt}).then(function(){$e&&_(ye)})),ye._fullLayout._outlining=!1}}xe.selection={},xe.selection.selectionDefs=je.selectionDefs=[],xe.selection.mergedPolygons=je.mergedPolygons=[]}function ae(je){return je._id}function ie(je,$e,Ee,xe){if(!je.calcdata)return[];var ye=[],Me=$e.map(ae),Xe=Ee.map(ae),Je,Lt,Ct;for(Ct=0;Ct0,Me=ye?xe[0]:Ee;return $e.selectedpoints?$e.selectedpoints.indexOf(Me)>-1:!1}function ze(je,$e){var Ee=[],xe,ye,Me,Xe;for(Xe=0;Xe0&&Ee.push(xe);if(Ee.length===1&&(Me=Ee[0]===$e.searchInfo,Me&&(ye=$e.searchInfo.cd[0].trace,ye.selectedpoints.length===$e.pointNumbers.length))){for(Xe=0;Xe<$e.pointNumbers.length;Xe++)if(ye.selectedpoints.indexOf($e.pointNumbers[Xe])<0)return!1;return!0}return!1}function Ye(je){var $e=0,Ee,xe,ye;for(ye=0;ye1||($e+=xe.selectedpoints.length,$e>1)))return!1;return $e===1}function it(je,$e,Ee){var xe;for(xe=0;xe<$e.length;xe++){var ye=$e[xe].cd[0].trace._fullInput,Me=je._fullLayout._tracePreGUI[ye.uid]||{};Me.selectedpoints===void 0&&(Me.selectedpoints=ye._input.selectedpoints||null)}var Xe;if(Ee){var Je=Ee.points||[];for(xe=0;xe<$e.length;xe++)Xe=$e[xe].cd[0].trace,Xe._input.selectedpoints=Xe._fullInput.selectedpoints=[],Xe._fullInput!==Xe&&(Xe.selectedpoints=[]);for(var Lt=0;Lt-1&&$e;if(!Xe&&$e){var Dr=Ft(je,!0);if(Dr.length){var ln=Dr[0].xref,Pn=Dr[0].yref;if(ln&&Pn){var jn=rr(Dr),Un=Sr([y(je,ln,"x"),y(je,Pn,"y")]);Un(Kr,jn)}}je._fullLayout._noEmitSelectedAtStart?je._fullLayout._noEmitSelectedAtStart=!1:or&&Br(je,Kr),_r._reselect=!1}if(!Xe&&_r._deselect){var un=_r._deselect;Je=un.xref,Lt=un.yref,ot(Je,Lt,Ot)||ct(je,Je,Lt,xe),or&&(Kr.points.length?Br(je,Kr):Mt(je)),_r._deselect=!1}return{eventData:Kr,selectionTesters:Ee}}function Ne(je){var $e=je.calcdata;if($e)for(var Ee=0;Ee<$e.length;Ee++){var xe=$e[Ee][0],ye=xe.trace,Me=je._fullLayout._splomScenes;if(Me){var Xe=Me[ye.uid];Xe&&(Xe.selectBatch=[])}}}function ot(je,$e,Ee){for(var xe=0;xe=0){Nr._fullLayout._deactivateShape(Nr);return}var jr=Nr._fullLayout.clickmode;if(ee(Nr),yt===2&&!Le&&ga(),Qe)jr.indexOf("select")>-1&&m(Er,Nr,ct,rt,Ae.id,Ot),jr.indexOf("event")>-1&&a.click(Nr,Er,Ae.id);else if(yt===1&&Le){var Ir=it?pe:Te,Ur=it==="s"||st==="w"?0:1,sn=Ir._name+".range["+Ur+"]",Kr=R(Ir,Ur),Tt="left",or="middle";if(Ir.fixedrange)return;it?(or=it==="n"?"top":"bottom",Ir.side==="right"&&(Tt="right")):st==="e"&&(Tt="right"),Nr._context.showAxisRangeEntryBoxes&&h.select(Ct).call(o.makeEditable,{gd:Nr,immediate:!0,background:Nr._fullLayout.paper_bgcolor,text:String(Kr),fill:Ir.tickfont?Ir.tickfont.color:"#444",horizontalAlign:Tt,verticalAlign:or}).on("edit",function(Dr){var ln=Ir.d2r(Dr);ln!==void 0&&t.call("_guiRelayout",Nr,sn,ln)})}}c.init(Ot);var pr,hr,Fr,En,Zn,qn,ta,ra,Nn,Ea;function ja(yt,Er,Nr){var jr=Ct.getBoundingClientRect();pr=Er-jr.left,hr=Nr-jr.top,ve._fullLayout._calcInverseTransform(ve);var Ir=b.apply3DTransform(ve._fullLayout._invTransform)(pr,hr);pr=Ir[0],hr=Ir[1],Fr={l:pr,r:pr,w:0,t:hr,b:hr,h:0},En=ve._hmpixcount?ve._hmlumcount/ve._hmpixcount:E(ve._fullLayout.plot_bgcolor).getLuminance(),Zn="M0,0H"+$t+"V"+rr+"H0V0",qn=!1,ta="xy",Ea=!1,ra=fe(nt,En,Ft,Nt,Zn),Nn=le(nt,Ft,Nt)}function ir(yt,Er){if(ve._transitioningWithDuration)return!1;var Nr=Math.max(0,Math.min($t,Me*yt+pr)),jr=Math.max(0,Math.min(rr,Xe*Er+hr)),Ir=Math.abs(Nr-pr),Ur=Math.abs(jr-hr);Fr.l=Math.min(pr,Nr),Fr.r=Math.max(pr,Nr),Fr.t=Math.min(hr,jr),Fr.b=Math.max(hr,jr);function sn(){ta="",Fr.r=Fr.l,Fr.t=Fr.b,Nn.attr("d","M0,0Z")}if(Mr.isSubplotConstrained)Ir>I||Ur>I?(ta="xy",Ir/$t>Ur/rr?(Ur=Ir*rr/$t,hr>jr?Fr.t=hr-Ur:Fr.b=hr+Ur):(Ir=Ur*$t/rr,pr>Nr?Fr.l=pr-Ir:Fr.r=pr+Ir),Nn.attr("d",te(Fr))):sn();else if(Sr.isSubplotConstrained)if(Ir>I||Ur>I){ta="xy";var Kr=Math.min(Fr.l/$t,(rr-Fr.b)/rr),Tt=Math.max(Fr.r/$t,(rr-Fr.t)/rr);Fr.l=Kr*$t,Fr.r=Tt*$t,Fr.b=(1-Kr)*rr,Fr.t=(1-Tt)*rr,Nn.attr("d",te(Fr))}else sn();else!Ar||Ur0){var Dr;if(Sr.isSubplotConstrained||!Zr&&Ar.length===1){for(Dr=0;Dr1&&(sn.maxallowed!==void 0&&Mt===(sn.range[0]1&&(Kr.maxallowed!==void 0&&je===(Kr.range[0]=0?Math.min(ve,.9):1/(1/Math.max(ve,-.3)+3.222))}function re(ve,Ae,Ce){return ve?ve==="nsew"?Ce?"":Ae==="pan"?"move":"crosshair":ve.toLowerCase()+"-resize":"pointer"}function fe(ve,Ae,Ce,Fe,ze){return ve.append("path").attr("class","zoombox").style({fill:Ae>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ce,Fe)).attr("d",ze+"Z")}function le(ve,Ae,Ce){return ve.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Ae,Ce)).attr("d","M0,0Z")}function ce(ve,Ae,Ce,Fe,ze,Ye){ve.attr("d",Fe+"M"+Ce.l+","+Ce.t+"v"+Ce.h+"h"+Ce.w+"v-"+Ce.h+"h-"+Ce.w+"Z"),V(ve,Ae,ze,Ye)}function V(ve,Ae,Ce,Fe){Ce||(ve.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Ae.transition().style("opacity",1).duration(200))}function ee(ve){h.select(ve).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ne(ve){L&&ve.data&&ve._context.showTips&&(b.notifier(b._(ve,"Double-click to zoom back out"),"long"),L=!1)}function K(ve,Ae){return"M"+(ve.l-.5)+","+(Ae-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(ve.r+.5)+","+(Ae-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function ue(ve,Ae){return"M"+(Ae-I-.5)+","+(ve.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(Ae-I-.5)+","+(ve.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function te(ve){var Ae=Math.floor(Math.min(ve.b-ve.t,ve.r-ve.l,I)/2);return"M"+(ve.l-3.5)+","+(ve.t-.5+Ae)+"h3v"+-Ae+"h"+Ae+"v-3h-"+(Ae+3)+"ZM"+(ve.r+3.5)+","+(ve.t-.5+Ae)+"h-3v"+-Ae+"h"+-Ae+"v-3h"+(Ae+3)+"ZM"+(ve.r+3.5)+","+(ve.b+.5-Ae)+"h-3v"+Ae+"h"+-Ae+"v3h"+(Ae+3)+"ZM"+(ve.l-3.5)+","+(ve.b+.5-Ae)+"h3v"+Ae+"h"+Ae+"v3h-"+(Ae+3)+"Z"}function H(ve,Ae,Ce,Fe,ze){for(var Ye=!1,it={},st={},nt,Qe,Le,Te,pe=(ze||{}).xaHash,Ne=(ze||{}).yaHash,ot=0;ot1&&b.warn("Full array edits are incompatible with other edits",f);var x=i[""][""];if(t(x))n.set(null);else if(Array.isArray(x))n.set(x);else return b.warn("Unrecognized full array edit value",f,x),!0;return T?!1:(c(l,g),p(o),!0)}var A=Object.keys(i).map(Number).sort(S),M=n.get(),_=M||[],w=s(g,f).get(),m=[],u=-1,v=_.length,y,I,L,z,F,N,B,R;for(y=0;y_.length-(B?0:1)){b.warn("index out of range",f,L);continue}if(N!==void 0)F.length>1&&b.warn("Insertion & removal are incompatible with edits to the same index.",f,L),t(N)?m.push(L):B?(N==="add"&&(N={}),_.splice(L,0,N),w&&w.splice(L,0,{})):b.warn("Unrecognized full object edit value",f,L,N),u===-1&&(u=L);else for(I=0;I=0;y--)_.splice(m[y],1),w&&w.splice(m[y],1);if(_.length?M||n.set(_):n.set(null),T)return!1;if(c(l,g),d!==h){var U;if(u===-1)U=A;else{for(v=Math.max(_.length,v),U=[],y=0;y=u));y++)U.push(L);for(y=u;y0&&b.log("Clearing previous rejected promises from queue."),l._promises=[]},$.cleanLayout=function(l){var g;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 x=(S.subplotsRegistry.cartesian||{}).attrRegex;(S.subplotsRegistry.polar||{}).attrRegex,(S.subplotsRegistry.ternary||{}).attrRegex,(S.subplotsRegistry.gl3d||{}).attrRegex;var A=Object.keys(l);for(g=0;g3?(L.x=1.02,L.xanchor="left"):L.x<-2&&(L.x=-.02,L.xanchor="right"),L.y>3?(L.y=1.02,L.yanchor="bottom"):L.y<-2&&(L.y=-.02,L.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),e.clean(l),l.template&&l.template.layout&&$.cleanLayout(l.template.layout),l};function i(l,g){var x=l[g],A=g.charAt(0);x&&x!=="paper"&&(l[g]=t(x,A,!0))}$.cleanData=function(l){for(var g=0;g0)return l.slice(0,g)}$.hasParent=function(l,g){for(var x=d(g);x;){if(x in l)return!0;x=d(x)}return!1},$.clearAxisTypes=function(l,g,x){for(var A=0;A{const x=(...A)=>A.every(M=>b.isPlainObject(M))||A.every(M=>Array.isArray(M));if([l,g].every(A=>Array.isArray(A))){if(l.length!==g.length)return!1;for(let A=0;Ab.isPlainObject(A))){if(Object.keys(l).length!==Object.keys(g).length)return!1;for(const A in l){if(A.startsWith("_"))continue;const M=l[A],_=g[A];if(M!==_&&!(x(M,_)?T(M,_):!1))return!1}return!0}return!1};$.collectionsAreEqual=T}}),_x=Ge({"src/plot_api/plot_api.js"($){var G=Mi(),h=Pi(),b=jw(),S=gn(),E=S.nestedProperty,e=b1(),t=vp(),r=Lo(),o=Qg(),n=Wc(),i=ws(),a=qT(),s=ev(),f=Ss(),c=_o(),p=o5().initInteractions,d=Ad(),T=Yf().clearOutline,l=S0().dfltConfig,g=EM(),x=s5(),A=mx(),M=Nc(),_=rh().AX_NAME_PATTERN,w=0,m=5;function u(Ee,xe,ye,Me){var Xe;if(Ee=S.getGraphDiv(Ee),e.init(Ee),S.isPlainObject(xe)){var Je=xe;xe=Je.data,ye=Je.layout,Me=Je.config,Xe=Je.frames}var Lt=e.triggerHandler(Ee,"plotly_beforeplot",[xe,ye,Me]);if(Lt===!1)return Promise.reject();!xe&&!ye&&!S.isPlotDiv(Ee)&&S.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Ee);function Ct(){if(Xe)return $.addFrames(Ee,Xe)}z(Ee,Me),ye||(ye={}),G.select(Ee).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(Ee._promises)||(Ee._promises=[]);var Ot=(Ee.data||[]).length===0&&Array.isArray(xe);Array.isArray(xe)&&(x.cleanData(xe),Ot?Ee.data=xe:Ee.data.push.apply(Ee.data,xe),Ee.empty=!1),(!Ee.layout||Ot)&&(Ee.layout=x.cleanLayout(ye)),n.supplyDefaults(Ee);var Wt=Ee._fullLayout,_r=Wt._has("cartesian");Wt._replotting=!0,(Ot||Wt._shouldCreateBgLayer)&&($e(Ee),Wt._shouldCreateBgLayer&&delete Wt._shouldCreateBgLayer),f.initGradients(Ee),f.initPatterns(Ee),Ot&&i.saveShowSpikeInitial(Ee);var pr=!Ee.calcdata||Ee.calcdata.length!==(Ee._fullData||[]).length;pr&&n.doCalcdata(Ee);for(var hr=0;hr=Ee.data.length||Xe<-Ee.data.length)throw new Error(ye+" must be valid indices for gd.data.");if(xe.indexOf(Xe,Me+1)>-1||Xe>=0&&xe.indexOf(-Ee.data.length+Xe)>-1||Xe<0&&xe.indexOf(Ee.data.length+Xe)>-1)throw new Error("each index in "+ye+" must be unique.")}}function U(Ee,xe,ye){if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(xe)||(xe=[xe]),R(Ee,xe,"currentIndices"),typeof ye<"u"&&!Array.isArray(ye)&&(ye=[ye]),typeof ye<"u"&&R(Ee,ye,"newIndices"),typeof ye<"u"&&xe.length!==ye.length)throw new Error("current and new indices must be of equal length.")}function j(Ee,xe,ye){var Me,Xe;if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("traces must be defined.");for(Array.isArray(xe)||(xe=[xe]),Me=0;Me"u")throw new Error("indices must be an integer or array of integers");R(Ee,ye,"indices");for(var Je in xe){if(!Array.isArray(xe[Je])||xe[Je].length!==ye.length)throw new Error("attribute "+Je+" must be an array of length equal to indices array length");if(Xe&&(!(Je in Me)||!Array.isArray(Me[Je])||Me[Je].length!==xe[Je].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function re(Ee,xe,ye,Me){var Xe=S.isPlainObject(Me),Je=[],Lt,Ct,Ot,Wt,_r;Array.isArray(ye)||(ye=[ye]),ye=B(ye,Ee.data.length-1);for(var pr in xe)for(var hr=0;hr=0&&_r=0&&_r"u")return Wt=$.redraw(Ee),t.add(Ee,Xe,Lt,Je,Ct),Wt;Array.isArray(ye)||(ye=[ye]);try{U(Ee,Me,ye)}catch(_r){throw Ee.data.splice(Ee.data.length-xe.length,xe.length),_r}return t.startSequence(Ee),t.add(Ee,Xe,Lt,Je,Ct),Wt=$.moveTraces(Ee,Me,ye),t.stopSequence(Ee),Wt}function ne(Ee,xe){Ee=S.getGraphDiv(Ee);var ye=[],Me=$.addTraces,Xe=ne,Je=[Ee,ye,xe],Lt=[Ee,xe],Ct,Ot;if(typeof xe>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(xe)||(xe=[xe]),R(Ee,xe,"indices"),xe=B(xe,Ee.data.length-1),xe.sort(S.sorterDes),Ct=0;Ct"u")for(ye=[],Wt=0;Wt0&&typeof ar.parts[on]!="string";)on--;var pn=ar.parts[on],wn=ar.parts[on-1]+"."+pn,Kn=ar.parts.slice(0,on).join("."),da=E(Ee.layout,Kn).get(),fa=E(Me,Kn).get(),ga=ar.get();if(sr!==void 0){ta[qt]=sr,ra[qt]=pn==="reverse"?sr:te(ga);var ka=o.getLayoutValObject(Me,ar.parts);if(ka&&ka.impliedEdits&&sr!==null)for(var Vn in ka.impliedEdits)Nn(S.relativeAttr(qt,Vn),ka.impliedEdits[Vn]);if(["width","height"].indexOf(qt)!==-1)if(sr){Nn("autosize",null);var hi=qt==="height"?"width":"height";Nn(hi,Me[hi])}else Me[qt]=Ee._initialAutoSize[qt];else if(qt==="autosize")Nn("width",sr?null:Me.width),Nn("height",sr?null:Me.height);else if(wn.match(ze))ir(wn),E(Me,Kn+"._inputRange").set(null);else if(wn.match(Ye)){ir(wn),E(Me,Kn+"._inputRange").set(null);var Ti=E(Me,Kn).get();Ti._inputDomain&&(Ti._input.domain=Ti._inputDomain.slice())}else wn.match(it)&&E(Me,Kn+"._inputDomain").set(null);if(pn==="type"){ja=da;var Dt=fa.type==="linear"&&sr==="log",yt=fa.type==="log"&&sr==="linear";if(Dt||yt){if(!ja||!ja.range)Nn(Kn+".autorange",!0);else if(fa.autorange)Dt&&(ja.range=ja.range[1]>ja.range[0]?[1,2]:[2,1]);else{var Er=ja.range[0],Nr=ja.range[1];Dt?(Er<=0&&Nr<=0&&Nn(Kn+".autorange",!0),Er<=0?Er=Nr/1e6:Nr<=0&&(Nr=Er/1e6),Nn(Kn+".range[0]",Math.log(Er)/Math.LN10),Nn(Kn+".range[1]",Math.log(Nr)/Math.LN10)):(Nn(Kn+".range[0]",Math.pow(10,Er)),Nn(Kn+".range[1]",Math.pow(10,Nr)))}Array.isArray(Me._subplots.polar)&&Me._subplots.polar.length&&Me[ar.parts[0]]&&ar.parts[1]==="radialaxis"&&delete Me[ar.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(Ee,fa,sr,Nn),r.getComponentMethod("images","convertCoords")(Ee,fa,sr,Nn)}else Nn(Kn+".autorange",!0),Nn(Kn+".range",null);E(Me,Kn+"._inputRange").set(null)}else if(pn.match(_)){var jr=E(Me,qt).get(),Ir=(sr||{}).type;(!Ir||Ir==="-")&&(Ir="linear"),r.getComponentMethod("annotations","convertCoords")(Ee,jr,Ir,Nn),r.getComponentMethod("images","convertCoords")(Ee,jr,Ir,Nn)}var Ur=g.containerArrayMatch(qt);if(Ur){_r=Ur.array,pr=Ur.index;var sn=Ur.property,Kr=ka||{editType:"calc"};pr!==""&&sn===""&&(g.isAddVal(sr)?ra[qt]=null:g.isRemoveVal(sr)?ra[qt]=(E(ye,_r).get()||[])[pr]:S.warn("unrecognized full object value",xe)),M.update(qn,Kr),Wt[_r]||(Wt[_r]={});var Tt=Wt[_r][pr];Tt||(Tt=Wt[_r][pr]={}),Tt[sn]=sr,delete xe[qt]}else pn==="reverse"?(da.range?da.range.reverse():(Nn(Kn+".autorange",!0),da.range=[1,0]),fa.autorange?qn.calc=!0:qn.plot=!0):(qt==="dragmode"&&(sr===!1&&ga!==!1||sr!==!1&&ga===!1)||Me._has("scatter-like")&&Me._has("regl")&&qt==="dragmode"&&(sr==="lasso"||sr==="select")&&!(ga==="lasso"||ga==="select")?qn.plot=!0:ka?M.update(qn,ka):qn.calc=!0,ar.set(sr))}}for(_r in Wt){var or=g.applyContainerArrayChanges(Ee,Je(ye,_r),Wt[_r],qn,Je);or||(qn.plot=!0)}for(var Dr in Ea){ja=i.getFromId(Ee,Dr);var ln=ja&&ja._constraintGroup;if(ln){qn.calc=!0;for(var Pn in ln)Ea[Pn]||(i.getFromId(Ee,Pn)._constraintShrinkable=!0)}}(nt(Ee)||xe.height||xe.width)&&(qn.plot=!0);var jn=Me.shapes;for(pr=0;pr1;)if(Me.pop(),ye=E(xe,Me.join(".")+".uirevision").get(),ye!==void 0)return ye;return xe.uirevision}function ct(Ee,xe){for(var ye=0;ye[Kn,Ee._ev.listeners(Kn)]);Je=$.newPlot(Ee,xe,ye,Me).then(()=>{for(const[Kn,da]of wn)da.forEach(fa=>Ee.on(Kn,fa));return $.react(Ee,xe,ye,Me)})}else{Ee.data=xe||[],x.cleanData(Ee.data),Ee.layout=ye||{},x.cleanLayout(Ee.layout),Nt(Ee.data,Ee.layout,Ct,Ot),n.supplyDefaults(Ee,{skipUpdateCalc:!0});var pr=Ee._fullData,hr=Ee._fullLayout,Fr=hr.datarevision===void 0,En=hr.transition,Zn=Mr(Ee,Ot,hr,Fr,En),qn=Zn.newDataRevision,ta=rr(Ee,Ct,pr,Fr,En,qn);if(nt(Ee)&&(Zn.layoutReplot=!0),ta.calc||Zn.calc){Ee.calcdata=void 0;for(var ra=Object.getOwnPropertyNames(hr),Nn=0;Nn(_r||Ee.emit("plotly_react",{config:Me,data:xe,layout:ye}),Ee))}function rr(Ee,xe,ye,Me,Xe,Je){var Lt=xe.length===ye.length;if(!Xe&&!Lt)return{fullReplot:!0,calc:!0};var Ct=M.traceFlags();Ct.arrays={},Ct.nChanges=0,Ct.nChangesAnim=0;var Ot,Wt;function _r(Fr){var En=o.getTraceValObject(Wt,Fr);return!Wt._module.animatable&&En.anim&&(En.anim=!1),En}var pr={getValObject:_r,flags:Ct,immutable:Me,transition:Xe,newDataRevision:Je,gd:Ee},hr={};for(Ot=0;Ot=Xe.length?Xe[0]:Xe[Wt]:Xe}function Ct(Wt){return Array.isArray(Je)?Wt>=Je.length?Je[0]:Je[Wt]:Je}function Ot(Wt,_r){var pr=0;return function(){if(Wt&&++pr===_r)return Wt()}}return new Promise(function(Wt,_r){function pr(){if(Me._frameQueue.length!==0){for(;Me._frameQueue.length;){var pn=Me._frameQueue.pop();pn.onInterrupt&&pn.onInterrupt()}Ee.emit("plotly_animationinterrupted",[])}}function hr(pn){if(pn.length!==0){for(var wn=0;wnMe._timeToNext&&En()};pn()}var qn=0;function ta(pn){return Array.isArray(Xe)?qn>=Xe.length?pn.transitionOpts=Xe[qn]:pn.transitionOpts=Xe[0]:pn.transitionOpts=Xe,qn++,pn}var ra,Nn,Ea=[],ja=xe==null,ir=Array.isArray(xe),qt=!ja&&!ir&&S.isPlainObject(xe);if(qt)Ea.push({type:"object",data:ta(S.extendFlat({},xe))});else if(ja||["string","number"].indexOf(typeof xe)!==-1)for(ra=0;ra0&&VrVr)&&on.push(Nn);Ea=on}}Ea.length>0?hr(Ea):(Ee.emit("plotly_animated"),Wt())})}function Ar(Ee,xe,ye){if(Ee=S.getGraphDiv(Ee),xe==null)return Promise.resolve();if(!S.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 Me,Xe,Je,Lt,Ct=Ee._transitionData._frames,Ot=Ee._transitionData._frameHash;if(!Array.isArray(xe))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+xe);var Wt=Ct.length+xe.length*2,_r=[],pr={};for(Me=xe.length-1;Me>=0;Me--)if(S.isPlainObject(xe[Me])){var hr=xe[Me].name,Fr=(Ot[hr]||pr[hr]||{}).name,En=xe[Me].name,Zn=Ot[Fr]||pr[Fr];Fr&&En&&typeof En=="number"&&Zn&&war.index?-1:qt.index=0;Me--){if(Xe=_r[Me].frame,typeof Xe.name=="number"&&S.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Xe.name)for(;Ot[Xe.name="frame "+Ee._transitionData._counter++];);if(Ot[Xe.name]){for(Je=0;Je=0;ye--)Me=xe[ye],Je.push({type:"delete",index:Me}),Lt.unshift({type:"insert",index:Me,value:Xe[Me]});var Ct=n.modifyFrames,Ot=n.modifyFrames,Wt=[Ee,Lt],_r=[Ee,Je];return t&&t.add(Ee,Ct,Wt,Ot,_r),n.modifyFrames(Ee,Je)}function Mt(Ee){Ee=S.getGraphDiv(Ee);var xe=Ee._fullLayout||{},ye=Ee._fullData||[];return n.cleanPlot([],{},ye,xe),n.purge(Ee),e.purge(Ee),xe._container&&xe._container.remove(),delete Ee._context,Ee}function je(Ee){var xe=Ee._fullLayout,ye=Ee.getBoundingClientRect();if(!S.equalDomRects(ye,xe._lastBBox)){var Me=xe._invTransform=S.inverseTransformMatrix(S.getFullTransformMatrix(Ee));xe._invScaleX=Math.sqrt(Me[0][0]*Me[0][0]+Me[0][1]*Me[0][1]+Me[0][2]*Me[0][2]),xe._invScaleY=Math.sqrt(Me[1][0]*Me[1][0]+Me[1][1]*Me[1][1]+Me[1][2]*Me[1][2]),xe._lastBBox=ye}}function $e(Ee){var xe=G.select(Ee),ye=Ee._fullLayout;if(ye._calcInverseTransform=je,ye._calcInverseTransform(Ee),ye._container=xe.selectAll(".plot-container").data([0]),ye._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),ye._paperdiv=ye._container.selectAll(".svg-container").data([0]),ye._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),ye._glcontainer=ye._paperdiv.selectAll(".gl-container").data([{}]),ye._glcontainer.enter().append("div").classed("gl-container",!0),ye._paperdiv.selectAll(".main-svg").remove(),ye._paperdiv.select(".modebar-container").remove(),ye._paper=ye._paperdiv.insert("svg",":first-child").classed("main-svg",!0),ye._toppaper=ye._paperdiv.append("svg").classed("main-svg",!0),ye._modebardiv=ye._paperdiv.append("div"),delete ye._modeBar,ye._hoverpaper=ye._paperdiv.append("svg").classed("main-svg",!0),!ye._uid){var Me={};G.selectAll("defs").each(function(){this.id&&(Me[this.id.split("-")[1]]=1)}),ye._uid=S.randstr(Me)}ye._paperdiv.selectAll(".main-svg").attr(d.svgAttrs),ye._defs=ye._paper.append("defs").attr("id","defs-"+ye._uid),ye._clips=ye._defs.append("g").classed("clips",!0),ye._topdefs=ye._toppaper.append("defs").attr("id","topdefs-"+ye._uid),ye._topclips=ye._topdefs.append("g").classed("clips",!0),ye._bgLayer=ye._paper.append("g").classed("bglayer",!0),ye._draggers=ye._paper.append("g").classed("draglayer",!0);var Xe=ye._paper.append("g").classed("layer-below",!0);ye._imageLowerLayer=Xe.append("g").classed("imagelayer",!0),ye._shapeLowerLayer=Xe.append("g").classed("shapelayer",!0),ye._cartesianlayer=ye._paper.append("g").classed("cartesianlayer",!0),ye._polarlayer=ye._paper.append("g").classed("polarlayer",!0),ye._smithlayer=ye._paper.append("g").classed("smithlayer",!0),ye._ternarylayer=ye._paper.append("g").classed("ternarylayer",!0),ye._geolayer=ye._paper.append("g").classed("geolayer",!0),ye._funnelarealayer=ye._paper.append("g").classed("funnelarealayer",!0),ye._pielayer=ye._paper.append("g").classed("pielayer",!0),ye._iciclelayer=ye._paper.append("g").classed("iciclelayer",!0),ye._treemaplayer=ye._paper.append("g").classed("treemaplayer",!0),ye._sunburstlayer=ye._paper.append("g").classed("sunburstlayer",!0),ye._indicatorlayer=ye._toppaper.append("g").classed("indicatorlayer",!0),ye._glimages=ye._paper.append("g").classed("glimages",!0);var Je=ye._toppaper.append("g").classed("layer-above",!0);ye._imageUpperLayer=Je.append("g").classed("imagelayer",!0),ye._shapeUpperLayer=Je.append("g").classed("shapelayer",!0),ye._selectionLayer=ye._toppaper.append("g").classed("selectionlayer",!0),ye._infolayer=ye._toppaper.append("g").classed("infolayer",!0),ye._menulayer=ye._toppaper.append("g").classed("menulayer",!0),ye._zoomlayer=ye._toppaper.append("g").classed("zoomlayer",!0),ye._hoverlayer=ye._hoverpaper.append("g").classed("hoverlayer",!0),ye._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Ee.emit("plotly_framework")}$.animate=Zr,$.addFrames=Ar,$.deleteFrames=Br,$.addTraces=ee,$.deleteTraces=ne,$.extendTraces=ce,$.moveTraces=K,$.prependTraces=V,$.newPlot=N,$._doPlot=u,$.purge=Mt,$.react=$t,$.redraw=F,$.relayout=Ae,$.restyle=ue,$.setPlotConfig=y,$.update=Qe,$._guiRelayout=Le(Ae),$._guiRestyle=Le(ue),$._guiUpdate=Le(Qe),$._storeDirectGUIEdit=ie}}),s0=Ge({"src/snapshot/helpers.js"($){var G=Lo();$.getDelay=function(S){return S._has&&(S._has("gl3d")||S._has("mapbox")||S._has("map"))?500:0},$.getRedrawFunc=function(S){return function(){G.getComponentMethod("colorbar","draw")(S)}},$.encodeSVG=function(S){return"data:image/svg+xml,"+encodeURIComponent(S)},$.encodeJSON=function(S){return"data:application/json,"+encodeURIComponent(S)};var h=window.URL||window.webkitURL;$.createObjectURL=function(S){return h.createObjectURL(S)},$.revokeObjectURL=function(S){return h.revokeObjectURL(S)},$.createBlob=function(S,E){if(E==="svg")return new window.Blob([S],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([S],{type:"application/json;charset=utf-8"});var e=b(window.atob(S));return new window.Blob([e],{type:"image/"+E})},$.octetStream=function(S){document.location.href="data:application/octet-stream"+S};function b(S){for(var E=S.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),a}function o(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,a,s){var f=i._fullLayout,c=f._paper,p=f._toppaper,d=f.width,T=f.height,l;c.insert("rect",":first-child").call(b.setRect,0,0,d,T).call(S.fill,f.paper_bgcolor);var g=f._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),b.supplyDefaults(_);for(var u=_._fullData,v=w.length,y=0;yI.length&&A.push(s("unused",M,v.concat(I.length)));var R=I.length,U=Array.isArray(B);U&&(R=Math.min(R,B.length));var j,Z,re,fe,le;if(L.dimensions===2)for(Z=0;ZI[Z].length&&A.push(s("unused",M,v.concat(Z,I[Z].length)));var ce=I[Z].length;for(j=0;j<(U?Math.min(ce,B[Z].length):ce);j++)re=U?B[Z][j]:B,fe=y[Z][j],le=I[Z][j],h.validate(fe,re)?le!==fe&&le!==+fe&&A.push(s("dynamic",M,v.concat(Z,j),fe,le)):A.push(s("value",M,v.concat(Z,j),fe))}else A.push(s("array",M,v.concat(Z),y[Z]));else for(Z=0;ZF?A.push({code:"unused",traceType:y,templateCount:z,dataCount:F}):F>z&&A.push({code:"reused",traceType:y,templateCount:z,dataCount:F})}}function N(B,R){for(var U in B)if(U.charAt(0)!=="_"){var j=B[U],Z=s(B,U,R);h(j)?(Array.isArray(B)&&j._template===!1&&j.templateitemname&&A.push({code:"missing",path:Z,templateitemname:j.templateitemname}),N(j,Z)):Array.isArray(j)&&f(j)&&N(j,Z)}}if(N({data:_,layout:M},""),A.length)return A.map(c)};function f(p){for(var d=0;d=0;c--){var p=e[c];if(p.type==="scatter"&&p.xaxis===s.xaxis&&p.yaxis===s.yaxis){p.opacity=void 0;break}}}}}}}),a2=Ge({"src/traces/scatter/layout_defaults.js"($,G){var h=gn(),b=nm();G.exports=function(S,E){function e(r,o){return h.coerce(S,E,b,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Np=Ge({"src/plots/cartesian/align_period.js"($,G){var h=Pi(),b=gn(),S=b.dateTime2ms,E=b.incrementMonth,e=zi(),t=e.ONEAVGMONTH;G.exports=function(o,n,i,a){if(n.type!=="date")return{vals:a};var s=o[i+"periodalignment"];if(!s)return{vals:a};var f=o[i+"period"],c;if(h(f)){if(f=+f,f<=0)return{vals:a}}else if(typeof f=="string"&&f.charAt(0)==="M"){var p=+f.substring(1);if(p>0&&Math.round(p)===p)c=p;else return{vals:a}}for(var d=n.calendar,T=s==="start",l=s==="end",g=o[i+"period0"],x=S(g,d)||0,A=[],M=[],_=[],w=a.length,m=0;mu;)I=E(I,-c,d);for(;I<=u;)I=E(I,c,d);y=E(I,-c,d)}else{for(v=Math.round((u-x)/f),I=x+v*f;I>u;)I-=f;for(;I<=u;)I+=f;y=I-f}A[m]=T?y:l?I:(y+I)/2,M[m]=y,_[m]=I}return{vals:A,starts:M,ends:_}}}}),tp=Ge({"src/traces/scatter/colorscale_calc.js"($,G){var h=hv().hasColorscale,b=dv(),S=iu();G.exports=function(e,t){S.hasLines(t)&&h(t,"line")&&b(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),S.hasMarkers(t)&&(h(t,"marker")&&b(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),h(t,"marker.line")&&b(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),l0=Ge({"src/traces/scatter/arrays_to_calcdata.js"($,G){var h=gn();G.exports=function(S,E){for(var e=0;eN&&y[R].gap;)R--;for(j=y[R].s,B=y.length-1;B>R;B--)y[B].s=j;for(;NU+B||!h(R))}for(var Z=0;Zz[d]&&d0?e:t)/(d._m*g*(d._m>0?e:t)))),Wt*=1e3}if(_r===S){if(l&&(_r=d.c2p(Ot.y,!0)),_r===S)return!1;_r*=1e3}return[Wt,_r]}function ae(Ct,Ot,Wt,_r){var pr=Wt-Ct,hr=_r-Ot,Fr=.5-Ct,En=.5-Ot,Zn=pr*pr+hr*hr,qn=pr*Fr+hr*En;if(qn>0&&qn1||Math.abs(Fr.y-Wt[0][1])>1)&&(Fr=[Fr.x,Fr.y],_r&&Ce(Fr,Ct)Ye||Ct[1]st)return[n(Ct[0],ze,Ye),n(Ct[1],it,st)]}function Ft(Ct,Ot){if(Ct[0]===Ot[0]&&(Ct[0]===ze||Ct[0]===Ye)||Ct[1]===Ot[1]&&(Ct[1]===it||Ct[1]===st))return!0}function Nt(Ct,Ot){var Wt=[],_r=rt(Ct),pr=rt(Ot);return _r&&pr&&Ft(_r,pr)||(_r&&Wt.push(_r),pr&&Wt.push(pr)),Wt}function $t(Ct,Ot,Wt){return function(_r,pr){var hr=rt(_r),Fr=rt(pr),En=[];if(hr&&Fr&&Ft(hr,Fr))return En;hr&&En.push(hr),Fr&&En.push(Fr);var Zn=2*r.constrain((_r[Ct]+pr[Ct])/2,Ot,Wt)-((hr||_r)[Ct]+(Fr||pr)[Ct]);if(Zn){var qn;hr&&Fr?qn=Zn>0==hr[Ct]>Fr[Ct]?hr:Fr:qn=hr||Fr,qn[Ct]+=Zn}return En}}var rr;m==="linear"||m==="spline"?rr=ct:m==="hv"||m==="vh"?rr=Nt:m==="hvh"?rr=$t(0,ze,Ye):m==="vhv"&&(rr=$t(1,it,st));function Mr(Ct,Ot){var Wt=Ot[0]-Ct[0],_r=(Ot[1]-Ct[1])/Wt,pr=(Ct[1]*Ot[0]-Ot[1]*Ct[0])/Wt;return pr>0?[_r>0?ze:Ye,st]:[_r>0?Ye:ze,it]}function Sr(Ct){var Ot=Ct[0],Wt=Ct[1],_r=Ot===z[F-1][0],pr=Wt===z[F-1][1];if(!(_r&&pr))if(F>1){var hr=Ot===z[F-2][0],Fr=Wt===z[F-2][1];_r&&(Ot===ze||Ot===Ye)&&hr?Fr?F--:z[F-1]=Ct:pr&&(Wt===it||Wt===st)&&Fr?hr?F--:z[F-1]=Ct:z[F++]=Ct}else z[F++]=Ct}function Zr(Ct){z[F-1][0]!==Ct[0]&&z[F-1][1]!==Ct[1]&&Sr([Te,pe]),Sr(Ct),Ne=null,Te=pe=0}var Ar=r.isArrayOrTypedArray(M);function Br(Ct){if(Ct&&A&&(Ct.i=N,Ct.d=s,Ct.trace=c,Ct.marker=Ar?M[Ct.i]:M,Ct.backoff=A),ie=Ct[0]/g,ve=Ct[1]/x,Qe=Ct[0]Ye?Ye:0,Le=Ct[1]st?st:0,Qe||Le){if(!F)z[F++]=[Qe||Ct[0],Le||Ct[1]];else if(Ne){var Ot=rr(Ne,Ct);Ot.length>1&&(Zr(Ot[0]),z[F++]=Ot[1])}else ot=rr(z[F-1],Ct)[0],z[F++]=ot;var Wt=z[F-1];Qe&&Le&&(Wt[0]!==Qe||Wt[1]!==Le)?(Ne&&(Te!==Qe&&pe!==Le?Sr(Te&&pe?Mr(Ne,Ct):[Te||Qe,pe||Le]):Te&&pe&&Sr([Te,pe])),Sr([Qe,Le])):Te-Qe&&pe-Le&&Sr([Qe||Te,Le||pe]),Ne=Ct,Te=Qe,pe=Le}else Ne&&Zr(rr(Ne,Ct)[0]),z[F++]=Ct}for(N=0;NAe(Z,Mt))break;R=Z,ne=le[0]*fe[0]+le[1]*fe[1],ne>V?(V=ne,U=Z,re=!1):ne=s.length||!Z)break;Br(Z),B=Z}}Ne&&Sr([Te||Ne[0],pe||Ne[1]]),y.push(z.slice(0,F))}var je=m.slice(m.length-1);if(A&&je!=="h"&&je!=="v"){for(var $e=!1,Ee=-1,xe=[],ye=0;ye=0?i=p:(i=p=c,c++),i0,m=n(p,d,T);if(A=l.selectAll("g.trace").data(m,function(v){return v[0].trace.uid}),A.enter().append("g").attr("class",function(v){return"trace scatter trace"+v[0].trace.uid}).style("stroke-miterlimit",2),A.order(),a(p,A,d),w){x&&(M=x());var u=h.transition().duration(g.duration).ease(g.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(v,y){s(p,y,d,v,m,this,g)})})}else A.each(function(v,y){s(p,y,d,v,m,this,g)});_&&A.exit().remove(),l.selectAll("path:not([d])").remove()};function a(c,p,d){p.each(function(T){var l=E(h.select(this),"g","fills");t.setClipUrl(l,d.layerClipId,c);var g=T[0].trace,x=[];g._ownfill&&x.push("_ownFill"),g._nexttrace&&x.push("_nextFill");var A=l.selectAll("g").data(x,e);A.enter().append("g"),A.exit().each(function(M){g[M]=null}).remove(),A.order().each(function(M){g[M]=E(h.select(this),"path","js-fill")})})}function s(c,p,d,T,l,g,x){var A=c._context.staticPlot,M;f(c,p,d,T,l);var _=!!x&&x.duration>0;function w(Sr){return _?Sr.transition():Sr}var m=d.xaxis,u=d.yaxis,v=T[0].trace,y=v.line,I=h.select(g),L=E(I,"g","errorbars"),z=E(I,"g","lines"),F=E(I,"g","points"),N=E(I,"g","text");if(b.getComponentMethod("errorbars","plot")(c,L,d,x),v.visible!==!0)return;w(I).style("opacity",v.opacity);var B,R,U=v.fill.charAt(v.fill.length-1);U!=="x"&&U!=="y"&&(U="");var j,Z;U==="y"?(j=1,Z=u.c2p(0,!0)):U==="x"&&(j=0,Z=m.c2p(0,!0)),T[0][d.isRangePlot?"nodeRangePlot3":"node3"]=I;var re="",fe=[],le=v._prevtrace,ce=null,V=null;le&&(re=le._prevRevpath||"",R=le._nextFill,fe=le._ownPolygons,ce=le._fillsegments,V=le._fillElement);var ee,ne,K="",ue="",te,H,ae,ie,ve,Ae,Ce=[];v._polygons=[];var Fe=[],ze=[],Ye=S.noop;if(B=v._ownFill,r.hasLines(v)||v.fill!=="none"){R&&R.datum(T),["hv","vh","hvh","vhv"].indexOf(y.shape)!==-1?(te=t.steps(y.shape),H=t.steps(y.shape.split("").reverse().join(""))):y.shape==="spline"?te=H=function(Sr){var Zr=Sr[Sr.length-1];return Sr.length>1&&Sr[0][0]===Zr[0]&&Sr[0][1]===Zr[1]?t.smoothclosed(Sr.slice(1),y.smoothing):t.smoothopen(Sr,y.smoothing)}:te=H=function(Sr){return"M"+Sr.join("L")},ae=function(Sr){return H(Sr.reverse())},ze=o(T,{xaxis:m,yaxis:u,trace:v,connectGaps:v.connectgaps,baseTolerance:Math.max(y.width||1,3)/4,shape:y.shape,backoff:y.backoff,simplify:y.simplify,fill:v.fill}),Fe=new Array(ze.length);var it=0;for(M=0;M=A[0]&&I.x<=A[1]&&I.y>=M[0]&&I.y<=M[1]}),u=Math.ceil(m.length/w),v=0;l.forEach(function(I,L){var z=I[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(le,ce)&&d<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(c.c2p(fe.x)-d);return ne=Math.min(le,ce)&&T<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(p.c2p(fe.y)-T);return neue!=Fe>=ue&&(ve=ae[H-1][0],Ae=ae[H][0],Fe-Ce&&(ie=ve+(Ae-ve)*(ue-Ce)/(Fe-Ce),V=Math.min(V,ie),ee=Math.max(ee,ie)));return V=Math.max(V,0),ee=Math.min(ee,c._length),{x0:V,x1:ee,y0:ue,y1:ue}}if(g.indexOf("fills")!==-1&&f._fillElement){var j=R(f._fillElement)&&!R(f._fillExclusionElement);if(j){var Z=U(f._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var re=e.defaultLine;return e.opacity(f.fillcolor)?re=f.fillcolor:e.opacity((f.line||{}).color)&&(re=f.line.color),h.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:re,hovertemplate:!1}),delete o.index,f.text&&!h.isArrayOrTypedArray(f.text)?o.text=String(f.text):o.text=f.name,[o]}}}}}),sg=Ge({"src/traces/scatter/select.js"($,G){var h=iu();G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=[],n=e[0].trace,i,a,s,f,c=!h.hasMarkers(n)&&!h.hasText(n);if(c)return[];if(E===!1)for(i=0;i0&&(a["_"+n+"axes"]||{})[o])return a;if((a[n+"axis"]||n)===o){if(t(a,n))return a;if((a[n]||[]).length||a[n+"0"])return a}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var n=e(r),i=h(r,"box-violin"),a=h(r._fullInput||{},"candlestick");return i&&!a&&o===n&&r[n]===void 0&&r[n+"0"]===void 0}}}),Lf=Ge({"src/plots/cartesian/category_order_defaults.js"($,G){var h=As().isTypedArraySpec;function b(S,E){var e=E.dataAttr||S._id.charAt(0),t={},r,o,n;if(E.axData)r=E.axData;else for(r=[],o=0;o0||h(o),i;n&&(i="array");var a=t("categoryorder",i),s;a==="array"&&(s=t("categoryarray")),!n&&a==="array"&&(a=e.categoryorder="trace"),a==="trace"?e._initialCategories=[]:a==="array"?e._initialCategories=s.slice():(s=b(e,r).sort(),a==="category ascending"?e._initialCategories=s:a==="category descending"&&(e._initialCategories=s.reverse()))}}}}),Nu=Ge({"src/plots/cartesian/line_grid_defaults.js"($,G){var h=Bs().mix,b=th(),S=gn();G.exports=function(e,t,r,o){o=o||{};var n=o.dfltColor;function i(v,y){return S.coerce2(e,t,o.attributes,v,y)}var a=i("linecolor",n),s=i("linewidth"),f=r("showline",o.showLine||!!a||!!s);f||(delete t.linecolor,delete t.linewidth);var c=h(n,o.bgColor,o.blend||b.lightFraction).toRgbString(),p=i("gridcolor",c),d=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!p||!!d||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var g=h(t.gridcolor,o.bgColor,67).toRgbString(),x=i("minor.gridcolor",g),A=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!x||!!A||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){i("zerolinelayer");var w=i("zerolinecolor",n),m=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!m);u||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Up=Ge({"src/plots/cartesian/axis_defaults.js"($,G){var h=Pi(),b=Lo(),S=gn(),E=pu(),e=vv(),t=ev(),r=eg(),o=R0(),n=Pp(),i=Sd(),a=Lf(),s=Nu(),f=qT(),c=Kd(),p=rh().WEEKDAY_PATTERN,d=rh().HOUR_PATTERN;G.exports=function(A,M,_,w,m){var u=w.letter,v=w.font||{},y=w.splomStash||{},I=_("visible",!w.visibleDflt),L=M._template||{},z=M.type||L.type||"-",F;if(z==="date"){var N=b.getComponentMethod("calendars","handleDefaults");N(A,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var B="";(!w.noTicklabelposition||z==="multicategory")&&(B=S.coerce(A,M,{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")),w.noTicklabeloverflow||_("ticklabeloverflow",B.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),c(M,m),f(A,M,_,w),a(A,M,_,w),w.noHover||(z!=="category"&&_("hoverformat"),w.noUnifiedhovertitle||_("unifiedhovertitle.text"));var R=_("color"),U=R!==t.color.dflt?R:v.color,j=y.label||m._dfltTitle[u];if(i(A,M,_,z,w),!I)return M;_("title.text",j),S.coerceFont(_,"title.font",v,{overrideDflt:{size:S.bigFont(v.size),color:U}}),r(A,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(A,M,_,z,{isMinor:!0})),n(A,M,_,z,w),o(A,M,_,w),Z){var re=w.isMinor;w.isMinor=!0,o(A,M,_,w),w.isMinor=re}s(A,M,_,{dfltColor:R,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var fe=z==="multicategory";if(!w.noTickson&&(z==="category"||fe)&&(M.ticks||M.showgrid)&&(fe?(_("tickson","boundaries"),delete M.ticklabelposition):_("tickson")),fe){var le=_("showdividers");le&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(A,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var ce=0;ce=2){var u="",v,y;if(m.length===2){for(v=0;v<2;v++)if(y=g(m[v]),y){u=p;break}}var I=_("pattern",u);if(I===p)for(v=0;v<2;v++)y=g(m[v]),y&&(A.bounds[v]=m[v]=y-1);if(I)for(v=0;v<2;v++)switch(y=m[v],I){case p:if(!h(y)){A.enabled=!1;return}if(y=+y,y!==Math.floor(y)||y<0||y>=7){A.enabled=!1;return}A.bounds[v]=m[v]=y;break;case d:if(!h(y)){A.enabled=!1;return}if(y=+y,y<0||y>24){A.enabled=!1;return}A.bounds[v]=m[v]=y;break}if(M.autorange===!1){var L=M.range;if(L[0]L[1]){A.enabled=!1;return}}else if(m[0]>L[0]&&m[1]_[1]-1/4096&&(e.domain=c),b.noneOrAll(E.domain,e.domain,c),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),i2=Ge({"src/plots/cartesian/layout_defaults.js"($,G){var h=gn(),b=_o(),S=Vv().isUnifiedHover,E=KT(),e=pu(),t=_1(),r=ev(),o=Dv(),n=Up(),i=ag(),a=Md(),s=Cf(),f=s.id2name,c=s.name2id,p=rh().AX_ID_PATTERN,d=Lo(),T=d.traceIs,l=d.getComponentMethod;function g(x,A,M){Array.isArray(x[A])?x[A].push(M):x[A]=[M]}G.exports=function(A,M,_){var w=M.autotypenumbers,m={},u={},v={},y={},I={},L={},z={},F={},N={},B={},R,U;for(R=0;R<_.length;R++){var j=_[R];if(T(j,"cartesian")){var Z;if(j.xaxis)Z=f(j.xaxis),g(m,Z,j);else if(j.xaxes)for(U=0;U rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var m=M.plot.selectAll(".scatterlayer .trace");m.selectAll(".point").call(E.setPointGroupScale,1,1),m.selectAll(".textpoint").call(E.setTextPointsScale,1,1),m.call(E.hideOutsideRangePoints,M)}function f(M,_){var w=M.plotinfo,m=w.xaxis,u=w.yaxis,v=m._length,y=u._length,I=!!M.xr1,L=!!M.yr1,z=[];if(I){var F=S.simpleMap(M.xr0,m.r2l),N=S.simpleMap(M.xr1,m.r2l),B=F[1]-F[0],R=N[1]-N[0];z[0]=(F[0]*(1-_)+_*N[0]-F[0])/(F[1]-F[0])*v,z[2]=v*(1-_+_*R/B),m.range[0]=m.l2r(F[0]*(1-_)+_*N[0]),m.range[1]=m.l2r(F[1]*(1-_)+_*N[1])}else z[0]=0,z[2]=v;if(L){var U=S.simpleMap(M.yr0,u.r2l),j=S.simpleMap(M.yr1,u.r2l),Z=U[1]-U[0],re=j[1]-j[0];z[1]=(U[1]*(1-_)+_*j[1]-U[1])/(U[0]-U[1])*y,z[3]=y*(1-_+_*re/Z),u.range[0]=m.l2r(U[0]*(1-_)+_*j[0]),u.range[1]=u.l2r(U[1]*(1-_)+_*j[1])}else z[1]=0,z[3]=y;e.drawOne(r,m,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[m._id,u._id]);var fe=I?v/z[2]:1,le=L?y/z[3]:1,ce=I?z[0]:0,V=L?z[1]:0,ee=I?z[0]/z[2]*v:0,ne=L?z[1]/z[3]*y:0,K=m._offset-ee,ue=u._offset-ne;w.clipRect.call(E.setTranslate,ce,V).call(E.setScale,1/fe,1/le),w.plot.call(E.setTranslate,K,ue).call(E.setScale,fe,le),E.setPointGroupScale(w.zoomScalePts,1/fe,1/le),E.setTextPointsScale(w.zoomScaleTxt,1/fe,1/le)}var c;i&&(c=i());function p(){for(var M={},_=0;_n.duration?(p(),g=window.cancelAnimationFrame(A)):g=window.requestAnimationFrame(A)}return T=Date.now(),g=window.requestAnimationFrame(A),Promise.resolve()}}}),dh=Ge({"src/plots/cartesian/index.js"($){var G=Mi(),h=Lo(),b=gn(),S=Wc(),E=Ss(),e=Rv().getModuleCalcData,t=Cf(),r=rh(),o=Ad(),n=b.ensureSingle;function i(T,l,g){return b.ensureSingle(T,l,g,function(x){x.datum(g)})}var a=r.zindexSeparator;$.name="cartesian",$.attr=["xaxis","yaxis"],$.idRoot=["x","y"],$.idRegex=r.idRegex,$.attrRegex=r.attrRegex,$.attributes=u5(),$.layoutAttributes=ev(),$.supplyLayoutDefaults=i2(),$.transitionAxes=fm(),$.finalizeSubplots=function(T,l){var g=l._subplots,x=g.xaxis,A=g.yaxis,M=g.cartesian,_=M,w={},m={},u,v,y;for(u=0;u<_.length;u++){var I=_[u].split("y");w[I[0]]=1,m["y"+I[1]]=1}for(u=0;u0){var L=I.id;if(L.indexOf(a)!==-1)continue;L+=a+(u+1),I=b.extendFlat({},I,{id:L,plot:A._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,N=0;N<_.length;N++){var B=_[N],R=B[0].trace;v===(R.zorder||0)&&R.xaxis+R.yaxis===y&&((l.indexOf(R.index)!==-1||R.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===y&&["tonextx","tonexty","tonext"].indexOf(R.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(B)),F=B)}s(T,I,z,g,x)}}};function s(T,l,g,x,A){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,m=_._modules,u,v,y,I=[],L=[],z=0;z1&&(Z+=a+j),U.push(w+Z),_=0;_1,y=l.mainplotinfo;if(!l.mainplot||v)if(u)l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.xaxislayer=n(x,"g","xaxislayer-above"),l.yaxislayer=n(x,"g","yaxislayer-above");else{if(!_){var I=n(x,"g","layer-subplot");l.shapelayer=n(I,"g","shapelayer"),l.imagelayer=n(I,"g","imagelayer"),y&&v?(l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer):(l.minorGridlayer=n(x,"g","minor-gridlayer"),l.gridlayer=n(x,"g","gridlayer"),l.zerolinelayer=n(x,"g","zerolinelayer"));var L=n(x,"g","layer-between");l.shapelayerBetween=n(L,"g","shapelayer"),l.imagelayerBetween=n(L,"g","imagelayer"),n(x,"path","xlines-below"),n(x,"path","ylines-below"),l.overlinesBelow=n(x,"g","overlines-below"),n(x,"g","xaxislayer-below"),n(x,"g","yaxislayer-below"),l.overaxesBelow=n(x,"g","overaxes-below")}l.overplot=n(x,"g","overplot"),l.plot=n(l.overplot,"g",A),y&&v?l.zerolinelayerAbove=y.zerolinelayerAbove:l.zerolinelayerAbove=n(x,"g","zerolinelayer-above"),_||(l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.overlinesAbove=n(x,"g","overlines-above"),n(x,"g","xaxislayer-above"),n(x,"g","yaxislayer-above"),l.overaxesAbove=n(x,"g","overaxes-above"),l.xlines=x.select(".xlines-"+w),l.ylines=x.select(".ylines-"+m),l.xaxislayer=x.select(".xaxislayer-"+w),l.yaxislayer=x.select(".yaxislayer-"+m))}else{var z=y.plotgroup,F=A+"-x",N=A+"-y";l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer,l.zerolinelayerAbove=y.zerolinelayerAbove,n(y.overlinesBelow,"path",F),n(y.overlinesBelow,"path",N),n(y.overaxesBelow,"g",F),n(y.overaxesBelow,"g",N),l.plot=n(y.overplot,"g",A),n(y.overlinesAbove,"path",F),n(y.overlinesAbove,"path",N),n(y.overaxesAbove,"g",F),n(y.overaxesAbove,"g",N),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+m).select("."+N),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+m).select("."+N)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function p(T,l){if(T){var g={};T.each(function(m){var u=m[0],v=G.select(this);v.remove(),d(u,l),g[u]=!0});for(var x in l._plots)for(var A=l._plots[x],M=A.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,g=f.backoff*p+a.standoff,x=c.backoff*d+a.startstandoff,A,M,_,w;if(s.nodeName==="line"){A={x:+n.attr("x1"),y:+n.attr("y1")},M={x:+n.attr("x2"),y:+n.attr("y2")};var m=A.x-M.x,u=A.y-M.y;if(_=Math.atan2(u,m),w=_+Math.PI,g&&x&&g+x>Math.sqrt(m*m+u*u)){Z();return}if(g){if(g*g>m*m+u*u){Z();return}var v=g*Math.cos(_),y=g*Math.sin(_);M.x+=v,M.y+=y,n.attr({x2:M.x,y2:M.y})}if(x){if(x*x>m*m+u*u){Z();return}var I=x*Math.cos(_),L=x*Math.sin(_);A.x-=I,A.y-=L,n.attr({x1:A.x,y1:A.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?Nn="right":Nn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Nn]}for(var ot=!1,ct=["x","y"],rt=0;rt1)&&($t===Nt?(Je=rr.r2fraction(x["a"+Ft]),(Je<0||Je>1)&&(ot=!0)):ot=!0),$e=rr._offset+rr.r2p(x[Ft]),ye=.5}else{var Lt=Xe==="domain";Ft==="x"?(xe=x[Ft],$e=Lt?rr._offset+rr._length*xe:$e=u.l+u.w*xe):(xe=1-x[Ft],$e=Lt?rr._offset+rr._length*xe:$e=u.t+u.h*xe),ye=x.showarrow?.5:xe}if(x.showarrow){je.head=$e;var Ct=x["a"+Ft];if(Me=Sr*Ne(.5,x.xanchor)-Zr*Ne(.5,x.yanchor),$t===Nt){var Ot=t.getRefType($t);Ot==="domain"?(Ft==="y"&&(Ct=1-Ct),je.tail=rr._offset+rr._length*Ct):Ot==="paper"?Ft==="y"?(Ct=1-Ct,je.tail=u.t+u.h*Ct):je.tail=u.l+u.w*Ct:je.tail=rr._offset+rr.r2p(Ct),Ee=Me}else je.tail=$e+Ct,Ee=Me+Ct;je.text=je.tail+Me;var Wt=m[Ft==="x"?"width":"height"];if(Nt==="paper"&&(je.head=E.constrain(je.head,1,Wt-1)),$t==="pixel"){var _r=-Math.max(je.tail-3,je.text),pr=Math.min(je.tail+3,je.text)-Wt;_r>0?(je.tail+=_r,je.text+=_r):pr>0&&(je.tail-=pr,je.text-=pr)}je.tail+=Mt,je.head+=Mt}else Me=Ar*Ne(ye,Br),Ee=Me,je.text=$e+Me;je.text+=Mt,Me+=Mt,Ee+=Mt,x["_"+Ft+"padplus"]=Ar/2+Ee,x["_"+Ft+"padminus"]=Ar/2-Ee,x["_"+Ft+"size"]=Ar,x["_"+Ft+"shift"]=Me}if(ot){ce.remove();return}var hr=0,Fr=0;if(x.align!=="left"&&(hr=(Qe-st)*(x.align==="center"?.5:1)),x.valign!=="top"&&(Fr=(Le-nt)*(x.valign==="middle"?.5:1)),Ye)ze.select("svg").attr({x:ne+hr-1,y:ne+Fr}).call(o.setClipUrl,ue?B:null,g);else{var En=ne+Fr-it.top,Zn=ne+hr-it.left;ie.call(i.positionText,Zn,En).call(o.setClipUrl,ue?B:null,g)}te.select("rect").call(o.setRect,ne,ne,Qe,Le),K.call(o.setRect,V/2,V/2,Te-V,pe-V),ce.call(o.setTranslate,Math.round(R.x.text-Te/2),Math.round(R.y.text-pe/2)),Z.attr({transform:"rotate("+U+","+R.x.text+","+R.y.text+")"});var qn=function(ra,Nn){j.selectAll(".annotation-arrow-g").remove();var Ea=R.x.head,ja=R.y.head,ir=R.x.tail+ra,qt=R.y.tail+Nn,ar=R.x.text+ra,sr=R.y.text+Nn,Vr=E.rotationXYMatrix(U,ar,sr),on=E.apply2DTransform(Vr),pn=E.apply2DTransform2(Vr),wn=+K.attr("width"),Kn=+K.attr("height"),da=ar-.5*wn,fa=da+wn,ga=sr-.5*Kn,ka=ga+Kn,Vn=[[da,ga,da,ka],[da,ka,fa,ka],[fa,ka,fa,ga],[fa,ga,da,ga]].map(pn);if(!Vn.reduce(function(Tt,or){return Tt^!!E.segmentsIntersect(Ea,ja,Ea+1e6,ja+1e6,or[0],or[1],or[2],or[3])},!1)){Vn.forEach(function(Tt){var or=E.segmentsIntersect(ir,qt,Ea,ja,Tt[0],Tt[1],Tt[2],Tt[3]);or&&(ir=or.x,qt=or.y)});var hi=x.arrowwidth,Ti=x.arrowcolor,Dt=x.arrowside,yt=j.append("g").style({opacity:r.opacity(Ti)}).classed("annotation-arrow-g",!0),Er=yt.append("path").attr("d","M"+ir+","+qt+"L"+Ea+","+ja).style("stroke-width",hi+"px").call(r.stroke,r.rgb(Ti));if(c(Er,Dt,x),v.annotationPosition&&Er.node().parentNode&&!M){var Nr=Ea,jr=ja;if(x.standoff){var Ir=Math.sqrt(Math.pow(Ea-ir,2)+Math.pow(ja-qt,2));Nr+=x.standoff*(ir-Ea)/Ir,jr+=x.standoff*(qt-ja)/Ir}var Ur=yt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(ir-Nr)+","+(qt-jr),transform:e(Nr,jr)}).style("stroke-width",hi+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),sn,Kr;s.init({element:Ur.node(),gd:g,prepFn:function(){var Tt=o.getTranslate(ce);sn=Tt.x,Kr=Tt.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(Tt,or){var Dr=on(sn,Kr),ln=Dr[0]+Tt,Pn=Dr[1]+or;ce.call(o.setTranslate,ln,Pn),F("x",T(_,Tt,"x",u,x)),F("y",T(w,or,"y",u,x)),x.axref===x.xref&&F("ax",T(_,Tt,"ax",u,x)),x.ayref===x.yref&&F("ay",T(w,or,"ay",u,x)),yt.attr("transform",e(Tt,or)),Z.attr({transform:"rotate("+U+","+ln+","+Pn+")"})},doneFn:function(){b.call("_guiRelayout",g,N());var Tt=document.querySelector(".js-notes-box-panel");Tt&&Tt.redraw(Tt.selectedObj)}})}}};if(x.showarrow&&qn(0,0),re){var ta;s.init({element:ce.node(),gd:g,prepFn:function(){ta=Z.attr("transform")},moveFn:function(ra,Nn){var Ea="pointer";if(x.showarrow)x.axref===x.xref?F("ax",T(_,ra,"ax",u,x)):F("ax",x.ax+ra),x.ayref===x.yref?F("ay",T(w,Nn,"ay",u.w,x)):F("ay",x.ay+Nn),qn(ra,Nn);else{if(M)return;var ja,ir;if(_)ja=T(_,ra,"x",u,x);else{var qt=x._xsize/u.w,ar=x.x+(x._xshift-x.xshift)/u.w-qt/2;ja=s.align(ar+ra/u.w,qt,0,1,x.xanchor)}if(w)ir=T(w,Nn,"y",u,x);else{var sr=x._ysize/u.h,Vr=x.y-(x._yshift+x.yshift)/u.h-sr/2;ir=s.align(Vr-Nn/u.h,sr,0,1,x.yanchor)}F("x",ja),F("y",ir),(!_||!w)&&(Ea=s.getCursor(_?.5:ja,w?.5:ir,x.xanchor,x.yanchor))}Z.attr({transform:e(ra,Nn)+ta}),a(ce,Ea)},clickFn:function(ra,Nn){x.captureevents&&g.emit("plotly_clickannotation",le(Nn))},doneFn:function(){a(ce),b.call("_guiRelayout",g,N());var ra=document.querySelector(".js-notes-box-panel");ra&&ra.redraw(ra.selectedObj)}})}}v.annotationText?ie.call(i.makeEditable,{delegate:ce,gd:g}).call(ve).on("edit",function(Ce){x.text=Ce,this.call(ve),F("text",Ce),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),b.call("_guiRelayout",g,N())}):ie.call(ve)}}}),o2=Ge({"src/components/annotations/click.js"($,G){var h=gn(),b=Lo(),S=pu().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,n){var i=t(o,n);return i.on.length>0||i.explicitOff.length>0}function e(o,n){var i=t(o,n),a=i.on,s=i.off.concat(i.explicitOff),f={},c=o._fullLayout.annotations,p,d;if(a.length||s.length){for(p=0;p1){a=!0;break}}a?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(i._pdata=b(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),h(e.graphDiv,i,n,e.id,i._xa,i._ya))}}}}),cg=Ge({"src/components/annotations3d/index.js"($,G){var h=Lo(),b=gn();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:jp()}}},layoutAttributes:jp(),handleDefaults:l2(),includeBasePlot:S,convert:u2(),draw:wx()};function S(E,e){var t=h.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),n=0;n0?l+p:p;return{ppad:p,ppadplus:d?x:A,ppadminus:d?A:x}}else return{ppad:p}}function o(n,i,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",c,p,d=0,T=0,l=f?n.r2c:n.d2c,g=i[s+"sizemode"]==="scaled";if(g?(c=i[s+"0"],p=i[s+"1"],f&&(d=i[s+"0shift"],T=i[s+"1shift"])):(c=i[s+"anchor"],p=i[s+"anchor"]),c!==void 0)return[l(c)+d,l(p)+T];if(i.path){var x=1/0,A=-1/0,M=i.path.match(S.segmentRE),_,w,m,u,v;for(n.type==="date"&&(l=E.decodeDate(l)),_=0;_A&&(A=v)));if(A>=x)return[x,A]}}}}),CM=Ge({"src/components/shapes/index.js"($,G){var h=ng();G.exports={moduleType:"component",name:"shapes",layoutAttributes:zv(),supplyLayoutDefaults:Tx(),supplyDrawNewShapeDefaults:f5(),includeBasePlot:k1()("shapes"),calcAutorange:kM(),draw:h.draw,drawOne:h.drawOne}}}),h5=Ge({"src/components/images/attributes.js"($,G){var h=rh(),b=pu().templatedArray;lm(),G.exports=b("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",h.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",h.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),tv=Ge({"src/components/images/defaults.js"($,G){var h=gn(),b=ws(),S=vv(),E=h5(),e="images";G.exports=function(o,n){var i={name:e,handleItemDefaults:t};S(o,n,i)};function t(r,o,n){function i(g,x){return h.coerce(r,o,E,g,x)}var a=i("source"),s=i("visible",!!a);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var f={_fullLayout:n},c=["x","y"],p=0;p<2;p++){var d=c[p],T=b.coerceRef(r,o,f,d,"paper",void 0);if(T!=="paper"){var l=b.getFromId(f,T);l._imgIndices.push(o._index)}b.coercePosition(o,f,i,T,d,0)}return o}}}),c2=Ge({"src/components/images/draw.js"($,G){var h=Mi(),b=Ss(),S=ws(),E=Cf(),e=Ad();G.exports=function(r){var o=r._fullLayout,n=[],i={},a=[],s,f;for(f=0;f0);c&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),h.noneOrAll(n,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),h.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(n,i){function a(f,c){return h.coerce(n,i,t,f,c)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}}),LM=Ge({"src/components/updatemenus/scrollbox.js"($,G){G.exports=e;var h=Mi(),b=_o(),S=Ss(),E=gn();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,n){var i=this.gd._fullLayout,a=i.width,s=i.height;this.position=r;var f=this.position.l,c=this.position.w,p=this.position.t,d=this.position.h,T=this.position.direction,l=T==="down",g=T==="left",x=T==="right",A=T==="up",M=c,_=d,w,m,u,v;!l&&!g&&!x&&!A&&(this.position.direction="down",l=!0);var y=l||A;y?(w=f,m=w+M,l?(u=p,v=Math.min(u+_,s),_=v-u):(v=p+_,u=Math.max(v-_,0),_=v-u)):(u=p,v=u+_,g?(m=f+M,w=Math.max(m-M,0),M=m-w):(w=f,m=Math.min(w+M,a),M=m-w)),this._box={l:w,t:u,w:M,h:_};var I=c>M,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=f,N=p+d;N+z>s&&(N=s-z);var B=this.container.selectAll("rect.scrollbar-horizontal").data(I?[0]:[]);B.exit().on(".drag",null).remove(),B.enter().append("rect").classed("scrollbar-horizontal",!0).call(b.fill,e.barColor),I?(this.hbar=B.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:N,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=M-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var R=d>_,U=e.barWidth+2*e.barPad,j=e.barLength+2*e.barPad,Z=f+c,re=p;Z+U>a&&(Z=a-U);var fe=this.container.selectAll("rect.scrollbar-vertical").data(R?[0]:[]);fe.exit().on(".drag",null).remove(),fe.enter().append("rect").classed("scrollbar-vertical",!0).call(b.fill,e.barColor),R?(this.vbar=fe.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:re,width:U,height:j}),this._vbarYMin=re+j/2,this._vbarTranslateMax=_-j):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var le=this.id,ce=w-.5,V=R?m+U+.5:m+.5,ee=u-.5,ne=I?v+z+.5:v+.5,K=i._topdefs.selectAll("#"+le).data(I||R?[0]:[]);if(K.exit().remove(),K.enter().append("clipPath").attr("id",le).append("rect"),I||R?(this._clipRect=K.select("rect").attr({x:Math.floor(ce),y:Math.floor(ee),width:Math.ceil(V)-Math.floor(ce),height:Math.ceil(ne)-Math.floor(ee)}),this.container.call(S.setClipUrl,le,this.gd),this.bg.attr({x:f,y:p,width:c,height:d})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),I||R){var ue=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(ue);var te=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault(),h.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));I&&this.hbar.on(".drag",null).call(te),R&&this.vbar.on(".drag",null).call(te)}this.setTranslate(o,n)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=h.event.dx),this.vbar&&(o-=h.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=h.event.deltaY),this.vbar&&(o+=h.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var n=r+this._hbarXMin,i=n+this._hbarTranslateMax,a=E.constrain(h.event.x,n,i),s=(a-n)/(i-n),f=this.position.w-this._box.w;r=s*f}if(this.vbar){var c=o+this._vbarYMin,p=c+this._vbarTranslateMax,d=E.constrain(h.event.y,c,p),T=(d-c)/(p-c),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var n=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,n),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(S.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var a=r/n;this.hbar.call(S.setTranslate,r+a*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(S.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),v5=Ge({"src/components/updatemenus/draw.js"($,G){var h=Mi(),b=Wc(),S=_o(),E=Ss(),e=gn(),t=Ju(),r=pu().arrayEditor,o=Qh().LINE_SPACING,n=I1(),i=LM();G.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[n.name]);function N(le){b.autoMargin(L,u(le))}var B=z._menulayer.selectAll("g."+n.containerClassName).data(F.length>0?[0]:[]);if(B.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),B.exit().each(function(){h.select(this).selectAll("g."+n.headerGroupClassName).each(N)}).remove(),F.length!==0){var R=B.selectAll("g."+n.headerGroupClassName).data(F,a);R.enter().append("g").classed(n.headerGroupClassName,!0);for(var U=e.ensureSingle(B,"g",n.dropdownButtonGroupClassName,function(le){le.style("pointer-events","all")}),j=0;j0?[0]:[]);Z.enter().append("g").classed(n.containerClassName,!0).style("cursor",R?null:"ew-resize");function re(V){V._commandObserver&&(V._commandObserver.remove(),delete V._commandObserver),b.autoMargin(B,c(V))}if(Z.exit().each(function(){h.select(this).selectAll("g."+n.groupClassName).each(re)}).remove(),j.length!==0){var fe=Z.selectAll("g."+n.groupClassName).data(j,d);fe.enter().append("g").classed(n.groupClassName,!0),fe.exit().each(re).remove();for(var le=0;le0&&(fe=fe.transition().duration(B.transition.duration).ease(B.transition.easing)),fe.attr("transform",t(re-n.gripWidth*.5,B._dims.currentValueTotalHeight))}}function I(N,B){var R=N._dims;return R.inputAreaStart+n.stepInset+(R.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,B))}function L(N,B){var R=N._dims;return Math.min(1,Math.max(0,(B-n.stepInset-R.inputAreaStart)/(R.inputAreaLength-2*n.stepInset-2*R.inputAreaStart)))}function z(N,B,R){var U=R._dims,j=e.ensureSingle(N,"rect",n.railTouchRectClass,function(Z){Z.call(m,B,N,R).style("pointer-events","all")});j.attr({width:U.inputAreaLength,height:Math.max(U.inputAreaWidth,n.tickOffset+R.ticklen+U.labelHeight)}).call(S.fill,R.bgcolor).attr("opacity",0),E.setTranslate(j,0,U.currentValueTotalHeight)}function F(N,B){var R=B._dims,U=R.inputAreaLength-n.railInset*2,j=e.ensureSingle(N,"rect",n.railRectClass);j.attr({width:U,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(S.stroke,B.bordercolor).call(S.fill,B.bgcolor).style("stroke-width",B.borderwidth+"px"),E.setTranslate(j,n.railInset,(R.inputAreaWidth-n.railWidth)*.5+R.currentValueTotalHeight)}}}),d5=Ge({"src/components/sliders/index.js"($,G){var h=D1();G.exports={moduleType:"component",name:h.name,layoutAttributes:vm(),supplyLayoutDefaults:f2(),draw:Ax()}}}),dm=Ge({"src/components/rangeslider/attributes.js"($,G){var h=th();G.exports={bgcolor:{valType:"color",dflt:h.background,editType:"plot"},bordercolor:{valType:"color",dflt:h.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"}}}),Sx=Ge({"src/components/rangeslider/oppaxis_attributes.js"($,G){G.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"}}}),uy=Ge({"src/components/rangeslider/constants.js"($,G){G.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}}}),Mx=Ge({"src/components/rangeslider/helpers.js"($){var G=Cf(),h=Ju(),b=uy(),S=Qh().LINE_SPACING,E=b.name;function e(t){var r=t&&t[E];return r&&r.visible}$.isVisible=e,$.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,n=[],i=0;i=st.max)Ye=ve[it+1];else if(ze=st.pmax)Ye=ve[it+1];else if(ze0?m.touches[0].clientX:0}function p(m,u,v,y){if(u._context.staticPlot)return;var I=m.select("rect."+f.slideBoxClassName).node(),L=m.select("rect."+f.grabAreaMinClassName).node(),z=m.select("rect."+f.grabAreaMaxClassName).node();function F(){var N=h.event,B=N.target,R=c(N),U=R-m.node().getBoundingClientRect().left,j=y.d2p(v._rl[0]),Z=y.d2p(v._rl[1]),re=a.coverSlip();this.addEventListener("touchmove",fe),this.addEventListener("touchend",le),re.addEventListener("mousemove",fe),re.addEventListener("mouseup",le);function fe(ce){var V=c(ce),ee=+V-R,ne,K,ue;switch(B){case I:if(ue="ew-resize",j+ee>v._length||Z+ee<0)return;ne=j+ee,K=Z+ee;break;case L:if(ue="col-resize",j+ee>v._length)return;ne=j+ee,K=Z;break;case z:if(ue="col-resize",Z+ee<0)return;ne=j,K=Z+ee;break;default:ue="ew-resize",ne=U,K=U+ee;break}if(K0);if(g){var x=o(a,s,f);T("x",x[0]),T("y",x[1]),h.noneOrAll(i,a,["x","y"]),T("xanchor"),T("yanchor"),h.coerceFont(T,"font",s.font);var A=T("bgcolor");T("activecolor",b.contrast(A,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(n,i,a,s){var f=s.calendar;function c(T,l){return h.coerce(n,i,e.buttons,T,l)}var p=c("visible");if(p){var d=c("step");d!=="all"&&(f&&f!=="gregorian"&&(d==="month"||d==="year")?i.stepmode="backward":c("stepmode"),c("count")),c("label")}}function o(n,i,a){for(var s=a.filter(function(d){return i[d].anchor===n._id}),f=0,c=0;c1)){delete f.grid;return}if(!T&&!l&&!g){var v=w("pattern")==="independent";v&&(T=!0)}_._hasSubplotGrid=T;var y=w("roworder"),I=y==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,N;x&&f._splomGridDflt&&(F=f._splomGridDflt.xside,N=f._splomGridDflt.yside),_._domains={x:n("x",w,L,F,u),y:n("y",w,z,N,m,I)}}function n(s,f,c,p,d,T){var l=f(s+"gap",c),g=f("domain."+s);f(s+"side",p);for(var x=new Array(d),A=g[0],M=(g[1]-A)/(d-l),_=M*(1-l),w=0;w0,p=r._context.staticPlot;o.each(function(d){var T=d[0].trace,l=T.error_x||{},g=T.error_y||{},x;T.ids&&(x=function(w){return w.id});var A=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!g.visible&&!l.visible&&(d=[]);var M=h.select(this).selectAll("g.errorbar").data(d,x);if(M.exit().remove(),!!d.length){l.visible||M.selectAll("path.xerror").remove(),g.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);c&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),S.setClipUrl(M,n.layerClipId,r),M.each(function(w){var m=h.select(this),u=e(w,s,f);if(!(A&&!w.vis)){var v,y=m.select("path.yerror");if(g.visible&&b(u.x)&&b(u.yh)&&b(u.ys)){var I=g.width;v="M"+(u.x-I)+","+u.yh+"h"+2*I+"m-"+I+",0V"+u.ys,u.noYS||(v+="m-"+I+",0h"+2*I),a=!y.size(),a?y=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("yerror",!0):c&&(y=y.transition().duration(i.duration).ease(i.easing)),y.attr("d",v)}else y.remove();var L=m.select("path.xerror");if(l.visible&&b(u.y)&&b(u.xh)&&b(u.xs)){var z=(l.copy_ystyle?g:l).width;v="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(v+="m0,-"+z+"v"+2*z),a=!L.size(),a?L=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("xerror",!0):c&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",v)}else L.remove()}})}})};function e(t,r,o){var n={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(n.yh=o.c2p(t.yh),n.ys=o.c2p(t.ys),b(n.ys)||(n.noYS=!0,n.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(n.xh=r.c2p(t.xh),n.xs=r.c2p(t.xs),b(n.xs)||(n.noXS=!0,n.xs=r.c2p(t.xs,!0))),n}}}),mm=Ge({"src/components/errorbars/style.js"($,G){var h=Mi(),b=_o();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},n=h.select(this);n.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(b.stroke,r.color),o.copy_ystyle&&(o=r),n.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(b.stroke,o.color)})}}}),gm=Ge({"src/components/errorbars/index.js"($,G){var h=gn(),b=Nc().overrideAll,S=pm(),E={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S),error_z:h.extendFlat({},S)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:b(e,"calc","nested"),scattergl:b(E,"calc","nested")}},supplyDefaults:g5(),calc:d2(),makeComputeError:F0(),plot:p2(),style:mm(),hoverInfo:t};function t(r,o,n){(o.error_y||{}).visible&&(n.yerr=r.yh-r.y,o.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(n.xerr=r.xh-r.x,o.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}}),F1=Ge({"src/components/colorbar/constants.js"($,G){G.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"}}}}),m2=Ge({"src/components/colorbar/draw.js"($,G){var h=Mi(),b=Bs(),S=Wc(),E=Lo(),e=ws(),t=rd(),r=gn(),o=r.strTranslate,n=Qi().extendFlat,i=Dp(),a=Ss(),s=_o(),f=im(),c=Ju(),p=hv().flipScale,d=Up(),T=Md(),l=ev(),g=Qh(),x=g.LINE_SPACING,A=g.FROM_TL,M=g.FROM_BR,_=F1().cn;function w(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(m(L),function(N){return N._id});F.enter().append("g").attr("class",function(N){return N._id}).classed(_.colorbar,!0),F.each(function(N){var B=h.select(this);r.ensureSingle(B,"rect",_.cbbg),r.ensureSingle(B,"g",_.cbfills),r.ensureSingle(B,"g",_.cblines),r.ensureSingle(B,"g",_.cbaxis,function(U){U.classed(_.crisp,!0)}),r.ensureSingle(B,"g",_.cbtitleunshift,function(U){U.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(B,"rect",_.cboutline);var R=u(B,N,L);R&&R.then&&(L._promises||[]).push(R),L._context.edits.colorbarPosition&&v(B,N,L)}),F.exit().each(function(N){S.autoMargin(L,N._id)}).remove(),F.order()}function m(L){var z=L._fullLayout,F=L.calcdata,N=[],B,R,U,j;function Z(H){return n(H,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function re(){typeof j.calc=="function"?j.calc(L,U,B):(B._fillgradient=R.reversescale?p(R.colorscale):R.colorscale,B._zrange=[R[j.min],R[j.max]])}for(var fe=0;fe1){var je=Math.pow(10,Math.floor(Math.log(Mt)/Math.LN10));Ar*=je*r.roundUp(Mt/je,[2,5,10]),(Math.abs(it.start)/it.size+1e-6)%1<2e-6&&(Sr.tick0=0)}Sr.dtick=Ar}Sr.domain=N?[rr+ee/ae.h,rr+Ne-ee/ae.h]:[rr+V/ae.w,rr+Ne-V/ae.w],Sr.setScale(),L.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var $e=L.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),Ee=Sr.ticklabelposition,xe=Sr.title.font.size,ye=L.select("."+_.cbaxis),Me,Xe=0,Je=0;function Lt(pr,hr){var Fr={propContainer:Sr,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:H._dfltTitle.colorbar,containerGroup:L.select("."+_.cbtitle)},En=pr.charAt(0)==="h"?pr.slice(1):"h"+pr;L.selectAll("."+En+",."+En+"-math-group").remove(),f.draw(F,pr,n(Fr,hr||{}))}function Ct(){if(N&&Zr||!N&&!Zr){var pr,hr;Ce==="top"&&(pr=V+ae.l+ot*ne,hr=ee+ae.t+ct*(1-rr-Ne)+3+xe*.75),Ce==="bottom"&&(pr=V+ae.l+ot*ne,hr=ee+ae.t+ct*(1-rr)-3-xe*.25),Ce==="right"&&(hr=ee+ae.t+ct*K+3+xe*.75,pr=V+ae.l+ot*rr),Lt(Sr._id+"title",{attributes:{x:pr,y:hr,"text-anchor":N?"start":"middle"}})}}function Ot(){if(N&&!Zr||!N&&Zr){var pr=Sr.position||0,hr=Sr._offset+Sr._length/2,Fr,En;if(Ce==="right")En=hr,Fr=ae.l+ot*pr+10+xe*(Sr.showticklabels?1:.5);else if(Fr=hr,Ce==="bottom"&&(En=ae.t+ct*pr+10+(Ee.indexOf("inside")===-1?Sr.tickfont.size:0)+(Sr.ticks!=="inside"&&z.ticklen||0)),Ce==="top"){var Zn=Ae.text.split("
").length;En=ae.t+ct*pr+10-Le-x*xe*Zn}Lt((N?"h":"v")+Sr._id+"title",{avoid:{selection:h.select(F).selectAll("g."+Sr._id+"tick"),side:Ce,offsetTop:N?0:ae.t,offsetLeft:N?ae.l:0,maxShift:N?H.width:H.height},attributes:{x:Fr,y:En,"text-anchor":"middle"},transform:{rotate:N?-90:0,offset:0}})}}function Wt(){if(!N&&!Zr||N&&Zr){var pr=L.select("."+_.cbtitle),hr=pr.select("text"),Fr=[-Z/2,Z/2],En=pr.select(".h"+Sr._id+"title-math-group").node(),Zn=15.6;hr.node()&&(Zn=parseInt(hr.node().style.fontSize,10)*x);var qn;if(En?(qn=a.bBox(En),Je=qn.width,Xe=qn.height,Xe>Zn&&(Fr[1]-=(Xe-Zn)/2)):hr.node()&&!hr.classed(_.jsPlaceholder)&&(qn=a.bBox(hr.node()),Je=qn.width,Xe=qn.height),N){if(Xe){if(Xe+=5,Ce==="top")Sr.domain[1]-=Xe/ae.h,Fr[1]*=-1;else{Sr.domain[0]+=Xe/ae.h;var ta=c.lineCount(hr);Fr[1]+=(1-ta)*Zn}pr.attr("transform",o(Fr[0],Fr[1])),Sr.setScale()}}else Je&&(Ce==="right"&&(Sr.domain[0]+=(Je+xe/2)/ae.w),pr.attr("transform",o(Fr[0],Fr[1])),Sr.setScale())}L.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",N?o(0,Math.round(ae.h*(1-Sr.domain[1]))):o(Math.round(ae.w*Sr.domain[0]),0)),ye.attr("transform",N?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var ra=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(nt);ra.enter().append("rect").classed(_.cbfill,!0).attr("style",""),ra.exit().remove();var Nn=Fe.map(Sr.c2p).map(Math.round).sort(function(ar,sr){return ar-sr});ra.each(function(ar,sr){var Vr=[sr===0?Fe[0]:(nt[sr]+nt[sr-1])/2,sr===nt.length-1?Fe[1]:(nt[sr]+nt[sr+1])/2].map(Sr.c2p).map(Math.round);N&&(Vr[1]=r.constrain(Vr[1]+(Vr[1]>Vr[0])?1:-1,Nn[0],Nn[1]));var on=h.select(this).attr(N?"x":"y",rt).attr(N?"y":"x",h.min(Vr)).attr(N?"width":"height",Math.max(Le,2)).attr(N?"height":"width",Math.max(h.max(Vr)-h.min(Vr),2));if(z._fillgradient)a.gradient(on,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var pn=Ye(ar).replace("e-","");on.attr("fill",b(pn).toHexString())}});var Ea=L.select("."+_.cblines).selectAll("path."+_.cbline).data(ve.color&&ve.width?Qe:[]);Ea.enter().append("path").classed(_.cbline,!0),Ea.exit().remove(),Ea.each(function(ar){var sr=rt,Vr=Math.round(Sr.c2p(ar))+ve.width/2%1;h.select(this).attr("d","M"+(N?sr+","+Vr:Vr+","+sr)+(N?"h":"v")+Le).call(a.lineGroupStyle,ve.width,ze(ar),ve.dash)}),ye.selectAll("g."+Sr._id+"tick,path").remove();var ja=rt+Le+(Z||0)/2-(z.ticks==="outside"?1:0),ir=e.calcTicks(Sr),qt=e.getTickSigns(Sr)[2];return e.drawTicks(F,Sr,{vals:Sr.ticks==="inside"?e.clipEnds(Sr,ir):ir,layer:ye,path:e.makeTickPath(Sr,ja,qt),transFn:e.makeTransTickFn(Sr)}),e.drawLabels(F,Sr,{vals:ir,layer:ye,transFn:e.makeTransTickLabelFn(Sr),labelFns:e.makeLabelFns(Sr,ja)})}function _r(){var pr,hr=Le+Z/2;Ee.indexOf("inside")===-1&&(pr=a.bBox(ye.node()),hr+=N?pr.width:pr.height),Me=$e.select("text");var Fr=0,En=N&&Ce==="top",Zn=!N&&Ce==="right",qn=0;if(Me.node()&&!Me.classed(_.jsPlaceholder)){var ta,ra=$e.select(".h"+Sr._id+"title-math-group").node();ra&&(N&&Zr||!N&&!Zr)?(pr=a.bBox(ra),Fr=pr.width,ta=pr.height):(pr=a.bBox($e.node()),Fr=pr.right-ae.l-(N?rt:Mr),ta=pr.bottom-ae.t-(N?Mr:rt),!N&&Ce==="top"&&(hr+=pr.height,qn=pr.height)),Zn&&(Me.attr("transform",o(Fr/2+xe/2,0)),Fr*=2),hr=Math.max(hr,N?Fr:ta)}var Nn=(N?V:ee)*2+hr+re+Z/2,Ea=0;!N&&Ae.text&&ce==="bottom"&&K<=0&&(Ea=Nn/2,Nn+=Ea,qn+=Ea),H._hColorbarMoveTitle=Ea,H._hColorbarMoveCBTitle=qn;var ja=re+Z,ir=(N?rt:Mr)-ja/2-(N?V:0),qt=(N?Mr:rt)-(N?pe:ee+qn-Ea);L.select("."+_.cbbg).attr("x",ir).attr("y",qt).attr(N?"width":"height",Math.max(Nn-Ea,2)).attr(N?"height":"width",Math.max(pe+ja,2)).call(s.fill,fe).call(s.stroke,z.bordercolor).style("stroke-width",re);var ar=Zn?Math.max(Fr-10,0):0;L.selectAll("."+_.cboutline).attr("x",(N?rt:Mr+V)+ar).attr("y",(N?Mr+ee-pe:rt)+(En?Xe:0)).attr(N?"width":"height",Math.max(Le,2)).attr(N?"height":"width",Math.max(pe-(N?2*ee+Xe:2*V+ar),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var sr=N?Ft*Nn:0,Vr=N?0:(1-Nt)*Nn-qn;if(sr=te?ae.l-sr:-sr,Vr=ue?ae.t-Vr:-Vr,L.attr("transform",o(sr,Vr)),!N&&(re||b(fe).getAlpha()&&!b.equals(H.paper_bgcolor,fe))){var on=ye.selectAll("text"),pn=on[0].length,wn=L.select("."+_.cbbg).node(),Kn=a.bBox(wn),da=a.getTranslate(L),fa=2;on.each(function(jr,Ir){var Ur=0,sn=pn-1;if(Ir===Ur||Ir===sn){var Kr=a.bBox(this),Tt=a.getTranslate(this),or;if(Ir===sn){var Dr=Kr.right+Tt.x,ln=Kn.right+da.x+Mr-re-fa+ne;or=ln-Dr,or>0&&(or=0)}else if(Ir===Ur){var Pn=Kr.left+Tt.x,jn=Kn.left+da.x+Mr+re+fa;or=jn-Pn,or<0&&(or=0)}or&&(pn<3?this.setAttribute("transform","translate("+or+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var ga={},ka=A[le],Vn=M[le],hi=A[ce],Ti=M[ce],Dt=Nn-Le;N?(R==="pixels"?(ga.y=K,ga.t=pe*hi,ga.b=pe*Ti):(ga.t=ga.b=0,ga.yt=K+B*hi,ga.yb=K-B*Ti),j==="pixels"?(ga.x=ne,ga.l=Nn*ka,ga.r=Nn*Vn):(ga.l=Dt*ka,ga.r=Dt*Vn,ga.xl=ne-U*ka,ga.xr=ne+U*Vn)):(R==="pixels"?(ga.x=ne,ga.l=pe*ka,ga.r=pe*Vn):(ga.l=ga.r=0,ga.xl=ne+B*ka,ga.xr=ne-B*Vn),j==="pixels"?(ga.y=1-K,ga.t=Nn*hi,ga.b=Nn*Ti):(ga.t=Dt*hi,ga.b=Dt*Ti,ga.yt=K-U*hi,ga.yb=K+U*Ti));var yt=z.y<.5?"b":"t",Er=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var Nr={r:H.width-ir-sr,l:ir+ga.r,b:H.height-qt-Vr,t:qt+ga.b};te&&ue?S.autoMargin(F,z._id,ga):te?F._fullLayout._reservedMargin[z._id][yt]=Nr[yt]:ue||N?F._fullLayout._reservedMargin[z._id][Er]=Nr[Er]:F._fullLayout._reservedMargin[z._id][yt]=Nr[yt]}return r.syncOrAsync([S.previousPromises,Ct,Wt,Ot,S.previousPromises,_r],F)}function v(L,z,F){var N=z.orientation==="v",B=F._fullLayout,R=B._size,U,j,Z;t.init({element:L.node(),gd:F,prepFn:function(){U=L.attr("transform"),i(L)},moveFn:function(re,fe){L.attr("transform",U+o(re,fe)),j=t.align((N?z._uFrac:z._vFrac)+re/R.w,N?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((N?z._vFrac:1-z._uFrac)-fe/R.h,N?z._lenFrac:z._thickFrac,0,1,z.yanchor);var le=t.getCursor(j,Z,z.xanchor,z.yanchor);i(L,le)},doneFn:function(){if(i(L),j!==void 0&&Z!==void 0){var re={};re[z._propPrefix+"x"]=j,re[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,re,z._traceIndex):E.call("_guiRelayout",F,re)}}})}function y(L,z,F){var N=z._levels,B=[],R=[],U,j,Z=N.end+N.size/100,re=N.size,fe=1.001*F[0]-.001*F[1],le=1.001*F[1]-.001*F[0];for(j=0;j<1e5&&(U=N.start+j*re,!(re>0?U>=Z:U<=Z));j++)U>fe&&U0?U>=Z:U<=Z));j++)U>F[0]&&U-1}G.exports=function(o,n){var i,a=o.data,s=o.layout,f=E([],a),c=E({},s,e(n.tileClass)),p=o._context||{};if(n.width&&(c.width=n.width),n.height&&(c.height=n.height),n.tileClass==="thumbnail"||n.tileClass==="themes__thumb"){c.annotations=[];var d=Object.keys(c);for(i=0;i=0)return p}else if(typeof p=="string"&&(p=p.trim(),p.slice(-1)==="%"&&h(p.slice(0,-1))&&(p=+p.slice(0,-1),p>=0)))return p+"%"}function c(p,d,T,l,g,x){x=x||{};var A=x.moduleHasSelected!==!1,M=x.moduleHasUnselected!==!1,_=x.moduleHasConstrain!==!1,w=x.moduleHasCliponaxis!==!1,m=x.moduleHasTextangle!==!1,u=x.moduleHasInsideanchor!==!1,v=!!x.hasPathbar,y=Array.isArray(g)||g==="auto",I=y||g==="inside",L=y||g==="outside";if(I||L){var z=i(l,"textfont",T.font),F=b.extendFlat({},z),N=p.textfont&&p.textfont.color,B=!N;if(B&&delete F.color,i(l,"insidetextfont",F),v){var R=b.extendFlat({},z);B&&delete R.color,i(l,"pathbar.textfont",R)}L&&i(l,"outsidetextfont",z),A&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),m&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}I&&u&&l("insidetextanchor")}G.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:c,validateCornerradius:f}}}),x2=Ge({"src/traces/bar/layout_defaults.js"($,G){var h=Lo(),b=ws(),S=gn(),E=Ed(),e=kd().validateCornerradius;G.exports=function(t,r,o){function n(A,M){return S.coerce(t,r,E,A,M)}for(var i=!1,a=!1,s=!1,f={},c=n("barmode"),p=c==="group",d=0;d0&&!f[l]&&(s=!0),f[l]=!0),T.visible&&T.type==="histogram"){var g=b.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);g.type!=="category"&&(a=!0)}}if(!i){delete r.barmode;return}c!=="overlay"&&n("barnorm"),n("bargap",a&&!s?0:.2),n("bargroupgap");var x=n("barcornerradius");r.barcornerradius=e(x)}}}),qp=Ge({"src/traces/bar/arrays_to_calcdata.js"($,G){var h=gn();G.exports=function(S,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:S.dflt},$.coerceColor=function(S,E,e){return h(E).isValid()?E:e!==void 0?e:S.dflt},$.coerceEnumerated=function(S,E,e){return S.coerceNumber&&(E=+E),S.values.indexOf(E)!==-1?E:e!==void 0?e:S.dflt},$.getValue=function(S,E){var e;return b(S)?E1||v.bargap===0&&v.bargroupgap===0&&!y[0].trace.marker.line.width)&&h.select(this).attr("shape-rendering","crispEdges")}),m.selectAll("g.points").each(function(y){var I=h.select(this),L=y[0].trace;f(I,L,w)}),e.getComponentMethod("errorbars","style")(m)}function f(w,m,u){S.pointStyle(w.selectAll("path"),m,u),c(w,m,u)}function c(w,m,u){w.selectAll("text").each(function(v){var y=h.select(this),I=E.ensureUniformFontSize(u,l(y,v,m,u));S.font(y,I)})}function p(w,m,u){var v=m[0].trace;v.selectedpoints?d(u,v,w):(f(u,v,w),e.getComponentMethod("errorbars","style")(u))}function d(w,m,u){S.selectedPointStyle(w.selectAll("path"),m),T(w.selectAll("text"),m,u)}function T(w,m,u){w.each(function(v){var y=h.select(this),I;if(v.selected){I=E.ensureUniformFontSize(u,l(y,v,m,u));var L=m.selected.textfont&&m.selected.textfont.color;L&&(I.color=L),S.font(y,I)}else S.selectedTextStyle(y,m)})}function l(w,m,u,v){var y=v._fullLayout.font,I=u.textfont;if(w.classed("bartext-inside")){var L=_(m,u);I=x(u,m.i,y,L)}else w.classed("bartext-outside")&&(I=A(u,m.i,y));return I}function g(w,m,u){return M(o,w.textfont,m,u)}function x(w,m,u,v){var y=g(w,m,u),I=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[m]===void 0;return I&&(y={color:b.contrast(v),family:y.family,size:y.size,weight:y.weight,style:y.style,variant:y.variant,textcase:y.textcase,lineposition:y.lineposition,shadow:y.shadow}),M(n,w.insidetextfont,m,y)}function A(w,m,u){var v=g(w,m,u);return M(i,w.outsidetextfont,m,v)}function M(w,m,u,v){m=m||{};var y=a.getValue(m.family,u),I=a.getValue(m.size,u),L=a.getValue(m.color,u),z=a.getValue(m.weight,u),F=a.getValue(m.style,u),N=a.getValue(m.variant,u),B=a.getValue(m.textcase,u),R=a.getValue(m.lineposition,u),U=a.getValue(m.shadow,u);return{family:a.coerceString(w.family,y,v.family),size:a.coerceNumber(w.size,I,v.size),color:a.coerceColor(w.color,L,v.color),weight:a.coerceString(w.weight,z,v.weight),style:a.coerceString(w.style,F,v.style),variant:a.coerceString(w.variant,N,v.variant),textcase:a.coerceString(w.variant,B,v.textcase),lineposition:a.coerceString(w.variant,R,v.lineposition),shadow:a.coerceString(w.variant,U,v.shadow)}}function _(w,m){return m.type==="waterfall"?m[w.dir].marker.color:w.mcc||w.mc||m.marker.color}G.exports={style:s,styleTextPoints:c,styleOnSelect:p,getInsideTextFont:x,getOutsideTextFont:A,getBarColor:_,resizeText:t}}}),nu=Ge({"src/traces/bar/plot.js"($,G){var h=Mi(),b=Pi(),S=gn(),E=Ju(),e=_o(),t=Ss(),r=Lo(),o=ws().tickText,n=ic(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=pv(),f=hy(),c=ym(),p=Fh(),d=p.text,T=p.textposition,l=Vv().appendArrayPointValue,g=c.TEXTPAD;function x(re){return re.id}function A(re){if(re.ids)return x}function M(re){return(re>0)-(re<0)}function _(re,fe){return re0}function v(re,fe,le,ce,V,ee){var ne=fe.xaxis,K=fe.yaxis,ue=re._fullLayout,te=re._context.staticPlot;V||(V={mode:ue.barmode,norm:ue.barmode,gap:ue.bargap,groupgap:ue.bargroupgap},a("bar",ue));var H=S.makeTraceGroups(ce,le,"trace bars").each(function(ae){var ie=h.select(this),ve=ae[0].trace,Ae=ae[0].t,Ce=ve.type==="waterfall",Fe=ve.type==="funnel",ze=ve.type==="histogram",Ye=ve.type==="bar",it=Ye||Fe,st=0;Ce&&ve.connector.visible&&ve.connector.mode==="between"&&(st=ve.connector.line.width/2);var nt=ve.orientation==="h",Qe=u(V),Le=S.ensureSingle(ie,"g","points"),Te=A(ve),pe=Le.selectAll("g.point").data(S.identity,Te);pe.enter().append("g").classed("point",!0),pe.exit().remove(),pe.each(function(ot,ct){var rt=h.select(this),Ft=w(ot,ne,K,nt),Nt=Ft[0][0],$t=Ft[0][1],rr=Ft[1][0],Mr=Ft[1][1],Sr=(nt?$t-Nt:Mr-rr)===0;Sr&&it&&f.getLineWidth(ve,ot)&&(Sr=!1),Sr||(Sr=!b(Nt)||!b($t)||!b(rr)||!b(Mr)),ot.isBlank=Sr,Sr&&(nt?$t=Nt:Mr=rr),st&&!Sr&&(nt?(Nt-=_(Nt,$t)*st,$t+=_(Nt,$t)*st):(rr-=_(rr,Mr)*st,Mr+=_(rr,Mr)*st));var Zr,Ar;if(ve.type==="waterfall"){if(!Sr){var Br=ve[ot.dir].marker;Zr=Br.line.width,Ar=Br.color}}else Zr=f.getLineWidth(ve,ot),Ar=ot.mc||ve.marker.color;function Mt(ja){var ir=h.round(Zr/2%1,2);return V.gap===0&&V.groupgap===0?h.round(Math.round(ja)-ir,2):ja}function je(ja,ir,qt){return qt&&ja===ir?ja:Math.abs(ja-ir)>=2?Mt(ja):ja>ir?Math.ceil(ja):Math.floor(ja)}var $e=e.opacity(Ar),Ee=$e<1||Zr>.01?Mt:je;re._context.staticPlot||(Nt=Ee(Nt,$t,nt),$t=Ee($t,Nt,nt),rr=Ee(rr,Mr,!nt),Mr=Ee(Mr,rr,!nt));var xe=nt?ne.c2p:K.c2p,ye;ot.s0>0?ye=ot._sMax:ot.s0<0?ye=ot._sMin:ye=ot.s1>0?ot._sMax:ot._sMin;function Me(ja,ir){if(!ja)return 0;var qt=Math.abs(nt?Mr-rr:$t-Nt),ar=Math.abs(nt?$t-Nt:Mr-rr),sr=Ee(Math.abs(xe(ye,!0)-xe(0,!0))),Vr=ot.hasB?Math.min(qt/2,ar/2):Math.min(qt/2,sr),on;if(ir==="%"){var pn=Math.min(50,ja);on=qt*(pn/100)}else on=ja;return Ee(Math.max(Math.min(on,Vr),0))}var Xe=Ye||ze?Me(Ae.cornerradiusvalue,Ae.cornerradiusform):0,Je,Lt,Ct="M"+Nt+","+rr+"V"+Mr+"H"+$t+"V"+rr+"Z",Ot=0;if(Xe&&ot.s){var Wt=M(ot.s0)===0||M(ot.s)===M(ot.s0)?ot.s1:ot.s0;if(Ot=Ee(ot.hasB?0:Math.abs(xe(ye,!0)-xe(Wt,!0))),Ot0?Math.sqrt(Ot*(2*Xe-Ot)):0,Zn=_r>0?Math.max:Math.min;Je="M"+Nt+","+rr+"V"+(Mr-Fr*pr)+"H"+Zn($t-(Xe-Ot)*_r,Nt)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+$t+","+(Mr-Xe*pr-En)+"V"+(rr+Xe*pr+En)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+Zn($t-(Xe-Ot)*_r,Nt)+","+(rr+Fr*pr)+"Z"}else if(ot.hasB)Je="M"+(Nt+Xe*_r)+","+rr+"A "+Xe+","+Xe+" 0 0 "+hr+" "+Nt+","+(rr+Xe*pr)+"V"+(Mr-Xe*pr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+(Nt+Xe*_r)+","+Mr+"H"+($t-Xe*_r)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+$t+","+(Mr-Xe*pr)+"V"+(rr+Xe*pr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+($t-Xe*_r)+","+rr+"Z";else{Lt=Math.abs(Mr-rr)+Ot;var qn=Lt0?Math.sqrt(Ot*(2*Xe-Ot)):0,ra=pr>0?Math.max:Math.min;Je="M"+(Nt+qn*_r)+","+rr+"V"+ra(Mr-(Xe-Ot)*pr,rr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+(Nt+Xe*_r-ta)+","+Mr+"H"+($t-Xe*_r+ta)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+($t-qn*_r)+","+ra(Mr-(Xe-Ot)*pr,rr)+"V"+rr+"Z"}}else Je=Ct}else Je=Ct;var Nn=m(S.ensureSingle(rt,"path"),ue,V,ee);if(Nn.style("vector-effect",te?"none":"non-scaling-stroke").attr("d",isNaN(($t-Nt)*(Mr-rr))||Sr&&re._context.staticPlot?"M0,0Z":Je).call(t.setClipUrl,fe.layerClipId,re),!ue.uniformtext.mode&&Qe){var Ea=t.makePointStyleFns(ve);t.singlePointStyle(ot,Nn,ve,Ea,re)}y(re,fe,rt,ae,ct,Nt,$t,rr,Mr,Xe,Ot,V,ee),fe.layerClipId&&t.hideOutsideRangePoint(ot,rt.select("text"),ne,K,ve.xcalendar,ve.ycalendar)});var Ne=ve.cliponaxis===!1;t.setClipUrl(ie,Ne?null:fe.layerClipId,re)});r.getComponentMethod("errorbars","plot")(re,H,fe,V)}function y(re,fe,le,ce,V,ee,ne,K,ue,te,H,ae,ie){var ve=fe.xaxis,Ae=fe.yaxis,Ce=re._fullLayout,Fe;function ze(Lt,Ct,Ot){var Wt=S.ensureSingle(Lt,"text").text(Ct).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Ot).call(E.convertToTspans,re);return Wt}var Ye=ce[0].trace,it=Ye.orientation==="h",st=R(Ce,ce,V,ve,Ae);Fe=U(Ye,V);var nt=ae.mode==="stack"||ae.mode==="relative",Qe=ce[V],Le=!nt||Qe._outmost,Te=Qe.hasB,pe=te&&te-H>g;if(!st||Fe==="none"||(Qe.isBlank||ee===ne||K===ue)&&(Fe==="auto"||Fe==="inside")){le.select("text").remove();return}var Ne=Ce.font,ot=s.getBarColor(ce[V],Ye),ct=s.getInsideTextFont(Ye,V,Ne,ot),rt=s.getOutsideTextFont(Ye,V,Ne),Ft=Ye.insidetextanchor||"end",Nt=le.datum();it?ve.type==="log"&&Nt.s0<=0&&(ve.range[0]0&&Mt>0,Ee;pe?Te?Ee=I(Mr-2*te,Sr,Br,Mt,it)||I(Mr,Sr-2*te,Br,Mt,it):it?Ee=I(Mr-(te-H),Sr,Br,Mt,it)||I(Mr,Sr-2*(te-H),Br,Mt,it):Ee=I(Mr,Sr-(te-H),Br,Mt,it)||I(Mr-2*(te-H),Sr,Br,Mt,it):Ee=I(Mr,Sr,Br,Mt,it),$e&&Ee?Fe="inside":(Fe="outside",Zr.remove(),Zr=null)}else Fe="inside";if(!Zr){je=S.ensureUniformFontSize(re,Fe==="outside"?rt:ct),Zr=ze(le,st,je);var xe=Zr.attr("transform");if(Zr.attr("transform",""),Ar=t.bBox(Zr.node()),Br=Ar.width,Mt=Ar.height,Zr.attr("transform",xe),Br<=0||Mt<=0){Zr.remove();return}}var ye=Ye.textangle,Me,Xe;Fe==="outside"?(Xe=Ye.constraintext==="both"||Ye.constraintext==="outside",Me=B(ee,ne,K,ue,Ar,{isHorizontal:it,constrained:Xe,angle:ye})):(Xe=Ye.constraintext==="both"||Ye.constraintext==="inside",Me=F(ee,ne,K,ue,Ar,{isHorizontal:it,constrained:Xe,angle:ye,anchor:Ft,hasB:Te,r:te,overhead:H})),Me.fontSize=je.size,i(Ye.type==="histogram"?"bar":Ye.type,Me,Ce),Qe.transform=Me;var Je=m(Zr,Ce,ae,ie);S.setTransormAndDisplay(Je,Me)}function I(re,fe,le,ce,V){if(re<0||fe<0)return!1;var ee=le<=re&&ce<=fe,ne=le<=fe&&ce<=re,K=V?re>=le*(fe/ce):fe>=ce*(re/le);return ee||ne||K}function L(re){return re==="auto"?0:re}function z(re,fe){var le=Math.PI/180*fe,ce=Math.abs(Math.sin(le)),V=Math.abs(Math.cos(le));return{x:re.width*V+re.height*ce,y:re.width*ce+re.height*V}}function F(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,K=!!ee.constrained,ue=ee.angle||0,te=ee.anchor,H=te==="end",ae=te==="start",ie=ee.leftToRight||0,ve=(ie+1)/2,Ae=1-ve,Ce=ee.hasB,Fe=ee.r,ze=ee.overhead,Ye=V.width,it=V.height,st=Math.abs(fe-re),nt=Math.abs(ce-le),Qe=st>2*g&&nt>2*g?g:0;st-=2*Qe,nt-=2*Qe;var Le=L(ue);ue==="auto"&&!(Ye<=st&&it<=nt)&&(Ye>st||it>nt)&&(!(Ye>nt||it>st)||Yeg){var ot=N(re,fe,le,ce,Te,Fe,ze,ne,Ce);pe=ot.scale,Ne=ot.pad}else pe=1,K&&(pe=Math.min(1,st/Te.x,nt/Te.y)),Ne=0;var ct=V.left*Ae+V.right*ve,rt=(V.top+V.bottom)/2,Ft=(re+g)*Ae+(fe-g)*ve,Nt=(le+ce)/2,$t=0,rr=0;if(ae||H){var Mr=(ne?Te.x:Te.y)/2;Fe&&(H||Ce)&&(Qe+=Ne);var Sr=ne?_(re,fe):_(le,ce);ne?ae?(Ft=re+Sr*Qe,$t=-Sr*Mr):(Ft=fe-Sr*Qe,$t=Sr*Mr):ae?(Nt=le+Sr*Qe,rr=-Sr*Mr):(Nt=ce-Sr*Qe,rr=Sr*Mr)}return{textX:ct,textY:rt,targetX:Ft,targetY:Nt,anchorX:$t,anchorY:rr,scale:pe,rotate:Le}}function N(re,fe,le,ce,V,ee,ne,K,ue){var te=Math.max(0,Math.abs(fe-re)-2*g),H=Math.max(0,Math.abs(ce-le)-2*g),ae=ee-g,ie=ne?ae-Math.sqrt(ae*ae-(ae-ne)*(ae-ne)):ae,ve=ue?ae*2:K?ae-ne:2*ie,Ae=ue?ae*2:K?2*ie:ae-ne,Ce,Fe,ze,Ye,it;return V.y/V.x>=H/(te-ve)?Ye=H/V.y:V.y/V.x<=(H-Ae)/te?Ye=te/V.x:!ue&&K?(Ce=V.x*V.x+V.y*V.y/4,Fe=-2*V.x*(te-ae)-V.y*(H/2-ae),ze=(te-ae)*(te-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)):ue?(Ce=(V.x*V.x+V.y*V.y)/4,Fe=-V.x*(te/2-ae)-V.y*(H/2-ae),ze=(te/2-ae)*(te/2-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)):(Ce=V.x*V.x/4+V.y*V.y,Fe=-V.x*(te/2-ae)-2*V.y*(H-ae),ze=(te/2-ae)*(te/2-ae)+(H-ae)*(H-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)),Ye=Math.min(1,Ye),K?it=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(H-V.y*Ye)/2)*(ae-(H-V.y*Ye)/2)))-ne):it=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(te-V.x*Ye)/2)*(ae-(te-V.x*Ye)/2)))-ne),{scale:Ye,pad:it}}function B(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,K=!!ee.constrained,ue=ee.angle||0,te=V.width,H=V.height,ae=Math.abs(fe-re),ie=Math.abs(ce-le),ve;ne?ve=ie>2*g?g:0:ve=ae>2*g?g:0;var Ae=1;K&&(Ae=ne?Math.min(1,ie/H):Math.min(1,ae/te));var Ce=L(ue),Fe=z(V,Ce),ze=(ne?Fe.x:Fe.y)/2,Ye=(V.left+V.right)/2,it=(V.top+V.bottom)/2,st=(re+fe)/2,nt=(le+ce)/2,Qe=0,Le=0,Te=ne?_(fe,re):_(le,ce);return ne?(st=fe-Te*ve,Qe=Te*ze):(nt=ce+Te*ve,Le=-Te*ze),{textX:Ye,textY:it,targetX:st,targetY:nt,anchorX:Qe,anchorY:Le,scale:Ae,rotate:Ce}}function R(re,fe,le,ce,V){var ee=fe[0].trace,ne=ee.texttemplate,K;return ne?K=j(re,fe,le,ce,V):ee.textinfo?K=Z(fe,le,ce,V):K=f.getValue(ee.text,le),f.coerceString(d,K)}function U(re,fe){var le=f.getValue(re.textposition,fe);return f.coerceEnumerated(T,le)}function j(re,fe,le,ce,V){var ee=fe[0].trace,ne=S.castOption(ee,le,"texttemplate");if(!ne)return"";var K=ee.type==="histogram",ue=ee.type==="waterfall",te=ee.type==="funnel",H=ee.orientation==="h",ae,ie,ve,Ae;H?(ae="y",ie=V,ve="x",Ae=ce):(ae="x",ie=ce,ve="y",Ae=V);function Ce(Qe){return o(ie,ie.c2l(Qe),!0).text}function Fe(Qe){return o(Ae,Ae.c2l(Qe),!0).text}var ze=fe[le],Ye={};Ye.label=ze.p,Ye.labelLabel=Ye[ae+"Label"]=Ce(ze.p);var it=S.castOption(ee,ze.i,"text");(it===0||it)&&(Ye.text=it),Ye.value=ze.s,Ye.valueLabel=Ye[ve+"Label"]=Fe(ze.s);var st={};l(st,ee,ze.i),(K||st.x===void 0)&&(st.x=H?Ye.value:Ye.label),(K||st.y===void 0)&&(st.y=H?Ye.label:Ye.value),(K||st.xLabel===void 0)&&(st.xLabel=H?Ye.valueLabel:Ye.labelLabel),(K||st.yLabel===void 0)&&(st.yLabel=H?Ye.labelLabel:Ye.valueLabel),ue&&(Ye.delta=+ze.rawS||ze.s,Ye.deltaLabel=Fe(Ye.delta),Ye.final=ze.v,Ye.finalLabel=Fe(Ye.final),Ye.initial=Ye.final-Ye.delta,Ye.initialLabel=Fe(Ye.initial)),te&&(Ye.value=ze.s,Ye.valueLabel=Fe(Ye.value),Ye.percentInitial=ze.begR,Ye.percentInitialLabel=S.formatPercent(ze.begR),Ye.percentPrevious=ze.difR,Ye.percentPreviousLabel=S.formatPercent(ze.difR),Ye.percentTotal=ze.sumR,Ye.percenTotalLabel=S.formatPercent(ze.sumR));var nt=S.castOption(ee,ze.i,"customdata");return nt&&(Ye.customdata=nt),S.texttemplateString({data:[st,Ye,ee._meta],fallback:ee.texttemplatefallback,labels:Ye,locale:re._d3locale,template:ne})}function Z(re,fe,le,ce){var V=re[0].trace,ee=V.orientation==="h",ne=V.type==="waterfall",K=V.type==="funnel";function ue(nt){var Qe=ee?ce:le;return o(Qe,nt,!0).text}function te(nt){var Qe=ee?le:ce;return o(Qe,+nt,!0).text}var H=V.textinfo,ae=re[fe],ie=H.split("+"),ve=[],Ae,Ce=function(nt){return ie.indexOf(nt)!==-1};if(Ce("label")&&ve.push(ue(re[fe].p)),Ce("text")&&(Ae=S.castOption(V,ae.i,"text"),(Ae===0||Ae)&&ve.push(Ae)),ne){var Fe=+ae.rawS||ae.s,ze=ae.v,Ye=ze-Fe;Ce("initial")&&ve.push(te(Ye)),Ce("delta")&&ve.push(te(Fe)),Ce("final")&&ve.push(te(ze))}if(K){Ce("value")&&ve.push(te(ae.s));var it=0;Ce("percent initial")&&it++,Ce("percent previous")&&it++,Ce("percent total")&&it++;var st=it>1;Ce("percent initial")&&(Ae=S.formatPercent(ae.begR),st&&(Ae+=" of initial"),ve.push(Ae)),Ce("percent previous")&&(Ae=S.formatPercent(ae.difR),st&&(Ae+=" of previous"),ve.push(Ae)),Ce("percent total")&&(Ae=S.formatPercent(ae.sumR),st&&(Ae+=" of total"),ve.push(Ae))}return ve.join("
")}G.exports={plot:v,toMoveInsideBar:F}}}),Sc=Ge({"src/traces/bar/hover.js"($,G){var h=jf(),b=Lo(),S=_o(),E=gn().fillText,e=hy().getLineWidth,t=ws().hoverLabelText,r=zi().BADNUM;function o(a,s,f,c,p){var d=n(a,s,f,c,p);if(d){var T=d.cd,l=T[0].trace,g=T[d.index];return d.color=i(l,g),b.getComponentMethod("errorbars","hoverInfo")(g,l,d),[d]}}function n(a,s,f,c,p){var d=a.cd,T=d[0].trace,l=d[0].t,g=c==="closest",x=T.type==="waterfall",A=a.maxHoverDistance,M=a.maxSpikeDistance,_,w,m,u,v,y,I;T.orientation==="h"?(_=f,w=s,m="y",u="x",v=ce,y=re):(_=s,w=f,m="x",u="y",y=ce,v=re);var L=T[m+"period"],z=g||L;function F(Ae){return B(Ae,-1)}function N(Ae){return B(Ae,1)}function B(Ae,Ce){var Fe=Ae.w;return Ae[m]+Ce*Fe/2}function R(Ae){return Ae[m+"End"]-Ae[m+"Start"]}var U=g?F:L?function(Ae){return Ae.p-R(Ae)/2}:function(Ae){return Math.min(F(Ae),Ae.p-l.bardelta/2)},j=g?N:L?function(Ae){return Ae.p+R(Ae)/2}:function(Ae){return Math.max(N(Ae),Ae.p+l.bardelta/2)};function Z(Ae,Ce,Fe){return p.finiteRange&&(Fe=0),h.inbox(Ae-_,Ce-_,Fe+Math.min(1,Math.abs(Ce-Ae)/I)-1)}function re(Ae){return Z(U(Ae),j(Ae),A)}function fe(Ae){return Z(F(Ae),N(Ae),M)}function le(Ae){var Ce=Ae[u];if(x){var Fe=Math.abs(Ae.rawS)||0;w>0?Ce+=Fe:w<0&&(Ce-=Fe)}return Ce}function ce(Ae){var Ce=w,Fe=Ae.b,ze=le(Ae);return h.inbox(Fe-Ce,ze-Ce,A+(ze-Ce)/(ze-Fe)-1)}function V(Ae){var Ce=w,Fe=Ae.b,ze=le(Ae);return h.inbox(Fe-Ce,ze-Ce,M+(ze-Ce)/(ze-Fe)-1)}var ee=a[m+"a"],ne=a[u+"a"];I=Math.abs(ee.r2c(ee.range[1])-ee.r2c(ee.range[0]));function K(Ae){return(v(Ae)+y(Ae))/2}var ue=h.getDistanceFunction(c,v,y,K);if(h.getClosest(d,ue,a),a.index!==!1&&d[a.index].p!==r){z||(U=function(Ae){return Math.min(F(Ae),Ae.p-l.bargroupwidth/2)},j=function(Ae){return Math.max(N(Ae),Ae.p+l.bargroupwidth/2)});var te=a.index,H=d[te],ae=T.base?H.b+H.s:H.s;a[u+"0"]=a[u+"1"]=ne.c2p(H[u],!0),a[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(H.p)];a[m+"0"]=ee.c2p(g?U(H):ie[0],!0),a[m+"1"]=ee.c2p(g?j(H):ie[1],!0);var ve=H.orig_p!==void 0;return a[m+"LabelVal"]=ve?H.orig_p:H.p,a.labelLabel=t(ee,a[m+"LabelVal"],T[m+"hoverformat"]),a.valueLabel=t(ne,a[u+"LabelVal"],T[u+"hoverformat"]),a.baseLabel=t(ne,H.b,T[u+"hoverformat"]),a.spikeDistance=(V(H)+fe(H))/2,a[m+"Spike"]=ee.c2p(H.p,!0),E(H,T,a),a.hovertemplate=T.hovertemplate,a}}function i(a,s){var f=s.mcc||a.marker.color,c=s.mlcc||a.marker.line.color,p=e(a,s);if(S.opacity(f))return f;if(S.opacity(c)&&p)return c}G.exports={hoverPoints:o,hoverOnBars:n,getTraceColor:i}}}),rv=Ge({"src/traces/bar/event_data.js"($,G){G.exports=function(b,S,E){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),E.orientation==="h"?(b.label=b.y,b.value=b.x):(b.label=b.x,b.value=b.y),b}}}),_m=Ge({"src/traces/bar/select.js"($,G){G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=e[0].trace,n=o.type==="funnel",i=o.orientation==="h",a=[],s;if(E===!1)for(s=0;s0?(L="v",m>0?z=Math.min(v,u):z=Math.min(u)):m>0?(L="h",z=Math.min(v)):z=0;if(!z){f.visible=!1;return}f._length=z;var U=c("orientation",L);f._hasPreCompStats?U==="v"&&m===0?(c("x0",0),c("dx",1)):U==="h"&&w===0&&(c("y0",0),c("dy",1)):U==="v"&&m===0?c("x0"):U==="h"&&w===0&&c("y0");var j=b.getComponentMethod("calendars","handleTraceDefaults");j(s,f,["x","y"],p)}function i(s,f,c,p){var d=p.prefix,T=h.coerce2(s,f,r,"marker.outliercolor"),l=c("marker.line.outliercolor"),g="outliers";f._hasPreCompStats?g="all":(T||l)&&(g="suspectedoutliers");var x=c(d+"points",g);x?(c("jitter",x==="all"?.3:0),c("pointpos",x==="all"?-1.5:0),c("marker.symbol"),c("marker.opacity"),c("marker.size"),c("marker.angle"),c("marker.color",f.line.color),c("marker.line.color"),c("marker.line.width"),x==="suspectedoutliers"&&(c("marker.line.outliercolor",f.marker.color),c("marker.line.outlierwidth")),c("selected.marker.color"),c("unselected.marker.color"),c("selected.marker.size"),c("unselected.marker.size"),c("text"),c("hovertext")):delete f.marker;var A=c("hoveron");(A==="all"||A.indexOf("points")!==-1)&&(c("hovertemplate"),c("hovertemplatefallback")),h.coerceSelectionMarkerOpacity(f,c)}function a(s,f){var c,p;function d(x){return h.coerce(p._input,p,r,x)}for(var T=0;Tle.uf};if(M._hasPreCompStats){var te=M[z],H=function(Sr){return L.d2c((M[Sr]||[])[y])},ae=1/0,ie=-1/0;for(y=0;y=le.q1&&le.q3>=le.med){var Ae=H("lowerfence");le.lf=Ae!==e&&Ae<=le.q1?Ae:p(le,V,ee);var Ce=H("upperfence");le.uf=Ce!==e&&Ce>=le.q3?Ce:d(le,V,ee);var Fe=H("mean");le.mean=Fe!==e?Fe:ee?E.mean(V,ee):(le.q1+le.q3)/2;var ze=H("sd");le.sd=Fe!==e&&ze>=0?ze:ee?E.stdev(V,ee,le.mean):le.q3-le.q1,le.lo=T(le),le.uo=l(le);var Ye=H("notchspan");Ye=Ye!==e&&Ye>0?Ye:g(le,ee),le.ln=le.med-Ye,le.un=le.med+Ye;var it=le.lf,st=le.uf;M.boxpoints&&V.length&&(it=Math.min(it,V[0]),st=Math.max(st,V[ee-1])),M.notched&&(it=Math.min(it,le.ln),st=Math.max(st,le.un)),le.min=it,le.max=st}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+le.q1,"median = "+le.med,"q3 = "+le.q3].join(` +`));var nt;le.med!==e?nt=le.med:le.q1!==e?le.q3!==e?nt=(le.q1+le.q3)/2:nt=le.q1:le.q3!==e?nt=le.q3:nt=0,le.med=nt,le.q1=le.q3=nt,le.lf=le.uf=nt,le.mean=le.sd=nt,le.ln=le.un=nt,le.min=le.max=nt}ae=Math.min(ae,le.min),ie=Math.max(ie,le.max),le.pts2=ce.filter(ue),u.push(le)}}M._extremes[L._id]=b.findExtremes(L,[ae,ie],{padded:!0})}else{var Qe=L.makeCalcdata(M,z),Le=o(re,fe),Te=re.length,pe=n(Te);for(y=0;y=0&&Ne0){if(le={},le.pos=le[N]=re[y],ce=le.pts=pe[y].sort(f),V=le[z]=ce.map(c),ee=V.length,le.min=V[0],le.max=V[ee-1],le.mean=E.mean(V,ee),le.sd=E.stdev(V,ee,le.mean)*M.sdmultiple,le.med=E.interp(V,.5),ee%2&&(Ft||Nt)){var $t,rr;Ft?($t=V.slice(0,ee/2),rr=V.slice(ee/2+1)):Nt&&($t=V.slice(0,ee/2+1),rr=V.slice(ee/2)),le.q1=E.interp($t,.5),le.q3=E.interp(rr,.5)}else le.q1=E.interp(V,.25),le.q3=E.interp(V,.75);le.lf=p(le,V,ee),le.uf=d(le,V,ee),le.lo=T(le),le.uo=l(le);var Mr=g(le,ee);le.ln=le.med-Mr,le.un=le.med+Mr,ot=Math.min(ot,le.ln),ct=Math.max(ct,le.un),le.pts2=ce.filter(ue),u.push(le)}M.notched&&E.isTypedArray(Qe)&&(Qe=Array.from(Qe)),M._extremes[L._id]=b.findExtremes(L,M.notched?Qe.concat([ot,ct]):Qe,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[v],dPos:fe,posLetter:N,valLetter:z,labels:{med:t(A,"median:"),min:t(A,"min:"),q1:t(A,"q1:"),q3:t(A,"q3:"),max:t(A,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(A,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(A,"mean:"),lf:t(A,"lower fence:"),uf:t(A,"upper fence:")}},_[v]++,u):[{t:{empty:!0}}]};function r(x,A,M,_){var w=A in x,m=A+"0"in x,u="d"+A in x;if(w||m&&u){var v=M.makeCalcdata(x,A),y=S(x,M,A,v).vals;return[y,v]}var I;m?I=x[A+"0"]:"name"in x&&(M.type==="category"||h(x.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(x.name)&&M.type==="date")?I=x.name:I=_;for(var L=M.type==="multicategory"?M.r2c_just_indices(I):M.d2c(I,0,x[A+"calendar"]),z=x._length,F=new Array(z),N=0;N1,m=1-s[r+"gap"],u=1-s[r+"groupgap"];for(p=0;p0;if(L==="positive"?(le=z*(I?1:.5),ee=V,ce=ee=N):L==="negative"?(le=ee=N,ce=z*(I?1:.5),ne=V):(le=ce=z,ee=ne=V),ie){var ve=v.pointpos,Ae=v.jitter,Ce=v.marker.size/2,Fe=0;ve+Ae>=0&&(Fe=V*(ve+Ae),Fe>le?(ae=!0,te=Ce,K=Fe):Fe>ee&&(te=Ce,K=le)),Fe<=le&&(K=le);var ze=0;ve-Ae<=0&&(ze=-V*(ve-Ae),ze>ce?(ae=!0,H=Ce,ue=ze):ze>ne&&(H=Ce,ue=ce)),ze<=ce&&(ue=ce)}else K=le,ue=ce;var Ye=new Array(T.length);for(d=0;dM.lo&&(U.so=!0)}return w});A.enter().append("path").classed("point",!0),A.exit().remove(),A.call(S.translatePoints,c,p)}function n(i,a,s,f){var c=a.val,p=a.pos,d=!!p.rangebreaks,T=f.bPos,l=f.bPosPxOffset||0,g=s.boxmean||(s.meanline||{}).visible,x,A;Array.isArray(f.bdPos)?(x=f.bdPos[0],A=f.bdPos[1]):(x=f.bdPos,A=f.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?b.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=p.c2l(_.pos+T,!0),m=p.l2p(w-x)+l,u=p.l2p(w+A)+l,v=d?(m+u)/2:p.l2p(w)+l,y=c.c2p(_.mean,!0),I=c.c2p(_.mean-_.sd,!0),L=c.c2p(_.mean+_.sd,!0);s.orientation==="h"?h.select(this).attr("d","M"+y+","+m+"V"+u+(g==="sd"?"m0,0L"+I+","+v+"L"+y+","+m+"L"+L+","+v+"Z":"")):h.select(this).attr("d","M"+m+","+y+"H"+u+(g==="sd"?"m0,0L"+v+","+I+"L"+m+","+y+"L"+v+","+L+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:n}}}),Lx=Ge({"src/traces/box/style.js"($,G){var h=Mi(),b=_o(),S=Ss();function E(t,r,o){var n=o||h.select(t).selectAll("g.trace.boxes");n.style("opacity",function(i){return i[0].trace.opacity}),n.each(function(i){var a=h.select(this),s=i[0].trace,f=s.line.width;function c(T,l,g,x){T.style("stroke-width",l+"px").call(b.stroke,g).call(b.fill,x)}var p=a.selectAll("path.box");if(s.type==="candlestick")p.each(function(T){if(!T.empty){var l=h.select(this),g=s[T.dir];c(l,g.line.width,g.line.color,g.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{c(p,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(b.stroke,s.line.color);var d=a.selectAll("path.point");S.pointStyle(d,s,t)}})}function e(t,r,o){var n=r[0].trace,i=o.selectAll("path.point");n.selectedpoints?S.selectedPointStyle(i,n):S.pointStyle(i,n,t)}G.exports={style:E,styleOnSelect:e}}}),w2=Ge({"src/traces/box/hover.js"($,G){var h=ws(),b=gn(),S=jf(),E=_o(),e=b.fillText;function t(n,i,a,s){var f=n.cd,c=f[0].trace,p=c.hoveron,d=[],T;return p.indexOf("boxes")!==-1&&(d=d.concat(r(n,i,a,s))),p.indexOf("points")!==-1&&(T=o(n,i,a)),s==="closest"?T?[T]:d:(T&&d.push(T),d)}function r(n,i,a,s){var f=n.cd,c=n.xa,p=n.ya,d=f[0].trace,T=f[0].t,l=d.type==="violin",g,x,A,M,_,w,m,u,v,y,I,L=T.bdPos,z,F,N=T.wHover,B=function(ze){return A.c2l(ze.pos)+T.bPos-A.c2l(w)};l&&d.side!=="both"?(d.side==="positive"&&(v=function(ze){var Ye=B(ze);return S.inbox(Ye,Ye+N,y)},z=L,F=0),d.side==="negative"&&(v=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye,y)},z=0,F=L)):(v=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye+N,y)},z=F=L);var R;l?R=function(ze){return S.inbox(ze.span[0]-_,ze.span[1]-_,y)}:R=function(ze){return S.inbox(ze.min-_,ze.max-_,y)},d.orientation==="h"?(_=i,w=a,m=R,u=v,g="y",A=p,x="x",M=c):(_=a,w=i,m=v,u=R,g="x",A=c,x="y",M=p);var U=Math.min(1,L/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));y=n.maxHoverDistance-U,I=n.maxSpikeDistance-U;function j(ze){return(m(ze)+u(ze))/2}var Z=S.getDistanceFunction(s,m,u,j);if(S.getClosest(f,Z,n),n.index===!1)return[];var re=f[n.index],fe=d.line.color,le=(d.marker||{}).color;E.opacity(fe)&&d.line.width?n.color=fe:E.opacity(le)&&d.boxpoints?n.color=le:n.color=d.fillcolor,n[g+"0"]=A.c2p(re.pos+T.bPos-F,!0),n[g+"1"]=A.c2p(re.pos+T.bPos+z,!0),n[g+"LabelVal"]=re.orig_p!==void 0?re.orig_p:re.pos;var ce=g+"Spike";n.spikeDistance=j(re)*I/y,n[ce]=A.c2p(re.pos,!0);var V=d.boxmean||d.sizemode==="sd"||(d.meanline||{}).visible,ee=d.boxpoints||d.points,ne=ee&&V?["max","uf","q3","med","mean","q1","lf","min"]:ee&&!V?["max","uf","q3","med","q1","lf","min"]:!ee&&V?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],K=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[b];return E[b]=t,r}}else return E[b]=t,t;return 0},max:function(b,S,E,e){var t=e[S];if(h(t))if(t=Number(t),h(E[b])){if(E[b]m&&mE){var y=u===b?1:6,I=u===b?"M12":"M1";return function(L,z){var F=T.c2d(L,b,l),N=F.indexOf("-",y);N>0&&(F=F.slice(0,N));var B=T.d2c(F,0,l);if(Br?f>E?f>b*1.1?b:f>S*1.1?S:E:f>e?e:f>t?t:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,c,p,d,T,l){if(d&&f>E){var g=s(c,T,l),x=s(p,T,l),A=f===b?0:1;return g[A]!==x[A]}return Math.floor(p/f)-Math.floor(c/f)>.1}function s(f,c,p){var d=c.c2d(f,b,p).split("-");return d[0]===""&&(d.unshift(),d[0]="-"+d[0]),d}}}),zx=Ge({"src/traces/histogram/calc.js"($,G){var h=Pi(),b=gn(),S=Lo(),E=ws(),{hasColorscale:e}=hv(),t=dv(),r=qp(),o=Ix(),n=c0(),i=q1(),a=Dx();function s(T,l){var g=[],x=[],A=l.orientation==="h",M=E.getFromId(T,A?l.yaxis:l.xaxis),_=A?"y":"x",w={x:"y",y:"x"}[_],m=l[_+"calendar"],u=l.cumulative,v,y=f(T,l,M,_),I=y[0],L=y[1],z=typeof I.size=="string",F=[],N=z?F:I,B=[],R=[],U=[],j=0,Z=l.histnorm,re=l.histfunc,fe=Z.indexOf("density")!==-1,le,ce,V;u.enabled&&fe&&(Z=Z.replace(/ ?density$/,""),fe=!1);var ee=re==="max"||re==="min",ne=ee?null:0,K=o.count,ue=n[Z],te=!1,H=function(Ne){return M.r2c(Ne,0,m)},ae;for(b.isArrayOrTypedArray(l[w])&&re!=="count"&&(ae=l[w],te=re==="avg",K=o[re]),v=H(I.start),ce=H(I.end)+(v-E.tickIncrement(v,I.size,!1,m))/1e6;v=0&&V=Le;v--)if(x[v]){Te=v;break}for(v=Le;v<=Te;v++)if(h(g[v])&&h(x[v])){var pe={p:g[v],s:x[v],b:0};u.enabled||(pe.pts=U[v],Ce?pe.ph0=pe.ph1=U[v].length?L[U[v][0]]:g[v]:(l._computePh=!0,pe.ph0=st(F[v]),pe.ph1=st(F[v+1],!0))),Qe.push(pe)}return Qe.length===1&&(Qe[0].width1=E.tickIncrement(Qe[0].p,I.size,!1,m)-Qe[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(Qe,l),b.isArrayOrTypedArray(l.selectedpoints)&&b.tagSelected(Qe,l,Ye),Qe}function f(T,l,g,x,A){var M=x+"bins",_=T._fullLayout,w=l["_"+x+"bingroup"],m=_._histogramBinOpts[w],u=_.barmode==="overlay",v,y,I,L,z,F,N,B=function(it){return g.r2c(it,0,L)},R=function(it){return g.c2r(it,0,L)},U=g.type==="date"?function(it){return it||it===0?b.cleanDate(it,null,L):null}:function(it){return h(it)?Number(it):null};function j(it,st,nt){st[it+"Found"]?(st[it]=U(st[it]),st[it]===null&&(st[it]=nt[it])):(F[it]=st[it]=nt[it],b.nestedProperty(y[0],M+"."+it).set(nt[it]))}if(l["_"+x+"autoBinFinished"])delete l["_"+x+"autoBinFinished"];else{y=m.traces;var Z=[],re=!0,fe=!1,le=!1;for(v=0;v"u"){if(A)return[V,z,!0];V=c(T,l,g,x,M)}N=I.cumulative||{},N.enabled&&N.currentbin!=="include"&&(N.direction==="decreasing"?V.start=R(E.tickIncrement(B(V.start),V.size,!0,L)):V.end=R(E.tickIncrement(B(V.end),V.size,!1,L))),m.size=V.size,m.sizeFound||(F.size=V.size,b.nestedProperty(y[0],M+".size").set(V.size)),j("start",m,V),j("end",m,V)}z=l["_"+x+"pos0"],delete l["_"+x+"pos0"];var ne=l._input[M]||{},K=b.extendFlat({},m),ue=m.start,te=g.r2l(ne.start),H=te!==void 0;if((m.startFound||H)&&te!==g.r2l(ue)){var ae=H?te:b.aggNums(Math.min,null,z),ie={type:g.type==="category"||g.type==="multicategory"?"linear":g.type,r2l:g.r2l,dtick:m.size,tick0:ue,calendar:L,range:[ae,E.tickIncrement(ae,m.size,!1,L)].map(g.l2r)},ve=E.tickFirst(ie);ve>g.r2l(ae)&&(ve=E.tickIncrement(ve,m.size,!0,L)),K.start=g.l2r(ve),H||b.nestedProperty(l,M+".start").set(K.start)}var Ae=m.end,Ce=g.r2l(ne.end),Fe=Ce!==void 0;if((m.endFound||Fe)&&Ce!==g.r2l(Ae)){var ze=Fe?Ce:b.aggNums(Math.max,null,z);K.end=g.l2r(ze),Fe||b.nestedProperty(l,M+".start").set(K.end)}var Ye="autobin"+x;return l._input[Ye]===!1&&(l._input[M]=b.extendFlat({},l[M]||{}),delete l._input[Ye],delete l[Ye]),[K,z]}function c(T,l,g,x,A){var M=T._fullLayout,_=p(T,l),w=!1,m=1/0,u=[l],v,y,I;for(v=0;v<_.length;v++)if(y=_[v],y===l)w=!0;else if(!w)I=M._histogramBinOpts[y["_"+x+"bingroup"]],m=Math.min(m,I.size||y[A].size);else{var L=f(T,y,g,x,!0),z=L[0],F=L[2];y["_"+x+"autoBinFinished"]=1,y["_"+x+"pos0"]=L[1],F?u.push(y):m=Math.min(m,z.size)}var N=new Array(u.length);for(v=0;v=0;x--)w(x);else if(l==="increasing"){for(x=1;x=0;x--)T[x]+=T[x+1];g==="exclude"&&(T.push(0),T.shift())}}G.exports={calc:s,calcAllAutoBins:f}}}),x5=Ge({"src/traces/histogram2d/calc.js"($,G){var h=gn(),b=ws(),S=Ix(),E=c0(),e=q1(),t=Dx(),r=zx().calcAllAutoBins;G.exports=function(s,f){var c=b.getFromId(s,f.xaxis),p=b.getFromId(s,f.yaxis),d=f.xcalendar,T=f.ycalendar,l=function(je){return c.r2c(je,0,d)},g=function(je){return p.r2c(je,0,T)},x=function(je){return c.c2r(je,0,d)},A=function(je){return p.c2r(je,0,T)},M,_,w,m,u=r(s,f,c,"x"),v=u[0],y=u[1],I=r(s,f,p,"y"),L=I[0],z=I[1],F=f._length;y.length>F&&y.splice(F,y.length-F),z.length>F&&z.splice(F,z.length-F);var N=[],B=[],R=[],U=typeof v.size=="string",j=typeof L.size=="string",Z=[],re=[],fe=U?Z:v,le=j?re:L,ce=0,V=[],ee=[],ne=f.histnorm,K=f.histfunc,ue=ne.indexOf("density")!==-1,te=K==="max"||K==="min",H=te?null:0,ae=S.count,ie=E[ne],ve=!1,Ae=[],Ce=[],Fe="z"in f?f.z:"marker"in f&&Array.isArray(f.marker.color)?f.marker.color:"";Fe&&K!=="count"&&(ve=K==="avg",ae=S[K]);var ze=v.size,Ye=l(v.start),it=l(v.end)+(Ye-b.tickIncrement(Ye,ze,!1,d))/1e6;for(M=Ye;M=0&&w=0&&mb;i++)n=e(r,o,E(n));return n>b&&h.log("interp2d didn't converge quickly",n),r};function e(t,r,o){var n=0,i,a,s,f,c,p,d,T,l,g,x,A,M;for(f=0;fA&&(n=Math.max(n,Math.abs(t[a][s]-x)/(M-A))))}return n}}}),Nx=Ge({"src/traces/heatmap/find_empties.js"($,G){var h=gn().maxRowLength;G.exports=function(S){var E=[],e={},t=[],r=S[0],o=[],n=[0,0,0],i=h(S),a,s,f,c,p,d,T,l;for(s=0;s=0;p--)c=t[p],s=c[0],f=c[1],d=((e[[s-1,f]]||n)[2]+(e[[s+1,f]]||n)[2]+(e[[s,f-1]]||n)[2]+(e[[s,f+1]]||n)[2])/20,d&&(T[c]=[s,f,d],t.splice(p,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(c in T)e[c]=T[c],E.push(T[c])}return E.sort(function(g,x){return x[2]-g[2]})}}}),S2=Ge({"src/traces/heatmap/make_bound_array.js"($,G){var h=Lo(),b=gn().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,n){var i=[],a=h.traceIs(E,"contour"),s=h.traceIs(E,"histogram"),f,c,p,d=b(e)&&e.length>1;if(d&&!s&&n.type!=="category"){var T=e.length;if(T<=o){if(a)i=Array.from(e).slice(0,o);else if(o===1)n.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(n.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],p=1;p1){var ne=(ee[ee.length-1]-ee[0])/(ee.length-1),K=Math.abs(ne/100);for(F=0;FK)return!1}return!0}T._islinear=!1,l.type==="log"||g.type==="log"?M==="fast"&&R("log axis found"):U(_)?U(v)?T._islinear=!0:M==="fast"&&R("y scale is not linear"):M==="fast"&&R("x scale is not linear");var j=b.maxRowLength(z),Z=T.xtype==="scaled"?"":_,re=a(T,Z,w,m,j,l),fe=T.ytype==="scaled"?"":v,le=a(T,fe,y,I,z.length,g);T._extremes[l._id]=S.findExtremes(l,re),T._extremes[g._id]=S.findExtremes(g,le);var ce={x:re,y:le,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(ce.orig_x=u),T.yperiodalignment&&L&&(ce.orig_y=L),Z&&Z.length===re.length-1&&(ce.xCenter=Z),fe&&fe.length===le.length-1&&(ce.yCenter=fe),A&&(ce.xRanges=N.xRanges,ce.yRanges=N.yRanges,ce.pts=N.pts),x||t(d,T,{vals:z,cLetter:"z"}),x&&T.contours&&T.contours.coloring==="heatmap"){var V={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};ce.xfill=a(V,Z,w,m,j,l),ce.yfill=a(V,fe,y,I,z.length,g)}return[ce]};function f(p){for(var d=[],T=p.length,l=0;l0;)ue=v.c2p(U[ie]),ie--;for(ue0;)ae=y.c2p(j[ie]),ie--;ae=v._length||ue<=0||H>=y._length||ae<=0;if(it){var st=L.selectAll("image").data([]);st.exit().remove(),g(L);return}var nt,Qe;Ce==="fast"?(nt=V,Qe=ce):(nt=ze,Qe=Ye);var Le=document.createElement("canvas");Le.width=nt,Le.height=Qe;var Te=Le.getContext("2d",{willReadFrequently:!0}),pe=a(F,{noNumericCheck:!0,returnArray:!0}),Ne,ot;Ce==="fast"?(Ne=ee?function(Rn){return V-1-Rn}:t.identity,ot=ne?function(Rn){return ce-1-Rn}:t.identity):(Ne=function(Rn){return t.constrain(Math.round(v.c2p(U[Rn])-K),0,ze)},ot=function(Rn){return t.constrain(Math.round(y.c2p(j[Rn])-H),0,Ye)});var ct=ot(0),rt=[ct,ct],Ft=ee?0:1,Nt=ne?0:1,$t=0,rr=0,Mr=0,Sr=0,Zr,Ar,Br,Mt,je;function $e(Rn,di){if(Rn!==void 0){var Ma=pe(Rn);return Ma[0]=Math.round(Ma[0]),Ma[1]=Math.round(Ma[1]),Ma[2]=Math.round(Ma[2]),$t+=di,rr+=Ma[0]*di,Mr+=Ma[1]*di,Sr+=Ma[2]*di,Ma}return[0,0,0,0]}function Ee(Rn,di,Ma,Ei){var Hi=Rn[Ma.bin0];if(Hi===void 0)return $e(void 0,1);var io=Rn[Ma.bin1],no=di[Ma.bin0],bo=di[Ma.bin1],li=io-Hi||0,ts=no-Hi||0,Ho;return io===void 0?bo===void 0?Ho=0:no===void 0?Ho=2*(bo-Hi):Ho=(2*bo-no-Hi)*2/3:bo===void 0?no===void 0?Ho=0:Ho=(2*Hi-io-no)*2/3:no===void 0?Ho=(2*bo-io-Hi)*2/3:Ho=bo+Hi-io-no,$e(Hi+Ma.frac*li+Ei.frac*(ts+Ma.frac*Ho))}if(Ce!=="default"){var xe=0,ye;try{ye=new Uint8Array(nt*Qe*4)}catch{ye=new Array(nt*Qe*4)}if(Ce==="smooth"){var Me=Z||U,Xe=re||j,Je=new Array(Me.length),Lt=new Array(Xe.length),Ct=new Array(ze),Ot=Z?A:x,Wt=re?A:x,_r,pr,hr;for(ie=0;ieda||da>y._length))for(ve=on;vega||ga>v._length)){var ka=o({x:fa,y:Kn},F,_._fullLayout);ka.x=fa,ka.y=Kn;var Vn=z.z[ie][ve];Vn===void 0?(ka.z="",ka.zLabel=""):(ka.z=Vn,ka.zLabel=e.tickText(ir,Vn,"hover").text);var hi=z.text&&z.text[ie]&&z.text[ie][ve];(hi===void 0||hi===!1)&&(hi=""),ka.text=hi;var Ti=t.texttemplateString({data:[ka,F._meta],fallback:F.texttemplatefallback,labels:ka,locale:_._fullLayout._d3locale,template:Ea});if(Ti){var Dt=Ti.split("
"),yt=Dt.length,Er=0;for(Ae=0;Ae=g[0].length||I<0||I>g.length)return}else{if(h.inbox(o-T[0],o-T[T.length-1],0)>0||h.inbox(n-l[0],n-l[l.length-1],0)>0)return;if(s){var L;for(w=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),G1=Ge({"src/traces/contour/attributes.js"($,G){var h=mv(),b=Uc(),S=fc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=Pu(),r=fv().dash,o=Hs(),n=Qi().extendFlat,i=Wx(),a=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,f=b.line;G.exports=n({z:h.z,x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:b.xperiod0,yperiod0:b.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,text:h.text,hovertext:h.hovertext,transpose:h.transpose,xtype:h.xtype,ytype:h.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:n({},h.texttemplate,{}),texttemplatefallback:h.texttemplatefallback,textfont:n({},h.textfont,{}),hoverongaps:h.hoverongaps,connectgaps:n({},h.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(a).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},f.smoothing,{}),editType:"plot"},zorder:b.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Kx=Ge({"src/traces/histogram2dcontour/attributes.js"($,G){var h=Yx(),b=G1(),S=Pu(),E=fc().axisHoverFormat,e=Qi().extendFlat;G.exports=e({x:h.x,y:h.y,z:h.z,marker:h.marker,histnorm:h.histnorm,histfunc:h.histfunc,nbinsx:h.nbinsx,xbins:h.xbins,nbinsy:h.nbinsy,ybins:h.ybins,autobinx:h.autobinx,autobiny:h.autobiny,bingroup:h.bingroup,xbingroup:h.xbingroup,ybingroup:h.ybingroup,autocontour:b.autocontour,ncontours:b.ncontours,contours:b.contours,line:{color:b.line.color,width:e({},b.line.width,{dflt:.5}),dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:b.texttemplate,texttemplatefallback:b.texttemplatefallback,textfont:b.textfont},S("",{cLetter:"z",editTypeOverride:"calc"}))}}),$x=Ge({"src/traces/contour/contours_defaults.js"($,G){G.exports=function(b,S,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,n=E("contours.size"),i;o?i=S.autocontour=!0:i=E("autocontour",!1),(i||!n)&&E("ncontours")}}}),k2=Ge({"src/traces/contour/label_defaults.js"($,G){var h=gn();G.exports=function(S,E,e,t){t||(t={});var r=S("contours.showlabels");if(r){var o=E.font;h.coerceFont(S,"contours.labelfont",o,{overrideDflt:{color:e}}),S("contours.labelformat")}t.hasHover!==!1&&S("zhoverformat")}}}),X1=Ge({"src/traces/contour/style_defaults.js"($,G){var h=vh(),b=k2();G.exports=function(E,e,t,r,o){var n=t("contours.coloring"),i,a="";n==="fill"&&(i=t("contours.showlines")),i!==!1&&(n!=="lines"&&(a=t("line.color","#000")),t("line.width",.5),t("line.dash")),n!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,h(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),b(t,r,a,o)}}}),k5=Ge({"src/traces/histogram2dcontour/defaults.js"($,G){var h=gn(),b=Zx(),S=$x(),E=X1(),e=mg(),t=Kx();G.exports=function(o,n,i,a){function s(c,p){return h.coerce(o,n,t,c,p)}function f(c){return h.coerce2(o,n,t,c)}b(o,n,s,a),n.visible!==!1&&(S(o,n,s,f),E(o,n,s,a),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),n.contours&&n.contours.coloring==="heatmap"&&e(s,a))}}}),C2=Ge({"src/traces/contour/set_contours.js"($,G){var h=ws(),b=gn();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,n=e.zmax;(e.zauto||o===void 0)&&(o=b.aggNums(Math.min,null,t)),(e.zauto||n===void 0)&&(n=b.aggNums(Math.max,null,t));var i=S(o,n,e.ncontours);r.size=i.dtick,r.start=h.tickFirst(i),i.range.reverse(),r.end=h.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===n&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),b.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var a=r.start,s=r.end,f=e._input.contours;if(a>s&&(r.start=f.start=s,s=r.end=f.end=a,a=r.start),!(r.size>0)){var c;a===s?c=1:c=S(a,s,e.ncontours).dtick,f.size=r.size=c}}};function S(E,e,t){var r={type:"linear",range:[E,e]};return h.autoTicks(r,(e-E)/(t||15)),r}}}),Jx=Ge({"src/traces/contour/end_plus.js"($,G){G.exports=function(b){return b.end+b.size/1e6}}}),Qx=Ge({"src/traces/contour/calc.js"($,G){var h=Tc(),b=V1(),S=C2(),E=Jx();G.exports=function(t,r){var o=b(t,r),n=o[0].z;S(r,n);var i=r.contours,a=h.extractOpts(r),s;if(i.coloring==="heatmap"&&a.auto&&r.autocontour===!1){var f=i.start,c=E(i),p=i.size||1,d=Math.floor((c-f)/p)+1;isFinite(p)||(p=1,d=1);var T=f-p/2,l=T+d*p;s=[T,l]}else s=n;return h.calc(t,r,{vals:s,cLetter:"z"}),o}}}),Y1=Ge({"src/traces/contour/constants.js"($,G){G.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}}}}),L2=Ge({"src/traces/contour/make_crossings.js"($,G){var h=Y1();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,n,i,a,s,f,c,p,d,T;for(i=0;iS?0:1)+(E[0][1]>S?0:2)+(E[1][1]>S?0:4)+(E[1][0]>S?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return S>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),eb=Ge({"src/traces/contour/find_all_paths.js"($,G){var h=gn(),b=Y1();G.exports=function(n,i,a){var s,f,c,p,d;for(i=i||.01,a=a||.01,c=0;c20?(c=b.CHOOSESADDLE[c][(p[0]||p[1])<0?0:1],o.crossings[f]=b.SADDLEREMAINDER[c]):delete o.crossings[f],p=b.NEWDELTA[c],!p){h.log("Found bad marching index:",c,n,o.level);break}d.push(r(o,n,p)),n[0]+=p[0],n[1]+=p[1],f=n.join(","),S(d[d.length-1],d[d.length-2],a,s)&&d.pop();var M=p[0]&&(n[0]<0||n[0]>l-2)||p[1]&&(n[1]<0||n[1]>T-2),_=n[0]===g[0]&&n[1]===g[1]&&p[0]===x[0]&&p[1]===x[1];if(_||i&&M)break;c=o.crossings[f]}A===1e4&&h.log("Infinite loop in contour?");var w=S(d[0],d[d.length-1],a,s),m=0,u=.2*o.smoothing,v=[],y=0,I,L,z,F,N,B,R,U,j,Z,re;for(A=1;A=y;A--)if(I=v[A],I=y&&I+v[L]U&&j--,o.edgepaths[j]=re.concat(d,Z));break}V||(o.edgepaths[U]=d.concat(Z))}for(U=0;U20&&n?o===208||o===1114?a=i[0]===0?1:-1:s=i[1]===0?1:-1:b.BOTTOMSTART.indexOf(o)!==-1?s=1:b.LEFTSTART.indexOf(o)!==-1?a=1:b.TOPSTART.indexOf(o)!==-1?s=-1:a=-1,[a,s]}function r(o,n,i){var a=n[0]+Math.max(i[0],0),s=n[1]+Math.max(i[1],0),f=o.z[s][a],c=o.xaxis,p=o.yaxis;if(i[1]){var d=(o.level-f)/(o.z[s][a+1]-f),T=(d!==1?(1-d)*c.c2l(o.x[a]):0)+(d!==0?d*c.c2l(o.x[a+1]):0);return[c.c2p(c.l2c(T),!0),p.c2p(o.y[s],!0),a+d,s]}else{var l=(o.level-f)/(o.z[s+1][a]-f),g=(l!==1?(1-l)*p.c2l(o.y[s]):0)+(l!==0?l*p.c2l(o.y[s+1]):0);return[c.c2p(o.x[a],!0),p.c2p(p.l2c(g),!0),a,s+l]}}}}),C5=Ge({"src/traces/contour/constraint_mapping.js"($,G){var h=Wx(),b=Pi();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function S(t,r){var o=Array.isArray(r),n;function i(a){return b(a)?+a:null}return h.COMPARISON_OPS2.indexOf(t)!==-1?n=i(o?r[0]:r):h.INTERVAL_OPS.indexOf(t)!==-1?n=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:h.SET_OPS.indexOf(t)!==-1&&(n=o?r.map(i):[i(r)]),n}function E(t){return function(r){r=S(t,r);var o=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:o,end:n,size:n-o}}}function e(t){return function(r){return r=S(t,r),{start:r,end:1/0,size:1/0}}}}}),P2=Ge({"src/traces/contour/empty_pathinfo.js"($,G){var h=gn(),b=C5(),S=Jx();G.exports=function(e,t,r){for(var o=e.type==="constraint"?b[e._operation](e.value):e,n=o.size,i=[],a=S(o),s=r.trace._carpetTrace,f=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},c=o.start;c1e3){h.warn("Too many contours, clipping at 1000",e);break}return i}}}),L5=Ge({"src/traces/contour/convert_to_constraints.js"($,G){var h=gn();G.exports=function(S,E){var e,t,r,o=function(a){return a.reverse()},n=function(a){return a};switch(E){case"=":case"<":return S;case">":for(S.length!==1&&h.warn("Contour data invalid for the specified inequality operation."),t=S[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(S.prefixBoundary=!1,S.edgepaths.length)return;var o=S.x.length,n=S.y.length,i=-1/0,a=1/0;for(e=0;e":s>i&&(S.prefixBoundary=!0);break;case"<":(si||S.starts.length&&c===a)&&(S.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),c=Math.max(s[0],s[1]),fi&&(S.prefixBoundary=!0);break}break}}}}),tb=Ge({"src/traces/contour/plot.js"($){var G=Mi(),h=gn(),b=Ss(),S=Tc(),E=Ju(),e=ws(),t=Kd(),r=jx(),o=L2(),n=eb(),i=P2(),a=L5(),s=P5(),f=Y1(),c=f.LABELOPTIMIZER;$.plot=function(_,w,m,u){var v=w.xaxis,y=w.yaxis;h.makeTraceGroups(u,m,"contour").each(function(I){var L=G.select(this),z=I[0],F=z.trace,N=z.x,B=z.y,R=F.contours,U=i(R,w,z),j=h.ensureSingle(L,"g","heatmapcoloring"),Z=[];R.coloring==="heatmap"&&(Z=[I]),r(_,w,Z,j),o(U),n(U);var re=v.c2p(N[0],!0),fe=v.c2p(N[N.length-1],!0),le=y.c2p(B[0],!0),ce=y.c2p(B[B.length-1],!0),V=[[re,ce],[fe,ce],[fe,le],[re,le]],ee=U;R.type==="constraint"&&(ee=a(U,R._operation)),p(L,V,R),d(L,ee,V,R),l(L,U,_,z,R),x(L,w,_,z,V)})};function p(M,_,w){var m=h.ensureSingle(M,"g","contourbg"),u=m.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function d(M,_,w,m){var u=m.coloring==="fill"||m.type==="constraint"&&m._operation!=="=",v="M"+w.join("L")+"Z";u&&s(_,m);var y=h.ensureSingle(M,"g","contourfill"),I=y.selectAll("path").data(u?_:[]);I.enter().append("path"),I.exit().remove(),I.each(function(L){var z=(L.prefixBoundary?v:"")+T(L,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",m=0,u=M.edgepaths.map(function(re,fe){return fe}),v=!0,y,I,L,z,F,N;function B(re){return Math.abs(re[1]-_[0][1])<.01}function R(re){return Math.abs(re[1]-_[2][1])<.01}function U(re){return Math.abs(re[0]-_[0][0])<.01}function j(re){return Math.abs(re[0]-_[2][0])<.01}for(;u.length;){for(N=b.smoothopen(M.edgepaths[m],M.smoothing),w+=v?N:N.replace(/^M/,"L"),u.splice(u.indexOf(m),1),y=M.edgepaths[m][M.edgepaths[m].length-1],z=-1,L=0;L<4;L++){if(!y){h.log("Missing end?",m,M);break}for(B(y)&&!j(y)?I=_[1]:U(y)?I=_[0]:R(y)?I=_[3]:j(y)&&(I=_[2]),F=0;F=0&&(I=Z,z=F):Math.abs(y[1]-I[1])<.01?Math.abs(y[1]-Z[1])<.01&&(Z[0]-y[0])*(I[0]-Z[0])>=0&&(I=Z,z=F):h.log("endpt to newendpt is not vert. or horz.",y,I,Z)}if(y=I,z>=0)break;w+="L"+I}if(z===M.edgepaths.length){h.log("unclosed perimeter path");break}m=z,v=u.indexOf(m)===-1,v&&(m=u[0],w+="Z")}for(m=0;mc.MAXCOST*2)break;B&&(I/=2),y=z-I/2,L=y+I*1.5}if(N<=c.MAXCOST)return F};function g(M,_,w,m){var u=_.width/2,v=_.height/2,y=M.x,I=M.y,L=M.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,N=(y>m.center?m.right-y:y-m.left)/(z+Math.abs(Math.sin(L)*v)),B=(I>m.middle?m.bottom-I:I-m.top)/(Math.abs(F)+Math.cos(L)*v);if(N<1||B<1)return 1/0;var R=c.EDGECOST*(1/(N-1)+1/(B-1));R+=c.ANGLECOST*L*L;for(var U=y-z,j=I-F,Z=y+z,re=I+F,fe=0;fe=x)&&(r<=g&&(r=g),o>=x&&(o=x),i=Math.floor((o-r)/n)+1,a=0),l=0;lg&&(p.unshift(g),d.unshift(d[0])),p[p.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(f=parseFloat(s.value[0]),s.value=[f,f+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:h(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(a("contours.value",0),h(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),D2=Ge({"src/traces/contour/defaults.js"($,G){var h=gn(),b=mh(),S=Fp(),E=I2(),e=$x(),t=X1(),r=mg(),o=G1();G.exports=function(i,a,s,f){function c(l,g){return h.coerce(i,a,o,l,g)}function p(l){return h.coerce2(i,a,o,l)}var d=b(i,a,c,f);if(!d){a.visible=!1;return}S(i,a,f,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate"),c("hovertemplatefallback");var T=c("contours.type")==="constraint";c("connectgaps",h.isArray1D(a.z)),T?E(i,a,c,f,s):(e(i,a,c,p),t(i,a,c,f)),a.contours&&a.contours.coloring==="heatmap"&&r(c,f),c("zorder")}}}),I5=Ge({"src/traces/contour/index.js"($,G){G.exports={attributes:G1(),supplyDefaults:D2(),calc:Qx(),plot:tb().plot,style:Z1(),colorbar:gy(),hoverPoints:R2(),moduleType:"trace",name:"contour",basePlotModule:dh(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),z2=Ge({"lib/contour.js"($,G){G.exports=I5()}}),rb=Ge({"src/traces/scatterternary/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Al(),E=nd(),e=Uc(),t=ru(),r=Pu(),o=fv().dash,n=Qi().extendFlat,i=e.marker,a=e.line,s=i.line;G.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:n({},e.mode,{dflt:"markers"}),text:n({},e.text,{}),texttemplate:b({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:n({},e.hovertext,{}),line:{color:a.color,width:a.width,dash:o,backoff:a.backoff,shape:n({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:e.connectgaps,cliponaxis:e.cliponaxis,fill:n({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:n({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:i.angleref,standoff:i.standoff,maxdisplayed:i.maxdisplayed,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:n({width:s.width,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:e.textfont,textposition:e.textposition,selected:e.selected,unselected:e.unselected,hoverinfo:n({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:e.hoveron,hovertemplate:h(),hovertemplatefallback:S()}}}),D5=Ge({"src/traces/scatterternary/defaults.js"($,G){var h=gn(),b=o0(),S=iu(),E=Hv(),e=Bp(),t=Gv(),r=ep(),o=Iv(),n=rb();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}var d=p("a"),T=p("b"),l=p("c"),g;if(d?(g=d.length,T?(g=Math.min(g,T.length),l&&(g=Math.min(g,l.length))):l?g=Math.min(g,l.length):g=0):T&&l&&(g=Math.min(T.length,l.length)),!g){s.visible=!1;return}s._length=g,p("sum"),p("text"),p("hovertext"),s.hoveron!=="fills"&&(p("hovertemplate"),p("hovertemplatefallback"));var x=g"),o.hovertemplate=c.hovertemplate,r}}}),B5=Ge({"src/traces/scatterternary/event_data.js"($,G){G.exports=function(b,S,E,e,t){if(S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),e[t]){var r=e[t];b.a=r.a,b.b=r.b,b.c=r.c}else b.a=S.a,b.b=S.b,b.c=S.c;return b}}}),nb=Ge({"src/plots/ternary/ternary.js"($,G){var h=Mi(),b=Bs(),S=Lo(),E=gn(),e=E.strTranslate,t=E._,r=_o(),o=Ss(),n=Kd(),i=Qi().extendFlat,a=Wc(),s=ws(),f=rd(),c=jf(),p=zp(),d=p.freeMode,T=p.rectMode,l=im(),g=Yf().prepSelect,x=Yf().selectOnClick,A=Yf().clearOutline,M=Yf().clearSelectionsCache,_=rh();function w(R,U){this.id=R.id,this.graphDiv=R.graphDiv,this.init(U),this.makeFramework(U),this.updateFx(U),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var m=w.prototype;m.init=function(R){this.container=R._ternarylayer,this.defs=R._defs,this.layoutId=R._uid,this.traceHash={},this.layers={}},m.plot=function(R,U){var j=this,Z=U[j.id],re=U._size;j._hasClipOnAxisFalse=!1;for(var fe=0;feu*ee?(ve=ee,ie=ve*u):(ie=V,ve=ie/u),Ae=le*ie/V,Ce=ce*ve/ee,H=U.l+U.w*re-ie/2,ae=U.t+U.h*(1-fe)-ve/2,j.x0=H,j.y0=ae,j.w=ie,j.h=ve,j.sum=ne,j.xaxis={type:"linear",range:[K+2*te-ne,ne-K-2*ue],domain:[re-Ae/2,re+Ae/2],_id:"x"},n(j.xaxis,j.graphDiv._fullLayout),j.xaxis.setScale(),j.xaxis.isPtWithinRange=function(Ne){return Ne.a>=j.aaxis.range[0]&&Ne.a<=j.aaxis.range[1]&&Ne.b>=j.baxis.range[1]&&Ne.b<=j.baxis.range[0]&&Ne.c>=j.caxis.range[1]&&Ne.c<=j.caxis.range[0]},j.yaxis={type:"linear",range:[K,ne-ue-te],domain:[fe-Ce/2,fe+Ce/2],_id:"y"},n(j.yaxis,j.graphDiv._fullLayout),j.yaxis.setScale(),j.yaxis.isPtWithinRange=function(){return!0};var Fe=j.yaxis.domain[0],ze=j.aaxis=i({},R.aaxis,{range:[K,ne-ue-te],side:"left",tickangle:(+R.aaxis.tickangle||0)-30,domain:[Fe,Fe+Ce*u],anchor:"free",position:0,_id:"y",_length:ie});n(ze,j.graphDiv._fullLayout),ze.setScale();var Ye=j.baxis=i({},R.baxis,{range:[ne-K-te,ue],side:"bottom",domain:j.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});n(Ye,j.graphDiv._fullLayout),Ye.setScale();var it=j.caxis=i({},R.caxis,{range:[ne-K-ue,te],side:"right",tickangle:(+R.caxis.tickangle||0)+30,domain:[Fe,Fe+Ce*u],anchor:"free",position:0,_id:"y",_length:ie});n(it,j.graphDiv._fullLayout),it.setScale();var st="M"+H+","+(ae+ve)+"h"+ie+"l-"+ie/2+",-"+ve+"Z";j.clipDef.select("path").attr("d",st),j.layers.plotbg.select("path").attr("d",st);var nt="M0,"+ve+"h"+ie+"l-"+ie/2+",-"+ve+"Z";j.clipDefRelative.select("path").attr("d",nt);var Qe=e(H,ae);j.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Qe),j.clipDefRelative.select("path").attr("transform",null);var Le=e(H-Ye._offset,ae+ve);j.layers.baxis.attr("transform",Le),j.layers.bgrid.attr("transform",Le);var Te=e(H+ie/2,ae)+"rotate(30)"+e(0,-ze._offset);j.layers.aaxis.attr("transform",Te),j.layers.agrid.attr("transform",Te);var pe=e(H+ie/2,ae)+"rotate(-30)"+e(0,-it._offset);j.layers.caxis.attr("transform",pe),j.layers.cgrid.attr("transform",pe),j.drawAxes(!0),j.layers.aline.select("path").attr("d",ze.showline?"M"+H+","+(ae+ve)+"l"+ie/2+",-"+ve:"M0,0").call(r.stroke,ze.linecolor||"#000").style("stroke-width",(ze.linewidth||0)+"px"),j.layers.bline.select("path").attr("d",Ye.showline?"M"+H+","+(ae+ve)+"h"+ie:"M0,0").call(r.stroke,Ye.linecolor||"#000").style("stroke-width",(Ye.linewidth||0)+"px"),j.layers.cline.select("path").attr("d",it.showline?"M"+(H+ie/2)+","+ae+"l"+ie/2+","+ve:"M0,0").call(r.stroke,it.linecolor||"#000").style("stroke-width",(it.linewidth||0)+"px"),j.graphDiv._context.staticPlot||j.initInteractions(),o.setClipUrl(j.layers.frontplot,j._hasClipOnAxisFalse?null:j.clipId,j.graphDiv)},m.drawAxes=function(R){var U=this,j=U.graphDiv,Z=U.id.slice(7)+"title",re=U.layers,fe=U.aaxis,le=U.baxis,ce=U.caxis;if(U.drawAx(fe),U.drawAx(le),U.drawAx(ce),R){var V=Math.max(fe.showticklabels?fe.tickfont.size/2:0,(ce.showticklabels?ce.tickfont.size*.75:0)+(ce.ticks==="outside"?ce.ticklen*.87:0)),ee=(le.showticklabels?le.tickfont.size:0)+(le.ticks==="outside"?le.ticklen:0)+3;re["a-title"]=l.draw(j,"a"+Z,{propContainer:fe,propName:U.id+".aaxis.title.text",placeholder:t(j,"Click to enter Component A title"),attributes:{x:U.x0+U.w/2,y:U.y0-fe.title.font.size/3-V,"text-anchor":"middle"}}),re["b-title"]=l.draw(j,"b"+Z,{propContainer:le,propName:U.id+".baxis.title.text",placeholder:t(j,"Click to enter Component B title"),attributes:{x:U.x0-ee,y:U.y0+U.h+le.title.font.size*.83+ee,"text-anchor":"middle"}}),re["c-title"]=l.draw(j,"c"+Z,{propContainer:ce,propName:U.id+".caxis.title.text",placeholder:t(j,"Click to enter Component C title"),attributes:{x:U.x0+U.w+ee,y:U.y0+U.h+ce.title.font.size*.83+ee,"text-anchor":"middle"}})}},m.drawAx=function(R){var U=this,j=U.graphDiv,Z=R._name,re=Z.charAt(0),fe=R._id,le=U.layers[Z],ce=30,V=re+"tickLayout",ee=v(R);U[V]!==ee&&(le.selectAll("."+fe+"tick").remove(),U[V]=ee),R.setScale();var ne=s.calcTicks(R),K=s.clipEnds(R,ne),ue=s.makeTransTickFn(R),te=s.getTickSigns(R)[2],H=E.deg2rad(ce),ae=te*(R.linewidth||1)/2,ie=te*R.ticklen,ve=U.w,Ae=U.h,Ce=re==="b"?"M0,"+ae+"l"+Math.sin(H)*ie+","+Math.cos(H)*ie:"M"+ae+",0l"+Math.cos(H)*ie+","+-Math.sin(H)*ie,Fe={a:"M0,0l"+Ae+",-"+ve/2,b:"M0,0l-"+ve/2+",-"+Ae,c:"M0,0l-"+Ae+","+ve/2}[re];s.drawTicks(j,R,{vals:R.ticks==="inside"?K:ne,layer:le,path:Ce,transFn:ue,crisp:!1}),s.drawGrid(j,R,{vals:K,layer:U.layers[re+"grid"],path:Fe,transFn:ue,crisp:!1}),s.drawLabels(j,R,{vals:ne,layer:le,transFn:ue,labelFns:s.makeLabelFns(R,0,ce)})};function v(R){return R.ticks+String(R.ticklen)+String(R.showticklabels)}var y=_.MINZOOM/2+.87,I="m-0.87,.5h"+y+"v3h-"+(y+5.2)+"l"+(y/2+2.6)+",-"+(y*.87+4.5)+"l2.6,1.5l-"+y/2+","+y*.87+"Z",L="m0.87,.5h-"+y+"v3h"+(y+5.2)+"l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-2.6,1.5l"+y/2+","+y*.87+"Z",z="m0,1l"+y/2+","+y*.87+"l2.6,-1.5l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-"+(y/2+2.6)+","+(y*.87+4.5)+"l2.6,1.5l"+y/2+",-"+y*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",N=!0;m.clearOutline=function(){M(this.dragOptions),A(this.dragOptions.gd)},m.initInteractions=function(){var R=this,U=R.layers.plotbg.select("path").node(),j=R.graphDiv,Z=j._fullLayout._zoomlayer,re,fe;this.dragOptions={element:U,gd:j,plotinfo:{id:R.id,domain:j._fullLayout[R.id].domain,xaxis:R.xaxis,yaxis:R.yaxis},subplot:R.id,prepFn:function(Le,Te,pe){R.dragOptions.xaxes=[R.xaxis],R.dragOptions.yaxes=[R.yaxis],re=j._fullLayout._invScaleX,fe=j._fullLayout._invScaleY;var Ne=R.dragOptions.dragmode=j._fullLayout.dragmode;d(Ne)?R.dragOptions.minDrag=1:R.dragOptions.minDrag=void 0,Ne==="zoom"?(R.dragOptions.moveFn=Ye,R.dragOptions.clickFn=ve,R.dragOptions.doneFn=it,Ae(Le,Te,pe)):Ne==="pan"?(R.dragOptions.moveFn=nt,R.dragOptions.clickFn=ve,R.dragOptions.doneFn=Qe,st(),R.clearOutline(j)):(T(Ne)||d(Ne))&&g(Le,Te,pe,R.dragOptions,Ne)}};var le,ce,V,ee,ne,K,ue,te,H,ae;function ie(Le){var Te={};return Te[R.id+".aaxis.min"]=Le.a,Te[R.id+".baxis.min"]=Le.b,Te[R.id+".caxis.min"]=Le.c,Te}function ve(Le,Te){var pe=j._fullLayout.clickmode;B(j),Le===2&&(j.emit("plotly_doubleclick",null),S.call("_guiRelayout",j,ie({a:0,b:0,c:0}))),pe.indexOf("select")>-1&&Le===1&&x(Te,j,[R.xaxis],[R.yaxis],R.id,R.dragOptions),pe.indexOf("event")>-1&&c.click(j,Te,R.id)}function Ae(Le,Te,pe){var Ne=U.getBoundingClientRect();le=Te-Ne.left,ce=pe-Ne.top,j._fullLayout._calcInverseTransform(j);var ot=j._fullLayout._invTransform,ct=E.apply3DTransform(ot)(le,ce);le=ct[0],ce=ct[1],V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V,ee=R.aaxis.range[1]-V.a,K=b(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),ue="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",te=!1,H=Z.append("path").attr("class","zoombox").attr("transform",e(R.x0,R.y0)).style({fill:K>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ue),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(R.x0,R.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),R.clearOutline(j)}function Ce(Le,Te){return 1-Te/R.h}function Fe(Le,Te){return 1-(Le+(R.h-Te)/Math.sqrt(3))/R.w}function ze(Le,Te){return(Le-(R.h-Te)/Math.sqrt(3))/R.w}function Ye(Le,Te){var pe=le+Le*re,Ne=ce+Te*fe,ot=Math.max(0,Math.min(1,Ce(le,ce),Ce(pe,Ne))),ct=Math.max(0,Math.min(1,Fe(le,ce),Fe(pe,Ne))),rt=Math.max(0,Math.min(1,ze(le,ce),ze(pe,Ne))),Ft=(ot/2+rt)*R.w,Nt=(1-ot/2-ct)*R.w,$t=(Ft+Nt)/2,rr=Nt-Ft,Mr=(1-ot)*R.h,Sr=Mr-rr/u;rr<_.MINZOOM?(ne=V,H.attr("d",ue),ae.attr("d","M0,0Z")):(ne={a:V.a+ot*ee,b:V.b+ct*ee,c:V.c+rt*ee},H.attr("d",ue+"M"+Ft+","+Mr+"H"+Nt+"L"+$t+","+Sr+"L"+Ft+","+Mr+"Z"),ae.attr("d","M"+le+","+ce+F+"M"+Ft+","+Mr+I+"M"+Nt+","+Mr+L+"M"+$t+","+Sr+z)),te||(H.transition().style("fill",K>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),te=!0),j.emit("plotly_relayouting",ie(ne))}function it(){B(j),ne!==V&&(S.call("_guiRelayout",j,ie(ne)),N&&j.data&&j._context.showTips&&(E.notifier(t(j,"Double-click to zoom back out"),"long"),N=!1))}function st(){V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V}function nt(Le,Te){var pe=Le/R.xaxis._m,Ne=Te/R.yaxis._m;ne={a:V.a-Ne,b:V.b+(pe+Ne)/2,c:V.c-(pe-Ne)/2};var ot=[ne.a,ne.b,ne.c].sort(E.sorterAsc),ct={a:ot.indexOf(ne.a),b:ot.indexOf(ne.b),c:ot.indexOf(ne.c)};ot[0]<0&&(ot[1]+ot[0]/2<0?(ot[2]+=ot[0]+ot[1],ot[0]=ot[1]=0):(ot[2]+=ot[0]/2,ot[1]+=ot[0]/2,ot[0]=0),ne={a:ot[ct.a],b:ot[ct.b],c:ot[ct.c]},Te=(V.a-ne.a)*R.yaxis._m,Le=(V.c-ne.c-V.b+ne.b)*R.xaxis._m);var rt=e(R.x0+Le,R.y0+Te);R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",rt);var Ft=e(-Le,-Te);R.clipDefRelative.select("path").attr("transform",Ft),R.aaxis.range=[ne.a,R.sum-ne.b-ne.c],R.baxis.range=[R.sum-ne.a-ne.c,ne.b],R.caxis.range=[R.sum-ne.a-ne.b,ne.c],R.drawAxes(!1),R._hasClipOnAxisFalse&&R.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,R),j.emit("plotly_relayouting",ie(ne))}function Qe(){S.call("_guiRelayout",j,ie(ne))}U.onmousemove=function(Le){c.hover(j,Le,R.id),j._fullLayout._lasthover=U,j._fullLayout._hoversubplot=R.id},U.onmouseout=function(Le){j._dragging||f.unhover(j,Le)},f.init(this.dragOptions)};function B(R){h.select(R).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),O2=Ge({"src/plots/ternary/layout_attributes.js"($,G){var h=th(),b=Ac().attributes,S=ev(),E=Nc().overrideAll,e=Qi().extendFlat,t={title:{text:S.title.text,font:S.title.font},color:S.color,tickmode:S.minor.tickmode,nticks:e({},S.nticks,{dflt:6,min:1}),tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,ticklabelstep:S.ticklabelstep,showticklabels:S.showticklabels,labelalias:S.labelalias,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickfont:S.tickfont,tickangle:S.tickangle,tickformat:S.tickformat,tickformatstops:S.tickformatstops,hoverformat:S.hoverformat,showline:e({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:e({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash,layer:S.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:b({name:"ternary"}),bgcolor:{valType:"color",dflt:h.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"}}}),N0=Ge({"src/plots/subplot_defaults.js"($,G){var h=gn(),b=pu(),S=Ac().defaults;G.exports=function(e,t,r,o){var n=o.type,i=o.attributes,a=o.handleDefaults,s=o.partition||"x",f=t._subplots[n],c=f.length,p=c&&f[0].replace(/\d+$/,""),d,T;function l(M,_){return h.coerce(d,T,i,M,_)}for(var g=0;g=g&&(w.min=0,m.min=0,u.min=0,c.aaxis&&delete c.aaxis.min,c.baxis&&delete c.baxis.min,c.caxis&&delete c.caxis.min)}function f(c,p,d,T){var l=i[p._name];function g(v,y){return S.coerce(c,p,l,v,y)}g("uirevision",T.uirevision),p.type="linear";var x=g("color"),A=x!==l.color.dflt?x:d.font.color,M=p._name,_=M.charAt(0).toUpperCase(),w="Component "+_,m=g("title.text",w);p._hovertitle=m===w?m:_,S.coerceFont(g,"title.font",d.font,{overrideDflt:{size:S.bigFont(d.font.size),color:A}}),g("min"),o(c,p,g,"linear"),t(c,p,g,"linear"),e(c,p,g,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(c,p,g,{outerTicks:!0});var u=g("showticklabels");u&&(S.coerceFont(g,"tickfont",d.font,{overrideDflt:{color:A}}),g("tickangle"),g("tickformat")),n(c,p,g,{dfltColor:x,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),g("hoverformat"),g("layer")}}}),U5=Ge({"src/plots/ternary/index.js"($){var G=nb(),h=Rv().getSubplotCalcData,b=gn().counterRegex,S="ternary";$.name=S;var E=$.attr="subplot";$.idRoot=S,$.idRegex=$.attrRegex=b(S);var e=$.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},$.layoutAttributes=O2(),$.supplyLayoutDefaults=N5(),$.plot=function(r){for(var o=r._fullLayout,n=r.calcdata,i=o._subplots[S],a=0;a0){var M=r.xa,_=r.ya,w,m,u,v,y;c.orientation==="h"?(y=o,w="y",u=_,m="x",v=M):(y=n,w="x",u=M,m="y",v=_);var I=f[r.index];if(y>=I.span[0]&&y<=I.span[1]){var L=b.extendFlat({},r),z=v.c2p(y,!0),F=e.getKdeValue(I,c,y),N=e.getPositionOnKdePath(I,c,z),B=u._offset,R=u._length;L[w+"0"]=N[0],L[w+"1"]=N[1],L[m+"0"]=L[m+"1"]=z,L[m+"Label"]=m+": "+S.hoverLabelText(v,y,c[m+"hoverformat"])+", "+f[0].t.labels.kde+" "+F.toFixed(3);for(var U=0,j=0;j path").each(function(d){if(!d.isBlank){var T=p.marker;h.select(this).call(S.fill,d.mc||T.color).call(S.stroke,d.mlc||T.line.color).call(b.dashLine,T.line.dash,d.mlw||T.line.width).style("opacity",p.selectedpoints&&!d.selected?E:1)}}),r(c,p,n),c.selectAll(".regions").each(function(){h.select(this).selectAll("path").style("stroke-width",0).call(S.fill,p.connector.fillcolor)}),c.selectAll(".lines").each(function(){var d=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),d.width,d.color,d.dash)})})}G.exports={style:o}}}),X2=Ge({"src/traces/funnel/hover.js"($,G){var h=_o().opacity,b=Sc().hoverOnBars,S=gn().formatPercent;G.exports=function(t,r,o,n,i){var a=b(t,r,o,n,i);if(a){var s=a.cd,f=s[0].trace,c=f.orientation==="h",p=a.index,d=s[p],T=c?"x":"y";a[T+"LabelVal"]=d.s,a.percentInitial=d.begR,a.percentInitialLabel=S(d.begR,1),a.percentPrevious=d.difR,a.percentPreviousLabel=S(d.difR,1),a.percentTotal=d.sumR,a.percentTotalLabel=S(d.sumR,1);var l=d.hi||f.hoverinfo,g=[];if(l&&l!=="none"&&l!=="skip"){var x=l==="all",A=l.split("+"),M=function(_){return x||A.indexOf(_)!==-1};M("percent initial")&&g.push(a.percentInitialLabel+" of initial"),M("percent previous")&&g.push(a.percentPreviousLabel+" of previous"),M("percent total")&&g.push(a.percentTotalLabel+" of total")}return a.extraText=g.join("
"),a.color=E(f,d),[a]}};function E(e,t){var r=e.marker,o=t.mc||r.color,n=t.mlc||r.line.color,i=t.mlw||r.line.width;if(h(o))return o;if(h(n)&&i)return n}}}),Y5=Ge({"src/traces/funnel/event_data.js"($,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"percentInitial"in S&&(b.percentInitial=S.percentInitial),"percentPrevious"in S&&(b.percentPrevious=S.percentPrevious),"percentTotal"in S&&(b.percentTotal=S.percentTotal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),Y2=Ge({"src/traces/funnel/index.js"($,G){G.exports={attributes:N2(),layoutAttributes:U2(),supplyDefaults:j2().supplyDefaults,crossTraceDefaults:j2().crossTraceDefaults,supplyLayoutDefaults:q2(),calc:H2(),crossTraceCalc:X5(),plot:G2(),style:sb().style,hoverPoints:X2(),eventData:Y5(),selectPoints:_m(),moduleType:"trace",name:"funnel",basePlotModule:dh(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Z5=Ge({"lib/funnel.js"($,G){G.exports=Y2()}}),U0=Ge({"src/traces/waterfall/constants.js"($,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),lb=Ge({"src/traces/waterfall/attributes.js"($,G){var h=Fh(),b=Uc().line,S=ru(),E=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Al(),o=U0(),n=Qi().extendFlat,i=_o();function a(s){return{marker:{color:n({},h.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},h.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},h.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:h.xperiod0,yperiod0:h.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:h.hovertext,hovertemplate:e({},{keys:o.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},S.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:o.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:h.text,textposition:h.textposition,insidetextanchor:h.insidetextanchor,textangle:h.textangle,textfont:h.textfont,insidetextfont:h.insidetextfont,outsidetextfont:h.outsidetextfont,constraintext:h.constraintext,cliponaxis:h.cliponaxis,orientation:h.orientation,offset:h.offset,width:h.width,increasing:a(),decreasing:a(),totals:a(),connector:{line:{color:n({},b.color,{dflt:i.defaultLine}),width:n({},b.width,{editType:"plot"}),dash:b.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:h.offsetgroup,alignmentgroup:h.alignmentgroup,zorder:h.zorder}}}),W5=Ge({"src/traces/waterfall/layout_attributes.js"($,G){G.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"}}}}),yy=Ge({"src/constants/delta.js"($,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),f0=Ge({"src/traces/waterfall/defaults.js"($,G){var h=gn(),b=I0(),S=kd().handleText,E=Op(),e=Fp(),t=lb(),r=_o(),o=yy(),n=o.INCREASING.COLOR,i=o.DECREASING.COLOR,a="#4499FF";function s(p,d,T){p(d+".marker.color",T),p(d+".marker.line.color",r.defaultLine),p(d+".marker.line.width")}function f(p,d,T,l){function g(w,m){return h.coerce(p,d,t,w,m)}var x=E(p,d,l,g);if(!x){d.visible=!1;return}e(p,d,l,g),g("xhoverformat"),g("yhoverformat"),g("measure"),g("orientation",d.x&&!d.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var A=g("textposition");S(p,d,l,g,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),d.textposition!=="none"&&(g("texttemplate"),g("texttemplatefallback"),d.texttemplate||g("textinfo")),s(g,"increasing",n),s(g,"decreasing",i),s(g,"totals",a);var M=g("connector.visible");if(M){g("connector.mode");var _=g("connector.line.width");_&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function c(p,d){var T,l;function g(A){return h.coerce(l._input,l,t,A)}if(d.waterfallmode==="group")for(var x=0;x0&&(g?y+="M"+u[0]+","+v[1]+"V"+v[0]:y+="M"+u[1]+","+v[0]+"H"+u[0]),x!=="between"&&(_.isSum||w path").each(function(d){if(!d.isBlank){var T=p[d.dir].marker;h.select(this).call(S.fill,T.color).call(S.stroke,T.line.color).call(b.dashLine,T.line.dash,T.line.width).style("opacity",p.selectedpoints&&!d.selected?E:1)}}),r(c,p,n),c.selectAll(".lines").each(function(){var d=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),d.width,d.color,d.dash)})})}G.exports={style:o}}}),FM=Ge({"src/traces/waterfall/hover.js"($,G){var h=ws().hoverLabelText,b=_o().opacity,S=Sc().hoverOnBars,E=yy(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,n,i,a,s){var f=S(o,n,i,a,s);if(!f)return;var c=f.cd,p=c[0].trace,d=p.orientation==="h",T=d?"x":"y",l=d?o.xa:o.ya;function g(I){return h(l,I,p[T+"hoverformat"])}var x=f.index,A=c[x],M=A.isSum?A.b+A.s:A.rawS;f.initial=A.b+A.s-M,f.delta=M,f.final=f.initial+f.delta;var _=g(Math.abs(f.delta));f.deltaLabel=M<0?"("+_+")":_,f.finalLabel=g(f.final),f.initialLabel=g(f.initial);var w=A.hi||p.hoverinfo,m=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",v=w.split("+"),y=function(I){return u||v.indexOf(I)!==-1};A.isSum||(y("final")&&(d?!y("x"):!y("y"))&&m.push(f.finalLabel),y("delta")&&(M<0?m.push(f.deltaLabel+" "+e.decreasing):m.push(f.deltaLabel+" "+e.increasing)),y("initial")&&m.push("Initial: "+f.initialLabel))}return m.length&&(f.extraText=m.join("
")),f.color=t(p,A),[f]};function t(r,o){var n=r[o.dir].marker,i=n.color,a=n.line.color,s=n.line.width;if(b(i))return i;if(b(a)&&s)return a}}}),BM=Ge({"src/traces/waterfall/event_data.js"($,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"initial"in S&&(b.initial=S.initial),"delta"in S&&(b.delta=S.delta),"final"in S&&(b.final=S.final),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),$5=Ge({"src/traces/waterfall/index.js"($,G){G.exports={attributes:lb(),layoutAttributes:W5(),supplyDefaults:f0().supplyDefaults,crossTraceDefaults:f0().crossTraceDefaults,supplyLayoutDefaults:Z2(),calc:K5(),crossTraceCalc:ub(),plot:$1(),style:Zf().style,hoverPoints:FM(),eventData:BM(),selectPoints:_m(),moduleType:"trace",name:"waterfall",basePlotModule:dh(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),J1=Ge({"lib/waterfall.js"($,G){G.exports=$5()}}),gp=Ge({"src/traces/image/constants.js"($,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(h){return h.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(h){return h.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(h){return h.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(h){var b=h.slice(0,3);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(h){var b=h.slice(0,4);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%",""]}}}}}),W2=Ge({"src/traces/image/attributes.js"($,G){var h=ru(),b=Uc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Al(),e=Qi().extendFlat,t=gp().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],o=[],n=[];for(a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");var p=f.indexOf("=");p===-1&&(p=c);var d=p===c?0:4-p%4;return[p,d]}function r(f){var c=t(f),p=c[0],d=c[1];return(p+d)*3/4-d}function o(f,c,p){return(c+p)*3/4-p}function n(f){var c,p=t(f),d=p[0],T=p[1],l=new b(o(f,d,T)),g=0,x=T>0?d-4:d,A;for(A=0;A>16&255,l[g++]=c>>8&255,l[g++]=c&255;return T===2&&(c=h[f.charCodeAt(A)]<<2|h[f.charCodeAt(A+1)]>>4,l[g++]=c&255),T===1&&(c=h[f.charCodeAt(A)]<<10|h[f.charCodeAt(A+1)]<<4|h[f.charCodeAt(A+2)]>>2,l[g++]=c>>8&255,l[g++]=c&255),l}function i(f){return G[f>>18&63]+G[f>>12&63]+G[f>>6&63]+G[f&63]}function a(f,c,p){for(var d,T=[],l=c;lx?x:g+l));return d===1?(c=f[p-1],T.push(G[c>>2]+G[c<<4&63]+"==")):d===2&&(c=(f[p-2]<<8)+f[p-1],T.push(G[c>>10]+G[c>>4&63]+G[c<<2&63]+"=")),T.join("")}}}),K2=Ge({"node_modules/ieee754/index.js"($){$.read=function(G,h,b,S,E){var e,t,r=E*8-S-1,o=(1<>1,i=-7,a=b?E-1:0,s=b?-1:1,f=G[h+a];for(a+=s,e=f&(1<<-i)-1,f>>=-i,i+=r;i>0;e=e*256+G[h+a],a+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=S;i>0;t=t*256+G[h+a],a+=s,i-=8);if(e===0)e=1-n;else{if(e===o)return t?NaN:(f?-1:1)*(1/0);t=t+Math.pow(2,S),e=e-n}return(f?-1:1)*t*Math.pow(2,e-S)},$.write=function(G,h,b,S,E,e){var t,r,o,n=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=S?0:e-1,c=S?1:-1,p=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(r=isNaN(h)?1:0,t=i):(t=Math.floor(Math.log(h)/Math.LN2),h*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+a>=1?h+=s/o:h+=s*Math.pow(2,1-a),h*o>=2&&(t++,o/=2),t+a>=i?(r=0,t=i):t+a>=1?(r=(h*o-1)*Math.pow(2,E),t=t+a):(r=h*Math.pow(2,a-1)*Math.pow(2,E),t=0));E>=8;G[b+f]=r&255,f+=c,r/=256,E-=8);for(t=t<0;G[b+f]=t&255,f+=c,t/=256,n-=8);G[b+f-c]|=p*128}}}),yg=Ge({"node_modules/buffer/index.js"($){var G=Q5(),h=K2(),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=t,$.SlowBuffer=T,$.INSPECT_MAX_BYTES=50;var S=2147483647;$.kMaxLength=S,t.TYPED_ARRAY_SUPPORT=E(),!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 E(){try{const Le=new Uint8Array(1),Te={foo:function(){return 42}};return Object.setPrototypeOf(Te,Uint8Array.prototype),Object.setPrototypeOf(Le,Te),Le.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(Le){if(Le>S)throw new RangeError('The value "'+Le+'" is invalid for option "size"');const Te=new Uint8Array(Le);return Object.setPrototypeOf(Te,t.prototype),Te}function t(Le,Te,pe){if(typeof Le=="number"){if(typeof Te=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Le)}return r(Le,Te,pe)}t.poolSize=8192;function r(Le,Te,pe){if(typeof Le=="string")return a(Le,Te);if(ArrayBuffer.isView(Le))return f(Le);if(Le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Le);if(Ye(Le,ArrayBuffer)||Le&&Ye(Le.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ye(Le,SharedArrayBuffer)||Le&&Ye(Le.buffer,SharedArrayBuffer)))return c(Le,Te,pe);if(typeof Le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ne=Le.valueOf&&Le.valueOf();if(Ne!=null&&Ne!==Le)return t.from(Ne,Te,pe);const ot=p(Le);if(ot)return ot;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Le[Symbol.toPrimitive]=="function")return t.from(Le[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 "+typeof Le)}t.from=function(Le,Te,pe){return r(Le,Te,pe)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Le){if(typeof Le!="number")throw new TypeError('"size" argument must be of type number');if(Le<0)throw new RangeError('The value "'+Le+'" is invalid for option "size"')}function n(Le,Te,pe){return o(Le),Le<=0?e(Le):Te!==void 0?typeof pe=="string"?e(Le).fill(Te,pe):e(Le).fill(Te):e(Le)}t.alloc=function(Le,Te,pe){return n(Le,Te,pe)};function i(Le){return o(Le),e(Le<0?0:d(Le)|0)}t.allocUnsafe=function(Le){return i(Le)},t.allocUnsafeSlow=function(Le){return i(Le)};function a(Le,Te){if((typeof Te!="string"||Te==="")&&(Te="utf8"),!t.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);const pe=l(Le,Te)|0;let Ne=e(pe);const ot=Ne.write(Le,Te);return ot!==pe&&(Ne=Ne.slice(0,ot)),Ne}function s(Le){const Te=Le.length<0?0:d(Le.length)|0,pe=e(Te);for(let Ne=0;Ne=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return Le|0}function T(Le){return+Le!=Le&&(Le=0),t.alloc(+Le)}t.isBuffer=function(Te){return Te!=null&&Te._isBuffer===!0&&Te!==t.prototype},t.compare=function(Te,pe){if(Ye(Te,Uint8Array)&&(Te=t.from(Te,Te.offset,Te.byteLength)),Ye(pe,Uint8Array)&&(pe=t.from(pe,pe.offset,pe.byteLength)),!t.isBuffer(Te)||!t.isBuffer(pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Te===pe)return 0;let Ne=Te.length,ot=pe.length;for(let ct=0,rt=Math.min(Ne,ot);ctot.length?(t.isBuffer(rt)||(rt=t.from(rt)),rt.copy(ot,ct)):Uint8Array.prototype.set.call(ot,rt,ct);else if(t.isBuffer(rt))rt.copy(ot,ct);else throw new TypeError('"list" argument must be an Array of Buffers');ct+=rt.length}return ot};function l(Le,Te){if(t.isBuffer(Le))return Le.length;if(ArrayBuffer.isView(Le)||Ye(Le,ArrayBuffer))return Le.byteLength;if(typeof Le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Le);const pe=Le.length,Ne=arguments.length>2&&arguments[2]===!0;if(!Ne&&pe===0)return 0;let ot=!1;for(;;)switch(Te){case"ascii":case"latin1":case"binary":return pe;case"utf8":case"utf-8":return ve(Le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe*2;case"hex":return pe>>>1;case"base64":return Fe(Le).length;default:if(ot)return Ne?-1:ve(Le).length;Te=(""+Te).toLowerCase(),ot=!0}}t.byteLength=l;function g(Le,Te,pe){let Ne=!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(Le||(Le="utf8");;)switch(Le){case"hex":return B(this,Te,pe);case"utf8":case"utf-8":return I(this,Te,pe);case"ascii":return F(this,Te,pe);case"latin1":case"binary":return N(this,Te,pe);case"base64":return y(this,Te,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,Te,pe);default:if(Ne)throw new TypeError("Unknown encoding: "+Le);Le=(Le+"").toLowerCase(),Ne=!0}}t.prototype._isBuffer=!0;function x(Le,Te,pe){const Ne=Le[Te];Le[Te]=Le[pe],Le[pe]=Ne}t.prototype.swap16=function(){const Te=this.length;if(Te%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let pe=0;pepe&&(Te+=" ... "),""},b&&(t.prototype[b]=t.prototype.inspect),t.prototype.compare=function(Te,pe,Ne,ot,ct){if(Ye(Te,Uint8Array)&&(Te=t.from(Te,Te.offset,Te.byteLength)),!t.isBuffer(Te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Te);if(pe===void 0&&(pe=0),Ne===void 0&&(Ne=Te?Te.length:0),ot===void 0&&(ot=0),ct===void 0&&(ct=this.length),pe<0||Ne>Te.length||ot<0||ct>this.length)throw new RangeError("out of range index");if(ot>=ct&&pe>=Ne)return 0;if(ot>=ct)return-1;if(pe>=Ne)return 1;if(pe>>>=0,Ne>>>=0,ot>>>=0,ct>>>=0,this===Te)return 0;let rt=ct-ot,Ft=Ne-pe;const Nt=Math.min(rt,Ft),$t=this.slice(ot,ct),rr=Te.slice(pe,Ne);for(let Mr=0;Mr2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),pe=+pe,it(pe)&&(pe=ot?0:Le.length-1),pe<0&&(pe=Le.length+pe),pe>=Le.length){if(ot)return-1;pe=Le.length-1}else if(pe<0)if(ot)pe=0;else return-1;if(typeof Te=="string"&&(Te=t.from(Te,Ne)),t.isBuffer(Te))return Te.length===0?-1:M(Le,Te,pe,Ne,ot);if(typeof Te=="number")return Te=Te&255,typeof Uint8Array.prototype.indexOf=="function"?ot?Uint8Array.prototype.indexOf.call(Le,Te,pe):Uint8Array.prototype.lastIndexOf.call(Le,Te,pe):M(Le,[Te],pe,Ne,ot);throw new TypeError("val must be string, number or Buffer")}function M(Le,Te,pe,Ne,ot){let ct=1,rt=Le.length,Ft=Te.length;if(Ne!==void 0&&(Ne=String(Ne).toLowerCase(),Ne==="ucs2"||Ne==="ucs-2"||Ne==="utf16le"||Ne==="utf-16le")){if(Le.length<2||Te.length<2)return-1;ct=2,rt/=2,Ft/=2,pe/=2}function Nt(rr,Mr){return ct===1?rr[Mr]:rr.readUInt16BE(Mr*ct)}let $t;if(ot){let rr=-1;for($t=pe;$trt&&(pe=rt-Ft),$t=pe;$t>=0;$t--){let rr=!0;for(let Mr=0;Mrot&&(Ne=ot)):Ne=ot;const ct=Te.length;Ne>ct/2&&(Ne=ct/2);let rt;for(rt=0;rt>>0,isFinite(Ne)?(Ne=Ne>>>0,ot===void 0&&(ot="utf8")):(ot=Ne,Ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ct=this.length-pe;if((Ne===void 0||Ne>ct)&&(Ne=ct),Te.length>0&&(Ne<0||pe<0)||pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");ot||(ot="utf8");let rt=!1;for(;;)switch(ot){case"hex":return _(this,Te,pe,Ne);case"utf8":case"utf-8":return w(this,Te,pe,Ne);case"ascii":case"latin1":case"binary":return m(this,Te,pe,Ne);case"base64":return u(this,Te,pe,Ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,Te,pe,Ne);default:if(rt)throw new TypeError("Unknown encoding: "+ot);ot=(""+ot).toLowerCase(),rt=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(Le,Te,pe){return Te===0&&pe===Le.length?G.fromByteArray(Le):G.fromByteArray(Le.slice(Te,pe))}function I(Le,Te,pe){pe=Math.min(Le.length,pe);const Ne=[];let ot=Te;for(;ot239?4:ct>223?3:ct>191?2:1;if(ot+Ft<=pe){let Nt,$t,rr,Mr;switch(Ft){case 1:ct<128&&(rt=ct);break;case 2:Nt=Le[ot+1],(Nt&192)===128&&(Mr=(ct&31)<<6|Nt&63,Mr>127&&(rt=Mr));break;case 3:Nt=Le[ot+1],$t=Le[ot+2],(Nt&192)===128&&($t&192)===128&&(Mr=(ct&15)<<12|(Nt&63)<<6|$t&63,Mr>2047&&(Mr<55296||Mr>57343)&&(rt=Mr));break;case 4:Nt=Le[ot+1],$t=Le[ot+2],rr=Le[ot+3],(Nt&192)===128&&($t&192)===128&&(rr&192)===128&&(Mr=(ct&15)<<18|(Nt&63)<<12|($t&63)<<6|rr&63,Mr>65535&&Mr<1114112&&(rt=Mr))}}rt===null?(rt=65533,Ft=1):rt>65535&&(rt-=65536,Ne.push(rt>>>10&1023|55296),rt=56320|rt&1023),Ne.push(rt),ot+=Ft}return z(Ne)}var L=4096;function z(Le){const Te=Le.length;if(Te<=L)return String.fromCharCode.apply(String,Le);let pe="",Ne=0;for(;NeNe)&&(pe=Ne);let ot="";for(let ct=Te;ctNe&&(Te=Ne),pe<0?(pe+=Ne,pe<0&&(pe=0)):pe>Ne&&(pe=Ne),pepe)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(Te,pe,Ne){Te=Te>>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te],ct=1,rt=0;for(;++rt>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te+--pe],ct=1;for(;pe>0&&(ct*=256);)ot+=this[Te+--pe]*ct;return ot},t.prototype.readUint8=t.prototype.readUInt8=function(Te,pe){return Te=Te>>>0,pe||U(Te,1,this.length),this[Te]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,2,this.length),this[Te]|this[Te+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,2,this.length),this[Te]<<8|this[Te+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),(this[Te]|this[Te+1]<<8|this[Te+2]<<16)+this[Te+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]*16777216+(this[Te+1]<<16|this[Te+2]<<8|this[Te+3])},t.prototype.readBigUInt64LE=nt(function(Te){Te=Te>>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=pe+this[++Te]*2**8+this[++Te]*2**16+this[++Te]*2**24,ct=this[++Te]+this[++Te]*2**8+this[++Te]*2**16+Ne*2**24;return BigInt(ot)+(BigInt(ct)<>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=pe*2**24+this[++Te]*2**16+this[++Te]*2**8+this[++Te],ct=this[++Te]*2**24+this[++Te]*2**16+this[++Te]*2**8+Ne;return(BigInt(ot)<>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te],ct=1,rt=0;for(;++rt=ct&&(ot-=Math.pow(2,8*pe)),ot},t.prototype.readIntBE=function(Te,pe,Ne){Te=Te>>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=pe,ct=1,rt=this[Te+--ot];for(;ot>0&&(ct*=256);)rt+=this[Te+--ot]*ct;return ct*=128,rt>=ct&&(rt-=Math.pow(2,8*pe)),rt},t.prototype.readInt8=function(Te,pe){return Te=Te>>>0,pe||U(Te,1,this.length),this[Te]&128?(255-this[Te]+1)*-1:this[Te]},t.prototype.readInt16LE=function(Te,pe){Te=Te>>>0,pe||U(Te,2,this.length);const Ne=this[Te]|this[Te+1]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt16BE=function(Te,pe){Te=Te>>>0,pe||U(Te,2,this.length);const Ne=this[Te+1]|this[Te]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt32LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]|this[Te+1]<<8|this[Te+2]<<16|this[Te+3]<<24},t.prototype.readInt32BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]<<24|this[Te+1]<<16|this[Te+2]<<8|this[Te+3]},t.prototype.readBigInt64LE=nt(function(Te){Te=Te>>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=this[Te+4]+this[Te+5]*2**8+this[Te+6]*2**16+(Ne<<24);return(BigInt(ot)<>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=(pe<<24)+this[++Te]*2**16+this[++Te]*2**8+this[++Te];return(BigInt(ot)<>>0,pe||U(Te,4,this.length),h.read(this,Te,!0,23,4)},t.prototype.readFloatBE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),h.read(this,Te,!1,23,4)},t.prototype.readDoubleLE=function(Te,pe){return Te=Te>>>0,pe||U(Te,8,this.length),h.read(this,Te,!0,52,8)},t.prototype.readDoubleBE=function(Te,pe){return Te=Te>>>0,pe||U(Te,8,this.length),h.read(this,Te,!1,52,8)};function j(Le,Te,pe,Ne,ot,ct){if(!t.isBuffer(Le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Te>ot||TeLe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,Ne=Ne>>>0,!ot){const Ft=Math.pow(2,8*Ne)-1;j(this,Te,pe,Ne,Ft,0)}let ct=1,rt=0;for(this[pe]=Te&255;++rt>>0,Ne=Ne>>>0,!ot){const Ft=Math.pow(2,8*Ne)-1;j(this,Te,pe,Ne,Ft,0)}let ct=Ne-1,rt=1;for(this[pe+ct]=Te&255;--ct>=0&&(rt*=256);)this[pe+ct]=Te/rt&255;return pe+Ne},t.prototype.writeUint8=t.prototype.writeUInt8=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,1,255,0),this[pe]=Te&255,pe+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,65535,0),this[pe]=Te&255,this[pe+1]=Te>>>8,pe+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,65535,0),this[pe]=Te>>>8,this[pe+1]=Te&255,pe+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(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},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(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 Z(Le,Te,pe,Ne,ot){ue(Te,Ne,ot,Le,pe,7);let ct=Number(Te&BigInt(4294967295));Le[pe++]=ct,ct=ct>>8,Le[pe++]=ct,ct=ct>>8,Le[pe++]=ct,ct=ct>>8,Le[pe++]=ct;let rt=Number(Te>>BigInt(32)&BigInt(4294967295));return Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,pe}function re(Le,Te,pe,Ne,ot){ue(Te,Ne,ot,Le,pe,7);let ct=Number(Te&BigInt(4294967295));Le[pe+7]=ct,ct=ct>>8,Le[pe+6]=ct,ct=ct>>8,Le[pe+5]=ct,ct=ct>>8,Le[pe+4]=ct;let rt=Number(Te>>BigInt(32)&BigInt(4294967295));return Le[pe+3]=rt,rt=rt>>8,Le[pe+2]=rt,rt=rt>>8,Le[pe+1]=rt,rt=rt>>8,Le[pe]=rt,pe+8}t.prototype.writeBigUInt64LE=nt(function(Te,pe=0){return Z(this,Te,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=nt(function(Te,pe=0){return re(this,Te,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,!ot){const Nt=Math.pow(2,8*Ne-1);j(this,Te,pe,Ne,Nt-1,-Nt)}let ct=0,rt=1,Ft=0;for(this[pe]=Te&255;++ct>0)-Ft&255;return pe+Ne},t.prototype.writeIntBE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,!ot){const Nt=Math.pow(2,8*Ne-1);j(this,Te,pe,Ne,Nt-1,-Nt)}let ct=Ne-1,rt=1,Ft=0;for(this[pe+ct]=Te&255;--ct>=0&&(rt*=256);)Te<0&&Ft===0&&this[pe+ct+1]!==0&&(Ft=1),this[pe+ct]=(Te/rt>>0)-Ft&255;return pe+Ne},t.prototype.writeInt8=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,1,127,-128),Te<0&&(Te=255+Te+1),this[pe]=Te&255,pe+1},t.prototype.writeInt16LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,32767,-32768),this[pe]=Te&255,this[pe+1]=Te>>>8,pe+2},t.prototype.writeInt16BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,32767,-32768),this[pe]=Te>>>8,this[pe+1]=Te&255,pe+2},t.prototype.writeInt32LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(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},t.prototype.writeInt32BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(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},t.prototype.writeBigInt64LE=nt(function(Te,pe=0){return Z(this,Te,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=nt(function(Te,pe=0){return re(this,Te,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(Le,Te,pe,Ne,ot,ct){if(pe+Ne>Le.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("Index out of range")}function le(Le,Te,pe,Ne,ot){return Te=+Te,pe=pe>>>0,ot||fe(Le,Te,pe,4),h.write(Le,Te,pe,Ne,23,4),pe+4}t.prototype.writeFloatLE=function(Te,pe,Ne){return le(this,Te,pe,!0,Ne)},t.prototype.writeFloatBE=function(Te,pe,Ne){return le(this,Te,pe,!1,Ne)};function ce(Le,Te,pe,Ne,ot){return Te=+Te,pe=pe>>>0,ot||fe(Le,Te,pe,8),h.write(Le,Te,pe,Ne,52,8),pe+8}t.prototype.writeDoubleLE=function(Te,pe,Ne){return ce(this,Te,pe,!0,Ne)},t.prototype.writeDoubleBE=function(Te,pe,Ne){return ce(this,Te,pe,!1,Ne)},t.prototype.copy=function(Te,pe,Ne,ot){if(!t.isBuffer(Te))throw new TypeError("argument should be a Buffer");if(Ne||(Ne=0),!ot&&ot!==0&&(ot=this.length),pe>=Te.length&&(pe=Te.length),pe||(pe=0),ot>0&&ot=this.length)throw new RangeError("Index out of range");if(ot<0)throw new RangeError("sourceEnd out of bounds");ot>this.length&&(ot=this.length),Te.length-pe>>0,Ne=Ne===void 0?this.length:Ne>>>0,Te||(Te=0);let ct;if(typeof Te=="number")for(ct=pe;ct2**32?ot=ne(String(pe)):typeof pe=="bigint"&&(ot=String(pe),(pe>BigInt(2)**BigInt(32)||pe<-(BigInt(2)**BigInt(32)))&&(ot=ne(ot)),ot+="n"),Ne+=` It must be ${Te}. Received ${ot}`,Ne},RangeError);function ne(Le){let Te="",pe=Le.length;const Ne=Le[0]==="-"?1:0;for(;pe>=Ne+4;pe-=3)Te=`_${Le.slice(pe-3,pe)}${Te}`;return`${Le.slice(0,pe)}${Te}`}function K(Le,Te,pe){te(Te,"offset"),(Le[Te]===void 0||Le[Te+pe]===void 0)&&H(Te,Le.length-(pe+1))}function ue(Le,Te,pe,Ne,ot,ct){if(Le>pe||Le= 0${rt} and < 2${rt} ** ${(ct+1)*8}${rt}`:Ft=`>= -(2${rt} ** ${(ct+1)*8-1}${rt}) and < 2 ** ${(ct+1)*8-1}${rt}`,new V.ERR_OUT_OF_RANGE("value",Ft,Le)}K(Ne,ot,ct)}function te(Le,Te){if(typeof Le!="number")throw new V.ERR_INVALID_ARG_TYPE(Te,"number",Le)}function H(Le,Te,pe){throw Math.floor(Le)!==Le?(te(Le,pe),new V.ERR_OUT_OF_RANGE("offset","an integer",Le)):Te<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Te}`,Le)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Le){if(Le=Le.split("=")[0],Le=Le.trim().replace(ae,""),Le.length<2)return"";for(;Le.length%4!==0;)Le=Le+"=";return Le}function ve(Le,Te){Te=Te||1/0;let pe;const Ne=Le.length;let ot=null;const ct=[];for(let rt=0;rt55295&&pe<57344){if(!ot){if(pe>56319){(Te-=3)>-1&&ct.push(239,191,189);continue}else if(rt+1===Ne){(Te-=3)>-1&&ct.push(239,191,189);continue}ot=pe;continue}if(pe<56320){(Te-=3)>-1&&ct.push(239,191,189),ot=pe;continue}pe=(ot-55296<<10|pe-56320)+65536}else ot&&(Te-=3)>-1&&ct.push(239,191,189);if(ot=null,pe<128){if((Te-=1)<0)break;ct.push(pe)}else if(pe<2048){if((Te-=2)<0)break;ct.push(pe>>6|192,pe&63|128)}else if(pe<65536){if((Te-=3)<0)break;ct.push(pe>>12|224,pe>>6&63|128,pe&63|128)}else if(pe<1114112){if((Te-=4)<0)break;ct.push(pe>>18|240,pe>>12&63|128,pe>>6&63|128,pe&63|128)}else throw new Error("Invalid code point")}return ct}function Ae(Le){const Te=[];for(let pe=0;pe>8,ot=pe%256,ct.push(ot),ct.push(Ne);return ct}function Fe(Le){return G.toByteArray(ie(Le))}function ze(Le,Te,pe,Ne){let ot;for(ot=0;ot=Te.length||ot>=Le.length);++ot)Te[ot+pe]=Le[ot];return ot}function Ye(Le,Te){return Le instanceof Te||Le!=null&&Le.constructor!=null&&Le.constructor.name!=null&&Le.constructor.name===Te.name}function it(Le){return Le!==Le}var st=(function(){const Le="0123456789abcdef",Te=new Array(256);for(let pe=0;pe<16;++pe){const Ne=pe*16;for(let ot=0;ot<16;++ot)Te[Ne+ot]=Le[pe]+Le[ot]}return Te})();function nt(Le){return typeof BigInt>"u"?Qe:Le}function Qe(){throw new Error("BigInt not supported")}}}),Q1=Ge({"node_modules/has-symbols/shams.js"($,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var b={},S=Symbol("test"),E=Object(S);if(typeof S=="string"||Object.prototype.toString.call(S)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;b[S]=e;for(var t in b)return!1;if(typeof Object.keys=="function"&&Object.keys(b).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(b).length!==0)return!1;var r=Object.getOwnPropertySymbols(b);if(r.length!==1||r[0]!==S||!Object.prototype.propertyIsEnumerable.call(b,S))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(b,S);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),_y=Ge({"node_modules/has-tostringtag/shams.js"($,G){var h=Q1();G.exports=function(){return h()&&!!Symbol.toStringTag}}}),e_=Ge({"node_modules/es-object-atoms/index.js"($,G){G.exports=Object}}),eA=Ge({"node_modules/es-errors/index.js"($,G){G.exports=Error}}),j0=Ge({"node_modules/es-errors/eval.js"($,G){G.exports=EvalError}}),nv=Ge({"node_modules/es-errors/range.js"($,G){G.exports=RangeError}}),$2=Ge({"node_modules/es-errors/ref.js"($,G){G.exports=ReferenceError}}),J2=Ge({"node_modules/es-errors/syntax.js"($,G){G.exports=SyntaxError}}),Eh=Ge({"node_modules/es-errors/type.js"($,G){G.exports=TypeError}}),NM=Ge({"node_modules/es-errors/uri.js"($,G){G.exports=URIError}}),tA=Ge({"node_modules/math-intrinsics/abs.js"($,G){G.exports=Math.abs}}),rA=Ge({"node_modules/math-intrinsics/floor.js"($,G){G.exports=Math.floor}}),nh=Ge({"node_modules/math-intrinsics/max.js"($,G){G.exports=Math.max}}),Cd=Ge({"node_modules/math-intrinsics/min.js"($,G){G.exports=Math.min}}),q0=Ge({"node_modules/math-intrinsics/pow.js"($,G){G.exports=Math.pow}}),nA=Ge({"node_modules/math-intrinsics/round.js"($,G){G.exports=Math.round}}),aA=Ge({"node_modules/math-intrinsics/isNaN.js"($,G){G.exports=Number.isNaN||function(b){return b!==b}}}),iA=Ge({"node_modules/math-intrinsics/sign.js"($,G){var h=aA();G.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),UM=Ge({"node_modules/gopd/gOPD.js"($,G){G.exports=Object.getOwnPropertyDescriptor}}),V0=Ge({"node_modules/gopd/index.js"($,G){var h=UM();if(h)try{h([],"length")}catch{h=null}G.exports=h}}),Xv=Ge({"node_modules/es-define-property/index.js"($,G){var h=Object.defineProperty||!1;if(h)try{h({},"a",{value:1})}catch{h=!1}G.exports=h}}),Hp=Ge({"node_modules/has-symbols/index.js"($,G){var h=typeof Symbol<"u"&&Symbol,b=Q1();G.exports=function(){return typeof h!="function"||typeof Symbol!="function"||typeof h("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:b()}}}),Q2=Ge({"node_modules/get-proto/Reflect.getPrototypeOf.js"($,G){G.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),yd=Ge({"node_modules/get-proto/Object.getPrototypeOf.js"($,G){var h=e_();G.exports=h.getPrototypeOf||null}}),oA=Ge({"node_modules/function-bind/implementation.js"($,G){var h="Function.prototype.bind called on incompatible ",b=Object.prototype.toString,S=Math.max,E="[object Function]",e=function(n,i){for(var a=[],s=0;s"u"||!w?h:w(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?h:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?h:ArrayBuffer,"%ArrayIteratorPrototype%":_&&w?w([][Symbol.iterator]()):h,"%AsyncFromSyncIteratorPrototype%":h,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?h:Atomics,"%BigInt%":typeof BigInt>"u"?h:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?h:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?h:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?h:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":E,"%Float16Array%":typeof Float16Array>"u"?h:Float16Array,"%Float32Array%":typeof Float32Array>"u"?h:Float32Array,"%Float64Array%":typeof Float64Array>"u"?h:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?h:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?h:Int8Array,"%Int16Array%":typeof Int16Array>"u"?h:Int16Array,"%Int32Array%":typeof Int32Array>"u"?h:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&w?w(w([][Symbol.iterator]())):h,"%JSON%":typeof JSON=="object"?JSON:h,"%Map%":typeof Map>"u"?h:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!w?h:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":b,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?h:Promise,"%Proxy%":typeof Proxy>"u"?h:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?h:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?h:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!w?h:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?h:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&w?w(""[Symbol.iterator]()):h,"%Symbol%":_?Symbol:h,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?h:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?h:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?h:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?h:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?h:WeakMap,"%WeakRef%":typeof WeakRef>"u"?h:WeakRef,"%WeakSet%":typeof WeakSet>"u"?h:WeakSet,"%Function.prototype.call%":y,"%Function.prototype.apply%":v,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":m,"%Math.abs%":i,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":c,"%Math.round%":p,"%Math.sign%":d,"%Reflect.getPrototypeOf%":u};if(w)try{null.error}catch(K){F=w(w(K)),z["%Error.prototype%"]=F}var F,N=function K(ue){var te;if(ue==="%AsyncFunction%")te=l("async function () {}");else if(ue==="%GeneratorFunction%")te=l("function* () {}");else if(ue==="%AsyncGeneratorFunction%")te=l("async function* () {}");else if(ue==="%AsyncGenerator%"){var H=K("%AsyncGeneratorFunction%");H&&(te=H.prototype)}else if(ue==="%AsyncIteratorPrototype%"){var ae=K("%AsyncGenerator%");ae&&w&&(te=w(ae.prototype))}return z[ue]=te,te},B={__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"]},R=ip(),U=t_(),j=R.call(y,Array.prototype.concat),Z=R.call(v,Array.prototype.splice),re=R.call(y,String.prototype.replace),fe=R.call(y,String.prototype.slice),le=R.call(y,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,ee=function(ue){var te=fe(ue,0,1),H=fe(ue,-1);if(te==="%"&&H!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&te!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var ae=[];return re(ue,ce,function(ie,ve,Ae,Ce){ae[ae.length]=Ae?re(Ce,V,"$1"):ve||ie}),ae},ne=function(ue,te){var H=ue,ae;if(U(B,H)&&(ae=B[H],H="%"+ae[0]+"%"),U(z,H)){var ie=z[H];if(ie===I&&(ie=N(H)),typeof ie>"u"&&!te)throw new o("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:ae,name:H,value:ie}}throw new r("intrinsic "+ue+" does not exist!")};G.exports=function(ue,te){if(typeof ue!="string"||ue.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,ue)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=ee(ue),ae=H.length>0?H[0]:"",ie=ne("%"+ae+"%",te),ve=ie.name,Ae=ie.value,Ce=!1,Fe=ie.alias;Fe&&(ae=Fe[0],Z(H,j([0,1],Fe)));for(var ze=1,Ye=!0;ze=H.length){var Qe=g(Ae,it);Ye=!!Qe,Ye&&"get"in Qe&&!("originalValue"in Qe.get)?Ae=Qe.get:Ae=Ae[it]}else Ye=U(Ae,it),Ae=Ae[it];Ye&&!Ce&&(z[ve]=Ae)}}return Ae}}}),by=Ge({"node_modules/define-data-property/index.js"($,G){var h=Xv(),b=J2(),S=Eh(),E=V0();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new S("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new S("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!E&&E(t,r);if(h)h(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:o,writable:i===null&&f?f.writable:!i});else if(s||!n&&!i&&!a)t[r]=o;else throw new b("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),r3=Ge({"node_modules/has-property-descriptors/index.js"($,G){var h=Xv(),b=function(){return!!h};b.hasArrayLengthDefineBug=function(){if(!h)return null;try{return h([],"length",{value:1}).length!==1}catch{return!0}},G.exports=b}}),lA=Ge({"node_modules/set-function-length/index.js"($,G){var h=_g(),b=by(),S=r3()(),E=V0(),e=Eh(),t=h("%Math.floor%");G.exports=function(o,n){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in o&&E){var f=E(o,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(s=!1)}return(a||s||!i)&&(S?b(o,"length",n,!0,!0):b(o,"length",n)),o}}}),wm=Ge({"node_modules/call-bind/index.js"($,G){var h=ip(),b=_g(),S=lA(),E=Eh(),e=b("%Function.prototype.apply%"),t=b("%Function.prototype.call%"),r=b("%Reflect.apply%",!0)||h.call(t,e),o=Xv(),n=b("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var f=r(h,t,arguments);return S(f,1+n(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(h,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),wy=Ge({"node_modules/call-bind/callBound.js"($,G){var h=_g(),b=wm(),S=b(h("String.prototype.indexOf"));G.exports=function(e,t){var r=h(e,!!t);return typeof r=="function"&&S(e,".prototype.")>-1?b(r):r}}}),cb=Ge({"node_modules/is-arguments/index.js"($,G){var h=_y()(),b=wy(),S=b("Object.prototype.toString"),E=function(o){return h&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:S(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&S(o)!=="[object Array]"&&S(o.callee)==="[object Function]"},t=(function(){return E(arguments)})();E.isLegacyArguments=e,G.exports=t?E:e}}),uA=Ge({"node_modules/is-generator-function/index.js"($,G){var h=Object.prototype.toString,b=Function.prototype.toString,S=/^\s*(?:function)?\*/,E=_y()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(n){if(typeof n!="function")return!1;if(S.test(b.call(n)))return!0;if(!E){var i=h.call(n);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var a=t();r=a?e(a):!1}return e(n)===r}}}),jM=Ge({"node_modules/is-callable/index.js"($,G){var h=Function.prototype.toString,b=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S,E;if(typeof b=="function"&&typeof Object.defineProperty=="function")try{S=Object.defineProperty({},"length",{get:function(){throw E}}),E={},b(function(){throw 42},null,S)}catch(g){g!==E&&(b=null)}else b=null;var e=/^\s*class\b/,t=function(x){try{var A=h.call(x);return e.test(A)}catch{return!1}},r=function(x){try{return t(x)?!1:(h.call(x),!0)}catch{return!1}},o=Object.prototype.toString,n="[object Object]",i="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",c="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,d=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(x){if((d||!x)&&(typeof x>"u"||typeof x=="object"))try{var A=o.call(x);return(A===s||A===f||A===c||A===n)&&x("")==null}catch{}return!1}));var l;G.exports=b?function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{b(x,null,S)}catch(A){if(A!==E)return!1}return!t(x)&&r(x)}:function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(p)return r(x);if(t(x))return!1;var A=o.call(x);return A!==i&&A!==a&&!/^\[object HTML/.test(A)?!1:r(x)}}}),cA=Ge({"node_modules/for-each/index.js"($,G){var h=jM(),b=Object.prototype.toString,S=Object.prototype.hasOwnProperty,E=function(n,i,a){for(var s=0,f=n.length;s=3&&(s=a),b.call(n)==="[object Array]"?E(n,i,s):typeof n=="string"?e(n,i,s):t(n,i,s)};G.exports=r}}),Mc=Ge({"node_modules/available-typed-arrays/index.js"($,G){var h=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],b=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,n=b(),i=E("String.prototype.slice"),a=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var g=0;g-1?l:l!=="Object"?!1:p(T)}return e?c(T):null}}}),Qu=Ge({"node_modules/is-typed-array/index.js"($,G){var h=cA(),b=Mc(),S=wy(),E=S("Object.prototype.toString"),e=_y()(),t=V0(),r=typeof globalThis>"u"?window:globalThis,o=b(),n=S("Array.prototype.indexOf",!0)||function(p,d){for(var T=0;T-1}return t?f(p):!1}}}),ec=Ge({"node_modules/util/support/types.js"($){var G=cb(),h=uA(),b=Pf(),S=Qu();function E(Ce){return Ce.call.bind(Ce)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),n=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(a=E(BigInt.prototype.valueOf));var a;t&&(s=E(Symbol.prototype.valueOf));var s;function f(Ce,Fe){if(typeof Ce!="object")return!1;try{return Fe(Ce),!0}catch{return!1}}$.isArgumentsObject=G,$.isGeneratorFunction=h,$.isTypedArray=S;function c(Ce){return typeof Promise<"u"&&Ce instanceof Promise||Ce!==null&&typeof Ce=="object"&&typeof Ce.then=="function"&&typeof Ce.catch=="function"}$.isPromise=c;function p(Ce){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ce):S(Ce)||Z(Ce)}$.isArrayBufferView=p;function d(Ce){return b(Ce)==="Uint8Array"}$.isUint8Array=d;function T(Ce){return b(Ce)==="Uint8ClampedArray"}$.isUint8ClampedArray=T;function l(Ce){return b(Ce)==="Uint16Array"}$.isUint16Array=l;function g(Ce){return b(Ce)==="Uint32Array"}$.isUint32Array=g;function x(Ce){return b(Ce)==="Int8Array"}$.isInt8Array=x;function A(Ce){return b(Ce)==="Int16Array"}$.isInt16Array=A;function M(Ce){return b(Ce)==="Int32Array"}$.isInt32Array=M;function _(Ce){return b(Ce)==="Float32Array"}$.isFloat32Array=_;function w(Ce){return b(Ce)==="Float64Array"}$.isFloat64Array=w;function m(Ce){return b(Ce)==="BigInt64Array"}$.isBigInt64Array=m;function u(Ce){return b(Ce)==="BigUint64Array"}$.isBigUint64Array=u;function v(Ce){return r(Ce)==="[object Map]"}v.working=typeof Map<"u"&&v(new Map);function y(Ce){return typeof Map>"u"?!1:v.working?v(Ce):Ce instanceof Map}$.isMap=y;function I(Ce){return r(Ce)==="[object Set]"}I.working=typeof Set<"u"&&I(new Set);function L(Ce){return typeof Set>"u"?!1:I.working?I(Ce):Ce instanceof Set}$.isSet=L;function z(Ce){return r(Ce)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ce){return typeof WeakMap>"u"?!1:z.working?z(Ce):Ce instanceof WeakMap}$.isWeakMap=F;function N(Ce){return r(Ce)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function B(Ce){return N(Ce)}$.isWeakSet=B;function R(Ce){return r(Ce)==="[object ArrayBuffer]"}R.working=typeof ArrayBuffer<"u"&&R(new ArrayBuffer);function U(Ce){return typeof ArrayBuffer>"u"?!1:R.working?R(Ce):Ce instanceof ArrayBuffer}$.isArrayBuffer=U;function j(Ce){return r(Ce)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function Z(Ce){return typeof DataView>"u"?!1:j.working?j(Ce):Ce instanceof DataView}$.isDataView=Z;var re=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function fe(Ce){return r(Ce)==="[object SharedArrayBuffer]"}function le(Ce){return typeof re>"u"?!1:(typeof fe.working>"u"&&(fe.working=fe(new re)),fe.working?fe(Ce):Ce instanceof re)}$.isSharedArrayBuffer=le;function ce(Ce){return r(Ce)==="[object AsyncFunction]"}$.isAsyncFunction=ce;function V(Ce){return r(Ce)==="[object Map Iterator]"}$.isMapIterator=V;function ee(Ce){return r(Ce)==="[object Set Iterator]"}$.isSetIterator=ee;function ne(Ce){return r(Ce)==="[object Generator]"}$.isGeneratorObject=ne;function K(Ce){return r(Ce)==="[object WebAssembly.Module]"}$.isWebAssemblyCompiledModule=K;function ue(Ce){return f(Ce,o)}$.isNumberObject=ue;function te(Ce){return f(Ce,n)}$.isStringObject=te;function H(Ce){return f(Ce,i)}$.isBooleanObject=H;function ae(Ce){return e&&f(Ce,a)}$.isBigIntObject=ae;function ie(Ce){return t&&f(Ce,s)}$.isSymbolObject=ie;function ve(Ce){return ue(Ce)||te(Ce)||H(Ce)||ae(Ce)||ie(Ce)}$.isBoxedPrimitive=ve;function Ae(Ce){return typeof Uint8Array<"u"&&(U(Ce)||le(Ce))}$.isAnyArrayBuffer=Ae,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ce){Object.defineProperty($,Ce,{enumerable:!1,value:function(){throw new Error(Ce+" is not supported in userland")}})})}}),Kc=Ge({"node_modules/util/support/isBufferBrowser.js"($,G){G.exports=function(b){return b&&typeof b=="object"&&typeof b.copy=="function"&&typeof b.fill=="function"&&typeof b.readUInt8=="function"}}}),Ld=Ge({"(disabled):node_modules/util/util.js"($){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return $.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;$.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=$.format.apply($,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),d(Z)?re.showHidden=Z:Z&&$._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}$.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(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&v(Z.inspect)&&Z.inspect!==$.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(v(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",K=!1,ue=["{","}"];if(p(Z)&&(K=!0,ue=["[","]"]),v(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!K||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return K?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,K)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(d(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V-1&&(ce?ee=ee.split(` +`).map(function(K){return" "+K}).join(` +`).slice(2):ee=` +`+ee.split(` +`).map(function(K){return" "+K}).join(` +`))):ee=j.stylize("[Circular]","special")),M(V)){if(ce&&le.match(/^\d+$/))return ee;V=JSON.stringify(""+le),V.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.slice(1,-1),V=j.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=j.stylize(V,"string"))}return V+": "+ee}function c(j,Z,re){var fe=j.reduce(function(le,ce){return ce.indexOf(` +`)>=0,le+ce.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?re[0]+(Z===""?"":Z+` + `)+" "+j.join(`, + `)+" "+re[1]:re[0]+Z+" "+j.join(", ")+" "+re[1]}$.types=ec();function p(j){return Array.isArray(j)}$.isArray=p;function d(j){return typeof j=="boolean"}$.isBoolean=d;function T(j){return j===null}$.isNull=T;function l(j){return j==null}$.isNullOrUndefined=l;function g(j){return typeof j=="number"}$.isNumber=g;function x(j){return typeof j=="string"}$.isString=x;function A(j){return typeof j=="symbol"}$.isSymbol=A;function M(j){return j===void 0}$.isUndefined=M;function _(j){return w(j)&&I(j)==="[object RegExp]"}$.isRegExp=_,$.types.isRegExp=_;function w(j){return typeof j=="object"&&j!==null}$.isObject=w;function m(j){return w(j)&&I(j)==="[object Date]"}$.isDate=m,$.types.isDate=m;function u(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}$.isError=u,$.types.isNativeError=u;function v(j){return typeof j=="function"}$.isFunction=v;function y(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}$.isPrimitive=y,$.isBuffer=Kc();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}$.log=function(){console.log("%s - %s",F(),$.format.apply($,arguments))},$.inherits=yp(),$._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;$.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,K){fe=ne,le=K}),V=[],ee=0;ee0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(p){var d={data:p,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var d=this.head,T=""+d.data;d=d.next;)T+=p+d.data;return T}},{key:"concat",value:function(p){if(this.length===0)return o.alloc(0);for(var d=o.allocUnsafe(p>>>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(p,d){var T;return pg.length?g.length:p;if(x===g.length?l+=g:l+=g.slice(0,p),p-=x,p===0){x===g.length?(++T,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=g.slice(x));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(p){var d=o.allocUnsafe(p),T=this.head,l=1;for(T.data.copy(d),p-=T.data.length;T=T.next;){var g=T.data,x=p>g.length?g.length:p;if(g.copy(d,d.length-p,0,x),p-=x,p===0){x===g.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=g.slice(x));break}++l}return this.length-=l,d}},{key:a,value:function(p,d){return i(this,b({},d,{depth:0,customInspect:!1}))}}]),f})()}}),xg=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"($,G){function h(r,o){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(S,n):(n._writableState.errorEmitted=!0,process.nextTick(b,n,s)):process.nextTick(b,n,s):o?(process.nextTick(S,n),o(s)):process.nextTick(S,n)}),this)}function b(r,o){e(r,o),S(r)}function S(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var n=r._readableState,i=r._writableState;n&&n.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:h,undestroy:E,errorOrDestroy:t}}}),Am=Ge({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"($,G){function h(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var b={};function S(o,n,i){i||(i=Error);function a(f,c,p){return typeof n=="string"?n:n(f,c,p)}var s=(function(f){h(c,f);function c(p,d,T){return f.call(this,a(p,d,T))||this}return c})(i);s.prototype.name=i.name,s.prototype.code=o,b[o]=s}function E(o,n){if(Array.isArray(o)){var i=o.length;return o=o.map(function(a){return String(a)}),i>2?"one of ".concat(n," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(n," ").concat(o[0]," or ").concat(o[1]):"of ".concat(n," ").concat(o[0])}else return"of ".concat(n," ").concat(String(o))}function e(o,n,i){return o.substr(0,n.length)===n}function t(o,n,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-n.length,i)===n}function r(o,n,i){return typeof i!="number"&&(i=0),i+n.length>o.length?!1:o.indexOf(n,i)!==-1}S("ERR_INVALID_OPT_VALUE",function(o,n){return'The value "'+n+'" is invalid for option "'+o+'"'},TypeError),S("ERR_INVALID_ARG_TYPE",function(o,n,i){var a;typeof n=="string"&&e(n,"not ")?(a="must not be",n=n.replace(/^not /,"")):a="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(a," ").concat(E(n,"type"));else{var f=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(f," ").concat(a," ").concat(E(n,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),S("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),S("ERR_STREAM_PREMATURE_CLOSE","Premature close"),S("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),S("ERR_STREAM_WRITE_AFTER_END","write after end"),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=b}}),v0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"($,G){var h=Am().codes.ERR_INVALID_OPT_VALUE;function b(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function S(E,e,t,r){var o=b(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var n=r?t:"highWaterMark";throw new h(n,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:S}}}),kh=Ge({"node_modules/util-deprecate/browser.js"($,G){G.exports=h;function h(S,E){if(b("noDeprecation"))return S;var e=!1;function t(){if(!e){if(b("throwDeprecation"))throw new Error(E);b("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return S.apply(this,arguments)}return t}function b(S){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[S];return E==null?!1:String(E).toLowerCase()==="true"}}}),G0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"($,G){G.exports=m;function h(V){var ee=this;this.next=null,this.entry=null,this.finish=function(){ce(ee,V)}}var b;m.WritableState=_;var S={deprecate:kh()},E=Vp(),e=yg().Buffer,t=window.Uint8Array||function(){};function r(V){return e.from(V)}function o(V){return e.isBuffer(V)||V instanceof t}var n=xg(),i=v0(),a=i.getHighWaterMark,s=Am().codes,f=s.ERR_INVALID_ARG_TYPE,c=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,d=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,g=s.ERR_STREAM_WRITE_AFTER_END,x=s.ERR_UNKNOWN_ENCODING,A=n.errorOrDestroy;yp()(m,E);function M(){}function _(V,ee,ne){b=b||_p(),V=V||{},typeof ne!="boolean"&&(ne=ee instanceof b),this.objectMode=!!V.objectMode,ne&&(this.objectMode=this.objectMode||!!V.writableObjectMode),this.highWaterMark=a(this,V,"writableHighWaterMark",ne),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=V.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){N(ee,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}_.prototype.getBuffer=function(){for(var ee=this.bufferedRequest,ne=[];ee;)ne.push(ee),ee=ee.next;return ne},(function(){try{Object.defineProperty(_.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(ee){return w.call(this,ee)?!0:this!==m?!1:ee&&ee._writableState instanceof _}})):w=function(ee){return ee instanceof this};function m(V){b=b||_p();var ee=this instanceof b;if(!ee&&!w.call(m,this))return new m(V);this._writableState=new _(V,this,ee),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),E.call(this)}m.prototype.pipe=function(){A(this,new d)};function u(V,ee){var ne=new g;A(V,ne),process.nextTick(ee,ne)}function v(V,ee,ne,K){var ue;return ne===null?ue=new l:typeof ne!="string"&&!ee.objectMode&&(ue=new f("chunk",["string","Buffer"],ne)),ue?(A(V,ue),process.nextTick(K,ue),!1):!0}m.prototype.write=function(V,ee,ne){var K=this._writableState,ue=!1,te=!K.objectMode&&o(V);return te&&!e.isBuffer(V)&&(V=r(V)),typeof ee=="function"&&(ne=ee,ee=null),te?ee="buffer":ee||(ee=K.defaultEncoding),typeof ne!="function"&&(ne=M),K.ending?u(this,ne):(te||v(this,K,V,ne))&&(K.pendingcb++,ue=I(this,K,te,V,ee,ne)),ue},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&U(this,V))},m.prototype.setDefaultEncoding=function(ee){if(typeof ee=="string"&&(ee=ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ee+"").toLowerCase())>-1))throw new x(ee);return this._writableState.defaultEncoding=ee,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function y(V,ee,ne){return!V.objectMode&&V.decodeStrings!==!1&&typeof ee=="string"&&(ee=e.from(ee,ne)),ee}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function I(V,ee,ne,K,ue,te){if(!ne){var H=y(ee,K,ue);K!==H&&(ne=!0,ue="buffer",K=H)}var ae=ee.objectMode?1:K.length;ee.length+=ae;var ie=ee.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,g){var x=l.length-1;if(x=0?(A>0&&(T.lastNeed=A-1),A):--x=0?(A>0&&(T.lastNeed=A-2),A):--x=0?(A>0&&(A===2?A=0:T.lastNeed=A-3),A):0))}function r(T,l,g){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,g=r(this,T);if(g!==void 0)return g;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 n(T,l){var g=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=g;var x=T.length-(g-this.lastNeed);return T.copy(this.lastChar,0,x),T.toString("utf8",l,x)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function a(T,l){if((T.length-l)%2===0){var g=T.toString("utf16le",l);if(g){var x=g.charCodeAt(g.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],g.slice(0,-1)}return g}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 g=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,g)}return l}function f(T,l){var g=(T.length-l)%3;return g===0?T.toString("base64",l):(this.lastNeed=3-g,this.lastTotal=3,g===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-g))}function c(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function p(T){return T.toString(this.encoding)}function d(T){return T&&T.length?this.write(T):""}}}),Sm=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"($,G){var h=Am().codes.ERR_STREAM_PREMATURE_CLOSE;function b(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,n=new Array(o),i=0;i0)if(typeof H!="string"&&!Ae.objectMode&&Object.getPrototypeOf(H)!==E.prototype&&(H=t(H)),ie)Ae.endEmitted?M(te,new l):y(te,Ae,H,!0);else if(Ae.ended)M(te,new d);else{if(Ae.destroyed)return!1;Ae.reading=!1,Ae.decoder&&!ae?(H=Ae.decoder.write(H),Ae.objectMode||H.length!==0?y(te,Ae,H,!1):U(te,Ae)):y(te,Ae,H,!1)}else ie||(Ae.reading=!1,U(te,Ae))}return!Ae.ended&&(Ae.length=L?te=L:(te--,te|=te>>>1,te|=te>>>2,te|=te>>>4,te|=te>>>8,te|=te>>>16,te++),te}function F(te,H){return te<=0||H.length===0&&H.ended?0:H.objectMode?1:te!==te?H.flowing&&H.length?H.buffer.head.data.length:H.length:(te>H.highWaterMark&&(H.highWaterMark=z(te)),te<=H.length?te:H.ended?H.length:(H.needReadable=!0,0))}u.prototype.read=function(te){n("read",te),te=parseInt(te,10);var H=this._readableState,ae=te;if(te!==0&&(H.emittedReadable=!1),te===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return n("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?ne(this):B(this),null;if(te=F(te,H),te===0&&H.ended)return H.length===0&&ne(this),null;var ie=H.needReadable;n("need readable",ie),(H.length===0||H.length-te0?ve=ee(te,H):ve=null,ve===null?(H.needReadable=H.length<=H.highWaterMark,te=0):(H.length-=te,H.awaitDrain=0),H.length===0&&(H.ended||(H.needReadable=!0),ae!==te&&H.ended&&ne(this)),ve!==null&&this.emit("data",ve),ve};function N(te,H){if(n("onEofChunk"),!H.ended){if(H.decoder){var ae=H.decoder.end();ae&&ae.length&&(H.buffer.push(ae),H.length+=H.objectMode?1:ae.length)}H.ended=!0,H.sync?B(te):(H.needReadable=!1,H.emittedReadable||(H.emittedReadable=!0,R(te)))}}function B(te){var H=te._readableState;n("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(n("emitReadable",H.flowing),H.emittedReadable=!0,process.nextTick(R,te))}function R(te){var H=te._readableState;n("emitReadable_",H.destroyed,H.length,H.ended),!H.destroyed&&(H.length||H.ended)&&(te.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,V(te)}function U(te,H){H.readingMore||(H.readingMore=!0,process.nextTick(j,te,H))}function j(te,H){for(;!H.reading&&!H.ended&&(H.length1&&ue(ie.pipes,te)!==-1)&&!Ye&&(n("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function nt(pe){n("onerror",pe),Te(),te.removeListener("error",nt),b(te,"error")===0&&M(te,pe)}w(te,"error",nt);function Qe(){te.removeListener("finish",Le),Te()}te.once("close",Qe);function Le(){n("onfinish"),te.removeListener("close",Qe),Te()}te.once("finish",Le);function Te(){n("unpipe"),ae.unpipe(te)}return te.emit("pipe",ae),ie.flowing||(n("pipe resume"),ae.resume()),te};function Z(te){return function(){var ae=te._readableState;n("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&b(te,"data")&&(ae.flowing=!0,V(te))}}u.prototype.unpipe=function(te){var H=this._readableState,ae={hasUnpiped:!1};if(H.pipesCount===0)return this;if(H.pipesCount===1)return te&&te!==H.pipes?this:(te||(te=H.pipes),H.pipes=null,H.pipesCount=0,H.flowing=!1,te&&te.emit("unpipe",this,ae),this);if(!te){var ie=H.pipes,ve=H.pipesCount;H.pipes=null,H.pipesCount=0,H.flowing=!1;for(var Ae=0;Ae0,ie.flowing!==!1&&this.resume()):te==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,n("on readable",ie.length,ie.reading),ie.length?B(this):ie.reading||process.nextTick(fe,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(te,H){var ae=S.prototype.removeListener.call(this,te,H);return te==="readable"&&process.nextTick(re,this),ae},u.prototype.removeAllListeners=function(te){var H=S.prototype.removeAllListeners.apply(this,arguments);return(te==="readable"||te===void 0)&&process.nextTick(re,this),H};function re(te){var H=te._readableState;H.readableListening=te.listenerCount("readable")>0,H.resumeScheduled&&!H.paused?H.flowing=!0:te.listenerCount("data")>0&&te.resume()}function fe(te){n("readable nexttick read 0"),te.read(0)}u.prototype.resume=function(){var te=this._readableState;return te.flowing||(n("resume"),te.flowing=!te.readableListening,le(this,te)),te.paused=!1,this};function le(te,H){H.resumeScheduled||(H.resumeScheduled=!0,process.nextTick(ce,te,H))}function ce(te,H){n("resume",H.reading),H.reading||te.read(0),H.resumeScheduled=!1,te.emit("resume"),V(te),H.flowing&&!H.reading&&te.read(0)}u.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 V(te){var H=te._readableState;for(n("flow",H.flowing);H.flowing&&te.read()!==null;);}u.prototype.wrap=function(te){var H=this,ae=this._readableState,ie=!1;te.on("end",function(){if(n("wrapped end"),ae.decoder&&!ae.ended){var Ce=ae.decoder.end();Ce&&Ce.length&&H.push(Ce)}H.push(null)}),te.on("data",function(Ce){if(n("wrapped data"),ae.decoder&&(Ce=ae.decoder.write(Ce)),!(ae.objectMode&&Ce==null)&&!(!ae.objectMode&&(!Ce||!Ce.length))){var Fe=H.push(Ce);Fe||(ie=!0,te.pause())}});for(var ve in te)this[ve]===void 0&&typeof te[ve]=="function"&&(this[ve]=(function(Fe){return function(){return te[Fe].apply(te,arguments)}})(ve));for(var Ae=0;Ae<_.length;Ae++)te.on(_[Ae],this.emit.bind(this,_[Ae]));return this._read=function(Ce){n("wrapped _read",Ce),ie&&(ie=!1,te.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=r_()),x(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(H){this._readableState&&(this._readableState.flowing=H)}}),u._fromList=ee,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ee(te,H){if(H.length===0)return null;var ae;return H.objectMode?ae=H.buffer.shift():!te||te>=H.length?(H.decoder?ae=H.buffer.join(""):H.buffer.length===1?ae=H.buffer.first():ae=H.buffer.concat(H.length),H.buffer.clear()):ae=H.buffer.consume(te,H.decoder),ae}function ne(te){var H=te._readableState;n("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,process.nextTick(K,H,te))}function K(te,H){if(n("endReadableNT",te.endEmitted,te.length),!te.endEmitted&&te.length===0&&(te.endEmitted=!0,H.readable=!1,H.emit("end"),te.autoDestroy)){var ae=H._writableState;(!ae||ae.autoDestroy&&ae.finished)&&H.destroy()}}typeof Symbol=="function"&&(u.from=function(te,H){return A===void 0&&(A=Rd()),A(u,te,H)});function ue(te,H){for(var ae=0,ie=te.length;ae0;return o(g,A,M,function(_){T||(T=_),_&&l.forEach(n),!A&&(l.forEach(n),d(T))})});return c.reduce(i)}G.exports=s}}),vb=Ge({"node_modules/stream-browserify/index.js"($,G){G.exports=S;var h=P0().EventEmitter,b=yp();b(S,h),S.Readable=fb(),S.Writable=G0(),S.Duplex=_p(),S.Transform=n_(),S.PassThrough=fA(),S.finished=Sm(),S.pipeline=hb(),S.Stream=S;function S(){h.call(this)}S.prototype.pipe=function(E,e){var t=this;function r(c){E.writable&&E.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",a));var n=!1;function i(){n||(n=!0,E.end())}function a(){n||(n=!0,typeof E.destroy=="function"&&E.destroy())}function s(c){if(f(),h.listenerCount(this,"error")===0)throw c}t.on("error",s),E.on("error",s);function f(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",a),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",f),t.removeListener("close",f),E.removeListener("close",f)}return t.on("end",f),t.on("close",f),E.on("close",f),E.emit("pipe",t),E}}}),xp=Ge({"node_modules/util/util.js"($){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return $.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;$.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=$.format.apply($,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),d(Z)?re.showHidden=Z:Z&&$._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}$.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(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&v(Z.inspect)&&Z.inspect!==$.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(v(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",K=!1,ue=["{","}"];if(p(Z)&&(K=!0,ue=["[","]"]),v(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!K||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return K?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,K)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(d(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V-1&&(ce?ee=ee.split(` +`).map(function(K){return" "+K}).join(` +`).slice(2):ee=` +`+ee.split(` +`).map(function(K){return" "+K}).join(` +`))):ee=j.stylize("[Circular]","special")),M(V)){if(ce&&le.match(/^\d+$/))return ee;V=JSON.stringify(""+le),V.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.slice(1,-1),V=j.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=j.stylize(V,"string"))}return V+": "+ee}function c(j,Z,re){var fe=j.reduce(function(le,ce){return ce.indexOf(` +`)>=0,le+ce.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?re[0]+(Z===""?"":Z+` + `)+" "+j.join(`, + `)+" "+re[1]:re[0]+Z+" "+j.join(", ")+" "+re[1]}$.types=ec();function p(j){return Array.isArray(j)}$.isArray=p;function d(j){return typeof j=="boolean"}$.isBoolean=d;function T(j){return j===null}$.isNull=T;function l(j){return j==null}$.isNullOrUndefined=l;function g(j){return typeof j=="number"}$.isNumber=g;function x(j){return typeof j=="string"}$.isString=x;function A(j){return typeof j=="symbol"}$.isSymbol=A;function M(j){return j===void 0}$.isUndefined=M;function _(j){return w(j)&&I(j)==="[object RegExp]"}$.isRegExp=_,$.types.isRegExp=_;function w(j){return typeof j=="object"&&j!==null}$.isObject=w;function m(j){return w(j)&&I(j)==="[object Date]"}$.isDate=m,$.types.isDate=m;function u(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}$.isError=u,$.types.isNativeError=u;function v(j){return typeof j=="function"}$.isFunction=v;function y(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}$.isPrimitive=y,$.isBuffer=Kc();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}$.log=function(){console.log("%s - %s",F(),$.format.apply($,arguments))},$.inherits=yp(),$._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;$.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,K){fe=ne,le=K}),V=[],ee=0;ee"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 i(g){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},i(g)}var a={},s,f;function c(g,x,A){A||(A=Error);function M(w,m,u){return typeof x=="string"?x:x(w,m,u)}var _=(function(w){E(u,w);var m=t(u);function u(v,y,I){var L;return S(this,u),L=m.call(this,M(v,y,I)),L.code=g,L}return b(u)})(A);a[g]=_}function p(g,x){if(Array.isArray(g)){var A=g.length;return g=g.map(function(M){return String(M)}),A>2?"one of ".concat(x," ").concat(g.slice(0,A-1).join(", "),", or ")+g[A-1]:A===2?"one of ".concat(x," ").concat(g[0]," or ").concat(g[1]):"of ".concat(x," ").concat(g[0])}else return"of ".concat(x," ").concat(String(g))}function d(g,x,A){return g.substr(0,x.length)===x}function T(g,x,A){return(A===void 0||A>g.length)&&(A=g.length),g.substring(A-x.length,A)===x}function l(g,x,A){return typeof A!="number"&&(A=0),A+x.length>g.length?!1:g.indexOf(x,A)!==-1}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(g,x,A){s===void 0&&(s=Ay()),s(typeof g=="string","'name' must be a string");var M;typeof x=="string"&&d(x,"not ")?(M="must not be",x=x.replace(/^not /,"")):M="must be";var _;if(T(g," argument"))_="The ".concat(g," ").concat(M," ").concat(p(x,"type"));else{var w=l(g,".")?"property":"argument";_='The "'.concat(g,'" ').concat(w," ").concat(M," ").concat(p(x,"type"))}return _+=". Received type ".concat(h(A)),_},TypeError),c("ERR_INVALID_ARG_VALUE",function(g,x){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=xp());var M=f.inspect(x);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(A,". Received ").concat(M)},TypeError),c("ERR_INVALID_RETURN_VALUE",function(g,x,A){var M;return A&&A.constructor&&A.constructor.name?M="instance of ".concat(A.constructor.name):M="type ".concat(h(A)),"Expected ".concat(g,' to be returned from the "').concat(x,'"')+" function but got ".concat(M,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var g=arguments.length,x=new Array(g),A=0;A0,"At least one arg needs to be specified");var M="The ",_=x.length;switch(x=x.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(x[0]," argument");break;case 2:M+="".concat(x[0]," and ").concat(x[1]," arguments");break;default:M+=x.slice(0,_-1).join(", "),M+=", and ".concat(x[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=a}}),Mm=Ge({"node_modules/assert/build/internal/assert/assertion_error.js"($,G){function h(U,j){var Z=Object.keys(U);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(U);j&&(re=re.filter(function(fe){return Object.getOwnPropertyDescriptor(U,fe).enumerable})),Z.push.apply(Z,re)}return Z}function b(U){for(var j=1;j"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(U){return Function.toString.call(U).indexOf("[native code]")!==-1}function T(U,j){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(re,fe){return re.__proto__=fe,re},T(U,j)}function l(U){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(U)}function g(U){"@babel/helpers - typeof";return g=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},g(U)}var x=xp(),A=x.inspect,M=av(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(U,j,Z){return(Z===void 0||Z>U.length)&&(Z=U.length),U.substring(Z-j.length,Z)===j}function m(U,j){if(j=Math.floor(j),U.length==0||j==0)return"";var Z=U.length*j;for(j=Math.floor(Math.log(j)/Math.log(2));j;)U+=U,j--;return U+=U.substring(0,Z-U.length),U}var u="",v="",y="",I="",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(U){var j=Object.keys(U),Z=Object.create(Object.getPrototypeOf(U));return j.forEach(function(re){Z[re]=U[re]}),Object.defineProperty(Z,"message",{value:U.message}),Z}function N(U){return A(U,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(U,j,Z){var re="",fe="",le=0,ce="",V=!1,ee=N(U),ne=ee.split(` +`),K=N(j).split(` +`),ue=0,te="";if(Z==="strictEqual"&&g(U)==="object"&&g(j)==="object"&&U!==null&&j!==null&&(Z="strictEqualObject"),ne.length===1&&K.length===1&&ne[0]!==K[0]){var H=ne[0].length+K[0].length;if(H<=z){if((g(U)!=="object"||U===null)&&(g(j)!=="object"||j===null)&&(U!==0||j!==0))return"".concat(L[Z],` + +`)+"".concat(ne[0]," !== ").concat(K[0],` +`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(H2&&(te=` + `.concat(m(" ",ue),"^"),ue=0)}}}for(var ie=ne[ne.length-1],ve=K[K.length-1];ie===ve&&(ue++<2?ce=` + `.concat(ie).concat(ce):re=ie,ne.pop(),K.pop(),!(ne.length===0||K.length===0));)ie=ne[ne.length-1],ve=K[K.length-1];var Ae=Math.max(ne.length,K.length);if(Ae===0){var Ce=ee.split(` +`);if(Ce.length>30)for(Ce[26]="".concat(u,"...").concat(I);Ce.length>27;)Ce.pop();return"".concat(L.notIdentical,` + +`).concat(Ce.join(` +`),` +`)}ue>3&&(ce=` +`.concat(u,"...").concat(I).concat(ce),V=!0),re!==""&&(ce=` + `.concat(re).concat(ce),re="");var Fe=0,ze=L[Z]+` +`.concat(v,"+ actual").concat(I," ").concat(y,"- expected").concat(I),Ye=" ".concat(u,"...").concat(I," Lines skipped");for(ue=0;ue1&&ue>2&&(it>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` + `.concat(K[ue-2]),Fe++),fe+=` + `.concat(K[ue-1]),Fe++),le=ue,re+=` +`.concat(y,"-").concat(I," ").concat(K[ue]),Fe++;else if(K.length1&&ue>2&&(it>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` + `.concat(ne[ue-2]),Fe++),fe+=` + `.concat(ne[ue-1]),Fe++),le=ue,fe+=` +`.concat(v,"+").concat(I," ").concat(ne[ue]),Fe++;else{var st=K[ue],nt=ne[ue],Qe=nt!==st&&(!w(nt,",")||nt.slice(0,-1)!==st);Qe&&w(st,",")&&st.slice(0,-1)===nt&&(Qe=!1,nt+=","),Qe?(it>1&&ue>2&&(it>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` + `.concat(ne[ue-2]),Fe++),fe+=` + `.concat(ne[ue-1]),Fe++),le=ue,fe+=` +`.concat(v,"+").concat(I," ").concat(nt),re+=` +`.concat(y,"-").concat(I," ").concat(st),Fe+=2):(fe+=re,re="",(it===1||ue===0)&&(fe+=` + `.concat(nt),Fe++))}if(Fe>20&&ue30)for(H[26]="".concat(u,"...").concat(I);H.length>27;)H.pop();H.length===1?le=Z.call(this,"".concat(te," ").concat(H[0])):le=Z.call(this,"".concat(te,` + +`).concat(H.join(` +`),` +`))}else{var ae=N(ne),ie="",ve=L[V];V==="notDeepEqual"||V==="notEqual"?(ae="".concat(L[V],` + +`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(N(K)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),V==="deepEqual"||V==="equal"?ae="".concat(ve,` + +`).concat(ae,` + +should equal + +`):ie=" ".concat(V," ").concat(ie)),le=Z.call(this,"".concat(ae).concat(ie))}return Error.stackTraceLimit=ue,le.generatedMessage=!ce,Object.defineProperty(s(le),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),le.code="ERR_ASSERTION",le.actual=ne,le.expected=K,le.operator=V,Error.captureStackTrace&&Error.captureStackTrace(s(le),ee),le.stack,le.name="AssertionError",a(le)}return t(re,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:j,value:function(le,ce){return A(this,b(b({},ce),{},{customInspect:!1,depth:0}))}}]),re})(f(Error),A.custom);G.exports=R}}),bg=Ge({"node_modules/object-keys/isArguments.js"($,G){var h=Object.prototype.toString;G.exports=function(S){var E=h.call(S),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&S!==null&&typeof S=="object"&&typeof S.length=="number"&&S.length>=0&&h.call(S.callee)==="[object Function]"),e}}}),X0=Ge({"node_modules/object-keys/implementation.js"($,G){var h;Object.keys||(b=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=bg(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(f){var c=f.constructor;return c&&c.prototype===f},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!i["$"+f]&&b.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{n(window[f])}catch{return!0}}catch{return!0}return!1})(),s=function(f){if(typeof window>"u"||!a)return n(f);try{return n(f)}catch{return!1}},h=function(c){var p=c!==null&&typeof c=="object",d=S.call(c)==="[object Function]",T=E(c),l=p&&S.call(c)==="[object String]",g=[];if(!p&&!d&&!T)throw new TypeError("Object.keys called on a non-object");var x=r&&d;if(l&&c.length>0&&!b.call(c,0))for(var A=0;A0)for(var M=0;M2?arguments[2]:{},c=h(s);b&&(c=E.call(c,Object.getOwnPropertySymbols(s)));for(var p=0;pQe.length)&&(Le=Qe.length);for(var Te=0,pe=new Array(Le);Te10)return!0;for(var Le=0;Le57)return!0}return Qe.length===10&&Qe>=Math.pow(2,32)}function R(Qe){return Object.keys(Qe).filter(B).concat(s(Qe).filter(Object.prototype.propertyIsEnumerable.bind(Qe)))}function U(Qe,Le){if(Qe===Le)return 0;for(var Te=Qe.length,pe=Le.length,Ne=0,ot=Math.min(Te,pe);Ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne0)return t(i);if(s==="number"&&isNaN(i)===!1)return a.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*S;case"minutes":case"minute":case"mins":case"min":case"m":return s*b;case"seconds":case"second":case"secs":case"sec":case"s":return s*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=S?Math.round(i/S)+"h":i>=b?Math.round(i/b)+"m":i>=h?Math.round(i/h)+"s":i+"ms"}function o(i){return n(i,E,"day")||n(i,S,"hour")||n(i,b,"minute")||n(i,h,"second")||i+" ms"}function n(i,a,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}$.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function b(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+$.humanize(this.diff),!!o){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var i=0,a=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(a=i))}),r.splice(a,0,n)}}function S(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?$.storage.removeItem("debug"):$.storage.debug=r}catch{}}function e(){var r;try{r=$.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ht.DEBUG),r}$.enable(e());function t(){try{return window.localStorage}catch{}}}}),mA=Ge({"node_modules/stream-parser/index.js"($,G){var h=Ay(),b=pA()("stream-parser");G.exports=r;var S=-1,E=0,e=1,t=2;function r(l){var g=l&&typeof l._transform=="function",x=l&&typeof l._write=="function";if(!g&&!x)throw new Error("must pass a Writable or Transform stream in");b("extending Parser into stream"),l._bytes=n,l._skipBytes=i,g&&(l._passthrough=a),g?l._transform=f:l._write=s}function o(l){b("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=S,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function n(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),b("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=E}function i(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=e}function a(l,g){h(!this._parserCallback,'There is already a "callback" set!'),h(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=t}function s(l,g,x){this._parserInit||o(this),b("write(%o bytes)",l.length),typeof g=="function"&&(x=g),d(this,l,null,x)}function f(l,g,x){this._parserInit||o(this),b("transform(%o bytes)",l.length),typeof g!="function"&&(g=this._parserOutput),d(this,l,g,x)}function c(l,g,x,A){return l._parserBytesLeft<=0?A(new Error("got data but not currently parsing anything")):g.length<=l._parserBytesLeft?function(){return p(l,g,x,A)}:function(){var M=g.slice(0,l._parserBytesLeft);return p(l,M,x,function(_){if(_)return A(_);if(g.length>M.length)return function(){return c(l,g.slice(M.length),x,A)}})}}function p(l,g,x,A){if(l._parserBytesLeft-=g.length,b("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(g),l._parserBuffered+=g.length):l._parserState===t&&x(g),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(g=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(g=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=S,l._parserBuffers.splice(0),M){var _=[];g&&_.push(g),x&&_.push(x);var w=M.length>_.length;w&&_.push(T(A));var m=M.apply(l,_);if(!w||A===m)return A}}else return A}var d=T(c);function T(l){return function(){for(var g=l.apply(this,arguments);typeof g=="function";)g=g();return g}}}}),Ec=Ge({"node_modules/probe-image-size/lib/common.js"($){var G=vb().Transform,h=mA();function b(){G.call(this,{readableObjectMode:!0})}b.prototype=Object.create(G.prototype),b.prototype.constructor=b,h(b.prototype),$.ParserStream=b,$.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,c=a[4]&15,p=a[5]>>4&15,d=h(a,6),T=8,l=0;ld.width||p.width===d.width&&p.height>d.height?p:d}),f=a.reduce(function(p,d){return p.height>d.height||p.height===d.height&&p.width>d.width?p:d}),c;return s.width>f.height||s.width===f.height&&s.height>f.width?c=s:c=f,c}G.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var f=i(s.sizes),c=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?c=l[c]:(c=l[c],c=T[c],c=T[c])),d.type==="irot")for(var g=0;g0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},S.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},S.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},S.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},S.prototype.exif_format_length=function(E){switch(E){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}},S.prototype.exif_format_read=function(E,e){var t;switch(E){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}},S.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw h("unexpected EOF","EBADDATA");for(var d=[],T=c,l=0;l0&&(this.ifds_to_read.push({id:n,offset:d[0]}),p=!0);var x={is_big_endian:this.big_endian,ifd:E,tag:n,format:i,count:a,entry_offset:e+this.start,data_length:f,data_offset:c+this.start,value:d,is_subifd_link:p};if(t(x)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=S,G.exports.get_orientation=function(E){var e=0;try{return new S(E,0,E.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}}}}),VM=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"($,G){var h=Ec().str2arr,b=Ec().sliceEq,S=Ec().readUInt32BE,E=mb(),e=i_(),t=h("ftyp");G.exports=function(r){if(b(r,4,t)){var o=E.unbox(r,0);if(o){var n=E.getMimeType(o.data);if(n){for(var i,a=o.end;;){var s=E.unbox(r,a);if(!s)break;if(a=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var f=E.readSizeFromMeta(i);if(f){var c={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(c.variants=f.variants),f.orientation&&(c.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var p=S(r,f.exif_location.offset),d=r.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),T=e.get_orientation(d);T>0&&(c.orientation=T)}return c}}}}}}}}),HM=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"($,G){var h=Ec().str2arr,b=Ec().sliceEq,S=Ec().readUInt16LE,E=h("BM");G.exports=function(e){if(!(e.length<26)&&b(e,0,E))return{width:S(e,18),height:S(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),GM=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"($,G){var h=Ec().str2arr,b=Ec().sliceEq,S=Ec().readUInt16LE,E=h("GIF87a"),e=h("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!b(t,0,E)&&!b(t,0,e)))return{width:S(t,6),height:S(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),gA=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"($,G){var h=Ec().readUInt16LE,b=0,S=1,E=16;G.exports=function(e){var t=h(e,0),r=h(e,2),o=h(e,4);if(!(t!==b||r!==S||!o)){for(var n=[],i={width:0,height:0},a=0;ai.width||f>i.height)&&(i=c)}return{width:i.width,height:i.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),yA=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"($,G){var h=Ec().readUInt16BE,b=Ec().str2arr,S=Ec().sliceEq,E=i_(),e=b("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],n;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)n=0;else if(192<=o&&o<=254){if(t.length-r<2)return;n=h(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&n>=10&&S(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+n))),n>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(a.orientation=i),a}r+=n}}}}),My=Ge({"node_modules/probe-image-size/lib/parse_sync/png.js"($,G){var h=Ec().str2arr,b=Ec().sliceEq,S=Ec().readUInt32BE,E=h(`‰PNG\r + +`),e=h("IHDR");G.exports=function(t){if(!(t.length<24)&&b(t,0,E)&&b(t,12,e))return{width:S(t,16),height:S(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gb=Ge({"node_modules/probe-image-size/lib/parse_sync/psd.js"($,G){var h=Ec().str2arr,b=Ec().sliceEq,S=Ec().readUInt32BE,E=h("8BPS\0");G.exports=function(e){if(!(e.length<22)&&b(e,0,E))return{width:S(e,18),height:S(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),_A=Ge({"node_modules/probe-image-size/lib/parse_sync/svg.js"($,G){function h(s){return s===32||s===9||s===13||s===10}function b(s){return typeof s=="number"&&isFinite(s)&&s>0}function S(s){var f=0,c=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var f=s.match(t),c=s.match(r),p=s.match(o);return{width:f&&(f[1]||f[2]),height:c&&(c[1]||c[2]),viewbox:p&&(p[1]||p[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}G.exports=function(s){if(S(s)){for(var f="",c=0;c>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(a,s){return{width:(a[s+6]<<16|a[s+5]<<8|a[s+4])+1,height:(a[s+9]<a.length)){for(;s+8=10?f=f||o(a,s+8):d==="VP8L"&&T>=9?f=f||n(a,s+8):d==="VP8X"&&T>=10?f=f||i(a,s+8):d==="EXIF"&&(c=e.get_orientation(a.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(f)return c>0&&(f.orientation=c),f}}}}}),wA=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"($,G){G.exports={avif:VM(),bmp:HM(),gif:GM(),ico:gA(),jpeg:yA(),png:My(),psd:gb(),svg:_A(),tiff:xA(),webp:bA()}}}),TA=Ge({"node_modules/probe-image-size/sync.js"($,G){var h=wA();function b(S){for(var E=Object.keys(h),e=0;e0;)I=f.c2p(M+N*u),N--;for(N=0;z===void 0&&N0;)F=c.c2p(_+N*v),N--;if(IV[0];if(ee||ne){var K=y+R/2,ue=z+U/2;le+="transform:"+S(K+"px",ue+"px")+"scale("+(ee?-1:1)+","+(ne?-1:1)+")"+S(-K+"px",-ue+"px")+";"}}fe.attr("style",le);var te=new Promise(function(H){if(g._hasZ)H();else if(g._hasSource)if(g._canvas&&g._canvas.el.width===w&&g._canvas.el.height===m&&g._canvas.source===g.source)H();else{var ae=document.createElement("canvas");ae.width=w,ae.height=m;var ie=ae.getContext("2d",{willReadFrequently:!0});g._image=g._image||new Image;var ve=g._image;ve.onload=function(){ie.drawImage(ve,0,0),g._canvas={el:ae,source:g.source},H()},ve.setAttribute("src",g.source)}}).then(function(){var H,ae;if(g._hasZ)ae=re(function(Ae,Ce){var Fe=A[Ce][Ae];return b.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),H=ae.toDataURL("image/png");else if(g._hasSource)if(x)H=g.source;else{var ie=g._canvas.el.getContext("2d",{willReadFrequently:!0}),ve=ie.getImageData(0,0,w,m).data;ae=re(function(Ae,Ce){var Fe=4*(Ce*w+Ae);return[ve[Fe],ve[Fe+1],ve[Fe+2],ve[Fe+3]]}),H=ae.toDataURL("image/png")}fe.attr({"xlink:href":H,height:U,width:R,x:y,y:z})});n._promises.push(te)})}}}),MA=Ge({"src/traces/image/style.js"($,G){var h=Mi();G.exports=function(S){h.select(S).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),of=Ge({"src/traces/image/hover.js"($,G){var h=jf(),b=gn(),S=b.isArrayOrTypedArray,E=gp();G.exports=function(t,r,o){var n=t.cd[0],i=n.trace,a=t.xa,s=t.ya;if(!(h.inbox(r-n.x0,r-(n.x0+n.w*i.dx),0)>0||h.inbox(o-n.y0,o-(n.y0+n.h*i.dy),0)>0)){var f=Math.floor((r-n.x0)/i.dx),c=Math.floor(Math.abs(o-n.y0)/i.dy),p;if(i._hasZ?p=n.z[c][f]:i._hasSource&&(p=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,c,1,1).data),!!p){var d=n.hi||i.hoverinfo,T;if(d){var l=d.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var g=E.colormodel[i.colormodel],x=g.colormodel||i.colormodel,A=x.length,M=i._scaler(p),_=g.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),A===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=x.toUpperCase()+": "+w);var m;S(i.hovertext)&&S(i.hovertext[c])?m=i.hovertext[c][f]:S(i.text)&&S(i.text[c])&&(m=i.text[c][f]);var u=s.c2p(n.y0+(c+.5)*i.dy),v=n.x0+(f+.5)*i.dx,y=n.y0+(c+.5)*i.dy,I="["+p.slice(0,i.colormodel.length).join(", ")+"]";return[b.extendFlat(t,{index:[c,f],x0:a.c2p(n.x0+f*i.dx),x1:a.c2p(n.x0+(f+1)*i.dx),y0:u,y1:u,color:M,xVal:v,xLabelVal:v,yVal:y,yLabelVal:y,zLabelVal:I,text:m,hovertemplateLabels:{zLabel:I,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),s3=Ge({"src/traces/image/event_data.js"($,G){G.exports=function(b,S){return"xVal"in S&&(b.x=S.xVal),"yVal"in S&&(b.y=S.yVal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b.color=S.color,b.colormodel=S.trace.colormodel,b.z||(b.z=S.color),b}}}),XM=Ge({"src/traces/image/index.js"($,G){G.exports={attributes:W2(),supplyDefaults:J5(),calc:yb(),plot:SA(),style:MA(),hoverPoints:of(),eventData:s3(),moduleType:"trace",name:"image",basePlotModule:dh(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),EA=Ge({"lib/image.js"($,G){G.exports=XM()}}),Ey=Ge({"src/traces/pie/attributes.js"($,G){var h=ru(),b=Ac().attributes,S=Hs(),E=th(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Al(),o=Qi().extendFlat,n=fv().pattern,i=S({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.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:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:n,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:o({},h.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:o({},i,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:o({},h.showlegend,{arrayOk:!0}),legend:o({},h.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:o({},i,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:b({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"}}}}),ky=Ge({"src/traces/pie/defaults.js"($,G){var h=Pi(),b=gn(),S=Ey(),E=Ac().defaults,e=kd().handleText,t=gn().coercePattern;function r(i,a){var s=b.isArrayOrTypedArray(i),f=b.isArrayOrTypedArray(a),c=Math.min(s?i.length:1/0,f?a.length:1/0);if(isFinite(c)||(c=0),c&&f){for(var p,d=0;d0){p=!0;break}}p||(c=0)}return{hasLabels:s,hasValues:f,len:c}}function o(i,a,s,f,c){var p=f("marker.line.width");p&&f("marker.line.color",c?void 0:s.paper_bgcolor);var d=f("marker.colors");t(f,"marker.pattern",d),i.marker&&!a.marker.pattern.fgcolor&&(a.marker.pattern.fgcolor=i.marker.colors),a.marker.pattern.bgcolor||(a.marker.pattern.bgcolor=s.paper_bgcolor)}function n(i,a,s,f){function c(y,I){return b.coerce(i,a,S,y,I)}var p=c("labels"),d=c("values"),T=r(p,d),l=T.len;if(a._hasLabels=T.hasLabels,a._hasValues=T.hasValues,!a._hasLabels&&a._hasValues&&(c("label0"),c("dlabel")),!l){a.visible=!1;return}a._length=l,o(i,a,f,c,!0),c("scalegroup");var g=c("text"),x=c("texttemplate");c("texttemplatefallback");var A;if(x||(A=c("textinfo",b.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),x||A&&A!=="none"){var M=c("textposition");e(i,a,f,c,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&c("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&c("insidetextorientation")}else A==="none"&&c("textposition","none");E(a,f,c);var m=c("hole"),u=c("title.text");if(u){var v=c("title.position",m?"middle center":"top center");!m&&v==="middle center"&&(a.title.position="top center"),b.coerceFont(c,"title.font",f.font)}c("sort"),c("direction"),c("rotation"),c("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:n}}}),l3=Ge({"src/traces/pie/layout_attributes.js"($,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),_b=Ge({"src/traces/pie/layout_defaults.js"($,G){var h=gn(),b=l3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),d0=Ge({"src/traces/pie/calc.js"($,G){var h=Pi(),b=Bs(),S=_o(),E={};function e(n,i){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],c=i.labels,p=i.marker.colors||[],d=i.values,T=i._length,l=i._hasValues&&T,g,x;if(i.dlabel)for(c=new Array(T),g=0;g=0});var I=i.type==="funnelarea"?w:i.sort;return I&&a.sort(function(L,z){return z.v-L.v}),a[0]&&(a[0].vTotal=_),a}function t(n){return function(a,s){return!a||(a=b(a),!a.isValid())?!1:(a=S.addOpacity(a,a.getAlpha()),n[s]||(n[s]=a),a)}}function r(n,i){var a=(i||{}).type;a||(a="pie");var s=n._fullLayout,f=n.calcdata,c=s[a+"colorway"],p=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(c=o(c,E));for(var d=0,T=0;T0&&(ot+=Nt*pe.pxmid[0],ct+=Nt*pe.pxmid[1])}pe.cxFinal=ot,pe.cyFinal=ct;function $t(Mt,je,$e,Ee){var xe=Ee*(je[0]-Mt[0]),ye=Ee*(je[1]-Mt[1]);return"a"+Ee*ve.r+","+Ee*ve.r+" 0 "+pe.largeArc+($e?" 1 ":" 0 ")+xe+","+ye}var rr=Ae.hole;if(pe.v===ve.vTotal){var Mr="M"+(ot+pe.px0[0])+","+(ct+pe.px0[1])+$t(pe.px0,pe.pxmid,!0,1)+$t(pe.pxmid,pe.px0,!0,1)+"Z";rr?Ft.attr("d","M"+(ot+rr*pe.px0[0])+","+(ct+rr*pe.px0[1])+$t(pe.px0,pe.pxmid,!1,rr)+$t(pe.pxmid,pe.px0,!1,rr)+"Z"+Mr):Ft.attr("d",Mr)}else{var Sr=$t(pe.px0,pe.px1,!0,1);if(rr){var Zr=1-rr;Ft.attr("d","M"+(ot+rr*pe.px1[0])+","+(ct+rr*pe.px1[1])+$t(pe.px1,pe.px0,!1,rr)+"l"+Zr*pe.px0[0]+","+Zr*pe.px0[1]+Sr+"Z")}else Ft.attr("d","M"+ot+","+ct+"l"+pe.px0[0]+","+pe.px0[1]+Sr+"Z")}ce(ee,pe,ve);var Ar=c.castOption(Ae.textposition,pe.pts),Br=rt.selectAll("g.slicetext").data(pe.text&&Ar!=="none"?[0]:[]);Br.enter().append("g").classed("slicetext",!0),Br.exit().remove(),Br.each(function(){var Mt=t.ensureSingle(h.select(this),"text","",function(Je){Je.attr("data-notex",1)}),je=t.ensureUniformFontSize(ee,Ar==="outside"?x(Ae,pe,ue.font):A(Ae,pe,ue.font));Mt.text(pe.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,je).call(n.convertToTspans,ee);var $e=e.bBox(Mt.node()),Ee;if(Ar==="outside")Ee=z($e,pe);else if(Ee=_($e,pe,ve),Ar==="auto"&&Ee.scale<1){var xe=t.ensureUniformFontSize(ee,Ae.outsidetextfont);Mt.call(e.font,xe),$e=e.bBox(Mt.node()),Ee=z($e,pe)}var ye=Ee.textPosAngle,Me=ye===void 0?pe.pxmid:le(ve.r,ye);if(Ee.targetX=ot+Me[0]*Ee.rCenter+(Ee.x||0),Ee.targetY=ct+Me[1]*Ee.rCenter+(Ee.y||0),V(Ee,$e),Ee.outside){var Xe=Ee.targetY;pe.yLabelMin=Xe-$e.height/2,pe.yLabelMid=Xe,pe.yLabelMax=Xe+$e.height/2,pe.labelExtraX=0,pe.labelExtraY=0,ze=!0}Ee.fontSize=je.size,a(Ae.type,Ee,ue),ae[Ne].transform=Ee,t.setTransormAndDisplay(Mt,Ee)})});var Ye=h.select(this).selectAll("g.titletext").data(Ae.title.text?[0]:[]);if(Ye.enter().append("g").classed("titletext",!0),Ye.exit().remove(),Ye.each(function(){var pe=t.ensureSingle(h.select(this),"text","",function(ct){ct.attr("data-notex",1)}),Ne=Ae.title.text;Ae._meta&&(Ne=t.templateString(Ne,Ae._meta)),pe.text(Ne).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,Ae.title.font).call(n.convertToTspans,ee);var ot;Ae.title.position==="middle center"?ot=F(ve):ot=N(ve,te),pe.attr("transform",o(ot.x,ot.y)+r(Math.min(1,ot.scale))+o(ot.tx,ot.ty))}),ze&&j(Fe,Ae),l(Ce,Ae),ze&&Ae.automargin){var it=e.bBox(ie.node()),st=Ae.domain,nt=te.w*(st.x[1]-st.x[0]),Qe=te.h*(st.y[1]-st.y[0]),Le=(.5*nt-ve.r)/te.w,Te=(.5*Qe-ve.r)/te.h;b.autoMargin(ee,"pie."+Ae.uid+".automargin",{xl:st.x[0]-Le,xr:st.x[1]+Le,yb:st.y[0]-Te,yt:st.y[1]+Te,l:Math.max(ve.cx-ve.r-it.left,0),r:Math.max(it.right-(ve.cx+ve.r),0),b:Math.max(it.bottom-(ve.cy+ve.r),0),t:Math.max(ve.cy-ve.r-it.top,0),pad:5})}})});setTimeout(function(){H.selectAll("tspan").each(function(){var ae=h.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(ee,ne){ee.each(function(K){var ue=h.select(this);if(!K.labelExtraX&&!K.labelExtraY){ue.select("path.textline").remove();return}var te=ue.select("g.slicetext text");K.transform.targetX+=K.labelExtraX,K.transform.targetY+=K.labelExtraY,t.setTransormAndDisplay(te,K.transform);var H=K.cxFinal+K.pxmid[0],ae=K.cyFinal+K.pxmid[1],ie="M"+H+","+ae,ve=(K.yLabelMax-K.yLabelMin)*(K.pxmid[0]<0?-1:1)/4;if(K.labelExtraX){var Ae=K.labelExtraX*K.pxmid[1]/K.pxmid[0],Ce=K.yLabelMid+K.labelExtraY-(K.cyFinal+K.pxmid[1]);Math.abs(Ae)>Math.abs(Ce)?ie+="l"+Ce*K.pxmid[0]/K.pxmid[1]+","+Ce+"H"+(H+K.labelExtraX+ve):ie+="l"+K.labelExtraX+","+Ae+"v"+(Ce-Ae)+"h"+ve}else ie+="V"+(K.yLabelMid+K.labelExtraY)+"h"+ve;t.ensureSingle(ue,"path","textline").call(E.stroke,ne.outsidetextfont.color).attr({"stroke-width":Math.min(2,ne.outsidetextfont.size/8),d:ie,fill:"none"})})}function g(ee,ne,K){var ue=K[0],te=ue.cx,H=ue.cy,ae=ue.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),ee.on("mouseover",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index];if(!(ne._dragging||Ae.hovermode===!1)){var Fe=Ce.hoverinfo;if(Array.isArray(Fe)&&(Fe=S.castHoverinfo({hoverinfo:[c.castOption(Fe,ve.pts)],_module:ae._module},Ae,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Ce.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var ze=ve.rInscribed||0,Ye=te+ve.pxmid[0]*(1-ze),it=H+ve.pxmid[1]*(1-ze),st=Ae.separators,nt=[];if(Fe&&Fe.indexOf("label")!==-1&&nt.push(ve.label),ve.text=c.castOption(Ce.hovertext||Ce.text,ve.pts),Fe&&Fe.indexOf("text")!==-1){var Qe=ve.text;t.isValidTextValue(Qe)&&nt.push(Qe)}ve.value=ve.v,ve.valueLabel=c.formatPieValue(ve.v,st),Fe&&Fe.indexOf("value")!==-1&&nt.push(ve.valueLabel),ve.percent=ve.v/ue.vTotal,ve.percentLabel=c.formatPiePercent(ve.percent,st),Fe&&Fe.indexOf("percent")!==-1&&nt.push(ve.percentLabel);var Le=Ce.hoverlabel,Te=Le.font,pe=[];S.loneHover({trace:ae,x0:Ye-ze*ue.r,x1:Ye+ze*ue.r,y:it,_x0:ie?te+ve.TL[0]:Ye-ze*ue.r,_x1:ie?te+ve.TR[0]:Ye+ze*ue.r,_y0:ie?H+ve.TL[1]:it-ze*ue.r,_y1:ie?H+ve.BL[1]:it+ze*ue.r,text:nt.join("
"),name:Ce.hovertemplate||Fe.indexOf("name")!==-1?Ce.name:void 0,idealAlign:ve.pxmid[0]<0?"left":"right",color:c.castOption(Le.bgcolor,ve.pts)||ve.color,borderColor:c.castOption(Le.bordercolor,ve.pts),fontFamily:c.castOption(Te.family,ve.pts),fontSize:c.castOption(Te.size,ve.pts),fontColor:c.castOption(Te.color,ve.pts),nameLength:c.castOption(Le.namelength,ve.pts),textAlign:c.castOption(Le.align,ve.pts),hovertemplate:c.castOption(Ce.hovertemplate,ve.pts),hovertemplateLabels:ve,eventData:[p(ve,Ce)]},{container:Ae._hoverlayer.node(),outerContainer:Ae._paper.node(),gd:ne,inOut_bbox:pe}),ve.bbox=pe[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,ne.emit("plotly_hover",{points:[p(ve,Ce)],event:h.event})}}),ee.on("mouseout",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index],Fe=h.select(this).datum();ae._hasHoverEvent&&(ve.originalEvent=h.event,ne.emit("plotly_unhover",{points:[p(Fe,Ce)],event:h.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(S.loneUnhover(Ae._hoverlayer.node()),ae._hasHoverLabel=!1)}),ee.on("click",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index];ne._dragging||Ae.hovermode===!1||(ne._hoverdata=[p(ve,Ce)],S.click(ne,h.event))})}function x(ee,ne,K){var ue=c.castOption(ee.outsidetextfont.color,ne.pts)||c.castOption(ee.textfont.color,ne.pts)||K.color,te=c.castOption(ee.outsidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||K.family,H=c.castOption(ee.outsidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||K.size,ae=c.castOption(ee.outsidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||K.weight,ie=c.castOption(ee.outsidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||K.style,ve=c.castOption(ee.outsidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||K.variant,Ae=c.castOption(ee.outsidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||K.textcase,Ce=c.castOption(ee.outsidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||K.lineposition,Fe=c.castOption(ee.outsidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||K.shadow;return{color:ue,family:te,size:H,weight:ae,style:ie,variant:ve,textcase:Ae,lineposition:Ce,shadow:Fe}}function A(ee,ne,K){var ue=c.castOption(ee.insidetextfont.color,ne.pts);!ue&&ee._input.textfont&&(ue=c.castOption(ee._input.textfont.color,ne.pts));var te=c.castOption(ee.insidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||K.family,H=c.castOption(ee.insidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||K.size,ae=c.castOption(ee.insidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||K.weight,ie=c.castOption(ee.insidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||K.style,ve=c.castOption(ee.insidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||K.variant,Ae=c.castOption(ee.insidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||K.textcase,Ce=c.castOption(ee.insidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||K.lineposition,Fe=c.castOption(ee.insidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||K.shadow;return{color:ue||E.contrast(ne.color),family:te,size:H,weight:ae,style:ie,variant:ve,textcase:Ae,lineposition:Ce,shadow:Fe}}function M(ee,ne){for(var K,ue,te=0;te=-4;Le-=2)Qe(Math.PI*Le,"tan");for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+1),"tan")}if(Fe||Ye){for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+1.5),"rad");for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+.5),"rad")}}if(ie||it||Fe){var Te=Math.sqrt(ee.width*ee.width+ee.height*ee.height);if(nt={scale:te*ue*2/Te,rCenter:1-te,rotate:0},nt.textPosAngle=(ne.startangle+ne.stopangle)/2,nt.scale>=1)return nt;st.push(nt)}(it||Ye)&&(nt=m(ee,ue,ae,ve,Ae),nt.textPosAngle=(ne.startangle+ne.stopangle)/2,st.push(nt)),(it||ze)&&(nt=u(ee,ue,ae,ve,Ae),nt.textPosAngle=(ne.startangle+ne.stopangle)/2,st.push(nt));for(var pe=0,Ne=0,ot=0;ot=1)break}return st[pe]}function w(ee,ne){var K=ee.startangle,ue=ee.stopangle;return K>ne&&ne>ue||K0?1:-1)/2,y:H/(1+K*K/(ue*ue)),outside:!0}}function F(ee){var ne=Math.sqrt(ee.titleBox.width*ee.titleBox.width+ee.titleBox.height*ee.titleBox.height);return{x:ee.cx,y:ee.cy,scale:ee.trace.hole*ee.r*2/ne,tx:0,ty:-ee.titleBox.height/2+ee.trace.title.font.size}}function N(ee,ne){var K=1,ue=1,te,H=ee.trace,ae={x:ee.cx,y:ee.cy},ie={tx:0,ty:0};ie.ty+=H.title.font.size,te=U(H),H.title.position.indexOf("top")!==-1?(ae.y-=(1+te)*ee.r,ie.ty-=ee.titleBox.height):H.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+te)*ee.r);var ve=B(ee.r,ee.trace.aspectratio),Ae=ne.w*(H.domain.x[1]-H.domain.x[0])/2;return H.title.position.indexOf("left")!==-1?(Ae=Ae+ve,ae.x-=(1+te)*ve,ie.tx+=ee.titleBox.width/2):H.title.position.indexOf("center")!==-1?Ae*=2:H.title.position.indexOf("right")!==-1&&(Ae=Ae+ve,ae.x+=(1+te)*ve,ie.tx-=ee.titleBox.width/2),K=Ae/ee.titleBox.width,ue=R(ee,ne)/ee.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min(K,ue),tx:ie.tx,ty:ie.ty}}function B(ee,ne){return ee/(ne===void 0?1:ne)}function R(ee,ne){var K=ee.trace,ue=ne.h*(K.domain.y[1]-K.domain.y[0]);return Math.min(ee.titleBox.height,ue/2)}function U(ee){var ne=ee.pull;if(!ne)return 0;var K;if(t.isArrayOrTypedArray(ne))for(ne=0,K=0;Kne&&(ne=ee.pull[K]);return ne}function j(ee,ne){var K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye,it;function st(Te,pe){return Te.pxmid[1]-pe.pxmid[1]}function nt(Te,pe){return pe.pxmid[1]-Te.pxmid[1]}function Qe(Te,pe){pe||(pe={});var Ne=pe.labelExtraY+(ue?pe.yLabelMax:pe.yLabelMin),ot=ue?Te.yLabelMin:Te.yLabelMax,ct=ue?Te.yLabelMax:Te.yLabelMin,rt=Te.cyFinal+ae(Te.px0[1],Te.px1[1]),Ft=Ne-ot,Nt,$t,rr,Mr,Sr,Zr;if(Ft*ve>0&&(Te.labelExtraY=Ft),!!t.isArrayOrTypedArray(ne.pull))for($t=0;$t=(c.castOption(ne.pull,rr.pts)||0))&&((Te.pxmid[1]-rr.pxmid[1])*ve>0?(Mr=rr.cyFinal+ae(rr.px0[1],rr.px1[1]),Ft=Mr-ot-Te.labelExtraY,Ft*ve>0&&(Te.labelExtraY+=Ft)):(ct+Te.labelExtraY-rt)*ve>0&&(Nt=3*ie*Math.abs($t-Fe.indexOf(Te)),Sr=rr.cxFinal+H(rr.px0[0],rr.px1[0]),Zr=Sr+Nt-(Te.cxFinal+Te.pxmid[0])-Te.labelExtraX,Zr*ie>0&&(Te.labelExtraX+=Zr)))}for(ue=0;ue<2;ue++)for(te=ue?st:nt,ae=ue?Math.max:Math.min,ve=ue?1:-1,K=0;K<2;K++){for(H=K?Math.max:Math.min,ie=K?1:-1,Ae=ee[ue][K],Ae.sort(te),Ce=ee[1-ue][K],Fe=Ce.concat(Ae),Ye=[],ze=0;ze1?(Ae=K.r,Ce=Ae/te.aspectratio):(Ce=K.r,Ae=Ce*te.aspectratio),Ae*=(1+te.baseratio)/2,ve=Ae*Ce}ae=Math.min(ae,ve/K.vTotal)}for(ue=0;uene.vTotal/2?1:0,Ae.halfangle=Math.PI*Math.min(Ae.v/ne.vTotal,.5),Ae.ring=1-ue.hole,Ae.rInscribed=L(Ae,ne))}function le(ee,ne){return[ee*Math.sin(ne),-ee*Math.cos(ne)]}function ce(ee,ne,K){var ue=ee._fullLayout,te=K.trace,H=te.texttemplate,ae=te.textinfo;if(!H&&ae&&ae!=="none"){var ie=ae.split("+"),ve=function(pe){return ie.indexOf(pe)!==-1},Ae=ve("label"),Ce=ve("text"),Fe=ve("value"),ze=ve("percent"),Ye=ue.separators,it;if(it=Ae?[ne.label]:[],Ce){var st=c.getFirstFilled(te.text,ne.pts);d(st)&&it.push(st)}Fe&&it.push(c.formatPieValue(ne.v,Ye)),ze&&it.push(c.formatPiePercent(ne.v/K.vTotal,Ye)),ne.text=it.join("
")}function nt(pe){return{label:pe.label,value:pe.v,valueLabel:c.formatPieValue(pe.v,ue.separators),percent:pe.v/K.vTotal,percentLabel:c.formatPiePercent(pe.v/K.vTotal,ue.separators),color:pe.color,text:pe.text,customdata:t.castOption(te,pe.i,"customdata")}}if(H){var Qe=t.castOption(te,ne.i,"texttemplate");if(!Qe)ne.text="";else{var Le=nt(ne),Te=c.getFirstFilled(te.text,ne.pts);(d(Te)||Te==="")&&(Le.text=Te),ne.text=t.texttemplateString({data:[Le,te._meta],fallback:te.texttemplatefallback,labels:Le,locale:ee._fullLayout._d3locale,template:Qe})}}}function V(ee,ne){var K=ee.rotate*Math.PI/180,ue=Math.cos(K),te=Math.sin(K),H=(ne.left+ne.right)/2,ae=(ne.top+ne.bottom)/2;ee.textX=H*ue-ae*te,ee.textY=H*te+ae*ue,ee.noCenter=!0}G.exports={plot:T,formatSliceLabel:ce,transformInsideText:_,determineInsideTextFont:A,positionTitleOutside:N,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:g,computeTransform:V}}}),c3=Ge({"src/traces/pie/style.js"($,G){var h=Mi(),b=T1(),S=ic().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");S(e,t,"pie"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),km=Ge({"src/traces/pie/base_plot.js"($){var G=Wc();$.name="pie",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),p0=Ge({"src/traces/pie/index.js"($,G){G.exports={attributes:Ey(),supplyDefaults:ky().supplyDefaults,supplyLayoutDefaults:_b(),layoutAttributes:l3(),calc:d0().calc,crossTraceCalc:d0().crossTraceCalc,plot:Cy().plot,style:c3(),styleOne:T1(),moduleType:"trace",name:"pie",basePlotModule:km(),categories:["pie-like","pie","showLegend"],meta:{}}}}),o_=Ge({"lib/pie.js"($,G){G.exports=p0()}}),YM=Ge({"src/traces/sunburst/base_plot.js"($){var G=Wc();$.name="sunburst",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),f3=Ge({"src/traces/sunburst/constants.js"($,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),s_=Ge({"src/traces/sunburst/attributes.js"($,G){var h=ru(),{hovertemplateAttrs:b,texttemplateAttrs:S,templatefallbackAttrs:E}=Al(),e=Pu(),t=Ac().attributes,r=Ey(),o=f3(),n=Qi().extendFlat,i=fv().pattern;G.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:n({colors:{valType:"data_array",editType:"calc"},line:{color:n({},r.marker.line.color,{dflt:null}),width:n({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:i,editType:"calc"},e("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:S({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},h.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:b({},{keys:o.eventDataKeys}),hovertemplatefallback:E(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:n({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}}),h3=Ge({"src/traces/sunburst/layout_attributes.js"($,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),kA=Ge({"src/traces/sunburst/defaults.js"($,G){var h=gn(),b=s_(),S=Ac().defaults,E=kd().handleText,e=ky().handleMarkerDefaults,t=Tc(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,a,s,f){function c(A,M){return h.coerce(i,a,b,A,M)}var p=c("labels"),d=c("parents");if(!p||!p.length||!d||!d.length){a.visible=!1;return}var T=c("values");T&&T.length?c("branchvalues"):c("count"),c("level"),c("maxdepth"),e(i,a,f,c);var l=a._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,a,f,c,{prefix:"marker.",cLetter:"c"}),c("leaf.opacity",l?1:.7);var g=c("text");c("texttemplate"),c("texttemplatefallback"),a.texttemplate||c("textinfo",h.isArrayOrTypedArray(g)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var x="auto";E(i,a,f,c,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("insidetextorientation"),c("sort"),c("rotation"),c("root.color"),S(a,f,c),a._length=null}}}),ZM=Ge({"src/traces/sunburst/layout_defaults.js"($,G){var h=gn(),b=h3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),Ly=Ge({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=h||self,b(h.d3=h.d3||{}))})($,function(h){function b(Ee,xe){return Ee.parent===xe.parent?1:2}function S(Ee){return Ee.reduce(E,0)/Ee.length}function E(Ee,xe){return Ee+xe.x}function e(Ee){return 1+Ee.reduce(t,0)}function t(Ee,xe){return Math.max(Ee,xe.y)}function r(Ee){for(var xe;xe=Ee.children;)Ee=xe[0];return Ee}function o(Ee){for(var xe;xe=Ee.children;)Ee=xe[xe.length-1];return Ee}function n(){var Ee=b,xe=1,ye=1,Me=!1;function Xe(Je){var Lt,Ct=0;Je.eachAfter(function(hr){var Fr=hr.children;Fr?(hr.x=S(Fr),hr.y=e(Fr)):(hr.x=Lt?Ct+=Ee(hr,Lt):0,hr.y=0,Lt=hr)});var Ot=r(Je),Wt=o(Je),_r=Ot.x-Ee(Ot,Wt)/2,pr=Wt.x+Ee(Wt,Ot)/2;return Je.eachAfter(Me?function(hr){hr.x=(hr.x-Je.x)*xe,hr.y=(Je.y-hr.y)*ye}:function(hr){hr.x=(hr.x-_r)/(pr-_r)*xe,hr.y=(1-(Je.y?hr.y/Je.y:1))*ye})}return Xe.separation=function(Je){return arguments.length?(Ee=Je,Xe):Ee},Xe.size=function(Je){return arguments.length?(Me=!1,xe=+Je[0],ye=+Je[1],Xe):Me?null:[xe,ye]},Xe.nodeSize=function(Je){return arguments.length?(Me=!0,xe=+Je[0],ye=+Je[1],Xe):Me?[xe,ye]:null},Xe}function i(Ee){var xe=0,ye=Ee.children,Me=ye&&ye.length;if(!Me)xe=1;else for(;--Me>=0;)xe+=ye[Me].value;Ee.value=xe}function a(){return this.eachAfter(i)}function s(Ee){var xe=this,ye,Me=[xe],Xe,Je,Lt;do for(ye=Me.reverse(),Me=[];xe=ye.pop();)if(Ee(xe),Xe=xe.children,Xe)for(Je=0,Lt=Xe.length;Je=0;--Xe)ye.push(Me[Xe]);return this}function c(Ee){for(var xe=this,ye=[xe],Me=[],Xe,Je,Lt;xe=ye.pop();)if(Me.push(xe),Xe=xe.children,Xe)for(Je=0,Lt=Xe.length;Je=0;)ye+=Me[Xe].value;xe.value=ye})}function d(Ee){return this.eachBefore(function(xe){xe.children&&xe.children.sort(Ee)})}function T(Ee){for(var xe=this,ye=l(xe,Ee),Me=[xe];xe!==ye;)xe=xe.parent,Me.push(xe);for(var Xe=Me.length;Ee!==ye;)Me.splice(Xe,0,Ee),Ee=Ee.parent;return Me}function l(Ee,xe){if(Ee===xe)return Ee;var ye=Ee.ancestors(),Me=xe.ancestors(),Xe=null;for(Ee=ye.pop(),xe=Me.pop();Ee===xe;)Xe=Ee,Ee=ye.pop(),xe=Me.pop();return Xe}function g(){for(var Ee=this,xe=[Ee];Ee=Ee.parent;)xe.push(Ee);return xe}function x(){var Ee=[];return this.each(function(xe){Ee.push(xe)}),Ee}function A(){var Ee=[];return this.eachBefore(function(xe){xe.children||Ee.push(xe)}),Ee}function M(){var Ee=this,xe=[];return Ee.each(function(ye){ye!==Ee&&xe.push({source:ye.parent,target:ye})}),xe}function _(Ee,xe){var ye=new y(Ee),Me=+Ee.value&&(ye.value=Ee.value),Xe,Je=[ye],Lt,Ct,Ot,Wt;for(xe==null&&(xe=m);Xe=Je.pop();)if(Me&&(Xe.value=+Xe.data.value),(Ct=xe(Xe.data))&&(Wt=Ct.length))for(Xe.children=new Array(Wt),Ot=Wt-1;Ot>=0;--Ot)Je.push(Lt=Xe.children[Ot]=new y(Ct[Ot])),Lt.parent=Xe,Lt.depth=Xe.depth+1;return ye.eachBefore(v)}function w(){return _(this).eachBefore(u)}function m(Ee){return Ee.children}function u(Ee){Ee.data=Ee.data.data}function v(Ee){var xe=0;do Ee.height=xe;while((Ee=Ee.parent)&&Ee.height<++xe)}function y(Ee){this.data=Ee,this.depth=this.height=0,this.parent=null}y.prototype=_.prototype={constructor:y,count:a,each:s,eachAfter:c,eachBefore:f,sum:p,sort:d,path:T,ancestors:g,descendants:x,leaves:A,links:M,copy:w};var I=Array.prototype.slice;function L(Ee){for(var xe=Ee.length,ye,Me;xe;)Me=Math.random()*xe--|0,ye=Ee[xe],Ee[xe]=Ee[Me],Ee[Me]=ye;return Ee}function z(Ee){for(var xe=0,ye=(Ee=L(I.call(Ee))).length,Me=[],Xe,Je;xe0&&ye*ye>Me*Me+Xe*Xe}function R(Ee,xe){for(var ye=0;yeOt?(Xe=(Wt+Ot-Je)/(2*Wt),Ct=Math.sqrt(Math.max(0,Ot/Wt-Xe*Xe)),ye.x=Ee.x-Xe*Me-Ct*Lt,ye.y=Ee.y-Xe*Lt+Ct*Me):(Xe=(Wt+Je-Ot)/(2*Wt),Ct=Math.sqrt(Math.max(0,Je/Wt-Xe*Xe)),ye.x=xe.x+Xe*Me-Ct*Lt,ye.y=xe.y+Xe*Lt+Ct*Me)):(ye.x=xe.x+ye.r,ye.y=xe.y)}function le(Ee,xe){var ye=Ee.r+xe.r-1e-6,Me=xe.x-Ee.x,Xe=xe.y-Ee.y;return ye>0&&ye*ye>Me*Me+Xe*Xe}function ce(Ee){var xe=Ee._,ye=Ee.next._,Me=xe.r+ye.r,Xe=(xe.x*ye.r+ye.x*xe.r)/Me,Je=(xe.y*ye.r+ye.y*xe.r)/Me;return Xe*Xe+Je*Je}function V(Ee){this._=Ee,this.next=null,this.previous=null}function ee(Ee){if(!(Xe=Ee.length))return 0;var xe,ye,Me,Xe,Je,Lt,Ct,Ot,Wt,_r,pr;if(xe=Ee[0],xe.x=0,xe.y=0,!(Xe>1))return xe.r;if(ye=Ee[1],xe.x=-ye.r,ye.x=xe.r,ye.y=0,!(Xe>2))return xe.r+ye.r;fe(ye,xe,Me=Ee[2]),xe=new V(xe),ye=new V(ye),Me=new V(Me),xe.next=Me.previous=ye,ye.next=xe.previous=Me,Me.next=ye.previous=xe;e:for(Ct=3;Ct0)throw new Error("cycle");return Ct}return ye.id=function(Me){return arguments.length?(Ee=ue(Me),ye):Ee},ye.parentId=function(Me){return arguments.length?(xe=ue(Me),ye):xe},ye}function pe(Ee,xe){return Ee.parent===xe.parent?1:2}function Ne(Ee){var xe=Ee.children;return xe?xe[0]:Ee.t}function ot(Ee){var xe=Ee.children;return xe?xe[xe.length-1]:Ee.t}function ct(Ee,xe,ye){var Me=ye/(xe.i-Ee.i);xe.c-=Me,xe.s+=ye,Ee.c+=Me,xe.z+=ye,xe.m+=ye}function rt(Ee){for(var xe=0,ye=0,Me=Ee.children,Xe=Me.length,Je;--Xe>=0;)Je=Me[Xe],Je.z+=xe,Je.m+=xe,xe+=Je.s+(ye+=Je.c)}function Ft(Ee,xe,ye){return Ee.a.parent===xe.parent?Ee.a:ye}function Nt(Ee,xe){this._=Ee,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=xe}Nt.prototype=Object.create(y.prototype);function $t(Ee){for(var xe=new Nt(Ee,0),ye,Me=[xe],Xe,Je,Lt,Ct;ye=Me.pop();)if(Je=ye._.children)for(ye.children=new Array(Ct=Je.length),Lt=Ct-1;Lt>=0;--Lt)Me.push(Xe=ye.children[Lt]=new Nt(Je[Lt],Lt)),Xe.parent=ye;return(xe.parent=new Nt(null,0)).children=[xe],xe}function rr(){var Ee=pe,xe=1,ye=1,Me=null;function Xe(Wt){var _r=$t(Wt);if(_r.eachAfter(Je),_r.parent.m=-_r.z,_r.eachBefore(Lt),Me)Wt.eachBefore(Ot);else{var pr=Wt,hr=Wt,Fr=Wt;Wt.eachBefore(function(ra){ra.xhr.x&&(hr=ra),ra.depth>Fr.depth&&(Fr=ra)});var En=pr===hr?1:Ee(pr,hr)/2,Zn=En-pr.x,qn=xe/(hr.x+En+Zn),ta=ye/(Fr.depth||1);Wt.eachBefore(function(ra){ra.x=(ra.x+Zn)*qn,ra.y=ra.depth*ta})}return Wt}function Je(Wt){var _r=Wt.children,pr=Wt.parent.children,hr=Wt.i?pr[Wt.i-1]:null;if(_r){rt(Wt);var Fr=(_r[0].z+_r[_r.length-1].z)/2;hr?(Wt.z=hr.z+Ee(Wt._,hr._),Wt.m=Wt.z-Fr):Wt.z=Fr}else hr&&(Wt.z=hr.z+Ee(Wt._,hr._));Wt.parent.A=Ct(Wt,hr,Wt.parent.A||pr[0])}function Lt(Wt){Wt._.x=Wt.z+Wt.parent.m,Wt.m+=Wt.parent.m}function Ct(Wt,_r,pr){if(_r){for(var hr=Wt,Fr=Wt,En=_r,Zn=hr.parent.children[0],qn=hr.m,ta=Fr.m,ra=En.m,Nn=Zn.m,Ea;En=ot(En),hr=Ne(hr),En&&hr;)Zn=Ne(Zn),Fr=ot(Fr),Fr.a=Wt,Ea=En.z+ra-hr.z-qn+Ee(En._,hr._),Ea>0&&(ct(Ft(En,Wt,pr),Wt,Ea),qn+=Ea,ta+=Ea),ra+=En.m,qn+=hr.m,Nn+=Zn.m,ta+=Fr.m;En&&!ot(Fr)&&(Fr.t=En,Fr.m+=ra-ta),hr&&!Ne(Zn)&&(Zn.t=hr,Zn.m+=qn-Nn,pr=Wt)}return pr}function Ot(Wt){Wt.x*=xe,Wt.y=Wt.depth*ye}return Xe.separation=function(Wt){return arguments.length?(Ee=Wt,Xe):Ee},Xe.size=function(Wt){return arguments.length?(Me=!1,xe=+Wt[0],ye=+Wt[1],Xe):Me?null:[xe,ye]},Xe.nodeSize=function(Wt){return arguments.length?(Me=!0,xe=+Wt[0],ye=+Wt[1],Xe):Me?[xe,ye]:null},Xe}function Mr(Ee,xe,ye,Me,Xe){for(var Je=Ee.children,Lt,Ct=-1,Ot=Je.length,Wt=Ee.value&&(Xe-ye)/Ee.value;++Ctra&&(ra=Wt),ir=qn*qn*ja,Nn=Math.max(ra/ir,ir/ta),Nn>Ea){qn-=Wt;break}Ea=Nn}Lt.push(Ot={value:qn,dice:Fr1?Me:1)},ye})(Sr);function Br(){var Ee=Ar,xe=!1,ye=1,Me=1,Xe=[0],Je=te,Lt=te,Ct=te,Ot=te,Wt=te;function _r(hr){return hr.x0=hr.y0=0,hr.x1=ye,hr.y1=Me,hr.eachBefore(pr),Xe=[0],xe&&hr.eachBefore(Fe),hr}function pr(hr){var Fr=Xe[hr.depth],En=hr.x0+Fr,Zn=hr.y0+Fr,qn=hr.x1-Fr,ta=hr.y1-Fr;qn=hr-1){var ra=Je[pr];ra.x0=En,ra.y0=Zn,ra.x1=qn,ra.y1=ta;return}for(var Nn=Wt[pr],Ea=Fr/2+Nn,ja=pr+1,ir=hr-1;ja>>1;Wt[qt]ta-Zn){var Vr=(En*sr+qn*ar)/Fr;_r(pr,ja,ar,En,Zn,Vr,ta),_r(ja,hr,sr,Vr,Zn,qn,ta)}else{var on=(Zn*sr+ta*ar)/Fr;_r(pr,ja,ar,En,Zn,qn,on),_r(ja,hr,sr,En,on,qn,ta)}}}function je(Ee,xe,ye,Me,Xe){(Ee.depth&1?Mr:ze)(Ee,xe,ye,Me,Xe)}var $e=(function Ee(xe){function ye(Me,Xe,Je,Lt,Ct){if((Ot=Me._squarify)&&Ot.ratio===xe)for(var Ot,Wt,_r,pr,hr=-1,Fr,En=Ot.length,Zn=Me.value;++hr1?Me:1)},ye})(Sr);h.cluster=n,h.hierarchy=_,h.pack=ie,h.packEnclose=z,h.packSiblings=ne,h.partition=Ye,h.stratify=Te,h.tree=rr,h.treemap=Br,h.treemapBinary=Mt,h.treemapDice=ze,h.treemapResquarify=$e,h.treemapSlice=Mr,h.treemapSliceDice=je,h.treemapSquarify=Ar,Object.defineProperty(h,"__esModule",{value:!0})})}}),l_=Ge({"src/traces/sunburst/calc.js"($){var G=Ly(),h=Pi(),b=gn(),S=Tc().makeColorScaleFuncFromTrace,E=d0().makePullColorFn,e=d0().generateExtendedColors,t=Tc().calc,r=zi().ALMOST_EQUAL,o={},n={},i={};$.calc=function(s,f){var c=s._fullLayout,p=f.ids,d=b.isArrayOrTypedArray(p),T=f.labels,l=f.parents,g=f.values,x=b.isArrayOrTypedArray(g),A=[],M={},_={},w=function(ne,K){M[ne]?M[ne].push(K):M[ne]=[K],_[K]=1},m=function(ne){return ne||typeof ne=="number"},u=function(ne){return!x||h(g[ne])&&g[ne]>=0},v,y,I;d?(v=Math.min(p.length,l.length),y=function(ne){return m(p[ne])&&u(ne)},I=function(ne){return String(p[ne])}):(v=Math.min(T.length,l.length),y=function(ne){return m(T[ne])&&u(ne)},I=function(ne){return String(T[ne])}),x&&(v=Math.min(v,g.length));for(var L=0;L1){for(var U=b.randstr(),j=0;j>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):h===8?Ry(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):h===4?Ry(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=m3.exec($))?new gv(G[1],G[2],G[3],1):(G=Ab.exec($))?new gv(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=Sb.exec($))?Ry(G[1],G[2],G[3],G[4]):(G=RA.exec($))?Ry(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=g3.exec($))?PA(G[1],G[2]/100,G[3]/100,1):(G=IA.exec($))?PA(G[1],G[2]/100,G[3]/100,G[4]):Mb.hasOwnProperty($)?Uu(Mb[$]):$==="transparent"?new gv(NaN,NaN,NaN,0):null}function Uu($){return new gv($>>16&255,$>>8&255,$&255,1)}function Ry($,G,h,b){return b<=0&&($=G=h=NaN),new gv($,G,h,b)}function Iy($){return $ instanceof m0||($=Py($)),$?($=$.rgb(),new gv($.r,$.g,$.b,$.opacity)):new gv}function Dy($,G,h,b){return arguments.length===1?Iy($):new gv($,G,h,b??1)}function gv($,G,h,b){this.r=+$,this.g=+G,this.b=+h,this.opacity=+b}function xb(){return`#${Tg(this.r)}${Tg(this.g)}${Tg(this.b)}`}function h_(){return`#${Tg(this.r)}${Tg(this.g)}${Tg(this.b)}${Tg((isNaN(this.opacity)?1:this.opacity)*255)}`}function v_(){const $=bb(this.opacity);return`${$===1?"rgb(":"rgba("}${Cm(this.r)}, ${Cm(this.g)}, ${Cm(this.b)}${$===1?")":`, ${$})`}`}function bb($){return isNaN($)?1:Math.max(0,Math.min(1,$))}function Cm($){return Math.max(0,Math.min(255,Math.round($)||0))}function Tg($){return $=Cm($),($<16?"0":"")+$.toString(16)}function PA($,G,h,b){return b<=0?$=G=h=NaN:h<=0||h>=1?$=G=NaN:G<=0&&($=NaN),new ju($,G,h,b)}function v3($){if($ instanceof ju)return new ju($.h,$.s,$.l,$.opacity);if($ instanceof m0||($=Py($)),!$)return new ju;if($ instanceof ju)return $;$=$.rgb();var G=$.r/255,h=$.g/255,b=$.b/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=NaN,t=E-S,r=(E+S)/2;return t?(G===E?e=(h-b)/t+(h0&&r<1?0:e,new ju(e,t,r,$.opacity)}function wb($,G,h,b){return arguments.length===1?v3($):new ju($,G,h,b??1)}function ju($,G,h,b){this.h=+$,this.s=+G,this.l=+h,this.opacity=+b}function Tb($){return $=($||0)%360,$<0?$+360:$}function iv($){return Math.max(0,Math.min(1,$||0))}function d3($,G,h){return($<60?G+(h-G)*$/60:$<180?h:$<240?G+(h-G)*(240-$)/60:G)*255}var Y0,Ag,Z0,Lm,Dd,p3,m3,Ab,Sb,RA,g3,IA,Mb,y3=bi({"node_modules/d3-color/src/color.js"(){c_(),Y0=.7,Ag=1/Y0,Z0="\\s*([+-]?\\d+)\\s*",Lm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p3=/^#([0-9a-f]{3,8})$/,m3=new RegExp(`^rgb\\(${Z0},${Z0},${Z0}\\)$`),Ab=new RegExp(`^rgb\\(${Dd},${Dd},${Dd}\\)$`),Sb=new RegExp(`^rgba\\(${Z0},${Z0},${Z0},${Lm}\\)$`),RA=new RegExp(`^rgba\\(${Dd},${Dd},${Dd},${Lm}\\)$`),g3=new RegExp(`^hsl\\(${Lm},${Dd},${Dd}\\)$`),IA=new RegExp(`^hsla\\(${Lm},${Dd},${Dd},${Lm}\\)$`),Mb={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},wg(m0,Py,{copy($){return Object.assign(new this.constructor,this,$)},displayable(){return this.rgb().displayable()},hex:CA,formatHex:CA,formatHex8:WM,formatHsl:f_,formatRgb:LA,toString:LA}),wg(gv,Dy,u_(m0,{brighter($){return $=$==null?Ag:Math.pow(Ag,$),new gv(this.r*$,this.g*$,this.b*$,this.opacity)},darker($){return $=$==null?Y0:Math.pow(Y0,$),new gv(this.r*$,this.g*$,this.b*$,this.opacity)},rgb(){return this},clamp(){return new gv(Cm(this.r),Cm(this.g),Cm(this.b),bb(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:xb,formatHex:xb,formatHex8:h_,formatRgb:v_,toString:v_})),wg(ju,wb,u_(m0,{brighter($){return $=$==null?Ag:Math.pow(Ag,$),new ju(this.h,this.s,this.l*$,this.opacity)},darker($){return $=$==null?Y0:Math.pow(Y0,$),new ju(this.h,this.s,this.l*$,this.opacity)},rgb(){var $=this.h%360+(this.h<0)*360,G=isNaN($)||isNaN(this.s)?0:this.s,h=this.l,b=h+(h<.5?h:1-h)*G,S=2*h-b;return new gv(d3($>=240?$-240:$+120,S,b),d3($,S,b),d3($<120?$+240:$-120,S,b),this.opacity)},clamp(){return new ju(Tb(this.h),iv(this.s),iv(this.l),bb(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(){const $=bb(this.opacity);return`${$===1?"hsl(":"hsla("}${Tb(this.h)}, ${iv(this.s)*100}%, ${iv(this.l)*100}%${$===1?")":`, ${$})`}`}}))}}),_3,g0,x3=bi({"node_modules/d3-color/src/math.js"(){_3=Math.PI/180,g0=180/Math.PI}});function b3($){if($ instanceof y0)return new y0($.l,$.a,$.b,$.opacity);if($ instanceof Xp)return T3($);$ instanceof gv||($=Iy($));var G=m_($.r),h=m_($.g),b=m_($.b),S=w3((.2225045*G+.7168786*h+.0606169*b)/Sg),E,e;return G===h&&h===b?E=e=S:(E=w3((.4360747*G+.3850649*h+.1430804*b)/kb),e=w3((.0139322*G+.0971045*h+.7141733*b)/Od)),new y0(116*S-16,500*(E-S),200*(S-e),$.opacity)}function d_($,G,h,b){return arguments.length===1?b3($):new y0($,G,h,b??1)}function y0($,G,h,b){this.l=+$,this.a=+G,this.b=+h,this.opacity=+b}function w3($){return $>DA?Math.pow($,.3333333333333333):$/Yp+Cb}function Eb($){return $>_0?$*$*$:Yp*($-Cb)}function p_($){return 255*($<=.0031308?12.92*$:1.055*Math.pow($,.4166666666666667)-.055)}function m_($){return($/=255)<=.04045?$/12.92:Math.pow(($+.055)/1.055,2.4)}function KM($){if($ instanceof Xp)return new Xp($.h,$.c,$.l,$.opacity);if($ instanceof y0||($=b3($)),$.a===0&&$.b===0)return new Xp(NaN,0<$.l&&$.l<100?0:NaN,$.l,$.opacity);var G=Math.atan2($.b,$.a)*g0;return new Xp(G<0?G+360:G,Math.sqrt($.a*$.a+$.b*$.b),$.l,$.opacity)}function zd($,G,h,b){return arguments.length===1?KM($):new Xp($,G,h,b??1)}function Xp($,G,h,b){this.h=+$,this.c=+G,this.l=+h,this.opacity=+b}function T3($){if(isNaN($.h))return new y0($.l,0,0,$.opacity);var G=$.h*_3;return new y0($.l,Math.cos(G)*$.c,Math.sin(G)*$.c,$.opacity)}var zy,kb,Sg,Od,Cb,_0,Yp,DA,$M=bi({"node_modules/d3-color/src/lab.js"(){c_(),y3(),x3(),zy=18,kb=.96422,Sg=1,Od=.82521,Cb=4/29,_0=6/29,Yp=3*_0*_0,DA=_0*_0*_0,wg(y0,d_,u_(m0,{brighter($){return new y0(this.l+zy*($??1),this.a,this.b,this.opacity)},darker($){return new y0(this.l-zy*($??1),this.a,this.b,this.opacity)},rgb(){var $=(this.l+16)/116,G=isNaN(this.a)?$:$+this.a/500,h=isNaN(this.b)?$:$-this.b/200;return G=kb*Eb(G),$=Sg*Eb($),h=Od*Eb(h),new gv(p_(3.1338561*G-1.6168667*$-.4906146*h),p_(-.9787684*G+1.9161415*$+.033454*h),p_(.0719453*G-.2289914*$+1.4052427*h),this.opacity)}})),wg(Xp,zd,u_(m0,{brighter($){return new Xp(this.h,this.c,this.l+zy*($??1),this.opacity)},darker($){return new Xp(this.h,this.c,this.l-zy*($??1),this.opacity)},rgb(){return T3(this).rgb()}}))}});function Oy($){if($ instanceof Mg)return new Mg($.h,$.s,$.l,$.opacity);$ instanceof gv||($=Iy($));var G=$.r/255,h=$.g/255,b=$.b/255,S=(Pm*b+S3*G-Ib*h)/(Pm+S3-Ib),E=b-S,e=(Fy*(h-S)-Rb*E)/g_,t=Math.sqrt(e*e+E*E)/(Fy*S*(1-S)),r=t?Math.atan2(e,E)*g0-120:NaN;return new Mg(r<0?r+360:r,t,S,$.opacity)}function Lb($,G,h,b){return arguments.length===1?Oy($):new Mg($,G,h,b??1)}function Mg($,G,h,b){this.h=+$,this.s=+G,this.l=+h,this.opacity=+b}var A3,Pb,Rb,g_,Fy,S3,Ib,Pm,y_=bi({"node_modules/d3-color/src/cubehelix.js"(){c_(),y3(),x3(),A3=-.14861,Pb=1.78277,Rb=-.29227,g_=-.90649,Fy=1.97294,S3=Fy*g_,Ib=Fy*Pb,Pm=Pb*Rb-g_*A3,wg(Mg,Lb,u_(m0,{brighter($){return $=$==null?Ag:Math.pow(Ag,$),new Mg(this.h,this.s,this.l*$,this.opacity)},darker($){return $=$==null?Y0:Math.pow(Y0,$),new Mg(this.h,this.s,this.l*$,this.opacity)},rgb(){var $=isNaN(this.h)?0:(this.h+120)*_3,G=+this.l,h=isNaN(this.s)?0:this.s*G*(1-G),b=Math.cos($),S=Math.sin($);return new gv(255*(G+h*(A3*b+Pb*S)),255*(G+h*(Rb*b+g_*S)),255*(G+h*(Fy*b)),this.opacity)}}))}}),Eg=bi({"node_modules/d3-color/src/index.js"(){y3(),$M(),y_()}});function zA($,G,h,b,S){var E=$*$,e=E*$;return((1-3*$+3*E-e)*G+(4-6*E+3*e)*h+(1+3*$+3*E-3*e)*b+e*S)/6}function kg($){var G=$.length-1;return function(h){var b=h<=0?h=0:h>=1?(h=1,G-1):Math.floor(h*G),S=$[b],E=$[b+1],e=b>0?$[b-1]:2*S-E,t=b()=>$}});function x_($,G){return function(h){return $+h*G}}function OA($,G,h){return $=Math.pow($,h),G=Math.pow(G,h)-$,h=1/h,function(b){return Math.pow($+b*G,h)}}function b_($,G){var h=G-$;return h?x_($,h>180||h<-180?h-360*Math.round(h/360):h):Lg(isNaN($)?G:$)}function JM($){return($=+$)==1?yv:function(G,h){return h-G?OA(G,h,$):Lg(isNaN(G)?h:G)}}function yv($,G){var h=G-$;return h?x_($,h):Lg(isNaN($)?G:$)}var By=bi({"node_modules/d3-interpolate/src/color.js"(){Db()}});function zb($){return function(G){var h=G.length,b=new Array(h),S=new Array(h),E=new Array(h),e,t;for(e=0;eh&&(E=G.slice(h,E),t[e]?t[e]+=E:t[++e]=E),(b=b[0])===(S=S[0])?t[e]?t[e]+=S:t[++e]=S:(t[++e]=null,r.push({i:e,x:Zp(b,S)})),h=Uy.lastIndex;return h180?n+=360:n-o>180&&(o+=360),a.push({i:i.push(S(i)+"rotate(",null,b)-2,x:Zp(o,n)})):n&&i.push(S(i)+"rotate("+n+b)}function t(o,n,i,a){o!==n?a.push({i:i.push(S(i)+"skewX(",null,b)-2,x:Zp(o,n)}):n&&i.push(S(i)+"skewX("+n+b)}function r(o,n,i,a,s,f){if(o!==i||n!==a){var c=s.push(S(s)+"scale(",null,",",null,")");f.push({i:c-4,x:Zp(o,i)},{i:c-2,x:Zp(n,a)})}else(i!==1||a!==1)&&s.push(S(s)+"scale("+i+","+a+")")}return function(o,n){var i=[],a=[];return o=$(o),n=$(n),E(o.translateX,o.translateY,n.translateX,n.translateY,i,a),e(o.rotate,n.rotate,i,a),t(o.skewX,n.skewX,i,a),r(o.scaleX,o.scaleY,n.scaleX,n.scaleY,i,a),o=n=null,function(s){for(var f=-1,c=a.length,p;++fjy,interpolateArray:()=>FA,interpolateBasis:()=>kg,interpolateBasisClosed:()=>M3,interpolateCubehelix:()=>Ci,interpolateCubehelixLong:()=>Ni,interpolateDate:()=>P3,interpolateDiscrete:()=>Rm,interpolateHcl:()=>Sa,interpolateHclLong:()=>wi,interpolateHsl:()=>de,interpolateHslLong:()=>Re,interpolateHue:()=>E_,interpolateLab:()=>Pt,interpolateNumber:()=>Zp,interpolateNumberArray:()=>E3,interpolateObject:()=>M_,interpolateRgb:()=>Ob,interpolateRgbBasis:()=>w_,interpolateRgbBasisClosed:()=>T_,interpolateRound:()=>Dm,interpolateString:()=>Bb,interpolateTransformCss:()=>z3,interpolateTransformSvg:()=>Ig,interpolateZoom:()=>L_,piecewise:()=>Bl,quantize:()=>oi});var to=bi({"node_modules/d3-interpolate/src/index.js"(){Wp(),L3(),Cg(),__(),Fb(),Im(),k_(),S_(),k3(),BA(),eE(),I3(),jA(),O(),A_(),ut(),Rr(),eo(),Ws(),_f(),Ga()}}),_l=Ge({"src/traces/sunburst/fill_one.js"($,G){var h=Ss(),b=_o();G.exports=function(E,e,t,r,o){var n=e.data.data,i=n.i,a=o||n.color;if(i>=0){e.i=n.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=a,e.color=a):(s.color=a,e.color=a),h.pointStyle(E,t,r,e)}else b.fill(E,a)}}}),mc=Ge({"src/traces/sunburst/style.js"($,G){var h=Mi(),b=_o(),S=gn(),E=ic().resizeText,e=_l();function t(o){var n=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,n,"sunburst"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,d=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",d).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),Ns=Ge({"src/traces/sunburst/helpers.js"($){var G=gn(),h=_o(),b=Dp(),S=tg();$.findEntryWithLevel=function(r,o){var n;return o&&r.eachAfter(function(i){if($.getPtId(i)===o)return n=i.copy()}),n||r},$.findEntryWithChild=function(r,o){var n;return r.eachAfter(function(i){for(var a=i.children||[],s=0;s0)},$.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},$.isHeader=function(r,o){return!($.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}$.getParent=function(r,o){return $.findEntryWithLevel(r,t(o))},$.listPath=function(r,o){var n=r.parent;if(!n)return[];var i=o?[n.data[o]]:[n];return $.listPath(n,o).concat(i)},$.getPath=function(r){return $.listPath(r,"label").join("/")+"/"},$.formatValue=S.formatPieValue,$.formatPercent=function(r,o){var n=G.formatPercent(r,0);return n==="0%"&&(n=S.formatPiePercent(r,o)),n}}}),mu=Ge({"src/traces/sunburst/fx.js"($,G){var h=Mi(),b=Lo(),S=Vv().appendArrayPointValue,E=jf(),e=gn(),t=b1(),r=Ns(),o=tg(),n=o.formatPieValue;G.exports=function(s,f,c,p,d){var T=p[0],l=T.trace,g=T.hierarchy,x=l.type==="sunburst",A=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(m){var u=c._fullLayout;if(!(c._dragging||u.hovermode===!1)){var v=c._fullData[l.index],y=m.data.data,I=y.i,L=r.isHierarchyRoot(m),z=r.getParent(g,m),F=r.getValue(m),N=function(ae){return e.castOption(v,I,ae)},B=N("hovertemplate"),R=E.castHoverinfo(v,u,I),U=u.separators,j;if(B||R&&R!=="none"&&R!=="skip"){var Z,re;x&&(Z=T.cx+m.pxmid[0]*(1-m.rInscribed),re=T.cy+m.pxmid[1]*(1-m.rInscribed)),A&&(Z=m._hoverX,re=m._hoverY);var fe={},le=[],ce=[],V=function(ae){return le.indexOf(ae)!==-1};R&&(le=R==="all"?v._module.attributes.hoverinfo.flags:R.split("+")),fe.label=y.label,V("label")&&fe.label&&ce.push(fe.label),y.hasOwnProperty("v")&&(fe.value=y.v,fe.valueLabel=n(fe.value,U),V("value")&&ce.push(fe.valueLabel)),fe.currentPath=m.currentPath=r.getPath(m.data),V("current path")&&!L&&ce.push(fe.currentPath);var ee,ne=[],K=function(){ne.indexOf(ee)===-1&&(ce.push(ee),ne.push(ee))};fe.percentParent=m.percentParent=F/r.getValue(z),fe.parent=m.parentString=r.getPtLabel(z),V("percent parent")&&(ee=r.formatPercent(fe.percentParent,U)+" of "+fe.parent,K()),fe.percentEntry=m.percentEntry=F/r.getValue(f),fe.entry=m.entry=r.getPtLabel(f),V("percent entry")&&!L&&!m.onPathbar&&(ee=r.formatPercent(fe.percentEntry,U)+" of "+fe.entry,K()),fe.percentRoot=m.percentRoot=F/r.getValue(g),fe.root=m.root=r.getPtLabel(g),V("percent root")&&!L&&(ee=r.formatPercent(fe.percentRoot,U)+" of "+fe.root,K()),fe.text=N("hovertext")||N("text"),V("text")&&(ee=fe.text,e.isValidTextValue(ee)&&ce.push(ee)),j=[i(m,v,d.eventDataKeys)];var ue={trace:v,y:re,_x0:m._x0,_x1:m._x1,_y0:m._y0,_y1:m._y1,text:ce.join("
"),name:B||V("name")?v.name:void 0,color:N("hoverlabel.bgcolor")||y.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:B,hovertemplateLabels:fe,eventData:j};x&&(ue.x0=Z-m.rInscribed*m.rpx1,ue.x1=Z+m.rInscribed*m.rpx1,ue.idealAlign=m.pxmid[0]<0?"left":"right"),A&&(ue.x=Z,ue.idealAlign=Z<0?"left":"right");var te=[];E.loneHover(ue,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:c,inOut_bbox:te}),j[0].bbox=te[0],l._hasHoverLabel=!0}if(A){var H=s.select("path.surface");d.styleOne(H,m,v,c,{hovered:!0})}l._hasHoverEvent=!0,c.emit("plotly_hover",{points:j||[i(m,v,d.eventDataKeys)],event:h.event})}},_=function(m){var u=c._fullLayout,v=c._fullData[l.index],y=h.select(this).datum();if(l._hasHoverEvent&&(m.originalEvent=h.event,c.emit("plotly_unhover",{points:[i(y,v,d.eventDataKeys)],event:h.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),A){var I=s.select("path.surface");d.styleOne(I,y,v,c,{hovered:!1})}},w=function(m){var u=c._fullLayout,v=c._fullData[l.index],y=x&&(r.isHierarchyRoot(m)||r.isLeaf(m)),I=r.getPtId(m),L=r.isEntry(m)?r.findEntryWithChild(g,I):r.findEntryWithLevel(g,I),z=r.getPtId(L),F={points:[i(m,v,d.eventDataKeys)],event:h.event};y||(F.nextLevel=z);var N=t.triggerHandler(c,"plotly_"+l.type+"click",F);if(N!==!1&&u.hovermode&&(c._hoverdata=[i(m,v,d.eventDataKeys)],E.click(c,h.event)),!y&&N!==!1&&!c._dragging&&!c._transitioning){b.call("_storeDirectGUIEdit",v,u._tracePreGUI[v.uid],{level:v.level});var B={data:[{level:z}],traces:[l.index]},R={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),b.call("animate",c,B,R)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(a,s,f){for(var c=a.data.data,p={curveNumber:s.index,pointNumber:c.i,data:s._input,fullData:s},d=0;dct.x1?2*Math.PI:0)+ae;rt=pe.rpx1Ye?2*Math.PI:0)+ae;ot={x0:rt,x1:rt}}else ot={rpx0:le,rpx1:le},E.extendFlat(ot,Te(pe));else ot={rpx0:0,rpx1:0};else ot={x0:ae,x1:ae};return b(ot,ct)}function Le(pe){var Ne=ne[T.getPtId(pe)],ot,ct=pe.transform;if(Ne)ot=Ne;else if(ot={rpx1:pe.rpx1,transform:{textPosAngle:ct.textPosAngle,scale:0,rotate:ct.rotate,rCenter:ct.rCenter,x:ct.x,y:ct.y}},ee)if(pe.parent)if(Ye){var rt=pe.x1>Ye?2*Math.PI:0;ot.x0=ot.x1=rt}else E.extendFlat(ot,Te(pe));else ot.x0=ot.x1=ae;else ot.x0=ot.x1=ae;var Ft=b(ot.transform.textPosAngle,pe.transform.textPosAngle),Nt=b(ot.rpx1,pe.rpx1),$t=b(ot.x0,pe.x0),rr=b(ot.x1,pe.x1),Mr=b(ot.transform.scale,ct.scale),Sr=b(ot.transform.rotate,ct.rotate),Zr=ct.rCenter===0?3:ot.transform.rCenter===0?1/3:1,Ar=b(ot.transform.rCenter,ct.rCenter),Br=function(Mt){return Ar(Math.pow(Mt,Zr))};return function(Mt){var je=Nt(Mt);$t(Mt),rr(Mt);var $e=Br(Mt),Ee=Ft(Mt),xe={rpx1:je,transform:{textPosAngle:Ee,rCenter:$e,x:ct.x,y:ct.y}};return r(N.type,ct,y),{transform:{targetX:Fe(xe),targetY:ze(xe),scale:Mr(Mt),rotate:Sr(Mt),rCenter:$e}}}}function Te(pe){var Ne=pe.parent,ot=ne[T.getPtId(Ne)],ct={};if(ot){var rt=Ne.children,Ft=rt.indexOf(pe),Nt=rt.length,$t=b(ot.x0,ot.x1);ct.x0=$t(Ft/Nt),ct.x1=$t(Ft/Nt)}else ct.x0=ct.x1=0;return ct}}function g(_){return h.partition().size([2*Math.PI,_.height+1])(_)}$.formatSliceLabel=function(_,w,m,u,v){var y=m.texttemplate,I=m.textinfo;if(!y&&(!I||I==="none"))return"";var L=v.separators,z=u[0],F=_.data.data,N=z.hierarchy,B=T.isHierarchyRoot(_),R=T.getParent(N,_),U=T.getValue(_);if(!y){var j=I.split("+"),Z=function(te){return j.indexOf(te)!==-1},re=[],fe;if(Z("label")&&F.label&&re.push(F.label),F.hasOwnProperty("v")&&Z("value")&&re.push(T.formatValue(F.v,L)),!B){Z("current path")&&re.push(T.getPath(_.data));var le=0;Z("percent parent")&&le++,Z("percent entry")&&le++,Z("percent root")&&le++;var ce=le>1;if(le){var V,ee=function(te){fe=T.formatPercent(V,L),ce&&(fe+=" of "+te),re.push(fe)};Z("percent parent")&&!B&&(V=U/T.getValue(R),ee("parent")),Z("percent entry")&&(V=U/T.getValue(w),ee("entry")),Z("percent root")&&(V=U/T.getValue(N),ee("root"))}}return Z("text")&&(fe=E.castOption(m,F.i,"text"),E.isValidTextValue(fe)&&re.push(fe)),re.join("
")}var ne=E.castOption(m,F.i,"texttemplate");if(!ne)return"";var K={};F.label&&(K.label=F.label),F.hasOwnProperty("v")&&(K.value=F.v,K.valueLabel=T.formatValue(F.v,L)),K.currentPath=T.getPath(_.data),B||(K.percentParent=U/T.getValue(R),K.percentParentLabel=T.formatPercent(K.percentParent,L),K.parent=T.getPtLabel(R)),K.percentEntry=U/T.getValue(w),K.percentEntryLabel=T.formatPercent(K.percentEntry,L),K.entry=T.getPtLabel(w),K.percentRoot=U/T.getValue(N),K.percentRootLabel=T.formatPercent(K.percentRoot,L),K.root=T.getPtLabel(N),F.hasOwnProperty("color")&&(K.color=F.color);var ue=E.castOption(m,F.i,"text");return(E.isValidTextValue(ue)||ue==="")&&(K.text=ue),K.customdata=E.castOption(m,F.i,"customdata"),E.texttemplateString({data:[K,m._meta],fallback:m.texttemplatefallback,labels:K,locale:v._d3locale,template:ne})};function x(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function A(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),kc=Ge({"src/traces/sunburst/index.js"($,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:YM(),categories:[],animatable:!0,attributes:s_(),layoutAttributes:h3(),supplyDefaults:kA(),supplyLayoutDefaults:ZM(),calc:l_().calc,crossTraceCalc:l_().crossTraceCalc,plot:qu().plot,style:mc().style,colorbar:qf(),meta:{}}}}),zm=Ge({"lib/sunburst.js"($,G){G.exports=kc()}}),tE=Ge({"src/traces/treemap/base_plot.js"($){var G=Wc();$.name="treemap",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Gb=Ge({"src/traces/treemap/constants.js"($,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),rE=Ge({"src/traces/treemap/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Al(),E=Pu(),e=Ac().attributes,t=Ey(),r=s_(),o=Gb(),n=Qi().extendFlat,i=fv().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.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:n({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:r.marker.colors,pattern:i,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("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:n({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:o.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:n({},t.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:t.sort,root:r.root,domain:e({name:"treemap",trace:!0,editType:"calc"})}}}),Ak=Ge({"src/traces/treemap/layout_attributes.js"($,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),F4=Ge({"src/traces/treemap/defaults.js"($,G){var h=gn(),b=rE(),S=_o(),E=Ac().defaults,e=kd().handleText,t=ym().TEXTPAD,r=ky().handleMarkerDefaults,o=Tc(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function d(v,y){return h.coerce(s,f,b,v,y)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth");var x=d("tiling.packing");x==="squarify"&&d("tiling.squarifyratio"),d("tiling.flip"),d("tiling.pad");var A=d("text");d("texttemplate"),d("texttemplatefallback"),f.texttemplate||d("textinfo",h.isArrayOrTypedArray(A)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var M=d("pathbar.visible"),_="auto";e(s,f,p,d,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition");var w=f.textposition.indexOf("bottom")!==-1;r(s,f,p,d);var m=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;m?i(s,f,p,d,{prefix:"marker.",cLetter:"c"}):d("marker.depthfade",!(f.marker.colors||[]).length);var u=f.textfont.size*2;d("marker.pad.t",w?u/4:u),d("marker.pad.l",u/4),d("marker.pad.r",u/4),d("marker.pad.b",w?u:u/4),d("marker.cornerradius"),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},M&&(d("pathbar.thickness",f.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),E(f,p,d),f._length=null}}}),B4=Ge({"src/traces/treemap/layout_defaults.js"($,G){var h=gn(),b=Ak();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),Sk=Ge({"src/traces/treemap/calc.js"($){var G=l_();$.calc=function(h,b){return G.calc(h,b)},$.crossTraceCalc=function(h){return G._runCrossTraceCalc("treemap",h)}}}),Mk=Ge({"src/traces/treemap/flip_tree.js"($,G){G.exports=function h(b,S,E){var e;E.swapXY&&(e=b.x0,b.x0=b.y0,b.y0=e,e=b.x1,b.x1=b.y1,b.y1=e),E.flipX&&(e=b.x0,b.x0=S[0]-b.x1,b.x1=S[0]-e),E.flipY&&(e=b.y0,b.y0=S[1]-b.y1,b.y1=S[1]-e);var t=b.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var ce=b.ensureSingle(fe,"g","slicetext"),V=b.ensureSingle(ce,"text","",function(ne){ne.attr("data-notex",1)}),ee=b.ensureUniformFontSize(s,o.determineTextFont(N,re,z.font,{onPathbar:!0}));V.text(re._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(S.font,ee).call(E.convertToTspans,s),re.textBB=S.bBox(V.node()),re.transform=_(re,{fontSize:ee.size,onPathbar:!0}),re.transform.fontSize=ee.size,m?V.transition().attrTween("transform",function(ne){var K=y(ne,i,I,[l,g]);return function(ue){return w(K(ue))}}):V.attr("transform",w(re))})}}}),U4=Ge({"src/traces/treemap/plot_one.js"($,G){var h=Mi(),b=(to(),yi(gi)).interpolate,S=Ns(),E=gn(),e=ym().TEXTPAD,t=nu(),r=t.toMoveInsideBar,o=ic(),n=o.recordMinTextSize,i=Gb(),a=N4();function s(f){return S.isHierarchyRoot(f)?"":S.getPtId(f)}G.exports=function(c,p,d,T,l){var g=c._fullLayout,x=p[0],A=x.trace,M=A.type,_=M==="icicle",w=x.hierarchy,m=S.findEntryWithLevel(w,A.level),u=h.select(d),v=u.selectAll("g.pathbar"),y=u.selectAll("g.slice");if(!m){v.remove(),y.remove();return}var I=S.isHierarchyRoot(m),L=!g.uniformtext.mode&&S.hasTransition(T),z=S.getMaxDepth(A),F=function(Ar){return Ar.data.depth-m.data.depth-1?U+re:-(Z+re):0,le={x0:j,x1:j,y0:fe,y1:fe+Z},ce=function(Ar,Br,Mt){var je=A.tiling.pad,$e=function(Me){return Me-je<=Br.x0},Ee=function(Me){return Me+je>=Br.x1},xe=function(Me){return Me-je<=Br.y0},ye=function(Me){return Me+je>=Br.y1};return Ar.x0===Br.x0&&Ar.x1===Br.x1&&Ar.y0===Br.y0&&Ar.y1===Br.y1?{x0:Ar.x0,x1:Ar.x1,y0:Ar.y0,y1:Ar.y1}:{x0:$e(Ar.x0-je)?0:Ee(Ar.x0-je)?Mt[0]:Ar.x0,x1:$e(Ar.x1+je)?0:Ee(Ar.x1+je)?Mt[0]:Ar.x1,y0:xe(Ar.y0-je)?0:ye(Ar.y0-je)?Mt[1]:Ar.y0,y1:xe(Ar.y1+je)?0:ye(Ar.y1+je)?Mt[1]:Ar.y1}},V=null,ee={},ne={},K=null,ue=function(Ar,Br){return Br?ee[s(Ar)]:ne[s(Ar)]},te=function(Ar,Br,Mt,je){if(Br)return ee[s(w)]||le;var $e=ne[A.level]||Mt;return F(Ar)?ce(Ar,$e,je):{}};x.hasMultipleRoots&&I&&z++,A._maxDepth=z,A._backgroundColor=g.paper_bgcolor,A._entryDepth=m.data.depth,A._atRootLevel=I;var H=-R/2+N.l+N.w*(B.x[1]+B.x[0])/2,ae=-U/2+N.t+N.h*(1-(B.y[1]+B.y[0])/2),ie=function(Ar){return H+Ar},ve=function(Ar){return ae+Ar},Ae=ve(0),Ce=ie(0),Fe=function(Ar){return Ce+Ar},ze=function(Ar){return Ae+Ar};function Ye(Ar,Br){return Ar+","+Br}var it=Fe(0),st=function(Ar){Ar.x=Math.max(it,Ar.x)},nt=A.pathbar.edgeshape,Qe=function(Ar){var Br=Fe(Math.max(Math.min(Ar.x0,Ar.x0),0)),Mt=Fe(Math.min(Math.max(Ar.x1,Ar.x1),j)),je=ze(Ar.y0),$e=ze(Ar.y1),Ee=Z/2,xe={},ye={};xe.x=Br,ye.x=Mt,xe.y=ye.y=(je+$e)/2;var Me={x:Br,y:je},Xe={x:Mt,y:je},Je={x:Mt,y:$e},Lt={x:Br,y:$e};return nt===">"?(Me.x-=Ee,Xe.x-=Ee,Je.x-=Ee,Lt.x-=Ee):nt==="/"?(Je.x-=Ee,Lt.x-=Ee,xe.x-=Ee/2,ye.x-=Ee/2):nt==="\\"?(Me.x-=Ee,Xe.x-=Ee,xe.x-=Ee/2,ye.x-=Ee/2):nt==="<"&&(xe.x-=Ee,ye.x-=Ee),st(Me),st(Lt),st(xe),st(Xe),st(Je),st(ye),"M"+Ye(Me.x,Me.y)+"L"+Ye(Xe.x,Xe.y)+"L"+Ye(ye.x,ye.y)+"L"+Ye(Je.x,Je.y)+"L"+Ye(Lt.x,Lt.y)+"L"+Ye(xe.x,xe.y)+"Z"},Le=A[_?"tiling":"marker"].pad,Te=function(Ar){return A.textposition.indexOf(Ar)!==-1},pe=Te("top"),Ne=Te("left"),ot=Te("right"),ct=Te("bottom"),rt=function(Ar){var Br=ie(Ar.x0),Mt=ie(Ar.x1),je=ve(Ar.y0),$e=ve(Ar.y1),Ee=Mt-Br,xe=$e-je;if(!Ee||!xe)return"";var ye=A.marker.cornerradius||0,Me=Math.min(ye,Ee/2,xe/2);Me&&Ar.data&&Ar.data.data&&Ar.data.data.label&&(pe&&(Me=Math.min(Me,Le.t)),Ne&&(Me=Math.min(Me,Le.l)),ot&&(Me=Math.min(Me,Le.r)),ct&&(Me=Math.min(Me,Le.b)));var Xe=function(Je,Lt){return Me?"a"+Ye(Me,Me)+" 0 0 1 "+Ye(Je,Lt):""};return"M"+Ye(Br,je+Me)+Xe(Me,-Me)+"L"+Ye(Mt-Me,je)+Xe(Me,Me)+"L"+Ye(Mt,$e-Me)+Xe(-Me,Me)+"L"+Ye(Br+Me,$e)+Xe(-Me,-Me)+"Z"},Ft=function(Ar,Br){var Mt=Ar.x0,je=Ar.x1,$e=Ar.y0,Ee=Ar.y1,xe=Ar.textBB,ye=pe||Br.isHeader&&!ct,Me=ye?"start":ct?"end":"middle",Xe=Te("right"),Je=Te("left")||Br.onPathbar,Lt=Je?-1:Xe?1:0;if(Br.isHeader){if(Mt+=(_?Le:Le.l)-e,je-=(_?Le:Le.r)-e,Mt>=je){var Ct=(Mt+je)/2;Mt=Ct,je=Ct}var Ot;ct?(Ot=Ee-(_?Le:Le.b),$e-1,flipY:B.tiling.flip.indexOf("y")>-1,pad:{inner:B.tiling.pad,top:B.marker.pad.t,left:B.marker.pad.l,right:B.marker.pad.r,bottom:B.marker.pad.b}}),fe=re.descendants(),le=1/0,ce=-1/0;fe.forEach(function(ue){var te=ue.depth;te>=B._maxDepth?(ue.x0=ue.x1=(ue.x0+ue.x1)/2,ue.y0=ue.y1=(ue.y0+ue.y1)/2):(le=Math.min(le,te),ce=Math.max(ce,te))}),d=d.data(fe,o.getPtId),B._maxVisibleLayers=isFinite(ce)?ce-le+1:0,d.enter().append("g").classed("slice",!0),u(d,a,L,[l,g],M),d.order();var V=null;if(m&&I){var ee=o.getPtId(I);d.each(function(ue){V===null&&o.getPtId(ue)===ee&&(V={x0:ue.x0,x1:ue.x1,y0:ue.y0,y1:ue.y1})})}var ne=function(){return V||{x0:0,x1:l,y0:0,y1:g}},K=d;return m&&(K=K.transition().each("end",function(){var ue=h.select(this);o.setSliceCursor(ue,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),K.each(function(ue){var te=o.isHeader(ue,B);ue._x0=x(ue.x0),ue._x1=x(ue.x1),ue._y0=A(ue.y0),ue._y1=A(ue.y1),ue._hoverX=x(ue.x1-B.marker.pad.r),ue._hoverY=A(j?ue.y1-B.marker.pad.b/2:ue.y0+B.marker.pad.t/2);var H=h.select(this),ae=b.ensureSingle(H,"path","surface",function(ze){ze.style("pointer-events",z?"none":"all")});m?ae.transition().attrTween("d",function(ze){var Ye=v(ze,a,ne(),[l,g]);return function(it){return M(Ye(it))}}):ae.attr("d",M),H.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),ae.call(t,ue,B,f,{hovered:!1}),ue.x0===ue.x1||ue.y0===ue.y1?ue._text="":te?ue._text=Z?"":o.getPtLabel(ue)||"":ue._text=i(ue,p,B,c,F)||"";var ie=b.ensureSingle(H,"g","slicetext"),ve=b.ensureSingle(ie,"text","",function(ze){ze.attr("data-notex",1)}),Ae=b.ensureUniformFontSize(f,o.determineTextFont(B,ue,F.font)),Ce=ue._text||" ",Fe=te&&Ce.indexOf("
")===-1;ve.text(Ce).classed("slicetext",!0).attr("text-anchor",U?"end":R||Fe?"start":"middle").call(S.font,Ae).call(E.convertToTspans,f),ue.textBB=S.bBox(ve.node()),ue.transform=_(ue,{fontSize:Ae.size,isHeader:te}),ue.transform.fontSize=Ae.size,m?ve.transition().attrTween("transform",function(ze){var Ye=y(ze,a,ne(),[l,g]);return function(it){return w(Ye(it))}}):ve.attr("transform",w(ue))}),V}}}),q4=Ge({"src/traces/treemap/plot.js"($,G){var h=kk(),b=j4();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"treemap",drawDescendants:b})}}}),V4=Ge({"src/traces/treemap/index.js"($,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:tE(),categories:[],animatable:!0,attributes:rE(),layoutAttributes:Ak(),supplyDefaults:F4(),supplyLayoutDefaults:B4(),calc:Sk().calc,crossTraceCalc:Sk().crossTraceCalc,plot:q4(),style:nE().style,colorbar:qf(),meta:{}}}}),H4=Ge({"lib/treemap.js"($,G){G.exports=V4()}}),G4=Ge({"src/traces/icicle/base_plot.js"($){var G=Wc();$.name="icicle",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Ck=Ge({"src/traces/icicle/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Al(),E=Pu(),e=Ac().attributes,t=Ey(),r=s_(),o=rE(),n=Gb(),i=Qi().extendFlat,a=fv().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:o.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:i({colors:r.marker.colors,line:r.marker.line,pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:n.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:o.outsidetextfont,textposition:o.textposition,sort:t.sort,root:r.root,domain:e({name:"icicle",trace:!0,editType:"calc"})}}}),Lk=Ge({"src/traces/icicle/layout_attributes.js"($,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),X4=Ge({"src/traces/icicle/defaults.js"($,G){var h=gn(),b=Ck(),S=_o(),E=Ac().defaults,e=kd().handleText,t=ym().TEXTPAD,r=ky().handleMarkerDefaults,o=Tc(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function d(w,m){return h.coerce(s,f,b,w,m)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),d("tiling.orientation"),d("tiling.flip"),d("tiling.pad");var x=d("text");d("texttemplate"),d("texttemplatefallback"),f.texttemplate||d("textinfo",h.isArrayOrTypedArray(x)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var A=d("pathbar.visible"),M="auto";e(s,f,p,d,M,{hasPathbar:A,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition"),r(s,f,p,d);var _=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,f,p,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",_?1:.7),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},A&&(d("pathbar.thickness",f.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),E(f,p,d),f._length=null}}}),Y4=Ge({"src/traces/icicle/layout_defaults.js"($,G){var h=gn(),b=Lk();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),Pk=Ge({"src/traces/icicle/calc.js"($){var G=l_();$.calc=function(h,b){return G.calc(h,b)},$.crossTraceCalc=function(h){return G._runCrossTraceCalc("icicle",h)}}}),Z4=Ge({"src/traces/icicle/partition.js"($,G){var h=Ly(),b=Mk();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,n=t.orientation==="h",i=t.maxDepth,a=e[0],s=e[1];i&&(a=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var f=h.partition().padding(t.pad.inner).size(n?[e[1],a]:[e[0],s])(E);return(n||r||o)&&b(f,e,{swapXY:n,flipX:r,flipY:o}),f}}}),Rk=Ge({"src/traces/icicle/style.js"($,G){var h=Mi(),b=_o(),S=gn(),E=ic().resizeText,e=_l();function t(o){var n=o._fullLayout._iciclelayer.selectAll(".trace");E(o,n,"icicle"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,d=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",d).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),W4=Ge({"src/traces/icicle/draw_descendants.js"($,G){var h=Mi(),b=gn(),S=Ss(),E=Ju(),e=Z4(),t=Rk().styleOne,r=Gb(),o=Ns(),n=mu(),i=qu().formatSliceLabel,a=!1;G.exports=function(f,c,p,d,T){var l=T.width,g=T.height,x=T.viewX,A=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,m=T.hasTransition,u=T.handleSlicesExit,v=T.makeUpdateSliceInterpolator,y=T.makeUpdateTextInterpolator,I=T.prevEntry,L={},z=f._context.staticPlot,F=f._fullLayout,N=c[0],B=N.trace,R=B.textposition.indexOf("left")!==-1,U=B.textposition.indexOf("right")!==-1,j=B.textposition.indexOf("bottom")!==-1,Z=e(p,[l,g],{flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1,orientation:B.tiling.orientation,pad:{inner:B.tiling.pad},maxDepth:B._maxDepth}),re=Z.descendants(),fe=1/0,le=-1/0;re.forEach(function(K){var ue=K.depth;ue>=B._maxDepth?(K.x0=K.x1=(K.x0+K.x1)/2,K.y0=K.y1=(K.y0+K.y1)/2):(fe=Math.min(fe,ue),le=Math.max(le,ue))}),d=d.data(re,o.getPtId),B._maxVisibleLayers=isFinite(le)?le-fe+1:0,d.enter().append("g").classed("slice",!0),u(d,a,L,[l,g],M),d.order();var ce=null;if(m&&I){var V=o.getPtId(I);d.each(function(K){ce===null&&o.getPtId(K)===V&&(ce={x0:K.x0,x1:K.x1,y0:K.y0,y1:K.y1})})}var ee=function(){return ce||{x0:0,x1:l,y0:0,y1:g}},ne=d;return m&&(ne=ne.transition().each("end",function(){var K=h.select(this);o.setSliceCursor(K,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function(K){K._x0=x(K.x0),K._x1=x(K.x1),K._y0=A(K.y0),K._y1=A(K.y1),K._hoverX=x(K.x1-B.tiling.pad),K._hoverY=A(j?K.y1-B.tiling.pad/2:K.y0+B.tiling.pad/2);var ue=h.select(this),te=b.ensureSingle(ue,"path","surface",function(ve){ve.style("pointer-events",z?"none":"all")});m?te.transition().attrTween("d",function(ve){var Ae=v(ve,a,ee(),[l,g],{orientation:B.tiling.orientation,flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1});return function(Ce){return M(Ae(Ce))}}):te.attr("d",M),ue.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),te.call(t,K,B,f,{hovered:!1}),K.x0===K.x1||K.y0===K.y1?K._text="":K._text=i(K,p,B,c,F)||"";var H=b.ensureSingle(ue,"g","slicetext"),ae=b.ensureSingle(H,"text","",function(ve){ve.attr("data-notex",1)}),ie=b.ensureUniformFontSize(f,o.determineTextFont(B,K,F.font));ae.text(K._text||" ").classed("slicetext",!0).attr("text-anchor",U?"end":R?"start":"middle").call(S.font,ie).call(E.convertToTspans,f),K.textBB=S.bBox(ae.node()),K.transform=_(K,{fontSize:ie.size}),K.transform.fontSize=ie.size,m?ae.transition().attrTween("transform",function(ve){var Ae=y(ve,a,ee(),[l,g]);return function(Ce){return w(Ae(Ce))}}):ae.attr("transform",w(K))}),ce}}}),K4=Ge({"src/traces/icicle/plot.js"($,G){var h=kk(),b=W4();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"icicle",drawDescendants:b})}}}),$4=Ge({"src/traces/icicle/index.js"($,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:G4(),categories:[],animatable:!0,attributes:Ck(),layoutAttributes:Lk(),supplyDefaults:X4(),supplyLayoutDefaults:Y4(),calc:Pk().calc,crossTraceCalc:Pk().crossTraceCalc,plot:K4(),style:Rk().style,colorbar:qf(),meta:{}}}}),J4=Ge({"lib/icicle.js"($,G){G.exports=$4()}}),Q4=Ge({"src/traces/funnelarea/base_plot.js"($){var G=Wc();$.name="funnelarea",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Ik=Ge({"src/traces/funnelarea/attributes.js"($,G){var h=Ey(),b=ru(),S=Ac().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Al(),r=Qi().extendFlat;G.exports={labels:h.labels,label0:h.label0,dlabel:h.dlabel,values:h.values,marker:{colors:h.marker.colors,line:{color:r({},h.marker.line.color,{dflt:null}),width:r({},h.marker.line.width,{dflt:1}),editType:"calc"},pattern:h.marker.pattern,editType:"calc"},text:h.text,hovertext:h.hovertext,scalegroup:r({},h.scalegroup,{}),textinfo:r({},h.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:t({editType:"plot"}),hoverinfo:r({},b.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:t(),textposition:r({},h.textposition,{values:["inside","none"],dflt:"inside"}),textfont:h.textfont,insidetextfont:h.insidetextfont,title:{text:h.title.text,font:h.title.font,position:r({},h.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:S({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"}}}}),Dk=Ge({"src/traces/funnelarea/layout_attributes.js"($,G){var h=l3().hiddenlabels;G.exports={hiddenlabels:h,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),eP=Ge({"src/traces/funnelarea/defaults.js"($,G){var h=gn(),b=Ik(),S=Ac().defaults,E=kd().handleText,e=ky().handleLabelsAndValues,t=ky().handleMarkerDefaults;G.exports=function(o,n,i,a){function s(M,_){return h.coerce(o,n,b,M,_)}var f=s("labels"),c=s("values"),p=e(f,c),d=p.len;if(n._hasLabels=p.hasLabels,n._hasValues=p.hasValues,!n._hasLabels&&n._hasValues&&(s("label0"),s("dlabel")),!d){n.visible=!1;return}n._length=d,t(o,n,a,s),s("scalegroup");var T=s("text"),l=s("texttemplate");s("texttemplatefallback");var g;if(l||(g=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),l||g&&g!=="none"){var x=s("textposition");E(o,n,a,s,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else g==="none"&&s("textposition","none");S(n,a,s);var A=s("title.text");A&&(s("title.position"),h.coerceFont(s,"title.font",a.font)),s("aspectratio"),s("baseratio")}}}),tP=Ge({"src/traces/funnelarea/layout_defaults.js"($,G){var h=gn(),b=Dk();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),zk=Ge({"src/traces/funnelarea/calc.js"($,G){var h=d0();function b(E,e){return h.calc(E,e)}function S(E){h.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:b,crossTraceCalc:S}}}),rP=Ge({"src/traces/funnelarea/plot.js"($,G){var h=Mi(),b=Ss(),S=gn(),E=S.strScale,e=S.strTranslate,t=Ju(),r=nu(),o=r.toMoveInsideBar,n=ic(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=tg(),f=Cy(),c=f.attachFxHandlers,p=f.determineInsideTextFont,d=f.layoutAreas,T=f.prerenderTitles,l=f.positionTitleOutside,g=f.formatSliceLabel;G.exports=function(w,m){var u=w._context.staticPlot,v=w._fullLayout;a("funnelarea",v),T(m,w),d(m,v._size),S.makeTraceGroups(v._funnelarealayer,m,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace;M(y),I.each(function(){var F=h.select(this).selectAll("g.slice").data(y);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(B,R){if(B.hidden){h.select(this).selectAll("path,g").remove();return}B.pointNumber=B.i,B.curveNumber=z.index;var U=L.cx,j=L.cy,Z=h.select(this),re=Z.selectAll("path.surface").data([B]);re.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(c,w,y);var fe="M"+(U+B.TR[0])+","+(j+B.TR[1])+x(B.TR,B.BR)+x(B.BR,B.BL)+x(B.BL,B.TL)+"Z";re.attr("d",fe),g(w,B,L);var le=s.castOption(z.textposition,B.pts),ce=Z.selectAll("g.slicetext").data(B.text&&le!=="none"?[0]:[]);ce.enter().append("g").classed("slicetext",!0),ce.exit().remove(),ce.each(function(){var V=S.ensureSingle(h.select(this),"text","",function(ie){ie.attr("data-notex",1)}),ee=S.ensureUniformFontSize(w,p(z,B,v.font));V.text(B.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(b.font,ee).call(t.convertToTspans,w);var ne=b.bBox(V.node()),K,ue,te,H=Math.min(B.BL[1],B.BR[1])+j,ae=Math.max(B.TL[1],B.TR[1])+j;ue=Math.max(B.TL[0],B.BL[0])+U,te=Math.min(B.TR[0],B.BR[0])+U,K=o(ue,te,H,ae,ne,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),K.fontSize=ee.size,i(z.type,K,v),y[R].transform=K,S.setTransormAndDisplay(V,K)})});var N=h.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var B=S.ensureSingle(h.select(this),"text","",function(j){j.attr("data-notex",1)}),R=z.title.text;z._meta&&(R=S.templateString(R,z._meta)),B.text(R).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(b.font,z.title.font).call(t.convertToTspans,w);var U=l(L,v._size);B.attr("transform",e(U.x,U.y)+E(Math.min(1,U.scale))+e(U.tx,U.ty))})})})};function x(_,w){var m=w[0]-_[0],u=w[1]-_[1];return"l"+m+","+u}function A(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],m=w.trace,u=m.aspectratio,v=m.baseratio;v>.999&&(v=.999);var y=Math.pow(v,2),I=w.vTotal,L=I*y/(1-y),z=I,F=L/I;function N(){var ve=Math.sqrt(F);return{x:ve,y:-ve}}function B(){var ve=N();return[ve.x,ve.y]}var R,U=[];U.push(B());var j,Z;for(j=_.length-1;j>-1;j--)if(Z=_[j],!Z.hidden){var re=Z.v/z;F+=re,U.push(B())}var fe=1/0,le=-1/0;for(j=0;j-1;j--)if(Z=_[j],!Z.hidden){H+=1;var ae=U[H][0],ie=U[H][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=ue,Z.BR=te,Z.pxmid=A(Z.TR,Z.BR),ue=Z.TL,te=Z.TR}}}}),nP=Ge({"src/traces/funnelarea/style.js"($,G){var h=Mi(),b=T1(),S=ic().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");S(e,t,"funnelarea"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),aP=Ge({"src/traces/funnelarea/index.js"($,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:Q4(),categories:["pie-like","funnelarea","showLegend"],attributes:Ik(),layoutAttributes:Dk(),supplyDefaults:eP(),supplyLayoutDefaults:tP(),calc:zk().calc,crossTraceCalc:zk().crossTraceCalc,plot:rP(),style:nP(),styleOne:T1(),meta:{}}}}),iP=Ge({"lib/funnelarea.js"($,G){G.exports=aP()}}),od=Ge({"stackgl_modules/index.js"($,G){(function(){var h={24:(function(e){var t={left:0,top:0};e.exports=r;function r(n,i,a){i=i||n.currentTarget||n.srcElement,Array.isArray(a)||(a=[0,0]);var s=n.clientX||0,f=n.clientY||0,c=o(i);return a[0]=s-c.left,a[1]=f-c.top,a}function o(n){return n===window||n===document||n===document.body?t:n.getBoundingClientRect()}}),109:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[2],f=o[0]-a,c=o[2]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=a+c*p+f*d,r[1]=o[1],r[2]=s+c*d-f*p,r}}),160:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.max(o[0],n[0]),r[1]=Math.max(o[1],n[1]),r[2]=Math.max(o[2],n[2]),r[3]=Math.max(o[3],n[3]),r}}),216:(function(e){e.exports=t;function t(r,o){for(var n={},i=0;i1){p[0]in f||(f[p[0]]=[]),f=f[p[0]];for(var d=1;d=0;--R){var ee=N[R];U=ee[0];var ne=z[U],K=ne[0],ue=ne[1],te=L[K],H=L[ue];if((te[0]-H[0]||te[1]-H[1])<0){var ae=K;K=ue,ue=ae}ne[0]=K;var ie=ne[1]=ee[1],ve;for(B&&(ve=ne[2]);R>0&&N[R-1][0]===U;){var ee=N[--R],Ae=ee[1];B?z.push([ie,Ae,ve]):z.push([ie,Ae]),ie=Ae}B?z.push([ie,ue,ve]):z.push([ie,ue])}return j}function _(L,z,F){for(var N=z.length,B=new o(N),R=[],U=0;Uz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var N=0;N0||U.length>0}function I(L,z,F){var N;if(F){N=z;for(var B=new Array(z.length),R=0;R 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec3 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, coneScale, coneOffset; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * conePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(conePosition, 1.0); + vec4 t_position = view * conePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = conePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the cone vertex and normal at the given index. +// +// The returned vertex is for a cone with its top at origin and height of 1.0, +// pointing in the direction of the vector attribute. +// +// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices. +// These vertices are used to make up the triangles of the cone by the following: +// segment + 0 top vertex +// segment + 1 perimeter vertex a+1 +// segment + 2 perimeter vertex a +// segment + 3 center base vertex +// segment + 4 perimeter vertex a +// segment + 5 perimeter vertex a+1 +// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment. +// To go from index to segment, floor(index / 6) +// To go from segment to angle, 2*pi * (segment/segmentCount) +// To go from index to segment index, index - (segment*6) +// +vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) { + + const float segmentCount = 8.0; + + float index = rawIndex - floor(rawIndex / + (segmentCount * 6.0)) * + (segmentCount * 6.0); + + float segment = floor(0.001 + index/6.0); + float segmentIndex = index - (segment*6.0); + + normal = -normalize(d); + + if (segmentIndex > 2.99 && segmentIndex < 3.01) { + return mix(vec3(0.0), -d, coneOffset); + } + + float nextAngle = ( + (segmentIndex > 0.99 && segmentIndex < 1.01) || + (segmentIndex > 4.99 && segmentIndex < 5.01) + ) ? 1.0 : 0.0; + float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount); + + vec3 v1 = mix(d, vec3(0.0), coneOffset); + vec3 v2 = v1 - d; + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d)*0.25; + vec3 y = v * sin(angle) * length(d)*0.25; + vec3 v3 = v2 + x + y; + if (segmentIndex < 3.0) { + vec3 tx = u * sin(angle); + vec3 ty = v * -cos(angle); + vec3 tangent = tx + ty; + normal = normalize(cross(v3 - v1, tangent)); + } + + if (segmentIndex == 0.0) { + return mix(d, vec3(0.0), coneOffset); + } + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float vectorScale, coneScale, coneOffset; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal); + vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + gl_Position = projection * (view * conePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}}),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"]}),665:(function(e,t,r){var o=r(3202);e.exports=s;var n=96;function i(f,c){var p=o(getComputedStyle(f).getPropertyValue(c));return p[0]*s(p[1],f)}function a(f,c){var p=document.createElement("div");p.style["font-size"]="128"+f,c.appendChild(p);var d=i(p,"font-size")/128;return c.removeChild(p),d}function s(f,c){switch(c=c||document.body,f=(f||"px").trim().toLowerCase(),(c===window||c===document)&&(c=document.body),f){case"%":return c.clientHeight/100;case"ch":case"ex":return a(f,c);case"em":return i(c,"font-size");case"rem":return i(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 n;case"cm":return n/2.54;case"mm":return n/25.4;case"pt":return n/72;case"pc":return n/6}return 1}}),727:(function(e,t,r){var o=r(2962),n=6;function i(A){var M=A===2?f:A===3?c:A===4?p:A===5?d:T;return A<6?M(o[A]):M(o)}function a(){return[[0]]}function s(A,M){return[[M[0]],[A[0][0]]]}function f(A){return function(_,w){return[A([[+w[0],+_[0][1]],[+w[1],+_[1][1]]]),A([[+_[0][0],+w[0]],[+_[1][0],+w[1]]]),A(_)]}}function c(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2]],[+w[1],+_[1][1],+_[1][2]],[+w[2],+_[2][1],+_[2][2]]]),A([[+_[0][0],+w[0],+_[0][2]],[+_[1][0],+w[1],+_[1][2]],[+_[2][0],+w[2],+_[2][2]]]),A([[+_[0][0],+_[0][1],+w[0]],[+_[1][0],+_[1][1],+w[1]],[+_[2][0],+_[2][1],+w[2]]]),A(_)]}}function p(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3]],[+w[1],+_[1][1],+_[1][2],+_[1][3]],[+w[2],+_[2][1],+_[2][2],+_[2][3]],[+w[3],+_[3][1],+_[3][2],+_[3][3]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3]],[+_[1][0],+w[1],+_[1][2],+_[1][3]],[+_[2][0],+w[2],+_[2][2],+_[2][3]],[+_[3][0],+w[3],+_[3][2],+_[3][3]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3]],[+_[1][0],+_[1][1],+w[1],+_[1][3]],[+_[2][0],+_[2][1],+w[2],+_[2][3]],[+_[3][0],+_[3][1],+w[3],+_[3][3]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+w[3]]]),A(_)]}}function d(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3],+_[0][4]],[+w[1],+_[1][1],+_[1][2],+_[1][3],+_[1][4]],[+w[2],+_[2][1],+_[2][2],+_[2][3],+_[2][4]],[+w[3],+_[3][1],+_[3][2],+_[3][3],+_[3][4]],[+w[4],+_[4][1],+_[4][2],+_[4][3],+_[4][4]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3],+_[0][4]],[+_[1][0],+w[1],+_[1][2],+_[1][3],+_[1][4]],[+_[2][0],+w[2],+_[2][2],+_[2][3],+_[2][4]],[+_[3][0],+w[3],+_[3][2],+_[3][3],+_[3][4]],[+_[4][0],+w[4],+_[4][2],+_[4][3],+_[4][4]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3],+_[0][4]],[+_[1][0],+_[1][1],+w[1],+_[1][3],+_[1][4]],[+_[2][0],+_[2][1],+w[2],+_[2][3],+_[2][4]],[+_[3][0],+_[3][1],+w[3],+_[3][3],+_[3][4]],[+_[4][0],+_[4][1],+w[4],+_[4][3],+_[4][4]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0],+_[0][4]],[+_[1][0],+_[1][1],+_[1][2],+w[1],+_[1][4]],[+_[2][0],+_[2][1],+_[2][2],+w[2],+_[2][4]],[+_[3][0],+_[3][1],+_[3][2],+w[3],+_[3][4]],[+_[4][0],+_[4][1],+_[4][2],+w[4],+_[4][4]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+w[3]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+w[4]]]),A(_)]}}function T(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3],+_[0][4],+_[0][5]],[+w[1],+_[1][1],+_[1][2],+_[1][3],+_[1][4],+_[1][5]],[+w[2],+_[2][1],+_[2][2],+_[2][3],+_[2][4],+_[2][5]],[+w[3],+_[3][1],+_[3][2],+_[3][3],+_[3][4],+_[3][5]],[+w[4],+_[4][1],+_[4][2],+_[4][3],+_[4][4],+_[4][5]],[+w[5],+_[5][1],+_[5][2],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3],+_[0][4],+_[0][5]],[+_[1][0],+w[1],+_[1][2],+_[1][3],+_[1][4],+_[1][5]],[+_[2][0],+w[2],+_[2][2],+_[2][3],+_[2][4],+_[2][5]],[+_[3][0],+w[3],+_[3][2],+_[3][3],+_[3][4],+_[3][5]],[+_[4][0],+w[4],+_[4][2],+_[4][3],+_[4][4],+_[4][5]],[+_[5][0],+w[5],+_[5][2],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3],+_[0][4],+_[0][5]],[+_[1][0],+_[1][1],+w[1],+_[1][3],+_[1][4],+_[1][5]],[+_[2][0],+_[2][1],+w[2],+_[2][3],+_[2][4],+_[2][5]],[+_[3][0],+_[3][1],+w[3],+_[3][3],+_[3][4],+_[3][5]],[+_[4][0],+_[4][1],+w[4],+_[4][3],+_[4][4],+_[4][5]],[+_[5][0],+_[5][1],+w[5],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0],+_[0][4],+_[0][5]],[+_[1][0],+_[1][1],+_[1][2],+w[1],+_[1][4],+_[1][5]],[+_[2][0],+_[2][1],+_[2][2],+w[2],+_[2][4],+_[2][5]],[+_[3][0],+_[3][1],+_[3][2],+w[3],+_[3][4],+_[3][5]],[+_[4][0],+_[4][1],+_[4][2],+w[4],+_[4][4],+_[4][5]],[+_[5][0],+_[5][1],+_[5][2],+w[5],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+w[0],+_[0][5]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+w[1],+_[1][5]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+w[2],+_[2][5]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+w[3],+_[3][5]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+w[4],+_[4][5]],[+_[5][0],+_[5][1],+_[5][2],+_[5][3],+w[5],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+_[0][4],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+_[1][4],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+_[2][4],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+_[3][4],+w[3]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+_[4][4],+w[4]],[+_[5][0],+_[5][1],+_[5][2],+_[5][3],+_[5][4],+w[5]]]),A(_)]}}var l=[a,s];function g(A,M,_,w,m,u,v,y){return function(L,z){switch(L.length){case 0:return A(L,z);case 1:return M(L,z);case 2:return _(L,z);case 3:return w(L,z);case 4:return m(L,z);case 5:return u(L,z)}var F=v[L.length];return F||(F=v[L.length]=y(L.length)),F(L,z)}}function x(){for(;l.length1e-6?(g=Math.acos(x),A=Math.sin(g),M=Math.sin((1-i)*g)/A,_=Math.sin(i*g)/A):(M=1-i,_=i),r[0]=M*a+_*p,r[1]=M*s+_*d,r[2]=M*f+_*T,r[3]=M*c+_*l,r}}),799:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),a=o([`precision mediump float; +#define GLSLIFY 1 + +uniform sampler2D accumBuffer; +varying vec2 uv; + +void main() { + vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0)); + gl_FragColor = min(vec4(1,1,1,1), accum); +}`]);e.exports=function(s){return n(s,i,a,null,[{name:"position",type:"vec2"}])}}),811:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r}}),840:(function(e,t,r){var o=r(3236),n=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, normal; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model + , view + , projection + , inverseModel; +uniform vec3 eyePosition + , lightPosition; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +vec4 project(vec3 p) { + return projection * (view * (model * vec4(p, 1.0))); +} + +void main() { + gl_Position = project(position); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * vec4(position , 1.0); + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + f_color = color; + f_data = position; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness + , fresnel + , kambient + , kdiffuse + , kspecular; +uniform sampler2D texture; + +varying vec3 f_normal + , f_lightDirection + , f_eyeDirection + , f_data; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (f_color.a == 0.0 || + outOfRange(clipBounds[0], clipBounds[1], f_data) + ) discard; + + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d + + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * f_color.a; +} +`]),a=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; + +uniform mat4 model, view, projection; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_color = color; + f_data = position; + f_uv = uv; +}`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec3 f_data; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard; + + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),f=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute vec4 color; +attribute vec2 uv; +attribute float pointSize; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + } + gl_PointSize = pointSize; + f_color = color; + f_uv = uv; +}`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform sampler2D texture; +uniform float opacity; + +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5); + if(dot(pointR, pointR) > 0.25) { + discard; + } + gl_FragColor = f_color * texture2D(texture, f_uv) * opacity; +}`]),p=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec4 id; + +uniform mat4 model, view, projection; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + f_id = id; + f_position = position; +}`]),d=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]),T=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +attribute vec3 position; +attribute float pointSize; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform vec3 clipBounds[2]; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], position)) { + + gl_Position = vec4(0.0, 0.0, 0.0, 0.0); + } else { + gl_Position = projection * (view * (model * vec4(position, 1.0))); + gl_PointSize = pointSize; + } + f_id = id; + f_position = position; +}`]),l=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; + +uniform mat4 model, view, projection; + +void main() { + gl_Position = projection * (view * (model * vec4(position, 1.0))); +}`]),g=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:f,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:p,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:g,attributes:[{name:"position",type:"vec3"}]}}),855:(function(e,t,r){e.exports={init:x,sweepBipartite:_,sweepComplete:w,scanBipartite:m,scanComplete:u};var o=r(1888),n=r(8828),i=r(4192),a=1<<28,s=1024,f=o.mallocInt32(s),c=o.mallocInt32(s),p=o.mallocInt32(s),d=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),g=o.mallocDouble(s*8);function x(v){var y=n.nextPow2(v);f.length>>1;i(g,ne);for(var K=0,ue=0,le=0;le=a)te=te-a|0,A(p,d,ue--,te);else if(te>=0)A(f,c,K--,te);else if(te<=-a){te=-te-a|0;for(var H=0;H>>1;i(g,ne);for(var K=0,ue=0,te=0,le=0;le>1===g[2*le+3]>>1&&(ae=2,le+=1),H<0){for(var ie=-(H>>1)-1,ve=0;ve>1)-1;ae===0?A(f,c,K--,ie):ae===1?A(p,d,ue--,ie):ae===2&&A(T,l,te--,ie)}}}function m(v,y,I,L,z,F,N,B,R,U,j,Z){var re=0,fe=2*v,le=y,ce=y+v,V=1,ee=1;L?ee=a:V=a;for(var ne=z;ne>>1;i(g,H);for(var ae=0,ne=0;ne=a?(ve=!L,K-=a):(ve=!!L,K-=1),ve)M(f,c,ae++,K);else{var Ae=Z[K],Ce=fe*K,Fe=j[Ce+y+1],ze=j[Ce+y+1+v];e:for(var Ye=0;Ye>>1;i(g,K);for(var ue=0,ce=0;ce=a)f[ue++]=V-a;else{V-=1;var H=j[V],ae=re*V,ie=U[ae+y+1],ve=U[ae+y+1+v];e:for(var Ae=0;Ae=0;--Ae)if(f[Ae]===V){for(var Ye=Ae+1;Ye 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 — 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=n([`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); +} +`]),f=n([`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(c){var p=o(c,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},t.createPickShader=function(c){var p=o(c,i,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},t.createContourShader=function(c){var p=o(c,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p},t.createPickContourShader=function(c){var p=o(c,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p}}),1085:(function(e,t,r){var o=r(1371);e.exports=n;function n(i,a,s){a=typeof a=="number"?a:1,s=s||": ";var f=i.split(/\r?\n/),c=String(f.length+a-1).length;return f.map(function(p,d){var T=d+a,l=String(T).length,g=o(T,c-l);return g+s+p}).join(` +`)}}),1091:(function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}}),1125:(function(e,t,r){e.exports=i;var o=r(3250)[3];function n(a,s,f,c){for(var p=0;p<2;++p){var d=a[p],T=s[p],l=Math.min(d,T),g=Math.max(d,T),x=f[p],A=c[p],M=Math.min(x,A),_=Math.max(x,A);if(_0&&d>0||p<0&&d<0)return!1;var T=o(f,a,s),l=o(c,a,s);return T>0&&l>0||T<0&&l<0?!1:p===0&&d===0&&T===0&&l===0?n(a,s,f,c):!0}}),1278:(function(e,t,r){var o=r(2361),n=Math.pow(2,-1074),i=-1>>>0;e.exports=a;function a(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var c=o.hi(s),p=o.lo(s);return f>s==s>0?p===i?(c+=1,p=0):p+=1:p===0?(p=i,c-=1):p-=1,o.pack(p,c)}}),1283:(function(e,t,r){var o=r(9405),n=r(3236),i=n([`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; + } +}`]),a=n([`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=n([`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; + } +} +`]),f=n([`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; +} +`]),c=n([`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); +}`]),p=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],d={vertex:i,fragment:f,attributes:p},T={vertex:a,fragment:f,attributes:p},l={vertex:s,fragment:f,attributes:p},g={vertex:i,fragment:c,attributes:p},x={vertex:a,fragment:c,attributes:p},A={vertex:s,fragment:c,attributes:p};function M(_,w){var m=o(_,w),u=m.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,m}t.createPerspective=function(_){return M(_,d)},t.createOrtho=function(_){return M(_,T)},t.createProject=function(_){return M(_,l)},t.createPickPerspective=function(_){return M(_,g)},t.createPickOrtho=function(_){return M(_,x)},t.createPickProject=function(_){return M(_,A)}}),1303:(function(e,t,r){e.exports=i;var o=r(3250);function n(a,s){var f,c;if(s[0][0]s[1][0])f=s[1],c=s[0];else{var p=Math.min(a[0][1],a[1][1]),d=Math.max(a[0][1],a[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return dl?p-l:d-l}var g,x;a[0][1]s[1][0])f=s[1],c=s[0];else return n(s,a);var p,d;if(a[0][0]a[1][0])p=a[1],d=a[0];else return-n(a,s);var T=o(f,c,d),l=o(f,c,p);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(d,p,c),l=o(d,p,f),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return c[0]-d[0]}}),1318:(function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}}),1338:(function(e){function t(n,i,a){var s=n[a]|0;if(s<=0)return[];var f=new Array(s),c;if(a===n.length-1)for(c=0;c"u"&&(i=0),typeof n){case"number":if(n>0)return r(n|0,i);break;case"object":if(typeof n.length=="number")return t(n,i,0);break}return[]}e.exports=o}),1369:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){var a=i.length,s=i.words,f=0;if(a===1)f=s[0];else if(a===2)f=s[0]+s[1]*67108864;else for(var c=0;ci)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a=0?y[U]:R)}function z(B){var R=A(B);return R?I in R:v.indexOf(B)>=0}function F(B,R){var U,j=A(B);return j?j[I]=R:(U=v.indexOf(B),U>=0?y[U]=R:(U=v.length,y[U]=R,v[U]=B)),this}function N(B){var R=A(B),U,j;return R?I in R&&delete R[I]:(U=v.indexOf(B),U<0?!1:(j=v.length-1,v[U]=void 0,y[U]=y[j],v[U]=v[j],v.length=j,y.length=j,!0))}return Object.create(u.prototype,{get___:{value:M(L)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(N)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(y,I){return this.get___(y,I)},writable:!0,configurable:!0},has:{value:function(y){return this.has___(y)},writable:!0,configurable:!0},set:{value:function(y,I){return this.set___(y,I)},writable:!0,configurable:!0},delete:{value:function(y){return this.delete___(y)},writable:!0,configurable:!0}}),typeof n=="function"?(function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function v(){this instanceof u||w();var y=new n,I=void 0,L=!1;function z(R,U){return I?y.has(R)?y.get(R):I.get___(R,U):y.get(R,U)}function F(R){return y.has(R)||(I?I.has___(R):!1)}var N;o?N=function(R,U){return y.set(R,U),y.has(R)||(I||(I=new u),I.set(R,U)),this}:N=function(R,U){if(L)try{y.set(R,U)}catch{I||(I=new u),I.set___(R,U)}else y.set(R,U);return this};function B(R){var U=!!y.delete(R);return I&&I.delete___(R)||U}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(N)},delete___:{value:M(B)},permitHostObjects___:{value:M(function(R){if(R===r)L=!0;else throw new Error("bogus call to permitHostObjects___")})}})}v.prototype=u.prototype,e.exports=v,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()}),1570:(function(e){e.exports=r;var t=[function(){function n(i,a,s,f){for(var c=i.length,p=[],d=0;d>1,x=s[2*g+1];if(x===d)return g;d>1,x=s[2*g+1];if(x===d)return g;d>1,x=s[2*g+1];if(x===d)return g;d 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); +} +`]),f=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(d){return n(d,s,f,null,[{name:"position",type:"vec3"}])};var c=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position; +attribute vec3 normal; + +uniform mat4 model, view, projection; +uniform vec3 enable; +uniform vec3 bounds[2]; + +varying vec3 colorChannel; + +void main() { + + vec3 signAxis = sign(bounds[1] - bounds[0]); + + vec3 realNormal = signAxis * normal; + + if(dot(realNormal, enable) > 0.0) { + vec3 minRange = min(bounds[0], bounds[1]); + vec3 maxRange = max(bounds[0], bounds[1]); + vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0)); + gl_Position = projection * (view * (model * vec4(nPosition, 1.0))); + } else { + gl_Position = vec4(0,0,0,0); + } + + colorChannel = abs(realNormal); +} +`]),p=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 colors[3]; + +varying vec3 colorChannel; + +void main() { + gl_FragColor = colorChannel.x * colors[0] + + colorChannel.y * colors[1] + + colorChannel.z * colors[2]; +}`]);t.bg=function(d){return n(d,c,p,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}}),1888:(function(e,t,r){var o=r(8828),n=r(1338),i=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:n([32,0]),UINT16:n([32,0]),UINT32:n([32,0]),BIGUINT64:n([32,0]),INT8:n([32,0]),INT16:n([32,0]),INT32:n([32,0]),BIGINT64:n([32,0]),FLOAT:n([32,0]),DOUBLE:n([32,0]),DATA:n([32,0]),UINT8C:n([32,0]),BUFFER:n([32,0])});var a=typeof Uint8ClampedArray<"u",s=typeof BigUint64Array<"u",f=typeof BigInt64Array<"u",c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=n([32,0])),c.BIGUINT64||(c.BIGUINT64=n([32,0])),c.BIGINT64||(c.BIGINT64=n([32,0])),c.BUFFER||(c.BUFFER=n([32,0]));var p=c.DATA,d=c.BUFFER;t.free=function(B){if(i.isBuffer(B))d[o.log2(B.length)].push(B);else{if(Object.prototype.toString.call(B)!=="[object ArrayBuffer]"&&(B=B.buffer),!B)return;var R=B.length||B.byteLength,U=o.log2(R)|0;p[U].push(B)}};function T(N){if(N){var B=N.length||N.byteLength,R=o.log2(B);p[R].push(N)}}function l(N){T(N.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(B){d[o.log2(B.length)].push(B)},t.malloc=function(B,R){if(R===void 0||R==="arraybuffer")return g(B);switch(R){case"uint8":return x(B);case"uint16":return A(B);case"uint32":return M(B);case"int8":return _(B);case"int16":return w(B);case"int32":return m(B);case"float":case"float32":return u(B);case"double":case"float64":return v(B);case"uint8_clamped":return y(B);case"bigint64":return L(B);case"biguint64":return I(B);case"buffer":return F(B);case"data":case"dataview":return z(B);default:return null}return null};function g(B){var B=o.nextPow2(B),R=o.log2(B),U=p[R];return U.length>0?U.pop():new ArrayBuffer(B)}t.mallocArrayBuffer=g;function x(N){return new Uint8Array(g(N),0,N)}t.mallocUint8=x;function A(N){return new Uint16Array(g(2*N),0,N)}t.mallocUint16=A;function M(N){return new Uint32Array(g(4*N),0,N)}t.mallocUint32=M;function _(N){return new Int8Array(g(N),0,N)}t.mallocInt8=_;function w(N){return new Int16Array(g(2*N),0,N)}t.mallocInt16=w;function m(N){return new Int32Array(g(4*N),0,N)}t.mallocInt32=m;function u(N){return new Float32Array(g(4*N),0,N)}t.mallocFloat32=t.mallocFloat=u;function v(N){return new Float64Array(g(8*N),0,N)}t.mallocFloat64=t.mallocDouble=v;function y(N){return a?new Uint8ClampedArray(g(N),0,N):x(N)}t.mallocUint8Clamped=y;function I(N){return s?new BigUint64Array(g(8*N),0,N):null}t.mallocBigUint64=I;function L(N){return f?new BigInt64Array(g(8*N),0,N):null}t.mallocBigInt64=L;function z(N){return new DataView(g(N),0,N)}t.mallocDataView=z;function F(N){N=o.nextPow2(N);var B=o.log2(N),R=d[B];return R.length>0?R.pop():new i(N)}t.mallocBuffer=F,t.clearCache=function(){for(var B=0;B<32;++B)c.UINT8[B].length=0,c.UINT16[B].length=0,c.UINT32[B].length=0,c.INT8[B].length=0,c.INT16[B].length=0,c.INT32[B].length=0,c.FLOAT[B].length=0,c.DOUBLE[B].length=0,c.BIGUINT64[B].length=0,c.BIGINT64[B].length=0,c.UINT8C[B].length=0,p[B].length=0,d[B].length=0}}),1903:(function(e){e.exports=t;function t(r){var o=new Float32Array(16);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o}}),1944:(function(e,t,r){var o=r(5250),n=r(8210);e.exports=i;function i(a,s){for(var f=o(a[0],s[0]),c=1;c>1,F=f(u[z],v);F<=0?(F===0&&(L=z),y=z+1):F>0&&(I=z-1)}return L}t.findCell=T;function l(u,v){for(var y=new Array(u.length),I=0,L=y.length;I=u.length||f(u[re],z)!==0););}return y}t.incidence=l;function g(u,v){if(!v)return l(d(A(u,0)),u);for(var y=new Array(v),I=0;I>>R&1&&B.push(L[R]);v.push(B)}return p(v)}t.explode=x;function A(u,v){if(v<0)return[];for(var y=[],I=(1<0}_=_.filter(w);for(var m=_.length,u=new Array(m),v=new Array(m),M=0;M0;){var ae=ue.pop(),ie=re[ae];f(ie,function(ze,Ye){return ze-Ye});var ve=ie.length,Ae=te[ae],Ce;if(Ae===0){var N=_[ae];Ce=[N]}for(var M=0;M=0)&&(te[Fe]=Ae^1,ue.push(Fe),Ae===0)){var N=_[Fe];K(N)||(N.reverse(),Ce.push(N))}}Ae===0&&H.push(Ce)}return H}}),2145:(function(e,t){t.uniforms=i,t.attributes=a;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"},o=null;function n(s,f){if(!o){var c=Object.keys(r);o={};for(var p=0;p1)for(var g=0;g1&&F.drawBuffersWEBGL(n[z]);var j=v.getExtension("WEBGL_depth_texture");j?N?m.depth=l(v,I,L,j.UNSIGNED_INT_24_8_WEBGL,v.DEPTH_STENCIL,v.DEPTH_STENCIL_ATTACHMENT):B&&(m.depth=l(v,I,L,v.UNSIGNED_SHORT,v.DEPTH_COMPONENT,v.DEPTH_ATTACHMENT)):B&&N?m._depth_rb=g(v,I,L,v.DEPTH_STENCIL,v.DEPTH_STENCIL_ATTACHMENT):B?m._depth_rb=g(v,I,L,v.DEPTH_COMPONENT16,v.DEPTH_ATTACHMENT):N&&(m._depth_rb=g(v,I,L,v.STENCIL_INDEX,v.STENCIL_ATTACHMENT));var Z=v.checkFramebufferStatus(v.FRAMEBUFFER);if(Z!==v.FRAMEBUFFER_COMPLETE){m._destroyed=!0,v.bindFramebuffer(v.FRAMEBUFFER,null),v.deleteFramebuffer(m.handle),m.handle=null,m.depth&&(m.depth.dispose(),m.depth=null),m._depth_rb&&(v.deleteRenderbuffer(m._depth_rb),m._depth_rb=null);for(var U=0;UI||v<0||v>I)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");m._shape[0]=u,m._shape[1]=v;for(var L=c(y),z=0;zL||v<0||v>L)throw new Error("gl-fbo: Parameters are too large for FBO");y=y||{};var z=1;if("color"in y){if(z=Math.max(y.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(I){if(z>m.getParameter(I.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=m.UNSIGNED_BYTE,N=m.getExtension("OES_texture_float");if(y.float&&z>0){if(!N)throw new Error("gl-fbo: Context does not support floating point textures");F=m.FLOAT}else y.preferFloat&&z>0&&N&&(F=m.FLOAT);var B=!0;"depth"in y&&(B=!!y.depth);var R=!1;return"stencil"in y&&(R=!!y.stencil),new A(m,u,v,F,z,B,R,I)}}),2272:(function(e,t,r){var o=r(2646)[4];r(2478),e.exports=i;function n(a,s,f,c,p,d){var T=s.opposite(c,p);if(!(T<0)){if(p0;){for(var g=f.pop(),d=f.pop(),x=-1,A=-1,T=p[d],_=1;_=0||(s.flip(d,g),n(a,s,f,x,d,A),n(a,s,f,d,A,x),n(a,s,f,A,g,x),n(a,s,f,g,x,A))}}}),2334:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r[3]=Math.min(o[3],n[3]),r}}),2335:(function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}}),2361:(function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),o=new Uint32Array(r.buffer);if(r[0]=1,t=!0,o[1]===1072693248){let i=function(f,c){return o[0]=f,o[1]=c,r[0]},a=function(f){return r[0]=f,o[0]},s=function(f){return r[0]=f,o[1]};e.exports=function(c){return r[0]=c,[o[0],o[1]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else if(o[0]===1072693248){let i=function(f,c){return o[1]=f,o[0]=c,r[0]},a=function(f){return r[0]=f,o[1]},s=function(f){return r[0]=f,o[0]};e.exports=function(c){return r[0]=c,[o[1],o[0]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else t=!1}if(!t){let i=function(f,c){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(c,4,!0),n.readDoubleLE(0,!0)},a=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(0,!0)},s=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);e.exports=function(c){return n.writeDoubleLE(c,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}e.exports.sign=function(i){return e.exports.hi(i)>>>31},e.exports.exponent=function(i){var a=e.exports.hi(i);return(a<<1>>>21)-1023},e.exports.fraction=function(i){var a=e.exports.lo(i),s=e.exports.hi(i),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[a,f]},e.exports.denormalized=function(i){var a=e.exports.hi(i);return!(a&2146435072)}}),2408:(function(e){e.exports=t;function t(r,o,n){var i=Math.sin(n),a=Math.cos(n),s=o[0],f=o[1],c=o[2],p=o[3],d=o[8],T=o[9],l=o[10],g=o[11];return o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=s*a-d*i,r[1]=f*a-T*i,r[2]=c*a-l*i,r[3]=p*a-g*i,r[8]=s*i+d*a,r[9]=f*i+T*a,r[10]=c*i+l*a,r[11]=p*i+g*a,r}}),2419:(function(e){e.exports=t;function t(r){for(var o=1,n=1;nA-x?i(f,c,p,d,T,l,g,x,A,M,_):a(f,c,p,d,T,l,g,x,A,M,_)}return s}function o(){function i(p,d,T,l,g,x,A,M,_,w,m){for(var u=2*p,v=l,y=u*l;vw-_?l?i(p,d,T,g,x,A,M,_,w,m,u):a(p,d,T,g,x,A,M,_,w,m,u):l?s(p,d,T,g,x,A,M,_,w,m,u):f(p,d,T,g,x,A,M,_,w,m,u)}return c}function n(i){return i?r():o()}t.partial=n(!1),t.full=n(!0)}),2478:(function(e){function t(s,f,c,p,d){for(var T=d+1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>=0?(T=l,d=l-1):p=l+1}return T}function r(s,f,c,p,d){for(var T=d+1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>0?(T=l,d=l-1):p=l+1}return T}function o(s,f,c,p,d){for(var T=p-1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<0?(T=l,p=l+1):d=l-1}return T}function n(s,f,c,p,d){for(var T=p-1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<=0?(T=l,p=l+1):d=l-1}return T}function i(s,f,c,p,d){for(;p<=d;){var T=p+d>>>1,l=s[T],g=c!==void 0?c(l,f):l-f;if(g===0)return T;g<=0?p=T+1:d=T-1}return-1}function a(s,f,c,p,d,T){return typeof c=="function"?T(s,f,c,p===void 0?0:p|0,d===void 0?s.length-1:d|0):T(s,f,void 0,c===void 0?0:c|0,p===void 0?s.length-1:p|0)}e.exports={ge:function(s,f,c,p,d){return a(s,f,c,p,d,t)},gt:function(s,f,c,p,d){return a(s,f,c,p,d,r)},lt:function(s,f,c,p,d){return a(s,f,c,p,d,o)},le:function(s,f,c,p,d){return a(s,f,c,p,d,n)},eq:function(s,f,c,p,d){return a(s,f,c,p,d,i)}}}),2504:(function(e){e.exports=t;function t(r,o,n){var i=n[0],a=n[1],s=n[2];return r[0]=o[0]*i,r[1]=o[1]*i,r[2]=o[2]*i,r[3]=o[3]*i,r[4]=o[4]*a,r[5]=o[5]*a,r[6]=o[6]*a,r[7]=o[7]*a,r[8]=o[8]*s,r[9]=o[9]*s,r[10]=o[10]*s,r[11]=o[11]*s,r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15],r}}),2538:(function(e,t,r){var o=r(8902),n=r(5542),i=r(2272),a=r(5023);e.exports=d;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function f(T,l){return T[0]-l[0]||T[1]-l[1]}function c(T){return T.map(s).sort(f)}function p(T,l,g){return l in T?T[l]:g}function d(T,l,g){Array.isArray(l)?(g=g||{},l=l||[]):(g=l||{},l=[]);var x=!!p(g,"delaunay",!0),A=!!p(g,"interior",!0),M=!!p(g,"exterior",!0),_=!!p(g,"infinity",!1);if(!A&&!M||T.length===0)return[];var w=o(T,l);if(x||A!==M||_){for(var m=n(T.length,c(l)),u=0;u0){if(fe=1,V[ne++]=p(m[I],x,A,M),I+=j,_>0)for(re=1,L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,re=2;re<_;++re)L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;for(I+=Z,ne=0,Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Ae,Ae=Ce,Ce=Ye,fe=2;fe0)for(re=1,L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,B,U,ve,Fe,x,A,M)),ne+=1,I+=j,re=2;re<_;++re)L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,B,U,ve,Fe,x,A,M),Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;fe&1&&(ne=0),Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Ae,Ae=Ce,Ce=Ye,I+=Z}}T(ee),T(V)}},"false,1,0":function(f,c,p,d,T){return function(g,x,A,M){var _=g.shape[0]|0,w=g.shape[1]|0,m=g.data,u=g.offset|0,v=g.stride[0]|0,y=g.stride[1]|0,I=u,L,z=-v|0,F=0,N=-y|0,B=0,R=-v-y|0,U=0,j=y|0,Z=v-y*w|0,re=0,fe=0,le=0,ce=2*w|0,V=d(ce),ee=d(ce),ne=0,K=0,ue=-1,te=-1,H=0,ae=-w|0,ie=w|0,ve=0,Ae=-w-1|0,Ce=w-1|0,Fe=0,ze=0,Ye=0;for(fe=0;fe0){if(re=1,V[ne++]=p(m[I],x,A,M),I+=j,w>0)for(fe=1,L=m[I],K=V[ne]=p(L,x,A,M),ve=V[ne+ae],H=V[ne+ue],Fe=V[ne+Ae],(K!==ve||K!==H||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,ve,H,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,fe=2;fe0)for(fe=1,L=m[I],K=V[ne]=p(L,x,A,M),ve=V[ne+ae],H=V[ne+ue],Fe=V[ne+Ae],(K!==ve||K!==H||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,ve,H,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,U,F,Fe,ve,x,A,M)),ne+=1,I+=j,fe=2;fe 0"),typeof s.vertex!="function"&&f("Must specify vertex creation function"),typeof s.cell!="function"&&f("Must specify cell creation function"),typeof s.phase!="function"&&f("Must specify phase function");for(var T=s.getters||[],l=new Array(p),g=0;g=0?l[g]=!0:l[g]=!1;return i(s.vertex,s.cell,s.phase,d,c,l)}}),2642:(function(e,t,r){e.exports=i;var o=r(727);function n(a){for(var s=0,f=0;fl[1][2]&&(I[0]=-I[0]),l[0][2]>l[2][0]&&(I[1]=-I[1]),l[1][0]>l[0][1]&&(I[2]=-I[2]),!0};function x(_,w,m){var u=w[0],v=w[1],y=w[2],I=w[3];return _[0]=m[0]*u+m[4]*v+m[8]*y+m[12]*I,_[1]=m[1]*u+m[5]*v+m[9]*y+m[13]*I,_[2]=m[2]*u+m[6]*v+m[10]*y+m[14]*I,_[3]=m[3]*u+m[7]*v+m[11]*y+m[15]*I,_}function A(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,m,u,v){_[0]=w[0]*u+m[0]*v,_[1]=w[1]*u+m[1]*v,_[2]=w[2]*u+m[2]*v}}),2653:(function(e,t,r){var o=r(3865);e.exports=n;function n(i,a){for(var s=i.length,f=new Array(s),c=0;c=c[A]&&(x+=1);l[g]=x}}return f}function s(f,c){try{return o(f,!0)}catch{var p=n(f);if(p.length<=c)return[];var d=i(f,p),T=o(d,!0);return a(T,p)}}}),2762:(function(e,t,r){var o=r(1888),n=r(5298),i=r(9618),a=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,g,x,A,M){this.gl=l,this.type=g,this.handle=x,this.length=A,this.usage=M}var f=s.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)};function c(l,g,x,A,M,_){var w=M.length*M.BYTES_PER_ELEMENT;if(_<0)return l.bufferData(g,M,A),w;if(w+_>x)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(g,_,M),x}function p(l,g){for(var x=o.malloc(l.length,g),A=l.length,M=0;M=0;--A){if(g[A]!==x)return!1;x*=l[A]}return!0}f.update=function(l,g){if(typeof g!="number"&&(g=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var x=l.dtype;if(a.indexOf(x)<0&&(x="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&x!=="uint16"?x="uint32":x="uint16"}if(x===l.dtype&&d(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,l.data,g):this.length=c(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),g);else{var M=o.malloc(l.size,x),_=i(M,l.shape);n.assign(_,l),g<0?this.length=c(this.gl,this.type,this.length,this.usage,M,g):this.length=c(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),g),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=p(l,"uint16"):w=p(l,"float32"),g<0?this.length=c(this.gl,this.type,this.length,this.usage,w,g):this.length=c(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),g),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=c(this.gl,this.type,this.length,this.usage,l,g);else if(typeof l=="number"||l===void 0){if(g>=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,g,x,A){if(x=x||l.ARRAY_BUFFER,A=A||l.DYNAMIC_DRAW,x!==l.ARRAY_BUFFER&&x!==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(A!==l.DYNAMIC_DRAW&&A!==l.STATIC_DRAW&&A!==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 M=l.createBuffer(),_=new s(l,x,M,0,A);return _.update(g),_}e.exports=T}),2825:(function(e){e.exports=t;function t(r,o,n){var i=new Float32Array(3);return i[0]=r,i[1]=o,i[2]=n,i}}),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)}}),2933:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}}),2953:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2];return n*n+i*i+a*a}}),2962:(function(e,t,r){var o=r(5250),n=r(8210),i=r(3012),a=r(7004),s=6;function f(A,M,_,w){return function(u){return w(A(_(u[0][0],u[1][1]),_(-u[0][1],u[1][0])))}}function c(A,M,_,w){return function(u){return w(A(M(A(_(u[1][1],u[2][2]),_(-u[1][2],u[2][1])),u[0][0]),A(M(A(_(u[1][0],u[2][2]),_(-u[1][2],u[2][0])),-u[0][1]),M(A(_(u[1][0],u[2][1]),_(-u[1][1],u[2][0])),u[0][2]))))}}function p(A,M,_,w){return function(u){return w(A(A(M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][1]),A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),-u[1][2]),M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][2]),M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),A(M(A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),M(A(M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function d(A,M,_,w){return function(u){return w(A(A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),A(M(A(A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),M(A(A(M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function T(A){var M=A===2?f:A===3?c:A===4?p:A===5?d:void 0;return M(n,i,o,a)}var l=[function(){return[0]},function(M){return[M[0][0]]}];function g(A,M,_,w,m,u,v,y){return function(L){switch(L.length){case 0:return A(L);case 1:return M(L);case 2:return _(L);case 3:return w(L);case 4:return m(L);case 5:return u(L)}var z=v[L.length];return z||(z=v[L.length]=y(L.length)),z(L)}}function x(){for(;l.length0){y=c[z][u][0],L=z;break}I=y[L^1];for(var F=0;F<2;++F)for(var N=c[F][u],B=0;B0&&(y=R,I=U,L=F)}return v||y&&l(y,L),I}function x(m,u){var v=c[u][m][0],y=[m];l(v,u);for(var I=v[u^1];;){for(;I!==m;)y.push(I),I=g(y[y.length-2],I,!1);if(c[0][m].length+c[1][m].length===0)break;var L=y[y.length-1],z=m,F=y[1],N=g(L,z,!0);if(o(a[L],a[z],a[F],a[N])<0)break;y.push(m),I=g(L,z)}return y}function A(m,u){return u[1]===u[u.length-1]}for(var p=0;p0;){c[0][p].length;var w=x(p,M);A(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}}),3090:(function(e,t,r){e.exports=n;var o=r(3250)[3];function n(i){var a=i.length;if(a<3){for(var g=new Array(a),s=0;s1&&o(i[c[l-2]],i[c[l-1]],T)<=0;)l-=1,c.pop();for(c.push(d),l=p.length;l>1&&o(i[p[l-2]],i[p[l-1]],T)>=0;)l-=1,p.pop();p.push(d)}for(var g=new Array(p.length+c.length-2),x=0,s=0,A=c.length;s0;--M)g[x++]=p[M];return g}}),3105:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),3126:(function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}}),3134:(function(e,t,r){e.exports=n;var o=r(1682);function n(i,a){var s=i.length;if(typeof a!="number"){a=0;for(var f=0;f=0}function c(p,d,T,l){var g=o(d,T,l);if(g===0){var x=n(o(p,d,T)),A=n(o(p,d,l));if(x===A){if(x===0){var M=f(p,d,T),_=f(p,d,l);return M===_?0:M?1:-1}return 0}else{if(A===0)return x>0||f(p,d,l)?-1:1;if(x===0)return A>0||f(p,d,T)?1:-1}return n(A-x)}var w=o(p,d,T);if(w>0)return g>0&&o(p,d,l)>0?1:-1;if(w<0)return g>0||o(p,d,l)>0?1:-1;var m=o(p,d,l);return m>0||f(p,d,T)?1:-1}}),3202:(function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var n=parseFloat(r,10);return o[0]=n,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}}),3233:(function(e){var t="",r;e.exports=o;function o(n,i){if(typeof n!="string")throw new TypeError("expected a string");if(i===1)return n;if(i===2)return n+n;var a=n.length*i;if(r!==n||typeof r>"u")r=n,t="";else if(t.length>=a)return t.substr(0,a);for(;a>t.length&&i>1;)i&1&&(t+=n),i>>=1,n+=n;return t+=n,t=t.substr(0,a),t}}),3236:(function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],n=0;n0){if(z<=0)return F;N=L+z}else if(L<0){if(z>=0)return F;N=-(L+z)}else return F;var B=c*N;return F>=B||F<=-B?F:x(v,y,I)},function(v,y,I,L){var z=v[0]-L[0],F=y[0]-L[0],N=I[0]-L[0],B=v[1]-L[1],R=y[1]-L[1],U=I[1]-L[1],j=v[2]-L[2],Z=y[2]-L[2],re=I[2]-L[2],fe=F*U,le=N*R,ce=N*B,V=z*U,ee=z*R,ne=F*B,K=j*(fe-le)+Z*(ce-V)+re*(ee-ne),ue=(Math.abs(fe)+Math.abs(le))*Math.abs(j)+(Math.abs(ce)+Math.abs(V))*Math.abs(Z)+(Math.abs(ee)+Math.abs(ne))*Math.abs(re),te=p*ue;return K>te||-K>te?K:A(v,y,I,L)}];function _(u){var v=M[u.length];return v||(v=M[u.length]=g(u.length)),v.apply(void 0,u)}function w(u,v,y,I,L,z,F){return function(B,R,U,j,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return I(B,R);case 3:return L(B,R,U);case 4:return z(B,R,U,j);case 5:return F(B,R,U,j,Z)}for(var re=new Array(arguments.length),fe=0;fe4)throw new n("","Invalid data type");switch(j.charAt(0)){case"b":case"i":f["uniform"+Z+"iv"](d[z],F);break;case"v":f["uniform"+Z+"fv"](d[z],F);break;default:throw new n("","Unrecognized data type for vector "+name+": "+j)}}else if(j.indexOf("mat")===0&&j.length===4){if(Z=j.charCodeAt(j.length-1)-48,Z<2||Z>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+j);f["uniformMatrix"+Z+"fv"](d[z],!1,F);break}else throw new n("","Unknown uniform data type for "+name+": "+j)}}}}}function g(w,m){if(typeof m!="object")return[[w,m]];var u=[];for(var v in m){var y=m[v],I=w;parseInt(v)+""===v?I+="["+v+"]":I+="."+v,typeof y=="object"?u.push.apply(u,g(I,y)):u.push([I,y])}return u}function x(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var m=w.indexOf("vec");if(0<=m&&m<=1&&w.length===4+m){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid data type");return w.charAt(0)==="b"?a(u,!1):a(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+w);return a(u*u,0)}else throw new n("","Unknown uniform data type for "+name+": "+w)}}function A(w,m,u){if(typeof u=="object"){var v=M(u);Object.defineProperty(w,m,{get:i(v),set:l(u),enumerable:!0,configurable:!1})}else d[u]?Object.defineProperty(w,m,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[m]=x(p[u].type)}function M(w){var m;if(Array.isArray(w)){m=new Array(w.length);for(var u=0;u=0!=m>=0&&d.push(x[0]+.5+.5*(w+m)/(w-m))}p+=_,++x[0]}}}function r(){return t()}var o=r;function n(s){var f={};return function(p,d,T){var l=p.dtype,g=p.order,x=[l,g.join()].join(),A=f[x];return A||(f[x]=A=s([l,g])),A(p.shape.slice(0),p.data,p.stride,p.offset|0,d,T)}}function i(s){return n(o.bind(void 0,s))}function a(s){return i({funcName:s.funcName})}e.exports=a({funcName:"zeroCrossings"})}),3352:(function(e,t,r){var o=r(2478),n=0,i=1,a=2;e.exports=v;function s(y,I,L,z,F){this.mid=y,this.left=I,this.right=L,this.leftPoints=z,this.rightPoints=F,this.count=(I?I.count:0)+(L?L.count:0)+z.length}var f=s.prototype;function c(y,I){y.mid=I.mid,y.left=I.left,y.right=I.right,y.leftPoints=I.leftPoints,y.rightPoints=I.rightPoints,y.count=I.count}function p(y,I){var L=w(I);y.mid=L.mid,y.left=L.left,y.right=L.right,y.leftPoints=L.leftPoints,y.rightPoints=L.rightPoints,y.count=L.count}function d(y,I){var L=y.intervals([]);L.push(I),p(y,L)}function T(y,I){var L=y.intervals([]),z=L.indexOf(I);return z<0?n:(L.splice(z,1),p(y,L),i)}f.intervals=function(y){return y.push.apply(y,this.leftPoints),this.left&&this.left.intervals(y),this.right&&this.right.intervals(y),y},f.insert=function(y){var I=this.count-this.leftPoints.length;if(this.count+=1,y[1]3*(I+1)?d(this,y):this.left.insert(y):this.left=w([y]);else if(y[0]>this.mid)this.right?4*(this.right.count+1)>3*(I+1)?d(this,y):this.right.insert(y):this.right=w([y]);else{var L=o.ge(this.leftPoints,y,M),z=o.ge(this.rightPoints,y,_);this.leftPoints.splice(L,0,y),this.rightPoints.splice(z,0,y)}},f.remove=function(y){var I=this.count-this.leftPoints;if(y[1]3*(I-1))return T(this,y);var z=this.left.remove(y);return z===a?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(y[0]>this.mid){if(!this.right)return n;var F=this.left?this.left.count:0;if(4*F>3*(I-1))return T(this,y);var z=this.right.remove(y);return z===a?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===y?a:n;if(this.leftPoints.length===1&&this.leftPoints[0]===y){if(this.left&&this.right){for(var N=this,B=this.left;B.right;)N=B,B=B.right;if(N===this)B.right=this.right;else{var R=this.left,z=this.right;N.count-=B.count,N.right=B.left,B.left=R,B.right=z}c(this,B),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return i}for(var R=o.ge(this.leftPoints,y,M);R=0&&y[z][1]>=I;--z){var F=L(y[z]);if(F)return F}}function x(y,I){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(y,I);if(L)return L}return g(this.rightPoints,y,I)}else return x(this.leftPoints,I)},f.queryInterval=function(y,I,L){if(ythis.mid&&this.right){var z=this.right.queryInterval(y,I,L);if(z)return z}return Ithis.mid?g(this.rightPoints,y,L):x(this.leftPoints,L)};function A(y,I){return y-I}function M(y,I){var L=y[0]-I[0];return L||y[1]-I[1]}function _(y,I){var L=y[1]-I[1];return L||y[0]-I[0]}function w(y){if(y.length===0)return null;for(var I=[],L=0;L>1],F=[],N=[],B=[],L=0;L=0),_.type){case"b":g=parseInt(g,10).toString(2);break;case"c":g=String.fromCharCode(parseInt(g,10));break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,_.width?parseInt(_.width):0);break;case"e":g=_.precision?parseFloat(g).toExponential(_.precision):parseFloat(g).toExponential();break;case"f":g=_.precision?parseFloat(g).toFixed(_.precision):parseFloat(g);break;case"g":g=_.precision?String(Number(g.toPrecision(_.precision))):parseFloat(g);break;case"o":g=(parseInt(g,10)>>>0).toString(8);break;case"s":g=String(g),g=_.precision?g.substring(0,_.precision):g;break;case"t":g=String(!!g),g=_.precision?g.substring(0,_.precision):g;break;case"T":g=Object.prototype.toString.call(g).slice(8,-1).toLowerCase(),g=_.precision?g.substring(0,_.precision):g;break;case"u":g=parseInt(g,10)>>>0;break;case"v":g=g.valueOf(),g=_.precision?g.substring(0,_.precision):g;break;case"x":g=(parseInt(g,10)>>>0).toString(16);break;case"X":g=(parseInt(g,10)>>>0).toString(16).toUpperCase();break}n.json.test(_.type)?x+=g:(n.number.test(_.type)&&(!v||_.sign)?(y=v?"+":"-",g=g.toString().replace(n.sign,"")):y="",m=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(y+g).length,w=_.width&&u>0?m.repeat(u):"",x+=_.align?y+g+w:m==="0"?y+w+g:w+y+g)}return x}var f=Object.create(null);function c(p){if(f[p])return f[p];for(var d=p,T,l=[],g=0;d;){if((T=n.text.exec(d))!==null)l.push(T[0]);else if((T=n.modulo.exec(d))!==null)l.push("%");else if((T=n.placeholder.exec(d))!==null){if(T[2]){g|=1;var x=[],A=T[2],M=[];if((M=n.key.exec(A))!==null)for(x.push(M[1]);(A=A.substring(M[0].length))!=="";)if((M=n.key_access.exec(A))!==null)x.push(M[1]);else if((M=n.index_access.exec(A))!==null)x.push(M[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]=x}else g|=2;if(g===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 f[p]=l}t.sprintf=i,t.vsprintf=a,typeof window<"u"&&(window.sprintf=i,window.vsprintf=a,o=(function(){return{sprintf:i,vsprintf:a}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()}),3390:(function(e){e.exports=t;function t(r,o,n,i){var a=new Float32Array(4);return a[0]=r,a[1]=o,a[2]=n,a[3]=i,a}}),3436:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision highp float; +#define GLSLIFY 1 + +attribute vec3 position, offset; +attribute vec4 color; +uniform mat4 model, view, projection; +uniform float capSize; +varying vec4 fragColor; +varying vec3 fragPosition; + +void main() { + vec4 worldPosition = model * vec4(position, 1.0); + worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0); + gl_Position = projection * (view * worldPosition); + fragColor = color; + fragPosition = position; +}`]),a=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float opacity; +varying vec3 fragPosition; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], fragPosition) || + fragColor.a * opacity == 0. + ) discard; + + gl_FragColor = opacity * fragColor; +}`]);e.exports=function(s){return n(s,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}}),3502:(function(e,t,r){e.exports=i;var o=r(5995),n=r(9127);function i(a,s){return n(o(a,s))}}),3508:(function(e,t,r){var o=r(6852);o=o.slice().filter(function(n){return!/^(gl\_|texture)/.test(n)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])}),3536:(function(e){e.exports=t;function t(r,o){var n=o[0],i=o[1],a=o[2],s=n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}}),3545:(function(e,t,r){e.exports=s;var o=r(8105),n=o("lop&&T[w+c]>M;--_,w-=g){for(var m=w,u=w+g,v=0;v>>1,M=2*f,_=A,w=T[M*A+c];g=I?(_=y,w=I):v>=z?(_=u,w=v):(_=L,w=z):I>=z?(_=y,w=I):z>=v?(_=u,w=v):(_=L,w=z);for(var B=M*(x-1),R=M*_,F=0;Fthis.buffer.length){n.free(this.buffer);for(var x=this.buffer=n.mallocUint8(a(g*l*4)),A=0;A_|0},vertex:function(x,A,M,_,w,m,u,v,y,I,L,z,F){var N=(u<<0)+(v<<1)+(y<<2)+(I<<3)|0;if(!(N===0||N===15))switch(N){case 0:L.push([x-.5,A-.5]);break;case 1:L.push([x-.25-.25*(_+M-2*F)/(M-_),A-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:L.push([x-.75-.25*(-_-M+2*F)/(_-M),A-.25-.25*(m+_-2*F)/(_-m)]);break;case 3:L.push([x-.5,A-.5-.5*(w+M+m+_-4*F)/(M-w+_-m)]);break;case 4:L.push([x-.25-.25*(m+w-2*F)/(w-m),A-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:L.push([x-.5-.5*(_+M+m+w-4*F)/(M-_+w-m),A-.5]);break;case 6:L.push([x-.5-.25*(-_-M+m+w)/(_-M+w-m),A-.5-.25*(-w-M+m+_)/(w-M+_-m)]);break;case 7:L.push([x-.75-.25*(m+w-2*F)/(w-m),A-.75-.25*(m+_-2*F)/(_-m)]);break;case 8:L.push([x-.75-.25*(-m-w+2*F)/(m-w),A-.75-.25*(-m-_+2*F)/(m-_)]);break;case 9:L.push([x-.5-.25*(_+M+-m-w)/(M-_+m-w),A-.5-.25*(w+M+-m-_)/(M-w+m-_)]);break;case 10:L.push([x-.5-.5*(-_-M+-m-w+4*F)/(_-M+m-w),A-.5]);break;case 11:L.push([x-.25-.25*(-m-w+2*F)/(m-w),A-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:L.push([x-.5,A-.5-.5*(-w-M+-m-_+4*F)/(w-M+m-_)]);break;case 13:L.push([x-.75-.25*(_+M-2*F)/(M-_),A-.25-.25*(-m-_+2*F)/(m-_)]);break;case 14:L.push([x-.25-.25*(-_-M+2*F)/(_-M),A-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:L.push([x-.5,A-.5]);break}},cell:function(x,A,M,_,w,m,u,v,y){w?v.push([x,A]):v.push([A,x])}});return function(g,x){var A=[],M=[];return l(g,A,M,x),{positions:A,cells:M}}}};function a(p,d){var T=p.length+"d",l=i[T];if(l)return l(o,p,d)}function s(p,d){for(var T=n(p,d),l=T.length,g=new Array(l),x=new Array(l),A=0;A>1,T=-7,l=n?a-1:0,g=n?-1:1,x=r[o+l];for(l+=g,s=x&(1<<-T)-1,x>>=-T,T+=c;T>0;s=s*256+r[o+l],l+=g,T-=8);for(f=s&(1<<-T)-1,s>>=-T,T+=i;T>0;f=f*256+r[o+l],l+=g,T-=8);if(s===0)s=1-d;else{if(s===p)return f?NaN:(x?-1:1)*(1/0);f=f+Math.pow(2,i),s=s-d}return(x?-1:1)*f*Math.pow(2,s-i)},t.write=function(r,o,n,i,a,s){var f,c,p,d=s*8-a-1,T=(1<>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:s-1,A=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,f=T):(f=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-f))<1&&(f--,p*=2),f+l>=1?o+=g/p:o+=g*Math.pow(2,1-l),o*p>=2&&(f++,p/=2),f+l>=T?(c=0,f=T):f+l>=1?(c=(o*p-1)*Math.pow(2,a),f=f+l):(c=o*Math.pow(2,l-1)*Math.pow(2,a),f=0));a>=8;r[n+x]=c&255,x+=A,c/=256,a-=8);for(f=f<0;r[n+x]=f&255,x+=A,f/=256,d-=8);r[n+x-A]|=M*128}}),3788:(function(e,t,r){var o=r(8507),n=r(2419);e.exports=i;function i(a,s){return o(a,s)||n(a)-n(s)}}),3837:(function(e,t,r){e.exports=L;var o=r(4935),n=r(501),i=r(5304),a=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,p=DataView;function d(z){return c.isView(z)&&!(z instanceof p)}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 g(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var x=g.prototype;x.update=function(z){z=z||{};function F(K,ue,te){if(te in z){var H=z[te],ae=this[te],ie;(K?T(H)&&T(H[0]):T(H))?this[te]=ie=[ue(H[0]),ue(H[1]),ue(H[2])]:this[te]=ie=[ue(H),ue(H),ue(H)];for(var ve=0;ve<3;++ve)if(ie[ve]!==ae[ve])return!0}return!1}var N=F.bind(this,!1,Number),B=F.bind(this,!1,Boolean),R=F.bind(this,!1,String),U=F.bind(this,!0,function(K){if(T(K)){if(K.length===3)return[+K[0],+K[1],+K[2],1];if(K.length===4)return[+K[0],+K[1],+K[2],+K[3]]}return[0,0,0,1]}),j,Z=!1,re=!1;if("bounds"in z)for(var fe=z.bounds,le=0;le<2;++le)for(var ce=0;ce<3;++ce)fe[le][ce]!==this.bounds[le][ce]&&(re=!0),this.bounds[le][ce]=fe[le][ce];if("ticks"in z){j=z.ticks,Z=!0,this.autoTicks=!1;for(var le=0;le<3;++le)this.tickSpacing[le]=0}else N("tickSpacing")&&(this.autoTicks=!0,re=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),re=!0,Z=!0,this._firstInit=!1),re&&this.autoTicks&&(j=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var le=0;le<3;++le)j[le].sort(function(ue,te){return ue.x-te.x});s.equal(j,this.ticks)?Z=!1:this.ticks=j}B("tickEnable"),R("tickFont")&&(Z=!0),R("tickFontStyle")&&(Z=!0),R("tickFontWeight")&&(Z=!0),R("tickFontVariant")&&(Z=!0),N("tickSize"),N("tickAngle"),N("tickPad"),U("tickColor");var V=R("labels");R("labelFont")&&(V=!0),R("labelFontStyle")&&(V=!0),R("labelFontWeight")&&(V=!0),R("labelFontVariant")&&(V=!0),B("labelEnable"),N("labelSize"),N("labelPad"),U("labelColor"),B("lineEnable"),B("lineMirror"),N("lineWidth"),U("lineColor"),B("lineTickEnable"),B("lineTickMirror"),N("lineTickLength"),N("lineTickWidth"),U("lineTickColor"),B("gridEnable"),N("gridWidth"),U("gridColor"),B("zeroEnable"),U("zeroLineColor"),N("zeroLineWidth"),B("backgroundEnable"),U("backgroundColor");var ee=[{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]}],ne=[{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&&(V||Z)&&this._text.update(this.bounds,this.labels,ee,this.ticks,ne):this._text=o(this.gl,this.bounds,this.labels,ee,this.ticks,ne),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function A(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new A,new A,new A];function _(z,F,N,B,R){for(var U=z.primalOffset,j=z.primalMinor,Z=z.mirrorOffset,re=z.mirrorMinor,fe=B[F],le=0;le<3;++le)if(F!==le){var ce=U,V=Z,ee=j,ne=re;fe&1<0?(ee[le]=-1,ne[le]=0):(ee[le]=0,ne[le]=1)}}var w=[0,0,0],m={model:f,view:f,projection:f,_ortho:!1};x.isOpaque=function(){return!0},x.isTransparent=function(){return!1},x.drawTransparent=function(z){};var u=0,v=[0,0,0],y=[0,0,0],I=[0,0,0];x.draw=function(z){z=z||m;for(var te=this.gl,F=z.model||f,N=z.view||f,B=z.projection||f,R=this.bounds,U=z._ortho||!1,j=a(F,N,B,R,U),Z=j.cubeEdges,re=j.axis,fe=N[12],le=N[13],ce=N[14],V=N[15],ee=U?2:1,ne=ee*this.pixelRatio*(B[3]*fe+B[7]*le+B[11]*ce+B[15]*V)/te.drawingBufferHeight,K=0;K<3;++K)this.lastCubeProps.cubeEdges[K]=Z[K],this.lastCubeProps.axis[K]=re[K];for(var ue=M,K=0;K<3;++K)_(M[K],K,this.bounds,Z,re);for(var te=this.gl,H=w,K=0;K<3;++K)this.backgroundEnable[K]?H[K]=re[K]:H[K]=0;this._background.draw(F,N,B,R,H,this.backgroundColor),this._lines.bind(F,N,B,this);for(var K=0;K<3;++K){var ae=[0,0,0];re[K]>0?ae[K]=R[1][K]:ae[K]=R[0][K];for(var ie=0;ie<2;++ie){var ve=(K+1+ie)%3,Ae=(K+1+(ie^1))%3;this.gridEnable[ve]&&this._lines.drawGrid(ve,Ae,this.bounds,ae,this.gridColor[ve],this.gridWidth[ve]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var ve=(K+1+ie)%3,Ae=(K+1+(ie^1))%3;this.zeroEnable[Ae]&&Math.min(R[0][Ae],R[1][Ae])<=0&&Math.max(R[0][Ae],R[1][Ae])>=0&&this._lines.drawZero(ve,Ae,this.bounds,ae,this.zeroLineColor[Ae],this.zeroLineWidth[Ae]*this.pixelRatio)}}for(var K=0;K<3;++K){this.lineEnable[K]&&this._lines.drawAxisLine(K,this.bounds,ue[K].primalOffset,this.lineColor[K],this.lineWidth[K]*this.pixelRatio),this.lineMirror[K]&&this._lines.drawAxisLine(K,this.bounds,ue[K].mirrorOffset,this.lineColor[K],this.lineWidth[K]*this.pixelRatio);for(var Ce=l(v,ue[K].primalMinor),Fe=l(y,ue[K].mirrorMinor),ze=this.lineTickLength,ie=0;ie<3;++ie){var Ye=ne/F[5*ie];Ce[ie]*=ze[ie]*Ye,Fe[ie]*=ze[ie]*Ye}this.lineTickEnable[K]&&this._lines.drawAxisTicks(K,ue[K].primalOffset,Ce,this.lineTickColor[K],this.lineTickWidth[K]*this.pixelRatio),this.lineTickMirror[K]&&this._lines.drawAxisTicks(K,ue[K].mirrorOffset,Fe,this.lineTickColor[K],this.lineTickWidth[K]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,N,B,this.pixelRatio);var it,st=.5,nt,Qe;function Le(rt){Qe=[0,0,0],Qe[rt]=1}function Te(rt,Ft,Nt){var $t=(rt+1)%3,rr=(rt+2)%3,Mr=Ft[$t],Sr=Ft[rr],Zr=Nt[$t],Ar=Nt[rr];if(Mr>0&&Ar>0){Le($t);return}else if(Mr>0&&Ar<0){Le($t);return}else if(Mr<0&&Ar>0){Le($t);return}else if(Mr<0&&Ar<0){Le($t);return}else if(Sr>0&&Zr>0){Le(rr);return}else if(Sr>0&&Zr<0){Le(rr);return}else if(Sr<0&&Zr>0){Le(rr);return}else if(Sr<0&&Zr<0){Le(rr);return}}for(var K=0;K<3;++K){for(var pe=ue[K].primalMinor,Ne=ue[K].mirrorMinor,ot=l(I,ue[K].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[K]&&(ot[ie]+=ne*pe[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var ct=[0,0,0];if(ct[K]=1,this.tickEnable[K]){this.tickAngle[K]===-3600?(this.tickAngle[K]=0,this.tickAlign[K]="auto"):this.tickAlign[K]=-1,nt=1,it=[this.tickAlign[K],st,nt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]),Qe=[0,0,0],Te(K,pe,Ne);for(var ie=0;ie<3;++ie)ot[ie]+=ne*pe[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks(K,this.tickSize[K],this.tickAngle[K],ot,this.tickColor[K],ct,Qe,it)}if(this.labelEnable[K]){nt=0,Qe=[0,0,0],this.labels[K].length>4&&(Le(K),nt=1),it=[this.labelAlign[K],st,nt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]);for(var ie=0;ie<3;++ie)ot[ie]+=ne*pe[ie]*this.labelPad[ie]/F[5*ie];ot[K]+=.5*(R[0][K]+R[1][K]),this._text.drawLabel(K,this.labelSize[K],this.labelAngle[K],ot,this.labelColor[K],[0,0,0],Qe,it)}}this._text.unbind()},x.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 N=new g(z);return N.update(F),N}}),3840:(function(e){e.exports=M;var t=0,r=1;function o(_,w,m,u,v,y){this._color=_,this.key=w,this.value=m,this.left=u,this.right=v,this._count=y}function n(_){return new o(_._color,_.key,_.value,_.left,_.right,_._count)}function i(_,w){return new o(_,w.key,w.value,w.left,w.right,w._count)}function a(_){_._count=1+(_.left?_.left._count:0)+(_.right?_.right._count:0)}function s(_,w){this._compare=_,this.root=w}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var _=[];return this.forEach(function(w,m){_.push(w)}),_}}),Object.defineProperty(f,"values",{get:function(){var _=[];return this.forEach(function(w,m){_.push(m)}),_}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(_,w){for(var m=this._compare,u=this.root,v=[],y=[];u;){var I=m(_,u.key);v.push(u),y.push(I),I<=0?u=u.left:u=u.right}v.push(new o(t,_,w,null,null,1));for(var L=v.length-2;L>=0;--L){var u=v[L];y[L]<=0?v[L]=new o(u._color,u.key,u.value,v[L+1],u.right,u._count+1):v[L]=new o(u._color,u.key,u.value,u.left,v[L+1],u._count+1)}for(var L=v.length-1;L>1;--L){var z=v[L-1],u=v[L];if(z._color===r||u._color===r)break;var F=v[L-2];if(F.left===z)if(z.left===u){var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,v[L-2]=z,v[L-1]=u,a(F),a(z),L>=3){var B=v[L-3];B.left===F?B.left=z:B.right=z}break}}else{var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),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,v[L-2]=u,v[L-1]=z,a(F),a(z),a(u),L>=3){var B=v[L-3];B.left===F?B.left=u:B.right=u}break}}else if(z.right===u){var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,v[L-2]=z,v[L-1]=u,a(F),a(z),L>=3){var B=v[L-3];B.right===F?B.right=z:B.left=z}break}}else{var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),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,v[L-2]=u,v[L-1]=z,a(F),a(z),a(u),L>=3){var B=v[L-3];B.right===F?B.right=u:B.left=u}break}}}return v[0]._color=r,new s(m,v[0])};function c(_,w){if(w.left){var m=c(_,w.left);if(m)return m}var m=_(w.key,w.value);if(m)return m;if(w.right)return c(_,w.right)}function p(_,w,m,u){var v=w(_,u.key);if(v<=0){if(u.left){var y=p(_,w,m,u.left);if(y)return y}var y=m(u.key,u.value);if(y)return y}if(u.right)return p(_,w,m,u.right)}function d(_,w,m,u,v){var y=m(_,v.key),I=m(w,v.key),L;if(y<=0&&(v.left&&(L=d(_,w,m,u,v.left),L)||I>0&&(L=u(v.key,v.value),L)))return L;if(I>0&&v.right)return d(_,w,m,u,v.right)}f.forEach=function(w,m,u){if(this.root)switch(arguments.length){case 1:return c(w,this.root);case 2:return p(m,this._compare,w,this.root);case 3:return this._compare(m,u)>=0?void 0:d(m,u,this._compare,w,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(f,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),f.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,m=[];;){if(m.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},f.ge=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y<=0&&(v=u.length),y<=0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.gt=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y<0&&(v=u.length),y<0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.lt=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y>0&&(v=u.length),y<=0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.le=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y>=0&&(v=u.length),y<0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.find=function(_){for(var w=this._compare,m=this.root,u=[];m;){var v=w(_,m.key);if(u.push(m),v===0)return new T(this,u);v<=0?m=m.left:m=m.right}return new T(this,[])},f.remove=function(_){var w=this.find(_);return w?w.remove():this},f.get=function(_){for(var w=this._compare,m=this.root;m;){var u=w(_,m.key);if(u===0)return m.value;u<=0?m=m.left:m=m.right}};function T(_,w){this.tree=_,this._stack=w}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(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function x(_){for(var w,m,u,v,y=_.length-1;y>=0;--y){if(w=_[y],y===0){w._color=r;return}if(m=_[y-1],m.left===w){if(u=m.right,u.right&&u.right._color===t){if(u=m.right=n(u),v=u.right=n(u.right),m.right=u.left,u.left=m,u.right=v,u._color=m._color,w._color=r,m._color=r,v._color=r,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u;return}else if(u.left&&u.left._color===t){if(u=m.right=n(u),v=u.left=n(u.left),m.right=v.left,u.left=v.right,v.left=m,v.right=u,v._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(v),y>1){var I=_[y-2];I.left===m?I.left=v:I.right=v}_[y-1]=v;return}if(u._color===r)if(m._color===t){m._color=r,m.right=i(t,u);return}else{m.right=i(t,u);continue}else{if(u=n(u),m.right=u.left,u.left=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}else{if(u=m.left,u.left&&u.left._color===t){if(u=m.left=n(u),v=u.left=n(u.left),m.left=u.right,u.right=m,u.left=v,u._color=m._color,w._color=r,m._color=r,v._color=r,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u;return}else if(u.right&&u.right._color===t){if(u=m.left=n(u),v=u.right=n(u.right),m.left=v.right,u.right=v.left,v.right=m,v.left=u,v._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(v),y>1){var I=_[y-2];I.right===m?I.right=v:I.left=v}_[y-1]=v;return}if(u._color===r)if(m._color===t){m._color=r,m.left=i(t,u);return}else{m.left=i(t,u);continue}else{if(u=n(u),m.left=u.right,u.right=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),m=_[_.length-1];w[w.length-1]=new o(m._color,m.key,m.value,m.left,m.right,m._count);for(var u=_.length-2;u>=0;--u){var m=_[u];m.left===_[u+1]?w[u]=new o(m._color,m.key,m.value,w[u+1],m.right,m._count):w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count)}if(m=w[w.length-1],m.left&&m.right){var v=w.length;for(m=m.left;m.right;)w.push(m),m=m.right;var y=w[v-1];w.push(new o(m._color,y.key,y.value,m.left,m.right,m._count)),w[v-1].key=m.key,w[v-1].value=m.value;for(var u=w.length-2;u>=v;--u)m=w[u],w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count);w[v-1].left=w[v]}if(m=w[w.length-1],m._color===t){var I=w[w.length-2];I.left===m?I.left=null:I.right===m&&(I.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var m=this.tree.root;return m?m._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var m=new Array(w.length),u=w[w.length-1];m[m.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var v=w.length-2;v>=0;--v)u=w[v],u.left===w[v+1]?m[v]=new o(u._color,u.key,u.value,m[v+1],u.right,u._count):m[v]=new o(u._color,u.key,u.value,u.left,m[v+1],u._count);return new s(this.tree._compare,m[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function A(_,w){return _w?1:0}function M(_){return new s(_||A,null)}}),3865:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]).add(a[0].mul(i[1])),i[1].mul(a[1]))}}),3952:(function(e,t,r){e.exports=i;var o=r(3250);function n(a,s){for(var f=new Array(s+1),c=0;c20?52:f+32}}),4040:(function(e){e.exports=t;function t(r,o,n,i,a,s,f){var c=1/(o-n),p=1/(i-a),d=1/(s-f);return r[0]=-2*c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*p,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*d,r[11]=0,r[12]=(o+n)*c,r[13]=(a+i)*p,r[14]=(f+s)*d,r[15]=1,r}}),4041:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2],d=n[3],T=d*i+c*s-p*a,l=d*a+p*i-f*s,g=d*s+f*a-c*i,x=-f*i-c*a-p*s;return r[0]=T*d+x*-f+l*-p-g*-c,r[1]=l*d+x*-c+g*-f-T*-p,r[2]=g*d+x*-p+T*-c-l*-f,r[3]=o[3],r}}),4081:(function(e){e.exports=t;function t(r,o,n,i,a,s,f,c,p,d){var T=o+s+d;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(f-p)/l,r[1]=.5*(c-i)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var g=Math.max(o,s,d),l=Math.sqrt(2*g-T+1);o>=g?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(c+i)/l,r[3]=.5*(f-p)/l):s>=g?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(p+f)/l,r[3]=.5*(c-i)/l):(r[0]=.5*(i+c)/l,r[1]=.5*(f+p)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}}),4100:(function(e,t,r){var o=r(4437),n=r(3837),i=r(5445),a=r(4449),s=r(3589),f=r(2260),c=r(7169),p=r(351),d=r(4772),T=r(4040),l=r(799),g=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function x(){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 A(u,v){var y=null;try{y=u.getContext("webgl",v),y||(y=u.getContext("experimental-webgl",v))}catch{return null}return y}function M(u){var v=Math.round(Math.log(Math.abs(u))/Math.log(10));if(v<0){var y=Math.round(Math.pow(10,-v));return Math.ceil(u*y)/y}else if(v>0){var y=Math.round(Math.pow(10,v));return Math.ceil(u/y)*y}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var v=u.canvas;if(!v)if(v=document.createElement("canvas"),u.container){var y=u.container;y.appendChild(v)}else document.body.appendChild(v);var I=u.gl;if(I||(u.glOptions&&(g=!!u.glOptions.preserveDrawingBuffer),I=A(v,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:g})),!I)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new x,F=f(I,I.drawingBufferWidth,I.drawingBufferHeight,{preferFloat:!g}),N=l(I),B=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,R={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:B},U=u.axes||{},j=n(I,U);j.enable=!U.disable;var Z=u.spikes||{},re=a(I,Z),fe=[],le=[],ce=[],V=[],ee=!0,te=!0,ne=new Array(16),K=new Array(16),ue={view:null,projection:ne,model:K,_ortho:!1},te=!0,H=[I.drawingBufferWidth,I.drawingBufferHeight],ae=u.cameraObject||o(v,R),ie={gl:I,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:v,selection:z,camera:ae,axes:j,axesPixels:null,spikes:re,bounds:L,objects:fe,shape:H,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:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:ue,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Qe){this.aspect[0]=Qe.x,this.aspect[1]=Qe.y,this.aspect[2]=Qe.z,te=!0},setBounds:function(Qe,Le){this.bounds[0][Qe]=Le.min,this.bounds[1][Qe]=Le.max},setClearColor:function(Qe){this.clearColor=Qe},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)}},ve=[I.drawingBufferWidth/ie.pixelRatio|0,I.drawingBufferHeight/ie.pixelRatio|0];function Ae(){if(!ie._stopped&&ie.autoResize){var Qe=v.parentNode,Le=1,Te=1;Qe&&Qe!==document.body?(Le=Qe.clientWidth,Te=Qe.clientHeight):(Le=window.innerWidth,Te=window.innerHeight);var pe=Math.ceil(Le*ie.pixelRatio)|0,Ne=Math.ceil(Te*ie.pixelRatio)|0;if(pe!==v.width||Ne!==v.height){v.width=pe,v.height=Ne;var ot=v.style;ot.position=ot.position||"absolute",ot.left="0px",ot.top="0px",ot.width=Le+"px",ot.height=Te+"px",ee=!0}}}ie.autoResize&&Ae(),window.addEventListener("resize",Ae);function Ce(){for(var Qe=fe.length,Le=V.length,Te=0;Te0&&ce[Le-1]===0;)ce.pop(),V.pop().dispose()}ie.update=function(Qe){ie._stopped||(ee=!0,te=!0)},ie.add=function(Qe){ie._stopped||(Qe.axes=j,fe.push(Qe),le.push(-1),ee=!0,te=!0,Ce())},ie.remove=function(Qe){if(!ie._stopped){var Le=fe.indexOf(Qe);Le<0||(fe.splice(Le,1),le.pop(),ee=!0,te=!0,Ce())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",Ae),v.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){j.dispose(),re.dispose();for(var Qe=0;Qez.distance)continue;for(var Nt=0;Ntd;){var m=l[w-2],u=l[w-1];if(ml[T+1]:!0}function c(d,T,l,g){d*=2;var x=g[d];return x>1,_=M-g,w=M+g,m=x,u=_,v=M,y=w,I=A,L=d+1,z=T-1,F=0;f(m,u,l)&&(F=m,m=u,u=F),f(y,I,l)&&(F=y,y=I,I=F),f(m,v,l)&&(F=m,m=v,v=F),f(u,v,l)&&(F=u,u=v,v=F),f(m,y,l)&&(F=m,m=y,y=F),f(v,y,l)&&(F=v,v=y,y=F),f(u,I,l)&&(F=u,u=I,I=F),f(u,v,l)&&(F=u,u=v,v=F),f(y,I,l)&&(F=y,y=I,I=F);for(var N=l[2*u],B=l[2*u+1],R=l[2*y],U=l[2*y+1],j=2*m,Z=2*v,re=2*I,fe=2*x,le=2*M,ce=2*A,V=0;V<2;++V){var ee=l[j+V],ne=l[Z+V],K=l[re+V];l[fe+V]=ee,l[le+V]=ne,l[ce+V]=K}i(_,d,l),i(w,T,l);for(var ue=L;ue<=z;++ue)if(c(ue,N,B,l))ue!==L&&n(ue,L,l),++L;else if(!c(ue,R,U,l))for(;;)if(c(z,R,U,l)){c(z,N,B,l)?(a(ue,L,z,l),++L,--z):(n(ue,z,l),--z);break}else{if(--z0)if(x[0]!==M[1][0])A=g,g=g.right;else{var u=p(g.right,x);if(u)return u;g=g.left}else{if(x[0]!==M[1][0])return g;var u=p(g.right,x);if(u)return u;g=g.left}}return A}f.castUp=function(g){var x=o.le(this.coordinates,g[0]);if(x<0)return-1;this.slabs[x];var A=p(this.slabs[x],g),M=-1;if(A&&(M=A.value),this.coordinates[x]===g[0]){var _=null;if(A&&(_=A.key),x>0){var w=p(this.slabs[x-1],g);w&&(_?a(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var m=this.horizontal[x];if(m.length>0){var u=o.ge(m,g[1],c);if(u=m.length)return M;v=m[u]}}if(v.start)if(_){var y=i(_[0],_[1],[g[0],v.y]);_[0][0]>_[1][0]&&(y=-y),y>0&&(M=v.index)}else M=v.index;else v.y!==g[1]&&(M=v.index)}}}return M};function d(g,x,A,M){this.y=g,this.index=x,this.start=A,this.closed=M}function T(g,x,A,M){this.x=g,this.segment=x,this.create=A,this.index=M}function l(g){for(var x=g.length,A=2*x,M=new Array(A),_=0;_Math.abs(u))l.rotate(I,0,0,-m*v*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var L=-_.zoomSpeed*y*u/window.innerHeight*(I-l.lastT())/20;l.pan(I,0,0,x*(Math.exp(L)-1))}}},!0)},_.enableMouseListeners(),_}}),4449:(function(e,t,r){var o=r(2762),n=r(8116),i=r(1493);e.exports=T;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.buffer=g,this.vao=x,this.shader=A,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 f=s.prototype,c=[0,0,0],p=[0,0,0],d=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var g=this.gl,x=this.vao,A=this.shader;x.bind(),A.bind();var M=l.model||a,_=l.view||a,w=l.projection||a,m;this.axes&&(m=this.axes.lastCubeProps.axis);for(var u=c,v=p,y=0;y<3;++y)m&&m[y]<0?(u[y]=this.bounds[0][y],v[y]=this.bounds[1][y]):(u[y]=this.bounds[1][y],v[y]=this.bounds[0][y]);d[0]=g.drawingBufferWidth,d[1]=g.drawingBufferHeight,A.uniforms.model=M,A.uniforms.view=_,A.uniforms.projection=w,A.uniforms.coordinates=[this.position,u,v],A.uniforms.colors=this.colors,A.uniforms.screenShape=d;for(var y=0;y<3;++y)A.uniforms.lineWidth=this.lineWidth[y]*this.pixelRatio,this.enabled[y]&&(x.draw(g.TRIANGLES,6,6*y),this.drawSides[y]&&x.draw(g.TRIANGLES,12,18+12*y));x.unbind()},f.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))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,g){var x=[];function A(u,v,y,I,L,z){var F=[u,v,y,0,0,0,1];F[I+3]=1,F[I]=L,x.push.apply(x,F),F[6]=-1,x.push.apply(x,F),F[I]=z,x.push.apply(x,F),x.push.apply(x,F),F[6]=1,x.push.apply(x,F),F[I]=L,x.push.apply(x,F)}A(0,0,0,0,0,1),A(0,0,0,1,0,1),A(0,0,0,2,0,1),A(1,0,0,1,-1,1),A(1,0,0,2,-1,1),A(0,1,0,0,-1,1),A(0,1,0,2,-1,1),A(0,0,1,0,-1,1),A(0,0,1,1,-1,1);var M=o(l,x),_=n(l,[{type:l.FLOAT,buffer:M,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:M,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:M,size:1,offset:24,stride:28}]),w=i(l);w.attributes.position.location=0,w.attributes.color.location=1,w.attributes.weight.location=2;var m=new s(l,M,_,w);return m.update(g),m}}),4494:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}}),4505:(function(e,t,r){e.exports=r(5847)}),4578:(function(e){e.exports=t;function t(r,o,n,i,a){return r[0]=o,r[1]=n,r[2]=i,r[3]=a,r}}),4623:(function(e){"use restrict";e.exports=t;function t(r){this.roots=new Array(r),this.ranks=new Array(r);for(var o=0;o0)return 1<=0)return 1<=0;--l)f[l]=c*o[l]+p*n[l]+d*i[l]+T*a[l];return f}return c*o+p*n+d*i[l]+T*a}function r(o,n,i,a,s,f){var c=s-1,p=s*s,d=c*c,T=(1+2*s)*d,l=s*d,g=p*(3-2*s),x=p*c;if(o.length){f||(f=new Array(o.length));for(var A=o.length-1;A>=0;--A)f[A]=T*o[A]+l*n[A]+g*i[A]+x*a[A];return f}return T*o+l*n+g*i+x*a}e.exports=r,e.exports.derivative=t}),4772:(function(e){e.exports=t;function t(r,o,n,i,a){var s=1/Math.tan(o/2),f=1/(i-a);return r[0]=s/n,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]=(a+i)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*i*f,r[15]=0,r}}),4793:(function(e,t,r){function o(xe,ye){if(!(xe instanceof ye))throw new TypeError("Cannot call a class as a function")}function n(xe,ye){for(var Me=0;Mew)throw new RangeError('The value "'+xe+'" is invalid for option "size"');var ye=new Uint8Array(xe);return Object.setPrototypeOf(ye,v.prototype),ye}function v(xe,ye,Me){if(typeof xe=="number"){if(typeof ye=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(xe)}return y(xe,ye,Me)}v.poolSize=8192;function y(xe,ye,Me){if(typeof xe=="string")return F(xe,ye);if(ArrayBuffer.isView(xe))return B(xe);if(xe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe));if(Br(xe,ArrayBuffer)||xe&&Br(xe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Br(xe,SharedArrayBuffer)||xe&&Br(xe.buffer,SharedArrayBuffer)))return R(xe,ye,Me);if(typeof xe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Xe=xe.valueOf&&xe.valueOf();if(Xe!=null&&Xe!==xe)return v.from(Xe,ye,Me);var Je=U(xe);if(Je)return Je;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof xe[Symbol.toPrimitive]=="function")return v.from(xe[Symbol.toPrimitive]("string"),ye,Me);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe))}v.from=function(xe,ye,Me){return y(xe,ye,Me)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function I(xe){if(typeof xe!="number")throw new TypeError('"size" argument must be of type number');if(xe<0)throw new RangeError('The value "'+xe+'" is invalid for option "size"')}function L(xe,ye,Me){return I(xe),xe<=0?u(xe):ye!==void 0?typeof Me=="string"?u(xe).fill(ye,Me):u(xe).fill(ye):u(xe)}v.alloc=function(xe,ye,Me){return L(xe,ye,Me)};function z(xe){return I(xe),u(xe<0?0:j(xe)|0)}v.allocUnsafe=function(xe){return z(xe)},v.allocUnsafeSlow=function(xe){return z(xe)};function F(xe,ye){if((typeof ye!="string"||ye==="")&&(ye="utf8"),!v.isEncoding(ye))throw new TypeError("Unknown encoding: "+ye);var Me=Z(xe,ye)|0,Xe=u(Me),Je=Xe.write(xe,ye);return Je!==Me&&(Xe=Xe.slice(0,Je)),Xe}function N(xe){for(var ye=xe.length<0?0:j(xe.length)|0,Me=u(ye),Xe=0;Xe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return xe|0}v.isBuffer=function(ye){return ye!=null&&ye._isBuffer===!0&&ye!==v.prototype},v.compare=function(ye,Me){if(Br(ye,Uint8Array)&&(ye=v.from(ye,ye.offset,ye.byteLength)),Br(Me,Uint8Array)&&(Me=v.from(Me,Me.offset,Me.byteLength)),!v.isBuffer(ye)||!v.isBuffer(Me))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ye===Me)return 0;for(var Xe=ye.length,Je=Me.length,Lt=0,Ct=Math.min(Xe,Je);LtJe.length?(v.isBuffer(Ct)||(Ct=v.from(Ct)),Ct.copy(Je,Lt)):Uint8Array.prototype.set.call(Je,Ct,Lt);else if(v.isBuffer(Ct))Ct.copy(Je,Lt);else throw new TypeError('"list" argument must be an Array of Buffers');Lt+=Ct.length}return Je};function Z(xe,ye){if(v.isBuffer(xe))return xe.length;if(ArrayBuffer.isView(xe)||Br(xe,ArrayBuffer))return xe.byteLength;if(typeof xe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+x(xe));var Me=xe.length,Xe=arguments.length>2&&arguments[2]===!0;if(!Xe&&Me===0)return 0;for(var Je=!1;;)switch(ye){case"ascii":case"latin1":case"binary":return Me;case"utf8":case"utf-8":return rr(xe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me*2;case"hex":return Me>>>1;case"base64":return Zr(xe).length;default:if(Je)return Xe?-1:rr(xe).length;ye=(""+ye).toLowerCase(),Je=!0}}v.byteLength=Z;function re(xe,ye,Me){var Xe=!1;if((ye===void 0||ye<0)&&(ye=0),ye>this.length||((Me===void 0||Me>this.length)&&(Me=this.length),Me<=0)||(Me>>>=0,ye>>>=0,Me<=ye))return"";for(xe||(xe="utf8");;)switch(xe){case"hex":return Ce(this,ye,Me);case"utf8":case"utf-8":return H(this,ye,Me);case"ascii":return ve(this,ye,Me);case"latin1":case"binary":return Ae(this,ye,Me);case"base64":return te(this,ye,Me);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ye,Me);default:if(Xe)throw new TypeError("Unknown encoding: "+xe);xe=(xe+"").toLowerCase(),Xe=!0}}v.prototype._isBuffer=!0;function fe(xe,ye,Me){var Xe=xe[ye];xe[ye]=xe[Me],xe[Me]=Xe}v.prototype.swap16=function(){var ye=this.length;if(ye%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Me=0;MeMe&&(ye+=" ... "),""},_&&(v.prototype[_]=v.prototype.inspect),v.prototype.compare=function(ye,Me,Xe,Je,Lt){if(Br(ye,Uint8Array)&&(ye=v.from(ye,ye.offset,ye.byteLength)),!v.isBuffer(ye))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+x(ye));if(Me===void 0&&(Me=0),Xe===void 0&&(Xe=ye?ye.length:0),Je===void 0&&(Je=0),Lt===void 0&&(Lt=this.length),Me<0||Xe>ye.length||Je<0||Lt>this.length)throw new RangeError("out of range index");if(Je>=Lt&&Me>=Xe)return 0;if(Je>=Lt)return-1;if(Me>=Xe)return 1;if(Me>>>=0,Xe>>>=0,Je>>>=0,Lt>>>=0,this===ye)return 0;for(var Ct=Lt-Je,Ot=Xe-Me,Wt=Math.min(Ct,Ot),_r=this.slice(Je,Lt),pr=ye.slice(Me,Xe),hr=0;hr2147483647?Me=2147483647:Me<-2147483648&&(Me=-2147483648),Me=+Me,Mt(Me)&&(Me=Je?0:xe.length-1),Me<0&&(Me=xe.length+Me),Me>=xe.length){if(Je)return-1;Me=xe.length-1}else if(Me<0)if(Je)Me=0;else return-1;if(typeof ye=="string"&&(ye=v.from(ye,Xe)),v.isBuffer(ye))return ye.length===0?-1:ce(xe,ye,Me,Xe,Je);if(typeof ye=="number")return ye=ye&255,typeof Uint8Array.prototype.indexOf=="function"?Je?Uint8Array.prototype.indexOf.call(xe,ye,Me):Uint8Array.prototype.lastIndexOf.call(xe,ye,Me):ce(xe,[ye],Me,Xe,Je);throw new TypeError("val must be string, number or Buffer")}function ce(xe,ye,Me,Xe,Je){var Lt=1,Ct=xe.length,Ot=ye.length;if(Xe!==void 0&&(Xe=String(Xe).toLowerCase(),Xe==="ucs2"||Xe==="ucs-2"||Xe==="utf16le"||Xe==="utf-16le")){if(xe.length<2||ye.length<2)return-1;Lt=2,Ct/=2,Ot/=2,Me/=2}function Wt(En,Zn){return Lt===1?En[Zn]:En.readUInt16BE(Zn*Lt)}var _r;if(Je){var pr=-1;for(_r=Me;_rCt&&(Me=Ct-Ot),_r=Me;_r>=0;_r--){for(var hr=!0,Fr=0;FrJe&&(Xe=Je)):Xe=Je;var Lt=ye.length;Xe>Lt/2&&(Xe=Lt/2);var Ct;for(Ct=0;Ct>>0,isFinite(Xe)?(Xe=Xe>>>0,Je===void 0&&(Je="utf8")):(Je=Xe,Xe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Lt=this.length-Me;if((Xe===void 0||Xe>Lt)&&(Xe=Lt),ye.length>0&&(Xe<0||Me<0)||Me>this.length)throw new RangeError("Attempt to write outside buffer bounds");Je||(Je="utf8");for(var Ct=!1;;)switch(Je){case"hex":return V(this,ye,Me,Xe);case"utf8":case"utf-8":return ee(this,ye,Me,Xe);case"ascii":case"latin1":case"binary":return ne(this,ye,Me,Xe);case"base64":return K(this,ye,Me,Xe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,ye,Me,Xe);default:if(Ct)throw new TypeError("Unknown encoding: "+Je);Je=(""+Je).toLowerCase(),Ct=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(xe,ye,Me){return ye===0&&Me===xe.length?A.fromByteArray(xe):A.fromByteArray(xe.slice(ye,Me))}function H(xe,ye,Me){Me=Math.min(xe.length,Me);for(var Xe=[],Je=ye;Je239?4:Lt>223?3:Lt>191?2:1;if(Je+Ot<=Me){var Wt=void 0,_r=void 0,pr=void 0,hr=void 0;switch(Ot){case 1:Lt<128&&(Ct=Lt);break;case 2:Wt=xe[Je+1],(Wt&192)===128&&(hr=(Lt&31)<<6|Wt&63,hr>127&&(Ct=hr));break;case 3:Wt=xe[Je+1],_r=xe[Je+2],(Wt&192)===128&&(_r&192)===128&&(hr=(Lt&15)<<12|(Wt&63)<<6|_r&63,hr>2047&&(hr<55296||hr>57343)&&(Ct=hr));break;case 4:Wt=xe[Je+1],_r=xe[Je+2],pr=xe[Je+3],(Wt&192)===128&&(_r&192)===128&&(pr&192)===128&&(hr=(Lt&15)<<18|(Wt&63)<<12|(_r&63)<<6|pr&63,hr>65535&&hr<1114112&&(Ct=hr))}}Ct===null?(Ct=65533,Ot=1):Ct>65535&&(Ct-=65536,Xe.push(Ct>>>10&1023|55296),Ct=56320|Ct&1023),Xe.push(Ct),Je+=Ot}return ie(Xe)}var ae=4096;function ie(xe){var ye=xe.length;if(ye<=ae)return String.fromCharCode.apply(String,xe);for(var Me="",Xe=0;XeXe)&&(Me=Xe);for(var Je="",Lt=ye;LtXe&&(ye=Xe),Me<0?(Me+=Xe,Me<0&&(Me=0)):Me>Xe&&(Me=Xe),MeMe)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(ye,Me,Xe){ye=ye>>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye],Lt=1,Ct=0;++Ct>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye+--Me],Lt=1;Me>0&&(Lt*=256);)Je+=this[ye+--Me]*Lt;return Je},v.prototype.readUint8=v.prototype.readUInt8=function(ye,Me){return ye=ye>>>0,Me||ze(ye,1,this.length),this[ye]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,2,this.length),this[ye]|this[ye+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,2,this.length),this[ye]<<8|this[ye+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),(this[ye]|this[ye+1]<<8|this[ye+2]<<16)+this[ye+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]*16777216+(this[ye+1]<<16|this[ye+2]<<8|this[ye+3])},v.prototype.readBigUInt64LE=$e(function(ye){ye=ye>>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=Me+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,24),Lt=this[++ye]+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+Xe*Math.pow(2,24);return BigInt(Je)+(BigInt(Lt)<>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=Me*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye],Lt=this[++ye]*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+Xe;return(BigInt(Je)<>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye],Lt=1,Ct=0;++Ct=Lt&&(Je-=Math.pow(2,8*Me)),Je},v.prototype.readIntBE=function(ye,Me,Xe){ye=ye>>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=Me,Lt=1,Ct=this[ye+--Je];Je>0&&(Lt*=256);)Ct+=this[ye+--Je]*Lt;return Lt*=128,Ct>=Lt&&(Ct-=Math.pow(2,8*Me)),Ct},v.prototype.readInt8=function(ye,Me){return ye=ye>>>0,Me||ze(ye,1,this.length),this[ye]&128?(255-this[ye]+1)*-1:this[ye]},v.prototype.readInt16LE=function(ye,Me){ye=ye>>>0,Me||ze(ye,2,this.length);var Xe=this[ye]|this[ye+1]<<8;return Xe&32768?Xe|4294901760:Xe},v.prototype.readInt16BE=function(ye,Me){ye=ye>>>0,Me||ze(ye,2,this.length);var Xe=this[ye+1]|this[ye]<<8;return Xe&32768?Xe|4294901760:Xe},v.prototype.readInt32LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]|this[ye+1]<<8|this[ye+2]<<16|this[ye+3]<<24},v.prototype.readInt32BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]<<24|this[ye+1]<<16|this[ye+2]<<8|this[ye+3]},v.prototype.readBigInt64LE=$e(function(ye){ye=ye>>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=this[ye+4]+this[ye+5]*Math.pow(2,8)+this[ye+6]*Math.pow(2,16)+(Xe<<24);return(BigInt(Je)<>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=(Me<<24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye];return(BigInt(Je)<>>0,Me||ze(ye,4,this.length),M.read(this,ye,!0,23,4)},v.prototype.readFloatBE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),M.read(this,ye,!1,23,4)},v.prototype.readDoubleLE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,8,this.length),M.read(this,ye,!0,52,8)},v.prototype.readDoubleBE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,8,this.length),M.read(this,ye,!1,52,8)};function Ye(xe,ye,Me,Xe,Je,Lt){if(!v.isBuffer(xe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ye>Je||yexe.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,Xe=Xe>>>0,!Je){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Me,Xe,Lt,0)}var Ct=1,Ot=0;for(this[Me]=ye&255;++Ot>>0,Xe=Xe>>>0,!Je){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Me,Xe,Lt,0)}var Ct=Xe-1,Ot=1;for(this[Me+Ct]=ye&255;--Ct>=0&&(Ot*=256);)this[Me+Ct]=ye/Ot&255;return Me+Xe},v.prototype.writeUint8=v.prototype.writeUInt8=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,1,255,0),this[Me]=ye&255,Me+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,65535,0),this[Me]=ye&255,this[Me+1]=ye>>>8,Me+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,65535,0),this[Me]=ye>>>8,this[Me+1]=ye&255,Me+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,4294967295,0),this[Me+3]=ye>>>24,this[Me+2]=ye>>>16,this[Me+1]=ye>>>8,this[Me]=ye&255,Me+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,4294967295,0),this[Me]=ye>>>24,this[Me+1]=ye>>>16,this[Me+2]=ye>>>8,this[Me+3]=ye&255,Me+4};function it(xe,ye,Me,Xe,Je){ct(ye,Xe,Je,xe,Me,7);var Lt=Number(ye&BigInt(4294967295));xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Me}function st(xe,ye,Me,Xe,Je){ct(ye,Xe,Je,xe,Me,7);var Lt=Number(ye&BigInt(4294967295));xe[Me+7]=Lt,Lt=Lt>>8,xe[Me+6]=Lt,Lt=Lt>>8,xe[Me+5]=Lt,Lt=Lt>>8,xe[Me+4]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Me+3]=Ct,Ct=Ct>>8,xe[Me+2]=Ct,Ct=Ct>>8,xe[Me+1]=Ct,Ct=Ct>>8,xe[Me]=Ct,Me+8}v.prototype.writeBigUInt64LE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return it(this,ye,Me,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Me,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,!Je){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Me,Xe,Lt-1,-Lt)}var Ct=0,Ot=1,Wt=0;for(this[Me]=ye&255;++Ct>0)-Wt&255;return Me+Xe},v.prototype.writeIntBE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,!Je){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Me,Xe,Lt-1,-Lt)}var Ct=Xe-1,Ot=1,Wt=0;for(this[Me+Ct]=ye&255;--Ct>=0&&(Ot*=256);)ye<0&&Wt===0&&this[Me+Ct+1]!==0&&(Wt=1),this[Me+Ct]=(ye/Ot>>0)-Wt&255;return Me+Xe},v.prototype.writeInt8=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,1,127,-128),ye<0&&(ye=255+ye+1),this[Me]=ye&255,Me+1},v.prototype.writeInt16LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,32767,-32768),this[Me]=ye&255,this[Me+1]=ye>>>8,Me+2},v.prototype.writeInt16BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,32767,-32768),this[Me]=ye>>>8,this[Me+1]=ye&255,Me+2},v.prototype.writeInt32LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,2147483647,-2147483648),this[Me]=ye&255,this[Me+1]=ye>>>8,this[Me+2]=ye>>>16,this[Me+3]=ye>>>24,Me+4},v.prototype.writeInt32BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,2147483647,-2147483648),ye<0&&(ye=4294967295+ye+1),this[Me]=ye>>>24,this[Me+1]=ye>>>16,this[Me+2]=ye>>>8,this[Me+3]=ye&255,Me+4},v.prototype.writeBigInt64LE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return it(this,ye,Me,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Me,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function nt(xe,ye,Me,Xe,Je,Lt){if(Me+Xe>xe.length)throw new RangeError("Index out of range");if(Me<0)throw new RangeError("Index out of range")}function Qe(xe,ye,Me,Xe,Je){return ye=+ye,Me=Me>>>0,Je||nt(xe,ye,Me,4),M.write(xe,ye,Me,Xe,23,4),Me+4}v.prototype.writeFloatLE=function(ye,Me,Xe){return Qe(this,ye,Me,!0,Xe)},v.prototype.writeFloatBE=function(ye,Me,Xe){return Qe(this,ye,Me,!1,Xe)};function Le(xe,ye,Me,Xe,Je){return ye=+ye,Me=Me>>>0,Je||nt(xe,ye,Me,8),M.write(xe,ye,Me,Xe,52,8),Me+8}v.prototype.writeDoubleLE=function(ye,Me,Xe){return Le(this,ye,Me,!0,Xe)},v.prototype.writeDoubleBE=function(ye,Me,Xe){return Le(this,ye,Me,!1,Xe)},v.prototype.copy=function(ye,Me,Xe,Je){if(!v.isBuffer(ye))throw new TypeError("argument should be a Buffer");if(Xe||(Xe=0),!Je&&Je!==0&&(Je=this.length),Me>=ye.length&&(Me=ye.length),Me||(Me=0),Je>0&&Je=this.length)throw new RangeError("Index out of range");if(Je<0)throw new RangeError("sourceEnd out of bounds");Je>this.length&&(Je=this.length),ye.length-Me>>0,Xe=Xe===void 0?this.length:Xe>>>0,ye||(ye=0);var Ct;if(typeof ye=="number")for(Ct=Me;CtMath.pow(2,32)?Je=Ne(String(Me)):typeof Me=="bigint"&&(Je=String(Me),(Me>Math.pow(BigInt(2),BigInt(32))||Me<-Math.pow(BigInt(2),BigInt(32)))&&(Je=Ne(Je)),Je+="n"),Xe+=" It must be ".concat(ye,". Received ").concat(Je),Xe},RangeError);function Ne(xe){for(var ye="",Me=xe.length,Xe=xe[0]==="-"?1:0;Me>=Xe+4;Me-=3)ye="_".concat(xe.slice(Me-3,Me)).concat(ye);return"".concat(xe.slice(0,Me)).concat(ye)}function ot(xe,ye,Me){rt(ye,"offset"),(xe[ye]===void 0||xe[ye+Me]===void 0)&&Ft(ye,xe.length-(Me+1))}function ct(xe,ye,Me,Xe,Je,Lt){if(xe>Me||xe= 0".concat(Ct," and < 2").concat(Ct," ** ").concat((Lt+1)*8).concat(Ct):Ot=">= -(2".concat(Ct," ** ").concat((Lt+1)*8-1).concat(Ct,") and < 2 ** ")+"".concat((Lt+1)*8-1).concat(Ct),new Te.ERR_OUT_OF_RANGE("value",Ot,xe)}ot(Xe,Je,Lt)}function rt(xe,ye){if(typeof xe!="number")throw new Te.ERR_INVALID_ARG_TYPE(ye,"number",xe)}function Ft(xe,ye,Me){throw Math.floor(xe)!==xe?(rt(xe,Me),new Te.ERR_OUT_OF_RANGE("offset","an integer",xe)):ye<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ye),xe)}var Nt=/[^+/0-9A-Za-z-_]/g;function $t(xe){if(xe=xe.split("=")[0],xe=xe.trim().replace(Nt,""),xe.length<2)return"";for(;xe.length%4!==0;)xe=xe+"=";return xe}function rr(xe,ye){ye=ye||1/0;for(var Me,Xe=xe.length,Je=null,Lt=[],Ct=0;Ct55295&&Me<57344){if(!Je){if(Me>56319){(ye-=3)>-1&&Lt.push(239,191,189);continue}else if(Ct+1===Xe){(ye-=3)>-1&&Lt.push(239,191,189);continue}Je=Me;continue}if(Me<56320){(ye-=3)>-1&&Lt.push(239,191,189),Je=Me;continue}Me=(Je-55296<<10|Me-56320)+65536}else Je&&(ye-=3)>-1&&Lt.push(239,191,189);if(Je=null,Me<128){if((ye-=1)<0)break;Lt.push(Me)}else if(Me<2048){if((ye-=2)<0)break;Lt.push(Me>>6|192,Me&63|128)}else if(Me<65536){if((ye-=3)<0)break;Lt.push(Me>>12|224,Me>>6&63|128,Me&63|128)}else if(Me<1114112){if((ye-=4)<0)break;Lt.push(Me>>18|240,Me>>12&63|128,Me>>6&63|128,Me&63|128)}else throw new Error("Invalid code point")}return Lt}function Mr(xe){for(var ye=[],Me=0;Me>8,Je=Me%256,Lt.push(Je),Lt.push(Xe);return Lt}function Zr(xe){return A.toByteArray($t(xe))}function Ar(xe,ye,Me,Xe){var Je;for(Je=0;Je=ye.length||Je>=xe.length);++Je)ye[Je+Me]=xe[Je];return Je}function Br(xe,ye){return xe instanceof ye||xe!=null&&xe.constructor!=null&&xe.constructor.name!=null&&xe.constructor.name===ye.name}function Mt(xe){return xe!==xe}var je=(function(){for(var xe="0123456789abcdef",ye=new Array(256),Me=0;Me<16;++Me)for(var Xe=Me*16,Je=0;Je<16;++Je)ye[Xe+Je]=xe[Me]+xe[Je];return ye})();function $e(xe){return typeof BigInt>"u"?Ee:xe}function Ee(){throw new Error("BigInt not supported")}}),4844:(function(e){e.exports=t;function t(r,o,n,i){return r[0]=o[0]+n[0]*i,r[1]=o[1]+n[1]*i,r[2]=o[2]+n[2]*i,r[3]=o[3]+n[3]*i,r}}),4905:(function(e,t,r){var o=r(5874);e.exports=n;function n(i,a){var s=o(a),f=[];return f=f.concat(s(i)),f=f.concat(s(null)),f}}),4935:(function(e,t,r){e.exports=g;var o=r(2762),n=r(8116),i=r(4359),a=r(1879).Q,s=window||process.global||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var c=3;function p(x,A,M,_){this.gl=x,this.shader=A,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var d=p.prototype,T=[0,0];d.bind=function(x,A,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=x,w.view=A,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},d.unbind=function(){this.vao.unbind()},d.update=function(x,A,M,_,w){var m=[];function u(U,j,Z,re,fe,le){var ce=[Z.style,Z.weight,Z.variant,Z.family].join("_"),V=f[ce];V||(V=f[ce]={});var ee=V[j];ee||(ee=V[j]=l(j,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:fe,styletags:le}));for(var ne=(re||12)/12,K=ee.positions,ue=ee.cells,te=0,H=ue.length;te=0;--ie){var ve=K[ae[ie]];m.push(ne*ve[0],-ne*ve[1],U)}}for(var v=[0,0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},N=0;N<3;++N){I[N]=m.length/c|0,u(.5*(x[0][N]+x[1][N]),A[N],M[N],12,z,F),L[N]=(m.length/c|0)-I[N],v[N]=m.length/c|0;for(var B=0;B<_[N].length;++B)if(_[N][B].text){var R={family:_[N][B].font||w[N].family,style:w[N].fontStyle||w[N].style,weight:w[N].fontWeight||w[N].weight,variant:w[N].fontVariant||w[N].variant};u(_[N][B].x,_[N][B].text,R,_[N][B].fontSize||12,z,F)}y[N]=(m.length/c|0)-v[N]}this.buffer.update(m),this.tickOffset=v,this.tickCount=y,this.labelOffset=I,this.labelCount=L},d.drawTicks=function(x,A,M,_,w,m,u,v){this.tickCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=v,this.vao.draw(this.gl.TRIANGLES,this.tickCount[x],this.tickOffset[x]))},d.drawLabel=function(x,A,M,_,w,m,u,v){this.labelCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=v,this.vao.draw(this.gl.TRIANGLES,this.labelCount[x],this.labelOffset[x]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(x,A){try{return i(x,A)}catch(M){return console.warn('error vectorizing text:"'+x+'" error:',M),{cells:[],positions:[]}}}function g(x,A,M,_,w,m){var u=o(x),v=n(x,[{buffer:u,size:3}]),y=a(x);y.attributes.position.location=0;var I=new p(x,y,u,v);return I.update(A,M,_,w,m),I}}),5023:(function(e,t,r){var o=r(2478);e.exports=c;function n(p,d,T,l,g,x,A){this.cells=p,this.neighbor=d,this.flags=l,this.constraint=T,this.active=g,this.next=x,this.boundary=A}var i=n.prototype;function a(p,d){return p[0]-d[0]||p[1]-d[1]||p[2]-d[2]}i.locate=(function(){var p=[0,0,0];return function(d,T,l){var g=d,x=T,A=l;return T0||A.length>0;){for(;x.length>0;){var u=x.pop();if(M[u]!==-g){M[u]=g,_[u];for(var v=0;v<3;++v){var y=m[3*u+v];y>=0&&M[y]===0&&(w[3*u+v]?A.push(y):(x.push(y),M[y]=g))}}}var I=A;A=x,x=I,A.length=0,g=-g}var L=f(_,M,d);return T?L.concat(l.boundary):L}}),5033:(function(e){e.exports=t;function t(r,o,n){var i=o||0,a=n||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]],[i*r[12]+r[8],i*r[13]+r[9],i*r[14]+r[10],i*r[15]+r[11]],[a*r[12]-r[8],a*r[13]-r[9],a*r[14]-r[10],a*r[15]-r[11]]]}}),5085:(function(e,t,r){e.exports=g;var o=r(3250)[3],n=r(4209),i=r(3352),a=r(2478);function s(){return!0}function f(x){return function(A,M){var _=x[A];return _?!!_.queryPoint(M,s):!1}}function c(x){for(var A={},M=0;M0&&A[_]===M[0])w=x[_-1];else return 1;for(var m=1;w;){var u=w.key,v=o(M,u[0],u[1]);if(u[0][0]0)m=-1,w=w.right;else return 0;else if(v>0)w=w.left;else if(v<0)m=1,w=w.right;else return 0}return m}}function d(x){return 1}function T(x){return function(M){return x(M[0],M[1])?0:1}}function l(x,A){return function(_){return x(_[0],_[1])?0:A(_)}}function g(x){for(var A=x.length,M=[],_=[],w=0;w"u"?r(606):WeakMap,a=new i,s=0;function f(A,M,_,w,m,u,v){this.id=A,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=v}f.prototype.dispose=function(){if(--this.count===0){for(var A=this.cache,M=A.gl,_=this.programs,w=0,m=_.length;w0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=i*f,r[2]=a*f,r[3]=s*f),r}}),5202:(function(e,t,r){var o=r(1944),n=r(8210);e.exports=s,e.exports.positive=f,e.exports.negative=c;function i(p,d){var T=n(o(p,d),[d[d.length-1]]);return T[T.length-1]}function a(p,d,T,l){var g=l-d,x=-d/g;x<0?x=0:x>1&&(x=1);for(var A=1-x,M=p.length,_=new Array(M),w=0;w0||g>0&&_<0){var w=a(x,_,A,g);T.push(w),l.push(w.slice())}_<0?l.push(A.slice()):_>0?T.push(A.slice()):(T.push(A.slice()),l.push(A.slice())),g=_}return{positive:T,negative:l}}function f(p,d){for(var T=[],l=i(p[p.length-1],d),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M>=0&&T.push(x.slice()),l=M}return T}function c(p,d){for(var T=[],l=i(p[p.length-1],d),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M<=0&&T.push(x.slice()),l=M}return T}}),5219:(function(e){e.exports=function(t){for(var r=t.length,o,n=0;n13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}}),5250:(function(e){e.exports=r;var t=+(Math.pow(2,27)+1);function r(o,n,i){var a=o*n,s=t*o,f=s-o,c=s-f,p=o-c,d=t*n,T=d-n,l=d-T,g=n-l,x=a-c*l,A=x-p*l,M=A-c*g,_=p*g-M;return i?(i[0]=_,i[1]=a,i):[_,a]}}),5298:(function(e,t){var r={"float64,2,1,0":function(){return function(p,d,T,l,g){var x=p[0],A=p[1],M=p[2],_=T[0],w=T[1],m=T[2];l|=0;var u=0,v=0,y=0,I=m,L=w-M*m,z=_-A*w;for(y=0;y0;){B<64?(_=B,B=0):(_=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(w=R,R=0):(w=64,R-=64),l=F+B*u+R*v,A=N+B*I+R*L;var U=0,j=0,Z=0,re=y,fe=u-m*y,le=v-_*u,ce=z,V=I-m*z,ee=L-_*I;for(Z=0;Z0;){L<64?(_=L,L=0):(_=64,L-=64);for(var z=p[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=y+L*m+z*w,A=I+L*v+z*u;var F=0,N=0,B=m,R=w-_*m,U=v,j=u-_*v;for(N=0;N0;){N<64?(w=N,N=0):(w=64,N-=64);for(var B=p[0]|0;B>0;){B<64?(M=B,B=0):(M=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(_=R,R=0):(_=64,R-=64),l=z+N*v+B*m+R*u,A=F+N*L+B*y+R*I;var U=0,j=0,Z=0,re=v,fe=m-w*v,le=u-M*m,ce=L,V=y-w*L,ee=I-M*y;for(Z=0;Z<_;++Z){for(j=0;j=0}})(),i.removeTriangle=function(f,c,p){var d=this.stars;a(d[f],c,p),a(d[c],p,f),a(d[p],f,c)},i.addTriangle=function(f,c,p){var d=this.stars;d[f].push(c,p),d[c].push(p,f),d[p].push(f,c)},i.opposite=function(f,c){for(var p=this.stars[c],d=1,T=p.length;d0;){var l=p.pop();f[l]=!1;for(var g=s[l],d=0;d0){for(var ce=0;ce<24;++ce)L.push(L[L.length-12]);B+=2,re=!0}continue e}R[0][y]=Math.min(R[0][y],fe[y],le[y]),R[1][y]=Math.max(R[1][y],fe[y],le[y])}var V,ee;Array.isArray(j[0])?(V=j.length>v-1?j[v-1]:j.length>0?j[j.length-1]:[0,0,0,1],ee=j.length>v?j[v]:j.length>0?j[j.length-1]:[0,0,0,1]):V=ee=j,V.length===3&&(V=[V[0],V[1],V[2],1]),ee.length===3&&(ee=[ee[0],ee[1],ee[2],1]),!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0);var ne;Array.isArray(Z)?ne=Z.length>v-1?Z[v-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:ne=Z;var K=N;if(N+=x(fe,le),re){for(y=0;y<2;++y)L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],K,ne,V[0],V[1],V[2],V[3]);B+=2,re=!1}L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],K,ne,V[0],V[1],V[2],V[3],fe[0],fe[1],fe[2],le[0],le[1],le[2],K,-ne,V[0],V[1],V[2],V[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,-ne,ee[0],ee[1],ee[2],ee[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,ne,ee[0],ee[1],ee[2],ee[3]),B+=4}}if(this.buffer.update(L),z.push(N),F.push(U[U.length-1].slice()),this.bounds=R,this.vertexCount=B,this.points=F,this.arcLength=z,"dashes"in u){var ue=u.dashes,te=ue.slice();for(te.unshift(0),v=1;vr[n][0]&&(n=i);return on?[[n],[o]]:[[o]]}}),5771:(function(e,t,r){var o=r(8507),n=r(3788),i=r(2419);e.exports=a;function a(s){s.sort(n);for(var f=s.length,c=0,p=0;p0){var l=s[c-1];if(o(d,l)===0&&i(l)!==T){c-=1;continue}}s[c++]=d}}return s.length=c,s}}),5838:(function(e,t,r){e.exports=n;var o=r(7842);function n(i){for(var a=new Array(i.length),s=0;s0)continue;Ne=Le.slice(0,1).join("")}return te(Ne),re+=Ne.length,R=R.slice(Ne.length),R.length}while(!0)}function it(){return/[^a-fA-F0-9]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function st(){return N==="."||/[eE]/.test(N)?(R.push(N),F=x,B=N,L+1):N==="x"&&R.length===1&&R[0]==="0"?(F=u,R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function nt(){return N==="f"&&(R.push(N),B=N,L+=1),/[eE]/.test(N)||(N==="-"||N==="+")&&/[eE]/.test(B)?(R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function Qe(){if(/[^\d\w_]/.test(N)){var Le=R.join("");return ue[Le]?F=_:K[Le]?F=M:F=A,te(R.join("")),F=f,L}return R.push(N),B=N,L+1}}}),5878:(function(e,t,r){e.exports=a;var o=r(3250),n=r(2014);function i(s,f,c){var p=Math.abs(o(s,f,c)),d=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2));return p/d}function a(s,f,c){for(var p=f.length,d=s.length,T=new Array(p),l=new Array(p),g=new Array(p),x=new Array(p),A=0;A>1:(ce>>1)-1}function I(ce){for(var V=v(ce);;){var ee=V,ne=2*ce+1,K=2*(ce+1),ue=ce;if(ne0;){var ee=y(ce);if(ee>=0){var ne=v(ee);if(V0){var ce=B[0];return u(0,j-1),j-=1,I(0),ce}return-1}function F(ce,V){var ee=B[ce];return g[ee]===V?ce:(g[ee]=-1/0,L(ce),z(),g[ee]=V,j+=1,L(j-1))}function N(ce){if(!x[ce]){x[ce]=!0;var V=T[ce],ee=l[ce];T[ee]>=0&&(T[ee]=V),l[V]>=0&&(l[V]=ee),R[V]>=0&&F(R[V],m(V)),R[ee]>=0&&F(R[ee],m(ee))}}for(var B=[],R=new Array(p),A=0;A>1;A>=0;--A)I(A);for(;;){var Z=z();if(Z<0||g[Z]>c)break;N(Z)}for(var re=[],A=0;A=0&&ee>=0&&V!==ee){var ne=R[V],K=R[ee];ne!==K&&le.push([ne,K])}}),n.unique(n.normalize(le)),{positions:re,edges:le}}}),5911:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2];return r[0]=a*p-s*c,r[1]=s*f-i*p,r[2]=i*c-a*f,r}}),5964:(function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}}),5995:(function(e,t,r){e.exports=i;var o=r(7642),n=r(6037);function i(a,s){return o(s).filter(function(f){for(var c=new Array(f.length),p=0;p2&&v[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(v[0]-2,v[1]-2),m.pick(-1,-1,0).lo(1,1).hi(v[0]-2,v[1]-2),m.pick(-1,-1,1).lo(1,1).hi(v[0]-2,v[1]-2)),v[1]>2&&(_(u.pick(0,-1).lo(1).hi(v[1]-2),m.pick(0,-1,1).lo(1).hi(v[1]-2)),M(m.pick(0,-1,0).lo(1).hi(v[1]-2))),v[1]>2&&(_(u.pick(v[0]-1,-1).lo(1).hi(v[1]-2),m.pick(v[0]-1,-1,1).lo(1).hi(v[1]-2)),M(m.pick(v[0]-1,-1,0).lo(1).hi(v[1]-2))),v[0]>2&&(_(u.pick(-1,0).lo(1).hi(v[0]-2),m.pick(-1,0,0).lo(1).hi(v[0]-2)),M(m.pick(-1,0,1).lo(1).hi(v[0]-2))),v[0]>2&&(_(u.pick(-1,v[1]-1).lo(1).hi(v[0]-2),m.pick(-1,v[1]-1,0).lo(1).hi(v[0]-2)),M(m.pick(-1,v[1]-1,1).lo(1).hi(v[0]-2))),m.set(0,0,0,0),m.set(0,0,1,0),m.set(v[0]-1,0,0,0),m.set(v[0]-1,0,1,0),m.set(0,v[1]-1,0,0),m.set(0,v[1]-1,1,0),m.set(v[0]-1,v[1]-1,0,0),m.set(v[0]-1,v[1]-1,1,0),m}}function x(A){var M=A.join(),v=p[M];if(v)return v;for(var _=A.length,w=[d,T],m=1;m<=_;++m)w.push(l(m));var u=g,v=u.apply(void 0,w);return p[M]=v,v}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var m=x(w);return m(M,_)}}),6204:(function(e){e.exports=t;function t(r){var o,n,i,a=r.length,s=0;for(o=0;op&&(p=o.length(L)),y&&!v){var z=2*o.distance(M,I)/(o.length(_)+o.length(L));z?(m=Math.min(m,z),u=!1):u=!0}u||(M=I,_=L),w.push(L)}var F=[d,l,x],N=[T,g,A];a&&(a[0]=F,a[1]=N),p===0&&(p=1);var B=1/p;isFinite(m)||(m=1),c.vectorScale=m;var R=i.coneSize||(v?1:.5);i.absoluteConeSize&&(R=i.absoluteConeSize*B),c.coneScale=R;for(var y=0,U=0;yre&&(N|=1<re){N|=1<c[L][1])&&(ue=L);for(var te=-1,L=0;L<3;++L){var H=ue^1<c[ae][0]&&(ae=H)}}var ie=x;ie[0]=ie[1]=ie[2]=0,ie[o.log2(te^ue)]=ue&te,ie[o.log2(ue^ae)]=ue&ae;var ve=ae^7;ve===N||ve===K?(ve=te^7,ie[o.log2(ae^ve)]=ve&ae):ie[o.log2(te^ve)]=ve&te;for(var Ae=A,Ce=N,U=0;U<3;++U)Ce&1<=0&&(c=s.length-f-1);var p=Math.pow(10,c),d=Math.round(i*a*p),T=d+"";if(T.indexOf("e")>=0)return T;var l=d/p,g=d%p;d<0?(l=-Math.ceil(l)|0,g=-g|0):(l=Math.floor(l)|0,g=g|0);var x=""+l;if(d<0&&(x="-"+x),c){for(var A=""+g;A.length=i[0][f];--p)c.push({x:p*a[f],text:r(a[f],p)});s.push(c)}return s}function n(i,a){for(var s=0;s<3;++s){if(i[s].length!==a[s].length)return!1;for(var f=0;fM+1)throw new Error(x+" map requires nshades to be at least size "+g.length);Array.isArray(c.alpha)?c.alpha.length!==2?_=[1,1]:_=c.alpha.slice():typeof c.alpha=="number"?_=[c.alpha,c.alpha]:_=[1,1],p=g.map(function(I){return Math.round(I.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var m=g.map(function(I,L){var z=g[L].index,F=g[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 color, position; +attribute vec2 uv; + +uniform float vectorScale, tubeScale; +uniform mat4 model, view, projection, inverseModel; +uniform vec3 eyePosition, lightPosition; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + // Scale the vector magnitude to stay constant with + // model & view changes. + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + //Lighting geometry parameters + vec4 cameraCoordinate = view * tubePosition; + cameraCoordinate.xyz /= cameraCoordinate.w; + f_lightDirection = lightPosition - cameraCoordinate.xyz; + f_eyeDirection = eyePosition - cameraCoordinate.xyz; + f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz); + + // vec4 m_position = model * vec4(tubePosition, 1.0); + vec4 t_position = view * tubePosition; + gl_Position = projection * t_position; + + f_color = color; + f_data = tubePosition.xyz; + f_position = position.xyz; + f_uv = uv; +} +`]),i=o([`#extension GL_OES_standard_derivatives : enable + +precision highp float; +#define GLSLIFY 1 + +float beckmannDistribution(float x, float roughness) { + float NdotH = max(x, 0.0001); + float cos2Alpha = NdotH * NdotH; + float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha; + float roughness2 = roughness * roughness; + float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha; + return exp(tan2Alpha / roughness2) / denom; +} + +float cookTorranceSpecular( + vec3 lightDirection, + vec3 viewDirection, + vec3 surfaceNormal, + float roughness, + float fresnel) { + + float VdotN = max(dot(viewDirection, surfaceNormal), 0.0); + float LdotN = max(dot(lightDirection, surfaceNormal), 0.0); + + //Half angle vector + vec3 H = normalize(lightDirection + viewDirection); + + //Geometric term + float NdotH = max(dot(surfaceNormal, H), 0.0); + float VdotH = max(dot(viewDirection, H), 0.000001); + float LdotH = max(dot(lightDirection, H), 0.000001); + float G1 = (2.0 * NdotH * VdotN) / VdotH; + float G2 = (2.0 * NdotH * LdotN) / LdotH; + float G = min(1.0, min(G1, G2)); + + //Distribution term + float D = beckmannDistribution(NdotH, roughness); + + //Fresnel term + float F = pow(1.0 - VdotN, fresnel); + + //Multiply terms and done + return G * F * D / max(3.14159265 * VdotN, 0.000001); +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity; +uniform sampler2D texture; + +varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position; +varying vec4 f_color; +varying vec2 f_uv; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + vec3 N = normalize(f_normal); + vec3 L = normalize(f_lightDirection); + vec3 V = normalize(f_eyeDirection); + + if(gl_FrontFacing) { + N = -N; + } + + float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel))); + float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0); + + vec4 surfaceColor = f_color * texture2D(texture, f_uv); + vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0); + + gl_FragColor = litColor * opacity; +} +`]),a=o([`precision highp float; + +precision highp float; +#define GLSLIFY 1 + +vec3 getOrthogonalVector(vec3 v) { + // Return up-vector for only-z vector. + // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0). + // From the above if-statement we have ||a|| > 0 U ||b|| > 0. + // Assign z = 0, x = -b, y = a: + // a*-b + b*a + c*0 = -ba + ba + 0 = 0 + if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) { + return normalize(vec3(-v.y, v.x, 0.0)); + } else { + return normalize(vec3(0.0, v.z, -v.y)); + } +} + +// Calculate the tube vertex and normal at the given index. +// +// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d. +// +// Each tube segment is made up of a ring of vertices. +// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array. +// The indexes of tube segments run from 0 to 8. +// +vec3 getTubePosition(vec3 d, float index, out vec3 normal) { + float segmentCount = 8.0; + + float angle = 2.0 * 3.14159 * (index / segmentCount); + + vec3 u = getOrthogonalVector(d); + vec3 v = normalize(cross(u, d)); + + vec3 x = u * cos(angle) * length(d); + vec3 y = v * sin(angle) * length(d); + vec3 v3 = x + y; + + normal = normalize(v3); + + return v3; +} + +attribute vec4 vector; +attribute vec4 position; +attribute vec4 id; + +uniform mat4 model, view, projection; +uniform float tubeScale; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + vec3 normal; + vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal); + vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0); + + gl_Position = projection * (view * tubePosition); + f_id = id; + f_position = position.xyz; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform float pickId; + +varying vec3 f_position; +varying vec4 f_id; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard; + + gl_FragColor = vec4(pickId, f_id.xyz); +}`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}}),6743:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=i+i,p=a+a,d=s+s,T=i*c,l=i*p,g=i*d,x=a*p,A=a*d,M=s*d,_=f*c,w=f*p,m=f*d;return r[0]=1-(x+M),r[1]=l+m,r[2]=g-w,r[3]=0,r[4]=l-m,r[5]=1-(T+M),r[6]=A+_,r[7]=0,r[8]=g+w,r[9]=A-_,r[10]=1-(T+x),r[11]=0,r[12]=n[0],r[13]=n[1],r[14]=n[2],r[15]=1,r}}),6760:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=o[3],c=o[4],p=o[5],d=o[6],T=o[7],l=o[8],g=o[9],x=o[10],A=o[11],M=o[12],_=o[13],w=o[14],m=o[15],u=n[0],v=n[1],y=n[2],I=n[3];return r[0]=u*i+v*c+y*l+I*M,r[1]=u*a+v*p+y*g+I*_,r[2]=u*s+v*d+y*x+I*w,r[3]=u*f+v*T+y*A+I*m,u=n[4],v=n[5],y=n[6],I=n[7],r[4]=u*i+v*c+y*l+I*M,r[5]=u*a+v*p+y*g+I*_,r[6]=u*s+v*d+y*x+I*w,r[7]=u*f+v*T+y*A+I*m,u=n[8],v=n[9],y=n[10],I=n[11],r[8]=u*i+v*c+y*l+I*M,r[9]=u*a+v*p+y*g+I*_,r[10]=u*s+v*d+y*x+I*w,r[11]=u*f+v*T+y*A+I*m,u=n[12],v=n[13],y=n[14],I=n[15],r[12]=u*i+v*c+y*l+I*M,r[13]=u*a+v*p+y*g+I*_,r[14]=u*s+v*d+y*x+I*w,r[15]=u*f+v*T+y*A+I*m,r}}),6768:(function(e,t,r){var o=r(6859);e.exports=n;function n(i){return new o(i)}}),6803:(function(e,t,r){r(8828),r(1755);function o(n,i){var a=n.length,s=n.length-i.length,f=Math.min;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-i[0];case 2:var l=n[0]+n[1]-i[0]-i[1];return l||f(n[0],n[1])-f(i[0],i[1]);case 3:var c=n[0]+n[1],p=i[0]+i[1];if(l=c+n[2]-(p+i[2]),l)return l;var d=f(n[0],n[1]),T=f(i[0],i[1]),l=f(d,n[2])-f(T,i[2]);return l||f(d+n[2],c)-f(T+i[2],p);default:var g=n.slice(0);g.sort();var x=i.slice(0);x.sort();for(var A=0;A0?R:U},s.min=function(R,U){return R.cmp(U)<0?R:U},s.prototype._init=function(R,U,j){if(typeof R=="number")return this._initNumber(R,U,j);if(typeof R=="object")return this._initArray(R,U,j);U==="hex"&&(U=16),i(U===(U|0)&&U>=2&&U<=36),R=R.toString().replace(/\s+/g,"");var Z=0;R[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)fe=R[Z]|R[Z-1]<<8|R[Z-2]<<16,this.words[re]|=fe<>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);else if(j==="le")for(Z=0,re=0;Z>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);return this.strip()};function c(B,R){var U=B.charCodeAt(R);return U>=65&&U<=70?U-55:U>=97&&U<=102?U-87:U-48&15}function p(B,R,U){var j=c(B,U);return U-1>=R&&(j|=c(B,U-1)<<4),j}s.prototype._parseHex=function(R,U,j){this.length=Math.ceil((R.length-U)/6),this.words=new Array(this.length);for(var Z=0;Z=U;Z-=2)le=p(R,U,Z)<=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8;else{var ce=R.length-U;for(Z=ce%2===0?U+1:U;Z=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8}this.strip()};function d(B,R,U,j){for(var Z=0,re=Math.min(B.length,U),fe=R;fe=49?Z+=le-49+10:le>=17?Z+=le-17+10:Z+=le}return Z}s.prototype._parseBase=function(R,U,j){this.words=[0],this.length=1;for(var Z=0,re=1;re<=67108863;re*=U)Z++;Z--,re=re/U|0;for(var fe=R.length-j,le=fe%Z,ce=Math.min(fe,fe-le)+j,V=0,ee=j;ee1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[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(R,U){R=R||10,U=U|0||1;var j;if(R===16||R==="hex"){j="";for(var Z=0,re=0,fe=0;fe>>24-Z&16777215,re!==0||fe!==this.length-1?j=T[6-ce.length]+ce+j:j=ce+j,Z+=2,Z>=26&&(Z-=26,fe--)}for(re!==0&&(j=re.toString(16)+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}if(R===(R|0)&&R>=2&&R<=36){var V=l[R],ee=g[R];j="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var K=ne.modn(ee).toString(R);ne=ne.idivn(ee),ne.isZero()?j=K+j:j=T[V-K.length]+K+j}for(this.isZero()&&(j="0"+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var R=this.words[0];return this.length===2?R+=this.words[1]*67108864:this.length===3&&this.words[2]===1?R+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-R:R},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(R,U){return i(typeof f<"u"),this.toArrayLike(f,R,U)},s.prototype.toArray=function(R,U){return this.toArrayLike(Array,R,U)},s.prototype.toArrayLike=function(R,U,j){var Z=this.byteLength(),re=j||Math.max(1,Z);i(Z<=re,"byte array longer than desired length"),i(re>0,"Requested array length <= 0"),this.strip();var fe=U==="le",le=new R(re),ce,V,ee=this.clone();if(fe){for(V=0;!ee.isZero();V++)ce=ee.andln(255),ee.iushrn(8),le[V]=ce;for(;V=4096&&(j+=13,U>>>=13),U>=64&&(j+=7,U>>>=7),U>=8&&(j+=4,U>>>=4),U>=2&&(j+=2,U>>>=2),j+U},s.prototype._zeroBits=function(R){if(R===0)return 26;var U=R,j=0;return(U&8191)===0&&(j+=13,U>>>=13),(U&127)===0&&(j+=7,U>>>=7),(U&15)===0&&(j+=4,U>>>=4),(U&3)===0&&(j+=2,U>>>=2),(U&1)===0&&j++,j},s.prototype.bitLength=function(){var R=this.words[this.length-1],U=this._countBits(R);return(this.length-1)*26+U};function x(B){for(var R=new Array(B.bitLength()),U=0;U>>Z}return R}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var R=0,U=0;UR.length?this.clone().ior(R):R.clone().ior(this)},s.prototype.uor=function(R){return this.length>R.length?this.clone().iuor(R):R.clone().iuor(this)},s.prototype.iuand=function(R){var U;this.length>R.length?U=R:U=this;for(var j=0;jR.length?this.clone().iand(R):R.clone().iand(this)},s.prototype.uand=function(R){return this.length>R.length?this.clone().iuand(R):R.clone().iuand(this)},s.prototype.iuxor=function(R){var U,j;this.length>R.length?(U=this,j=R):(U=R,j=this);for(var Z=0;ZR.length?this.clone().ixor(R):R.clone().ixor(this)},s.prototype.uxor=function(R){return this.length>R.length?this.clone().iuxor(R):R.clone().iuxor(this)},s.prototype.inotn=function(R){i(typeof R=="number"&&R>=0);var U=Math.ceil(R/26)|0,j=R%26;this._expand(U),j>0&&U--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-j),this.strip()},s.prototype.notn=function(R){return this.clone().inotn(R)},s.prototype.setn=function(R,U){i(typeof R=="number"&&R>=0);var j=R/26|0,Z=R%26;return this._expand(j+1),U?this.words[j]=this.words[j]|1<R.length?(j=this,Z=R):(j=R,Z=this);for(var re=0,fe=0;fe>>26;for(;re!==0&&fe>>26;if(this.length=j.length,re!==0)this.words[this.length]=re,this.length++;else if(j!==this)for(;feR.length?this.clone().iadd(R):R.clone().iadd(this)},s.prototype.isub=function(R){if(R.negative!==0){R.negative=0;var U=this.iadd(R);return R.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(R),this.negative=1,this._normSign();var j=this.cmp(R);if(j===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,re;j>0?(Z=this,re=R):(Z=R,re=this);for(var fe=0,le=0;le>26,this.words[le]=U&67108863;for(;fe!==0&&le>26,this.words[le]=U&67108863;if(fe===0&&le>>26,ne=ce&67108863,K=Math.min(V,R.length-1),ue=Math.max(0,V-B.length+1);ue<=K;ue++){var te=V-ue|0;Z=B.words[te]|0,re=R.words[ue]|0,fe=Z*re+ne,ee+=fe/67108864|0,ne=fe&67108863}U.words[V]=ne|0,ce=ee|0}return ce!==0?U.words[V]=ce|0:U.length--,U.strip()}var M=function(R,U,j){var Z=R.words,re=U.words,fe=j.words,le=0,ce,V,ee,ne=Z[0]|0,K=ne&8191,ue=ne>>>13,te=Z[1]|0,H=te&8191,ae=te>>>13,ie=Z[2]|0,ve=ie&8191,Ae=ie>>>13,Ce=Z[3]|0,Fe=Ce&8191,ze=Ce>>>13,Ye=Z[4]|0,it=Ye&8191,st=Ye>>>13,nt=Z[5]|0,Qe=nt&8191,Le=nt>>>13,Te=Z[6]|0,pe=Te&8191,Ne=Te>>>13,ot=Z[7]|0,ct=ot&8191,rt=ot>>>13,Ft=Z[8]|0,Nt=Ft&8191,$t=Ft>>>13,rr=Z[9]|0,Mr=rr&8191,Sr=rr>>>13,Zr=re[0]|0,Ar=Zr&8191,Br=Zr>>>13,Mt=re[1]|0,je=Mt&8191,$e=Mt>>>13,Ee=re[2]|0,xe=Ee&8191,ye=Ee>>>13,Me=re[3]|0,Xe=Me&8191,Je=Me>>>13,Lt=re[4]|0,Ct=Lt&8191,Ot=Lt>>>13,Wt=re[5]|0,_r=Wt&8191,pr=Wt>>>13,hr=re[6]|0,Fr=hr&8191,En=hr>>>13,Zn=re[7]|0,qn=Zn&8191,ta=Zn>>>13,ra=re[8]|0,Nn=ra&8191,Ea=ra>>>13,ja=re[9]|0,ir=ja&8191,qt=ja>>>13;j.negative=R.negative^U.negative,j.length=19,ce=Math.imul(K,Ar),V=Math.imul(K,Br),V=V+Math.imul(ue,Ar)|0,ee=Math.imul(ue,Br);var ar=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ar>>>26)|0,ar&=67108863,ce=Math.imul(H,Ar),V=Math.imul(H,Br),V=V+Math.imul(ae,Ar)|0,ee=Math.imul(ae,Br),ce=ce+Math.imul(K,je)|0,V=V+Math.imul(K,$e)|0,V=V+Math.imul(ue,je)|0,ee=ee+Math.imul(ue,$e)|0;var sr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(sr>>>26)|0,sr&=67108863,ce=Math.imul(ve,Ar),V=Math.imul(ve,Br),V=V+Math.imul(Ae,Ar)|0,ee=Math.imul(Ae,Br),ce=ce+Math.imul(H,je)|0,V=V+Math.imul(H,$e)|0,V=V+Math.imul(ae,je)|0,ee=ee+Math.imul(ae,$e)|0,ce=ce+Math.imul(K,xe)|0,V=V+Math.imul(K,ye)|0,V=V+Math.imul(ue,xe)|0,ee=ee+Math.imul(ue,ye)|0;var Vr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,ce=Math.imul(Fe,Ar),V=Math.imul(Fe,Br),V=V+Math.imul(ze,Ar)|0,ee=Math.imul(ze,Br),ce=ce+Math.imul(ve,je)|0,V=V+Math.imul(ve,$e)|0,V=V+Math.imul(Ae,je)|0,ee=ee+Math.imul(Ae,$e)|0,ce=ce+Math.imul(H,xe)|0,V=V+Math.imul(H,ye)|0,V=V+Math.imul(ae,xe)|0,ee=ee+Math.imul(ae,ye)|0,ce=ce+Math.imul(K,Xe)|0,V=V+Math.imul(K,Je)|0,V=V+Math.imul(ue,Xe)|0,ee=ee+Math.imul(ue,Je)|0;var on=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(on>>>26)|0,on&=67108863,ce=Math.imul(it,Ar),V=Math.imul(it,Br),V=V+Math.imul(st,Ar)|0,ee=Math.imul(st,Br),ce=ce+Math.imul(Fe,je)|0,V=V+Math.imul(Fe,$e)|0,V=V+Math.imul(ze,je)|0,ee=ee+Math.imul(ze,$e)|0,ce=ce+Math.imul(ve,xe)|0,V=V+Math.imul(ve,ye)|0,V=V+Math.imul(Ae,xe)|0,ee=ee+Math.imul(Ae,ye)|0,ce=ce+Math.imul(H,Xe)|0,V=V+Math.imul(H,Je)|0,V=V+Math.imul(ae,Xe)|0,ee=ee+Math.imul(ae,Je)|0,ce=ce+Math.imul(K,Ct)|0,V=V+Math.imul(K,Ot)|0,V=V+Math.imul(ue,Ct)|0,ee=ee+Math.imul(ue,Ot)|0;var pn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pn>>>26)|0,pn&=67108863,ce=Math.imul(Qe,Ar),V=Math.imul(Qe,Br),V=V+Math.imul(Le,Ar)|0,ee=Math.imul(Le,Br),ce=ce+Math.imul(it,je)|0,V=V+Math.imul(it,$e)|0,V=V+Math.imul(st,je)|0,ee=ee+Math.imul(st,$e)|0,ce=ce+Math.imul(Fe,xe)|0,V=V+Math.imul(Fe,ye)|0,V=V+Math.imul(ze,xe)|0,ee=ee+Math.imul(ze,ye)|0,ce=ce+Math.imul(ve,Xe)|0,V=V+Math.imul(ve,Je)|0,V=V+Math.imul(Ae,Xe)|0,ee=ee+Math.imul(Ae,Je)|0,ce=ce+Math.imul(H,Ct)|0,V=V+Math.imul(H,Ot)|0,V=V+Math.imul(ae,Ct)|0,ee=ee+Math.imul(ae,Ot)|0,ce=ce+Math.imul(K,_r)|0,V=V+Math.imul(K,pr)|0,V=V+Math.imul(ue,_r)|0,ee=ee+Math.imul(ue,pr)|0;var wn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(wn>>>26)|0,wn&=67108863,ce=Math.imul(pe,Ar),V=Math.imul(pe,Br),V=V+Math.imul(Ne,Ar)|0,ee=Math.imul(Ne,Br),ce=ce+Math.imul(Qe,je)|0,V=V+Math.imul(Qe,$e)|0,V=V+Math.imul(Le,je)|0,ee=ee+Math.imul(Le,$e)|0,ce=ce+Math.imul(it,xe)|0,V=V+Math.imul(it,ye)|0,V=V+Math.imul(st,xe)|0,ee=ee+Math.imul(st,ye)|0,ce=ce+Math.imul(Fe,Xe)|0,V=V+Math.imul(Fe,Je)|0,V=V+Math.imul(ze,Xe)|0,ee=ee+Math.imul(ze,Je)|0,ce=ce+Math.imul(ve,Ct)|0,V=V+Math.imul(ve,Ot)|0,V=V+Math.imul(Ae,Ct)|0,ee=ee+Math.imul(Ae,Ot)|0,ce=ce+Math.imul(H,_r)|0,V=V+Math.imul(H,pr)|0,V=V+Math.imul(ae,_r)|0,ee=ee+Math.imul(ae,pr)|0,ce=ce+Math.imul(K,Fr)|0,V=V+Math.imul(K,En)|0,V=V+Math.imul(ue,Fr)|0,ee=ee+Math.imul(ue,En)|0;var Kn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,ce=Math.imul(ct,Ar),V=Math.imul(ct,Br),V=V+Math.imul(rt,Ar)|0,ee=Math.imul(rt,Br),ce=ce+Math.imul(pe,je)|0,V=V+Math.imul(pe,$e)|0,V=V+Math.imul(Ne,je)|0,ee=ee+Math.imul(Ne,$e)|0,ce=ce+Math.imul(Qe,xe)|0,V=V+Math.imul(Qe,ye)|0,V=V+Math.imul(Le,xe)|0,ee=ee+Math.imul(Le,ye)|0,ce=ce+Math.imul(it,Xe)|0,V=V+Math.imul(it,Je)|0,V=V+Math.imul(st,Xe)|0,ee=ee+Math.imul(st,Je)|0,ce=ce+Math.imul(Fe,Ct)|0,V=V+Math.imul(Fe,Ot)|0,V=V+Math.imul(ze,Ct)|0,ee=ee+Math.imul(ze,Ot)|0,ce=ce+Math.imul(ve,_r)|0,V=V+Math.imul(ve,pr)|0,V=V+Math.imul(Ae,_r)|0,ee=ee+Math.imul(Ae,pr)|0,ce=ce+Math.imul(H,Fr)|0,V=V+Math.imul(H,En)|0,V=V+Math.imul(ae,Fr)|0,ee=ee+Math.imul(ae,En)|0,ce=ce+Math.imul(K,qn)|0,V=V+Math.imul(K,ta)|0,V=V+Math.imul(ue,qn)|0,ee=ee+Math.imul(ue,ta)|0;var da=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(da>>>26)|0,da&=67108863,ce=Math.imul(Nt,Ar),V=Math.imul(Nt,Br),V=V+Math.imul($t,Ar)|0,ee=Math.imul($t,Br),ce=ce+Math.imul(ct,je)|0,V=V+Math.imul(ct,$e)|0,V=V+Math.imul(rt,je)|0,ee=ee+Math.imul(rt,$e)|0,ce=ce+Math.imul(pe,xe)|0,V=V+Math.imul(pe,ye)|0,V=V+Math.imul(Ne,xe)|0,ee=ee+Math.imul(Ne,ye)|0,ce=ce+Math.imul(Qe,Xe)|0,V=V+Math.imul(Qe,Je)|0,V=V+Math.imul(Le,Xe)|0,ee=ee+Math.imul(Le,Je)|0,ce=ce+Math.imul(it,Ct)|0,V=V+Math.imul(it,Ot)|0,V=V+Math.imul(st,Ct)|0,ee=ee+Math.imul(st,Ot)|0,ce=ce+Math.imul(Fe,_r)|0,V=V+Math.imul(Fe,pr)|0,V=V+Math.imul(ze,_r)|0,ee=ee+Math.imul(ze,pr)|0,ce=ce+Math.imul(ve,Fr)|0,V=V+Math.imul(ve,En)|0,V=V+Math.imul(Ae,Fr)|0,ee=ee+Math.imul(Ae,En)|0,ce=ce+Math.imul(H,qn)|0,V=V+Math.imul(H,ta)|0,V=V+Math.imul(ae,qn)|0,ee=ee+Math.imul(ae,ta)|0,ce=ce+Math.imul(K,Nn)|0,V=V+Math.imul(K,Ea)|0,V=V+Math.imul(ue,Nn)|0,ee=ee+Math.imul(ue,Ea)|0;var fa=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(fa>>>26)|0,fa&=67108863,ce=Math.imul(Mr,Ar),V=Math.imul(Mr,Br),V=V+Math.imul(Sr,Ar)|0,ee=Math.imul(Sr,Br),ce=ce+Math.imul(Nt,je)|0,V=V+Math.imul(Nt,$e)|0,V=V+Math.imul($t,je)|0,ee=ee+Math.imul($t,$e)|0,ce=ce+Math.imul(ct,xe)|0,V=V+Math.imul(ct,ye)|0,V=V+Math.imul(rt,xe)|0,ee=ee+Math.imul(rt,ye)|0,ce=ce+Math.imul(pe,Xe)|0,V=V+Math.imul(pe,Je)|0,V=V+Math.imul(Ne,Xe)|0,ee=ee+Math.imul(Ne,Je)|0,ce=ce+Math.imul(Qe,Ct)|0,V=V+Math.imul(Qe,Ot)|0,V=V+Math.imul(Le,Ct)|0,ee=ee+Math.imul(Le,Ot)|0,ce=ce+Math.imul(it,_r)|0,V=V+Math.imul(it,pr)|0,V=V+Math.imul(st,_r)|0,ee=ee+Math.imul(st,pr)|0,ce=ce+Math.imul(Fe,Fr)|0,V=V+Math.imul(Fe,En)|0,V=V+Math.imul(ze,Fr)|0,ee=ee+Math.imul(ze,En)|0,ce=ce+Math.imul(ve,qn)|0,V=V+Math.imul(ve,ta)|0,V=V+Math.imul(Ae,qn)|0,ee=ee+Math.imul(Ae,ta)|0,ce=ce+Math.imul(H,Nn)|0,V=V+Math.imul(H,Ea)|0,V=V+Math.imul(ae,Nn)|0,ee=ee+Math.imul(ae,Ea)|0,ce=ce+Math.imul(K,ir)|0,V=V+Math.imul(K,qt)|0,V=V+Math.imul(ue,ir)|0,ee=ee+Math.imul(ue,qt)|0;var ga=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ga>>>26)|0,ga&=67108863,ce=Math.imul(Mr,je),V=Math.imul(Mr,$e),V=V+Math.imul(Sr,je)|0,ee=Math.imul(Sr,$e),ce=ce+Math.imul(Nt,xe)|0,V=V+Math.imul(Nt,ye)|0,V=V+Math.imul($t,xe)|0,ee=ee+Math.imul($t,ye)|0,ce=ce+Math.imul(ct,Xe)|0,V=V+Math.imul(ct,Je)|0,V=V+Math.imul(rt,Xe)|0,ee=ee+Math.imul(rt,Je)|0,ce=ce+Math.imul(pe,Ct)|0,V=V+Math.imul(pe,Ot)|0,V=V+Math.imul(Ne,Ct)|0,ee=ee+Math.imul(Ne,Ot)|0,ce=ce+Math.imul(Qe,_r)|0,V=V+Math.imul(Qe,pr)|0,V=V+Math.imul(Le,_r)|0,ee=ee+Math.imul(Le,pr)|0,ce=ce+Math.imul(it,Fr)|0,V=V+Math.imul(it,En)|0,V=V+Math.imul(st,Fr)|0,ee=ee+Math.imul(st,En)|0,ce=ce+Math.imul(Fe,qn)|0,V=V+Math.imul(Fe,ta)|0,V=V+Math.imul(ze,qn)|0,ee=ee+Math.imul(ze,ta)|0,ce=ce+Math.imul(ve,Nn)|0,V=V+Math.imul(ve,Ea)|0,V=V+Math.imul(Ae,Nn)|0,ee=ee+Math.imul(Ae,Ea)|0,ce=ce+Math.imul(H,ir)|0,V=V+Math.imul(H,qt)|0,V=V+Math.imul(ae,ir)|0,ee=ee+Math.imul(ae,qt)|0;var ka=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ka>>>26)|0,ka&=67108863,ce=Math.imul(Mr,xe),V=Math.imul(Mr,ye),V=V+Math.imul(Sr,xe)|0,ee=Math.imul(Sr,ye),ce=ce+Math.imul(Nt,Xe)|0,V=V+Math.imul(Nt,Je)|0,V=V+Math.imul($t,Xe)|0,ee=ee+Math.imul($t,Je)|0,ce=ce+Math.imul(ct,Ct)|0,V=V+Math.imul(ct,Ot)|0,V=V+Math.imul(rt,Ct)|0,ee=ee+Math.imul(rt,Ot)|0,ce=ce+Math.imul(pe,_r)|0,V=V+Math.imul(pe,pr)|0,V=V+Math.imul(Ne,_r)|0,ee=ee+Math.imul(Ne,pr)|0,ce=ce+Math.imul(Qe,Fr)|0,V=V+Math.imul(Qe,En)|0,V=V+Math.imul(Le,Fr)|0,ee=ee+Math.imul(Le,En)|0,ce=ce+Math.imul(it,qn)|0,V=V+Math.imul(it,ta)|0,V=V+Math.imul(st,qn)|0,ee=ee+Math.imul(st,ta)|0,ce=ce+Math.imul(Fe,Nn)|0,V=V+Math.imul(Fe,Ea)|0,V=V+Math.imul(ze,Nn)|0,ee=ee+Math.imul(ze,Ea)|0,ce=ce+Math.imul(ve,ir)|0,V=V+Math.imul(ve,qt)|0,V=V+Math.imul(Ae,ir)|0,ee=ee+Math.imul(Ae,qt)|0;var Vn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,ce=Math.imul(Mr,Xe),V=Math.imul(Mr,Je),V=V+Math.imul(Sr,Xe)|0,ee=Math.imul(Sr,Je),ce=ce+Math.imul(Nt,Ct)|0,V=V+Math.imul(Nt,Ot)|0,V=V+Math.imul($t,Ct)|0,ee=ee+Math.imul($t,Ot)|0,ce=ce+Math.imul(ct,_r)|0,V=V+Math.imul(ct,pr)|0,V=V+Math.imul(rt,_r)|0,ee=ee+Math.imul(rt,pr)|0,ce=ce+Math.imul(pe,Fr)|0,V=V+Math.imul(pe,En)|0,V=V+Math.imul(Ne,Fr)|0,ee=ee+Math.imul(Ne,En)|0,ce=ce+Math.imul(Qe,qn)|0,V=V+Math.imul(Qe,ta)|0,V=V+Math.imul(Le,qn)|0,ee=ee+Math.imul(Le,ta)|0,ce=ce+Math.imul(it,Nn)|0,V=V+Math.imul(it,Ea)|0,V=V+Math.imul(st,Nn)|0,ee=ee+Math.imul(st,Ea)|0,ce=ce+Math.imul(Fe,ir)|0,V=V+Math.imul(Fe,qt)|0,V=V+Math.imul(ze,ir)|0,ee=ee+Math.imul(ze,qt)|0;var hi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(hi>>>26)|0,hi&=67108863,ce=Math.imul(Mr,Ct),V=Math.imul(Mr,Ot),V=V+Math.imul(Sr,Ct)|0,ee=Math.imul(Sr,Ot),ce=ce+Math.imul(Nt,_r)|0,V=V+Math.imul(Nt,pr)|0,V=V+Math.imul($t,_r)|0,ee=ee+Math.imul($t,pr)|0,ce=ce+Math.imul(ct,Fr)|0,V=V+Math.imul(ct,En)|0,V=V+Math.imul(rt,Fr)|0,ee=ee+Math.imul(rt,En)|0,ce=ce+Math.imul(pe,qn)|0,V=V+Math.imul(pe,ta)|0,V=V+Math.imul(Ne,qn)|0,ee=ee+Math.imul(Ne,ta)|0,ce=ce+Math.imul(Qe,Nn)|0,V=V+Math.imul(Qe,Ea)|0,V=V+Math.imul(Le,Nn)|0,ee=ee+Math.imul(Le,Ea)|0,ce=ce+Math.imul(it,ir)|0,V=V+Math.imul(it,qt)|0,V=V+Math.imul(st,ir)|0,ee=ee+Math.imul(st,qt)|0;var Ti=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,ce=Math.imul(Mr,_r),V=Math.imul(Mr,pr),V=V+Math.imul(Sr,_r)|0,ee=Math.imul(Sr,pr),ce=ce+Math.imul(Nt,Fr)|0,V=V+Math.imul(Nt,En)|0,V=V+Math.imul($t,Fr)|0,ee=ee+Math.imul($t,En)|0,ce=ce+Math.imul(ct,qn)|0,V=V+Math.imul(ct,ta)|0,V=V+Math.imul(rt,qn)|0,ee=ee+Math.imul(rt,ta)|0,ce=ce+Math.imul(pe,Nn)|0,V=V+Math.imul(pe,Ea)|0,V=V+Math.imul(Ne,Nn)|0,ee=ee+Math.imul(Ne,Ea)|0,ce=ce+Math.imul(Qe,ir)|0,V=V+Math.imul(Qe,qt)|0,V=V+Math.imul(Le,ir)|0,ee=ee+Math.imul(Le,qt)|0;var Dt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,ce=Math.imul(Mr,Fr),V=Math.imul(Mr,En),V=V+Math.imul(Sr,Fr)|0,ee=Math.imul(Sr,En),ce=ce+Math.imul(Nt,qn)|0,V=V+Math.imul(Nt,ta)|0,V=V+Math.imul($t,qn)|0,ee=ee+Math.imul($t,ta)|0,ce=ce+Math.imul(ct,Nn)|0,V=V+Math.imul(ct,Ea)|0,V=V+Math.imul(rt,Nn)|0,ee=ee+Math.imul(rt,Ea)|0,ce=ce+Math.imul(pe,ir)|0,V=V+Math.imul(pe,qt)|0,V=V+Math.imul(Ne,ir)|0,ee=ee+Math.imul(Ne,qt)|0;var yt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(yt>>>26)|0,yt&=67108863,ce=Math.imul(Mr,qn),V=Math.imul(Mr,ta),V=V+Math.imul(Sr,qn)|0,ee=Math.imul(Sr,ta),ce=ce+Math.imul(Nt,Nn)|0,V=V+Math.imul(Nt,Ea)|0,V=V+Math.imul($t,Nn)|0,ee=ee+Math.imul($t,Ea)|0,ce=ce+Math.imul(ct,ir)|0,V=V+Math.imul(ct,qt)|0,V=V+Math.imul(rt,ir)|0,ee=ee+Math.imul(rt,qt)|0;var Er=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Er>>>26)|0,Er&=67108863,ce=Math.imul(Mr,Nn),V=Math.imul(Mr,Ea),V=V+Math.imul(Sr,Nn)|0,ee=Math.imul(Sr,Ea),ce=ce+Math.imul(Nt,ir)|0,V=V+Math.imul(Nt,qt)|0,V=V+Math.imul($t,ir)|0,ee=ee+Math.imul($t,qt)|0;var Nr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,ce=Math.imul(Mr,ir),V=Math.imul(Mr,qt),V=V+Math.imul(Sr,ir)|0,ee=Math.imul(Sr,qt);var jr=(le+ce|0)+((V&8191)<<13)|0;return le=(ee+(V>>>13)|0)+(jr>>>26)|0,jr&=67108863,fe[0]=ar,fe[1]=sr,fe[2]=Vr,fe[3]=on,fe[4]=pn,fe[5]=wn,fe[6]=Kn,fe[7]=da,fe[8]=fa,fe[9]=ga,fe[10]=ka,fe[11]=Vn,fe[12]=hi,fe[13]=Ti,fe[14]=Dt,fe[15]=yt,fe[16]=Er,fe[17]=Nr,fe[18]=jr,le!==0&&(fe[19]=le,j.length++),j};Math.imul||(M=A);function _(B,R,U){U.negative=R.negative^B.negative,U.length=B.length+R.length;for(var j=0,Z=0,re=0;re>>26)|0,Z+=fe>>>26,fe&=67108863}U.words[re]=le,j=fe,fe=Z}return j!==0?U.words[re]=j:U.length--,U.strip()}function w(B,R,U){var j=new m;return j.mulp(B,R,U)}s.prototype.mulTo=function(R,U){var j,Z=this.length+R.length;return this.length===10&&R.length===10?j=M(this,R,U):Z<63?j=A(this,R,U):Z<1024?j=_(this,R,U):j=w(this,R,U),j};function m(B,R){this.x=B,this.y=R}m.prototype.makeRBT=function(R){for(var U=new Array(R),j=s.prototype._countBits(R)-1,Z=0;Z>=1;return Z},m.prototype.permute=function(R,U,j,Z,re,fe){for(var le=0;le>>1)re++;return 1<>>13,j[2*fe+1]=re&8191,re=re>>>13;for(fe=2*U;fe>=26,U+=Z/67108864|0,U+=re>>>26,this.words[j]=re&67108863}return U!==0&&(this.words[j]=U,this.length++),this},s.prototype.muln=function(R){return this.clone().imuln(R)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(R){var U=x(R);if(U.length===0)return new s(1);for(var j=this,Z=0;Z=0);var U=R%26,j=(R-U)/26,Z=67108863>>>26-U<<26-U,re;if(U!==0){var fe=0;for(re=0;re>>26-U}fe&&(this.words[re]=fe,this.length++)}if(j!==0){for(re=this.length-1;re>=0;re--)this.words[re+j]=this.words[re];for(re=0;re=0);var Z;U?Z=(U-U%26)/26:Z=0;var re=R%26,fe=Math.min((R-re)/26,this.length),le=67108863^67108863>>>re<fe)for(this.length-=fe,V=0;V=0&&(ee!==0||V>=Z);V--){var ne=this.words[V]|0;this.words[V]=ee<<26-re|ne>>>re,ee=ne&le}return ce&&ee!==0&&(ce.words[ce.length++]=ee),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(R,U,j){return i(this.negative===0),this.iushrn(R,U,j)},s.prototype.shln=function(R){return this.clone().ishln(R)},s.prototype.ushln=function(R){return this.clone().iushln(R)},s.prototype.shrn=function(R){return this.clone().ishrn(R)},s.prototype.ushrn=function(R){return this.clone().iushrn(R)},s.prototype.testn=function(R){i(typeof R=="number"&&R>=0);var U=R%26,j=(R-U)/26,Z=1<=0);var U=R%26,j=(R-U)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=j)return this;if(U!==0&&j++,this.length=Math.min(j,this.length),U!==0){var Z=67108863^67108863>>>U<=67108864;U++)this.words[U]-=67108864,U===this.length-1?this.words[U+1]=1:this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},s.prototype.isubn=function(R){if(i(typeof R=="number"),i(R<67108864),R<0)return this.iaddn(-R);if(this.negative!==0)return this.negative=0,this.iaddn(R),this.negative=1,this;if(this.words[0]-=R,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U>26)-(ce/67108864|0),this.words[re+j]=fe&67108863}for(;re>26,this.words[re+j]=fe&67108863;if(le===0)return this.strip();for(i(le===-1),le=0,re=0;re>26,this.words[re]=fe&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(R,U){var j=this.length-R.length,Z=this.clone(),re=R,fe=re.words[re.length-1]|0,le=this._countBits(fe);j=26-le,j!==0&&(re=re.ushln(j),Z.iushln(j),fe=re.words[re.length-1]|0);var ce=Z.length-re.length,V;if(U!=="mod"){V=new s(null),V.length=ce+1,V.words=new Array(V.length);for(var ee=0;ee=0;K--){var ue=(Z.words[re.length+K]|0)*67108864+(Z.words[re.length+K-1]|0);for(ue=Math.min(ue/fe|0,67108863),Z._ishlnsubmul(re,ue,K);Z.negative!==0;)ue--,Z.negative=0,Z._ishlnsubmul(re,1,K),Z.isZero()||(Z.negative^=1);V&&(V.words[K]=ue)}return V&&V.strip(),Z.strip(),U!=="div"&&j!==0&&Z.iushrn(j),{div:V||null,mod:Z}},s.prototype.divmod=function(R,U,j){if(i(!R.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,re,fe;return this.negative!==0&&R.negative===0?(fe=this.neg().divmod(R,U),U!=="mod"&&(Z=fe.div.neg()),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.iadd(R)),{div:Z,mod:re}):this.negative===0&&R.negative!==0?(fe=this.divmod(R.neg(),U),U!=="mod"&&(Z=fe.div.neg()),{div:Z,mod:fe.mod}):(this.negative&R.negative)!==0?(fe=this.neg().divmod(R.neg(),U),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.isub(R)),{div:fe.div,mod:re}):R.length>this.length||this.cmp(R)<0?{div:new s(0),mod:this}:R.length===1?U==="div"?{div:this.divn(R.words[0]),mod:null}:U==="mod"?{div:null,mod:new s(this.modn(R.words[0]))}:{div:this.divn(R.words[0]),mod:new s(this.modn(R.words[0]))}:this._wordDiv(R,U)},s.prototype.div=function(R){return this.divmod(R,"div",!1).div},s.prototype.mod=function(R){return this.divmod(R,"mod",!1).mod},s.prototype.umod=function(R){return this.divmod(R,"mod",!0).mod},s.prototype.divRound=function(R){var U=this.divmod(R);if(U.mod.isZero())return U.div;var j=U.div.negative!==0?U.mod.isub(R):U.mod,Z=R.ushrn(1),re=R.andln(1),fe=j.cmp(Z);return fe<0||re===1&&fe===0?U.div:U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},s.prototype.modn=function(R){i(R<=67108863);for(var U=(1<<26)%R,j=0,Z=this.length-1;Z>=0;Z--)j=(U*j+(this.words[Z]|0))%R;return j},s.prototype.idivn=function(R){i(R<=67108863);for(var U=0,j=this.length-1;j>=0;j--){var Z=(this.words[j]|0)+U*67108864;this.words[j]=Z/R|0,U=Z%R}return this.strip()},s.prototype.divn=function(R){return this.clone().idivn(R)},s.prototype.egcd=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=new s(0),le=new s(1),ce=0;U.isEven()&&j.isEven();)U.iushrn(1),j.iushrn(1),++ce;for(var V=j.clone(),ee=U.clone();!U.isZero();){for(var ne=0,K=1;(U.words[0]&K)===0&&ne<26;++ne,K<<=1);if(ne>0)for(U.iushrn(ne);ne-- >0;)(Z.isOdd()||re.isOdd())&&(Z.iadd(V),re.isub(ee)),Z.iushrn(1),re.iushrn(1);for(var ue=0,te=1;(j.words[0]&te)===0&&ue<26;++ue,te<<=1);if(ue>0)for(j.iushrn(ue);ue-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(V),le.isub(ee)),fe.iushrn(1),le.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(fe),re.isub(le)):(j.isub(U),fe.isub(Z),le.isub(re))}return{a:fe,b:le,gcd:j.iushln(ce)}},s.prototype._invmp=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=j.clone();U.cmpn(1)>0&&j.cmpn(1)>0;){for(var le=0,ce=1;(U.words[0]&ce)===0&&le<26;++le,ce<<=1);if(le>0)for(U.iushrn(le);le-- >0;)Z.isOdd()&&Z.iadd(fe),Z.iushrn(1);for(var V=0,ee=1;(j.words[0]&ee)===0&&V<26;++V,ee<<=1);if(V>0)for(j.iushrn(V);V-- >0;)re.isOdd()&&re.iadd(fe),re.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(re)):(j.isub(U),re.isub(Z))}var ne;return U.cmpn(1)===0?ne=Z:ne=re,ne.cmpn(0)<0&&ne.iadd(R),ne},s.prototype.gcd=function(R){if(this.isZero())return R.abs();if(R.isZero())return this.abs();var U=this.clone(),j=R.clone();U.negative=0,j.negative=0;for(var Z=0;U.isEven()&&j.isEven();Z++)U.iushrn(1),j.iushrn(1);do{for(;U.isEven();)U.iushrn(1);for(;j.isEven();)j.iushrn(1);var re=U.cmp(j);if(re<0){var fe=U;U=j,j=fe}else if(re===0||j.cmpn(1)===0)break;U.isub(j)}while(!0);return j.iushln(Z)},s.prototype.invm=function(R){return this.egcd(R).a.umod(R)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(R){return this.words[0]&R},s.prototype.bincn=function(R){i(typeof R=="number");var U=R%26,j=(R-U)/26,Z=1<>>26,le&=67108863,this.words[fe]=le}return re!==0&&(this.words[fe]=re,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(R){var U=R<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var j;if(this.length>1)j=1;else{U&&(R=-R),i(R<=67108863,"Number is too big");var Z=this.words[0]|0;j=Z===R?0:ZR.length)return 1;if(this.length=0;j--){var Z=this.words[j]|0,re=R.words[j]|0;if(Z!==re){Zre&&(U=1);break}}return U},s.prototype.gtn=function(R){return this.cmpn(R)===1},s.prototype.gt=function(R){return this.cmp(R)===1},s.prototype.gten=function(R){return this.cmpn(R)>=0},s.prototype.gte=function(R){return this.cmp(R)>=0},s.prototype.ltn=function(R){return this.cmpn(R)===-1},s.prototype.lt=function(R){return this.cmp(R)===-1},s.prototype.lten=function(R){return this.cmpn(R)<=0},s.prototype.lte=function(R){return this.cmp(R)<=0},s.prototype.eqn=function(R){return this.cmpn(R)===0},s.prototype.eq=function(R){return this.cmp(R)===0},s.red=function(R){return new F(R)},s.prototype.toRed=function(R){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),R.convertTo(this)._forceRed(R)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(R){return this.red=R,this},s.prototype.forceRed=function(R){return i(!this.red,"Already a number in reduction context"),this._forceRed(R)},s.prototype.redAdd=function(R){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,R)},s.prototype.redIAdd=function(R){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,R)},s.prototype.redSub=function(R){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,R)},s.prototype.redISub=function(R){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,R)},s.prototype.redShl=function(R){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,R)},s.prototype.redMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.mul(this,R)},s.prototype.redIMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.imul(this,R)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(R){return i(this.red&&!R.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,R)};var u={k256:null,p224:null,p192:null,p25519:null};function v(B,R){this.name=B,this.p=new s(R,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}v.prototype._tmp=function(){var R=new s(null);return R.words=new Array(Math.ceil(this.n/13)),R},v.prototype.ireduce=function(R){var U=R,j;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),j=U.bitLength();while(j>this.n);var Z=j0?U.isub(this.p):U.strip!==void 0?U.strip():U._strip(),U},v.prototype.split=function(R,U){R.iushrn(this.n,0,U)},v.prototype.imulK=function(R){return R.imul(this.k)};function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(y,v),y.prototype.split=function(R,U){for(var j=4194303,Z=Math.min(R.length,9),re=0;re>>22,fe=le}fe>>>=22,R.words[re-10]=fe,fe===0&&R.length>10?R.length-=10:R.length-=9},y.prototype.imulK=function(R){R.words[R.length]=0,R.words[R.length+1]=0,R.length+=2;for(var U=0,j=0;j>>=26,R.words[j]=re,U=Z}return U!==0&&(R.words[R.length++]=U),R},s._prime=function(R){if(u[R])return u[R];var U;if(R==="k256")U=new y;else if(R==="p224")U=new I;else if(R==="p192")U=new L;else if(R==="p25519")U=new z;else throw new Error("Unknown prime "+R);return u[R]=U,U};function F(B){if(typeof B=="string"){var R=s._prime(B);this.m=R.p,this.prime=R}else i(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}F.prototype._verify1=function(R){i(R.negative===0,"red works only with positives"),i(R.red,"red works only with red numbers")},F.prototype._verify2=function(R,U){i((R.negative|U.negative)===0,"red works only with positives"),i(R.red&&R.red===U.red,"red works only with red numbers")},F.prototype.imod=function(R){return this.prime?this.prime.ireduce(R)._forceRed(this):R.umod(this.m)._forceRed(this)},F.prototype.neg=function(R){return R.isZero()?R.clone():this.m.sub(R)._forceRed(this)},F.prototype.add=function(R,U){this._verify2(R,U);var j=R.add(U);return j.cmp(this.m)>=0&&j.isub(this.m),j._forceRed(this)},F.prototype.iadd=function(R,U){this._verify2(R,U);var j=R.iadd(U);return j.cmp(this.m)>=0&&j.isub(this.m),j},F.prototype.sub=function(R,U){this._verify2(R,U);var j=R.sub(U);return j.cmpn(0)<0&&j.iadd(this.m),j._forceRed(this)},F.prototype.isub=function(R,U){this._verify2(R,U);var j=R.isub(U);return j.cmpn(0)<0&&j.iadd(this.m),j},F.prototype.shl=function(R,U){return this._verify1(R),this.imod(R.ushln(U))},F.prototype.imul=function(R,U){return this._verify2(R,U),this.imod(R.imul(U))},F.prototype.mul=function(R,U){return this._verify2(R,U),this.imod(R.mul(U))},F.prototype.isqr=function(R){return this.imul(R,R.clone())},F.prototype.sqr=function(R){return this.mul(R,R)},F.prototype.sqrt=function(R){if(R.isZero())return R.clone();var U=this.m.andln(3);if(i(U%2===1),U===3){var j=this.m.add(new s(1)).iushrn(2);return this.pow(R,j)}for(var Z=this.m.subn(1),re=0;!Z.isZero()&&Z.andln(1)===0;)re++,Z.iushrn(1);i(!Z.isZero());var fe=new s(1).toRed(this),le=fe.redNeg(),ce=this.m.subn(1).iushrn(1),V=this.m.bitLength();for(V=new s(2*V*V).toRed(this);this.pow(V,ce).cmp(le)!==0;)V.redIAdd(le);for(var ee=this.pow(V,Z),ne=this.pow(R,Z.addn(1).iushrn(1)),K=this.pow(R,Z),ue=re;K.cmp(fe)!==0;){for(var te=K,H=0;te.cmp(fe)!==0;H++)te=te.redSqr();i(H=0;re--){for(var ee=U.words[re],ne=V-1;ne>=0;ne--){var K=ee>>ne&1;if(fe!==Z[0]&&(fe=this.sqr(fe)),K===0&&le===0){ce=0;continue}le<<=1,le|=K,ce++,!(ce!==j&&(re!==0||ne!==0))&&(fe=this.mul(fe,Z[le]),ce=0,le=0)}V=26}return fe},F.prototype.convertTo=function(R){var U=R.umod(this.m);return U===R?U.clone():U},F.prototype.convertFrom=function(R){var U=R.clone();return U.red=null,U},s.mont=function(R){return new N(R)};function N(B){F.call(this,B),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)}a(N,F),N.prototype.convertTo=function(R){return this.imod(R.ushln(this.shift))},N.prototype.convertFrom=function(R){var U=this.imod(R.mul(this.rinv));return U.red=null,U},N.prototype.imul=function(R,U){if(R.isZero()||U.isZero())return R.words[0]=0,R.length=1,R;var j=R.imul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.mul=function(R,U){if(R.isZero()||U.isZero())return new s(0)._forceRed(this);var j=R.mul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.invm=function(R){var U=this.imod(R._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(e,this)}),6860:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]-n[0],r[1]=o[1]-n[1],r[2]=o[2]-n[2],r[3]=o[3]-n[3],r}}),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}}),6867:(function(e,t,r){e.exports=l;var o=r(1888),n=r(855),i=r(7150);function a(g,x){for(var A=0;A>>1;if(!(m<=0)){var u,v=o.mallocDouble(2*m*_),y=o.mallocInt32(_);if(_=s(g,m,v,y),_>0){if(m===1&&M)n.init(_),u=n.sweepComplete(m,A,0,_,v,y,0,_,v,y);else{var I=o.mallocDouble(2*m*w),L=o.mallocInt32(w);w=s(x,m,I,L),w>0&&(n.init(_+w),m===1?u=n.sweepBipartite(m,A,0,_,v,y,0,w,I,L):u=i(m,A,M,_,v,y,w,I,L),o.free(I),o.free(L))}o.free(v),o.free(y)}return u}}}var c;function p(g,x){c.push([g,x])}function d(g){return c=[],f(g,g,p,!0),c}function T(g,x){return c=[],f(g,x,p,!1),c}function l(g,x,A){switch(arguments.length){case 1:return d(g);case 2:return typeof x=="function"?f(g,g,x,!0):T(g,x);case 3:return f(g,x,A,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),6894:(function(e){e.exports=t;function t(r,o,n,i){var a=n[1],s=n[2],f=o[1]-a,c=o[2]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=o[0],r[1]=a+f*d-c*p,r[2]=s+f*p+c*d,r}}),7004:(function(e){e.exports=t;function t(r){for(var o=r.length,n=r[r.length-1],i=o,a=o-2;a>=0;--a){var s=n,f=r[a];n=s+f;var c=n-s,p=f-c;p&&(r[--i]=n,n=p)}for(var d=0,a=i;a=p0)&&!(p1>=hi)"),x=p("lo===p0"),A=p("lo0;){ee-=1;var ue=ee*m,te=y[ue],H=y[ue+1],ae=y[ue+2],ie=y[ue+3],ve=y[ue+4],Ae=y[ue+5],Ce=ee*u,Fe=I[Ce],ze=I[Ce+1],Ye=Ae&1,it=!!(Ae&16),st=re,nt=fe,Qe=ce,Le=V;if(Ye&&(st=ce,nt=V,Qe=re,Le=fe),!(Ae&2&&(ae=A(R,te,H,ae,st,nt,ze),H>=ae))&&!(Ae&4&&(H=M(R,te,H,ae,st,nt,Fe),H>=ae))){var Te=ae-H,pe=ve-ie;if(it){if(R*Te*(Te+pe)"u"?r(1538):WeakMap,n=r(2762),i=r(8116),a=new o;function s(f){var c=a.get(f),p=c&&(c._triangleBuffer.handle||c._triangleBuffer.buffer);if(!p||!f.isBuffer(p)){var d=n(f,new Float32Array([-1,-1,-1,4,4,-1]));c=i(f,[{buffer:d,type:f.FLOAT,size:2}]),c._triangleBuffer=d,a.set(f,c)}c.bind(),f.drawArrays(f.TRIANGLES,0,3),c.unbind()}e.exports=s}),7182:(function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var n=o.create();e.exports=function(a,s,f,c,p,d){return o.identity(a),o.fromRotationTranslation(a,d,s),a[3]=p[0],a[7]=p[1],a[11]=p[2],a[15]=p[3],o.identity(n),c[2]!==0&&(n[9]=c[2],o.multiply(a,a,n)),c[1]!==0&&(n[9]=0,n[8]=c[1],o.multiply(a,a,n)),c[0]!==0&&(n[8]=0,n[4]=c[0],o.multiply(a,a,n)),o.scale(a,a,f),a}}),7201:(function(e,t,r){var o=1e-6,n=1e-6,i=r(9405),a=r(2762),s=r(8116),f=r(7766),c=r(8406),p=r(6760),d=r(7608),T=r(9618),l=r(6729),g=r(7765),x=r(1888),A=r(840),M=r(7626),_=A.meshShader,w=A.wireShader,m=A.pointShader,u=A.pickShader,v=A.pointPickShader,y=A.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(ce,V,ee,ne,K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye,it,st,nt,Qe,Le,Te,pe,Ne,ot,ct,rt){this.gl=ce,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=V,this.dirty=!0,this.triShader=ee,this.lineShader=ne,this.pointShader=K,this.pickShader=ue,this.pointPickShader=te,this.contourShader=H,this.trianglePositions=ae,this.triangleColors=ve,this.triangleNormals=Ce,this.triangleUVs=Ae,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=ze,this.edgeColors=it,this.edgeUVs=st,this.edgeIds=Ye,this.edgeVAO=nt,this.edgeCount=0,this.pointPositions=Qe,this.pointColors=Te,this.pointUVs=pe,this.pointSizes=Ne,this.pointIds=Le,this.pointVAO=ot,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=ct,this.contourVAO=rt,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=I,this._view=I,this._projection=I,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(ce){this.pickId=ce};function F(ce,V){if(!V||!V.length)return 1;for(var ee=0;eece&&ee>0){var ne=(V[ee][0]-ce)/(V[ee][0]-V[ee-1][0]);return V[ee][1]*(1-ne)+ne*V[ee-1][1]}}return 1}function N(ce,V){for(var ee=l({colormap:ce,nshades:256,format:"rgba"}),ne=new Uint8Array(256*4),K=0;K<256;++K){for(var ue=ee[K],te=0;te<3;++te)ne[4*K+te]=ue[te];V?ne[4*K+3]=255*F(K/255,V):ne[4*K+3]=255*ue[3]}return T(ne,[256,256,4],[4,0,1])}function B(ce){for(var V=ce.length,ee=new Array(V),ne=0;ne0){var Ce=this.triShader;Ce.bind(),Ce.uniforms=H,this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ce=this.lineShader;Ce.bind(),Ce.uniforms=H,this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ce=this.pointShader;Ce.bind(),Ce.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ce=this.contourShader;Ce.bind(),Ce.uniforms=H,this.contourVAO.bind(),V.drawArrays(V.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(ce){ce=ce||{};for(var V=this.gl,ee=ce.model||I,ne=ce.view||I,K=ce.projection||I,ue=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],te=0;te<3;++te)ue[0][te]=Math.max(ue[0][te],this.clipBounds[0][te]),ue[1][te]=Math.min(ue[1][te],this.clipBounds[1][te]);this._model=[].slice.call(ee),this._view=[].slice.call(ne),this._projection=[].slice.call(K),this._resolution=[V.drawingBufferWidth,V.drawingBufferHeight];var H={model:ee,view:ne,projection:K,clipBounds:ue,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=H,this.triangleCount>0&&(this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(ce){if(!ce||ce.id!==this.pickId)return null;for(var V=ce.value[0]+256*ce.value[1]+65536*ce.value[2],ee=this.cells[V],ne=this.positions,K=new Array(ee.length),ue=0;ueMath.max(_,w)?m[2]=1:_>Math.max(M,w)?m[0]=1:m[1]=1;for(var u=0,v=0,y=0;y<3;++y)u+=A[y]*A[y],v+=m[y]*A[y];for(var y=0;y<3;++y)m[y]-=v/u*A[y];return s(m,m),m}function T(A,M,_,w,m,u,v,y){this.center=o(_),this.up=o(w),this.right=o(m),this.radius=o([u]),this.angle=o([v,y]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(A,M),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 I=0;I<16;++I)this.computedMatrix[I]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(A,M){A>0?A=Math.log(A):A=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,A),this.radius.bounds[0][0]=A,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(A){var M=this.radius.bounds[0];return A?(A[0]=Math.exp(M[0][0]),A[1]=Math.exp(M[1][0]),A):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(A){this.center.curve(A),this.up.curve(A),this.right.curve(A),this.radius.curve(A),this.angle.curve(A);for(var M=this.computedUp,_=this.computedRight,w=0,m=0,u=0;u<3;++u)m+=M[u]*_[u],w+=M[u]*M[u];for(var v=Math.sqrt(w),y=0,u=0;u<3;++u)_[u]-=M[u]*m/w,y+=_[u]*_[u],M[u]/=v;for(var I=Math.sqrt(y),u=0;u<3;++u)_[u]/=I;var L=this.computedToward;a(L,M,_),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],N=this.computedAngle[1],B=Math.cos(F),R=Math.sin(F),U=Math.cos(N),j=Math.sin(N),Z=this.computedCenter,re=B*U,fe=R*U,le=j,ce=-B*j,V=-R*j,ee=U,ne=this.computedEye,K=this.computedMatrix,u=0;u<3;++u){var ue=re*_[u]+fe*L[u]+le*M[u];K[4*u+1]=ce*_[u]+V*L[u]+ee*M[u],K[4*u+2]=ue,K[4*u+3]=0}var te=K[1],H=K[5],ae=K[9],ie=K[2],ve=K[6],Ae=K[10],Ce=H*Ae-ae*ve,Fe=ae*ie-te*Ae,ze=te*ve-H*ie,Ye=c(Ce,Fe,ze);Ce/=Ye,Fe/=Ye,ze/=Ye,K[0]=Ce,K[4]=Fe,K[8]=ze;for(var u=0;u<3;++u)ne[u]=Z[u]+K[2+4*u]*z;for(var u=0;u<3;++u){for(var y=0,it=0;it<3;++it)y+=K[u+4*it]*ne[it];K[12+u]=-y}K[15]=1},l.getMatrix=function(A,M){this.recalcMatrix(A);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var g=[0,0,0];l.rotate=function(A,M,_,w){if(this.angle.move(A,M,_),w){this.recalcMatrix(A);var m=this.computedMatrix;g[0]=m[2],g[1]=m[6],g[2]=m[10];for(var u=this.computedUp,v=this.computedRight,y=this.computedToward,I=0;I<3;++I)m[4*I]=u[I],m[4*I+1]=v[I],m[4*I+2]=y[I];i(m,m,w,g);for(var I=0;I<3;++I)u[I]=m[4*I],v[I]=m[4*I+1];this.up.set(A,u[0],u[1],u[2]),this.right.set(A,v[0],v[1],v[2])}},l.pan=function(A,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(A);var m=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=m[1],v=m[5],y=m[9],I=c(u,v,y);u/=I,v/=I,y/=I;var L=m[0],z=m[4],F=m[8],N=L*u+z*v+F*y;L-=u*N,z-=v*N,F-=y*N;var B=c(L,z,F);L/=B,z/=B,F/=B;var R=L*M+u*_,U=z*M+v*_,j=F*M+y*_;this.center.move(A,R,U,j);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(A,Math.log(Z))},l.translate=function(A,M,_,w){this.center.move(A,M||0,_||0,w||0)},l.setMatrix=function(A,M,_,w){var m=1;typeof _=="number"&&(m=_|0),(m<0||m>3)&&(m=1);var u=(m+2)%3;M||(this.recalcMatrix(A),M=this.computedMatrix);var v=M[m],y=M[m+4],I=M[m+8];if(w){var z=Math.abs(v),F=Math.abs(y),N=Math.abs(I),B=Math.max(z,F,N);z===B?(v=v<0?-1:1,y=I=0):N===B?(I=I<0?-1:1,v=y=0):(y=y<0?-1:1,v=I=0)}else{var L=c(v,y,I);v/=L,y/=L,I/=L}var R=M[u],U=M[u+4],j=M[u+8],Z=R*v+U*y+j*I;R-=v*Z,U-=y*Z,j-=I*Z;var re=c(R,U,j);R/=re,U/=re,j/=re;var fe=y*j-I*U,le=I*R-v*j,ce=v*U-y*R,V=c(fe,le,ce);fe/=V,le/=V,ce/=V,this.center.jump(A,Le,Te,pe),this.radius.idle(A),this.up.jump(A,v,y,I),this.right.jump(A,R,U,j);var ee,ne;if(m===2){var K=M[1],ue=M[5],te=M[9],H=K*R+ue*U+te*j,ae=K*fe+ue*le+te*ce;Ce<0?ee=-Math.PI/2:ee=Math.PI/2,ne=Math.atan2(ae,H)}else{var ie=M[2],ve=M[6],Ae=M[10],Ce=ie*v+ve*y+Ae*I,Fe=ie*R+ve*U+Ae*j,ze=ie*fe+ve*le+Ae*ce;ee=Math.asin(p(Ce)),ne=Math.atan2(ze,Fe)}this.angle.jump(A,ne,ee),this.recalcMatrix(A);var Ye=M[2],it=M[6],st=M[10],nt=this.computedMatrix;n(nt,M);var Qe=nt[15],Le=nt[12]/Qe,Te=nt[13]/Qe,pe=nt[14]/Qe,Ne=Math.exp(this.computedRadius[0]);this.center.jump(A,Le-Ye*Ne,Te-it*Ne,pe-st*Ne)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(A){this.center.idle(A),this.up.idle(A),this.right.idle(A),this.radius.idle(A),this.angle.idle(A)},l.flush=function(A){this.center.flush(A),this.up.flush(A),this.right.flush(A),this.radius.flush(A),this.angle.flush(A)},l.setDistance=function(A,M){M>0&&this.radius.set(A,Math.log(M))},l.lookAt=function(A,M,_,w){this.recalcMatrix(A),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var m=w[0],u=w[1],v=w[2],y=c(m,u,v);if(!(y<1e-6)){m/=y,u/=y,v/=y;var I=M[0]-_[0],L=M[1]-_[1],z=M[2]-_[2],F=c(I,L,z);if(!(F<1e-6)){I/=F,L/=F,z/=F;var N=this.computedRight,B=N[0],R=N[1],U=N[2],j=m*B+u*R+v*U;B-=j*m,R-=j*u,U-=j*v;var Z=c(B,R,U);if(!(Z<.01&&(B=u*z-v*L,R=v*I-m*z,U=m*L-u*I,Z=c(B,R,U),Z<1e-6))){B/=Z,R/=Z,U/=Z,this.up.set(A,m,u,v),this.right.set(A,B,R,U),this.center.set(A,_[0],_[1],_[2]),this.radius.set(A,Math.log(F));var re=u*U-v*R,fe=v*B-m*U,le=m*R-u*B,ce=c(re,fe,le);re/=ce,fe/=ce,le/=ce;var V=m*I+u*L+v*z,ee=B*I+R*L+U*z,ne=re*I+fe*L+le*z,K=Math.asin(p(V)),ue=Math.atan2(ne,ee),te=this.angle._state,H=te[te.length-1],ae=te[te.length-2];H=H%(2*Math.PI);var ie=Math.abs(H+2*Math.PI-ue),ve=Math.abs(H-ue),Ae=Math.abs(H-2*Math.PI-ue);ie max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform vec3 clipBounds[2]; +uniform sampler2D dashTexture; +uniform float dashScale; +uniform float opacity; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if ( + outOfRange(clipBounds[0], clipBounds[1], worldPosition) || + fragColor.a * opacity == 0. + ) discard; + + float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r; + if(dashWeight < 0.5) { + discard; + } + gl_FragColor = fragColor * opacity; +} +`]),s=o([`precision highp float; +#define GLSLIFY 1 + +#define FLOAT_MAX 1.70141184e38 +#define FLOAT_MIN 1.17549435e-38 + +// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl +vec4 packFloat(float v) { + float av = abs(v); + + //Handle special cases + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(127.0, 128.0, 0.0, 0.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(255.0, 128.0, 0.0, 0.0) / 255.0; + } + + vec4 c = vec4(0,0,0,0); + + //Compute exponent and mantissa + float e = floor(log2(av)); + float m = av * pow(2.0, -e) - 1.0; + + //Unpack mantissa + c[1] = floor(128.0 * m); + m -= c[1] / 128.0; + c[2] = floor(32768.0 * m); + m -= c[2] / 32768.0; + c[3] = floor(8388608.0 * m); + + //Unpack exponent + float ebias = e + 127.0; + c[0] = floor(ebias / 2.0); + ebias -= c[0] * 2.0; + c[1] += floor(ebias) * 128.0; + + //Unpack sign bit + c[0] += 128.0 * step(0.0, -v); + + //Scale back to range + return c / 255.0; +} + +bool outOfRange(float a, float b, float p) { + return ((p > max(a, b)) || + (p < min(a, b))); +} + +bool outOfRange(vec2 a, vec2 b, vec2 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y)); +} + +bool outOfRange(vec3 a, vec3 b, vec3 p) { + return (outOfRange(a.x, b.x, p.x) || + outOfRange(a.y, b.y, p.y) || + outOfRange(a.z, b.z, p.z)); +} + +bool outOfRange(vec4 a, vec4 b, vec4 p) { + return outOfRange(a.xyz, b.xyz, p.xyz); +} + +uniform float pickId; +uniform vec3 clipBounds[2]; + +varying vec3 worldPosition; +varying float pixelArcLength; +varying vec4 fragColor; + +void main() { + if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard; + + gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz); +}`]),f=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(c){return n(c,i,a,null,f)},t.createPickShader=function(c){return n(c,i,s,null,f)}}),7352:(function(e,t,r){var o=r(5721),n=r(4750),i=r(2690);e.exports=a;function a(s){var f=s.length;if(f===0)return[];if(f===1)return[[0]];var c=s[0].length;return c===0?[]:c===1?o(s):c===2?n(s):i(s,c)}}),7399:(function(e){e.exports=t;function t(r,o){var n=o[0],i=o[1],a=o[2],s=o[3],f=n+n,c=i+i,p=a+a,d=n*f,T=i*f,l=i*c,g=a*f,x=a*c,A=a*p,M=s*f,_=s*c,w=s*p;return r[0]=1-l-A,r[1]=T+w,r[2]=g-_,r[3]=0,r[4]=T-w,r[5]=1-d-A,r[6]=x+M,r[7]=0,r[8]=g+_,r[9]=x-M,r[10]=1-d-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7417:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.max(o[0],n[0]),r[1]=Math.max(o[1],n[1]),r[2]=Math.max(o[2],n[2]),r}}),7442:(function(e,t,r){var o=r(6658),n=r(7182),i=r(2652),a=r(9921),s=r(8648),f=T(),c=T(),p=T();e.exports=d;function d(x,A,M,_){if(a(A)===0||a(M)===0)return!1;var w=i(A,f.translate,f.scale,f.skew,f.perspective,f.quaternion),m=i(M,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!w||!m?!1:(o(p.translate,f.translate,c.translate,_),o(p.skew,f.skew,c.skew,_),o(p.scale,f.scale,c.scale,_),o(p.perspective,f.perspective,c.perspective,_),s(p.quaternion,f.quaternion,c.quaternion,_),n(x,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:g(),quaternion:g()}}function l(x){return[x||0,x||0,x||0]}function g(){return[0,0,0,1]}}),7507:(function(e,t){t.byteLength=c,t.toByteArray=d,t.fromByteArray=g;for(var r=[],o=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var M=x.indexOf("=");M===-1&&(M=A);var _=M===A?0:4-M%4;return[M,_]}function c(x){var A=f(x),M=A[0],_=A[1];return(M+_)*3/4-_}function p(x,A,M){return(A+M)*3/4-M}function d(x){var A,M=f(x),_=M[0],w=M[1],m=new n(p(x,_,w)),u=0,v=w>0?_-4:_,y;for(y=0;y>16&255,m[u++]=A>>8&255,m[u++]=A&255;return w===2&&(A=o[x.charCodeAt(y)]<<2|o[x.charCodeAt(y+1)]>>4,m[u++]=A&255),w===1&&(A=o[x.charCodeAt(y)]<<10|o[x.charCodeAt(y+1)]<<4|o[x.charCodeAt(y+2)]>>2,m[u++]=A>>8&255,m[u++]=A&255),m}function T(x){return r[x>>18&63]+r[x>>12&63]+r[x>>6&63]+r[x&63]}function l(x,A,M){for(var _,w=[],m=A;mv?v:u+m));return _===1?(A=x[M-1],w.push(r[A>>2]+r[A<<4&63]+"==")):_===2&&(A=(x[M-2]<<8)+x[M-1],w.push(r[A>>10]+r[A>>4&63]+r[A<<2&63]+"=")),w.join("")}}),7518:(function(e,t,r){var o=r(1433);function n(s,f,c,p,d,T){this.location=s,this.dimension=f,this.a=c,this.b=p,this.c=d,this.d=T}n.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 i(s,f,c){this.gl=s,this._ext=f,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s1.0001)return null;y+=v[M]}return Math.abs(y-1)>.001?null:[_,f(p,v),v]}}),7636:(function(e){e.exports=t;function t(r,o){o=o||1;var n=Math.random()*2*Math.PI,i=Math.random()*2-1,a=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(n)*a,r[1]=Math.sin(n)*a,r[2]=i*o,r}}),7640:(function(e,t,r){var o=r(1888);function n(d){return d==="uint32"?[o.mallocUint32,o.freeUint32]:null}var i={"uint32,1,0":function(d,T){return function(g,x,A,M,_,w,m,u,v,y,I){var L,z,F,N=g*_+M,B,R=d(u),U,j,Z,re;for(L=g+1;L<=x;++L){for(z=L,N+=_,F=N,U=0,j=N,B=0;Bg;){U=0,j=F-_;t:for(B=0;Bre)break t;j+=y,U+=I}for(U=F,j=F-_,B=0;B>1,R=B-z,U=B+z,j=F,Z=R,re=B,fe=U,le=N,ce=x+1,V=A-1,ee=!0,ne,K,ue,te,H,ae,ie,ve,Ae,Ce=0,Fe=0,ze=0,Ye,it,st,nt,Qe,Le,Te,pe,Ne,ot,ct,rt,Ft,Nt,$t,rr,Mr=v,Sr=T(Mr),Zr=T(Mr);it=w*j,st=w*Z,rr=_;e:for(Ye=0;Ye0){K=j,j=Z,Z=K;break e}if(ze<0)break e;rr+=I}it=w*fe,st=w*le,rr=_;e:for(Ye=0;Ye0){K=fe,fe=le,le=K;break e}if(ze<0)break e;rr+=I}it=w*j,st=w*re,rr=_;e:for(Ye=0;Ye0){K=j,j=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*re,rr=_;e:for(Ye=0;Ye0){K=Z,Z=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*j,st=w*fe,rr=_;e:for(Ye=0;Ye0){K=j,j=fe,fe=K;break e}if(ze<0)break e;rr+=I}it=w*re,st=w*fe,rr=_;e:for(Ye=0;Ye0){K=re,re=fe,fe=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*le,rr=_;e:for(Ye=0;Ye0){K=Z,Z=le,le=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*re,rr=_;e:for(Ye=0;Ye0){K=Z,Z=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*fe,st=w*le,rr=_;e:for(Ye=0;Ye0){K=fe,fe=le,le=K;break e}if(ze<0)break e;rr+=I}for(it=w*j,st=w*Z,nt=w*re,Qe=w*fe,Le=w*le,Te=w*F,pe=w*B,Ne=w*N,$t=0,rr=_,Ye=0;Ye0)V--;else if(ze<0){for(it=w*ae,st=w*ce,nt=w*V,rr=_,Ye=0;Ye0)for(;;){ie=_+V*w,$t=0;e:for(Ye=0;Ye0){if(--VN){e:for(;;){for(ie=_+ce*w,$t=0,rr=_,Ye=0;Ye1&&g?A(l,g[0],g[1]):A(l)}var c={"uint32,1,0":function(d,T){return function(l){var g=l.data,x=l.offset|0,A=l.shape,M=l.stride,_=M[0]|0,w=A[0]|0,m=M[1]|0,u=A[1]|0,v=m,y=m,I=1;w<=32?d(0,w-1,g,x,_,m,w,u,v,y,I):T(0,w-1,g,x,_,m,w,u,v,y,I)}}};function p(d,T){var l=[T,d].join(","),g=c[l],x=a(d,T),A=f(d,T,x);return g(x,A)}e.exports=p}),7642:(function(e,t,r){var o=r(8954),n=r(1682);e.exports=f;function i(c,p){this.point=c,this.index=p}function a(c,p){for(var d=c.point,T=p.point,l=d.length,g=0;g=2)return!1;F[B]=R}return!0}):z=z.filter(function(F){for(var N=0;N<=T;++N){var B=v[F[N]];if(B<0)return!1;F[N]=B}return!0}),T&1)for(var x=0;x",U="",j=R.length,Z=U.length,re=F[0]===g||F[0]===M,fe=0,le=-Z;fe>-1&&(fe=N.indexOf(R,fe),!(fe===-1||(le=N.indexOf(U,fe+j),le===-1)||le<=fe));){for(var ce=fe;ce=le)B[ce]=null,N=N.substr(0,ce)+" "+N.substr(ce+1);else if(B[ce]!==null){var V=B[ce].indexOf(F[0]);V===-1?B[ce]+=F:re&&(B[ce]=B[ce].substr(0,V+1)+(1+parseInt(B[ce][V+1]))+B[ce].substr(V+2))}var ee=fe+j,ne=N.substr(ee,le-ee),K=ne.indexOf(R);K!==-1?fe=K:fe=le+Z}return B}function m(z,F,N){for(var B=F.textAlign||"start",R=F.textBaseline||"alphabetic",U=[1<<30,1<<30],j=[0,0],Z=z.length,re=0;re/g,` +`):N=N.replace(/\/g," ");var j="",Z=[];for(H=0;H-1?parseInt(pe[1+ct]):0,Nt=rt>-1?parseInt(Ne[1+rt]):0;Ft!==Nt&&(ot=ot.replace(ze(),"?px "),ve*=Math.pow(.75,Nt-Ft),ot=ot.replace("?px ",ze())),ie+=.25*V*(Nt-Ft)}if(U.superscripts===!0){var $t=pe.indexOf(g),rr=Ne.indexOf(g),Mr=$t>-1?parseInt(pe[1+$t]):0,Sr=rr>-1?parseInt(Ne[1+rr]):0;Mr!==Sr&&(ot=ot.replace(ze(),"?px "),ve*=Math.pow(.75,Sr-Mr),ot=ot.replace("?px ",ze())),ie-=.25*V*(Sr-Mr)}if(U.bolds===!0){var Zr=pe.indexOf(p)>-1,Ar=Ne.indexOf(p)>-1;!Zr&&Ar&&(Br?ot=ot.replace("italic ","italic bold "):ot="bold "+ot),Zr&&!Ar&&(ot=ot.replace("bold ",""))}if(U.italics===!0){var Br=pe.indexOf(T)>-1,Mt=Ne.indexOf(T)>-1;!Br&&Mt&&(ot="italic "+ot),Br&&!Mt&&(ot=ot.replace("italic ",""))}F.font=ot}for(te=0;te0&&(R=B.size),B.lineSpacing&&B.lineSpacing>0&&(U=B.lineSpacing),B.styletags&&B.styletags.breaklines&&(j.breaklines=!!B.styletags.breaklines),B.styletags&&B.styletags.bolds&&(j.bolds=!!B.styletags.bolds),B.styletags&&B.styletags.italics&&(j.italics=!!B.styletags.italics),B.styletags&&B.styletags.subscripts&&(j.subscripts=!!B.styletags.subscripts),B.styletags&&B.styletags.superscripts&&(j.superscripts=!!B.styletags.superscripts)),N.font=[B.fontStyle,B.fontVariant,B.fontWeight,R+"px",B.font].filter(function(re){return re}).join(" "),N.textAlign="start",N.textBaseline="alphabetic",N.direction="ltr";var Z=u(F,N,z,R,U,j);return I(Z,B,R)}}),7721:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){return o(i[0])*o(i[1])}}),7765:(function(e,t,r){e.exports=l;var o=r(9618),n=r(1888),i=r(446),a=r(1570);function s(g){for(var x=g.length,A=0,M=0;M"u"&&(M=s(g));var _=g.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=f(x,+A),m=c(g,M),u=p(m,x,w,+A),v=d(m,x.length|0),y=a(M)(g,m.data,v,w),I=T(m),L=[].slice.call(u.data,0,u.shape[0]);return n.free(w),n.free(m.data),n.free(u.data),n.free(v),{cells:y,vertexIds:I,vertexWeights:L}}}),7766:(function(e,t,r){var o=r(9618),n=r(5298),i=r(1888);e.exports=u;var a=null,s=null,f=null;function c(v){a=[v.LINEAR,v.NEAREST_MIPMAP_LINEAR,v.LINEAR_MIPMAP_NEAREST,v.LINEAR_MIPMAP_NEAREST],s=[v.NEAREST,v.LINEAR,v.NEAREST_MIPMAP_NEAREST,v.NEAREST_MIPMAP_LINEAR,v.LINEAR_MIPMAP_NEAREST,v.LINEAR_MIPMAP_LINEAR],f=[v.REPEAT,v.CLAMP_TO_EDGE,v.MIRRORED_REPEAT]}function p(v){return typeof HTMLCanvasElement<"u"&&v instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&v instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&v instanceof HTMLVideoElement||typeof ImageData<"u"&&v instanceof ImageData}var d=function(v,y){n.muls(v,y,255)};function T(v,y,I){var L=v.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(y<0||y>z||I<0||I>z)throw new Error("gl-texture2d: Invalid texture size");return v._shape=[y,I],v.bind(),L.texImage2D(L.TEXTURE_2D,0,v.format,y,I,0,v.format,v.type,null),v._mipLevels=[0],v}function l(v,y,I,L,z,F){this.gl=v,this.handle=y,this.format=z,this.type=F,this._shape=[I,L],this._mipLevels=[0],this._magFilter=v.NEAREST,this._minFilter=v.NEAREST,this._wrapS=v.CLAMP_TO_EDGE,this._wrapT=v.CLAMP_TO_EDGE,this._anisoSamples=1;var N=this,B=[this._wrapS,this._wrapT];Object.defineProperties(B,[{get:function(){return N._wrapS},set:function(U){return N.wrapS=U}},{get:function(){return N._wrapT},set:function(U){return N.wrapT=U}}]),this._wrapVector=B;var R=[this._shape[0],this._shape[1]];Object.defineProperties(R,[{get:function(){return N._shape[0]},set:function(U){return N.width=U}},{get:function(){return N._shape[1]},set:function(U){return N.height=U}}]),this._shapeVector=R}var g=l.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(v){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(v)>=0&&(y.getExtension("OES_texture_float_linear")||(v=y.NEAREST)),s.indexOf(v)<0)throw new Error("gl-texture2d: Unknown filter mode "+v);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,v),this._minFilter=v}},magFilter:{get:function(){return this._magFilter},set:function(v){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(v)>=0&&(y.getExtension("OES_texture_float_linear")||(v=y.NEAREST)),s.indexOf(v)<0)throw new Error("gl-texture2d: Unknown filter mode "+v);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,v),this._magFilter=v}},mipSamples:{get:function(){return this._anisoSamples},set:function(v){var y=this._anisoSamples;if(this._anisoSamples=Math.max(v,1)|0,y!==this._anisoSamples){var I=this.gl.getExtension("EXT_texture_filter_anisotropic");I&&this.gl.texParameterf(this.gl.TEXTURE_2D,I.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(v){if(this.bind(),f.indexOf(v)<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,v),this._wrapS=v}},wrapT:{get:function(){return this._wrapT},set:function(v){if(this.bind(),f.indexOf(v)<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,v),this._wrapT=v}},wrap:{get:function(){return this._wrapVector},set:function(v){if(Array.isArray(v)||(v=[v,v]),v.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var y=0;y<2;++y)if(f.indexOf(v[y])<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);this._wrapS=v[0],this._wrapT=v[1];var I=this.gl;return this.bind(),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,this._wrapS),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,this._wrapT),v}},shape:{get:function(){return this._shapeVector},set:function(v){if(!Array.isArray(v))v=[v|0,v|0];else if(v.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,v[0]|0,v[1]|0),[v[0]|0,v[1]|0]}},width:{get:function(){return this._shape[0]},set:function(v){return v=v|0,T(this,v,this._shape[1]),v}},height:{get:function(){return this._shape[1]},set:function(v){return v=v|0,T(this,this._shape[0],v),v}}}),g.bind=function(v){var y=this.gl;return v!==void 0&&y.activeTexture(y.TEXTURE0+(v|0)),y.bindTexture(y.TEXTURE_2D,this.handle),v!==void 0?v|0:y.getParameter(y.ACTIVE_TEXTURE)-y.TEXTURE0},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var v=Math.min(this._shape[0],this._shape[1]),y=0;v>0;++y,v>>>=1)this._mipLevels.indexOf(y)<0&&this._mipLevels.push(y)},g.setPixels=function(v,y,I,L){var z=this.gl;this.bind(),Array.isArray(y)?(L=I,I=y[1]|0,y=y[0]|0):(y=y||0,I=I||0),L=L||0;var F=p(v)?v:v.raw;if(F){var N=this._mipLevels.indexOf(L)<0;N?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,y,I,this.format,this.type,F)}else if(v.shape&&v.stride&&v.data){if(v.shape.length<2||y+v.shape[1]>this._shape[1]>>>L||I+v.shape[0]>this._shape[0]>>>L||y<0||I<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");A(z,y,I,L,this.format,this.type,this._mipLevels,v)}else throw new Error("gl-texture2d: Unsupported data type")};function x(v,y){return v.length===3?y[2]===1&&y[1]===v[0]*v[2]&&y[0]===v[2]:y[0]===1&&y[1]===v[0]}function A(v,y,I,L,z,F,N,B){var R=B.dtype,U=B.shape.slice();if(U.length<2||U.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var j=0,Z=0,re=x(U,B.stride.slice());if(R==="float32"?j=v.FLOAT:R==="float64"?(j=v.FLOAT,re=!1,R="float32"):R==="uint8"?j=v.UNSIGNED_BYTE:(j=v.UNSIGNED_BYTE,re=!1,R="uint8"),U.length===2)Z=v.LUMINANCE,U=[U[0],U[1],1],B=o(B.data,U,[B.stride[0],B.stride[1],1],B.offset);else if(U.length===3){if(U[2]===1)Z=v.ALPHA;else if(U[2]===2)Z=v.LUMINANCE_ALPHA;else if(U[2]===3)Z=v.RGB;else if(U[2]===4)Z=v.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");U[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===v.LUMINANCE||Z===v.ALPHA)&&(z===v.LUMINANCE||z===v.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var fe=B.size,le=N.indexOf(L)<0;if(le&&N.push(L),j===F&&re)B.offset===0&&B.data.length===fe?le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data):le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data.subarray(B.offset,B.offset+fe)):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data.subarray(B.offset,B.offset+fe));else{var ce;F===v.FLOAT?ce=i.mallocFloat32(fe):ce=i.mallocUint8(fe);var V=o(ce,U,[U[2],U[2]*U[0],1]);j===v.FLOAT&&F===v.UNSIGNED_BYTE?d(V,B):n.assign(V,B),le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,ce.subarray(0,fe)):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,ce.subarray(0,fe)),F===v.FLOAT?i.freeFloat32(ce):i.freeUint8(ce)}}function M(v){var y=v.createTexture();return v.bindTexture(v.TEXTURE_2D,y),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),y}function _(v,y,I,L,z){var F=v.getParameter(v.MAX_TEXTURE_SIZE);if(y<0||y>F||I<0||I>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===v.FLOAT&&!v.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var N=M(v);return v.texImage2D(v.TEXTURE_2D,0,L,y,I,0,L,z,null),new l(v,N,y,I,L,z)}function w(v,y,I,L,z,F){var N=M(v);return v.texImage2D(v.TEXTURE_2D,0,z,z,F,y),new l(v,N,I,L,z,F)}function m(v,y){var I=y.dtype,L=y.shape.slice(),z=v.getParameter(v.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=x(L,y.stride.slice()),N=0;I==="float32"?N=v.FLOAT:I==="float64"?(N=v.FLOAT,F=!1,I="float32"):I==="uint8"?N=v.UNSIGNED_BYTE:(N=v.UNSIGNED_BYTE,F=!1,I="uint8");var B=0;if(L.length===2)B=v.LUMINANCE,L=[L[0],L[1],1],y=o(y.data,L,[y.stride[0],y.stride[1],1],y.offset);else if(L.length===3)if(L[2]===1)B=v.ALPHA;else if(L[2]===2)B=v.LUMINANCE_ALPHA;else if(L[2]===3)B=v.RGB;else if(L[2]===4)B=v.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");N===v.FLOAT&&!v.getExtension("OES_texture_float")&&(N=v.UNSIGNED_BYTE,F=!1);var R,U,j=y.size;if(F)y.offset===0&&y.data.length===j?R=y.data:R=y.data.subarray(y.offset,y.offset+j);else{var Z=[L[2],L[2]*L[0],1];U=i.malloc(j,I);var re=o(U,L,Z,0);(I==="float32"||I==="float64")&&N===v.UNSIGNED_BYTE?d(re,y):n.assign(re,y),R=U.subarray(0,j)}var fe=M(v);return v.texImage2D(v.TEXTURE_2D,0,B,L[0],L[1],0,B,N,R),F||i.free(U),new l(v,fe,L[0],L[1],B,N)}function u(v){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||c(v),typeof arguments[1]=="number")return _(v,arguments[1],arguments[2],arguments[3]||v.RGBA,arguments[4]||v.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(v,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||v.RGBA,arguments[3]||v.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var y=arguments[1],I=p(y)?y:y.raw;if(I)return w(v,I,y.width|0,y.height|0,arguments[2]||v.RGBA,arguments[3]||v.UNSIGNED_BYTE);if(y.shape&&y.data&&y.stride)return m(v,y)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),7790:(function(){}),7815:(function(e,t,r){var o=r(2931),n=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(x,A,M,_){for(var w=x.points,m=x.velocities,u=x.divergences,v=[],y=[],I=[],L=[],z=[],F=[],N=0,B=0,R=n.create(),U=n.create(),j=8,Z=0;Z0)for(var ce=0;ceA)return _-1}return _},c=function(x,A,M){return xM?M:x},p=function(x,A,M){var _=A.vectors,w=A.meshgrid,m=x[0],u=x[1],v=x[2],y=w[0].length,I=w[1].length,L=w[2].length,z=f(w[0],m),F=f(w[1],u),N=f(w[2],v),B=z+1,R=F+1,U=N+1;if(z=c(z,0,y-1),B=c(B,0,y-1),F=c(F,0,I-1),R=c(R,0,I-1),N=c(N,0,L-1),U=c(U,0,L-1),z<0||F<0||N<0||B>y-1||R>I-1||U>L-1)return o.create();var j=w[0][z],Z=w[0][B],re=w[1][F],fe=w[1][R],le=w[2][N],ce=w[2][U],V=(m-j)/(Z-j),ee=(u-re)/(fe-re),ne=(v-le)/(ce-le);isFinite(V)||(V=.5),isFinite(ee)||(ee=.5),isFinite(ne)||(ne=.5);var K,ue,te,H,ae,ie;switch(M.reversedX&&(z=y-1-z,B=y-1-B),M.reversedY&&(F=I-1-F,R=I-1-R),M.reversedZ&&(N=L-1-N,U=L-1-U),M.filled){case 5:ae=N,ie=U,te=F*L,H=R*L,K=z*L*I,ue=B*L*I;break;case 4:ae=N,ie=U,K=z*L,ue=B*L,te=F*L*y,H=R*L*y;break;case 3:te=F,H=R,ae=N*I,ie=U*I,K=z*I*L,ue=B*I*L;break;case 2:te=F,H=R,K=z*I,ue=B*I,ae=N*I*y,ie=U*I*y;break;case 1:K=z,ue=B,ae=N*y,ie=U*y,te=F*y*L,H=R*y*L;break;default:K=z,ue=B,te=F*y,H=R*y,ae=N*y*I,ie=U*y*I;break}var ve=_[K+te+ae],Ae=_[K+te+ie],Ce=_[K+H+ae],Fe=_[K+H+ie],ze=_[ue+te+ae],Ye=_[ue+te+ie],it=_[ue+H+ae],st=_[ue+H+ie],nt=o.create(),Qe=o.create(),Le=o.create(),Te=o.create();o.lerp(nt,ve,ze,V),o.lerp(Qe,Ae,Ye,V),o.lerp(Le,Ce,it,V),o.lerp(Te,Fe,st,V);var pe=o.create(),Ne=o.create();o.lerp(pe,nt,Le,ee),o.lerp(Ne,Qe,Te,ee);var ot=o.create();return o.lerp(ot,pe,Ne,ne),ot},d=function(x){var A=1/0;x.sort(function(m,u){return m-u});for(var M=x.length,_=1;_B||stR||ntU)},Z=o.distance(A[0],A[1]),re=10*Z/_,fe=re*re,le=1,ce=0,V=M.length;V>1&&(le=T(M));for(var ee=0;eece&&(ce=ve),ae.push(ve),L.push({points:K,velocities:ue,divergences:ae});for(var Ae=0;Ae<_*100&&K.length<_&&j(ne);){Ae++;var Ce=o.clone(te),Fe=o.squaredLength(Ce);if(Fe===0)break;if(Fe>fe&&o.scale(Ce,Ce,re/Math.sqrt(Fe)),o.add(Ce,Ce,ne),te=y(Ce),o.squaredDistance(H,Ce)-fe>-1e-4*fe){K.push(Ce),H=Ce,ue.push(te);var ie=I(Ce,te),ve=o.length(ie);isFinite(ve)&&ve>ce&&(ce=ve),ae.push(ve)}ne=Ce}}var ze=s(L,x.colormap,ce,le);return m?ze.tubeScale=m:(ce===0&&(ce=1),ze.tubeScale=w*.5*le/ce),ze};var l=r(6740),g=r(6405).createMesh;e.exports.createTubeMesh=function(x,A){return g(x,A,{shaders:l,traceType:"streamtube"})}}),7827:(function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),7842:(function(e,t,r){var o=r(6330),n=r(1533),i=r(2651),a=r(6768),s=r(869),f=r(8697);e.exports=c;function c(p,d){if(o(p))return d?f(p,c(d)):[p[0].clone(),p[1].clone()];var T=0,l,g;if(n(p))l=p.clone();else if(typeof p=="string")l=a(p);else{if(p===0)return[i(0),i(1)];if(p===Math.floor(p))l=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T-=256;l=i(p)}}if(o(d))l.mul(d[1]),g=d[0].clone();else if(n(d))g=d.clone();else if(typeof d=="string")g=a(d);else if(!d)g=i(1);else if(d===Math.floor(d))g=i(d);else{for(;d!==Math.floor(d);)d=d*Math.pow(2,256),T+=256;g=i(d)}return T>0?l=l.ushln(T):T<0&&(g=g.ushln(-T)),s(l,g)}}),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}}),7932:(function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])}),7960:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2],s=o[3]-r[3];return n*n+i*i+a*a+s*s}}),8105:(function(e){e.exports=r;var t={"lo===p0":o,"lo=p0)&&!(p1>=hi)":c};function r(p){return t[p]}function o(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u];if(I===A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function n(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u];if(IL;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function i(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+v];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function a(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+v];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function s(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+v];if(I<=A&&A<=L)if(m===y)m+=1,w+=M;else{for(var z=0;M>z;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function f(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+v];if(Iz;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function c(p,d,T,l,g,x,A,M){for(var _=2*p,w=_*T,m=w,u=T,v=d,y=p+d,I=T;l>I;++I,w+=_){var L=g[w+v],z=g[w+y];if(!(L>=A)&&!(M>=z))if(u===I)u+=1,m+=_;else{for(var F=0;_>F;++F){var N=g[w+F];g[w+F]=g[m],g[m++]=N}var B=x[I];x[I]=x[u],x[u++]=B}}return u}}),8107:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r}}),8116:(function(e,t,r){var o=r(7518),n=r(870);function i(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function a(s,f,c,p){var d=s.createVertexArray?new i(s):s.getExtension("OES_vertex_array_object"),T;return d?T=o(s,d):T=n(s),T.update(f,c,p),T}e.exports=a}),8192:(function(e,t,r){e.exports=a;var o=r(2825),n=r(3536),i=r(244);function a(s,f){var c=o(s[0],s[1],s[2]),p=o(f[0],f[1],f[2]);n(c,c),n(p,p);var d=i(c,p);return d>1?0:Math.acos(d)}}),8210:(function(e){e.exports=r;function t(o,n){var i=o+n,a=i-o,s=i-a,f=n-a,c=o-s,p=c+f;return p?[p,i]:[i]}function r(o,n){var i=o.length|0,a=n.length|0;if(i===1&&a===1)return t(o[0],n[0]);var s=i+a,f=new Array(s),c=0,p=0,d=0,T=Math.abs,l=o[p],g=T(l),x=n[d],A=T(x),M,_;g=a?(M=l,p+=1,pc)for(var I=f[l],L=1/Math.sqrt(m*v),y=0;y<3;++y){var z=(y+1)%3,F=(y+2)%3;I[y]+=L*(u[z]*w[F]-u[F]*w[z])}}for(var p=0;pc)for(var L=1/Math.sqrt(N),y=0;y<3;++y)I[y]*=L;else for(var y=0;y<3;++y)I[y]=0}return f},t.faceNormals=function(n,i,a){for(var s=n.length,f=new Array(s),c=a===void 0?o:a,p=0;pc?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)A[l]*=M;f[p]=A}return f}}),8418:(function(e,t,r){var o=r(5219),n=r(2762),i=r(8116),a=r(1888),s=r(6760),f=r(1283),c=r(9366),p=r(5964),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function g(K){return T.isView(K)&&!(K instanceof l)}function x(K){return Array.isArray(K)||g(K)}e.exports=ne;function A(K,ue){var te=K[0],H=K[1],ae=K[2],ie=K[3];return K[0]=ue[0]*te+ue[4]*H+ue[8]*ae+ue[12]*ie,K[1]=ue[1]*te+ue[5]*H+ue[9]*ae+ue[13]*ie,K[2]=ue[2]*te+ue[6]*H+ue[10]*ae+ue[14]*ie,K[3]=ue[3]*te+ue[7]*H+ue[11]*ae+ue[15]*ie,K}function M(K,ue,te,H){return A(H,H),A(H,H),A(H,H)}function _(K,ue){this.index=K,this.dataCoordinate=this.position=ue}function w(K){return K===!0||K>1?1:K}function m(K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye){this.gl=K,this.pixelRatio=1,this.shader=ue,this.orthoShader=te,this.projectShader=H,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=ve,this.idBuffer=Ae,this.vao=Ce,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=Fe,this.pickOrthoShader=ze,this.pickProjectShader=Ye,this.points=[],this._selectResult=new _(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=m.prototype;u.pickSlots=1,u.setPickBase=function(K){this.pickId=K},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&!this.projectHasAlpha)return!0;return!1};var v=[0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=d.slice(),N=[0,0,0],B=[[0,0,0],[0,0,0]];function R(K){return K[0]=K[1]=K[2]=0,K}function U(K,ue){return K[0]=ue[0],K[1]=ue[1],K[2]=ue[2],K[3]=1,K}function j(K,ue,te,H){return K[0]=ue[0],K[1]=ue[1],K[2]=ue[2],K[te]=H,K}function Z(K){for(var ue=B,te=0;te<2;++te)for(var H=0;H<3;++H)ue[te][H]=Math.max(Math.min(K[te][H],1e8),-1e8);return ue}function re(K,ue,te,H){var ae=ue.axesProject,ie=ue.gl,ve=K.uniforms,Ae=te.model||d,Ce=te.view||d,Fe=te.projection||d,ze=ue.axesBounds,Ye=Z(ue.clipBounds),it;ue.axes&&ue.axes.lastCubeProps?it=ue.axes.lastCubeProps.axis:it=[1,1,1],v[0]=2/ie.drawingBufferWidth,v[1]=2/ie.drawingBufferHeight,K.bind(),ve.view=Ce,ve.projection=Fe,ve.screenSize=v,ve.highlightId=ue.highlightId,ve.highlightScale=ue.highlightScale,ve.clipBounds=Ye,ve.pickGroup=ue.pickId/255,ve.pixelRatio=H;for(var st=0;st<3;++st)if(ae[st]){ve.scale=ue.projectScale[st],ve.opacity=ue.projectOpacity[st];for(var nt=F,Qe=0;Qe<16;++Qe)nt[Qe]=0;for(var Qe=0;Qe<4;++Qe)nt[5*Qe]=1;nt[5*st]=0,it[st]<0?nt[12+st]=ze[0][st]:nt[12+st]=ze[1][st],s(nt,Ae,nt),ve.model=nt;var Le=(st+1)%3,Te=(st+2)%3,pe=R(y),Ne=R(I);pe[Le]=1,Ne[Te]=1;var ot=M(Fe,Ce,Ae,U(L,pe)),ct=M(Fe,Ce,Ae,U(z,Ne));if(Math.abs(ot[1])>Math.abs(ct[1])){var rt=ot;ot=ct,ct=rt,rt=pe,pe=Ne,Ne=rt;var Ft=Le;Le=Te,Te=Ft}ot[0]<0&&(pe[Le]=-1),ct[1]>0&&(Ne[Te]=-1);for(var Nt=0,$t=0,Qe=0;Qe<4;++Qe)Nt+=Math.pow(Ae[4*Le+Qe],2),$t+=Math.pow(Ae[4*Te+Qe],2);pe[Le]/=Math.sqrt(Nt),Ne[Te]/=Math.sqrt($t),ve.axes[0]=pe,ve.axes[1]=Ne,ve.fragClipBounds[0]=j(N,Ye[0],st,-1e8),ve.fragClipBounds[1]=j(N,Ye[1],st,1e8),ue.vao.bind(),ue.vao.draw(ie.TRIANGLES,ue.vertexCount),ue.lineWidth>0&&(ie.lineWidth(ue.lineWidth*H),ue.vao.draw(ie.LINES,ue.lineVertexCount,ue.vertexCount)),ue.vao.unbind()}}var fe=[-1e8,-1e8,-1e8],le=[1e8,1e8,1e8],ce=[fe,le];function V(K,ue,te,H,ae,ie,ve){var Ae=te.gl;if((ie===te.projectHasAlpha||ve)&&re(ue,te,H,ae),ie===te.hasAlpha||ve){K.bind();var Ce=K.uniforms;Ce.model=H.model||d,Ce.view=H.view||d,Ce.projection=H.projection||d,v[0]=2/Ae.drawingBufferWidth,v[1]=2/Ae.drawingBufferHeight,Ce.screenSize=v,Ce.highlightId=te.highlightId,Ce.highlightScale=te.highlightScale,Ce.fragClipBounds=ce,Ce.clipBounds=te.axes.bounds,Ce.opacity=te.opacity,Ce.pickGroup=te.pickId/255,Ce.pixelRatio=ae,te.vao.bind(),te.vao.draw(Ae.TRIANGLES,te.vertexCount),te.lineWidth>0&&(Ae.lineWidth(te.lineWidth*ae),te.vao.draw(Ae.LINES,te.lineVertexCount,te.vertexCount)),te.vao.unbind()}}u.draw=function(K){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,K,this.pixelRatio,!1,!1)},u.drawTransparent=function(K){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,K,this.pixelRatio,!0,!1)},u.drawPick=function(K){var ue=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;V(ue,this.pickProjectShader,this,K,1,!0,!0)},u.pick=function(K){if(!K||K.id!==this.pickId)return null;var ue=K.value[2]+(K.value[1]<<8)+(K.value[0]<<16);if(ue>=this.pointCount||ue<0)return null;var te=this.points[ue],H=this._selectResult;H.index=ue;for(var ae=0;ae<3;++ae)H.position[ae]=H.dataCoordinate[ae]=te[ae];return H},u.highlight=function(K){if(!K)this.highlightId=[1,1,1,1];else{var ue=K.index,te=ue&255,H=ue>>8&255,ae=ue>>16&255;this.highlightId=[te/255,H/255,ae/255,0]}};function ee(K,ue,te,H){var ae;x(K)?ue0){var Br=0,Mt=Te,je=[0,0,0,1],$e=[0,0,0,1],Ee=x(it)&&x(it[0]),xe=x(Qe)&&x(Qe[0]);e:for(var H=0;H0?1-$t[0][0]:Ot<0?1+$t[1][0]:1,Wt*=Wt>0?1-$t[0][1]:Wt<0?1+$t[1][1]:1;for(var _r=[Ot,Wt],Zn=Ft.cells||[],qn=Ft.positions||[],ct=0;ct=a?(M=l,p+=1,p0?1:0}}),8648:(function(e,t,r){e.exports=r(783)}),8692:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[1],f=o[0]-a,c=o[1]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=a+f*d-c*p,r[1]=s+f*p+c*d,r[2]=o[2],r}}),8697:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]),i[1].mul(a[0]))}}),8731:(function(e,t,r){e.exports=c;var o=r(8866);function n(p,d,T,l,g,x){this._gl=p,this._wrapper=d,this._index=T,this._locations=l,this._dimension=g,this._constFunc=x}var i=n.prototype;i.pointer=function(d,T,l,g){var x=this,A=x._gl,M=x._locations[x._index];A.vertexAttribPointer(M,x._dimension,d||A.FLOAT,!!T,l||0,g||0),A.enableVertexAttribArray(M)},i.set=function(p,d,T,l){return this._constFunc(this._locations[this._index],p,d,T,l)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(p){return p!==this._locations[this._index]&&(this._locations[this._index]=p|0,this._wrapper.program=null),p|0}});var a=[function(p,d,T){return T.length===void 0?p.vertexAttrib1f(d,T):p.vertexAttrib1fv(d,T)},function(p,d,T,l){return T.length===void 0?p.vertexAttrib2f(d,T,l):p.vertexAttrib2fv(d,T)},function(p,d,T,l,g){return T.length===void 0?p.vertexAttrib3f(d,T,l,g):p.vertexAttrib3fv(d,T)},function(p,d,T,l,g,x){return T.length===void 0?p.vertexAttrib4f(d,T,l,g,x):p.vertexAttrib4fv(d,T)}];function s(p,d,T,l,g,x,A){var M=a[g],_=new n(p,d,T,l,g,M);Object.defineProperty(x,A,{set:function(w){return p.disableVertexAttribArray(l[T]),M(p,l[T],w),w},get:function(){return _},enumerable:!0})}function f(p,d,T,l,g,x,A){for(var M=new Array(g),_=new Array(g),w=0;w=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(p,d,m[0],l,u,g,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);f(p,d,m,l,u,g,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return g}}),8828:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),8866:(function(e){function t(r,o,n){this.shortMessage=o||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(o||r||"")+(n?` +`+n:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t}),8902:(function(e,t,r){var o=r(2478),n=r(3250)[3],i=0,a=1,s=2;e.exports=A;function f(M,_,w,m,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=m,this.upperIds=u}function c(M,_,w,m){this.a=M,this.b=_,this.type=w,this.idx=m}function p(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=n(M.a,M.b,_.b),w)?w:M.idx-_.idx}function d(M,_){return n(M.a,M.b,_)}function T(M,_,w,m,u){for(var v=o.lt(_,m,d),y=o.gt(_,m,d),I=v;I1&&n(w[z[N-2]],w[z[N-1]],m)>0;)M.push([z[N-1],z[N-2],u]),N-=1;z.length=N,z.push(u);for(var F=L.upperIds,N=F.length;N>1&&n(w[F[N-2]],w[F[N-1]],m)<0;)M.push([F[N-2],F[N-1],u]),N-=1;F.length=N,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=n(M.a,M.b,_.a):w=n(_.b,_.a,M.a),w||(_.b[0]L[0]&&u.push(new c(L,I,s,v),new c(I,L,a,v))}u.sort(p);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new f([z,1],[z,0],-1,[],[])],N=[],v=0,B=u.length;v0;){g=m.pop();for(var u=g.adjacent,v=0;v<=A;++v){var y=u[v];if(!(!y.boundary||y.lastVisited<=-M)){for(var I=y.vertices,L=0;L<=A;++L){var z=I[L];z<0?_[L]=x:_[L]=w[z]}var F=this.orient();if(F>0)return y;y.lastVisited=-M,F===0&&m.push(y)}}}return null},T.walk=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=x?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[m];e:for(;!u.boundary;){for(var v=u.vertices,y=u.adjacent,I=0;I<=M;++I)w[I]=_[v[I]];u.lastVisited=A;for(var I=0;I<=M;++I){var L=y[I];if(!(L.lastVisited>=A)){var z=w[I];w[I]=g;var F=this.orient();if(w[I]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-A:L.lastVisited=A}}return}return u},T.addPeaks=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=this.interior,u=this.simplices,v=[x];x.lastVisited=A,x.vertices[x.vertices.indexOf(-1)]=A,x.boundary=!1,m.push(x);for(var y=[];v.length>0;){var x=v.pop(),I=x.vertices,L=x.adjacent,z=I.indexOf(A);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var N=L[F];if(!(!N.boundary||N.lastVisited>=A)){var B=N.vertices;if(N.lastVisited!==-A){for(var R=0,U=0;U<=M;++U)B[U]<0?(R=U,w[U]=g):w[U]=_[B[U]];var j=this.orient();if(j>0){B[R]=A,N.boundary=!1,m.push(N),v.push(N),N.lastVisited=A;continue}else N.lastVisited=-A}var Z=N.adjacent,re=I.slice(),fe=L.slice(),le=new i(re,fe,!0);u.push(le);var ce=Z.indexOf(x);if(!(ce<0)){Z[ce]=le,fe[z]=N,re[F]=-1,fe[F]=x,L[F]=le,le.flip();for(var U=0;U<=M;++U){var V=re[U];if(!(V<0||V===A)){for(var ee=new Array(M-1),ne=0,K=0;K<=M;++K){var ue=re[K];ue<0||K===U||(ee[ne++]=ue)}y.push(new a(ee,le,U))}}}}}}}y.sort(s);for(var F=0;F+1=0?m[v++]=u[I]:y=I&1;if(y===(g&1)){var L=m[0];m[0]=m[1],m[1]=L}x.push(m)}}return x};function l(g,x){var A=g.length;if(A===0)throw new Error("Must have at least d+1 points");var M=g[0].length;if(A<=M)throw new Error("Must input at least d+1 points");var _=g.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var m=new Array(M+1),u=0;u<=M;++u)m[u]=u;w<0&&(m[0]=1,m[1]=0);for(var v=new i(m,new Array(M+1),!1),y=v.adjacent,I=new Array(M+2),u=0;u<=M;++u){for(var L=m.slice(),z=0;z<=M;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var N=new i(L,new Array(M+1),!0);y[u]=N,I[u]=N}I[M+1]=v;for(var u=0;u<=M;++u)for(var L=y[u].vertices,B=y[u].adjacent,z=0;z<=M;++z){var R=L[z];if(R<0){B[z]=v;continue}for(var U=0;U<=M;++U)y[U].vertices.indexOf(R)<0&&(B[z]=y[U])}for(var j=new d(M,_,I),Z=!!x,u=M+1;u=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function g(w){for(var m=p({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),v=0;v<256;++v){for(var y=m[v],I=0;I<3;++I)u[4*v+I]=y[I];u[4*v+3]=y[3]*255}return c(u,[256,256,4],[4,0,1])}function x(w){for(var m=w.length,u=new Array(m),v=0;v0){var U=this.triShader;U.bind(),U.uniforms=z,this.triangleVAO.bind(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var m=this.gl,u=w.model||d,v=w.view||d,y=w.projection||d,I=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)I[0][L]=Math.max(I[0][L],this.clipBounds[0][L]),I[1][L]=Math.min(I[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(v),this._projection=[].slice.call(y),this._resolution=[m.drawingBufferWidth,m.drawingBufferHeight];var z={model:u,view:v,projection:y,clipBounds:I,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(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var m=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[m],v=this.positions[u[1]].slice(0,3),y={position:v,dataCoordinate:v,index:Math.floor(u[1]/48)};return this.traceType==="cone"?y.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(y.intensity=this.intensity[u[1]],y.velocity=this.vectors[u[1]].slice(0,3),y.divergence=this.vectors[u[1]][3],y.index=m),y},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 A(w,m){var u=o(w,m.meshShader.vertex,m.meshShader.fragment,null,m.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 M(w,m){var u=o(w,m.pickShader.vertex,m.pickShader.fragment,null,m.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,m,u){var v=u.shaders;arguments.length===1&&(m=w,w=m.gl);var y=A(w,v),I=M(w,v),L=a(w,c(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=w.LINEAR_MIPMAP_LINEAR,L.magFilter=w.LINEAR;var z=n(w),F=n(w),N=n(w),B=n(w),R=n(w),U=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:R,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:N,type:w.FLOAT,size:4},{buffer:B,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),j=new T(w,L,y,I,z,F,R,N,B,U,u.traceType||"cone");return j.update(m),j}e.exports=_}),9127:(function(e,t,r){e.exports=i;var o=r(6204),n=r(5771);function i(a){return n(o(a))}}),9131:(function(e,t,r){var o=r(5177),n=r(9288);e.exports=i;function i(a,s){return s=s||1,a[0]=Math.random(),a[1]=Math.random(),a[2]=Math.random(),a[3]=Math.random(),o(a,a),n(a,a,s),a}}),9165:(function(e,t,r){e.exports=T;var o=r(2762),n=r(8116),i=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.shader=A,this.buffer=g,this.vao=x,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 f=s.prototype;f.isOpaque=function(){return!this.hasAlpha},f.isTransparent=function(){return this.hasAlpha},f.drawTransparent=f.draw=function(l){var g=this.gl,x=this.shader.uniforms;this.shader.bind();var A=x.view=l.view||a,M=x.projection=l.projection||a;x.model=l.model||a,x.clipBounds=this.clipBounds,x.opacity=this.opacity;var _=A[12],w=A[13],m=A[14],u=A[15],v=l._ortho||!1,y=v?2:1,I=y*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*m+M[15]*u)/g.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)g.lineWidth(this.lineWidth[L]*this.pixelRatio),x.capSize=this.capSize[L]*I,this.lineCount[L]&&g.drawArrays(g.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function c(l,g){for(var x=0;x<3;++x)l[0][x]=Math.min(l[0][x],g[x]),l[1][x]=Math.max(l[1][x],g[x])}var p=(function(){for(var l=new Array(3),g=0;g<3;++g){for(var x=[],A=1;A<=2;++A)for(var M=-1;M<=1;M+=2){var _=(A+g)%3,w=[0,0,0];w[_]=M,x.push(w)}l[g]=x}return l})();function d(l,g,x,A){for(var M=p[A],_=0;_0){var z=v.slice();z[m]+=I[1][m],M.push(v[0],v[1],v[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),c(this.bounds,z),w+=2+d(M,z,L,m)}}}this.lineCount[m]=w-this.lineOffset[m]}this.buffer.update(M)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var g=l.gl,x=o(g),A=n(g,[{buffer:x,type:g.FLOAT,size:3,offset:0,stride:40},{buffer:x,type:g.FLOAT,size:4,offset:12,stride:40},{buffer:x,type:g.FLOAT,size:3,offset:28,stride:40}]),M=i(g);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(g,x,A,M);return _.update(l),_}}),9215:(function(e,t,r){e.exports=c;var o=r(4769),n=r(2478);function i(p,d,T){return Math.min(d,Math.max(p,T))}function a(p,d,T){this.dimension=p.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=T-1)for(var w=x.length-1,u=p-d[T-1],m=0;m=T-1){var _=x.length-1;p-d[T-1];for(var w=0;w=0;--T)if(p[--d])return!1;return!0},s.jump=function(p){var d=this.lastT(),T=this.dimension;if(!(p0;--m)l.push(i(M[m-1],_[m-1],arguments[m])),g.push(0)}},s.push=function(p){var d=this.lastT(),T=this.dimension;if(!(p1e-6?1/A:0;this._time.push(p);for(var u=T;u>0;--u){var v=i(_[u-1],w[u-1],arguments[u]);l.push(v),g.push((v-l[x++])*m)}}},s.set=function(p){var d=this.dimension;if(!(p0;--M)T.push(i(x[M-1],A[M-1],arguments[M])),l.push(0)}},s.move=function(p){var d=this.lastT(),T=this.dimension;if(!(p<=d||arguments.length!==T+1)){var l=this._state,g=this._velocity,x=l.length-this.dimension,A=this.bounds,M=A[0],_=A[1],w=p-d,m=w>1e-6?1/w:0;this._time.push(p);for(var u=T;u>0;--u){var v=arguments[u];l.push(i(M[u-1],_[u-1],l[x++]+v)),g.push(v*m)}}},s.idle=function(p){var d=this.lastT();if(!(p=0;--m)l.push(i(M[m],_[m],l[x]+w*g[x])),g.push(0),x+=1}};function f(p){for(var d=new Array(p),T=0;T1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(s=!0),s}}),9226:(function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}}),9265:(function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}}),9288:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]*n,r[1]=o[1]*n,r[2]=o[2]*n,r[3]=o[3]*n,r}}),9346:(function(e){var t=new Float64Array(4),r=new Float64Array(4),o=new Float64Array(4);function n(i,a,s,f,c){t.length=d?(u=1,y=d+2*g+A):(u=-g/d,y=g*u+A)):(u=0,x>=0?(v=0,y=A):-x>=l?(v=1,y=l+2*x+A):(v=-x/l,y=x*v+A));else if(v<0)v=0,g>=0?(u=0,y=A):-g>=d?(u=1,y=d+2*g+A):(u=-g/d,y=g*u+A);else{var I=1/m;u*=I,v*=I,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A}else{var L,z,F,N;u<0?(L=T+g,z=l+x,z>L?(F=z-L,N=d-2*T+l,F>=N?(u=1,v=0,y=d+2*g+A):(u=F/N,v=1-u,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)):(u=0,z<=0?(v=1,y=l+2*x+A):x>=0?(v=0,y=A):(v=-x/l,y=x*v+A))):v<0?(L=T+x,z=d+g,z>L?(F=z-L,N=d-2*T+l,F>=N?(v=1,u=0,y=l+2*x+A):(v=F/N,u=1-v,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)):(v=0,z<=0?(u=1,y=d+2*g+A):g>=0?(u=0,y=A):(u=-g/d,y=g*u+A))):(F=l+x-T-g,F<=0?(u=0,v=1,y=l+2*x+A):(N=d-2*T+l,F>=N?(u=1,v=0,y=d+2*g+A):(u=F/N,v=1-u,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)))}for(var B=1-u-v,p=0;px)for(l=x;lg)for(l=g;l=0){for(var B=N.type.charAt(N.type.length-1)|0,R=new Array(B),U=0;U=0;)j+=1;z[F]=j}var Z=new Array(x.length);function re(){_.program=a.program(w,_._vref,_._fref,L,z);for(var fe=0;fete&&ae>0){var ie=(H[ae][0]-te)/(H[ae][0]-H[ae-1][0]);return H[ae][1]*(1-ie)+ie*H[ae-1][1]}}return 1}var U=[0,0,0],j={showSurface:!1,showContour:!1,projections:[y.slice(),y.slice(),y.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(te,H){var ae,ie,ve,Ae=H.axes&&H.axes.lastCubeProps.axis||U,Ce=H.showSurface,Fe=H.showContour;for(ae=0;ae<3;++ae)for(Ce=Ce||H.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||H.contourProject[ae][ie];for(ae=0;ae<3;++ae){var ze=j.projections[ae];for(ie=0;ie<16;++ie)ze[ie]=0;for(ie=0;ie<4;++ie)ze[5*ie]=1;ze[5*ae]=0,ze[12+ae]=H.axesBounds[+(Ae[ae]>0)][ae],l(ze,te.model,ze);var Ye=j.clipBounds[ae];for(ve=0;ve<2;++ve)for(ie=0;ie<3;++ie)Ye[ve][ie]=te.clipBounds[ve][ie];Ye[0][ae]=-1e8,Ye[1][ae]=1e8}return j.showSurface=Ce,j.showContour=Fe,j}var re={model:y,view:y,projection:y,inverseModel:y.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},fe=y.slice(),le=[1,0,0,0,1,0,0,0,1];function ce(te,H){te=te||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=re;ie.model=te.model||y,ie.view=te.view||y,ie.projection=te.projection||y,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=g(ie.inverseModel,ie.model);for(var ve=0;ve<2;++ve)for(var Ae=ie.clipBounds[ve],Ce=0;Ce<3;++Ce)Ae[Ce]=Math.min(Math.max(this.clipBounds[ve][Ce],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=le,ie.vertexColor=this.vertexColor;var Fe=fe;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),g(Fe,Fe),ve=0;ve<3;++ve)ie.eyePosition[ve]=Fe[12+ve]/Fe[15];var ze=Fe[15];for(ve=0;ve<3;++ve)ze+=this.lightPosition[ve]*Fe[4*ve+3];for(ve=0;ve<3;++ve){var Ye=Fe[12+ve];for(Ce=0;Ce<3;++Ce)Ye+=Fe[4*Ce+ve]*this.lightPosition[Ce];ie.lightPosition[ve]=Ye/ze}var it=Z(ie,this);if(it.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),ve=0;ve<3;++ve)!this.surfaceProject[ve]||!this.vertexCount||(this._shader.uniforms.model=it.projections[ve],this._shader.uniforms.clipBounds=it.clipBounds[ve],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(it.showContour){var st=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,st.bind(),st.uniforms=ie;var nt=this._contourVAO;for(nt.bind(),ve=0;ve<3;++ve)for(st.uniforms.permutation=L[ve],ae.lineWidth(this.contourWidth[ve]*this.pixelRatio),Ce=0;Ce>4)/16)/255,ve=Math.floor(ie),Ae=ie-ve,Ce=H[1]*(te.value[1]+(te.value[2]&15)/16)/255,Fe=Math.floor(Ce),ze=Ce-Fe;ve+=1,Fe+=1;var Ye=ae.position;Ye[0]=Ye[1]=Ye[2]=0;for(var it=0;it<2;++it)for(var st=it?Ae:1-Ae,nt=0;nt<2;++nt)for(var Qe=nt?ze:1-ze,Le=ve+it,Te=Fe+nt,pe=st*Qe,Ne=0;Ne<3;++Ne)Ye[Ne]+=this._field[Ne].get(Le,Te)*pe;for(var ot=this._pickResult.level,ct=0;ct<3;++ct)if(ot[ct]=x.le(this.contourLevels[ct],Ye[ct]),ot[ct]<0)this.contourLevels[ct].length>0&&(ot[ct]=0);else if(ot[ct]Math.abs(Ft-Ye[ct])&&(ot[ct]+=1)}for(ae.index[0]=Ae<.5?ve:ve+1,ae.index[1]=ze<.5?Fe:Fe+1,ae.uv[0]=ie/H[0],ae.uv[1]=Ce/H[1],Ne=0;Ne<3;++Ne)ae.dataCoordinate[Ne]=this._field[Ne].get(ae.index[0],ae.index[1]);return ae},B.padField=function(te,H){var ae=H.shape.slice(),ie=te.shape.slice();c.assign(te.lo(1,1).hi(ae[0],ae[1]),H),c.assign(te.lo(1).hi(ae[0],1),H.hi(ae[0],1)),c.assign(te.lo(1,ie[1]-1).hi(ae[0],1),H.lo(0,ae[1]-1).hi(ae[0],1)),c.assign(te.lo(0,1).hi(1,ae[1]),H.hi(1)),c.assign(te.lo(ie[0]-1,1).hi(1,ae[1]),H.lo(ae[0]-1)),te.set(0,0,H.get(0,0)),te.set(0,ie[1]-1,H.get(0,ae[1]-1)),te.set(ie[0]-1,0,H.get(ae[0]-1,0)),te.set(ie[0]-1,ie[1]-1,H.get(ae[0]-1,ae[1]-1))};function ee(te,H){return Array.isArray(te)?[H(te[0]),H(te[1]),H(te[2])]:[H(te),H(te),H(te)]}function ne(te){return Array.isArray(te)?te.length===3?[te[0],te[1],te[2],1]:[te[0],te[1],te[2],te[3]]:[0,0,0,1]}function K(te){if(Array.isArray(te)){if(Array.isArray(te))return[ne(te[0]),ne(te[1]),ne(te[2])];var H=ne(te);return[H.slice(),H.slice(),H.slice()]}}B.update=function(te){te=te||{},this.objectOffset=te.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in te&&(this.contourWidth=ee(te.contourWidth,Number)),"showContour"in te&&(this.showContour=ee(te.showContour,Boolean)),"showSurface"in te&&(this.showSurface=!!te.showSurface),"contourTint"in te&&(this.contourTint=ee(te.contourTint,Boolean)),"contourColor"in te&&(this.contourColor=K(te.contourColor)),"contourProject"in te&&(this.contourProject=ee(te.contourProject,function(ka){return ee(ka,Boolean)})),"surfaceProject"in te&&(this.surfaceProject=te.surfaceProject),"dynamicColor"in te&&(this.dynamicColor=K(te.dynamicColor)),"dynamicTint"in te&&(this.dynamicTint=ee(te.dynamicTint,Number)),"dynamicWidth"in te&&(this.dynamicWidth=ee(te.dynamicWidth,Number)),"opacity"in te&&(this.opacity=te.opacity),"opacityscale"in te&&(this.opacityscale=te.opacityscale),"colorBounds"in te&&(this.colorBounds=te.colorBounds),"vertexColor"in te&&(this.vertexColor=te.vertexColor?1:0),"colormap"in te&&this._colorMap.setPixels(this.genColormap(te.colormap,this.opacityscale));var H=te.field||te.coords&&te.coords[2]||null,ae=!1;if(H||(this._field[2].shape[0]||this._field[2].shape[2]?H=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):H=this._field[2].hi(0,0)),"field"in te||"coords"in te){var ie=(H.shape[0]+2)*(H.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=d(this._field[2].data,[H.shape[0]+2,H.shape[1]+2]),this.padField(this._field[2],H),this.shape=H.shape.slice();for(var ve=this.shape,Ae=0;Ae<2;++Ae)this._field[2].size>this._field[Ae].data.length&&(s.freeFloat(this._field[Ae].data),this._field[Ae].data=s.mallocFloat(this._field[2].size)),this._field[Ae]=d(this._field[Ae].data,[ve[0]+2,ve[1]+2]);if(te.coords){var Ce=te.coords;if(!Array.isArray(Ce)||Ce.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Ae=0;Ae<2;++Ae){var Fe=Ce[Ae];for(nt=0;nt<2;++nt)if(Fe.shape[nt]!==ve[nt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Ae],Fe)}}else if(te.ticks){var ze=te.ticks;if(!Array.isArray(ze)||ze.length!==2)throw new Error("gl-surface: invalid ticks");for(Ae=0;Ae<2;++Ae){var Ye=ze[Ae];if((Array.isArray(Ye)||Ye.length)&&(Ye=d(Ye)),Ye.shape[0]!==ve[Ae])throw new Error("gl-surface: invalid tick length");var it=d(Ye.data,ve);it.stride[Ae]=Ye.stride[0],it.stride[Ae^1]=0,this.padField(this._field[Ae],it)}}else{for(Ae=0;Ae<2;++Ae){var st=[0,0];st[Ae]=1,this._field[Ae]=d(this._field[Ae].data,[ve[0]+2,ve[1]+2],st,0)}this._field[0].set(0,0,0);for(var nt=0;nt0){for(var fa=0;fa<5;++fa)pr.pop();Ee-=1}continue e}}}Zn.push(Ee)}this._contourOffsets[hr]=En,this._contourCounts[hr]=Zn}var ga=s.mallocFloat(pr.length);for(Ae=0;Ae=0&&(m=_|0,w+=v*m,u-=m),new x(this.data,u,v,w)},A.step=function(_){var w=this.shape[0],m=this.stride[0],u=this.offset,v=0,y=Math.ceil;return typeof _=="number"&&(v=_|0,v<0?(u+=m*(w-1),w=y(-w/v)):w=y(w/v),m*=v),new x(this.data,w,m,u)},A.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,m=this.stride;return new x(this.data,w[_],m[_],this.offset)},A.pick=function(_){var w=[],m=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),m.push(this.stride[0]));var v=l[w.length+1];return v(this.data,w,m,u)},function(_,w,m,u){return new x(_,w[0],m[0],u)}},2:function(T,l,g){function x(M,_,w,m,u,v){this.data=M,this.shape=[_,w],this.stride=[m,u],this.offset=v|0}var A=x.prototype;return A.dtype=T,A.dimension=2,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(A,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),A.set=function(_,w,m){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=m},A.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},A.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},A.hi=function(_,w){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},A.lo=function(_,w){var m=this.offset,u=0,v=this.shape[0],y=this.shape[1],I=this.stride[0],L=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,m+=I*u,v-=u),typeof w=="number"&&w>=0&&(u=w|0,m+=L*u,y-=u),new x(this.data,v,y,I,L,m)},A.step=function(_,w){var m=this.shape[0],u=this.shape[1],v=this.stride[0],y=this.stride[1],I=this.offset,L=0,z=Math.ceil;return typeof _=="number"&&(L=_|0,L<0?(I+=v*(m-1),m=z(-m/L)):m=z(m/L),v*=L),typeof w=="number"&&(L=w|0,L<0?(I+=y*(u-1),u=z(-u/L)):u=z(u/L),y*=L),new x(this.data,m,u,v,y,I)},A.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var m=this.shape,u=this.stride;return new x(this.data,m[_],m[w],u[_],u[w],this.offset)},A.pick=function(_,w){var m=[],u=[],v=this.offset;typeof _=="number"&&_>=0?v=v+this.stride[0]*_|0:(m.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?v=v+this.stride[1]*w|0:(m.push(this.shape[1]),u.push(this.stride[1]));var y=l[m.length+1];return y(this.data,m,u,v)},function(_,w,m,u){return new x(_,w[0],w[1],m[0],m[1],u)}},3:function(T,l,g){function x(M,_,w,m,u,v,y,I){this.data=M,this.shape=[_,w,m],this.stride=[u,v,y],this.offset=I|0}var A=x.prototype;return A.dtype=T,A.dimension=3,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(A,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),m=Math.abs(this.stride[2]);return _>w?w>m?[2,1,0]:_>m?[1,2,0]:[1,0,2]:_>m?[2,0,1]:m>w?[0,1,2]:[0,2,1]}}),A.set=function(_,w,m,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]=u},A.get=function(_,w,m){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]},A.index=function(_,w,m){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m},A.hi=function(_,w,m){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},A.lo=function(_,w,m){var u=this.offset,v=0,y=this.shape[0],I=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],N=this.stride[2];return typeof _=="number"&&_>=0&&(v=_|0,u+=z*v,y-=v),typeof w=="number"&&w>=0&&(v=w|0,u+=F*v,I-=v),typeof m=="number"&&m>=0&&(v=m|0,u+=N*v,L-=v),new x(this.data,y,I,L,z,F,N,u)},A.step=function(_,w,m){var u=this.shape[0],v=this.shape[1],y=this.shape[2],I=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,N=0,B=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(F+=I*(u-1),u=B(-u/N)):u=B(u/N),I*=N),typeof w=="number"&&(N=w|0,N<0?(F+=L*(v-1),v=B(-v/N)):v=B(v/N),L*=N),typeof m=="number"&&(N=m|0,N<0?(F+=z*(y-1),y=B(-y/N)):y=B(y/N),z*=N),new x(this.data,u,v,y,I,L,z,F)},A.transpose=function(_,w,m){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0;var u=this.shape,v=this.stride;return new x(this.data,u[_],u[w],u[m],v[_],v[w],v[m],this.offset)},A.pick=function(_,w,m){var u=[],v=[],y=this.offset;typeof _=="number"&&_>=0?y=y+this.stride[0]*_|0:(u.push(this.shape[0]),v.push(this.stride[0])),typeof w=="number"&&w>=0?y=y+this.stride[1]*w|0:(u.push(this.shape[1]),v.push(this.stride[1])),typeof m=="number"&&m>=0?y=y+this.stride[2]*m|0:(u.push(this.shape[2]),v.push(this.stride[2]));var I=l[u.length+1];return I(this.data,u,v,y)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],m[0],m[1],m[2],u)}},4:function(T,l,g){function x(M,_,w,m,u,v,y,I,L,z){this.data=M,this.shape=[_,w,m,u],this.stride=[v,y,I,L],this.offset=z|0}var A=x.prototype;return A.dtype=T,A.dimension=4,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(A,"order",{get:g}),A.set=function(_,w,m,u,v){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u,v):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]=v},A.get=function(_,w,m,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]},A.index=function(_,w,m,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u},A.hi=function(_,w,m,u){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|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)},A.lo=function(_,w,m,u){var v=this.offset,y=0,I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.stride[0],B=this.stride[1],R=this.stride[2],U=this.stride[3];return typeof _=="number"&&_>=0&&(y=_|0,v+=N*y,I-=y),typeof w=="number"&&w>=0&&(y=w|0,v+=B*y,L-=y),typeof m=="number"&&m>=0&&(y=m|0,v+=R*y,z-=y),typeof u=="number"&&u>=0&&(y=u|0,v+=U*y,F-=y),new x(this.data,I,L,z,F,N,B,R,U,v)},A.step=function(_,w,m,u){var v=this.shape[0],y=this.shape[1],I=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],N=this.stride[2],B=this.stride[3],R=this.offset,U=0,j=Math.ceil;return typeof _=="number"&&(U=_|0,U<0?(R+=z*(v-1),v=j(-v/U)):v=j(v/U),z*=U),typeof w=="number"&&(U=w|0,U<0?(R+=F*(y-1),y=j(-y/U)):y=j(y/U),F*=U),typeof m=="number"&&(U=m|0,U<0?(R+=N*(I-1),I=j(-I/U)):I=j(I/U),N*=U),typeof u=="number"&&(U=u|0,U<0?(R+=B*(L-1),L=j(-L/U)):L=j(L/U),B*=U),new x(this.data,v,y,I,L,z,F,N,B,R)},A.transpose=function(_,w,m,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0,u=u===void 0?3:u|0;var v=this.shape,y=this.stride;return new x(this.data,v[_],v[w],v[m],v[u],y[_],y[w],y[m],y[u],this.offset)},A.pick=function(_,w,m,u){var v=[],y=[],I=this.offset;typeof _=="number"&&_>=0?I=I+this.stride[0]*_|0:(v.push(this.shape[0]),y.push(this.stride[0])),typeof w=="number"&&w>=0?I=I+this.stride[1]*w|0:(v.push(this.shape[1]),y.push(this.stride[1])),typeof m=="number"&&m>=0?I=I+this.stride[2]*m|0:(v.push(this.shape[2]),y.push(this.stride[2])),typeof u=="number"&&u>=0?I=I+this.stride[3]*u|0:(v.push(this.shape[3]),y.push(this.stride[3]));var L=l[v.length+1];return L(this.data,v,y,I)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],w[3],m[0],m[1],m[2],m[3],u)}},5:function(l,g,x){function A(_,w,m,u,v,y,I,L,z,F,N,B){this.data=_,this.shape=[w,m,u,v,y],this.stride=[I,L,z,F,N],this.offset=B|0}var M=A.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:x}),M.set=function(w,m,u,v,y,I){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y,I):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y]=I},M.get=function(w,m,u,v,y){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y]},M.index=function(w,m,u,v,y){return this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y},M.hi=function(w,m,u,v,y){return new A(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof m!="number"||m<0?this.shape[1]:m|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof v!="number"||v<0?this.shape[3]:v|0,typeof y!="number"||y<0?this.shape[4]:y|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,m,u,v,y){var I=this.offset,L=0,z=this.shape[0],F=this.shape[1],N=this.shape[2],B=this.shape[3],R=this.shape[4],U=this.stride[0],j=this.stride[1],Z=this.stride[2],re=this.stride[3],fe=this.stride[4];return typeof w=="number"&&w>=0&&(L=w|0,I+=U*L,z-=L),typeof m=="number"&&m>=0&&(L=m|0,I+=j*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,I+=Z*L,N-=L),typeof v=="number"&&v>=0&&(L=v|0,I+=re*L,B-=L),typeof y=="number"&&y>=0&&(L=y|0,I+=fe*L,R-=L),new A(this.data,z,F,N,B,R,U,j,Z,re,fe,I)},M.step=function(w,m,u,v,y){var I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.shape[4],B=this.stride[0],R=this.stride[1],U=this.stride[2],j=this.stride[3],Z=this.stride[4],re=this.offset,fe=0,le=Math.ceil;return typeof w=="number"&&(fe=w|0,fe<0?(re+=B*(I-1),I=le(-I/fe)):I=le(I/fe),B*=fe),typeof m=="number"&&(fe=m|0,fe<0?(re+=R*(L-1),L=le(-L/fe)):L=le(L/fe),R*=fe),typeof u=="number"&&(fe=u|0,fe<0?(re+=U*(z-1),z=le(-z/fe)):z=le(z/fe),U*=fe),typeof v=="number"&&(fe=v|0,fe<0?(re+=j*(F-1),F=le(-F/fe)):F=le(F/fe),j*=fe),typeof y=="number"&&(fe=y|0,fe<0?(re+=Z*(N-1),N=le(-N/fe)):N=le(N/fe),Z*=fe),new A(this.data,I,L,z,F,N,B,R,U,j,Z,re)},M.transpose=function(w,m,u,v,y){w=w===void 0?0:w|0,m=m===void 0?1:m|0,u=u===void 0?2:u|0,v=v===void 0?3:v|0,y=y===void 0?4:y|0;var I=this.shape,L=this.stride;return new A(this.data,I[w],I[m],I[u],I[v],I[y],L[w],L[m],L[u],L[v],L[y],this.offset)},M.pick=function(w,m,u,v,y){var I=[],L=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(I.push(this.shape[0]),L.push(this.stride[0])),typeof m=="number"&&m>=0?z=z+this.stride[1]*m|0:(I.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(I.push(this.shape[2]),L.push(this.stride[2])),typeof v=="number"&&v>=0?z=z+this.stride[3]*v|0:(I.push(this.shape[3]),L.push(this.stride[3])),typeof y=="number"&&y>=0?z=z+this.stride[4]*y|0:(I.push(this.shape[4]),L.push(this.stride[4]));var F=g[I.length+1];return F(this.data,I,L,z)},function(w,m,u,v){return new A(w,m[0],m[1],m[2],m[3],m[4],u[0],u[1],u[2],u[3],u[4],v)}}};function f(T,l){var g=l===-1?"T":String(l),x=s[g];return l===-1?x(T):l===0?x(T,p[T][0]):x(T,p[T],a)}function c(T){if(o(T))return"buffer";if(n)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 p={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function d(T,l,g,x){if(T===void 0){var u=p.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var A=l.length;if(g===void 0){g=new Array(A);for(var M=A-1,_=1;M>=0;--M)g[M]=_,_*=l[M]}if(x===void 0){x=0;for(var M=0;M1e-6?(g[0]=A/m,g[1]=M/m,g[2]=_/m,g[3]=w/m):(g[0]=g[1]=g[2]=0,g[3]=1)}function d(g,x,A){this.radius=o([A]),this.center=o(x),this.rotation=o(g),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(g){this.radius.curve(g),this.center.curve(g),this.rotation.curve(g);var x=this.computedRotation;p(x,x);var A=this.computedMatrix;i(A,x);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,m=Math.exp(this.computedRadius[0]);_[0]=M[0]+m*A[2],_[1]=M[1]+m*A[6],_[2]=M[2]+m*A[10],w[0]=A[1],w[1]=A[5],w[2]=A[9];for(var u=0;u<3;++u){for(var v=0,y=0;y<3;++y)v+=A[u+4*y]*_[y];A[12+u]=-v}},T.getMatrix=function(g,x){this.recalcMatrix(g);var A=this.computedMatrix;if(x){for(var M=0;M<16;++M)x[M]=A[M];return x}return A},T.idle=function(g){this.center.idle(g),this.radius.idle(g),this.rotation.idle(g)},T.flush=function(g){this.center.flush(g),this.radius.flush(g),this.rotation.flush(g)},T.pan=function(g,x,A,M){x=x||0,A=A||0,M=M||0,this.recalcMatrix(g);var _=this.computedMatrix,w=_[1],m=_[5],u=_[9],v=f(w,m,u);w/=v,m/=v,u/=v;var y=_[0],I=_[4],L=_[8],z=y*w+I*m+L*u;y-=w*z,I-=m*z,L-=u*z;var F=f(y,I,L);y/=F,I/=F,L/=F,_[2],_[6],_[10];var N=y*x+w*A,B=I*x+m*A,R=L*x+u*A;this.center.move(g,N,B,R);var U=Math.exp(this.computedRadius[0]);U=Math.max(1e-4,U+M),this.radius.set(g,Math.log(U))},T.rotate=function(g,x,A,M){this.recalcMatrix(g),x=x||0,A=A||0;var _=this.computedMatrix,w=_[0],m=_[4],u=_[8],v=_[1],y=_[5],I=_[9],L=_[2],z=_[6],F=_[10],N=x*w+A*v,B=x*m+A*y,R=x*u+A*I,U=-(z*R-F*B),j=-(F*N-L*R),Z=-(L*B-z*N),re=Math.sqrt(Math.max(0,1-Math.pow(U,2)-Math.pow(j,2)-Math.pow(Z,2))),fe=c(U,j,Z,re);fe>1e-6?(U/=fe,j/=fe,Z/=fe,re/=fe):(U=j=Z=0,re=1);var le=this.computedRotation,ce=le[0],V=le[1],ee=le[2],ne=le[3],K=ce*re+ne*U+V*Z-ee*j,ue=V*re+ne*j+ee*U-ce*Z,te=ee*re+ne*Z+ce*j-V*U,H=ne*re-ce*U-V*j-ee*Z;if(M){U=L,j=z,Z=F;var ae=Math.sin(M)/f(U,j,Z);U*=ae,j*=ae,Z*=ae,re=Math.cos(x),K=K*re+H*U+ue*Z-te*j,ue=ue*re+H*j+te*U-K*Z,te=te*re+H*Z+K*j-ue*U,H=H*re-K*U-ue*j-te*Z}var ie=c(K,ue,te,H);ie>1e-6?(K/=ie,ue/=ie,te/=ie,H/=ie):(K=ue=te=0,H=1),this.rotation.set(g,K,ue,te,H)},T.lookAt=function(g,x,A,M){this.recalcMatrix(g),A=A||this.computedCenter,x=x||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;n(_,x,A,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),p(w,w),this.rotation.set(g,w[0],w[1],w[2],w[3]);for(var m=0,u=0;u<3;++u)m+=Math.pow(A[u]-x[u],2);this.radius.set(g,.5*Math.log(Math.max(m,1e-6))),this.center.set(g,A[0],A[1],A[2])},T.translate=function(g,x,A,M){this.center.move(g,x||0,A||0,M||0)},T.setMatrix=function(g,x){var A=this.computedRotation;s(A,x[0],x[1],x[2],x[4],x[5],x[6],x[8],x[9],x[10]),p(A,A),this.rotation.set(g,A[0],A[1],A[2],A[3]);var M=this.computedMatrix;a(M,x);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,m=M[13]/_,u=M[14]/_;this.recalcMatrix(g);var v=Math.exp(this.computedRadius[0]);this.center.set(g,w-M[2]*v,m-M[6]*v,u-M[10]*v),this.radius.idle(g)}else this.center.idle(g),this.radius.idle(g)},T.setDistance=function(g,x){x>0&&this.radius.set(g,Math.log(x))},T.setDistanceLimits=function(g,x){g>0?g=Math.log(g):g=-1/0,x>0?x=Math.log(x):x=1/0,x=Math.max(x,g),this.radius.bounds[0][0]=g,this.radius.bounds[1][0]=x},T.getDistanceLimits=function(g){var x=this.radius.bounds;return g?(g[0]=Math.exp(x[0][0]),g[1]=Math.exp(x[1][0]),g):[Math.exp(x[0][0]),Math.exp(x[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(g){var x=this.lastT(),A=g.center;A&&this.center.set(x,A[0],A[1],A[2]);var M=g.rotation;M&&this.rotation.set(x,M[0],M[1],M[2],M[3]);var _=g.distance;_&&_>0&&this.radius.set(x,Math.log(_)),this.setDistanceLimits(g.zoomMin,g.zoomMax)};function l(g){g=g||{};var x=g.center||[0,0,0],A=g.rotation||[0,0,0,1],M=g.radius||1;x=[].slice.call(x,0,3),A=[].slice.call(A,0,4),p(A,A);var _=new d(A,x,Math.log(M));return _.setDistanceLimits(g.zoomMin,g.zoomMax),("eye"in g||"up"in g)&&_.lookAt(0,g.eye,g.center,g.up),_}}),9994:(function(e,t,r){var o=r(9618),n=r(8277);e.exports=function(a,s){for(var f=[],c=a,p=1;Array.isArray(c);)f.push(c.length),p*=c.length,c=c[0];return f.length===0?o():(s||(s=o(new Float64Array(p),f)),n(s,a),s)}})},b={};function S(e){var t=b[e];if(t!==void 0)return t.exports;var r=b[e]={id:e,loaded:!1,exports:{}};return h[e].call(r.exports,r,r.exports,S),r.loaded=!0,r.exports}(function(){S.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){S.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}})();var E=S(1964);G.exports=E})()}}),Ok=Ge({"node_modules/color-name/index.js"($,G){G.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]}}}),oP=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"($,G){var h=Ok();G.exports=S;var b={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function S(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),h[E])t=h[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var n=E.slice(1),i=n.length,a=i<=4;r=1,a?(t=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],i===4&&(r=parseInt(n[3]+n[3],16)/255)):(t=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],i===8&&(r=parseInt(n[6]+n[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],f=s==="rgb",n=s.replace(/a$/,"");o=n;var i=n==="cmyk"?4:n==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,T){if(/%$/.test(d))return T===i?parseFloat(d)/100:n==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(n[T]==="h"){if(/deg$/.test(d))return parseFloat(d);if(b[d]!==void 0)return b[d]}return parseFloat(d)}),s===n&&t.push(1),r=f||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),sP=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"($,G){var h=oP();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=h(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=b(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function b(S){var E=S[0]/360,e=S[1]/100,t=S[2]/100,r,o,n,i,a,s=0;if(e===0)return a=t*255,[a,a,a];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)n=E+1/3*-(s-1),n<0?n++:n>1&&n--,a=6*n<1?r+(o-r)*6*n:2*n<1?o:3*n<2?r+(o-r)*(2/3-n)*6:r,i[s++]=a*255;return i}}}),HA=Ge({"node_modules/clamp/index.js"($,G){G.exports=h;function h(b,S,E){return SE?E:b:bS?S:b}}}),aE=Ge({"node_modules/dtype/index.js"($,G){G.exports=function(h){switch(h){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}}}}),P_=Ge({"node_modules/color-normalize/index.js"($,G){var h=sP(),b=HA(),S=aE();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=S(r),n=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=h(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:255,i&&(n[0]/=255,n[1]/=255,n[2]/=255,n[3]/=255),n):(i?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:1):(n[0]=b(Math.floor(t[0]*255),0,255),n[1]=b(Math.floor(t[1]*255),0,255),n[2]=b(Math.floor(t[2]*255),0,255),n[3]=t[3]==null?255:b(Math.floor(t[3]*255),0,255)),n)};function E(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))}}}),qy=Ge({"src/lib/str2rgbarray.js"($,G){var h=P_();function b(S){return S?h(S):[0,0,0,1]}G.exports=b}}),Vy=Ge({"src/lib/gl_format_color.js"($,G){var h=Pi(),b=Bs(),S=P_(),E=Tc(),e=th().defaultLine,t=As().isArrayOrTypedArray,r=S(e),o=1;function n(c,p){var d=c;return d[3]*=p,d}function i(c){if(h(c))return r;var p=S(c);return p.length?p:r}function a(c){return h(c)?c:o}function s(c,p,d){var T=c.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),g=t(p),x=E.extractOpts(c),A=[],M,_,w,m,u;if(x.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(c):M=i,l?_=function(y,I){return y[I]===void 0?r:S(M(y[I]))}:_=i,g?w=function(y,I){return y[I]===void 0?o:a(y[I])}:w=a,l||g)for(var v=0;v0){var d=o.c2l(c);o._lowerLogErrorBound||(o._lowerLogErrorBound=d),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,d)}}else i[a]=[-s[0]*r,s[1]*r]}return i}function S(e){for(var t=0;t-1?-1:I.indexOf("right")>-1?1:0}function x(I){return I==null?0:I.indexOf("top")>-1?-1:I.indexOf("bottom")>-1?1:0}function A(I){var L=0,z=0,F=[L,z];if(Array.isArray(I))for(var N=0;N=0){var Z=T(U.position,U.delaunayColor,U.delaunayAxis);Z.opacity=I.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=L,this.delaunayMesh=E(Z),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 y(I,L){var z=new p(I,L.uid);return z.update(L),z}G.exports=y}}),Bk=Ge({"src/traces/scatter3d/attributes.js"($,G){var h=Uc(),b=Hs(),S=Pu(),E=fc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Al(),o=ru(),n=Fk(),i=iE(),a=Qi().extendFlat,s=Nc().overrideAll,f=Lp(),c=h.line,p=h.marker,d=p.line,T=a({width:c.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},S("line"));function l(x){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 g=G.exports=s({x:h.x,y:h.y,z:{valType:"data_array"},text:a({},h.text,{}),texttemplate:t(),texttemplatefallback:r({editType:"calc"}),hovertext:a({},h.hovertext,{}),hovertemplate:e(),hovertemplatefallback:r(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:a({},h.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l(),y:l(),z:l()},connectgaps:h.connectgaps,line:T,marker:a({symbol:{valType:"enumerated",values:f(i),dflt:"circle",arrayOk:!0},size:a({},p.size,{dflt:8}),sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:a({},p.opacity,{arrayOk:!1}),colorbar:p.colorbar,line:a({width:a({},d.width,{arrayOk:!1})},S("marker.line"))},S("marker")),textposition:a({},h.textposition,{dflt:"top center"}),textfont:b({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:o.opacity,hoverinfo:a({},o.hoverinfo)},"calc","nested");g.x.editType=g.y.editType=g.z.editType="calc+clearAxisTypes"}}),cP=Ge({"src/traces/scatter3d/defaults.js"($,G){var h=Lo(),b=gn(),S=iu(),E=Hv(),e=Bp(),t=ep(),r=Bk();G.exports=function(i,a,s,f){function c(M,_){return b.coerce(i,a,r,M,_)}var p=o(i,a,c,f);if(!p){a.visible=!1;return}c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),c("mode"),S.hasMarkers(a)&&E(i,a,s,f,c,{noSelect:!0,noAngle:!0}),S.hasLines(a)&&(c("connectgaps"),e(i,a,s,f,c)),S.hasText(a)&&(c("texttemplate"),c("texttemplatefallback"),t(i,a,f,c,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var d=(a.line||{}).color,T=(a.marker||{}).color;c("surfaceaxis")>=0&&c("surfacecolor",d||T);for(var l=["x","y","z"],g=0;g<3;++g){var x="projection."+l[g];c(x+".show")&&(c(x+".opacity"),c(x+".scale"))}var A=h.getComponentMethod("errorbars","supplyDefaults");A(i,a,d||T||s,{axis:"z"}),A(i,a,d||T||s,{axis:"y",inherit:"z"}),A(i,a,d||T||s,{axis:"x",inherit:"z"})};function o(n,i,a,s){var f=0,c=a("x"),p=a("y"),d=a("z"),T=h.getComponentMethod("calendars","handleTraceDefaults");return T(n,i,["x","y","z"],s),c&&p&&d&&(f=Math.min(c.length,p.length,d.length),i._length=i._xlength=i._ylength=i._zlength=f),f}}}),fP=Ge({"src/traces/scatter3d/calc.js"($,G){var h=l0(),b=tp();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),b(E,e),t}}}),hP=Ge({"node_modules/get-canvas-context/index.js"($,G){G.exports=h;function h(b,S){if(typeof b!="string")throw new TypeError("must specify type string");if(S=S||{},typeof document>"u"&&!S.canvas)return null;var E=S.canvas||document.createElement("canvas");typeof S.width=="number"&&(E.width=S.width),typeof S.height=="number"&&(E.height=S.height);var e=S,t;try{var r=[b];b.indexOf("webgl")===0&&r.push("experimental-"+b);for(var o=0;o/g," "));i[a]=p,s.tickmode=f}}r.ticks=i;for(var a=0;a<3;++a){.5*(t.glplot.bounds[0][a]+t.glplot.bounds[1][a]);for(var d=0;d<2;++d)r.bounds[d][a]=t.glplot.bounds[d][a]}t.contourLevels=E(i)}}}),gP=Ge({"src/plots/gl3d/scene.js"($,G){var h=od().gl_plot3d,b=h.createCamera,S=h.createScene,E=vP(),e=Hw(),t=Lo(),r=gn(),o=r.preserveDrawingBuffer(),n=ws(),i=jf(),a=qy(),s=Nk(),f=ug(),c=dP(),p=pP(),d=mP(),T=Ip().applyAutorangeOptions,l,g,x=!1;function A(z,F){var N=document.createElement("div"),B=z.container;this.graphDiv=z.graphDiv;var R=document.createElementNS("http://www.w3.org/2000/svg","svg");R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",R.style["z-index"]=20,R.style["pointer-events"]="none",N.appendChild(R),this.svgContainer=R,N.id=z.id,N.style.position="absolute",N.style.top=N.style.left="0px",N.style.width=N.style.height="100%",B.appendChild(N),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=c(F,F[this.id]),this.spikeOptions=p(F[this.id]),this.container=N,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 M=A.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!g&&(l=document.createElement("canvas"),g=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!g))throw new Error("error creating static canvas/context for image server");F.gl=g,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),N=!0;try{z.glplot=S(F)}catch{if(z.staticMode||!_||o)N=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=S(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,N=!1}}}return _=!1,N},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,N=F.projection.type==="orthographic";z.camera=b(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:N,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var N=z.graphDiv,B=N.layout,R=function(){var j={};return z.isCameraChanged(B)&&(j[z.id+".camera"]=z.getCamera()),z.isAspectChanged(B)&&(j[z.id+".aspectratio"]=z.glplot.getAspectratio(),B[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=B[z.id].aspectmode=j[z.id+".aspectmode"]="manual")),j},U=function(j){if(j.fullSceneLayout.dragmode!==!1){var Z=R();j.saveLayout(B),j.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){U(z)}),z.glplot.canvas.addEventListener("touchstart",function(){x=!0}),z.glplot.canvas.addEventListener("wheel",function(j){if(N._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=j.deltaX>j.deltaY?1.1:.9090909090909091,re=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*re.x,y:Z*re.y,z:Z*re.z})}U(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var j=R();z.graphDiv.emit("plotly_relayouting",j)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(j){N&&N.emit&&N.emit("plotly_webglcontextlost",{event:j,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,N,B=z.svgContainer,R=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var U=F._fullLayout._invScaleX,j=F._fullLayout._invScaleY,Z=R.width*U,re=R.height*j;B.setAttributeNS(null,"viewBox","0 0 "+Z+" "+re),B.setAttributeNS(null,"width",Z),B.setAttributeNS(null,"height",re),d(z),z.glplot.axes.update(z.axesOptions);for(var fe=Object.keys(z.traces),le=null,ce=z.glplot.selection,V=0;V")):N.type==="isosurface"||N.type==="volume"?(te.valueLabel=n.hoverLabelText(z._mockAxis,z._mockAxis.d2l(ce.traceCoordinate[3]),N.valuehoverformat),Ae.push("value: "+te.valueLabel),ce.textLabel&&Ae.push(ce.textLabel),ve=Ae.join("
")):ve=ce.textLabel;var Ce={x:ce.traceCoordinate[0],y:ce.traceCoordinate[1],z:ce.traceCoordinate[2],data:K._input,fullData:K,curveNumber:K.index,pointNumber:ue};i.appendArrayPointValue(Ce,K,ue),N._module.eventData&&(Ce=K._module.eventData(Ce,ce,K,{},ue));var Fe={points:[Ce]};if(z.fullSceneLayout.hovermode){var ze=[];i.loneHover({trace:K,x:(.5+.5*ne[0]/ne[3])*Z,y:(.5-.5*ne[1]/ne[3])*re,xLabel:te.xLabel,yLabel:te.yLabel,zLabel:te.zLabel,text:ve,name:le.name,color:i.castHoverOption(K,ue,"bgcolor")||le.color,borderColor:i.castHoverOption(K,ue,"bordercolor"),fontFamily:i.castHoverOption(K,ue,"font.family"),fontSize:i.castHoverOption(K,ue,"font.size"),fontColor:i.castHoverOption(K,ue,"font.color"),nameLength:i.castHoverOption(K,ue,"namelength"),textAlign:i.castHoverOption(K,ue,"align"),hovertemplate:r.castOption(K,ue,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ce,te),eventData:[Ce]},{container:B,gd:F,inOut_bbox:ze}),Ce.bbox=ze[0]}ce.distance<5&&(ce.buttons||x)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(B),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.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 w=["xaxis","yaxis","zaxis"];function m(z,F,N){for(var B=z.fullSceneLayout,R=0;R<3;R++){var U=w[R],j=U.charAt(0),Z=B[U],re=F[j],fe=F[j+"calendar"],le=F["_"+j+"length"];if(!r.isArrayOrTypedArray(re))N[0][R]=Math.min(N[0][R],0),N[1][R]=Math.max(N[1][R],le-1);else for(var ce,V=0;V<(le||re.length);V++)if(r.isArrayOrTypedArray(re[V]))for(var ee=0;eeK[1][j])K[0][j]=-1,K[1][j]=1;else{var Ye=K[1][j]-K[0][j];K[0][j]-=Ye/32,K[1][j]+=Ye/32}if(te=[K[0][j],K[1][j]],te=T(te,re),K[0][j]=te[0],K[1][j]=te[1],re.isReversed()){var it=K[0][j];K[0][j]=K[1][j],K[1][j]=it}}else te=re.range,K[0][j]=re.r2l(te[0]),K[1][j]=re.r2l(te[1]);K[0][j]===K[1][j]&&(K[0][j]-=1,K[1][j]+=1),re.range=[K[0][j],K[1][j]],re.limitRange(),B.glplot.setBounds(j,{min:re.range[0]*ee[j],max:re.range[1]*ee[j]})}var st,nt=le.aspectmode;if(nt==="cube")st=[1,1,1];else if(nt==="manual"){var Qe=le.aspectratio;st=[Qe.x,Qe.y,Qe.z]}else if(nt==="auto"||nt==="data"){var Le=[1,1,1];for(j=0;j<3;++j){re=le[w[j]],fe=re.type;var Te=ue[fe];Le[j]=Math.pow(Te.acc,1/Te.count)/ee[j]}nt==="data"||Math.max.apply(null,Le)/Math.min.apply(null,Le)<=4?st=Le:st=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");le.aspectratio.x=ce.aspectratio.x=st[0],le.aspectratio.y=ce.aspectratio.y=st[1],le.aspectratio.z=ce.aspectratio.z=st[2],B.glplot.setAspectratio(le.aspectratio),B.viewInitial.aspectratio||(B.viewInitial.aspectratio={x:le.aspectratio.x,y:le.aspectratio.y,z:le.aspectratio.z}),B.viewInitial.aspectmode||(B.viewInitial.aspectmode=le.aspectmode);var pe=le.domain||null,Ne=F._size||null;if(pe&&Ne){var ot=B.container.style;ot.position="absolute",ot.left=Ne.l+pe.x[0]*Ne.w+"px",ot.top=Ne.t+(1-pe.y[1])*Ne.h+"px",ot.width=Ne.w*(pe.x[1]-pe.x[0])+"px",ot.height=Ne.h*(pe.y[1]-pe.y[0])+"px"}B.glplot.redraw()}},M.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 v(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 y(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"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),y(z.camera)},M.setViewport=function(z){var F=this,N=z.camera;F.camera.lookAt.apply(this,v(N)),F.glplot.setAspectratio(z.aspectratio);var B=N.projection.type==="orthographic",R=F.camera._ortho;B!==R&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,N=F.getCamera(),B=r.nestedProperty(z,F.id+".camera"),R=B.get();function U(fe,le,ce,V){var ee=["up","center","eye"],ne=["x","y","z"];return le[ee[ce]]&&fe[ee[ce]][ne[V]]===le[ee[ce]][ne[V]]}var j=!1;if(R===void 0)j=!0;else{for(var Z=0;Z<3;Z++)for(var re=0;re<3;re++)if(!U(N,R,Z,re)){j=!0;break}(!R.projection||N.projection&&N.projection.type!==R.projection.type)&&(j=!0)}return j},M.isAspectChanged=function(z){var F=this,N=F.glplot.getAspectratio(),B=r.nestedProperty(z,F.id+".aspectratio"),R=B.get();return R===void 0||R.x!==N.x||R.y!==N.y||R.z!==N.z},M.saveLayout=function(z){var F=this,N=F.fullLayout,B,R,U,j,Z,re,fe=F.isCameraChanged(z),le=F.isAspectChanged(z),ce=fe||le;if(ce){var V={};if(fe&&(B=F.getCamera(),R=r.nestedProperty(z,F.id+".camera"),U=R.get(),V[F.id+".camera"]=U),le&&(j=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),re=Z.get(),V[F.id+".aspectratio"]=re),t.call("_storeDirectGUIEdit",z,N._preGUI,V),fe){R.set(B);var ee=r.nestedProperty(N,F.id+".camera");ee.set(B)}if(le){Z.set(j);var ne=r.nestedProperty(N,F.id+".aspectratio");ne.set(j),F.glplot.redraw()}}return ce},M.updateFx=function(z,F){var N=this,B=N.camera;if(B)if(z==="orbit")B.mode="orbit",B.keyBindingMode="rotate";else if(z==="turntable"){B.up=[0,0,1],B.mode="turntable",B.keyBindingMode="rotate";var R=N.graphDiv,U=R._fullLayout,j=N.fullSceneLayout.camera,Z=j.up.x,re=j.up.y,fe=j.up.z;if(fe/Math.sqrt(Z*Z+re*re+fe*fe)<.999){var le=N.id+".camera.up",ce={x:0,y:0,z:1},V={};V[le]=ce;var ee=R.layout;t.call("_storeDirectGUIEdit",ee,U._preGUI,V),j.up=ce,r.nestedProperty(ee,le).set(ce)}}else B.keyBindingMode=z;N.fullSceneLayout.hovermode=F};function I(z,F,N){for(var B=0,R=N-1;B0)for(var Z=255/j,re=0;re<3;++re)z[U+re]=Math.min(Z*z[U+re],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var N=F.glplot.gl,B=N.drawingBufferWidth,R=N.drawingBufferHeight;N.bindFramebuffer(N.FRAMEBUFFER,null);var U=new Uint8Array(B*R*4);N.readPixels(0,0,B,R,N.RGBA,N.UNSIGNED_BYTE,U),I(U,B,R),L(U,B,R);var j=document.createElement("canvas");j.width=B,j.height=R;var Z=j.getContext("2d",{willReadFrequently:!0}),re=Z.createImageData(B,R);re.data.set(U),Z.putImageData(re,0,0);var fe;switch(z){case"jpeg":fe=j.toDataURL("image/jpeg");break;case"webp":fe=j.toDataURL("image/webp");break;default:fe=j.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),fe},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var N=z.fullSceneLayout[w[F]];n.setConvert(N,z.fullLayout),N.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,N=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(z._mockAxis,N)},G.exports=A}}),yP=Ge({"src/plots/gl3d/layout/attributes.js"($,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),Uk=Ge({"src/plots/gl3d/layout/axis_attributes.js"($,G){var h=_o(),b=ev(),S=Qi().extendFlat,E=Nc().overrideAll;G.exports=E({visible:b.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:h.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:b.color,categoryorder:b.categoryorder,categoryarray:b.categoryarray,title:{text:b.title.text,font:b.title.font},type:S({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorange:b.autorange,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},rangemode:b.rangemode,minallowed:b.minallowed,maxallowed:b.maxallowed,range:S({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,mirror:b.mirror,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,tickfont:b.tickfont,tickangle:b.tickangle,tickprefix:b.tickprefix,showtickprefix:b.showtickprefix,ticksuffix:b.ticksuffix,showticksuffix:b.showticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickformat:b.tickformat,tickformatstops:b.tickformatstops,hoverformat:b.hoverformat,showline:b.showline,linecolor:b.linecolor,linewidth:b.linewidth,showgrid:b.showgrid,gridcolor:S({},b.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:b.gridwidth,zeroline:b.zeroline,zerolinecolor:b.zerolinecolor,zerolinewidth:b.zerolinewidth},"plot","from-root")}}),jk=Ge({"src/plots/gl3d/layout/layout_attributes.js"($,G){var h=Uk(),b=Ac().attributes,S=Qi().extendFlat,E=gn().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:S(e(0,0,1),{}),center:S(e(0,0,0),{}),eye:S(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:b({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:h,yaxis:h,zaxis:h,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"}}}),_P=Ge({"src/plots/gl3d/layout/axis_defaults.js"($,G){var h=Bs().mix,b=gn(),S=pu(),E=Uk(),e=Dv(),t=Up(),r=["xaxis","yaxis","zaxis"],o=13600/187;G.exports=function(i,a,s){var f,c;function p(l,g){return b.coerce(f,c,E,l,g)}for(var d=0;d1;function p(d){if(!c){var T=h.validate(a[d],t[d]);if(T)return a[d]}}E(a,s,f,{type:o,attributes:t,handleDefaults:n,fullLayout:s,font:s.font,fullData:f,getDfltFromLayout:p,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function n(i,a,s,f){for(var c=s("bgcolor"),p=b.combine(c,f.paper_bgcolor),d=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",f.getDfltFromLayout("hovermode"))}}}),R_=Ge({"src/plots/gl3d/index.js"($){var G=Nc().overrideAll,h=cc(),b=gP(),S=Rv().getSubplotData,E=gn(),e=Ad(),t="gl3d",r="scene";$.name=t,$.attr=r,$.idRoot=r,$.idRegex=$.attrRegex=E.counterRegex("scene"),$.attributes=yP(),$.layoutAttributes=jk(),$.baseLayoutAttrOverrides=G({hoverlabel:h.hoverlabel},"plot","nested"),$.supplyLayoutDefaults=xP(),$.plot=function(n){for(var i=n._fullLayout,a=n._fullData,s=i._subplots[t],f=0;f0){I=f[L];break}return I}function T(v,y){if(!(v<1||y<1)){for(var I=p(v),L=p(y),z=1,F=0;FA;)L--,L/=d(L),L++,L1?z:1};function M(v,y,I){var L=I[8]+I[2]*y[0]+I[5]*y[1];return v[0]=(I[6]+I[0]*y[0]+I[3]*y[1])/L,v[1]=(I[7]+I[1]*y[0]+I[4]*y[1])/L,v}function _(v,y,I){return w(v,y,M,I),v}function w(v,y,I,L){for(var z=[0,0],F=v.shape[0],N=v.shape[1],B=0;B0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(y[L]=!0,z=this.contourStart[L];zre&&(this.minValues[U]=re),this.maxValues[U]f&&(o.isomin=null,o.isomax=null);var c=a("x"),p=a("y"),d=a("z"),T=a("value");if(!c||!c.length||!p||!p.length||!d||!d.length||!T||!T.length){o.visible=!1;return}var l=b.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),a("valuehoverformat"),["x","y","z"].forEach(function(M){a(M+"hoverformat");var _="caps."+M,w=a(_+".show");w&&a(_+".fill");var m="slices."+M,u=a(m+".show");u&&(a(m+".fill"),a(m+".locations"))});var g=a("spaceframe.show");g&&a("spaceframe.fill");var x=a("surface.show");x&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var A=a("contour.show");A&&(a("contour.color"),a("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(M){a(M)}),E(r,o,i,a,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),sE=Ge({"src/traces/streamtube/calc.js"($,G){var h=gn(),b=dv();function S(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var n=E(o);o._gridFill=n.fill,o._Xs=n.Xs,o._Ys=n.Ys,o._Zs=n.Zs,o._len=n.len;var i=0,a,s,f;o.starts&&(a=t(o.starts.x||[]),s=t(o.starts.y||[]),f=t(o.starts.z||[]),i=Math.min(a.length,s.length,f.length)),o._startsX=a||[],o._startsY=s||[],o._startsZ=f||[];var c=0,p=1/0,d;for(d=0;d1&&(u=o[a-1],y=n[a-1],L=i[a-1]),s=0;su?"-":"+")+"x"),A=A.replace("y",(v>y?"-":"+")+"y"),A=A.replace("z",(I>L?"-":"+")+"z");var B=function(){a=0,z=[],F=[],N=[]};(!a||a0;p--){var d=Math.min(c[p],c[p-1]),T=Math.max(c[p],c[p-1]);if(T>d&&d-1}function ae(Mt,je){return Mt===null?je:Mt}function ie(Mt,je,$e){fe();var Ee=[je],xe=[$e];if(K>=1)Ee=[je],xe=[$e];else if(K>0){var ye=te(je,$e);Ee=ye.xyzv,xe=ye.abc}for(var Me=0;Me-1?$e[Je]:re(Lt,Ct,Ot);_r>-1?Xe[Je]=_r:Xe[Je]=ce(Lt,Ct,Ot,ae(Mt,Wt))}V(Xe[0],Xe[1],Xe[2])}}function ve(Mt,je,$e){var Ee=function(xe,ye,Me){ie(Mt,[je[xe],je[ye],je[Me]],[$e[xe],$e[ye],$e[Me]])};Ee(0,1,2),Ee(2,3,0)}function Ae(Mt,je,$e){var Ee=function(xe,ye,Me){ie(Mt,[je[xe],je[ye],je[Me]],[$e[xe],$e[ye],$e[Me]])};Ee(0,1,2),Ee(3,0,1),Ee(2,3,0),Ee(1,2,3)}function Ce(Mt,je,$e,Ee){var xe=Mt[3];xe<$e&&(xe=$e),xe>Ee&&(xe=Ee);for(var ye=(Mt[3]-xe)/(Mt[3]-je[3]+1e-9),Me=[],Xe=0;Xe<4;Xe++)Me[Xe]=(1-ye)*Mt[Xe]+ye*je[Xe];return Me}function Fe(Mt,je,$e){return Mt>=je&&Mt<=$e}function ze(Mt){var je=.001*(B-N);return Mt>=N-je&&Mt<=B+je}function Ye(Mt){for(var je=[],$e=0;$e<4;$e++){var Ee=Mt[$e];je.push([f._x[Ee],f._y[Ee],f._z[Ee],f._value[Ee]])}return je}var it=3;function st(Mt,je,$e,Ee,xe,ye){ye||(ye=1),$e=[-1,-1,-1];var Me=!1,Xe=[Fe(je[0][3],Ee,xe),Fe(je[1][3],Ee,xe),Fe(je[2][3],Ee,xe)];if(!Xe[0]&&!Xe[1]&&!Xe[2])return!1;var Je=function(Ct,Ot,Wt){return ze(Ot[0][3])&&ze(Ot[1][3])&&ze(Ot[2][3])?(ie(Ct,Ot,Wt),!0):yeXe?[z,ye]:[ye,F];$t(je,Je[0],Je[1])}}var Lt=[[Math.min(N,F),Math.max(N,F)],[Math.min(z,B),Math.max(z,B)]];["x","y","z"].forEach(function(Ct){for(var Ot=[],Wt=0;Wt0&&(Zn.push(ra.id),Ct==="x"?qn.push([ra.distRatio,0,0]):Ct==="y"?qn.push([0,ra.distRatio,0]):qn.push([0,0,ra.distRatio]))}else Ct==="x"?En=Zr(1,u-1):Ct==="y"?En=Zr(1,v-1):En=Zr(1,y-1);Zn.length>0&&(Ct==="x"?Ot[_r]=rr(Mt,Zn,pr,hr,qn,Ot[_r]):Ct==="y"?Ot[_r]=Mr(Mt,Zn,pr,hr,qn,Ot[_r]):Ot[_r]=Sr(Mt,Zn,pr,hr,qn,Ot[_r]),_r++),En.length>0&&(Ct==="x"?Ot[_r]=ot(Mt,En,pr,hr,Ot[_r]):Ct==="y"?Ot[_r]=ct(Mt,En,pr,hr,Ot[_r]):Ot[_r]=rt(Mt,En,pr,hr,Ot[_r]),_r++)}var Nn=f.caps[Ct];Nn.show&&Nn.fill&&(ue(Nn.fill),Ct==="x"?Ot[_r]=ot(Mt,[0,u-1],pr,hr,Ot[_r]):Ct==="y"?Ot[_r]=ct(Mt,[0,v-1],pr,hr,Ot[_r]):Ot[_r]=rt(Mt,[0,y-1],pr,hr,Ot[_r]),_r++)}}),x===0&&le(),f._meshX=R,f._meshY=U,f._meshZ=j,f._meshIntensity=Z,f._Xs=_,f._Ys=w,f._Zs=m}return Br(),f}function s(f,c){var p=f.glplot.gl,d=h({gl:p}),T=new o(f,d,c.uid);return d._trace=T,T.update(c),f.glplot.add(d),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}}),EP=Ge({"src/traces/isosurface/index.js"($,G){G.exports={attributes:oE(),supplyDefaults:Vk().supplyDefaults,calc:Hk(),colorbar:{min:"cmin",max:"cmax"},plot:lE().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:R_(),categories:["gl3d","showLegend"],meta:{}}}}),kP=Ge({"lib/isosurface.js"($,G){G.exports=EP()}}),Gk=Ge({"src/traces/volume/attributes.js"($,G){var h=Pu(),b=oE(),S=GA(),E=ru(),e=Qi().extendFlat,t=Nc().overrideAll,r=G.exports=t(e({x:b.x,y:b.y,z:b.z,value:b.value,isomin:b.isomin,isomax:b.isomax,surface:b.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:b.slices,caps:b.caps,text:b.text,hovertext:b.hovertext,xhoverformat:b.xhoverformat,yhoverformat:b.yhoverformat,zhoverformat:b.zhoverformat,valuehoverformat:b.valuehoverformat,hovertemplate:b.hovertemplate,hovertemplatefallback:b.hovertemplatefallback},h("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:b.colorbar,opacity:b.opacity,opacityscale:S.opacityscale,lightposition:b.lightposition,lighting:b.lighting,flatshading:b.flatshading,contour:b.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),CP=Ge({"src/traces/volume/defaults.js"($,G){var h=gn(),b=Gk(),S=Vk().supplyIsoDefaults,E=qk().opacityscaleDefaults;G.exports=function(t,r,o,n){function i(a,s){return h.coerce(t,r,b,a,s)}S(t,r,o,n,i),E(t,r,n,i)}}}),LP=Ge({"src/traces/volume/convert.js"($,G){var h=od().gl_mesh3d,b=Vy().parseColorScale,S=gn().isArrayOrTypedArray,E=qy(),e=Tc().extractOpts,t=F3(),r=lE().findNearestOnAxis,o=lE().generateIsoMeshes;function n(s,f,c){this.scene=s,this.uid=c,this.mesh=f,this.name="",this.data=null,this.showContour=!1}var i=n.prototype;i.handlePick=function(s){if(s.object===this.mesh){var f=s.data.index,c=this.data._meshX[f],p=this.data._meshY[f],d=this.data._meshZ[f],T=this.data._Ys.length,l=this.data._Zs.length,g=r(c,this.data._Xs).id,x=r(p,this.data._Ys).id,A=r(d,this.data._Zs).id,M=s.index=A+l*x+l*T*g;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return S(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var f=this.scene,c=f.fullSceneLayout;this.data=o(s);function p(x,A,M,_){return A.map(function(w){return x.d2l(w,0,_)*M})}var d=t(p(c.xaxis,s._meshX,f.dataScale[0],s.xcalendar),p(c.yaxis,s._meshY,f.dataScale[1],s.ycalendar),p(c.zaxis,s._meshZ,f.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:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},g=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[g.min,g.max],l.colormap=b(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,f){var c=s.glplot.gl,p=h({gl:c}),d=new n(s,p,f.uid);return p._trace=d,d.update(f),s.glplot.add(p),d}G.exports=a}}),PP=Ge({"src/traces/volume/index.js"($,G){G.exports={attributes:Gk(),supplyDefaults:CP(),calc:Hk(),colorbar:{min:"cmin",max:"cmax"},plot:LP(),moduleType:"trace",name:"volume",basePlotModule:R_(),categories:["gl3d","showLegend"],meta:{}}}}),RP=Ge({"lib/volume.js"($,G){G.exports=PP()}}),IP=Ge({"src/traces/mesh3d/defaults.js"($,G){var h=Lo(),b=gn(),S=vh(),E=O3();G.exports=function(t,r,o,n){function i(p,d){return b.coerce(t,r,E,p,d)}function a(p){var d=p.map(function(T){var l=i(T);return l&&b.isArrayOrTypedArray(l)?l:null});return d.every(function(T){return T&&T.length===d[0].length})&&d}var s=a(["x","y","z"]);if(!s){r.visible=!1;return}if(a(["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 f=h.getComponentMethod("calendars","handleTraceDefaults");f(t,r,["x","y","z"],n),["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(p){i(p)});var c=i("contour.show");c&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),S(t,r,n,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),DP=Ge({"src/traces/mesh3d/calc.js"($,G){var h=dv();G.exports=function(S,E){E.intensity&&h(S,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),zP=Ge({"src/traces/mesh3d/convert.js"($,G){var h=od().gl_mesh3d,b=od().delaunay_triangulate,S=od().alpha_shape,E=od().convex_hull,e=Vy().parseColorScale,t=gn().isArrayOrTypedArray,r=qy(),o=Tc().extractOpts,n=F3();function i(l,g,x){this.scene=l,this.uid=x,this.mesh=g,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var a=i.prototype;a.handlePick=function(l){if(l.object===this.mesh){var g=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[g],this.data.y[g],this.data.z[g]];var x=this.data.hovertext||this.data.text;return t(x)&&x[g]!==void 0?l.textLabel=x[g]:x&&(l.textLabel=x),!0}};function s(l){for(var g=[],x=l.length,A=0;A=g-.5)return!1;return!0}a.update=function(l){var g=this.scene,x=g.fullSceneLayout;this.data=l;var A=l.x.length,M=n(f(x.xaxis,l.x,g.dataScale[0],l.xcalendar),f(x.yaxis,l.y,g.dataScale[1],l.ycalendar),f(x.zaxis,l.z,g.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!d(l.i,A)||!d(l.j,A)||!d(l.k,A))return;_=n(c(l.i),c(l.j),c(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=S(l.alphahull,M):_=p(l.delaunayaxis,M);var w={positions:M,cells:_,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 m=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[m.min,m.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,g){var x=l.glplot.gl,A=h({gl:x}),M=new i(l,A,g.uid);return A._trace=M,M.update(g),l.glplot.add(A),M}G.exports=T}}),OP=Ge({"src/traces/mesh3d/index.js"($,G){G.exports={attributes:O3(),supplyDefaults:IP(),calc:DP(),colorbar:{min:"cmin",max:"cmax"},plot:zP(),moduleType:"trace",name:"mesh3d",basePlotModule:R_(),categories:["gl3d","showLegend"],meta:{}}}}),FP=Ge({"lib/mesh3d.js"($,G){G.exports=OP()}}),Xk=Ge({"src/traces/cone/attributes.js"($,G){var h=Pu(),b=fc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Al(),e=O3(),t=ru(),r=Qi().extendFlat,o={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:S({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:E({editType:"calc"}),uhoverformat:b("u",1),vhoverformat:b("v",1),whoverformat:b("w",1),xhoverformat:b("x"),yhoverformat:b("y"),zhoverformat:b("z"),showlegend:r({},t.showlegend,{dflt:!1})};r(o,h("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(i){o[i]=e[i]}),o.hoverinfo=r({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=o}}),BP=Ge({"src/traces/cone/defaults.js"($,G){var h=gn(),b=vh(),S=Xk();G.exports=function(e,t,r,o){function n(T,l){return h.coerce(e,t,S,T,l)}var i=n("u"),a=n("v"),s=n("w"),f=n("x"),c=n("y"),p=n("z");if(!i||!i.length||!a||!a.length||!s||!s.length||!f||!f.length||!c||!c.length||!p||!p.length){t.visible=!1;return}var d=n("sizemode");n("sizeref",d==="raw"?1:.5),n("anchor"),n("lighting.ambient"),n("lighting.diffuse"),n("lighting.specular"),n("lighting.roughness"),n("lighting.fresnel"),n("lightposition.x"),n("lightposition.y"),n("lightposition.z"),b(e,t,o,n,{prefix:"",cLetter:"c"}),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),n("uhoverformat"),n("vhoverformat"),n("whoverformat"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),t._length=null}}}),NP=Ge({"src/traces/cone/calc.js"($,G){var h=dv();G.exports=function(S,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),n=-1/0,i=1/0,a=0;a2?d=c.slice(1,p-1):p===2?d=[(c[0]+c[1])/2]:d=c,d}function a(c){var p=c.length;return p===1?[.5,.5]:[c[1]-c[0],c[p-1]-c[p-2]]}function s(c,p){var d=c.fullSceneLayout,T=c.dataScale,l=p._len,g={};function x(ce,V){var ee=d[V],ne=T[r[V]];return S.simpleMap(ce,function(K){return ee.d2l(K)*ne})}if(g.vectors=t(x(p._u,"xaxis"),x(p._v,"yaxis"),x(p._w,"zaxis"),l),!l)return{positions:[],cells:[]};var A=x(p._Xs,"xaxis"),M=x(p._Ys,"yaxis"),_=x(p._Zs,"zaxis");g.meshgrid=[A,M,_],g.gridFill=p._gridFill;var w=p._slen;if(w)g.startingPositions=t(x(p._startsX,"xaxis"),x(p._startsY,"yaxis"),x(p._startsZ,"zaxis"));else{for(var m=M[0],u=i(A),v=i(_),y=new Array(u.length*v.length),I=0,L=0;Lm&&(m=I[0]),I[1]u&&(u=I[1])}function y(I){switch(I.type){case"GeometryCollection":I.geometries.forEach(y);break;case"Point":v(I.coordinates);break;case"MultiPoint":I.coordinates.forEach(v);break}}x.arcs.forEach(function(I){for(var L=-1,z=I.length,F;++Lm&&(m=F[0]),F[1]u&&(u=F[1])});for(M in x.objects)y(x.objects[M]);return[_,w,m,u]}function e(x,A){for(var M,_=x.length,w=_-A;w<--_;)M=x[w],x[w++]=x[_],x[_]=M}function t(x,A){return typeof A=="string"&&(A=x.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(M){return r(x,M)})}:r(x,A)}function r(x,A){var M=A.id,_=A.bbox,w=A.properties==null?{}:A.properties,m=o(x,A);return M==null&&_==null?{type:"Feature",properties:w,geometry:m}:_==null?{type:"Feature",id:M,properties:w,geometry:m}:{type:"Feature",id:M,bbox:_,properties:w,geometry:m}}function o(x,A){var M=S(x.transform),_=x.arcs;function w(L,z){z.length&&z.pop();for(var F=_[L<0?~L:L],N=0,B=F.length;N1)_=s(x,A,M);else for(w=0,_=new Array(m=x.arcs.length);w1)for(var z=1,F=v(I[0]),N,B;zF&&(B=I[0],I[0]=I[z],I[z]=B,F=N);return I}).filter(function(y){return y.length>0})}}function d(x,A){for(var M=0,_=x.length;M<_;){var w=M+_>>>1;x[w]=2))throw new Error("n must be ≥2");y=x.bbox||E(x);var M=y[0],_=y[1],w=y[2],m=y[3],u;A={scale:[w-M?(w-M)/(u-1):1,m-_?(m-_)/(u-1):1],translate:[M,_]}}else y=x.bbox;var v=l(A),y,I,L=x.objects,z={};function F(R){return v(R)}function N(R){var U;switch(R.type){case"GeometryCollection":U={type:"GeometryCollection",geometries:R.geometries.map(N)};break;case"Point":U={type:"Point",coordinates:F(R.coordinates)};break;case"MultiPoint":U={type:"MultiPoint",coordinates:R.coordinates.map(F)};break;default:return R}return R.id!=null&&(U.id=R.id),R.bbox!=null&&(U.bbox=R.bbox),R.properties!=null&&(U.properties=R.properties),U}function B(R){var U=0,j=1,Z=R.length,re,fe=new Array(Z);for(fe[0]=v(R[0],0);++U0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},$.makeLine=function(h){return h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}},$.makePolygon=function(h){if(h.length===1)return{type:"Polygon",coordinates:h};for(var b=new Array(h.length),S=0;Se(N,z)),F)}function r(L,z,F={}){for(const B of L){if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(B[B.length-1].length!==B[0].length)throw new Error("First and last Position are not equivalent.");for(let R=0;Rr(N,z)),F)}function n(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return S({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return a(L.map(N=>n(N,z)),F)}function a(L,z={}){const 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 S({type:"MultiLineString",coordinates:L},z,F)}function f(L,z,F={}){return S({type:"MultiPoint",coordinates:L},z,F)}function c(L,z,F={}){return S({type:"MultiPolygon",coordinates:L},z,F)}function p(L,z,F={}){return S({type:"GeometryCollection",geometries:L},z,F)}function d(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L/F}function g(L,z){return M(l(L,z))}function x(L){let z=L%360;return z<0&&(z+=360),z}function A(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function M(L){return L%(2*Math.PI)*180/Math.PI}function _(L){return L%360*Math.PI/180}function w(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function m(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");const N=b[z];if(!N)throw new Error("invalid original units");const B=b[F];if(!B)throw new Error("invalid final units");return L/N*B}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function v(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function y(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 I(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")}$.areaFactors=b,$.azimuthToBearing=A,$.bearingToAzimuth=x,$.convertArea=m,$.convertLength=w,$.degreesToRadians=_,$.earthRadius=G,$.factors=h,$.feature=S,$.featureCollection=a,$.geometry=E,$.geometryCollection=p,$.isNumber=u,$.isObject=v,$.lengthToDegrees=g,$.lengthToRadians=l,$.lineString=n,$.lineStrings=i,$.multiLineString=s,$.multiPoint=f,$.multiPolygon=c,$.point=e,$.points=t,$.polygon=r,$.polygons=o,$.radiansToDegrees=M,$.radiansToLength=T,$.round=d,$.validateBBox=y,$.validateId=I}}),hE=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=fE();function h(l,g,x){if(l!==null)for(var A,M,_,w,m,u,v,y=0,I=0,L,z=l.type,F=z==="FeatureCollection",N=z==="Feature",B=F?l.features.length:1,R=0;Ru||F>v||N>y){m=I,u=A,v=F,y=N,_=0;return}var B=G.lineString.call(void 0,[m,I],x.properties);if(g(B,A,M,N,_)===!1)return!1;_++,m=I})===!1)return!1}}})}function f(l,g,x){var A=x,M=!1;return s(l,function(_,w,m,u,v){M===!1&&x===void 0?A=_:A=g(A,_,w,m,u,v),M=!0}),A}function c(l,g){if(!l)throw new Error("geojson is required");i(l,function(x,A,M){if(x.geometry!==null){var _=x.geometry.type,w=x.geometry.coordinates;switch(_){case"LineString":if(g(x,A,M,0,0)===!1)return!1;break;case"Polygon":for(var m=0;mi+S(a),0)}function S(n){let i=0,a;switch(n.type){case"Polygon":return E(n.coordinates);case"MultiPolygon":for(a=0;a0){i+=Math.abs(r(n[0]));for(let a=1;a=i?(s+2)%i:s+2],d=f[0]*t,T=c[1]*t,l=p[0]*t;a+=(l-d)*Math.sin(T),s++}return a*e}var o=b;$.area=b,$.default=o}}),$P=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=fE(),h=hE();function b(E,e={}){let t=0,r=0,o=0;return h.coordEach.call(void 0,E,function(n){t+=n[0],r+=n[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var S=b;$.centroid=b,$.default=S}}),JP=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=hE();function h(S,E={}){if(S.bbox!=null&&E.recompute!==!0)return S.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,S,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(L(z)===null)F=z;else for(F=new Array(z.length),I=0;IF?N[B++]=[z[I][0]+360,z[I][1]]:I===F?(N[B++]=z[I],N[B++]=[z[I][0],-90]):N[B++]=z[I];var R=i.tester(N);R.pts.pop(),m.push(R)}:u=function(z){m.push(i.tester(z))},M.type){case"MultiPolygon":for(v=0;v<_.length;v++)for(y=0;y<_[v].length;y++)u(_[v][y]);break;case"Polygon":for(v=0;v<_.length;v++)u(_[v]);break}return m}function d(A){var M=A.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(A){var M=A[0].trace,_=d(M);if(!_)return!1;var w={},m=[],u;for(u=0;u0?R.properties.ct=l(R):R.properties.ct=[NaN,NaN],N.fIn=z,N.fOut=R,m.push(R)}else r.log(["Location",N.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var I=_.features;for(u=0;um&&(m=y,_=v)}else _=M;return E(_).geometry.coordinates}function g(A){var M=window.PlotlyGeoAssets||{},_=[];function w(I){return new Promise(function(L,z){h.json(I,function(F,N){if(F){delete M[I];var B=F.status===404?'GeoJSON at URL "'+I+'" does not exist.':"Unexpected error while fetching from "+I;return z(new Error(B))}return M[I]=N,L(N)})})}function m(I){return new Promise(function(L,z){var F=0,N=setInterval(function(){if(M[I]&&M[I]!=="pending")return clearInterval(N),L(M[I]);if(F>100)return clearInterval(N),z("Unexpected error while fetching from "+I);F++},50)})}for(var u=0;u")}}}),eR=Ge({"src/traces/scattergeo/event_data.js"($,G){G.exports=function(b,S,E,e,t){b.lon=S.lon,b.lat=S.lat,b.location=S.loc?S.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b}}}),tR=Ge({"src/traces/scattergeo/select.js"($,G){var h=iu(),b=zi().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,n=[],i=t[0].trace,a,s,f,c,p,d=!h.hasMarkers(i)&&!h.hasText(i);if(d)return[];if(e===!1)for(p=0;pK?1:ne>=K?0:NaN}function S(ne){return ne.length===1&&(ne=E(ne)),{left:function(K,ue,te,H){for(te==null&&(te=0),H==null&&(H=K.length);te>>1;ne(K[ae],ue)<0?te=ae+1:H=ae}return te},right:function(K,ue,te,H){for(te==null&&(te=0),H==null&&(H=K.length);te>>1;ne(K[ae],ue)>0?H=ae:te=ae+1}return te}}}function E(ne){return function(K,ue){return b(ne(K),ue)}}var e=S(b),t=e.right,r=e.left;function o(ne,K){K==null&&(K=n);for(var ue=0,te=ne.length-1,H=ne[0],ae=new Array(te<0?0:te);uene?1:K>=ne?0:NaN}function s(ne){return ne===null?NaN:+ne}function f(ne,K){var ue=ne.length,te=0,H=-1,ae=0,ie,ve,Ae=0;if(K==null)for(;++H1)return Ae/(te-1)}function c(ne,K){var ue=f(ne,K);return ue&&Math.sqrt(ue)}function p(ne,K){var ue=ne.length,te=-1,H,ae,ie;if(K==null){for(;++te=H)for(ae=ie=H;++teH&&(ae=H),ie=H)for(ae=ie=H;++teH&&(ae=H),ie0)return[ne];if((te=K0)for(ne=Math.ceil(ne/ve),K=Math.floor(K/ve),ie=new Array(ae=Math.ceil(K-ne+1));++H=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,H):-Math.pow(10,-H)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function v(ne,K,ue){var te=Math.abs(K-ne)/Math.max(0,ue),H=Math.pow(10,Math.floor(Math.log(te)/Math.LN10)),ae=te/H;return ae>=M?H*=10:ae>=_?H*=5:ae>=w&&(H*=2),Kze;)Ye.pop(),--it;var st=new Array(it+1),nt;for(ae=0;ae<=it;++ae)nt=st[ae]=[],nt.x0=ae>0?Ye[ae-1]:Fe,nt.x1=ae=1)return+ue(ne[te-1],te-1,ne);var te,H=(te-1)*K,ae=Math.floor(H),ie=+ue(ne[ae],ae,ne),ve=+ue(ne[ae+1],ae+1,ne);return ie+(ve-ie)*(H-ae)}}function z(ne,K,ue){return ne=l.call(ne,s).sort(b),Math.ceil((ue-K)/(2*(L(ne,.75)-L(ne,.25))*Math.pow(ne.length,-1/3)))}function F(ne,K,ue){return Math.ceil((ue-K)/(3.5*c(ne)*Math.pow(ne.length,-1/3)))}function N(ne,K){var ue=ne.length,te=-1,H,ae;if(K==null){for(;++te=H)for(ae=H;++teae&&(ae=H)}else for(;++te=H)for(ae=H;++teae&&(ae=H);return ae}function B(ne,K){var ue=ne.length,te=ue,H=-1,ae,ie=0;if(K==null)for(;++H=0;)for(ie=ne[K],ue=ie.length;--ue>=0;)ae[--H]=ie[ue];return ae}function j(ne,K){var ue=ne.length,te=-1,H,ae;if(K==null){for(;++te=H)for(ae=H;++teH&&(ae=H)}else for(;++te=H)for(ae=H;++teH&&(ae=H);return ae}function Z(ne,K){for(var ue=K.length,te=new Array(ue);ue--;)te[ue]=ne[K[ue]];return te}function re(ne,K){if(ue=ne.length){var ue,te=0,H=0,ae,ie=ne[H];for(K==null&&(K=b);++te0?1:ur<0?-1:0},m=Math.sqrt,u=Math.tan;function v(ur){return ur>1?0:ur<-1?n:Math.acos(ur)}function y(ur){return ur>1?i:ur<-1?-i:Math.asin(ur)}function I(ur){return(ur=_(ur/2))*ur}function L(){}function z(ur,Pr){ur&&N.hasOwnProperty(ur.type)&&N[ur.type](ur,Pr)}var F={Feature:function(ur,Pr){z(ur.geometry,Pr)},FeatureCollection:function(ur,Pr){for(var vn=ur.features,rn=-1,On=vn.length;++rn=0?1:-1,On=rn*vn,Ta=l(Pr),ya=_(Pr),ei=V*ya,si=ce*Ta+ei*l(On),Bi=ei*rn*_(On);j.add(T(Bi,si)),le=ur,ce=Ta,V=ya}function H(ur){return Z.reset(),U(ur,ee),Z*2}function ae(ur){return[T(ur[1],ur[0]),y(ur[2])]}function ie(ur){var Pr=ur[0],vn=ur[1],rn=l(vn);return[rn*l(Pr),rn*_(Pr),_(vn)]}function ve(ur,Pr){return ur[0]*Pr[0]+ur[1]*Pr[1]+ur[2]*Pr[2]}function Ae(ur,Pr){return[ur[1]*Pr[2]-ur[2]*Pr[1],ur[2]*Pr[0]-ur[0]*Pr[2],ur[0]*Pr[1]-ur[1]*Pr[0]]}function Ce(ur,Pr){ur[0]+=Pr[0],ur[1]+=Pr[1],ur[2]+=Pr[2]}function Fe(ur,Pr){return[ur[0]*Pr,ur[1]*Pr,ur[2]*Pr]}function ze(ur){var Pr=m(ur[0]*ur[0]+ur[1]*ur[1]+ur[2]*ur[2]);ur[0]/=Pr,ur[1]/=Pr,ur[2]/=Pr}var Ye,it,st,nt,Qe,Le,Te,pe,Ne=S(),ot,ct,rt={point:Ft,lineStart:$t,lineEnd:rr,polygonStart:function(){rt.point=Mr,rt.lineStart=Sr,rt.lineEnd=Zr,Ne.reset(),ee.polygonStart()},polygonEnd:function(){ee.polygonEnd(),rt.point=Ft,rt.lineStart=$t,rt.lineEnd=rr,j<0?(Ye=-(st=180),it=-(nt=90)):Ne>r?nt=90:Ne<-r&&(it=-90),ct[0]=Ye,ct[1]=st},sphere:function(){Ye=-(st=180),it=-(nt=90)}};function Ft(ur,Pr){ot.push(ct=[Ye=ur,st=ur]),Prnt&&(nt=Pr)}function Nt(ur,Pr){var vn=ie([ur*c,Pr*c]);if(pe){var rn=Ae(pe,vn),On=[rn[1],-rn[0],0],Ta=Ae(On,rn);ze(Ta),Ta=ae(Ta);var ya=ur-Qe,ei=ya>0?1:-1,si=Ta[0]*f*ei,Bi,Va=p(ya)>180;Va^(ei*Qent&&(nt=Bi)):(si=(si+360)%360-180,Va^(ei*Qent&&(nt=Pr))),Va?urAr(Ye,st)&&(st=ur):Ar(ur,st)>Ar(Ye,st)&&(Ye=ur):st>=Ye?(urst&&(st=ur)):ur>Qe?Ar(Ye,ur)>Ar(Ye,st)&&(st=ur):Ar(ur,st)>Ar(Ye,st)&&(Ye=ur)}else ot.push(ct=[Ye=ur,st=ur]);Prnt&&(nt=Pr),pe=vn,Qe=ur}function $t(){rt.point=Nt}function rr(){ct[0]=Ye,ct[1]=st,rt.point=Ft,pe=null}function Mr(ur,Pr){if(pe){var vn=ur-Qe;Ne.add(p(vn)>180?vn+(vn>0?360:-360):vn)}else Le=ur,Te=Pr;ee.point(ur,Pr),Nt(ur,Pr)}function Sr(){ee.lineStart()}function Zr(){Mr(Le,Te),ee.lineEnd(),p(Ne)>r&&(Ye=-(st=180)),ct[0]=Ye,ct[1]=st,pe=null}function Ar(ur,Pr){return(Pr-=ur)<0?Pr+360:Pr}function Br(ur,Pr){return ur[0]-Pr[0]}function Mt(ur,Pr){return ur[0]<=ur[1]?ur[0]<=Pr&&Pr<=ur[1]:PrAr(rn[0],rn[1])&&(rn[1]=On[1]),Ar(On[0],rn[1])>Ar(rn[0],rn[1])&&(rn[0]=On[0])):Ta.push(rn=On);for(ya=-1/0,vn=Ta.length-1,Pr=0,rn=Ta[vn];Pr<=vn;rn=On,++Pr)On=Ta[Pr],(ei=Ar(rn[1],On[0]))>ya&&(ya=ei,Ye=On[0],st=rn[1])}return ot=ct=null,Ye===1/0||it===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ye,it],[st,nt]]}var $e,Ee,xe,ye,Me,Xe,Je,Lt,Ct,Ot,Wt,_r,pr,hr,Fr,En,Zn={sphere:L,point:qn,lineStart:ra,lineEnd:ja,polygonStart:function(){Zn.lineStart=ir,Zn.lineEnd=qt},polygonEnd:function(){Zn.lineStart=ra,Zn.lineEnd=ja}};function qn(ur,Pr){ur*=c,Pr*=c;var vn=l(Pr);ta(vn*l(ur),vn*_(ur),_(Pr))}function ta(ur,Pr,vn){++$e,xe+=(ur-xe)/$e,ye+=(Pr-ye)/$e,Me+=(vn-Me)/$e}function ra(){Zn.point=Nn}function Nn(ur,Pr){ur*=c,Pr*=c;var vn=l(Pr);hr=vn*l(ur),Fr=vn*_(ur),En=_(Pr),Zn.point=Ea,ta(hr,Fr,En)}function Ea(ur,Pr){ur*=c,Pr*=c;var vn=l(Pr),rn=vn*l(ur),On=vn*_(ur),Ta=_(Pr),ya=T(m((ya=Fr*Ta-En*On)*ya+(ya=En*rn-hr*Ta)*ya+(ya=hr*On-Fr*rn)*ya),hr*rn+Fr*On+En*Ta);Ee+=ya,Xe+=ya*(hr+(hr=rn)),Je+=ya*(Fr+(Fr=On)),Lt+=ya*(En+(En=Ta)),ta(hr,Fr,En)}function ja(){Zn.point=qn}function ir(){Zn.point=ar}function qt(){sr(_r,pr),Zn.point=qn}function ar(ur,Pr){_r=ur,pr=Pr,ur*=c,Pr*=c,Zn.point=sr;var vn=l(Pr);hr=vn*l(ur),Fr=vn*_(ur),En=_(Pr),ta(hr,Fr,En)}function sr(ur,Pr){ur*=c,Pr*=c;var vn=l(Pr),rn=vn*l(ur),On=vn*_(ur),Ta=_(Pr),ya=Fr*Ta-En*On,ei=En*rn-hr*Ta,si=hr*On-Fr*rn,Bi=m(ya*ya+ei*ei+si*si),Va=y(Bi),_i=Bi&&-Va/Bi;Ct+=_i*ya,Ot+=_i*ei,Wt+=_i*si,Ee+=Va,Xe+=Va*(hr+(hr=rn)),Je+=Va*(Fr+(Fr=On)),Lt+=Va*(En+(En=Ta)),ta(hr,Fr,En)}function Vr(ur){$e=Ee=xe=ye=Me=Xe=Je=Lt=Ct=Ot=Wt=0,U(ur,Zn);var Pr=Ct,vn=Ot,rn=Wt,On=Pr*Pr+vn*vn+rn*rn;return Onn?ur+Math.round(-ur/s)*s:ur,Pr]}wn.invert=wn;function Kn(ur,Pr,vn){return(ur%=s)?Pr||vn?pn(fa(ur),ga(Pr,vn)):fa(ur):Pr||vn?ga(Pr,vn):wn}function da(ur){return function(Pr,vn){return Pr+=ur,[Pr>n?Pr-s:Pr<-n?Pr+s:Pr,vn]}}function fa(ur){var Pr=da(ur);return Pr.invert=da(-ur),Pr}function ga(ur,Pr){var vn=l(ur),rn=_(ur),On=l(Pr),Ta=_(Pr);function ya(ei,si){var Bi=l(si),Va=l(ei)*Bi,_i=_(ei)*Bi,Ja=_(si),Ba=Ja*vn+Va*rn;return[T(_i*On-Ba*Ta,Va*vn-Ja*rn),y(Ba*On+_i*Ta)]}return ya.invert=function(ei,si){var Bi=l(si),Va=l(ei)*Bi,_i=_(ei)*Bi,Ja=_(si),Ba=Ja*On-_i*Ta;return[T(_i*On+Ja*Ta,Va*vn+Ba*rn),y(Ba*vn-Va*rn)]},ya}function ka(ur){ur=Kn(ur[0]*c,ur[1]*c,ur.length>2?ur[2]*c:0);function Pr(vn){return vn=ur(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn}return Pr.invert=function(vn){return vn=ur.invert(vn[0]*c,vn[1]*c),vn[0]*=f,vn[1]*=f,vn},Pr}function Vn(ur,Pr,vn,rn,On,Ta){if(vn){var ya=l(Pr),ei=_(Pr),si=rn*vn;On==null?(On=Pr+rn*s,Ta=Pr-si/2):(On=hi(ya,On),Ta=hi(ya,Ta),(rn>0?OnTa)&&(On+=rn*s));for(var Bi,Va=On;rn>0?Va>Ta:Va1&&ur.push(ur.pop().concat(ur.shift()))},result:function(){var vn=ur;return ur=[],Pr=null,vn}}}function yt(ur,Pr){return p(ur[0]-Pr[0])=0;--ei)On.point((_i=Va[ei])[0],_i[1]);else rn(Ja.x,Ja.p.x,-1,On);Ja=Ja.p}Ja=Ja.o,Va=Ja.z,Ba=!Ba}while(!Ja.v);On.lineEnd()}}}function jr(ur){if(Pr=ur.length){for(var Pr,vn=0,rn=ur[0],On;++vn=0?1:-1,Sl=Hl*wl,Gl=Sl>n,el=No*ns;if(Ir.add(T(el*Hl*_(Sl),Ro*Fs+el*l(Sl))),ya+=Gl?wl+Hl*s:wl,Gl^Ba>=vn^Yi>=vn){var Su=Ae(ie(Ja),ie(jo));ze(Su);var bu=Ae(Ta,Su);ze(bu);var Ul=(Gl^wl>=0?-1:1)*y(bu[2]);(rn>Ul||rn===Ul&&(Su[0]||Su[1]))&&(ei+=Gl^wl>=0?1:-1)}}return(ya<-r||ya0){for(si||(On.polygonStart(),si=!0),On.lineStart(),Fs=0;Fs1&&ki&2&&ns.push(ns.pop().concat(ns.shift())),Va.push(ns.filter(Tt))}}return Ja}}function Tt(ur){return ur.length>1}function or(ur,Pr){return((ur=ur.x)[0]<0?ur[1]-i-r:i-ur[1])-((Pr=Pr.x)[0]<0?Pr[1]-i-r:i-Pr[1])}var Dr=Kr(function(){return!0},ln,jn,[-n,-i]);function ln(ur){var Pr=NaN,vn=NaN,rn=NaN,On;return{lineStart:function(){ur.lineStart(),On=1},point:function(Ta,ya){var ei=Ta>0?n:-n,si=p(Ta-Pr);p(si-n)0?i:-i),ur.point(rn,vn),ur.lineEnd(),ur.lineStart(),ur.point(ei,vn),ur.point(Ta,vn),On=0):rn!==ei&&si>=n&&(p(Pr-rn)r?d((_(Pr)*(Ta=l(rn))*_(vn)-_(rn)*(On=l(Pr))*_(ur))/(On*Ta*ya)):(Pr+rn)/2}function jn(ur,Pr,vn,rn){var On;if(ur==null)On=vn*i,rn.point(-n,On),rn.point(0,On),rn.point(n,On),rn.point(n,0),rn.point(n,-On),rn.point(0,-On),rn.point(-n,-On),rn.point(-n,0),rn.point(-n,On);else if(p(ur[0]-Pr[0])>r){var Ta=ur[0]0,On=p(Pr)>r;function Ta(Va,_i,Ja,Ba){Vn(Ba,ur,vn,Ja,Va,_i)}function ya(Va,_i){return l(Va)*l(_i)>Pr}function ei(Va){var _i,Ja,Ba,Gi,No;return{lineStart:function(){Gi=Ba=!1,No=1},point:function(Ro,Go){var jo=[Ro,Go],Yi,ki=ya(Ro,Go),ns=rn?ki?0:Bi(Ro,Go):ki?Bi(Ro+(Ro<0?n:-n),Go):0;if(!_i&&(Gi=Ba=ki)&&Va.lineStart(),ki!==Ba&&(Yi=si(_i,jo),(!Yi||yt(_i,Yi)||yt(jo,Yi))&&(jo[2]=1)),ki!==Ba)No=0,ki?(Va.lineStart(),Yi=si(jo,_i),Va.point(Yi[0],Yi[1])):(Yi=si(_i,jo),Va.point(Yi[0],Yi[1],2),Va.lineEnd()),_i=Yi;else if(On&&_i&&rn^ki){var Fs;!(ns&Ja)&&(Fs=si(jo,_i,!0))&&(No=0,rn?(Va.lineStart(),Va.point(Fs[0][0],Fs[0][1]),Va.point(Fs[1][0],Fs[1][1]),Va.lineEnd()):(Va.point(Fs[1][0],Fs[1][1]),Va.lineEnd(),Va.lineStart(),Va.point(Fs[0][0],Fs[0][1],3)))}ki&&(!_i||!yt(_i,jo))&&Va.point(jo[0],jo[1]),_i=jo,Ba=ki,Ja=ns},lineEnd:function(){Ba&&Va.lineEnd(),_i=null},clean:function(){return No|(Gi&&Ba)<<1}}}function si(Va,_i,Ja){var Ba=ie(Va),Gi=ie(_i),No=[1,0,0],Ro=Ae(Ba,Gi),Go=ve(Ro,Ro),jo=Ro[0],Yi=Go-jo*jo;if(!Yi)return!Ja&&Va;var ki=Pr*Go/Yi,ns=-Pr*jo/Yi,Fs=Ae(No,Ro),wl=Fe(No,ki),Hl=Fe(Ro,ns);Ce(wl,Hl);var Sl=Fs,Gl=ve(wl,Sl),el=ve(Sl,Sl),Su=Gl*Gl-el*(ve(wl,wl)-1);if(!(Su<0)){var bu=m(Su),Ul=Fe(Sl,(-Gl-bu)/el);if(Ce(Ul,wl),Ul=ae(Ul),!Ja)return Ul;var po=Va[0],gs=_i[0],Il=Va[1],dl=_i[1],vc;gs0^Ul[1]<(p(Ul[0]-po)n^(po<=Ul[0]&&Ul[0]<=gs)){var pc=Fe(Sl,(-Gl+bu)/el);return Ce(pc,wl),[Ul,ae(pc)]}}}function Bi(Va,_i){var Ja=rn?ur:n-ur,Ba=0;return Va<-Ja?Ba|=1:Va>Ja&&(Ba|=2),_i<-Ja?Ba|=4:_i>Ja&&(Ba|=8),Ba}return Kr(ya,ei,Ta,rn?[0,-ur]:[-n,ur-n])}function un(ur,Pr,vn,rn,On,Ta){var ya=ur[0],ei=ur[1],si=Pr[0],Bi=Pr[1],Va=0,_i=1,Ja=si-ya,Ba=Bi-ei,Gi;if(Gi=vn-ya,!(!Ja&&Gi>0)){if(Gi/=Ja,Ja<0){if(Gi0){if(Gi>_i)return;Gi>Va&&(Va=Gi)}if(Gi=On-ya,!(!Ja&&Gi<0)){if(Gi/=Ja,Ja<0){if(Gi>_i)return;Gi>Va&&(Va=Gi)}else if(Ja>0){if(Gi0)){if(Gi/=Ba,Ba<0){if(Gi0){if(Gi>_i)return;Gi>Va&&(Va=Gi)}if(Gi=Ta-ei,!(!Ba&&Gi<0)){if(Gi/=Ba,Ba<0){if(Gi>_i)return;Gi>Va&&(Va=Gi)}else if(Ba>0){if(Gi0&&(ur[0]=ya+Va*Ja,ur[1]=ei+Va*Ba),_i<1&&(Pr[0]=ya+_i*Ja,Pr[1]=ei+_i*Ba),!0}}}}}var Rn=1e9,di=-Rn;function Ma(ur,Pr,vn,rn){function On(Bi,Va){return ur<=Bi&&Bi<=vn&&Pr<=Va&&Va<=rn}function Ta(Bi,Va,_i,Ja){var Ba=0,Gi=0;if(Bi==null||(Ba=ya(Bi,_i))!==(Gi=ya(Va,_i))||si(Bi,Va)<0^_i>0)do Ja.point(Ba===0||Ba===3?ur:vn,Ba>1?rn:Pr);while((Ba=(Ba+_i+4)%4)!==Gi);else Ja.point(Va[0],Va[1])}function ya(Bi,Va){return p(Bi[0]-ur)0?0:3:p(Bi[0]-vn)0?2:1:p(Bi[1]-Pr)0?1:0:Va>0?3:2}function ei(Bi,Va){return si(Bi.x,Va.x)}function si(Bi,Va){var _i=ya(Bi,1),Ja=ya(Va,1);return _i!==Ja?_i-Ja:_i===0?Va[1]-Bi[1]:_i===1?Bi[0]-Va[0]:_i===2?Bi[1]-Va[1]:Va[0]-Bi[0]}return function(Bi){var Va=Bi,_i=Dt(),Ja,Ba,Gi,No,Ro,Go,jo,Yi,ki,ns,Fs,wl={point:Hl,lineStart:Su,lineEnd:bu,polygonStart:Gl,polygonEnd:el};function Hl(po,gs){On(po,gs)&&Va.point(po,gs)}function Sl(){for(var po=0,gs=0,Il=Ba.length;gsrn&&(Af-Hf)*(rn-pc)>(Mu-pc)*(ur-Hf)&&++po:Mu<=rn&&(Af-Hf)*(rn-pc)<(Mu-pc)*(ur-Hf)&&--po;return po}function Gl(){Va=_i,Ja=[],Ba=[],Fs=!0}function el(){var po=Sl(),gs=Fs&&po,Il=(Ja=b.merge(Ja)).length;(gs||Il)&&(Bi.polygonStart(),gs&&(Bi.lineStart(),Ta(null,null,1,Bi),Bi.lineEnd()),Il&&Nr(Ja,ei,po,Ta,Bi),Bi.polygonEnd()),Va=Bi,Ja=Ba=Gi=null}function Su(){wl.point=Ul,Ba&&Ba.push(Gi=[]),ns=!0,ki=!1,jo=Yi=NaN}function bu(){Ja&&(Ul(No,Ro),Go&&ki&&_i.rejoin(),Ja.push(_i.result())),wl.point=Hl,ki&&Va.lineEnd()}function Ul(po,gs){var Il=On(po,gs);if(Ba&&Gi.push([po,gs]),ns)No=po,Ro=gs,Go=Il,ns=!1,Il&&(Va.lineStart(),Va.point(po,gs));else if(Il&&ki)Va.point(po,gs);else{var dl=[jo=Math.max(di,Math.min(Rn,jo)),Yi=Math.max(di,Math.min(Rn,Yi))],vc=[po=Math.max(di,Math.min(Rn,po)),gs=Math.max(di,Math.min(Rn,gs))];un(dl,vc,ur,Pr,vn,rn)?(ki||(Va.lineStart(),Va.point(dl[0],dl[1])),Va.point(vc[0],vc[1]),Il||Va.lineEnd(),Fs=!1):Il&&(Va.lineStart(),Va.point(po,gs),Fs=!1)}jo=po,Yi=gs,ki=Il}return wl}}function Ei(){var ur=0,Pr=0,vn=960,rn=500,On,Ta,ya;return ya={stream:function(ei){return On&&Ta===ei?On:On=Ma(ur,Pr,vn,rn)(Ta=ei)},extent:function(ei){return arguments.length?(ur=+ei[0][0],Pr=+ei[0][1],vn=+ei[1][0],rn=+ei[1][1],On=Ta=null,ya):[[ur,Pr],[vn,rn]]}}}var Hi=S(),io,no,bo,li={sphere:L,point:L,lineStart:ts,lineEnd:L,polygonStart:L,polygonEnd:L};function ts(){li.point=Gs,li.lineEnd=Ho}function Ho(){li.point=li.lineEnd=L}function Gs(ur,Pr){ur*=c,Pr*=c,io=ur,no=_(Pr),bo=l(Pr),li.point=cs}function cs(ur,Pr){ur*=c,Pr*=c;var vn=_(Pr),rn=l(Pr),On=p(ur-io),Ta=l(On),ya=_(On),ei=rn*ya,si=bo*vn-no*rn*Ta,Bi=no*vn+bo*rn*Ta;Hi.add(T(m(ei*ei+si*si),Bi)),io=ur,no=vn,bo=rn}function Jo(ur){return Hi.reset(),U(ur,li),+Hi}var Uo=[null,null],Xs={type:"LineString",coordinates:Uo};function js(ur,Pr){return Uo[0]=ur,Uo[1]=Pr,Jo(Xs)}var ol={Feature:function(ur,Pr){return Zo(ur.geometry,Pr)},FeatureCollection:function(ur,Pr){for(var vn=ur.features,rn=-1,On=vn.length;++rn0&&(On=js(ur[Ta],ur[Ta-1]),On>0&&vn<=On&&rn<=On&&(vn+rn-On)*(1-Math.pow((vn-rn)/On,2))r}).map(Ja)).concat(b.range(g(Ta/Bi)*Bi,On,Bi).filter(function(Yi){return p(Yi%_i)>r}).map(Ba))}return Go.lines=function(){return jo().map(function(Yi){return{type:"LineString",coordinates:Yi}})},Go.outline=function(){return{type:"Polygon",coordinates:[Gi(rn).concat(No(ya).slice(1),Gi(vn).reverse().slice(1),No(ei).reverse().slice(1))]}},Go.extent=function(Yi){return arguments.length?Go.extentMajor(Yi).extentMinor(Yi):Go.extentMinor()},Go.extentMajor=function(Yi){return arguments.length?(rn=+Yi[0][0],vn=+Yi[1][0],ei=+Yi[0][1],ya=+Yi[1][1],rn>vn&&(Yi=rn,rn=vn,vn=Yi),ei>ya&&(Yi=ei,ei=ya,ya=Yi),Go.precision(Ro)):[[rn,ei],[vn,ya]]},Go.extentMinor=function(Yi){return arguments.length?(Pr=+Yi[0][0],ur=+Yi[1][0],Ta=+Yi[0][1],On=+Yi[1][1],Pr>ur&&(Yi=Pr,Pr=ur,ur=Yi),Ta>On&&(Yi=Ta,Ta=On,On=Yi),Go.precision(Ro)):[[Pr,Ta],[ur,On]]},Go.step=function(Yi){return arguments.length?Go.stepMajor(Yi).stepMinor(Yi):Go.stepMinor()},Go.stepMajor=function(Yi){return arguments.length?(Va=+Yi[0],_i=+Yi[1],Go):[Va,_i]},Go.stepMinor=function(Yi){return arguments.length?(si=+Yi[0],Bi=+Yi[1],Go):[si,Bi]},Go.precision=function(Yi){return arguments.length?(Ro=+Yi,Ja=ci(Ta,On,90),Ba=Ji(Pr,ur,Ro),Gi=ci(ei,ya,90),No=Ji(rn,vn,Ro),Go):Ro},Go.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Rs(){return kl()()}function zo(ur,Pr){var vn=ur[0]*c,rn=ur[1]*c,On=Pr[0]*c,Ta=Pr[1]*c,ya=l(rn),ei=_(rn),si=l(Ta),Bi=_(Ta),Va=ya*l(vn),_i=ya*_(vn),Ja=si*l(On),Ba=si*_(On),Gi=2*y(m(I(Ta-rn)+ya*si*I(On-vn))),No=_(Gi),Ro=Gi?function(Go){var jo=_(Go*=Gi)/No,Yi=_(Gi-Go)/No,ki=Yi*Va+jo*Ja,ns=Yi*_i+jo*Ba,Fs=Yi*ei+jo*Bi;return[T(ns,ki)*f,T(Fs,m(ki*ki+ns*ns))*f]}:function(){return[vn*f,rn*f]};return Ro.distance=Gi,Ro}function Pl(ur){return ur}var Ys=S(),ll=S(),_u,Ki,ms,rs,ql={point:L,lineStart:L,lineEnd:L,polygonStart:function(){ql.lineStart=Vl,ql.lineEnd=cu},polygonEnd:function(){ql.lineStart=ql.lineEnd=ql.point=L,Ys.add(p(ll)),ll.reset()},result:function(){var ur=Ys/2;return Ys.reset(),ur}};function Vl(){ql.point=Po}function Po(ur,Pr){ql.point=ou,_u=ms=ur,Ki=rs=Pr}function ou(ur,Pr){ll.add(rs*ur-ms*Pr),ms=ur,rs=Pr}function cu(){ou(_u,Ki)}var zs=1/0,xl=zs,Ol=-zs,Nl=Ol,Vu={point:sf,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var ur=[[zs,xl],[Ol,Nl]];return Ol=Nl=-(xl=zs=1/0),ur}};function sf(ur,Pr){urOl&&(Ol=ur),PrNl&&(Nl=Pr)}var jc=0,$c=0,Ch=0,gh=0,bl=0,Cc=0,Lh=0,tc=0,Hu=0,rc,Jc,Zl,Gu,qs={point:Rl,lineStart:xf,lineEnd:su,polygonStart:function(){qs.lineStart=xv,qs.lineEnd=Os},polygonEnd:function(){qs.point=Rl,qs.lineStart=xf,qs.lineEnd=su},result:function(){var ur=Hu?[Lh/Hu,tc/Hu]:Cc?[gh/Cc,bl/Cc]:Ch?[jc/Ch,$c/Ch]:[NaN,NaN];return jc=$c=Ch=gh=bl=Cc=Lh=tc=Hu=0,ur}};function Rl(ur,Pr){jc+=ur,$c+=Pr,++Ch}function xf(){qs.point=gc}function gc(ur,Pr){qs.point=Rf,Rl(Zl=ur,Gu=Pr)}function Rf(ur,Pr){var vn=ur-Zl,rn=Pr-Gu,On=m(vn*vn+rn*rn);gh+=On*(Zl+ur)/2,bl+=On*(Gu+Pr)/2,Cc+=On,Rl(Zl=ur,Gu=Pr)}function su(){qs.point=Rl}function xv(){qs.point=Fv}function Os(){vl(rc,Jc)}function Fv(ur,Pr){qs.point=vl,Rl(rc=Zl=ur,Jc=Gu=Pr)}function vl(ur,Pr){var vn=ur-Zl,rn=Pr-Gu,On=m(vn*vn+rn*rn);gh+=On*(Zl+ur)/2,bl+=On*(Gu+Pr)/2,Cc+=On,On=Gu*ur-Zl*Pr,Lh+=On*(Zl+ur),tc+=On*(Gu+Pr),Hu+=On*3,Rl(Zl=ur,Gu=Pr)}function Do(ur){this._context=ur}Do.prototype={_radius:4.5,pointRadius:function(ur){return this._radius=ur,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(ur,Pr){switch(this._point){case 0:{this._context.moveTo(ur,Pr),this._point=1;break}case 1:{this._context.lineTo(ur,Pr);break}default:{this._context.moveTo(ur+this._radius,Pr),this._context.arc(ur,Pr,this._radius,0,s);break}}},result:L};var Wf=S(),Qc,Ru,Ph,If,ah,Xu={point:L,lineStart:function(){Xu.point=ov},lineEnd:function(){Qc&&Nh(Ru,Ph),Xu.point=L},polygonStart:function(){Qc=!0},polygonEnd:function(){Qc=null},result:function(){var ur=+Wf;return Wf.reset(),ur}};function ov(ur,Pr){Xu.point=Nh,Ru=If=ur,Ph=ah=Pr}function Nh(ur,Pr){If-=ur,ah-=Pr,Wf.add(m(If*If+ah*ah)),If=ur,ah=Pr}function ih(){this._string=[]}ih.prototype={_radius:4.5,_circle:Df(4.5),pointRadius:function(ur){return(ur=+ur)!==this._radius&&(this._radius=ur,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(ur,Pr){switch(this._point){case 0:{this._string.push("M",ur,",",Pr),this._point=1;break}case 1:{this._string.push("L",ur,",",Pr);break}default:{this._circle==null&&(this._circle=Df(this._radius)),this._string.push("M",ur,",",Pr,this._circle);break}}},result:function(){if(this._string.length){var ur=this._string.join("");return this._string=[],ur}else return null}};function Df(ur){return"m0,"+ur+"a"+ur+","+ur+" 0 1,1 0,"+-2*ur+"a"+ur+","+ur+" 0 1,1 0,"+2*ur+"z"}function Rh(ur,Pr){var vn=4.5,rn,On;function Ta(ya){return ya&&(typeof vn=="function"&&On.pointRadius(+vn.apply(this,arguments)),U(ya,rn(On))),On.result()}return Ta.area=function(ya){return U(ya,rn(ql)),ql.result()},Ta.measure=function(ya){return U(ya,rn(Xu)),Xu.result()},Ta.bounds=function(ya){return U(ya,rn(Vu)),Vu.result()},Ta.centroid=function(ya){return U(ya,rn(qs)),qs.result()},Ta.projection=function(ya){return arguments.length?(rn=ya==null?(ur=null,Pl):(ur=ya).stream,Ta):ur},Ta.context=function(ya){return arguments.length?(On=ya==null?(Pr=null,new ih):new Do(Pr=ya),typeof vn!="function"&&On.pointRadius(vn),Ta):Pr},Ta.pointRadius=function(ya){return arguments.length?(vn=typeof ya=="function"?ya:(On.pointRadius(+ya),+ya),Ta):vn},Ta.projection(ur).context(Pr)}function Ih(ur){return{stream:ef(ur)}}function ef(ur){return function(Pr){var vn=new Uh;for(var rn in ur)vn[rn]=ur[rn];return vn.stream=Pr,vn}}function Uh(){}Uh.prototype={constructor:Uh,point:function(ur,Pr){this.stream.point(ur,Pr)},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 bf(ur,Pr,vn){var rn=ur.clipExtent&&ur.clipExtent();return ur.scale(150).translate([0,0]),rn!=null&&ur.clipExtent(null),U(vn,ur.stream(Vu)),Pr(Vu.result()),rn!=null&&ur.clipExtent(rn),ur}function lf(ur,Pr,vn){return bf(ur,function(rn){var On=Pr[1][0]-Pr[0][0],Ta=Pr[1][1]-Pr[0][1],ya=Math.min(On/(rn[1][0]-rn[0][0]),Ta/(rn[1][1]-rn[0][1])),ei=+Pr[0][0]+(On-ya*(rn[1][0]+rn[0][0]))/2,si=+Pr[0][1]+(Ta-ya*(rn[1][1]+rn[0][1]))/2;ur.scale(150*ya).translate([ei,si])},vn)}function Yu(ur,Pr,vn){return lf(ur,[[0,0],Pr],vn)}function Vf(ur,Pr,vn){return bf(ur,function(rn){var On=+Pr,Ta=On/(rn[1][0]-rn[0][0]),ya=(On-Ta*(rn[1][0]+rn[0][0]))/2,ei=-Ta*rn[0][1];ur.scale(150*Ta).translate([ya,ei])},vn)}function Dh(ur,Pr,vn){return bf(ur,function(rn){var On=+Pr,Ta=On/(rn[1][1]-rn[0][1]),ya=-Ta*rn[0][0],ei=(On-Ta*(rn[1][1]+rn[0][1]))/2;ur.scale(150*Ta).translate([ya,ei])},vn)}var Fl=16,yh=l(30*c);function bv(ur,Pr){return+Pr?oh(ur,Pr):jh(ur)}function jh(ur){return ef({point:function(Pr,vn){Pr=ur(Pr,vn),this.stream.point(Pr[0],Pr[1])}})}function oh(ur,Pr){function vn(rn,On,Ta,ya,ei,si,Bi,Va,_i,Ja,Ba,Gi,No,Ro){var Go=Bi-rn,jo=Va-On,Yi=Go*Go+jo*jo;if(Yi>4*Pr&&No--){var ki=ya+Ja,ns=ei+Ba,Fs=si+Gi,wl=m(ki*ki+ns*ns+Fs*Fs),Hl=y(Fs/=wl),Sl=p(p(Fs)-1)Pr||p((Go*bu+jo*Ul)/Yi-.5)>.3||ya*Ja+ei*Ba+si*Gi2?po[2]%360*c:0,bu()):[ei*f,si*f,Bi*f]},el.angle=function(po){return arguments.length?(_i=po%360*c,bu()):_i*f},el.reflectX=function(po){return arguments.length?(Ja=po?-1:1,bu()):Ja<0},el.reflectY=function(po){return arguments.length?(Ba=po?-1:1,bu()):Ba<0},el.precision=function(po){return arguments.length?(Fs=bv(wl,ns=po*po),Ul()):m(ns)},el.fitExtent=function(po,gs){return lf(el,po,gs)},el.fitSize=function(po,gs){return Yu(el,po,gs)},el.fitWidth=function(po,gs){return Vf(el,po,gs)},el.fitHeight=function(po,gs){return Dh(el,po,gs)};function bu(){var po=gu(vn,0,0,Ja,Ba,_i).apply(null,Pr(Ta,ya)),gs=(_i?gu:Vh)(vn,rn-po[0],On-po[1],Ja,Ba,_i);return Va=Kn(ei,si,Bi),wl=pn(Pr,gs),Hl=pn(Va,wl),Fs=bv(wl,ns),Ul()}function Ul(){return Sl=Gl=null,el}return function(){return Pr=ur.apply(this,arguments),el.invert=Pr.invert&&Su,bu()}}function Wl(ur){var Pr=0,vn=n/3,rn=zf(ur),On=rn(Pr,vn);return On.parallels=function(Ta){return arguments.length?rn(Pr=Ta[0]*c,vn=Ta[1]*c):[Pr*f,vn*f]},On}function wf(ur){var Pr=l(ur);function vn(rn,On){return[rn*Pr,_(On)/Pr]}return vn.invert=function(rn,On){return[rn/Pr,y(On*Pr)]},vn}function hc(ur,Pr){var vn=_(ur),rn=(vn+_(Pr))/2;if(p(rn)=.12&&Ro<.234&&No>=-.425&&No<-.214?On:Ro>=.166&&Ro<.234&&No>=-.214&&No<-.115?ya:vn).invert(Ja)},Va.stream=function(Ja){return ur&&Pr===Ja?ur:ur=Kf([vn.stream(Pr=Ja),On.stream(Ja),ya.stream(Ja)])},Va.precision=function(Ja){return arguments.length?(vn.precision(Ja),On.precision(Ja),ya.precision(Ja),_i()):vn.precision()},Va.scale=function(Ja){return arguments.length?(vn.scale(Ja),On.scale(Ja*.35),ya.scale(Ja),Va.translate(vn.translate())):vn.scale()},Va.translate=function(Ja){if(!arguments.length)return vn.translate();var Ba=vn.scale(),Gi=+Ja[0],No=+Ja[1];return rn=vn.translate(Ja).clipExtent([[Gi-.455*Ba,No-.238*Ba],[Gi+.455*Ba,No+.238*Ba]]).stream(Bi),Ta=On.translate([Gi-.307*Ba,No+.201*Ba]).clipExtent([[Gi-.425*Ba+r,No+.12*Ba+r],[Gi-.214*Ba-r,No+.234*Ba-r]]).stream(Bi),ei=ya.translate([Gi-.205*Ba,No+.212*Ba]).clipExtent([[Gi-.214*Ba+r,No+.166*Ba+r],[Gi-.115*Ba-r,No+.234*Ba-r]]).stream(Bi),_i()},Va.fitExtent=function(Ja,Ba){return lf(Va,Ja,Ba)},Va.fitSize=function(Ja,Ba){return Yu(Va,Ja,Ba)},Va.fitWidth=function(Ja,Ba){return Vf(Va,Ja,Ba)},Va.fitHeight=function(Ja,Ba){return Dh(Va,Ja,Ba)};function _i(){return ur=Pr=null,Va}return Va.scale(1070)}function Of(ur){return function(Pr,vn){var rn=l(Pr),On=l(vn),Ta=ur(rn*On);return[Ta*On*_(Pr),Ta*_(vn)]}}function _h(ur){return function(Pr,vn){var rn=m(Pr*Pr+vn*vn),On=ur(rn),Ta=_(On),ya=l(On);return[T(Pr*Ta,rn*ya),y(rn&&vn*Ta/rn)]}}var wv=Of(function(ur){return m(2/(1+ur))});wv.invert=_h(function(ur){return 2*y(ur/2)});function Yv(){return Pc(wv).scale(124.75).clipAngle(180-.001)}var $f=Of(function(ur){return(ur=v(ur))&&ur/_(ur)});$f.invert=_h(function(ur){return ur});function xh(){return Pc($f).scale(79.4188).clipAngle(180-.001)}function qc(ur,Pr){return[ur,A(u((i+Pr)/2))]}qc.invert=function(ur,Pr){return[ur,2*d(x(Pr))-i]};function bh(){return nc(qc).scale(961/s)}function nc(ur){var Pr=Pc(ur),vn=Pr.center,rn=Pr.scale,On=Pr.translate,Ta=Pr.clipExtent,ya=null,ei,si,Bi;Pr.scale=function(_i){return arguments.length?(rn(_i),Va()):rn()},Pr.translate=function(_i){return arguments.length?(On(_i),Va()):On()},Pr.center=function(_i){return arguments.length?(vn(_i),Va()):vn()},Pr.clipExtent=function(_i){return arguments.length?(_i==null?ya=ei=si=Bi=null:(ya=+_i[0][0],ei=+_i[0][1],si=+_i[1][0],Bi=+_i[1][1]),Va()):ya==null?null:[[ya,ei],[si,Bi]]};function Va(){var _i=n*rn(),Ja=Pr(ka(Pr.rotate()).invert([0,0]));return Ta(ya==null?[[Ja[0]-_i,Ja[1]-_i],[Ja[0]+_i,Ja[1]+_i]]:ur===qc?[[Math.max(Ja[0]-_i,ya),ei],[Math.min(Ja[0]+_i,si),Bi]]:[[ya,Math.max(Ja[1]-_i,ei)],[si,Math.min(Ja[1]+_i,Bi)]])}return Va()}function Jf(ur){return u((i+ur)/2)}function Hh(ur,Pr){var vn=l(ur),rn=ur===Pr?_(ur):A(vn/l(Pr))/A(Jf(Pr)/Jf(ur)),On=vn*M(Jf(ur),rn)/rn;if(!rn)return qc;function Ta(ya,ei){On>0?ei<-i+r&&(ei=-i+r):ei>i-r&&(ei=i-r);var si=On/M(Jf(ei),rn);return[si*_(rn*ya),On-si*l(rn*ya)]}return Ta.invert=function(ya,ei){var si=On-ei,Bi=w(rn)*m(ya*ya+si*si),Va=T(ya,p(si))*w(si);return si*rn<0&&(Va-=n*w(ya)*w(si)),[Va/rn,2*d(M(On/Bi,1/rn))-i]},Ta}function Qf(){return Wl(Hh).scale(109.5).parallels([30,30])}function Ql(ur,Pr){return[ur,Pr]}Ql.invert=Ql;function Ic(){return Pc(Ql).scale(152.63)}function tf(ur,Pr){var vn=l(ur),rn=ur===Pr?_(ur):(vn-l(Pr))/(Pr-ur),On=vn/rn+ur;if(p(rn)r&&--rn>0);return[ur/(.8707+(Ta=vn*vn)*(-.131979+Ta*(-.013791+Ta*Ta*Ta*(.003971-.001529*Ta)))),vn]};function ff(){return Pc(Tf).scale(175.295)}function xu(ur,Pr){return[l(Pr)*_(ur),_(Pr)]}xu.invert=_h(y);function yc(){return Pc(xu).scale(249.5).clipAngle(90+r)}function fu(ur,Pr){var vn=l(Pr),rn=1+l(ur)*vn;return[vn*_(ur)/rn,_(Pr)/rn]}fu.invert=_h(function(ur){return 2*d(ur)});function Bf(){return Pc(fu).scale(250).clipAngle(142)}function hf(ur,Pr){return[A(u((i+Pr)/2)),-ur]}hf.invert=function(ur,Pr){return[-Pr,2*d(x(ur))-i]};function Oh(){var ur=nc(hf),Pr=ur.center,vn=ur.rotate;return ur.center=function(rn){return arguments.length?Pr([-rn[1],rn[0]]):(rn=Pr(),[rn[1],-rn[0]])},ur.rotate=function(rn){return arguments.length?vn([rn[0],rn[1],rn.length>2?rn[2]+90:90]):(rn=vn(),[rn[0],rn[1],rn[2]-90])},vn([0,0,90]).scale(159.155)}h.geoAlbers=lu,h.geoAlbersUsa=uf,h.geoArea=H,h.geoAzimuthalEqualArea=Yv,h.geoAzimuthalEqualAreaRaw=wv,h.geoAzimuthalEquidistant=xh,h.geoAzimuthalEquidistantRaw=$f,h.geoBounds=je,h.geoCentroid=Vr,h.geoCircle=Ti,h.geoClipAntimeridian=Dr,h.geoClipCircle=Un,h.geoClipExtent=Ei,h.geoClipRectangle=Ma,h.geoConicConformal=Qf,h.geoConicConformalRaw=Hh,h.geoConicEqualArea=Rc,h.geoConicEqualAreaRaw=hc,h.geoConicEquidistant=zh,h.geoConicEquidistantRaw=tf,h.geoContains=Es,h.geoDistance=js,h.geoEqualEarth=Tv,h.geoEqualEarthRaw=uh,h.geoEquirectangular=Ic,h.geoEquirectangularRaw=Ql,h.geoGnomonic=Gh,h.geoGnomonicRaw=oc,h.geoGraticule=kl,h.geoGraticule10=Rs,h.geoIdentity=Hc,h.geoInterpolate=zo,h.geoLength=Jo,h.geoMercator=bh,h.geoMercatorRaw=qc,h.geoNaturalEarth1=ff,h.geoNaturalEarth1Raw=Tf,h.geoOrthographic=yc,h.geoOrthographicRaw=xu,h.geoPath=Rh,h.geoProjection=Pc,h.geoProjectionMutator=zf,h.geoRotation=ka,h.geoStereographic=Bf,h.geoStereographicRaw=fu,h.geoStream=U,h.geoTransform=Ih,h.geoTransverseMercator=Oh,h.geoTransverseMercatorRaw=hf,Object.defineProperty(h,"__esModule",{value:!0})})}}),rR=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,$k(),YA()):b(h.d3=h.d3||{},h.d3,h.d3)})($,function(h,b,S){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,n=Math.floor,i=Math.log,a=Math.max,s=Math.min,f=Math.pow,c=Math.round,p=Math.sign||function(Ze){return Ze>0?1:Ze<0?-1:0},d=Math.sin,T=Math.tan,l=1e-6,g=1e-12,x=Math.PI,A=x/2,M=x/4,_=Math.SQRT1_2,w=F(2),m=F(x),u=x*2,v=180/x,y=x/180;function I(Ze){return Ze?Ze/Math.sin(Ze):1}function L(Ze){return Ze>1?A:Ze<-1?-A:Math.asin(Ze)}function z(Ze){return Ze>1?0:Ze<-1?x:Math.acos(Ze)}function F(Ze){return Ze>0?Math.sqrt(Ze):0}function N(Ze){return Ze=o(2*Ze),(Ze-1)/(Ze+1)}function B(Ze){return(o(Ze)-o(-Ze))/2}function R(Ze){return(o(Ze)+o(-Ze))/2}function U(Ze){return i(Ze+F(Ze*Ze+1))}function j(Ze){return i(Ze+F(Ze*Ze-1))}function Z(Ze){var et=T(Ze/2),ft=2*i(r(Ze/2))/(et*et);function _t(zt,Et){var Ut=r(zt),mr=r(Et),wr=d(Et),Lr=mr*Ut,Gr=-((1-Lr?i((1+Lr)/2)/(1-Lr):-.5)+ft/(1+Lr));return[Gr*mr*d(zt),Gr*wr]}return _t.invert=function(zt,Et){var Ut=F(zt*zt+Et*Et),mr=-Ze/2,wr=50,Lr;if(!Ut)return[0,0];do{var Gr=mr/2,an=r(Gr),Mn=d(Gr),Ln=Mn/an,Gn=-i(E(an));mr-=Lr=(2/Ln*Gn-ft*Ln-Ut)/(-Gn/(Mn*Mn)+1-ft/(2*an*an))*(an<0?.7:1)}while(E(Lr)>l&&--wr>0);var ba=d(mr);return[t(zt*ba,Ut*r(mr)),L(Et*ba/Ut)]},_t}function re(){var Ze=A,et=b.geoProjectionMutator(Z),ft=et(Ze);return ft.radius=function(_t){return arguments.length?et(Ze=_t*y):Ze*v},ft.scale(179.976).clipAngle(147)}function fe(Ze,et){var ft=r(et),_t=I(z(ft*r(Ze/=2)));return[2*ft*d(Ze)*_t,d(et)*_t]}fe.invert=function(Ze,et){if(!(Ze*Ze+4*et*et>x*x+l)){var ft=Ze,_t=et,zt=25;do{var Et=d(ft),Ut=d(ft/2),mr=r(ft/2),wr=d(_t),Lr=r(_t),Gr=d(2*_t),an=wr*wr,Mn=Lr*Lr,Ln=Ut*Ut,Gn=1-Mn*mr*mr,ba=Gn?z(Lr*mr)*F(ti=1/Gn):ti=0,ti,Za=2*ba*Lr*Ut-Ze,ri=ba*wr-et,Zi=ti*(Mn*Ln+ba*Lr*mr*an),yo=ti*(.5*Et*Gr-ba*2*wr*Ut),co=ti*.25*(Gr*Ut-ba*wr*Mn*Et),Wo=ti*(an*mr+ba*Ln*Lr),Ks=yo*co-Wo*Zi;if(!Ks)break;var $s=(ri*yo-Za*Wo)/Ks,ks=(Za*co-ri*Zi)/Ks;ft-=$s,_t-=ks}while((E($s)>l||E(ks)>l)&&--zt>0);return[ft,_t]}};function le(){return b.geoProjection(fe).scale(152.63)}function ce(Ze){var et=d(Ze),ft=r(Ze),_t=Ze>=0?1:-1,zt=T(_t*Ze),Et=(1+et-ft)/2;function Ut(mr,wr){var Lr=r(wr),Gr=r(mr/=2);return[(1+Lr)*d(mr),(_t*wr>-t(Gr,zt)-.001?0:-_t*10)+Et+d(wr)*ft-(1+Lr)*et*Gr]}return Ut.invert=function(mr,wr){var Lr=0,Gr=0,an=50;do{var Mn=r(Lr),Ln=d(Lr),Gn=r(Gr),ba=d(Gr),ti=1+Gn,Za=ti*Ln-mr,ri=Et+ba*ft-ti*et*Mn-wr,Zi=ti*Mn/2,yo=-Ln*ba,co=et*ti*Ln/2,Wo=ft*Gn+et*Mn*ba,Ks=yo*co-Wo*Zi,$s=(ri*yo-Za*Wo)/Ks/2,ks=(Za*co-ri*Zi)/Ks;E(ks)>2&&(ks/=2),Lr-=$s,Gr-=ks}while((E($s)>l||E(ks)>l)&&--an>0);return _t*Gr>-t(r(Lr),zt)-.001?[Lr*2,Gr]:null},Ut}function V(){var Ze=20*y,et=Ze>=0?1:-1,ft=T(et*Ze),_t=b.geoProjectionMutator(ce),zt=_t(Ze),Et=zt.stream;return zt.parallel=function(Ut){return arguments.length?(ft=T((et=(Ze=Ut*y)>=0?1:-1)*Ze),_t(Ze)):Ze*v},zt.stream=function(Ut){var mr=zt.rotate(),wr=Et(Ut),Lr=(zt.rotate([0,0]),Et(Ut)),Gr=zt.precision();return zt.rotate(mr),wr.sphere=function(){Lr.polygonStart(),Lr.lineStart();for(var an=et*-180;et*an<180;an+=et*90)Lr.point(an,et*90);if(Ze)for(;et*(an-=3*et*Gr)>=-180;)Lr.point(an,et*-t(r(an*y/2),ft)*v);Lr.lineEnd(),Lr.polygonEnd()},wr},zt.scale(218.695).center([0,28.0974])}function ee(Ze,et){var ft=T(et/2),_t=F(1-ft*ft),zt=1+_t*r(Ze/=2),Et=d(Ze)*_t/zt,Ut=ft/zt,mr=Et*Et,wr=Ut*Ut;return[4/3*Et*(3+mr-3*wr),4/3*Ut*(3+3*mr-wr)]}ee.invert=function(Ze,et){if(Ze*=3/8,et*=3/8,!Ze&&E(et)>1)return null;var ft=Ze*Ze,_t=et*et,zt=1+ft+_t,Et=F((zt-F(zt*zt-4*et*et))/2),Ut=L(Et)/3,mr=Et?j(E(et/Et))/3:U(E(Ze))/3,wr=r(Ut),Lr=R(mr),Gr=Lr*Lr-wr*wr;return[p(Ze)*2*t(B(mr)*wr,.25-Gr),p(et)*2*t(Lr*d(Ut),.25+Gr)]};function ne(){return b.geoProjection(ee).scale(66.1603)}var K=F(8),ue=i(1+w);function te(Ze,et){var ft=E(et);return ftg&&--_t>0);return[Ze/(r(ft)*(K-1/d(ft))),p(et)*ft]};function H(){return b.geoProjection(te).scale(112.314)}function ae(Ze){var et=2*x/Ze;function ft(_t,zt){var Et=b.geoAzimuthalEquidistantRaw(_t,zt);if(E(_t)>A){var Ut=t(Et[1],Et[0]),mr=F(Et[0]*Et[0]+Et[1]*Et[1]),wr=et*c((Ut-A)/et)+A,Lr=t(d(Ut-=wr),2-r(Ut));Ut=wr+L(x/mr*d(Lr))-Lr,Et[0]=mr*r(Ut),Et[1]=mr*d(Ut)}return Et}return ft.invert=function(_t,zt){var Et=F(_t*_t+zt*zt);if(Et>A){var Ut=t(zt,_t),mr=et*c((Ut-A)/et)+A,wr=Ut>mr?-1:1,Lr=Et*r(mr-Ut),Gr=1/T(wr*z((Lr-x)/F(x*(x-2*Lr)+Et*Et)));Ut=mr+2*e((Gr+wr*F(Gr*Gr-3))/3),_t=Et*r(Ut),zt=Et*d(Ut)}return b.geoAzimuthalEquidistantRaw.invert(_t,zt)},ft}function ie(){var Ze=5,et=b.geoProjectionMutator(ae),ft=et(Ze),_t=ft.stream,zt=.01,Et=-r(zt*y),Ut=d(zt*y);return ft.lobes=function(mr){return arguments.length?et(Ze=+mr):Ze},ft.stream=function(mr){var wr=ft.rotate(),Lr=_t(mr),Gr=(ft.rotate([0,0]),_t(mr));return ft.rotate(wr),Lr.sphere=function(){Gr.polygonStart(),Gr.lineStart();for(var an=0,Mn=360/Ze,Ln=2*x/Ze,Gn=90-180/Ze,ba=A;an0&&E(zt)>l);return _t<0?NaN:ft}function ze(Ze,et,ft){return et===void 0&&(et=40),ft===void 0&&(ft=g),function(_t,zt,Et,Ut){var mr,wr,Lr;Et=Et===void 0?0:+Et,Ut=Ut===void 0?0:+Ut;for(var Gr=0;Grmr){Et-=wr/=2,Ut-=Lr/=2;continue}mr=Gn;var ba=(Et>0?-1:1)*ft,ti=(Ut>0?-1:1)*ft,Za=Ze(Et+ba,Ut),ri=Ze(Et,Ut+ti),Zi=(Za[0]-an[0])/ba,yo=(Za[1]-an[1])/ba,co=(ri[0]-an[0])/ti,Wo=(ri[1]-an[1])/ti,Ks=Wo*Zi-yo*co,$s=(E(Ks)<.5?.5:1)/Ks;if(wr=(Ln*co-Mn*Wo)*$s,Lr=(Mn*yo-Ln*Zi)*$s,Et+=wr,Ut+=Lr,E(wr)0&&(mr[1]*=1+wr/1.5*mr[0]*mr[0]),mr}return _t.invert=ze(_t),_t}function it(){return b.geoProjection(Ye()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function st(Ze,et){var ft=Ze*d(et),_t=30,zt;do et-=zt=(et+d(et)-ft)/(1+r(et));while(E(zt)>l&&--_t>0);return et/2}function nt(Ze,et,ft){function _t(zt,Et){return[Ze*zt*r(Et=st(ft,Et)),et*d(Et)]}return _t.invert=function(zt,Et){return Et=L(Et/et),[zt/(Ze*r(Et)),L((2*Et+d(2*Et))/ft)]},_t}var Qe=nt(w/A,w,x);function Le(){return b.geoProjection(Qe).scale(169.529)}var Te=2.00276,pe=1.11072;function Ne(Ze,et){var ft=st(x,et);return[Te*Ze/(1/r(et)+pe/r(ft)),(et+w*d(ft))/Te]}Ne.invert=function(Ze,et){var ft=Te*et,_t=et<0?-M:M,zt=25,Et,Ut;do Ut=ft-w*d(_t),_t-=Et=(d(2*_t)+2*_t-x*d(Ut))/(2*r(2*_t)+2+x*r(Ut)*w*r(_t));while(E(Et)>l&&--zt>0);return Ut=ft-w*d(_t),[Ze*(1/r(Ut)+pe/r(_t))/Te,Ut]};function ot(){return b.geoProjection(Ne).scale(160.857)}function ct(Ze){var et=0,ft=b.geoProjectionMutator(Ze),_t=ft(et);return _t.parallel=function(zt){return arguments.length?ft(et=zt*y):et*v},_t}function rt(Ze,et){return[Ze*r(et),et]}rt.invert=function(Ze,et){return[Ze/r(et),et]};function Ft(){return b.geoProjection(rt).scale(152.63)}function Nt(Ze){if(!Ze)return rt;var et=1/T(Ze);function ft(_t,zt){var Et=et+Ze-zt,Ut=Et&&_t*r(zt)/Et;return[Et*d(Ut),et-Et*r(Ut)]}return ft.invert=function(_t,zt){var Et=F(_t*_t+(zt=et-zt)*zt),Ut=et+Ze-Et;return[Et/r(Ut)*t(_t,zt),Ut]},ft}function $t(){return ct(Nt).scale(123.082).center([0,26.1441]).parallel(45)}function rr(Ze){function et(ft,_t){var zt=A-_t,Et=zt&&ft*Ze*d(zt)/zt;return[zt*d(Et)/Ze,A-zt*r(Et)]}return et.invert=function(ft,_t){var zt=ft*Ze,Et=A-_t,Ut=F(zt*zt+Et*Et),mr=t(zt,Et);return[(Ut?Ut/d(Ut):1)*mr/Ze,A-Ut]},et}function Mr(){var Ze=.5,et=b.geoProjectionMutator(rr),ft=et(Ze);return ft.fraction=function(_t){return arguments.length?et(Ze=+_t):Ze},ft.scale(158.837)}var Sr=nt(1,4/x,x);function Zr(){return b.geoProjection(Sr).scale(152.63)}function Ar(Ze,et,ft,_t,zt,Et){var Ut=r(Et),mr;if(E(Ze)>1||E(Et)>1)mr=z(ft*zt+et*_t*Ut);else{var wr=d(Ze/2),Lr=d(Et/2);mr=2*L(F(wr*wr+et*_t*Lr*Lr))}return E(mr)>l?[mr,t(_t*d(Et),et*zt-ft*_t*Ut)]:[0,0]}function Br(Ze,et,ft){return z((Ze*Ze+et*et-ft*ft)/(2*Ze*et))}function Mt(Ze){return Ze-2*x*n((Ze+x)/(2*x))}function je(Ze,et,ft){for(var _t=[[Ze[0],Ze[1],d(Ze[1]),r(Ze[1])],[et[0],et[1],d(et[1]),r(et[1])],[ft[0],ft[1],d(ft[1]),r(ft[1])]],zt=_t[2],Et,Ut=0;Ut<3;++Ut,zt=Et)Et=_t[Ut],zt.v=Ar(Et[1]-zt[1],zt[3],zt[2],Et[3],Et[2],Et[0]-zt[0]),zt.point=[0,0];var mr=Br(_t[0].v[0],_t[2].v[0],_t[1].v[0]),wr=Br(_t[0].v[0],_t[1].v[0],_t[2].v[0]),Lr=x-mr;_t[2].point[1]=0,_t[0].point[0]=-(_t[1].point[0]=_t[0].v[0]/2);var Gr=[_t[2].point[0]=_t[0].point[0]+_t[2].v[0]*r(mr),2*(_t[0].point[1]=_t[1].point[1]=_t[2].v[0]*d(mr))];function an(Mn,Ln){var Gn=d(Ln),ba=r(Ln),ti=new Array(3),Za;for(Za=0;Za<3;++Za){var ri=_t[Za];if(ti[Za]=Ar(Ln-ri[1],ri[3],ri[2],ba,Gn,Mn-ri[0]),!ti[Za][0])return ri.point;ti[Za][1]=Mt(ti[Za][1]-ri.v[1])}var Zi=Gr.slice();for(Za=0;Za<3;++Za){var yo=Za==2?0:Za+1,co=Br(_t[Za].v[0],ti[Za][0],ti[yo][0]);ti[Za][1]<0&&(co=-co),Za?Za==1?(co=wr-co,Zi[0]-=ti[Za][0]*r(co),Zi[1]-=ti[Za][0]*d(co)):(co=Lr-co,Zi[0]+=ti[Za][0]*r(co),Zi[1]+=ti[Za][0]*d(co)):(Zi[0]+=ti[Za][0]*r(co),Zi[1]-=ti[Za][0]*d(co))}return Zi[0]/=3,Zi[1]/=3,Zi}return an}function $e(Ze){return Ze[0]*=y,Ze[1]*=y,Ze}function Ee(){return xe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function xe(Ze,et,ft){var _t=b.geoCentroid({type:"MultiPoint",coordinates:[Ze,et,ft]}),zt=[-_t[0],-_t[1]],Et=b.geoRotation(zt),Ut=je($e(Et(Ze)),$e(Et(et)),$e(Et(ft)));Ut.invert=ze(Ut);var mr=b.geoProjection(Ut).rotate(zt),wr=mr.center;return delete mr.rotate,mr.center=function(Lr){return arguments.length?wr(Et(Lr)):Et.invert(wr())},mr.clipAngle(90)}function ye(Ze,et){var ft=F(1-d(et));return[2/m*Ze*ft,m*(1-ft)]}ye.invert=function(Ze,et){var ft=(ft=et/m-1)*ft;return[ft>0?Ze*F(x/ft)/2:0,L(1-ft)]};function Me(){return b.geoProjection(ye).scale(95.6464).center([0,30])}function Xe(Ze){var et=T(Ze);function ft(_t,zt){return[_t,(_t?_t/d(_t):1)*(d(zt)*r(_t)-et*r(zt))]}return ft.invert=et?function(_t,zt){_t&&(zt*=d(_t)/_t);var Et=r(_t);return[_t,2*t(F(Et*Et+et*et-zt*zt)-Et,et-zt)]}:function(_t,zt){return[_t,L(_t?zt*T(_t)/_t:zt)]},ft}function Je(){return ct(Xe).scale(249.828).clipAngle(90)}var Lt=F(3);function Ct(Ze,et){return[Lt*Ze*(2*r(2*et/3)-1)/m,Lt*m*d(et/3)]}Ct.invert=function(Ze,et){var ft=3*L(et/(Lt*m));return[m*Ze/(Lt*(2*r(2*ft/3)-1)),ft]};function Ot(){return b.geoProjection(Ct).scale(156.19)}function Wt(Ze){var et=r(Ze);function ft(_t,zt){return[_t*et,d(zt)/et]}return ft.invert=function(_t,zt){return[_t/et,L(zt*et)]},ft}function _r(){return ct(Wt).parallel(38.58).scale(195.044)}function pr(Ze){var et=r(Ze);function ft(_t,zt){return[_t*et,(1+et)*T(zt/2)]}return ft.invert=function(_t,zt){return[_t/et,e(zt/(1+et))*2]},ft}function hr(){return ct(pr).scale(124.75)}function Fr(Ze,et){var ft=F(8/(3*x));return[ft*Ze*(1-E(et)/x),ft*et]}Fr.invert=function(Ze,et){var ft=F(8/(3*x)),_t=et/ft;return[Ze/(ft*(1-E(_t)/x)),_t]};function En(){return b.geoProjection(Fr).scale(165.664)}function Zn(Ze,et){var ft=F(4-3*d(E(et)));return[2/F(6*x)*Ze*ft,p(et)*F(2*x/3)*(2-ft)]}Zn.invert=function(Ze,et){var ft=2-E(et)/F(2*x/3);return[Ze*F(6*x)/(2*ft),p(et)*L((4-ft*ft)/3)]};function qn(){return b.geoProjection(Zn).scale(165.664)}function ta(Ze,et){var ft=F(x*(4+x));return[2/ft*Ze*(1+F(1-4*et*et/(x*x))),4/ft*et]}ta.invert=function(Ze,et){var ft=F(x*(4+x))/2;return[Ze*ft/(1+F(1-et*et*(4+x)/(4*x))),et*ft/2]};function ra(){return b.geoProjection(ta).scale(180.739)}function Nn(Ze,et){var ft=(2+A)*d(et);et/=2;for(var _t=0,zt=1/0;_t<10&&E(zt)>l;_t++){var Et=r(et);et-=zt=(et+d(et)*(Et+2)-ft)/(2*Et*(1+Et))}return[2/F(x*(4+x))*Ze*(1+r(et)),2*F(x/(4+x))*d(et)]}Nn.invert=function(Ze,et){var ft=et*F((4+x)/x)/2,_t=L(ft),zt=r(_t);return[Ze/(2/F(x*(4+x))*(1+zt)),L((_t+ft*(zt+2))/(2+A))]};function Ea(){return b.geoProjection(Nn).scale(180.739)}function ja(Ze,et){return[Ze*(1+r(et))/F(2+x),2*et/F(2+x)]}ja.invert=function(Ze,et){var ft=F(2+x),_t=et*ft/2;return[ft*Ze/(1+r(_t)),_t]};function ir(){return b.geoProjection(ja).scale(173.044)}function qt(Ze,et){for(var ft=(1+A)*d(et),_t=0,zt=1/0;_t<10&&E(zt)>l;_t++)et-=zt=(et+d(et)-ft)/(1+r(et));return ft=F(2+x),[Ze*(1+r(et))/ft,2*et/ft]}qt.invert=function(Ze,et){var ft=1+A,_t=F(ft/2);return[Ze*2*_t/(1+r(et*=_t)),L((et+d(et))/ft)]};function ar(){return b.geoProjection(qt).scale(173.044)}var sr=3+2*w;function Vr(Ze,et){var ft=d(Ze/=2),_t=r(Ze),zt=F(r(et)),Et=r(et/=2),Ut=d(et)/(Et+w*_t*zt),mr=F(2/(1+Ut*Ut)),wr=F((w*Et+(_t+ft)*zt)/(w*Et+(_t-ft)*zt));return[sr*(mr*(wr-1/wr)-2*i(wr)),sr*(mr*Ut*(wr+1/wr)-2*e(Ut))]}Vr.invert=function(Ze,et){if(!(Et=ee.invert(Ze/1.2,et*1.065)))return null;var ft=Et[0],_t=Et[1],zt=20,Et;Ze/=sr,et/=sr;do{var Ut=ft/2,mr=_t/2,wr=d(Ut),Lr=r(Ut),Gr=d(mr),an=r(mr),Mn=r(_t),Ln=F(Mn),Gn=Gr/(an+w*Lr*Ln),ba=Gn*Gn,ti=F(2/(1+ba)),Za=w*an+(Lr+wr)*Ln,ri=w*an+(Lr-wr)*Ln,Zi=Za/ri,yo=F(Zi),co=yo-1/yo,Wo=yo+1/yo,Ks=ti*co-2*i(yo)-Ze,$s=ti*Gn*Wo-2*e(Gn)-et,ks=Gr&&_*Ln*wr*ba/Gr,nl=(w*Lr*an+Ln)/(2*(an+w*Lr*Ln)*(an+w*Lr*Ln)*Ln),hu=-.5*Gn*ti*ti*ti,eu=hu*ks,Cs=hu*nl,Ls=(Ls=2*an+w*Ln*(Lr-wr))*Ls*yo,ku=(w*Lr*an*Ln+Mn)/Ls,ac=-(w*wr*Gr)/(Ln*Ls),zc=co*eu-2*ku/yo+ti*(ku+ku/Zi),ge=co*Cs-2*ac/yo+ti*(ac+ac/Zi),Oe=Gn*Wo*eu-2*ks/(1+ba)+ti*Wo*ks+ti*Gn*(ku-ku/Zi),tt=Gn*Wo*Cs-2*nl/(1+ba)+ti*Wo*nl+ti*Gn*(ac-ac/Zi),xt=ge*Oe-tt*zc;if(!xt)break;var At=($s*ge-Ks*tt)/xt,It=(Ks*Oe-$s*zc)/xt;ft-=At,_t=a(-A,s(A,_t-It))}while((E(At)>l||E(It)>l)&&--zt>0);return E(E(_t)-A)_t){var an=F(Gr),Mn=t(Lr,wr),Ln=ft*c(Mn/ft),Gn=Mn-Ln,ba=Ze*r(Gn),ti=(Ze*d(Gn)-Gn*d(ba))/(A-ba),Za=yt(Gn,ti),ri=(x-Ze)/Er(Za,ba,x);wr=an;var Zi=50,yo;do wr-=yo=(Ze+Er(Za,ba,wr)*ri-an)/(Za(wr)*ri);while(E(yo)>l&&--Zi>0);Lr=Gn*d(wr),wr_t){var wr=F(mr),Lr=t(Ut,Et),Gr=ft*c(Lr/ft),an=Lr-Gr;Et=wr*r(an),Ut=wr*d(an);for(var Mn=Et-A,Ln=d(Et),Gn=Ut/Ln,ba=Etl||E(Gn)>l)&&--ba>0);return[an,Mn]},wr}var Ir=jr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Ur(){return b.geoProjection(Ir).scale(149.995)}var sn=jr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Kr(){return b.geoProjection(sn).scale(153.93)}var Tt=jr(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function or(){return b.geoProjection(Tt).scale(130.945)}function Dr(Ze,et){var ft=Ze*Ze,_t=et*et;return[Ze*(1-.162388*_t)*(.87-952426e-9*ft*ft),et*(1+_t/12)]}Dr.invert=function(Ze,et){var ft=Ze,_t=et,zt=50,Et;do{var Ut=_t*_t;_t-=Et=(_t*(1+Ut/12)-et)/(1+Ut/4)}while(E(Et)>l&&--zt>0);zt=50,Ze/=1-.162388*Ut;do{var mr=(mr=ft*ft)*mr;ft-=Et=(ft*(.87-952426e-9*mr)-Ze)/(.87-.00476213*mr)}while(E(Et)>l&&--zt>0);return[ft,_t]};function ln(){return b.geoProjection(Dr).scale(131.747)}var Pn=jr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function jn(){return b.geoProjection(Pn).scale(131.087)}function Un(Ze){var et=Ze(A,0)[0]-Ze(-A,0)[0];function ft(_t,zt){var Et=_t>0?-.5:.5,Ut=Ze(_t+Et*x,zt);return Ut[0]-=Et*et,Ut}return Ze.invert&&(ft.invert=function(_t,zt){var Et=_t>0?-.5:.5,Ut=Ze.invert(_t+Et*et,zt),mr=Ut[0]-Et*x;return mr<-x?mr+=2*x:mr>x&&(mr-=2*x),Ut[0]=mr,Ut}),ft}function un(Ze,et){var ft=p(Ze),_t=p(et),zt=r(et),Et=r(Ze)*zt,Ut=d(Ze)*zt,mr=d(_t*et);Ze=E(t(Ut,mr)),et=L(Et),E(Ze-A)>l&&(Ze%=A);var wr=Rn(Ze>x/4?A-Ze:Ze,et);return Ze>x/4&&(mr=wr[0],wr[0]=-wr[1],wr[1]=-mr),wr[0]*=ft,wr[1]*=-_t,wr}un.invert=function(Ze,et){E(Ze)>1&&(Ze=p(Ze)*2-Ze),E(et)>1&&(et=p(et)*2-et);var ft=p(Ze),_t=p(et),zt=-ft*Ze,Et=-_t*et,Ut=Et/zt<1,mr=di(Ut?Et:zt,Ut?zt:Et),wr=mr[0],Lr=mr[1],Gr=r(Lr);return Ut&&(wr=-A-wr),[ft*(t(d(wr)*Gr,-d(Lr))+x),_t*L(r(wr)*Gr)]};function Rn(Ze,et){if(et===A)return[0,0];var ft=d(et),_t=ft*ft,zt=_t*_t,Et=1+zt,Ut=1+3*zt,mr=1-zt,wr=L(1/F(Et)),Lr=mr+_t*Et*wr,Gr=(1-ft)/Lr,an=F(Gr),Mn=Gr*Et,Ln=F(Mn),Gn=an*mr,ba,ti;if(Ze===0)return[0,-(Gn+_t*Ln)];var Za=r(et),ri=1/Za,Zi=2*ft*Za,yo=(-3*_t+wr*Ut)*Zi,co=(-Lr*Za-(1-ft)*yo)/(Lr*Lr),Wo=.5*co/an,Ks=mr*Wo-2*_t*an*Zi,$s=_t*Et*co+Gr*Ut*Zi,ks=-ri*Zi,nl=-ri*$s,hu=-2*ri*Ks,eu=4*Ze/x,Cs;if(Ze>.222*x||et.175*x){if(ba=(Gn+_t*F(Mn*(1+zt)-Gn*Gn))/(1+zt),Ze>x/4)return[ba,ba];var Ls=ba,ku=.5*ba;ba=.5*(ku+Ls),ti=50;do{var ac=F(Mn-ba*ba),zc=ba*(hu+ks*ac)+nl*L(ba/Ln)-eu;if(!zc)break;zc<0?ku=ba:Ls=ba,ba=.5*(ku+Ls)}while(E(Ls-ku)>l&&--ti>0)}else{ba=l,ti=25;do{var ge=ba*ba,Oe=F(Mn-ge),tt=hu+ks*Oe,xt=ba*tt+nl*L(ba/Ln)-eu,At=tt+(nl-ks*ge)/Oe;ba-=Cs=Oe?xt/At:0}while(E(Cs)>l&&--ti>0)}return[ba,-Gn-_t*F(Mn-ba*ba)]}function di(Ze,et){for(var ft=0,_t=1,zt=.5,Et=50;;){var Ut=zt*zt,mr=F(zt),wr=L(1/F(1+Ut)),Lr=1-Ut+zt*(1+Ut)*wr,Gr=(1-mr)/Lr,an=F(Gr),Mn=Gr*(1+Ut),Ln=an*(1-Ut),Gn=Mn-Ze*Ze,ba=F(Gn),ti=et+Ln+zt*ba;if(E(_t-ft)0?ft=zt:_t=zt,zt=.5*(ft+_t)}if(!Et)return null;var Za=L(mr),ri=r(Za),Zi=1/ri,yo=2*mr*ri,co=(-3*zt+wr*(1+3*Ut))*yo,Wo=(-Lr*ri-(1-mr)*co)/(Lr*Lr),Ks=.5*Wo/an,$s=(1-Ut)*Ks-2*zt*an*yo,ks=-2*Zi*$s,nl=-Zi*yo,hu=-Zi*(zt*(1+Ut)*Wo+Gr*(1+3*Ut)*yo);return[x/4*(Ze*(ks+nl*ba)+hu*L(Ze/F(Mn))),Za]}function Ma(){return b.geoProjection(Un(un)).scale(239.75)}function Ei(Ze,et,ft){var _t,zt,Et;return Ze?(_t=Hi(Ze,ft),et?(zt=Hi(et,1-ft),Et=zt[1]*zt[1]+ft*_t[0]*_t[0]*zt[0]*zt[0],[[_t[0]*zt[2]/Et,_t[1]*_t[2]*zt[0]*zt[1]/Et],[_t[1]*zt[1]/Et,-_t[0]*_t[2]*zt[0]*zt[2]/Et],[_t[2]*zt[1]*zt[2]/Et,-ft*_t[0]*_t[1]*zt[0]/Et]]):[[_t[0],0],[_t[1],0],[_t[2],0]]):(zt=Hi(et,1-ft),[[0,zt[0]/zt[1]],[1/zt[1],0],[zt[2]/zt[1],0]])}function Hi(Ze,et){var ft,_t,zt,Et,Ut;if(et=1-l)return ft=(1-et)/4,_t=R(Ze),Et=N(Ze),zt=1/_t,Ut=_t*B(Ze),[Et+ft*(Ut-Ze)/(_t*_t),zt-ft*Et*zt*(Ut-Ze),zt+ft*Et*zt*(Ut+Ze),2*e(o(Ze))-A+ft*(Ut-Ze)/_t];var mr=[1,0,0,0,0,0,0,0,0],wr=[F(et),0,0,0,0,0,0,0,0],Lr=0;for(_t=F(1-et),Ut=1;E(wr[Lr]/mr[Lr])>l&&Lr<8;)ft=mr[Lr++],wr[Lr]=(ft-_t)/2,mr[Lr]=(ft+_t)/2,_t=F(ft*_t),Ut*=2;zt=Ut*mr[Lr]*Ze;do Et=wr[Lr]*d(_t=zt)/mr[Lr],zt=(L(Et)+zt)/2;while(--Lr);return[d(zt),Et=r(zt),Et/r(zt-_t),zt]}function io(Ze,et,ft){var _t=E(Ze),zt=E(et),Et=B(zt);if(_t){var Ut=1/d(_t),mr=1/(T(_t)*T(_t)),wr=-(mr+ft*(Et*Et*Ut*Ut)-1+ft),Lr=(ft-1)*mr,Gr=(-wr+F(wr*wr-4*Lr))/2;return[no(e(1/F(Gr)),ft)*p(Ze),no(e(F((Gr/mr-1)/ft)),1-ft)*p(et)]}return[0,no(e(Et),1-ft)*p(et)]}function no(Ze,et){if(!et)return Ze;if(et===1)return i(T(Ze/2+M));for(var ft=1,_t=F(1-et),zt=F(et),Et=0;E(zt)>l;Et++){if(Ze%x){var Ut=e(_t*T(Ze)/ft);Ut<0&&(Ut+=x),Ze+=Ut+~~(Ze/x)*x}else Ze+=Ze;zt=(ft+_t)/2,_t=F(ft*_t),zt=((ft=zt)-_t)/2}return Ze/(f(2,Et)*ft)}function bo(Ze,et){var ft=(w-1)/(w+1),_t=F(1-ft*ft),zt=no(A,_t*_t),Et=-1,Ut=i(T(x/4+E(et)/2)),mr=o(Et*Ut)/F(ft),wr=li(mr*r(Et*Ze),mr*d(Et*Ze)),Lr=io(wr[0],wr[1],_t*_t);return[-Lr[1],(et>=0?1:-1)*(.5*zt-Lr[0])]}function li(Ze,et){var ft=Ze*Ze,_t=et+1,zt=1-ft-et*et;return[.5*((Ze>=0?A:-A)-t(zt,2*Ze)),-.25*i(zt*zt+4*ft)+.5*i(_t*_t+ft)]}function ts(Ze,et){var ft=et[0]*et[0]+et[1]*et[1];return[(Ze[0]*et[0]+Ze[1]*et[1])/ft,(Ze[1]*et[0]-Ze[0]*et[1])/ft]}bo.invert=function(Ze,et){var ft=(w-1)/(w+1),_t=F(1-ft*ft),zt=no(A,_t*_t),Et=-1,Ut=Ei(.5*zt-et,-Ze,_t*_t),mr=ts(Ut[0],Ut[1]),wr=t(mr[1],mr[0])/Et;return[wr,2*e(o(.5/Et*i(ft*mr[0]*mr[0]+ft*mr[1]*mr[1])))-A]};function Ho(){return b.geoProjection(Un(bo)).scale(151.496)}function Gs(Ze){var et=d(Ze),ft=r(Ze),_t=cs(Ze);_t.invert=cs(-Ze);function zt(Et,Ut){var mr=_t(Et,Ut);Et=mr[0],Ut=mr[1];var wr=d(Ut),Lr=r(Ut),Gr=r(Et),an=z(et*wr+ft*Lr*Gr),Mn=d(an),Ln=E(Mn)>l?an/Mn:1;return[Ln*ft*d(Et),(E(Et)>A?Ln:-Ln)*(et*Lr-ft*wr*Gr)]}return zt.invert=function(Et,Ut){var mr=F(Et*Et+Ut*Ut),wr=-d(mr),Lr=r(mr),Gr=mr*Lr,an=-Ut*wr,Mn=mr*et,Ln=F(Gr*Gr+an*an-Mn*Mn),Gn=t(Gr*Mn+an*Ln,an*Mn-Gr*Ln),ba=(mr>A?-1:1)*t(Et*wr,mr*r(Gn)*Lr+Ut*d(Gn)*wr);return _t.invert(ba,Gn)},zt}function cs(Ze){var et=d(Ze),ft=r(Ze);return function(_t,zt){var Et=r(zt),Ut=r(_t)*Et,mr=d(_t)*Et,wr=d(zt);return[t(mr,Ut*ft-wr*et),L(wr*ft+Ut*et)]}}function Jo(){var Ze=0,et=b.geoProjectionMutator(Gs),ft=et(Ze),_t=ft.rotate,zt=ft.stream,Et=b.geoCircle();return ft.parallel=function(Ut){if(!arguments.length)return Ze*v;var mr=ft.rotate();return et(Ze=Ut*y).rotate(mr)},ft.rotate=function(Ut){return arguments.length?(_t.call(ft,[Ut[0],Ut[1]-Ze*v]),Et.center([-Ut[0],-Ut[1]]),ft):(Ut=_t.call(ft),Ut[1]+=Ze*v,Ut)},ft.stream=function(Ut){return Ut=zt(Ut),Ut.sphere=function(){Ut.polygonStart();var mr=.01,wr=Et.radius(90-mr)().coordinates[0],Lr=wr.length-1,Gr=-1,an;for(Ut.lineStart();++Gr=0;)Ut.point((an=wr[Gr])[0],an[1]);Ut.lineEnd(),Ut.polygonEnd()},Ut},ft.scale(79.4187).parallel(45).clipAngle(180-.001)}var Uo=3,Xs=L(1-1/Uo)*v,js=Wt(0);function ol(Ze){var et=Xs*y,ft=ye(x,et)[0]-ye(-x,et)[0],_t=js(0,et)[1],zt=ye(0,et)[1],Et=m-zt,Ut=u/Ze,mr=4/u,wr=_t+Et*Et*4/u;function Lr(Gr,an){var Mn,Ln=E(an);if(Ln>et){var Gn=s(Ze-1,a(0,n((Gr+x)/Ut)));Gr+=x*(Ze-1)/Ze-Gn*Ut,Mn=ye(Gr,Ln),Mn[0]=Mn[0]*u/ft-u*(Ze-1)/(2*Ze)+Gn*u/Ze,Mn[1]=_t+(Mn[1]-zt)*4*Et/u,an<0&&(Mn[1]=-Mn[1])}else Mn=js(Gr,an);return Mn[0]*=mr,Mn[1]/=wr,Mn}return Lr.invert=function(Gr,an){Gr/=mr,an*=wr;var Mn=E(an);if(Mn>_t){var Ln=s(Ze-1,a(0,n((Gr+x)/Ut)));Gr=(Gr+x*(Ze-1)/Ze-Ln*Ut)*ft/u;var Gn=ye.invert(Gr,.25*(Mn-_t)*u/Et+zt);return Gn[0]-=x*(Ze-1)/Ze-Ln*Ut,an<0&&(Gn[1]=-Gn[1]),Gn}return js.invert(Gr,an)},Lr}function fs(Ze,et){return[Ze,et&1?90-l:Xs]}function Zo(Ze,et){return[Ze,et&1?-90+l:-Xs]}function ho(Ze){return[Ze[0]*(1-l),Ze[1]]}function hs(Ze){var et=[].concat(S.range(-180,180+Ze/2,Ze).map(fs),S.range(180,-180-Ze/2,-Ze).map(Zo));return{type:"Polygon",coordinates:[Ze===180?et.map(ho):et]}}function sl(){var Ze=4,et=b.geoProjectionMutator(ol),ft=et(Ze),_t=ft.stream;return ft.lobes=function(zt){return arguments.length?et(Ze=+zt):Ze},ft.stream=function(zt){var Et=ft.rotate(),Ut=_t(zt),mr=(ft.rotate([0,0]),_t(zt));return ft.rotate(Et),Ut.sphere=function(){b.geoStream(hs(180/Ze),mr)},Ut},ft.scale(239.75)}function El(Ze){var et=1+Ze,ft=d(1/et),_t=L(ft),zt=2*F(x/(Et=x+4*_t*et)),Et,Ut=.5*zt*(et+F(Ze*(2+Ze))),mr=Ze*Ze,wr=et*et;function Lr(Gr,an){var Mn=1-d(an),Ln,Gn;if(Mn&&Mn<2){var ba=A-an,ti=25,Za;do{var ri=d(ba),Zi=r(ba),yo=_t+t(ri,et-Zi),co=1+wr-2*et*Zi;ba-=Za=(ba-mr*_t-et*ri+co*yo-.5*Mn*Et)/(2*et*ri*yo)}while(E(Za)>g&&--ti>0);Ln=zt*F(co),Gn=Gr*yo/x}else Ln=zt*(Ze+Mn),Gn=Gr*_t/x;return[Ln*d(Gn),Ut-Ln*r(Gn)]}return Lr.invert=function(Gr,an){var Mn=Gr*Gr+(an-=Ut)*an,Ln=(1+wr-Mn/(zt*zt))/(2*et),Gn=z(Ln),ba=d(Gn),ti=_t+t(ba,et-Ln);return[L(Gr/F(Mn))*x/ti,L(1-2*(Gn-mr*_t-et*ba+(1+wr-2*et*Ln)*ti)/Et)]},Lr}function Ll(){var Ze=1,et=b.geoProjectionMutator(El),ft=et(Ze);return ft.ratio=function(_t){return arguments.length?et(Ze=+_t):Ze},ft.scale(167.774).center([0,18.67])}var Es=.7109889596207567,ci=.0528035274542;function Ji(Ze,et){return et>-Es?(Ze=Qe(Ze,et),Ze[1]+=ci,Ze):rt(Ze,et)}Ji.invert=function(Ze,et){return et>-Es?Qe.invert(Ze,et-ci):rt.invert(Ze,et)};function kl(){return b.geoProjection(Ji).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Rs(Ze,et){return E(et)>Es?(Ze=Qe(Ze,et),Ze[1]-=et>0?ci:-ci,Ze):rt(Ze,et)}Rs.invert=function(Ze,et){return E(et)>Es?Qe.invert(Ze,et+(et>0?ci:-ci)):rt.invert(Ze,et)};function zo(){return b.geoProjection(Rs).scale(152.63)}function Pl(Ze,et,ft,_t){var zt=F(4*x/(2*ft+(1+Ze-et/2)*d(2*ft)+(Ze+et)/2*d(4*ft)+et/2*d(6*ft))),Et=F(_t*d(ft)*F((1+Ze*r(2*ft)+et*r(4*ft))/(1+Ze+et))),Ut=ft*wr(1);function mr(an){return F(1+Ze*r(2*an)+et*r(4*an))}function wr(an){var Mn=an*ft;return(2*Mn+(1+Ze-et/2)*d(2*Mn)+(Ze+et)/2*d(4*Mn)+et/2*d(6*Mn))/ft}function Lr(an){return mr(an)*d(an)}var Gr=function(an,Mn){var Ln=ft*Fe(wr,Ut*d(Mn)/ft,Mn/x);isNaN(Ln)&&(Ln=ft*p(Mn));var Gn=zt*mr(Ln);return[Gn*Et*an/x*r(Ln),Gn/Et*d(Ln)]};return Gr.invert=function(an,Mn){var Ln=Fe(Lr,Mn*Et/zt);return[an*x/(r(Ln)*zt*Et*mr(Ln)),L(ft*wr(Ln/ft)/Ut)]},ft===0&&(zt=F(_t/x),Gr=function(an,Mn){return[an*zt,d(Mn)/zt]},Gr.invert=function(an,Mn){return[an/zt,L(Mn*zt)]}),Gr}function Ys(){var Ze=1,et=0,ft=45*y,_t=2,zt=b.geoProjectionMutator(Pl),Et=zt(Ze,et,ft,_t);return Et.a=function(Ut){return arguments.length?zt(Ze=+Ut,et,ft,_t):Ze},Et.b=function(Ut){return arguments.length?zt(Ze,et=+Ut,ft,_t):et},Et.psiMax=function(Ut){return arguments.length?zt(Ze,et,ft=+Ut*y,_t):ft*v},Et.ratio=function(Ut){return arguments.length?zt(Ze,et,ft,_t=+Ut):_t},Et.scale(180.739)}function ll(Ze,et,ft,_t,zt,Et,Ut,mr,wr,Lr,Gr){if(Gr.nanEncountered)return NaN;var an,Mn,Ln,Gn,ba,ti,Za,ri,Zi,yo;if(an=ft-et,Mn=Ze(et+an*.25),Ln=Ze(ft-an*.25),isNaN(Mn)){Gr.nanEncountered=!0;return}if(isNaN(Ln)){Gr.nanEncountered=!0;return}return Gn=an*(_t+4*Mn+zt)/12,ba=an*(zt+4*Ln+Et)/12,ti=Gn+ba,yo=(ti-Ut)/15,Lr>wr?(Gr.maxDepthCount++,ti+yo):Math.abs(yo)>1;do wr[ti]>Ln?ba=ti:Gn=ti,ti=Gn+ba>>1;while(ti>Gn);var Za=wr[ti+1]-wr[ti];return Za&&(Za=(Ln-wr[ti+1])/Za),(ti+1+Za)/Ut}var an=2*Gr(1)/x*Et/ft,Mn=function(Ln,Gn){var ba=Gr(E(d(Gn))),ti=_t(ba)*Ln;return ba/=an,[ti,Gn>=0?ba:-ba]};return Mn.invert=function(Ln,Gn){var ba;return Gn*=an,E(Gn)<1&&(ba=p(Gn)*L(zt(E(Gn))*Et)),[Ln/_t(E(Gn)),ba]},Mn}function ms(){var Ze=0,et=2.5,ft=1.183136,_t=b.geoProjectionMutator(Ki),zt=_t(Ze,et,ft);return zt.alpha=function(Et){return arguments.length?_t(Ze=+Et,et,ft):Ze},zt.k=function(Et){return arguments.length?_t(Ze,et=+Et,ft):et},zt.gamma=function(Et){return arguments.length?_t(Ze,et,ft=+Et):ft},zt.scale(152.63)}function rs(Ze,et){return E(Ze[0]-et[0])=0;--wr)ft=Ze[1][wr],_t=ft[0][0],zt=ft[0][1],Et=ft[1][1],Ut=ft[2][0],mr=ft[2][1],et.push(ql([[Ut-l,mr-l],[Ut-l,Et+l],[_t+l,Et+l],[_t+l,zt-l]],30));return{type:"Polygon",coordinates:[S.merge(et)]}}function Po(Ze,et,ft){var _t,zt;function Et(wr,Lr){for(var Gr=Lr<0?-1:1,an=et[+(Lr<0)],Mn=0,Ln=an.length-1;Mnan[Mn][2][0];++Mn);var Gn=Ze(wr-an[Mn][1][0],Lr);return Gn[0]+=Ze(an[Mn][1][0],Gr*Lr>Gr*an[Mn][0][1]?an[Mn][0][1]:Lr)[0],Gn}ft?Et.invert=ft(Et):Ze.invert&&(Et.invert=function(wr,Lr){for(var Gr=zt[+(Lr<0)],an=et[+(Lr<0)],Mn=0,Ln=Gr.length;MnGn&&(ba=Ln,Ln=Gn,Gn=ba),[[an,Ln],[Mn,Gn]]})}),Ut):et.map(function(Lr){return Lr.map(function(Gr){return[[Gr[0][0]*v,Gr[0][1]*v],[Gr[1][0]*v,Gr[1][1]*v],[Gr[2][0]*v,Gr[2][1]*v]]})})},et!=null&&Ut.lobes(et),Ut}var ou=[[[[-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 cu(){return Po(Ne,ou).scale(160.857)}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 xl(){return Po(Rs,zs).scale(152.63)}var Ol=[[[[-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 Nl(){return Po(Qe,Ol).scale(169.529)}var Vu=[[[[-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 sf(){return Po(Qe,Vu).scale(169.529).rotate([20,0])}var jc=[[[[-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 $c(){return Po(Ji,jc,ze).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Ch=[[[[-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 gh(){return Po(rt,Ch).scale(152.63).rotate([-20,0])}function bl(Ze,et){return[3/u*Ze*F(x*x/3-et*et),et]}bl.invert=function(Ze,et){return[u/3*Ze/F(x*x/3-et*et),et]};function Cc(){return b.geoProjection(bl).scale(158.837)}function Lh(Ze){function et(ft,_t){if(E(E(_t)-A)2)return null;ft/=2,_t/=2;var Et=ft*ft,Ut=_t*_t,mr=2*_t/(1+Et+Ut);return mr=f((1+mr)/(1-mr),1/Ze),[t(2*ft,1-Et-Ut)/Ze,L((mr-1)/(mr+1))]},et}function tc(){var Ze=.5,et=b.geoProjectionMutator(Lh),ft=et(Ze);return ft.spacing=function(_t){return arguments.length?et(Ze=+_t):Ze},ft.scale(124.75)}var Hu=x/w;function rc(Ze,et){return[Ze*(1+F(r(et)))/2,et/(r(et/2)*r(Ze/6))]}rc.invert=function(Ze,et){var ft=E(Ze),_t=E(et),zt=l,Et=A;_tl||E(ti)>l)&&--zt>0);return zt&&[ft,_t]};function Gu(){return b.geoProjection(Zl).scale(139.98)}function qs(Ze,et){return[d(Ze)/r(et),T(et)*r(Ze)]}qs.invert=function(Ze,et){var ft=Ze*Ze,_t=et*et,zt=_t+1,Et=ft+zt,Ut=Ze?_*F((Et-F(Et*Et-4*ft))/ft):1/F(zt);return[L(Ze*Ut),p(et)*z(Ut)]};function Rl(){return b.geoProjection(qs).scale(144.049).clipAngle(90-.001)}function xf(Ze){var et=r(Ze),ft=T(M+Ze/2);function _t(zt,Et){var Ut=Et-Ze,mr=E(Ut)=0;)Gr=Ze[Lr],an=Gr[0]+mr*(Ln=an)-wr*Mn,Mn=Gr[1]+mr*Mn+wr*Ln;return an=mr*(Ln=an)-wr*Mn,Mn=mr*Mn+wr*Ln,[an,Mn]}return ft.invert=function(_t,zt){var Et=20,Ut=_t,mr=zt;do{for(var wr=et,Lr=Ze[wr],Gr=Lr[0],an=Lr[1],Mn=0,Ln=0,Gn;--wr>=0;)Lr=Ze[wr],Mn=Gr+Ut*(Gn=Mn)-mr*Ln,Ln=an+Ut*Ln+mr*Gn,Gr=Lr[0]+Ut*(Gn=Gr)-mr*an,an=Lr[1]+Ut*an+mr*Gn;Mn=Gr+Ut*(Gn=Mn)-mr*Ln,Ln=an+Ut*Ln+mr*Gn,Gr=Ut*(Gn=Gr)-mr*an-_t,an=Ut*an+mr*Gn-zt;var ba=Mn*Mn+Ln*Ln,ti,Za;Ut-=ti=(Gr*Mn+an*Ln)/ba,mr-=Za=(an*Mn-Gr*Ln)/ba}while(E(ti)+E(Za)>l*l&&--Et>0);if(Et){var ri=F(Ut*Ut+mr*mr),Zi=2*e(ri*.5),yo=d(Zi);return[t(Ut*yo,ri*r(Zi)),ri?L(mr*yo/ri):0]}},ft}var Os=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Fv=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],vl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Do=[[.9245,0],[0,0],[.01943,0]],Wf=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Qc(){return Xu(Os,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ru(){return Xu(Fv,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Ph(){return Xu(vl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function If(){return Xu(Do,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function ah(){return Xu(Wf,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Xu(Ze,et){var ft=b.geoProjection(xv(Ze)).rotate(et).clipAngle(90),_t=b.geoRotation(et),zt=ft.center;return delete ft.rotate,ft.center=function(Et){return arguments.length?zt(_t(Et)):_t.invert(zt())},ft}var ov=F(6),Nh=F(7);function ih(Ze,et){var ft=L(7*d(et)/(3*ov));return[ov*Ze*(2*r(2*ft/3)-1)/Nh,9*d(ft/3)/Nh]}ih.invert=function(Ze,et){var ft=3*L(et*Nh/9);return[Ze*Nh/(ov*(2*r(2*ft/3)-1)),L(d(ft)*3*ov/7)]};function Df(){return b.geoProjection(ih).scale(164.859)}function Rh(Ze,et){for(var ft=(1+_)*d(et),_t=et,zt=0,Et;zt<25&&(_t-=Et=(d(_t/2)+d(_t)-ft)/(.5*r(_t/2)+r(_t)),!(E(Et)g&&--_t>0);return Et=ft*ft,Ut=Et*Et,mr=Et*Ut,[Ze/(.84719-.13063*Et+mr*mr*(-.04515+.05494*Et-.02326*Ut+.00331*mr)),ft]};function lf(){return b.geoProjection(bf).scale(175.295)}function Yu(Ze,et){return[Ze*(1+r(et))/2,2*(et-T(et/2))]}Yu.invert=function(Ze,et){for(var ft=et/2,_t=0,zt=1/0;_t<10&&E(zt)>l;++_t){var Et=r(et/2);et-=zt=(et-T(et/2)-ft)/(1-.5/(Et*Et))}return[2*Ze/(1+r(et)),et]};function Vf(){return b.geoProjection(Yu).scale(152.63)}var Dh=[[[[-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 Fl(){return Po(ve(1/0),Dh).rotate([20,0]).scale(152.63)}function yh(Ze,et){var ft=d(et),_t=r(et),zt=p(Ze);if(Ze===0||E(et)===A)return[0,et];if(et===0)return[Ze,0];if(E(Ze)===A)return[Ze*_t,A*ft];var Et=x/(2*Ze)-2*Ze/x,Ut=2*et/x,mr=(1-Ut*Ut)/(ft-Ut),wr=Et*Et,Lr=mr*mr,Gr=1+wr/Lr,an=1+Lr/wr,Mn=(Et*ft/mr-Et/2)/Gr,Ln=(Lr*ft/wr+mr/2)/an,Gn=Mn*Mn+_t*_t/Gr,ba=Ln*Ln-(Lr*ft*ft/wr+mr*ft-1)/an;return[A*(Mn+F(Gn)*zt),A*(Ln+F(ba<0?0:ba)*p(-et*Et)*zt)]}yh.invert=function(Ze,et){Ze/=A,et/=A;var ft=Ze*Ze,_t=et*et,zt=ft+_t,Et=x*x;return[Ze?(zt-1+F((1-zt)*(1-zt)+4*ft))/(2*Ze)*A:0,Fe(function(Ut){return zt*(x*d(Ut)-2*Ut)*x+4*Ut*Ut*(et-d(Ut))+2*x*Ut-Et*et},0)]};function bv(){return b.geoProjection(yh).scale(127.267)}var jh=1.0148,oh=.23185,qh=-.14499,Lc=.02406,Vh=jh,gu=5*oh,Pc=7*qh,zf=9*Lc,Wl=1.790857183;function wf(Ze,et){var ft=et*et;return[Ze,et*(jh+ft*ft*(oh+ft*(qh+Lc*ft)))]}wf.invert=function(Ze,et){et>Wl?et=Wl:et<-Wl&&(et=-Wl);var ft=et,_t;do{var zt=ft*ft;ft-=_t=(ft*(jh+zt*zt*(oh+zt*(qh+Lc*zt)))-et)/(Vh+zt*zt*(gu+zt*(Pc+zf*zt)))}while(E(_t)>l);return[Ze,ft]};function hc(){return b.geoProjection(wf).scale(139.319)}function Rc(Ze,et){if(E(et)l&&--zt>0);return Ut=T(_t),[(E(et)=0;)if(_t=et[mr],ft[0]===_t[0]&&ft[1]===_t[1]){if(Et)return[Et,ft];Et=ft}}}function nc(Ze){for(var et=Ze.length,ft=[],_t=Ze[et-1],zt=0;zt0?[-_t[0],0]:[180-_t[0],180])};var et=Qf.map(function(ft){return{face:ft,project:Ze(ft)}});return[-1,0,0,1,0,1,4,5].forEach(function(ft,_t){var zt=et[ft];zt&&(zt.children||(zt.children=[])).push(et[_t])}),$f(et[0],function(ft,_t){return et[ft<-x/2?_t<0?6:4:ft<0?_t<0?2:0:ft_t^Ln>_t&&ft<(Mn-Lr)*(_t-Gr)/(Ln-Gr)+Lr&&(zt=!zt)}return zt}function oc(Ze,et){var ft=et.stream,_t;if(!ft)throw new Error("invalid projection");switch(Ze&&Ze.type){case"Feature":_t=Hc;break;case"FeatureCollection":_t=Gh;break;default:_t=ff;break}return _t(Ze,ft)}function Gh(Ze,et){return{type:"FeatureCollection",features:Ze.features.map(function(ft){return Hc(ft,et)})}}function Hc(Ze,et){return{type:"Feature",id:Ze.id,properties:Ze.properties,geometry:ff(Ze.geometry,et)}}function Tf(Ze,et){return{type:"GeometryCollection",geometries:Ze.geometries.map(function(ft){return ff(ft,et)})}}function ff(Ze,et){if(!Ze)return null;if(Ze.type==="GeometryCollection")return Tf(Ze,et);var ft;switch(Ze.type){case"Point":ft=fu;break;case"MultiPoint":ft=fu;break;case"LineString":ft=Bf;break;case"MultiLineString":ft=Bf;break;case"Polygon":ft=hf;break;case"MultiPolygon":ft=hf;break;case"Sphere":ft=hf;break;default:return null}return b.geoStream(Ze,et(ft)),ft.result()}var xu=[],yc=[],fu={point:function(Ze,et){xu.push([Ze,et])},result:function(){var Ze=xu.length?xu.length<2?{type:"Point",coordinates:xu[0]}:{type:"MultiPoint",coordinates:xu}:null;return xu=[],Ze}},Bf={lineStart:cf,point:function(Ze,et){xu.push([Ze,et])},lineEnd:function(){xu.length&&(yc.push(xu),xu=[])},result:function(){var Ze=yc.length?yc.length<2?{type:"LineString",coordinates:yc[0]}:{type:"MultiLineString",coordinates:yc}:null;return yc=[],Ze}},hf={polygonStart:cf,lineStart:cf,point:function(Ze,et){xu.push([Ze,et])},lineEnd:function(){var Ze=xu.length;if(Ze){do xu.push(xu[0].slice());while(++Ze<4);yc.push(xu),xu=[]}},polygonEnd:cf,result:function(){if(!yc.length)return null;var Ze=[],et=[];return yc.forEach(function(ft){uh(ft)?Ze.push([ft]):et.push(ft)}),et.forEach(function(ft){var _t=ft[0];Ze.some(function(zt){if(Tv(zt[0],_t))return zt.push(ft),!0})||Ze.push([ft])}),yc=[],Ze.length?Ze.length>1?{type:"MultiPolygon",coordinates:Ze}:{type:"Polygon",coordinates:Ze[0]}:null}};function Oh(Ze){var et=Ze(A,0)[0]-Ze(-A,0)[0];function ft(_t,zt){var Et=E(_t)0?_t-x:_t+x,zt),mr=(Ut[0]-Ut[1])*_,wr=(Ut[0]+Ut[1])*_;if(Et)return[mr,wr];var Lr=et*_,Gr=mr>0^wr>0?-1:1;return[Gr*mr-p(wr)*Lr,Gr*wr-p(mr)*Lr]}return Ze.invert&&(ft.invert=function(_t,zt){var Et=(_t+zt)*_,Ut=(zt-_t)*_,mr=E(Et)<.5*et&&E(Ut)<.5*et;if(!mr){var wr=et*_,Lr=Et>0^Ut>0?-1:1,Gr=-Lr*_t+(Ut>0?1:-1)*wr,an=-Lr*zt+(Et>0?1:-1)*wr;Et=(-Gr-an)*_,Ut=(Gr-an)*_}var Mn=Ze.invert(Et,Ut);return mr||(Mn[0]+=Et>0?x:-x),Mn}),b.geoProjection(ft).rotate([-90,-90,45]).clipAngle(180-.001)}function ur(){return Oh(un).scale(176.423)}function Pr(){return Oh(bo).scale(111.48)}function vn(Ze,et){if(!(0<=(et=+et)&&et<=20))throw new Error("invalid digits");function ft(Lr){var Gr=Lr.length,an=2,Mn=new Array(Gr);for(Mn[0]=+Lr[0].toFixed(et),Mn[1]=+Lr[1].toFixed(et);an2||Ln[0]!=Gr[0]||Ln[1]!=Gr[1])&&(an.push(Ln),Gr=Ln)}return an.length===1&&Lr.length>1&&an.push(ft(Lr[Lr.length-1])),an}function Et(Lr){return Lr.map(zt)}function Ut(Lr){if(Lr==null)return Lr;var Gr;switch(Lr.type){case"GeometryCollection":Gr={type:"GeometryCollection",geometries:Lr.geometries.map(Ut)};break;case"Point":Gr={type:"Point",coordinates:ft(Lr.coordinates)};break;case"MultiPoint":Gr={type:Lr.type,coordinates:_t(Lr.coordinates)};break;case"LineString":Gr={type:Lr.type,coordinates:zt(Lr.coordinates)};break;case"MultiLineString":case"Polygon":Gr={type:Lr.type,coordinates:Et(Lr.coordinates)};break;case"MultiPolygon":Gr={type:"MultiPolygon",coordinates:Lr.coordinates.map(Et)};break;default:return Lr}return Lr.bbox!=null&&(Gr.bbox=Lr.bbox),Gr}function mr(Lr){var Gr={type:"Feature",properties:Lr.properties,geometry:Ut(Lr.geometry)};return Lr.id!=null&&(Gr.id=Lr.id),Lr.bbox!=null&&(Gr.bbox=Lr.bbox),Gr}if(Ze!=null)switch(Ze.type){case"Feature":return mr(Ze);case"FeatureCollection":{var wr={type:"FeatureCollection",features:Ze.features.map(mr)};return Ze.bbox!=null&&(wr.bbox=Ze.bbox),wr}default:return Ut(Ze)}return Ze}function rn(Ze){var et=d(Ze);function ft(_t,zt){var Et=et?T(_t*et/2)/et:_t/2;if(!zt)return[2*Et,-Ze];var Ut=2*e(Et*d(zt)),mr=1/T(zt);return[d(Ut)*mr,zt+(1-r(Ut))*mr-Ze]}return ft.invert=function(_t,zt){if(E(zt+=Ze)l&&--mr>0);var Mn=_t*(Lr=T(Ut)),Ln=T(E(zt)0?A:-A)*(wr+zt*(Gr-Ut)/2+zt*zt*(Gr-2*wr+Ut)/2)]}ya.invert=function(Ze,et){var ft=et/A,_t=ft*90,zt=s(18,E(_t/5)),Et=a(0,n(zt));do{var Ut=Ta[Et][1],mr=Ta[Et+1][1],wr=Ta[s(19,Et+2)][1],Lr=wr-Ut,Gr=wr-2*mr+Ut,an=2*(E(ft)-mr)/Lr,Mn=Gr/Lr,Ln=an*(1-Mn*an*(1-2*Mn*an));if(Ln>=0||Et===1){_t=(et>=0?5:-5)*(Ln+zt);var Gn=50,ba;do zt=s(18,E(_t)/5),Et=n(zt),Ln=zt-Et,Ut=Ta[Et][1],mr=Ta[Et+1][1],wr=Ta[s(19,Et+2)][1],_t-=(ba=(et>=0?A:-A)*(mr+Ln*(wr-Ut)/2+Ln*Ln*(wr-2*mr+Ut)/2)-et)*v;while(E(ba)>g&&--Gn>0);break}}while(--Et>=0);var ti=Ta[Et][0],Za=Ta[Et+1][0],ri=Ta[s(19,Et+2)][0];return[Ze/(Za+Ln*(ri-ti)/2+Ln*Ln*(ri-2*Za+ti)/2),_t*y]};function ei(){return b.geoProjection(ya).scale(152.63)}function si(Ze){function et(ft,_t){var zt=r(_t),Et=(Ze-1)/(Ze-zt*r(ft));return[Et*zt*d(ft),Et*d(_t)]}return et.invert=function(ft,_t){var zt=ft*ft+_t*_t,Et=F(zt),Ut=(Ze-F(1-zt*(Ze+1)/(Ze-1)))/((Ze-1)/Et+Et/(Ze-1));return[t(ft*Ut,Et*F(1-Ut*Ut)),Et?L(_t*Ut/Et):0]},et}function Bi(Ze,et){var ft=si(Ze);if(!et)return ft;var _t=r(et),zt=d(et);function Et(Ut,mr){var wr=ft(Ut,mr),Lr=wr[1],Gr=Lr*zt/(Ze-1)+_t;return[wr[0]*_t/Gr,Lr/Gr]}return Et.invert=function(Ut,mr){var wr=(Ze-1)/(Ze-1-mr*zt);return ft.invert(wr*Ut,wr*mr*_t)},Et}function Va(){var Ze=2,et=0,ft=b.geoProjectionMutator(Bi),_t=ft(Ze,et);return _t.distance=function(zt){return arguments.length?ft(Ze=+zt,et):Ze},_t.tilt=function(zt){return arguments.length?ft(Ze,et=zt*y):et*v},_t.scale(432.147).clipAngle(z(1/Ze)*v-1e-6)}var _i=1e-4,Ja=1e4,Ba=-180,Gi=Ba+_i,No=180,Ro=No-_i,Go=-90,jo=Go+_i,Yi=90,ki=Yi-_i;function ns(Ze){return Ze.length>0}function Fs(Ze){return Math.floor(Ze*Ja)/Ja}function wl(Ze){return Ze===Go||Ze===Yi?[0,Ze]:[Ba,Fs(Ze)]}function Hl(Ze){var et=Ze[0],ft=Ze[1],_t=!1;return et<=Gi?(et=Ba,_t=!0):et>=Ro&&(et=No,_t=!0),ft<=jo?(ft=Go,_t=!0):ft>=ki&&(ft=Yi,_t=!0),_t?[et,ft]:Ze}function Sl(Ze){return Ze.map(Hl)}function Gl(Ze,et,ft){for(var _t=0,zt=Ze.length;_t=Ro||Gr<=jo||Gr>=ki){Et[Ut]=Hl(wr);for(var an=Ut+1;anGi&&Lnjo&&Gn=mr)break;ft.push({index:-1,polygon:et,ring:Et=Et.slice(an-1)}),Et[0]=wl(Et[0][1]),Ut=-1,mr=Et.length}}}}function el(Ze){var et,ft=Ze.length,_t={},zt={},Et,Ut,mr,wr,Lr;for(et=0;et0?x-mr:mr)*v],Lr=b.geoProjection(Ze(Ut)).rotate(wr),Gr=b.geoRotation(wr),an=Lr.center;return delete Lr.rotate,Lr.center=function(Mn){return arguments.length?an(Gr(Mn)):Gr.invert(an())},Lr.clipAngle(90)}function dl(Ze){var et=r(Ze);function ft(_t,zt){var Et=b.geoGnomonicRaw(_t,zt);return Et[0]*=et,Et}return ft.invert=function(_t,zt){return b.geoGnomonicRaw.invert(_t/et,zt)},ft}function vc(){return dc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function dc(Ze,et){return Il(dl,Ze,et)}function _c(Ze){if(!(Ze*=2))return b.geoAzimuthalEquidistantRaw;var et=-Ze/2,ft=-et,_t=Ze*Ze,zt=T(ft),Et=.5/d(ft);function Ut(mr,wr){var Lr=z(r(wr)*r(mr-et)),Gr=z(r(wr)*r(mr-ft)),an=wr<0?-1:1;return Lr*=Lr,Gr*=Gr,[(Lr-Gr)/(2*Ze),an*F(4*_t*Gr-(_t-Lr+Gr)*(_t-Lr+Gr))/(2*Ze)]}return Ut.invert=function(mr,wr){var Lr=wr*wr,Gr=r(F(Lr+(Mn=mr+et)*Mn)),an=r(F(Lr+(Mn=mr+ft)*Mn)),Mn,Ln;return[t(Ln=Gr-an,Mn=(Gr+an)*zt),(wr<0?-1:1)*z(F(Mn*Mn+Ln*Ln)*Et)]},Ut}function Hf(){return pc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function pc(Ze,et){return Il(_c,Ze,et)}function Af(Ze,et){if(E(et)l&&--mr>0);return[p(Ze)*(F(zt*zt+4)+zt)*x/4,A*Ut]};function Dc(){return b.geoProjection(Gc).scale(127.16)}function Ue(Ze,et,ft,_t,zt){function Et(Ut,mr){var wr=ft*d(_t*mr),Lr=F(1-wr*wr),Gr=F(2/(1+Lr*r(Ut*=zt)));return[Ze*Lr*Gr*d(Ut),et*wr*Gr]}return Et.invert=function(Ut,mr){var wr=Ut/Ze,Lr=mr/et,Gr=F(wr*wr+Lr*Lr),an=2*L(Gr/2);return[t(Ut*T(an),Ze*Gr)/zt,Gr&&L(mr*d(an)/(et*ft*Gr))/_t]},Et}function P(Ze,et,ft,_t){var zt=x/3;Ze=a(Ze,l),et=a(et,l),Ze=s(Ze,A),et=s(et,x-l),ft=a(ft,0),ft=s(ft,100-l),_t=a(_t,l);var Et=ft/100+1,Ut=_t/100,mr=z(Et*r(zt))/zt,wr=d(Ze)/d(mr*A),Lr=et/x,Gr=F(Ut*d(Ze/2)/d(et/2)),an=Gr/F(Lr*wr*mr),Mn=1/(Gr*F(Lr*wr*mr));return Ue(an,Mn,wr,mr,Lr)}function oe(){var Ze=65*y,et=60*y,ft=20,_t=200,zt=b.geoProjectionMutator(P),Et=zt(Ze,et,ft,_t);return Et.poleline=function(Ut){return arguments.length?zt(Ze=+Ut*y,et,ft,_t):Ze*v},Et.parallels=function(Ut){return arguments.length?zt(Ze,et=+Ut*y,ft,_t):et*v},Et.inflation=function(Ut){return arguments.length?zt(Ze,et,ft=+Ut,_t):ft},Et.ratio=function(Ut){return arguments.length?zt(Ze,et,ft,_t=+Ut):_t},Et.scale(163.775)}function Se(){return oe().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var ke=4*x+3*F(3),Be=2*F(2*x*F(3)/ke),gt=nt(Be*F(3)/x,Be,ke/6);function kt(){return b.geoProjection(gt).scale(176.84)}function Gt(Ze,et){return[Ze*F(1-3*et*et/(x*x)),et]}Gt.invert=function(Ze,et){return[Ze/F(1-3*et*et/(x*x)),et]};function cr(){return b.geoProjection(Gt).scale(152.63)}function Tr(Ze,et){var ft=r(et),_t=r(Ze)*ft,zt=1-_t,Et=r(Ze=t(d(Ze)*ft,-d(et))),Ut=d(Ze);return ft=F(1-_t*_t),[Ut*ft-Et*zt,-Et*ft-Ut*zt]}Tr.invert=function(Ze,et){var ft=(Ze*Ze+et*et)/-2,_t=F(-ft*(2+ft)),zt=et*ft+Ze*_t,Et=Ze*ft-et*_t,Ut=F(Et*Et+zt*zt);return[t(_t*zt,Ut*(1+ft)),Ut?-L(_t*Et/Ut):0]};function kr(){return b.geoProjection(Tr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Qr(Ze,et){var ft=fe(Ze,et);return[(ft[0]+Ze/A)/2,(ft[1]+et)/2]}Qr.invert=function(Ze,et){var ft=Ze,_t=et,zt=25;do{var Et=r(_t),Ut=d(_t),mr=d(2*_t),wr=Ut*Ut,Lr=Et*Et,Gr=d(ft),an=r(ft/2),Mn=d(ft/2),Ln=Mn*Mn,Gn=1-Lr*an*an,ba=Gn?z(Et*an)*F(ti=1/Gn):ti=0,ti,Za=.5*(2*ba*Et*Mn+ft/A)-Ze,ri=.5*(ba*Ut+_t)-et,Zi=.5*ti*(Lr*Ln+ba*Et*an*wr)+.5/A,yo=ti*(Gr*mr/4-ba*Ut*Mn),co=.125*ti*(mr*Mn-ba*Ut*Lr*Gr),Wo=.5*ti*(wr*an+ba*Ln*Et)+.5,Ks=yo*co-Wo*Zi,$s=(ri*yo-Za*Wo)/Ks,ks=(Za*co-ri*Zi)/Ks;ft-=$s,_t-=ks}while((E($s)>l||E(ks)>l)&&--zt>0);return[ft,_t]};function yn(){return b.geoProjection(Qr).scale(158.837)}h.geoNaturalEarth=b.geoNaturalEarth1,h.geoNaturalEarthRaw=b.geoNaturalEarth1Raw,h.geoAiry=re,h.geoAiryRaw=Z,h.geoAitoff=le,h.geoAitoffRaw=fe,h.geoArmadillo=V,h.geoArmadilloRaw=ce,h.geoAugust=ne,h.geoAugustRaw=ee,h.geoBaker=H,h.geoBakerRaw=te,h.geoBerghaus=ie,h.geoBerghausRaw=ae,h.geoBertin1953=it,h.geoBertin1953Raw=Ye,h.geoBoggs=ot,h.geoBoggsRaw=Ne,h.geoBonne=$t,h.geoBonneRaw=Nt,h.geoBottomley=Mr,h.geoBottomleyRaw=rr,h.geoBromley=Zr,h.geoBromleyRaw=Sr,h.geoChamberlin=xe,h.geoChamberlinRaw=je,h.geoChamberlinAfrica=Ee,h.geoCollignon=Me,h.geoCollignonRaw=ye,h.geoCraig=Je,h.geoCraigRaw=Xe,h.geoCraster=Ot,h.geoCrasterRaw=Ct,h.geoCylindricalEqualArea=_r,h.geoCylindricalEqualAreaRaw=Wt,h.geoCylindricalStereographic=hr,h.geoCylindricalStereographicRaw=pr,h.geoEckert1=En,h.geoEckert1Raw=Fr,h.geoEckert2=qn,h.geoEckert2Raw=Zn,h.geoEckert3=ra,h.geoEckert3Raw=ta,h.geoEckert4=Ea,h.geoEckert4Raw=Nn,h.geoEckert5=ir,h.geoEckert5Raw=ja,h.geoEckert6=ar,h.geoEckert6Raw=qt,h.geoEisenlohr=on,h.geoEisenlohrRaw=Vr,h.geoFahey=Kn,h.geoFaheyRaw=wn,h.geoFoucaut=fa,h.geoFoucautRaw=da,h.geoFoucautSinusoidal=ka,h.geoFoucautSinusoidalRaw=ga,h.geoGilbert=Ti,h.geoGingery=Nr,h.geoGingeryRaw=Dt,h.geoGinzburg4=Ur,h.geoGinzburg4Raw=Ir,h.geoGinzburg5=Kr,h.geoGinzburg5Raw=sn,h.geoGinzburg6=or,h.geoGinzburg6Raw=Tt,h.geoGinzburg8=ln,h.geoGinzburg8Raw=Dr,h.geoGinzburg9=jn,h.geoGinzburg9Raw=Pn,h.geoGringorten=Ma,h.geoGringortenRaw=un,h.geoGuyou=Ho,h.geoGuyouRaw=bo,h.geoHammer=Ce,h.geoHammerRaw=ve,h.geoHammerRetroazimuthal=Jo,h.geoHammerRetroazimuthalRaw=Gs,h.geoHealpix=sl,h.geoHealpixRaw=ol,h.geoHill=Ll,h.geoHillRaw=El,h.geoHomolosine=zo,h.geoHomolosineRaw=Rs,h.geoHufnagel=Ys,h.geoHufnagelRaw=Pl,h.geoHyperelliptical=ms,h.geoHyperellipticalRaw=Ki,h.geoInterrupt=Po,h.geoInterruptedBoggs=cu,h.geoInterruptedHomolosine=xl,h.geoInterruptedMollweide=Nl,h.geoInterruptedMollweideHemispheres=sf,h.geoInterruptedSinuMollweide=$c,h.geoInterruptedSinusoidal=gh,h.geoKavrayskiy7=Cc,h.geoKavrayskiy7Raw=bl,h.geoLagrange=tc,h.geoLagrangeRaw=Lh,h.geoLarrivee=Jc,h.geoLarriveeRaw=rc,h.geoLaskowski=Gu,h.geoLaskowskiRaw=Zl,h.geoLittrow=Rl,h.geoLittrowRaw=qs,h.geoLoximuthal=gc,h.geoLoximuthalRaw=xf,h.geoMiller=su,h.geoMillerRaw=Rf,h.geoModifiedStereographic=Xu,h.geoModifiedStereographicRaw=xv,h.geoModifiedStereographicAlaska=Qc,h.geoModifiedStereographicGs48=Ru,h.geoModifiedStereographicGs50=Ph,h.geoModifiedStereographicMiller=If,h.geoModifiedStereographicLee=ah,h.geoMollweide=Le,h.geoMollweideRaw=Qe,h.geoMtFlatPolarParabolic=Df,h.geoMtFlatPolarParabolicRaw=ih,h.geoMtFlatPolarQuartic=Ih,h.geoMtFlatPolarQuarticRaw=Rh,h.geoMtFlatPolarSinusoidal=Uh,h.geoMtFlatPolarSinusoidalRaw=ef,h.geoNaturalEarth2=lf,h.geoNaturalEarth2Raw=bf,h.geoNellHammer=Vf,h.geoNellHammerRaw=Yu,h.geoInterruptedQuarticAuthalic=Fl,h.geoNicolosi=bv,h.geoNicolosiRaw=yh,h.geoPatterson=hc,h.geoPattersonRaw=wf,h.geoPolyconic=lu,h.geoPolyconicRaw=Rc,h.geoPolyhedral=$f,h.geoPolyhedralButterfly=Ql,h.geoPolyhedralCollignon=zh,h.geoPolyhedralWaterman=au,h.geoProject=oc,h.geoGringortenQuincuncial=ur,h.geoPeirceQuincuncial=Pr,h.geoPierceQuincuncial=Pr,h.geoQuantize=vn,h.geoQuincuncial=Oh,h.geoRectangularPolyconic=On,h.geoRectangularPolyconicRaw=rn,h.geoRobinson=ei,h.geoRobinsonRaw=ya,h.geoSatellite=Va,h.geoSatelliteRaw=Bi,h.geoSinuMollweide=kl,h.geoSinuMollweideRaw=Ji,h.geoSinusoidal=Ft,h.geoSinusoidalRaw=rt,h.geoStitch=Ul,h.geoTimes=gs,h.geoTimesRaw=po,h.geoTwoPointAzimuthal=dc,h.geoTwoPointAzimuthalRaw=dl,h.geoTwoPointAzimuthalUsa=vc,h.geoTwoPointEquidistant=pc,h.geoTwoPointEquidistantRaw=_c,h.geoTwoPointEquidistantUsa=Hf,h.geoVanDerGrinten=Mu,h.geoVanDerGrintenRaw=Af,h.geoVanDerGrinten2=Xo,h.geoVanDerGrinten2Raw=Sf,h.geoVanDerGrinten3=Mf,h.geoVanDerGrinten3Raw=as,h.geoVanDerGrinten4=Dc,h.geoVanDerGrinten4Raw=Gc,h.geoWagner=oe,h.geoWagner7=Se,h.geoWagnerRaw=P,h.geoWagner4=kt,h.geoWagner4Raw=gt,h.geoWagner6=cr,h.geoWagner6Raw=Gt,h.geoWiechel=kr,h.geoWiechelRaw=Tr,h.geoWinkel3=yn,h.geoWinkel3Raw=Qr,Object.defineProperty(h,"__esModule",{value:!0})})}}),nR=Ge({"src/plots/geo/zoom.js"($,G){var h=Mi(),b=gn(),S=Lo(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(v,y){var I=v.projection,L;return y._isScoped?L=a:y._isClipped?L=f:L=s,L(v,I)}G.exports=o;function n(v,y){return h.behavior.zoom().translate(y.translate()).scale(y.scale())}function i(v,y,I){var L=v.id,z=v.graphDiv,F=z.layout,N=F[L],B=z._fullLayout,R=B[L],U={},j={};function Z(re,fe){U[L+"."+re]=b.nestedProperty(N,re).get(),S.call("_storeDirectGUIEdit",F,B._preGUI,U);var le=b.nestedProperty(R,re);le.get()!==fe&&(le.set(fe),b.nestedProperty(N,re).set(fe),j[L+"."+re]=fe)}I(Z),Z("projection.scale",y.scale()/v.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",j)}function a(v,y){var I=n(v,y);function L(){h.select(this).style(t)}function z(){y.scale(h.event.scale).translate(h.event.translate),v.render(!0);var B=y.invert(v.midPt);v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.center.lon":B[0],"geo.center.lat":B[1]})}function F(B){var R=y.invert(v.midPt);B("center.lon",R[0]),B("center.lat",R[1])}function N(){h.select(this).style(r),i(v,y,F)}return I.on("zoomstart",L).on("zoom",z).on("zoomend",N),I}function s(v,y){var I=n(v,y),L=2,z,F,N,B,R,U,j,Z,re;function fe(K){return y.invert(K)}function le(K){var ue=fe(K);if(!ue)return!0;var te=y(ue);return Math.abs(te[0]-K[0])>L||Math.abs(te[1]-K[1])>L}function ce(){h.select(this).style(t),z=h.mouse(this),F=y.rotate(),N=y.translate(),B=F,R=fe(z)}function V(){if(U=h.mouse(this),le(z)){I.scale(y.scale()),I.translate(y.translate());return}y.scale(h.event.scale),y.translate([N[0],h.event.translate[1]]),R?fe(U)&&(Z=fe(U),j=[B[0]+(Z[0]-R[0]),F[1],F[2]],y.rotate(j),B=j):(z=U,R=fe(z)),re=!0,v.render(!0);var K=y.rotate(),ue=y.invert(v.midPt);v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.center.lon":ue[0],"geo.center.lat":ue[1],"geo.projection.rotation.lon":-K[0]})}function ee(){h.select(this).style(r),re&&i(v,y,ne)}function ne(K){var ue=y.rotate(),te=y.invert(v.midPt);K("projection.rotation.lon",-ue[0]),K("center.lon",te[0]),K("center.lat",te[1])}return I.on("zoomstart",ce).on("zoom",V).on("zoomend",ee),I}function f(v,y){y.rotate(),y.scale();var I=n(v,y),L=u(I,"zoomstart","zoom","zoomend"),z=0,F=I.on,N;I.on("zoomstart",function(){h.select(this).style(t);var Z=h.mouse(this),re=y.rotate(),fe=re,le=y.translate(),ce=p(re);N=c(y,Z),F.call(I,"zoom",function(){var V=h.mouse(this);if(y.scale(h.event.scale),!N)Z=V,N=c(y,Z);else if(c(y,V)){y.rotate(re).translate(le);var ee=c(y,V),ne=T(N,ee),K=M(d(ce,ne)),ue=l(K,N,fe);(!isFinite(ue[0])||!isFinite(ue[1])||!isFinite(ue[2]))&&(ue=fe),y.rotate(ue),fe=ue}R(L.of(this,arguments))}),B(L.of(this,arguments))}).on("zoomend",function(){h.select(this).style(r),F.call(I,"zoom",null),U(L.of(this,arguments)),i(v,y,j)}).on("zoom.redraw",function(){v.render(!0);var Z=y.rotate();v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function B(Z){z++||Z({type:"zoomstart"})}function R(Z){Z({type:"zoom"})}function U(Z){--z||Z({type:"zoomend"})}function j(Z){var re=y.rotate();Z("projection.rotation.lon",-re[0]),Z("projection.rotation.lat",-re[1])}return h.rebind(I,L,"on")}function c(v,y){var I=v.invert(y);return I&&isFinite(I[0])&&isFinite(I[1])&&_(I)}function p(v){var y=.5*v[0]*E,I=.5*v[1]*E,L=.5*v[2]*E,z=Math.sin(y),F=Math.cos(y),N=Math.sin(I),B=Math.cos(I),R=Math.sin(L),U=Math.cos(L);return[F*B*U+z*N*R,z*B*U-F*N*R,F*N*U+z*B*R,F*B*R-z*N*U]}function d(v,y){var I=v[0],L=v[1],z=v[2],F=v[3],N=y[0],B=y[1],R=y[2],U=y[3];return[I*N-L*B-z*R-F*U,I*B+L*N+z*U-F*R,I*R-L*U+z*N+F*B,I*U+L*R-z*B+F*N]}function T(v,y){if(!(!v||!y)){var I=m(v,y),L=Math.sqrt(w(I,I)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(v,y)))),F=Math.sin(z)/L;return L&&[Math.cos(z),I[2]*F,-I[1]*F,I[0]*F]}}function l(v,y,I){var L=A(y,2,v[0]);L=A(L,1,v[1]),L=A(L,0,v[2]-I[2]);var z=y[0],F=y[1],N=y[2],B=L[0],R=L[1],U=L[2],j=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),re,fe;Math.abs(R)>Z?(fe=(R>0?90:-90)-j,re=0):(fe=Math.asin(R/Z)*e-j,re=Math.sqrt(Z*Z-R*R));var le=180-fe-2*j,ce=(Math.atan2(U,B)-Math.atan2(N,re))*e,V=(Math.atan2(U,B)-Math.atan2(N,-re))*e,ee=g(I[0],I[1],fe,ce),ne=g(I[0],I[1],le,V);return ee<=ne?[fe,ce,I[2]]:[le,V,I[2]]}function g(v,y,I,L){var z=x(I-v),F=x(L-y);return Math.sqrt(z*z+F*F)}function x(v){return(v%360+540)%360-180}function A(v,y,I){var L=I*E,z=v.slice(),F=y===0?1:0,N=y===2?1:2,B=Math.cos(L),R=Math.sin(L);return z[F]=v[F]*B-v[N]*R,z[N]=v[N]*B+v[F]*R,z}function M(v){return[Math.atan2(2*(v[0]*v[1]+v[2]*v[3]),1-2*(v[1]*v[1]+v[2]*v[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(v[0]*v[2]-v[3]*v[1]))))*e,Math.atan2(2*(v[0]*v[3]+v[1]*v[2]),1-2*(v[2]*v[2]+v[3]*v[3]))*e]}function _(v){var y=v[0]*E,I=v[1]*E,L=Math.cos(I);return[L*Math.cos(y),L*Math.sin(y),Math.sin(I)]}function w(v,y){for(var I=0,L=0,z=v.length;L0&&R._module.calcGeoJSON(B,L)}if(!z){var U=this.updateProjection(I,L);if(U)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,I,F);var j=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=j.selectAll(".point"),this.dataPoints.text=j.selectAll("text"),this.dataPaths.line=j.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},m.updateProjection=function(I,L){var z=this.graphDiv,F=L[this.id],N=L._size,B=F.domain,R=F.projection,U=F.lonaxis,j=F.lataxis,Z=U._ax,re=j._ax,fe=this.projection=u(F),le=[[N.l+N.w*B.x[0],N.t+N.h*(1-B.y[1])],[N.l+N.w*B.x[1],N.t+N.h*(1-B.y[0])]],ce=F.center||{},V=R.rotation||{},ee=U.range||[],ne=j.range||[];if(F.fitbounds){Z._length=le[1][0]-le[0][0],re._length=le[1][1]-le[0][1],Z.range=c(z,Z),re.range=c(z,re);var K=(Z.range[0]+Z.range[1])/2,ue=(re.range[0]+re.range[1])/2;if(F._isScoped)ce={lon:K,lat:ue};else if(F._isClipped){ce={lon:K,lat:ue},V={lon:K,lat:ue,roll:V.roll};var te=R.type,H=x.lonaxisSpan[te]/2||180,ae=x.lataxisSpan[te]/2||90;ee=[K-H,K+H],ne=[ue-ae,ue+ae]}else ce={lon:K,lat:ue},V={lon:K,lat:V.lat,roll:V.roll}}fe.center([ce.lon-V.lon,ce.lat-V.lat]).rotate([-V.lon,-V.lat,V.roll]).parallels(R.parallels);var ie=y(ee,ne);fe.fitExtent(le,ie);var ve=this.bounds=fe.getBounds(ie),Ae=this.fitScale=fe.scale(),Ce=fe.translate();if(F.fitbounds){var Fe=fe.getBounds(y(Z.range,re.range)),ze=Math.min((ve[1][0]-ve[0][0])/(Fe[1][0]-Fe[0][0]),(ve[1][1]-ve[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(ze)?fe.scale(ze*Ae):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else fe.scale(R.scale*Ae);var Ye=this.midPt=[(ve[0][0]+ve[1][0])/2,(ve[0][1]+ve[1][1])/2];if(fe.translate([Ce[0]+(Ye[0]-Ce[0]),Ce[1]+(Ye[1]-Ce[1])]).clipExtent(ve),F._isAlbersUsa){var it=fe([ce.lon,ce.lat]),st=fe.translate();fe.translate([st[0]-(it[0]-st[0]),st[1]-(it[1]-st[1])])}},m.updateBaseLayers=function(I,L){var z=this,F=z.topojson,N=z.layers,B=z.basePaths;function R(le){return le==="lonaxis"||le==="lataxis"}function U(le){return!!x.lineLayers[le]}function j(le){return!!x.fillLayers[le]}var Z=this.hasChoropleth?x.layersForChoropleth:x.layers,re=Z.filter(function(le){return U(le)||j(le)?L["show"+le]:R(le)?L[le].showgrid:!0}),fe=z.framework.selectAll(".layer").data(re,String);fe.exit().each(function(le){delete N[le],delete B[le],h.select(this).remove()}),fe.enter().append("g").attr("class",function(le){return"layer "+le}).each(function(le){var ce=N[le]=h.select(this);le==="bg"?z.bgRect=ce.append("rect").style("pointer-events","all"):R(le)?B[le]=ce.append("path").style("fill","none"):le==="backplot"?ce.append("g").classed("choroplethlayer",!0):le==="frontplot"?ce.append("g").classed("scatterlayer",!0):U(le)?B[le]=ce.append("path").style("fill","none").style("stroke-miterlimit",2):j(le)&&(B[le]=ce.append("path").style("stroke","none"))}),fe.order(),fe.each(function(le){var ce=B[le],V=x.layerNameToAdjective[le];le==="frame"?ce.datum(x.sphereSVG):U(le)||j(le)?ce.datum(_(F,F.objects[le])):R(le)&&ce.datum(v(le,L,I)).call(n.stroke,L[le].gridcolor).call(i.dashLine,L[le].griddash,L[le].gridwidth),U(le)?ce.call(n.stroke,L[V+"color"]).call(i.dashLine,"",L[V+"width"]):j(le)&&ce.call(n.fill,L[V+"color"])})},m.updateDims=function(I,L){var z=this.bounds,F=(L.framewidth||0)/2,N=z[0][0]-F,B=z[0][1]-F,R=z[1][0]-N+F,U=z[1][1]-B+F;i.setRect(this.clipRect,N,B,R,U),this.bgRect.call(i.setRect,N,B,R,U).call(n.fill,L.bgcolor),this.xaxis._offset=N,this.xaxis._length=R,this.yaxis._offset=B,this.yaxis._length=U},m.updateFx=function(I,L){var z=this,F=z.graphDiv,N=z.bgRect,B=I.dragmode,R=I.clickmode;if(z.isStatic)return;function U(){var fe=z.viewInitial,le={};for(var ce in fe)le[z.id+"."+ce]=fe[ce];t.call("_guiRelayout",F,le),F.emit("plotly_doubleclick",null)}function j(fe){return z.projection.invert([fe[0]+z.xaxis._offset,fe[1]+z.yaxis._offset])}var Z=function(fe,le){if(le.isRect){var ce=fe.range={};ce[z.id]=[j([le.xmin,le.ymin]),j([le.xmax,le.ymax])]}else{var V=fe.lassoPoints={};V[z.id]=le.map(j)}},re={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(fe){fe===2&&T(F)}};B==="pan"?(N.node().onmousedown=null,N.call(g(z,L)),N.on("dblclick.zoom",U),F._context._scrollZoom.geo||N.on("wheel.zoom",null)):(B==="select"||B==="lasso")&&(N.on(".zoom",null),re.prepFn=function(fe,le,ce){d(fe,le,ce,re,B)},p.init(re)),N.on("mousemove",function(){var fe=z.projection.invert(r.getPositionFromD3Event());if(!fe)return p.unhover(F,h.event);z.xaxis.p2c=function(){return fe[0]},z.yaxis.p2c=function(){return fe[1]},a.hover(F,h.event,z.id)}),N.on("mouseout",function(){F._dragging||p.unhover(F,h.event)}),N.on("click",function(){B!=="select"&&B!=="lasso"&&(R.indexOf("select")>-1&&l(h.event,F,[z.xaxis],[z.yaxis],z.id,re),R.indexOf("event")>-1&&a.click(F,h.event))})},m.makeFramework=function(){var I=this,L=I.graphDiv,z=L._fullLayout,F="clip"+z._uid+I.id;I.clipDef=z._clips.append("clipPath").attr("id",F),I.clipRect=I.clipDef.append("rect"),I.framework=h.select(I.container).append("g").attr("class","geo "+I.id).call(i.setClipUrl,F,L),I.project=function(N){var B=I.projection(N);return B?[B[0]-I.xaxis._offset,B[1]-I.yaxis._offset]:[null,null]},I.xaxis={_id:"x",c2p:function(N){return I.project(N)[0]}},I.yaxis={_id:"y",c2p:function(N){return I.project(N)[1]}},I.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(I.mockAxis,z)},m.saveViewInitial=function(I){var L=I.center||{},z=I.projection,F=z.rotation||{};this.viewInitial={fitbounds:I.fitbounds,"projection.scale":z.scale};var N;I._isScoped?N={"center.lon":L.lon,"center.lat":L.lat}:I._isClipped?N={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:N={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,N)},m.render=function(I){this._hasMarkerAngles&&I?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},m._render=function(){var I=this.projection,L=I.getPath(),z;function F(B){var R=I(B.lonlat);return R?o(R[0],R[1]):null}function N(B){return I.isLonLatOverEdges(B.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(B){return L(B.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",N).attr("transform",F)};function u(I){var L=I.projection,z=L.type,F=x.projNames[z];F="geo"+r.titleCase(F);for(var N=b[F]||e[F],B=N(),R=I._isSatellite?Math.acos(1/L.distance)*180/Math.PI:I._isClipped?x.lonaxisSpan[z]/2:null,U=["center","rotate","parallels","clipExtent"],j=function(fe){return fe?B:[]},Z=0;ZV}else return!1},B.getPath=function(){return S().projection(B)},B.getBounds=function(fe){return B.getPath().bounds(fe)},B.precision(x.precision),I._isSatellite&&B.tilt(L.tilt).distance(L.distance),R&&B.clipAngle(R-x.clipPad),B}function v(I,L,z){var F=1e-6,N=2.5,B=L[I],R=x.scopeDefaults[L.scope],U,j,Z;I==="lonaxis"?(U=R.lonaxisRange,j=R.lataxisRange,Z=function(ue,te){return[ue,te]}):I==="lataxis"&&(U=R.lataxisRange,j=R.lonaxisRange,Z=function(ue,te){return[te,ue]});var re={type:"linear",range:[U[0],U[1]-F],tick0:B.tick0,dtick:B.dtick};f.setConvert(re,z);var fe=f.calcTicks(re);!L.isScoped&&I==="lonaxis"&&fe.pop();for(var le=fe.length,ce=new Array(le),V=0;V0&&N<0&&(N+=360);var U=(N-F)/4;return{type:"Polygon",coordinates:[[[F,B],[F,R],[F+U,R],[F+2*U,R],[F+3*U,R],[N,R],[N,B],[N-U,B],[N-2*U,B],[N-3*U,B],[F,B]]]}}}}),Jk=Ge({"src/plots/geo/layout_attributes.js"($,G){var h=th(),b=Ac().attributes,S=fv().dash,E=XA(),e=Nc().overrideAll,t=Lp(),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:h.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:S},o=G.exports=e({domain:b({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(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.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:h.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:h.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:h.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:h.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:h.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),iR=Ge({"src/plots/geo/layout_defaults.js"($,G){var h=gn(),b=N0(),S=Rv().getSubplotData,E=XA(),e=Jk(),t=E.axesNames;G.exports=function(n,i,a){b(n,i,a,{type:"geo",attributes:e,handleDefaults:r,fullData:a,partition:"y"})};function r(o,n,i,a){var s=S(a.fullData,"geo",a.id),f=s.map(function(ne){return ne.index}),c=i("resolution"),p=i("scope"),d=E.scopeDefaults[p],T=i("projection.type",d.projType),l=n._isAlbersUsa=T==="albers usa";l&&(p=n.scope="usa");var g=n._isScoped=p!=="world",x=n._isSatellite=T==="satellite",A=n._isConic=T.indexOf("conic")!==-1||T==="albers",M=n._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=h.extendDeep({},n._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),n._template=_}for(var w=i("visible"),m,u=0;u0&&j<0&&(j+=360);var Z=(U+j)/2,re;if(!l){var fe=g?d.projRotate:[Z,0,0];re=i("projection.rotation.lon",fe[0]),i("projection.rotation.lat",fe[1]),i("projection.rotation.roll",fe[2]),m=i("showcoastlines",!g&&w),m&&(i("coastlinecolor"),i("coastlinewidth")),m=i("showocean",w?void 0:!1),m&&i("oceancolor")}var le,ce;if(l?(le=-96.6,ce=38.7):(le=g?Z:re,ce=(R[0]+R[1])/2),i("center.lon",le),i("center.lat",ce),x&&(i("projection.tilt"),i("projection.distance")),A){var V=d.projParallels||[0,60];i("projection.parallels",V)}i("projection.scale"),m=i("showland",w?void 0:!1),m&&i("landcolor"),m=i("showlakes",w?void 0:!1),m&&i("lakecolor"),m=i("showrivers",w?void 0:!1),m&&(i("rivercolor"),i("riverwidth")),m=i("showcountries",g&&p!=="usa"&&w),m&&(i("countrycolor"),i("countrywidth")),(p==="usa"||p==="north america"&&c===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),g||(m=i("showframe",w),m&&(i("framecolor"),i("framewidth"))),i("bgcolor");var ee=i("fitbounds");ee&&(delete n.projection.scale,g?(delete n.center.lon,delete n.center.lat):M?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}}}),Qk=Ge({"src/plots/geo/index.js"($,G){var h=Rv().getSubplotCalcData,b=gn().counterRegex,S=aR(),E="geo",e=b(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var a=i._fullLayout,s=i.calcdata,f=a._subplots[E],c=0;c")}}}}),mE=Ge({"src/traces/choropleth/event_data.js"($,G){G.exports=function(b,S,E,e,t){b.location=S.location,b.z=S.z;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b.ct=r.ct,b}}}),gE=Ge({"src/traces/choropleth/select.js"($,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n,i,a,s;if(S===!1)for(o=0;o=Math.min(j,Z)&&T<=Math.max(j,Z)?0:1/0}if(L=Math.min(re,fe)&&l<=Math.max(re,fe)?0:1/0}N=Math.sqrt(L*L+z*z),u=x[I]}}}else for(I=x.length-1;I>-1;I--)m=x[I],v=p[m],y=d[m],L=f.c2p(v)-T,z=c.c2p(y)-l,F=Math.sqrt(L*L+z*z),F100},$.isDotSymbol=function(h){return typeof h=="string"?G.DOT_RE.test(h):h>200}}}),fR=Ge({"src/traces/scattergl/defaults.js"($,G){var h=gn(),b=Lo(),S=_E(),E=ZA(),e=o0(),t=iu(),r=Op(),o=Fp(),n=Hv(),i=Bp(),a=Iv(),s=ep();G.exports=function(c,p,d,T){function l(u,v){return h.coerce(c,p,E,u,v)}var g=c.marker?S.isOpenSymbol(c.marker.symbol):!1,x=t.isBubble(c),A=r(c,p,T,l);if(!A){p.visible=!1;return}o(c,p,T,l),l("xhoverformat"),l("yhoverformat");var M=A>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>=0?(s=f,a=f-1):i=f+1}return s}function b(r,o,n,i,a){for(var s=a+1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>0?(s=f,a=f-1):i=f+1}return s}function S(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<0?(s=f,i=f+1):a=f-1}return s}function E(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<=0?(s=f,i=f+1):a=f-1}return s}function e(r,o,n,i,a){for(;i<=a;){var s=i+a>>>1,f=r[s],c=n!==void 0?n(f,o):f-o;if(c===0)return s;c<=0?i=s+1:a=s-1}return-1}function t(r,o,n,i,a,s){return typeof n=="function"?s(r,o,n,i===void 0?0:i|0,a===void 0?r.length-1:a|0):s(r,o,void 0,n===void 0?0:n|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,n,i,a){return t(r,o,n,i,a,h)},gt:function(r,o,n,i,a){return t(r,o,n,i,a,b)},lt:function(r,o,n,i,a){return t(r,o,n,i,a,S)},le:function(r,o,n,i,a){return t(r,o,n,i,a,E)},eq:function(r,o,n,i,a){return t(r,o,n,i,a,e)}}}}),Dg=Ge({"node_modules/pick-by-alias/index.js"($,G){G.exports=function(E,e,t){var r={},o,n;if(typeof e=="string"&&(e=b(e)),Array.isArray(e)){var i={};for(n=0;n1&&(S=arguments),typeof S=="string"?S=S.split(/\s/).map(parseFloat):typeof S=="number"&&(S=[S]),S.length&&typeof S[0]=="number"?S.length===1?E={width:S[0],height:S[0],x:0,y:0}:S.length===2?E={width:S[0],height:S[1],x:0,y:0}:E={x:S[0],y:S[1],width:S[2]-S[0]||0,height:S[3]-S[1]||0}:S&&(S=h(S,{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"}),E={x:S.left||0,y:S.top||0},S.width==null?S.right?E.width=S.right-E.x:E.width=0:E.width=S.width,S.height==null?S.bottom?E.height=S.bottom-E.y:E.height=0:E.height=S.height),E}}}),Yb=Ge({"node_modules/array-bounds/index.js"($,G){G.exports=h;function h(b,S){if(!b||b.length==null)throw Error("Argument should be an array");S==null?S=1:S=Math.floor(S);for(var E=Array(S*2),e=0;et&&(t=b[o]),b[o]>>1,x;p.dtype||(p.dtype="array"),typeof p.dtype=="string"?x=new(n(p.dtype))(g):p.dtype&&(x=p.dtype,Array.isArray(x)&&(x.length=g));for(let L=0;Ld||R>a){for(let ue=0;ueie||Z>ve||re=le||H===ae)return;let Ae=A[te];ae===void 0&&(ae=Ae.length);for(let Le=H;Le=N&&pe<=R&&Ne>=B&&Ne<=U&&ce.push(Te)}let Ce=M[te],Fe=Ce[H*4+0],ze=Ce[H*4+1],Ye=Ce[H*4+2],it=Ce[H*4+3],st=ee(Ce,H+1),nt=ue*.5,Qe=te+1;V(ne,K,nt,Qe,Fe,ze||Ye||it||st),V(ne,K+nt,nt,Qe,ze,Ye||it||st),V(ne+nt,K,nt,Qe,Ye,it||st),V(ne+nt,K+nt,nt,Qe,it,st)}function ee(ne,K){let ue=null,te=0;for(;ue===null;)if(ue=ne[K*4+te],te++,te>ne.length)return null;return ue}return ce}function y(L,z,F,N,B){let R=[];for(let U=0;U1&&(c=1),c<-1&&(c=-1),f*Math.acos(c)},t=function(n,i,a,s,f,c,p,d,T,l,g,x){var A=Math.pow(f,2),M=Math.pow(c,2),_=Math.pow(g,2),w=Math.pow(x,2),m=A*M-A*w-M*_;m<0&&(m=0),m/=A*w+M*_,m=Math.sqrt(m)*(p===d?-1:1);var u=m*f/c*x,v=m*-c/f*g,y=l*u-T*v+(n+a)/2,I=T*u+l*v+(i+s)/2,L=(g-u)/f,z=(x-v)/c,F=(-g-u)/f,N=(-x-v)/c,B=e(1,0,L,z),R=e(L,z,F,N);return d===0&&R>0&&(R-=b),d===1&&R<0&&(R+=b),[y,I,B,R]},r=function(n){var i=n.px,a=n.py,s=n.cx,f=n.cy,c=n.rx,p=n.ry,d=n.xAxisRotation,T=d===void 0?0:d,l=n.largeArcFlag,g=l===void 0?0:l,x=n.sweepFlag,A=x===void 0?0:x,M=[];if(c===0||p===0)return[];var _=Math.sin(T*b/360),w=Math.cos(T*b/360),m=w*(i-s)/2+_*(a-f)/2,u=-_*(i-s)/2+w*(a-f)/2;if(m===0&&u===0)return[];c=Math.abs(c),p=Math.abs(p);var v=Math.pow(m,2)/Math.pow(c,2)+Math.pow(u,2)/Math.pow(p,2);v>1&&(c*=Math.sqrt(v),p*=Math.sqrt(v));var y=t(i,a,s,f,c,p,g,A,_,w,m,u),I=h(y,4),L=I[0],z=I[1],F=I[2],N=I[3],B=Math.abs(N)/(b/4);Math.abs(1-B)<1e-7&&(B=1);var R=Math.max(Math.ceil(B),1);N/=R;for(var U=0;U4?(o=l[l.length-4],n=l[l.length-3]):(o=c,n=p),r.push(l)}return r}function S(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,n,i){return["C",e/3+2/3*r,t/3+2/3*o,n/3+2/3*r,i/3+2/3*o,n,i]}}}),rC=Ge({"node_modules/is-svg-path/index.js"($,G){G.exports=function(b){return typeof b!="string"?!1:(b=b.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(b)&&/[\dz]$/i.test(b)&&b.length>4))}}}),xR=Ge({"node_modules/svg-path-bounds/index.js"($,G){var h=am(),b=tC(),S=_R(),E=rC(),e=Ay();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=h(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=b(r),r=S(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],n=0,i=r.length;no[2]&&(o[2]=a[s+0]),a[s+1]>o[3]&&(o[3]=a[s+1]);return o}}}),bR=Ge({"node_modules/normalize-svg-path/index.js"($,G){var h=Math.PI,b=o(120);G.exports=S;function S(n){for(var i,a=[],s=0,f=0,c=0,p=0,d=null,T=null,l=0,g=0,x=0,A=n.length;x7&&(a.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,m=g;(i=="C"||i=="S")&&(w+=w-s,m+=m-f),M=["C",w,m,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(d=l*2-d,T=g*2-T):(d=l,T=g),M=e(l,g,d,T,M[1],M[2]);break;case"Q":d=M[1],T=M[2],M=e(l,g,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,g,M[1],M[2]);break;case"H":M=E(l,g,M[1],g);break;case"V":M=E(l,g,l,M[1]);break;case"Z":M=E(l,g,c,p);break}i=_,l=M[M.length-2],g=M[M.length-1],M.length>4?(s=M[M.length-4],f=M[M.length-3]):(s=l,f=g),a.push(M)}return a}function E(n,i,a,s){return["C",n,i,a,s,a,s]}function e(n,i,a,s,f,c){return["C",n/3+2/3*a,i/3+2/3*s,f/3+2/3*a,c/3+2/3*s,f,c]}function t(n,i,a,s,f,c,p,d,T,l){if(l)y=l[0],I=l[1],u=l[2],v=l[3];else{var g=r(n,i,-f);n=g.x,i=g.y,g=r(d,T,-f),d=g.x,T=g.y;var x=(n-d)/2,A=(i-T)/2,M=x*x/(a*a)+A*A/(s*s);M>1&&(M=Math.sqrt(M),a=M*a,s=M*s);var _=a*a,w=s*s,m=(c==p?-1:1)*Math.sqrt(Math.abs((_*w-_*A*A-w*x*x)/(_*A*A+w*x*x)));m==1/0&&(m=1);var u=m*a*A/s+(n+d)/2,v=m*-s*x/a+(i+T)/2,y=Math.asin(((i-v)/s).toFixed(9)),I=Math.asin(((T-v)/s).toFixed(9));y=nI&&(y=y-h*2),!p&&I>y&&(I=I-h*2)}if(Math.abs(I-y)>b){var L=I,z=d,F=T;I=y+b*(p&&I>y?1:-1),d=u+a*Math.cos(I),T=v+s*Math.sin(I);var N=t(d,T,a,s,f,0,p,z,F,[I,L,u,v])}var B=Math.tan((I-y)/4),R=4/3*a*B,U=4/3*s*B,j=[2*n-(n+R*Math.sin(y)),2*i-(i-U*Math.cos(y)),d+R*Math.sin(I),T-U*Math.cos(I),d,T];if(l)return j;N&&(j=j.concat(N));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(d)),r.translate(f*.5,c*.5),r.scale(g,g),i()){var x=new Path2D(a);r.fill(x),d&&r.stroke(x)}else{var A=b(a);S(r,A),r.fill(),d&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:p*.5});return M}var n;function i(){if(n!=null)return n;var a=document.createElement("canvas").getContext("2d");if(a.canvas.width=a.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");a.fillStyle="black",a.fill(s);var f=a.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}}),Wb=Ge({"src/traces/scattergl/convert.js"($,G){var h=Pi(),b=AR(),S=P_(),E=Lo(),e=gn(),t=e.isArrayOrTypedArray,r=Ss(),o=Cf(),n=Vy().formatColor,i=iu(),a=Rp(),s=_E(),f=z_(),c=cp().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},d=Vv().appendArrayPointValue;function T(N,B){var R,U={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},j=N._context.plotGlPixelRatio;if(B.visible!==!0)return U;if(i.hasText(B)&&(U.text=l(N,B),U.textSel=M(N,B,B.selected),U.textUnsel=M(N,B,B.unselected)),i.hasMarkers(B)&&(U.marker=x(N,B),U.markerSel=A(N,B,B.selected),U.markerUnsel=A(N,B,B.unselected),!B.unselected&&t(B.marker.opacity))){var Z=B.marker.opacity;for(U.markerUnsel.opacity=new Array(Z.length),R=0;R500?"bold":"normal":N}function x(N,B){var R=B._length,U=B.marker,j={},Z,re=t(U.symbol),fe=t(U.angle),le=t(U.color),ce=t(U.line.color),V=t(U.opacity),ee=t(U.size),ne=t(U.line.width),K;if(re||(K=s.isOpenSymbol(U.symbol)),re||le||ce||V||fe){j.symbols=new Array(R),j.angles=new Array(R),j.colors=new Array(R),j.borderColors=new Array(R);var ue=U.symbol,te=U.angle,H=n(U,U.opacity,R),ae=n(U.line,U.opacity,R);if(!t(ae[0])){var ie=ae;for(ae=Array(R),Z=0;Zf.TOO_MANY_POINTS||i.hasMarkers(B)?"rect":"round";if(ce&&B.connectgaps){var ee=Z[0],ne=Z[1];for(re=0;re1?le[re]:le[0]:le,K=t(ce)?ce.length>1?ce[re]:ce[0]:ce,ue=p[ne],te=p[K],H=V?V/.8+1:0,ae=-te*H-te*.5;Z.offset[re]=[ue*H/ee,ae/ee]}}return Z}G.exports={style:T,markerStyle:x,markerSelection:A,linePositions:L,errorBarPositions:z,textPosition:F}}}),nC=Ge({"src/traces/scattergl/scene_update.js"($,G){var h=gn();G.exports=function(S,E){var e=E._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 E._scene||(e=E._scene={},e.init=function(){h.extendFlat(e,r,t)},e.init(),e.update=function(n){var i=h.repeat(n,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var a=0;a=c,u=w*2,v={},y,I=A.makeCalcdata(g,"x"),L=M.makeCalcdata(g,"y"),z=e(g,A,"x",I),F=e(g,M,"y",L),N=z.vals,B=F.vals;g._x=N,g._y=B,g.xperiodalignment&&(g._origX=I,g._xStarts=z.starts,g._xEnds=z.ends),g.yperiodalignment&&(g._origY=L,g._yStarts=F.starts,g._yEnds=F.ends);var R=new Array(u),U=new Array(w);for(y=0;y1&&b.extendFlat(_.line,a.linePositions(T,g,x)),_.errorX||_.errorY){var w=a.errorBarPositions(T,g,x,A,M);_.errorX&&b.extendFlat(_.errorX,w.x),_.errorY&&b.extendFlat(_.errorY,w.y)}return _.text&&(b.extendFlat(_.text,{positions:x},a.textPosition(T,g,_.text,_.marker)),b.extendFlat(_.textSel,{positions:x},a.textPosition(T,g,_.text,_.markerSel)),b.extendFlat(_.textUnsel,{positions:x},a.textPosition(T,g,_.text,_.markerUnsel))),_}}}),aC=Ge({"src/traces/scattergl/edit_style.js"($,G){var h=gn(),b=_o(),S=cp().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,n=o._scene,i=o.index,a=n.selectBatch[i],s=n.unselectBatch[i],f=n.textOptions[i],c=n.textSelectedOptions[i]||{},p=n.textUnselectedOptions[i]||{},d=h.extendFlat({},f),T,l;if(a.length||s.length){var g=c.color,x=p.color,A=f.color,M=h.isArrayOrTypedArray(A);for(d.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,n=E&255;return e===!1?[t,r,o,n]:[t/255,r/255,o/255,n/255]}}}),_v=Ge({"node_modules/object-assign/index.js"($,G){var h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,n=E(t),i,a=1;av.length)&&(y=v.length);for(var I=0,L=new Array(y);I 1.0 + delta) { + discard; + } + + alpha -= smoothstep(1.0 - delta, 1.0 + delta, radius); + + float borderRadius = fragBorderRadius; + float ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius); + vec4 color = mix(fragColor, fragBorderColor, ratio); + color.a *= alpha * opacity; + gl_FragColor = color; +} +`]),le.vert=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; +} +`]),x&&(le.frag=le.frag.replace("smoothstep","smoothStep"),fe.frag=fe.frag.replace("smoothstep","smoothStep")),this.drawCircle=v(le)}w.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},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var v=this,y=arguments.length,I=new Array(y),L=0;LTe)?Qe.tree=c(nt,{bounds:rt}):Te&&Te.length&&(Qe.tree=Te),Qe.tree){var Ft={primitive:"points",usage:"static",data:Qe.tree,type:"uint32"};Qe.elements?Qe.elements(Ft):Qe.elements=N.elements(Ft)}var Nt=A.float32(nt);pe({data:Nt,usage:"dynamic"});var $t=A.fract32(nt,Nt);return Ne({data:$t,usage:"dynamic"}),ot({data:new Uint8Array(ct),type:"uint8",usage:"stream"}),nt}},{marker:function(nt,Qe,Le){var Te=Qe.activation;if(Te.forEach(function($t){return $t&&$t.destroy&&$t.destroy()}),Te.length=0,!nt||typeof nt[0]=="number"){var pe=v.addMarker(nt);Te[pe]=!0}else{for(var Ne=[],ot=0,ct=Math.min(nt.length,Qe.count);ot=0)return z;var F;if(v instanceof Uint8Array||v instanceof Uint8ClampedArray)F=v;else{F=new Uint8Array(v.length);for(var N=0,B=v.length;NL*4&&(this.tooManyColors=!0),this.updatePalette(I),z.length===1?z[0]:z},w.prototype.updatePalette=function(v){if(!this.tooManyColors){var y=this.maxColors,I=this.paletteTexture,L=Math.ceil(v.length*.25/y);if(L>1){v=v.slice();for(var z=v.length*.25%y;z80*R){fe=ce=N[0],le=V=N[1];for(var ue=R;uece&&(ce=ee),ne>V&&(V=ne);K=Math.max(ce-fe,V-le),K=K!==0?32767/K:0}return E(Z,re,R,fe,le,K,0),re}function b(N,B,R,U,j){var Z,re;if(j===F(N,B,R,U)>0)for(Z=B;Z=B;Z-=U)re=I(Z,N[Z],N[Z+1],re);return re&&A(re,re.next)&&(L(re),re=re.next),re}function S(N,B){if(!N)return N;B||(B=N);var R=N,U;do if(U=!1,!R.steiner&&(A(R,R.next)||x(R.prev,R,R.next)===0)){if(L(R),R=B=R.prev,R===R.next)break;U=!0}else R=R.next;while(U||R!==B);return B}function E(N,B,R,U,j,Z,re){if(N){!re&&Z&&c(N,U,j,Z);for(var fe=N,le,ce;N.prev!==N.next;){if(le=N.prev,ce=N.next,Z?t(N,U,j,Z):e(N)){B.push(le.i/R|0),B.push(N.i/R|0),B.push(ce.i/R|0),L(N),N=ce.next,fe=ce.next;continue}if(N=ce,N===fe){re?re===1?(N=r(S(N),B,R),E(N,B,R,U,j,Z,2)):re===2&&o(N,B,R,U,j,Z):E(S(N),B,R,U,j,Z,1);break}}}}function e(N){var B=N.prev,R=N,U=N.next;if(x(B,R,U)>=0)return!1;for(var j=B.x,Z=R.x,re=U.x,fe=B.y,le=R.y,ce=U.y,V=jZ?j>re?j:re:Z>re?Z:re,K=fe>le?fe>ce?fe:ce:le>ce?le:ce,ue=U.next;ue!==B;){if(ue.x>=V&&ue.x<=ne&&ue.y>=ee&&ue.y<=K&&l(j,fe,Z,le,re,ce,ue.x,ue.y)&&x(ue.prev,ue,ue.next)>=0)return!1;ue=ue.next}return!0}function t(N,B,R,U){var j=N.prev,Z=N,re=N.next;if(x(j,Z,re)>=0)return!1;for(var fe=j.x,le=Z.x,ce=re.x,V=j.y,ee=Z.y,ne=re.y,K=fele?fe>ce?fe:ce:le>ce?le:ce,H=V>ee?V>ne?V:ne:ee>ne?ee:ne,ae=d(K,ue,B,R,U),ie=d(te,H,B,R,U),ve=N.prevZ,Ae=N.nextZ;ve&&ve.z>=ae&&Ae&&Ae.z<=ie;){if(ve.x>=K&&ve.x<=te&&ve.y>=ue&&ve.y<=H&&ve!==j&&ve!==re&&l(fe,V,le,ee,ce,ne,ve.x,ve.y)&&x(ve.prev,ve,ve.next)>=0||(ve=ve.prevZ,Ae.x>=K&&Ae.x<=te&&Ae.y>=ue&&Ae.y<=H&&Ae!==j&&Ae!==re&&l(fe,V,le,ee,ce,ne,Ae.x,Ae.y)&&x(Ae.prev,Ae,Ae.next)>=0))return!1;Ae=Ae.nextZ}for(;ve&&ve.z>=ae;){if(ve.x>=K&&ve.x<=te&&ve.y>=ue&&ve.y<=H&&ve!==j&&ve!==re&&l(fe,V,le,ee,ce,ne,ve.x,ve.y)&&x(ve.prev,ve,ve.next)>=0)return!1;ve=ve.prevZ}for(;Ae&&Ae.z<=ie;){if(Ae.x>=K&&Ae.x<=te&&Ae.y>=ue&&Ae.y<=H&&Ae!==j&&Ae!==re&&l(fe,V,le,ee,ce,ne,Ae.x,Ae.y)&&x(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.nextZ}return!0}function r(N,B,R){var U=N;do{var j=U.prev,Z=U.next.next;!A(j,Z)&&M(j,U,U.next,Z)&&u(j,Z)&&u(Z,j)&&(B.push(j.i/R|0),B.push(U.i/R|0),B.push(Z.i/R|0),L(U),L(U.next),U=N=Z),U=U.next}while(U!==N);return S(U)}function o(N,B,R,U,j,Z){var re=N;do{for(var fe=re.next.next;fe!==re.prev;){if(re.i!==fe.i&&g(re,fe)){var le=y(re,fe);re=S(re,re.next),le=S(le,le.next),E(re,B,R,U,j,Z,0),E(le,B,R,U,j,Z,0);return}fe=fe.next}re=re.next}while(re!==N)}function n(N,B,R,U){var j=[],Z,re,fe,le,ce;for(Z=0,re=B.length;Z=R.next.y&&R.next.y!==R.y){var fe=R.x+(j-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(fe<=U&&fe>Z&&(Z=fe,re=R.x=R.x&&R.x>=ce&&U!==R.x&&l(jre.x||R.x===re.x&&f(re,R)))&&(re=R,ee=ne)),R=R.next;while(R!==le);return re}function f(N,B){return x(N.prev,N,B.prev)<0&&x(B.next,N,N.next)<0}function c(N,B,R,U){var j=N;do j.z===0&&(j.z=d(j.x,j.y,B,R,U)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==N);j.prevZ.nextZ=null,j.prevZ=null,p(j)}function p(N){var B,R,U,j,Z,re,fe,le,ce=1;do{for(R=N,N=null,Z=null,re=0;R;){for(re++,U=R,fe=0,B=0;B0||le>0&&U;)fe!==0&&(le===0||!U||R.z<=U.z)?(j=R,R=R.nextZ,fe--):(j=U,U=U.nextZ,le--),Z?Z.nextZ=j:N=j,j.prevZ=Z,Z=j;R=U}Z.nextZ=null,ce*=2}while(re>1);return N}function d(N,B,R,U,j){return N=(N-R)*j|0,B=(B-U)*j|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,N|B<<1}function T(N){var B=N,R=N;do(B.x=(N-re)*(Z-fe)&&(N-re)*(U-fe)>=(R-re)*(B-fe)&&(R-re)*(Z-fe)>=(j-re)*(U-fe)}function g(N,B){return N.next.i!==B.i&&N.prev.i!==B.i&&!m(N,B)&&(u(N,B)&&u(B,N)&&v(N,B)&&(x(N.prev,N,B.prev)||x(N,B.prev,B))||A(N,B)&&x(N.prev,N,N.next)>0&&x(B.prev,B,B.next)>0)}function x(N,B,R){return(B.y-N.y)*(R.x-B.x)-(B.x-N.x)*(R.y-B.y)}function A(N,B){return N.x===B.x&&N.y===B.y}function M(N,B,R,U){var j=w(x(N,B,R)),Z=w(x(N,B,U)),re=w(x(R,U,N)),fe=w(x(R,U,B));return!!(j!==Z&&re!==fe||j===0&&_(N,R,B)||Z===0&&_(N,U,B)||re===0&&_(R,N,U)||fe===0&&_(R,B,U))}function _(N,B,R){return B.x<=Math.max(N.x,R.x)&&B.x>=Math.min(N.x,R.x)&&B.y<=Math.max(N.y,R.y)&&B.y>=Math.min(N.y,R.y)}function w(N){return N>0?1:N<0?-1:0}function m(N,B){var R=N;do{if(R.i!==N.i&&R.next.i!==N.i&&R.i!==B.i&&R.next.i!==B.i&&M(R,R.next,N,B))return!0;R=R.next}while(R!==N);return!1}function u(N,B){return x(N.prev,N,N.next)<0?x(N,B,N.next)>=0&&x(N,N.prev,B)>=0:x(N,B,N.prev)<0||x(N,N.next,B)<0}function v(N,B){var R=N,U=!1,j=(N.x+B.x)/2,Z=(N.y+B.y)/2;do R.y>Z!=R.next.y>Z&&R.next.y!==R.y&&j<(R.next.x-R.x)*(Z-R.y)/(R.next.y-R.y)+R.x&&(U=!U),R=R.next;while(R!==N);return U}function y(N,B){var R=new z(N.i,N.x,N.y),U=new z(B.i,B.x,B.y),j=N.next,Z=B.prev;return N.next=B,B.prev=N,R.next=j,j.prev=R,U.next=R,R.prev=U,Z.next=U,U.prev=Z,U}function I(N,B,R,U){var j=new z(N,B,R);return U?(j.next=U.next,j.prev=U,U.next.prev=j,U.next=j):(j.prev=j,j.next=j),j}function L(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function z(N,B,R){this.i=N,this.x=B,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h.deviation=function(N,B,R,U){var j=B&&B.length,Z=j?B[0]*R:N.length,re=Math.abs(F(N,0,Z,R));if(j)for(var fe=0,le=B.length;fe0&&(U+=N[j-1].length,R.holes.push(U))}return R}}}),PR=Ge({"node_modules/array-normalize/index.js"($,G){var h=Yb();G.exports=b;function b(S,E,e){if(!S||S.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=h(S,E));for(var t=0;t-1}}}),vC=Ge({"node_modules/es5-ext/string/#/contains/index.js"($,G){G.exports=HR()()?String.prototype.contains:GR()}}),Gy=Ge({"node_modules/d/index.js"($,G){var h=Kb(),b=fC(),S=AE(),E=hC(),e=vC(),t=G.exports=function(r,o){var n,i,a,s,f;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],h(r)?(n=e.call(r,"c"),i=e.call(r,"e"),a=e.call(r,"w")):(n=a=!0,i=!1),f={value:o,configurable:n,enumerable:i,writable:a},s?S(E(s),f):f};t.gs=function(r,o,n){var i,a,s,f;return typeof r!="string"?(s=n,n=o,o=r,r=null):s=arguments[3],h(o)?b(o)?h(n)?b(n)||(s=n,n=void 0):n=void 0:(s=o,o=n=void 0):o=void 0,h(r)?(i=e.call(r,"c"),a=e.call(r,"e")):(i=!0,a=!1),f={get:o,set:n,configurable:i,enumerable:a},s?S(E(s),f):f}}}),WA=Ge({"node_modules/es5-ext/function/is-arguments.js"($,G){var h=Object.prototype.toString,b=h.call((function(){return arguments})());G.exports=function(S){return h.call(S)===b}}}),KA=Ge({"node_modules/es5-ext/string/is-string.js"($,G){var h=Object.prototype.toString,b=h.call("");G.exports=function(S){return typeof S=="string"||S&&typeof S=="object"&&(S instanceof String||h.call(S)===b)||!1}}}),XR=Ge({"node_modules/ext/global-this/is-implemented.js"($,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),YR=Ge({"node_modules/ext/global-this/implementation.js"($,G){var h=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return h()}try{return __global__||h()}finally{delete Object.prototype.__global__}})()}}),$A=Ge({"node_modules/ext/global-this/index.js"($,G){G.exports=XR()()?globalThis:YR()}}),ZR=Ge({"node_modules/es6-symbol/is-implemented.js"($,G){var h=$A(),b={object:!0,symbol:!0};G.exports=function(){var S=h.Symbol,E;if(typeof S!="function")return!1;E=S("test symbol");try{String(E)}catch{return!1}return!(!b[typeof S.iterator]||!b[typeof S.toPrimitive]||!b[typeof S.toStringTag])}}}),WR=Ge({"node_modules/es6-symbol/is-symbol.js"($,G){G.exports=function(h){return h?typeof h=="symbol"?!0:!h.constructor||h.constructor.name!=="Symbol"?!1:h[h.constructor.toStringTag]==="Symbol":!1}}}),dC=Ge({"node_modules/es6-symbol/validate-symbol.js"($,G){var h=WR();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not a symbol");return b}}}),KR=Ge({"node_modules/es6-symbol/lib/private/generate-name.js"($,G){var h=Gy(),b=Object.create,S=Object.defineProperty,E=Object.prototype,e=b(null);G.exports=function(t){for(var r=0,o,n;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,S(E,o,h.gs(null,function(i){n||(n=!0,S(this,o,h(i)),n=!1)})),o}}}),$R=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"($,G){var h=Gy(),b=$A().Symbol;G.exports=function(S){return Object.defineProperties(S,{hasInstance:h("",b&&b.hasInstance||S("hasInstance")),isConcatSpreadable:h("",b&&b.isConcatSpreadable||S("isConcatSpreadable")),iterator:h("",b&&b.iterator||S("iterator")),match:h("",b&&b.match||S("match")),replace:h("",b&&b.replace||S("replace")),search:h("",b&&b.search||S("search")),species:h("",b&&b.species||S("species")),split:h("",b&&b.split||S("split")),toPrimitive:h("",b&&b.toPrimitive||S("toPrimitive")),toStringTag:h("",b&&b.toStringTag||S("toStringTag")),unscopables:h("",b&&b.unscopables||S("unscopables"))})}}}),JR=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"($,G){var h=Gy(),b=dC(),S=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:h(function(e){return S[e]?S[e]:S[e]=E(String(e))}),keyFor:h(function(e){var t;b(e);for(t in S)if(S[t]===e)return t})})}}}),QR=Ge({"node_modules/es6-symbol/polyfill.js"($,G){var h=Gy(),b=dC(),S=$A().Symbol,E=KR(),e=$R(),t=JR(),r=Object.create,o=Object.defineProperties,n=Object.defineProperty,i,a,s;if(typeof S=="function")try{String(S()),s=!0}catch{}else S=null;a=function(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return i(c)},G.exports=i=function f(c){var p;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?S(c):(p=r(a.prototype),c=c===void 0?"":String(c),o(p,{__description__:h("",c),__name__:h("",E(c))}))},e(i),t(i),o(a.prototype,{constructor:h(i),toString:h("",function(){return this.__name__})}),o(i.prototype,{toString:h(function(){return"Symbol ("+b(this).__description__+")"}),valueOf:h(function(){return b(this)})}),n(i.prototype,i.toPrimitive,h("",function(){var f=b(this);return typeof f=="symbol"?f:f.toString()})),n(i.prototype,i.toStringTag,h("c","Symbol")),n(a.prototype,i.toStringTag,h("c",i.prototype[i.toStringTag])),n(a.prototype,i.toPrimitive,h("c",i.prototype[i.toPrimitive]))}}),F_=Ge({"node_modules/es6-symbol/index.js"($,G){G.exports=ZR()()?$A().Symbol:QR()}}),eI=Ge({"node_modules/es5-ext/array/#/clear.js"($,G){var h=Hy();G.exports=function(){return h(this).length=0,this}}}),U3=Ge({"node_modules/es5-ext/object/valid-callable.js"($,G){G.exports=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h}}}),tI=Ge({"node_modules/type/string/coerce.js"($,G){var h=Kb(),b=TE(),S=Object.prototype.toString;G.exports=function(E){if(!h(E))return null;if(b(E)){var e=E.toString;if(typeof e!="function"||e===S)return null}try{return""+E}catch{return null}}}}),rI=Ge({"node_modules/type/lib/safe-to-string.js"($,G){G.exports=function(h){try{return h.toString()}catch{try{return String(h)}catch{return null}}}}}),nI=Ge({"node_modules/type/lib/to-short-string.js"($,G){var h=rI(),b=/[\n\r\u2028\u2029]/g;G.exports=function(S){var E=h(S);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(b,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")}}),E)}}}),pC=Ge({"node_modules/type/lib/resolve-exception.js"($,G){var h=Kb(),b=TE(),S=tI(),E=nI(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!b(o))throw new TypeError(e(r,t));if(!h(t)){if("default"in o)return o.default;if(o.isOptional)return null}var n=S(o.errorMessage);throw h(n)||(n=r),new TypeError(e(n,t))}}}),aI=Ge({"node_modules/type/value/ensure.js"($,G){var h=pC(),b=Kb();G.exports=function(S){return b(S)?S:h(S,"Cannot use %v",arguments[1])}}}),iI=Ge({"node_modules/type/plain-function/ensure.js"($,G){var h=pC(),b=fC();G.exports=function(S){return b(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),oI=Ge({"node_modules/es5-ext/array/from/is-implemented.js"($,G){G.exports=function(){var h=Array.from,b,S;return typeof h!="function"?!1:(b=["raz","dwa"],S=h(b),!!(S&&S!==b&&S[1]==="dwa"))}}}),sI=Ge({"node_modules/es5-ext/function/is-function.js"($,G){var h=Object.prototype.toString,b=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(S){return typeof S=="function"&&b(h.call(S))}}}),lI=Ge({"node_modules/es5-ext/math/sign/is-implemented.js"($,G){G.exports=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1}}}),uI=Ge({"node_modules/es5-ext/math/sign/shim.js"($,G){G.exports=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}}}),cI=Ge({"node_modules/es5-ext/math/sign/index.js"($,G){G.exports=lI()()?Math.sign:uI()}}),fI=Ge({"node_modules/es5-ext/number/to-integer.js"($,G){var h=cI(),b=Math.abs,S=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:h(E)*S(b(E)))}}}),hI=Ge({"node_modules/es5-ext/number/to-pos-integer.js"($,G){var h=fI(),b=Math.max;G.exports=function(S){return b(0,h(S))}}}),vI=Ge({"node_modules/es5-ext/array/from/shim.js"($,G){var h=F_().iterator,b=WA(),S=sI(),E=hI(),e=U3(),t=Hy(),r=O_(),o=KA(),n=Array.isArray,i=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(f){var c=arguments[1],p=arguments[2],d,T,l,g,x,A,M,_,w,m;if(f=Object(t(f)),r(c)&&e(c),!this||this===Array||!S(this)){if(!c){if(b(f))return x=f.length,x!==1?Array.apply(null,f):(g=new Array(1),g[0]=f[0],g);if(n(f)){for(g=new Array(x=f.length),T=0;T=55296&&A<=56319&&(m+=f[++T])),m=c?i.call(c,p,m,l):m,d?(a.value=m,s(g,l,a)):g[l]=m,++l;x=l}}if(x===void 0)for(x=E(f.length),d&&(g=new d(x)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[a]));return}this.__redo__.forEach(function(s,f){s>=a&&(this.__redo__[f]=++s)},this),this.__redo__.push(a)}}),_onDelete:e(function(a){var s;a>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(a),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(f,c){f>a&&(this.__redo__[c]=--f)},this)))}),_onClear:e(function(){this.__redo__&&h.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),xI=Ge({"node_modules/es6-iterator/array.js"($,G){var h=wE(),b=vC(),S=Gy(),E=F_(),e=mC(),t=Object.defineProperty,r;r=G.exports=function(o,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),n?b.call(n,"key+value")?n="key+value":b.call(n,"key")?n="key":n="value":n="value",t(this,"__kind__",S("",n))},h&&h(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:S(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,S("c","Array Iterator"))}}),bI=Ge({"node_modules/es6-iterator/string.js"($,G){var h=wE(),b=Gy(),S=F_(),E=mC(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",b("",r.length))},h&&h(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:b(function(){if(this.__list__){if(this.__nextIndex__=55296&&n<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,S.toStringTag,b("c","String Iterator"))}}),wI=Ge({"node_modules/es6-iterator/is-iterable.js"($,G){var h=WA(),b=O_(),S=KA(),E=F_().iterator,e=Array.isArray;G.exports=function(t){return b(t)?e(t)||S(t)||h(t)?!0:typeof t[E]=="function":!1}}}),TI=Ge({"node_modules/es6-iterator/valid-iterable.js"($,G){var h=wI();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not iterable");return b}}}),gC=Ge({"node_modules/es6-iterator/get.js"($,G){var h=WA(),b=KA(),S=xI(),E=bI(),e=TI(),t=F_().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():h(r)?new S(r):b(r)?new E(r):new S(r)}}}),AI=Ge({"node_modules/es6-iterator/for-of.js"($,G){var h=WA(),b=U3(),S=KA(),E=gC(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,n){var i,a=arguments[2],s,f,c,p,d,T,l;if(e(o)||h(o)?i="array":S(o)?i="string":o=E(o),b(n),f=function(){c=!0},i==="array"){r.call(o,function(g){return t.call(n,a,g,f),c});return}if(i==="string"){for(d=o.length,p=0;p=55296&&l<=56319&&(T+=o[++p])),t.call(n,a,T,f),!c);++p);return}for(s=o.next();!s.done;){if(t.call(n,a,s.value,f),c)return;s=o.next()}}}}),SI=Ge({"node_modules/es6-weak-map/is-native-implemented.js"($,G){G.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),MI=Ge({"node_modules/es6-weak-map/polyfill.js"($,G){var h=O_(),b=wE(),S=zR(),E=Hy(),e=OR(),t=Gy(),r=gC(),o=AI(),n=F_().toStringTag,i=SI(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,c=Object.getPrototypeOf,p;G.exports=p=function(){var d=arguments[0],T;if(!(this instanceof p))throw new TypeError("Constructor requires 'new'");return T=i&&b&&WeakMap!==p?b(new WeakMap,c(this)):this,h(d)&&(a(d)||(d=r(d))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),d&&o(d,function(l){E(l),T.set(l[0],l[1])}),T},i&&(b&&b(p,WeakMap),p.prototype=Object.create(WeakMap.prototype,{constructor:t(p)})),Object.defineProperties(p.prototype,{delete:t(function(d){return f.call(S(d),this.__weakMapData__)?(delete d[this.__weakMapData__],!0):!1}),get:t(function(d){if(f.call(S(d),this.__weakMapData__))return d[this.__weakMapData__]}),has:t(function(d){return f.call(S(d),this.__weakMapData__)}),set:t(function(d,T){return s(S(d),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(p.prototype,n,t("c","WeakMap"))}}),yC=Ge({"node_modules/es6-weak-map/index.js"($,G){G.exports=RR()()?WeakMap:MI()}}),EI=Ge({"node_modules/array-find-index/index.js"($,G){G.exports=function(h,b,S){if(typeof Array.prototype.findIndex=="function")return h.findIndex(b,S);if(typeof b!="function")throw new TypeError("predicate must be a function");var E=Object(h),e=E.length;if(e===0)return-1;for(var t=0;t 0. && baClipping < length(normalWidth * endBotJoin)) { + //handle miter clipping + bTopCoord -= normalWidth * endTopJoin; + bTopCoord += normalize(endTopJoin * normalWidth) * baClipping; + } + + if (nextReverse) { + //make join rectangular + vec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5; + float normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.); + bBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5; + bTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5; + } + else if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) { + //handle miter clipping + aBotCoord -= normalWidth * startBotJoin; + aBotCoord += normalize(startBotJoin * normalWidth) * abClipping; + } + + vec2 aTopPosition = (aTopCoord) * adjustedScale + translate; + vec2 aBotPosition = (aBotCoord) * adjustedScale + translate; + + vec2 bTopPosition = (bTopCoord) * adjustedScale + translate; + vec2 bBotPosition = (bBotCoord) * adjustedScale + translate; + + //position is normalized 0..1 coord on the screen + vec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd; + + startCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy; + endCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2.0 - 1.0, depth, 1); + + enableStartMiter = step(dot(currTangent, prevTangent), .5); + enableEndMiter = step(dot(currTangent, nextTangent), .5); + + //bevel miter cutoffs + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } + + //round miter cutoffs + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + vec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5; + startCutoff = vec4(aCoord, aCoord); + startCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio; + startCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + startCutoff += viewport.xyxy; + startCutoff += startMiterWidth.xyxy; + } + + if (enableEndMiter == 1.) { + vec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5; + endCutoff = vec4(bCoord, bCoord); + endCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio; + endCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw; + endCutoff += viewport.xyxy; + endCutoff += endMiterWidth.xyxy; + } + } +} +`,l=` +precision highp float; + +uniform float dashLength, pixelRatio, thickness, opacity, id, miterMode; +uniform sampler2D dashTexture; + +varying vec4 fragColor; +varying vec2 tangent; +varying vec4 startCutoff, endCutoff; +varying vec2 startCoord, endCoord; +varying float enableStartMiter, enableEndMiter; + +float distToLine(vec2 p, vec2 a, vec2 b) { + vec2 diff = b - a; + vec2 perp = normalize(vec2(-diff.y, diff.x)); + return dot(p - a, perp); +} + +void main() { + float alpha = 1., distToStart, distToEnd; + float cutoff = thickness * .5; + + //bevel miter + if (miterMode == 1.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < -1.) { + discard; + return; + } + alpha *= min(max(distToStart + 1., 0.), 1.); + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < -1.) { + discard; + return; + } + alpha *= min(max(distToEnd + 1., 0.), 1.); + } + } + + // round miter + else if (miterMode == 2.) { + if (enableStartMiter == 1.) { + distToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw); + if (distToStart < 0.) { + float radius = length(gl_FragCoord.xy - startCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + + if (enableEndMiter == 1.) { + distToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw); + if (distToEnd < 0.) { + float radius = length(gl_FragCoord.xy - endCoord); + + if(radius > cutoff + .5) { + discard; + return; + } + + alpha -= smoothstep(cutoff - .5, cutoff + .5, radius); + } + } + } + + float t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25; + float dash = texture2D(dashTexture, vec2(t, .5)).r; + + gl_FragColor = fragColor; + gl_FragColor.a *= alpha * opacity * dash; +} +`;G.exports=g;function g(x,A){if(!(this instanceof g))return new g(x,A);if(typeof x=="function"?(A||(A={}),A.regl=x):A=x,A.length&&(A.positions=A),x=A.regl,!x.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=x._gl,this.regl=x,this.passes=[],this.shaders=g.shaders.has(x)?g.shaders.get(x):g.shaders.set(x,g.createShaders(x)).get(x),this.update(A)}g.dashMult=2,g.maxPatternLength=256,g.precisionThreshold=3e6,g.maxPoints=1e4,g.maxLines=2048,g.shaders=new i,g.createShaders=function(x){let A=x.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:x.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,v)=>v.join==="round"?2:1,miterLimit:x.prop("miterLimit"),scale:x.prop("scale"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),thickness:x.prop("thickness"),dashTexture:x.prop("dashTexture"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),dashLength:x.prop("dashLength"),viewport:(u,v)=>[v.viewport.x,v.viewport.y,u.viewportWidth,u.viewportHeight],depth:x.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,v)=>!v.overlay},stencil:{enable:!1},scissor:{enable:!0,box:x.prop("viewport")},viewport:x.prop("viewport")},_=x(S({vert:f,frag:c,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=x(S({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aColor:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:x.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:x({primitive:"triangle",elements:(u,v)=>v.triangles,offset:0,vert:p,frag:d,uniforms:{scale:x.prop("scale"),color:x.prop("fill"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),viewport:(u,v)=>[v.viewport.x,v.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:x.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},g.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},g.prototype.render=function(...x){x.length&&this.update(...x),this.draw()},g.prototype.draw=function(...x){return(x.length?x:this.passes).forEach((A,M)=>{if(A&&Array.isArray(A))return this.draw(...A);typeof A=="number"&&(A=this.passes[A]),A&&A.count>1&&A.opacity&&(this.regl._refresh(),A.fill&&A.triangles&&A.triangles.length>2&&this.shaders.fill(A),A.thickness&&(A.scale[0]*A.viewport.width>g.precisionThreshold||A.scale[1]*A.viewport.height>g.precisionThreshold?this.shaders.rect(A):A.join==="rect"||!A.join&&(A.thickness<=2||A.count>=g.maxPoints)?this.shaders.rect(A):this.shaders.miter(A)))}),this},g.prototype.update=function(x){if(!x)return;x.length!=null?typeof x[0]=="number"&&(x=[{positions:x}]):Array.isArray(x)||(x=[x]);let{regl:A,gl:M}=this;if(x.forEach((w,m)=>{let u=this.passes[m];if(w!==void 0){if(w===null){this.passes[m]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{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[m]=u={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:A.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:A.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=S({},g.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,mle-ce),Z=[],re=0,fe=u.hole!=null?u.hole[0]:null;if(fe!=null){let le=s(j,ce=>ce>=fe);j=j.slice(0,le),j.push(fe)}for(let le=0;lene-fe+(j[le]-re)),ee=t(ce,V);ee=ee.map(ne=>ne+re+(ne+re{x.colorBuffer.destroy(),x.positionBuffer.destroy(),x.dashTexture.destroy()}),this.passes.length=0,this}}}),kI=Ge({"node_modules/regl-error2d/index.js"($,G){var h=Yb(),b=P_(),S=oC(),E=Dg(),e=_v(),t=Zb(),{float32:r,fract32:o}=bE();G.exports=i;var n=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(a,s){if(typeof a=="function"?(s||(s={}),s.regl=a):s=a,s.length&&(s.positions=s),a=s.regl,!a.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let f=a._gl,c,p,d,T,l,g,x={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},A=[];return T=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=a.buffer({usage:"static",type:"float",data:n}),m(s),c=a({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:a.prop("range"),lineWidth:a.prop("lineWidth"),capSize:a.prop("capSize"),opacity:a.prop("opacity"),scale:a.prop("scale"),translate:a.prop("translate"),scaleFract:a.prop("scaleFract"),translateFract:a.prop("translateFract"),viewport:(v,y)=>[y.viewport.x,y.viewport.y,v.viewportWidth,v.viewportHeight]},attributes:{color:{buffer:T,offset:(v,y)=>y.offset*4,divisor:1},position:{buffer:p,offset:(v,y)=>y.offset*8,divisor:1},positionFract:{buffer:d,offset:(v,y)=>y.offset*8,divisor:1},error:{buffer:l,offset:(v,y)=>y.offset*16,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,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:a.prop("viewport")},viewport:a.prop("viewport"),stencil:!1,instances:a.prop("count"),count:n.length}),e(M,{update:m,draw:_,destroy:u,regl:a,gl:f,canvas:f.canvas,groups:A}),M;function M(v){v?m(v):v===null&&u(),_()}function _(v){if(typeof v=="number")return w(v);v&&!Array.isArray(v)&&(v=[v]),a._refresh(),A.forEach((y,I)=>{if(y){if(v&&(v[I]?y.draw=!0:y.draw=!1),!y.draw){y.draw=!0;return}w(I)}})}function w(v){typeof v=="number"&&(v=A[v]),v!=null&&v&&v.count&&v.color&&v.opacity&&v.positions&&v.positions.length>1&&(v.scaleRatio=[v.scale[0]*v.viewport.width,v.scale[1]*v.viewport.height],c(v),v.after&&v.after(v))}function m(v){if(!v)return;v.length!=null?typeof v[0]=="number"&&(v=[{positions:v}]):Array.isArray(v)||(v=[v]);let y=0,I=0;if(M.groups=A=v.map((F,N)=>{let B=A[N];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return B;return F=E(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"}),B||(A[N]=B={id:N,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},x,F)),S(B,F,[{lineWidth:R=>+R*.5,capSize:R=>+R*.5,opacity:parseFloat,errors:R=>(R=t(R),I+=R.length,R),positions:(R,U)=>(R=t(R,"float64"),U.count=Math.floor(R.length/2),U.bounds=h(R,2),U.offset=y,y+=U.count,R)},{color:(R,U)=>{let j=U.count;if(R||(R="transparent"),!Array.isArray(R)||typeof R[0]=="number"){let re=R;R=Array(j);for(let fe=0;fe{let Z=U.bounds;return R||(R=Z),U.scale=[1/(R[2]-R[0]),1/(R[3]-R[1])],U.translate=[-R[0],-R[1]],U.scaleFract=o(U.scale),U.translateFract=o(U.translate),R},viewport:R=>{let U;return Array.isArray(R)?U={x:R[0],y:R[1],width:R[2]-R[0],height:R[3]-R[1]}:R?(U={x:R.x||R.left||0,y:R.y||R.top||0},R.right?U.width=R.right-U.x:U.width=R.w||R.width||0,R.bottom?U.height=R.bottom-U.y:U.height=R.h||R.height||0):U={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},U}}]),B}),y||I){let F=A.reduce((U,j,Z)=>U+(j?j.count:0),0),N=new Float64Array(F*2),B=new Uint8Array(F*4),R=new Float32Array(F*4);A.forEach((U,j)=>{if(!U)return;let{positions:Z,count:re,offset:fe,color:le,errors:ce}=U;re&&(B.set(le,fe*4),R.set(ce,fe*4),N.set(Z,fe*2))});var L=r(N);p(L);var z=o(N,L);d(z),T(B),l(R)}}function u(){p.destroy(),d.destroy(),T.destroy(),l.destroy(),g.destroy()}}}}),CI=Ge({"node_modules/unquote/index.js"($,G){var h=/[\'\"]/;G.exports=function(S){return S?(h.test(S.charAt(0))&&(S=S.substr(1)),h.test(S.charAt(S.length-1))&&(S=S.substr(0,S.length-1)),S):""}}}),xC=Ge({"node_modules/css-global-keywords/index.json"($,G){G.exports=["inherit","initial","unset"]}}),bC=Ge({"node_modules/css-system-font-keywords/index.json"($,G){G.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),wC=Ge({"node_modules/css-font-weight-keywords/index.json"($,G){G.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),TC=Ge({"node_modules/css-font-style-keywords/index.json"($,G){G.exports=["normal","italic","oblique"]}}),AC=Ge({"node_modules/css-font-stretch-keywords/index.json"($,G){G.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),LI=Ge({"node_modules/parenthesis/index.js"($,G){function h(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",n=!!e.flat;r.forEach(function(s){var f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),c=[];function p(d,T,l){var g=t.push(d.slice(s[0].length,-s[1].length))-1;return c.push(g),o+g+o}t.forEach(function(d,T){for(var l,g=0;d!=l;)if(l=d,d=d.replace(f,p),g++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=d}),c=c.reverse(),t=t.map(function(d){return c.forEach(function(T){d=d.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),d})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(s,f,c){for(var p=[],d,T=0;d=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");p.push(s.slice(0,d.index)),p.push(a(f[d[1]],f)),s=s.slice(d.index+d[0].length)}return p.push(s),p}return n?t:a(t[0],t)}function b(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var n=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(n,a)}return r}return E.reduce(function s(f,c){return Array.isArray(c)&&(c=c.reduce(s,"")),f+c},"");function a(s,f){if(E[f]==null)throw Error("Reference "+f+"is undefined");return E[f]}}function S(E,e){return Array.isArray(E)?b(E,e):h(E,e)}S.parse=h,S.stringify=b,G.exports=S}}),PI=Ge({"node_modules/string-split-by/index.js"($,G){var h=LI();G.exports=function(S,E,e){if(S==null)throw Error("First argument should be a string");if(E==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=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(f){return f.length===1&&(f=f+f),f}));var t=h.parse(S,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var n=[],i=0;i1&&gr===br&&(gr==='"'||gr==="'"))return['"'+r(dt.substr(1,dt.length-2))+'"'];var Cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(dt);if(Cn)return o(dt.substr(0,Cn.index)).concat(o(Cn[1])).concat(o(dt.substr(Cn.index+Cn[0].length)));var ua=dt.split(".");if(ua.length===1)return['"'+r(dt)+'"'];for(var mn=[],dn=0;dn"u"?1:window.devicePixelRatio,Ya=!1,Oi={},pi=function(tn){},Ha=function(){};if(typeof gr=="string"?br=document.querySelector(gr):typeof gr=="object"&&(g(gr)?br=gr:x(gr)?(mn=gr,ua=mn.canvas):("gl"in gr?mn=gr.gl:"canvas"in gr?ua=M(gr.canvas):"container"in gr&&(Cn=M(gr.container)),"attributes"in gr&&(dn=gr.attributes),"extensions"in gr&&(Da=A(gr.extensions)),"optionalExtensions"in gr&&(Ra=A(gr.optionalExtensions)),"onDone"in gr&&(pi=gr.onDone),"profile"in gr&&(Ya=!!gr.profile),"pixelRatio"in gr&&(Ia=+gr.pixelRatio),"cachedCode"in gr&&(Oi=gr.cachedCode))),br&&(br.nodeName.toLowerCase()==="canvas"?ua=br:Cn=br),!mn){if(!ua){var pa=T(Cn||document.body,pi,Ia);if(!pa)return null;ua=pa.canvas,Ha=pa.onDestroy}dn.premultipliedAlpha===void 0&&(dn.premultipliedAlpha=!0),mn=l(ua,dn)}return mn?{gl:mn,canvas:ua,container:Cn,extensions:Da,optionalExtensions:Ra,pixelRatio:Ia,profile:Ya,cachedCode:Oi,onDone:pi,onDestroy:Ha}:(Ha(),pi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(dt,gr){var br={};function Cn(dn){var Da=dn.toLowerCase(),Ra;try{Ra=br[Da]=dt.getExtension(Da)}catch{}return!!Ra}for(var ua=0;ua65535)<<4,dt>>>=gr,br=(dt>255)<<3,dt>>>=br,gr|=br,br=(dt>15)<<2,dt>>>=br,gr|=br,br=(dt>3)<<1,dt>>>=br,gr|=br,gr|dt>>1}function R(){var dt=m(8,function(){return[]});function gr(mn){var dn=N(mn),Da=dt[B(dn)>>2];return Da.length>0?Da.pop():new ArrayBuffer(dn)}function br(mn){dt[B(mn.byteLength)>>2].push(mn)}function Cn(mn,dn){var Da=null;switch(mn){case u:Da=new Int8Array(gr(dn),0,dn);break;case v:Da=new Uint8Array(gr(dn),0,dn);break;case y:Da=new Int16Array(gr(2*dn),0,dn);break;case I:Da=new Uint16Array(gr(2*dn),0,dn);break;case L:Da=new Int32Array(gr(4*dn),0,dn);break;case z:Da=new Uint32Array(gr(4*dn),0,dn);break;case F:Da=new Float32Array(gr(4*dn),0,dn);break;default:return null}return Da.length!==dn?Da.subarray(0,dn):Da}function ua(mn){br(mn.buffer)}return{alloc:gr,free:br,allocType:Cn,freeType:ua}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,K=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,ve=35660,Ae=34930,Ce=36349,Fe=34076,ze=34024,Ye=7936,it=7937,st=7938,nt=35724,Qe=34047,Le=36063,Te=34852,pe=3553,Ne=34067,ot=34069,ct=33984,rt=6408,Ft=5126,Nt=5121,$t=36160,rr=36053,Mr=36064,Sr=16384,Zr=function(dt,gr){var br=1;gr.ext_texture_filter_anisotropic&&(br=dt.getParameter(Qe));var Cn=1,ua=1;gr.webgl_draw_buffers&&(Cn=dt.getParameter(Te),ua=dt.getParameter(Le));var mn=!!gr.oes_texture_float;if(mn){var dn=dt.createTexture();dt.bindTexture(pe,dn),dt.texImage2D(pe,0,rt,1,1,0,rt,Ft,null);var Da=dt.createFramebuffer();if(dt.bindFramebuffer($t,Da),dt.framebufferTexture2D($t,Mr,pe,dn,0),dt.bindTexture(pe,null),dt.checkFramebufferStatus($t)!==rr)mn=!1;else{dt.viewport(0,0,1,1),dt.clearColor(1,0,0,1),dt.clear(Sr);var Ra=U.allocType(Ft,4);dt.readPixels(0,0,1,1,rt,Ft,Ra),dt.getError()?mn=!1:(dt.deleteFramebuffer(Da),dt.deleteTexture(dn),mn=Ra[0]===1),U.freeType(Ra)}}var Ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ya=!0;if(!Ia){var Oi=dt.createTexture(),pi=U.allocType(Nt,36);dt.activeTexture(ct),dt.bindTexture(Ne,Oi),dt.texImage2D(ot,0,rt,3,3,0,rt,Nt,pi),U.freeType(pi),dt.bindTexture(Ne,null),dt.deleteTexture(Oi),Ya=!dt.getError()}return{colorBits:[dt.getParameter(Z),dt.getParameter(re),dt.getParameter(fe),dt.getParameter(le)],depthBits:dt.getParameter(ce),stencilBits:dt.getParameter(V),subpixelBits:dt.getParameter(j),extensions:Object.keys(gr).filter(function(Ha){return!!gr[Ha]}),maxAnisotropic:br,maxDrawbuffers:Cn,maxColorAttachments:ua,pointSizeDims:dt.getParameter(ee),lineWidthDims:dt.getParameter(ne),maxViewportDims:dt.getParameter(ue),maxCombinedTextureUnits:dt.getParameter(ie),maxCubeMapSize:dt.getParameter(Fe),maxRenderbufferSize:dt.getParameter(ze),maxTextureUnits:dt.getParameter(Ae),maxTextureSize:dt.getParameter(K),maxAttributes:dt.getParameter(te),maxVertexUniforms:dt.getParameter(H),maxVertexTextureUnits:dt.getParameter(ve),maxVaryingVectors:dt.getParameter(ae),maxFragmentUniforms:dt.getParameter(Ce),glsl:dt.getParameter(nt),renderer:dt.getParameter(it),vendor:dt.getParameter(Ye),version:dt.getParameter(st),readFloat:mn,npotTextureCube:Ya}},Ar=function(dt){return dt instanceof Uint8Array||dt instanceof Uint16Array||dt instanceof Uint32Array||dt instanceof Int8Array||dt instanceof Int16Array||dt instanceof Int32Array||dt instanceof Float32Array||dt instanceof Float64Array||dt instanceof Uint8ClampedArray};function Br(dt){return!!dt&&typeof dt=="object"&&Array.isArray(dt.shape)&&Array.isArray(dt.stride)&&typeof dt.offset=="number"&&dt.shape.length===dt.stride.length&&(Array.isArray(dt.data)||Ar(dt.data))}var Mt=function(dt){return Object.keys(dt).map(function(gr){return dt[gr]})},je={shape:Xe,flatten:Me};function $e(dt,gr,br){for(var Cn=0;Cn0){var Li;if(Array.isArray(Fn[0])){Na=Nn(Fn);for(var aa=1,Xn=1;Xn0){if(typeof aa[0]=="number"){var Wa=U.allocType(na.dtype,aa.length);Vr(Wa,aa),Na(Wa,ai),U.freeType(Wa)}else if(Array.isArray(aa[0])||Ar(aa[0])){In=Nn(aa);var za=ra(aa,In,na.dtype);Na(za,ai),U.freeType(za)}}}else if(Br(aa)){In=aa.shape;var Ii=aa.stride,Eo=0,mi=0,Ui=0,Xa=0;In.length===1?(Eo=In[0],mi=1,Ui=Ii[0],Xa=0):In.length===2&&(Eo=In[0],mi=In[1],Ui=Ii[0],Xa=Ii[1]);var xo=Array.isArray(aa.data)?na.dtype:sr(aa.data),qo=U.allocType(xo,Eo*mi);on(qo,aa.data,Eo,mi,Ui,Xa,aa.offset),Na(qo,ai),U.freeType(qo)}return ui}return ea||ui(tn),ui._reglType="buffer",ui._buffer=na,ui.subdata=Li,br.profile&&(ui.stats=na.stats),ui.destroy=function(){pi(na)},ui}function pa(){Mt(mn).forEach(function(tn){tn.buffer=dt.createBuffer(),dt.bindBuffer(tn.type,tn.buffer),dt.bufferData(tn.type,tn.persistentData||tn.byteLength,tn.usage)})}return br.profile&&(gr.getTotalBufferSize=function(){var tn=0;return Object.keys(mn).forEach(function(Fn){tn+=mn[Fn].stats.size}),tn}),{create:Ha,createStream:Ra,destroyStream:Ia,clear:function(){Mt(mn).forEach(pi),Da.forEach(pi)},getBuffer:function(tn){return tn&&tn._buffer instanceof dn?tn._buffer:null},restore:pa,_initBuffer:Oi}}var wn=0,Kn=0,da=1,fa=1,ga=4,ka=4,Vn={points:wn,point:Kn,lines:da,line:fa,triangles:ga,triangle:ka,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},hi=0,Ti=1,Dt=4,yt=5120,Er=5121,Nr=5122,jr=5123,Ir=5124,Ur=5125,sn=34963,Kr=35040,Tt=35044;function or(dt,gr,br,Cn){var ua={},mn=0,dn={uint8:Er,uint16:jr};gr.oes_element_index_uint&&(dn.uint32=Ur);function Da(pa){this.id=mn++,ua[this.id]=this,this.buffer=pa,this.primType=Dt,this.vertCount=0,this.type=0}Da.prototype.bind=function(){this.buffer.bind()};var Ra=[];function Ia(pa){var tn=Ra.pop();return tn||(tn=new Da(br.create(null,sn,!0,!1)._buffer)),Oi(tn,pa,Kr,-1,-1,0,0),tn}function Ya(pa){Ra.push(pa)}function Oi(pa,tn,Fn,ea,ma,na,ui){pa.buffer.bind();var Na;if(tn){var Li=ui;!ui&&(!Ar(tn)||Br(tn)&&!Ar(tn.data))&&(Li=gr.oes_element_index_uint?Ur:jr),br._initBuffer(pa.buffer,tn,Fn,Li,3)}else dt.bufferData(sn,na,Fn),pa.buffer.dtype=Na||Er,pa.buffer.usage=Fn,pa.buffer.dimension=3,pa.buffer.byteLength=na;if(Na=ui,!ui){switch(pa.buffer.dtype){case Er:case yt:Na=Er;break;case jr:case Nr:Na=jr;break;case Ur:case Ir:Na=Ur;break}pa.buffer.dtype=Na}pa.type=Na;var aa=ma;aa<0&&(aa=pa.buffer.byteLength,Na===jr?aa>>=1:Na===Ur&&(aa>>=2)),pa.vertCount=aa;var Xn=ea;if(ea<0){Xn=Dt;var ai=pa.buffer.dimension;ai===1&&(Xn=hi),ai===2&&(Xn=Ti),ai===3&&(Xn=Dt)}pa.primType=Xn}function pi(pa){Cn.elementsCount--,delete ua[pa.id],pa.buffer.destroy(),pa.buffer=null}function Ha(pa,tn){var Fn=br.create(null,sn,!0),ea=new Da(Fn._buffer);Cn.elementsCount++;function ma(na){if(!na)Fn(),ea.primType=Dt,ea.vertCount=0,ea.type=Er;else if(typeof na=="number")Fn(na),ea.primType=Dt,ea.vertCount=na|0,ea.type=Er;else{var ui=null,Na=Tt,Li=-1,aa=-1,Xn=0,ai=0;Array.isArray(na)||Ar(na)||Br(na)?ui=na:("data"in na&&(ui=na.data),"usage"in na&&(Na=ta[na.usage]),"primitive"in na&&(Li=Vn[na.primitive]),"count"in na&&(aa=na.count|0),"type"in na&&(ai=dn[na.type]),"length"in na?Xn=na.length|0:(Xn=aa,ai===jr||ai===Nr?Xn*=2:(ai===Ur||ai===Ir)&&(Xn*=4))),Oi(ea,ui,Na,Li,aa,Xn,ai)}return ma}return ma(pa),ma._reglType="elements",ma._elements=ea,ma.subdata=function(na,ui){return Fn.subdata(na,ui),ma},ma.destroy=function(){pi(ea)},ma}return{create:Ha,createStream:Ia,destroyStream:Ya,getElements:function(pa){return typeof pa=="function"&&pa._elements instanceof Da?pa._elements:null},clear:function(){Mt(ua).forEach(pi)}}}var Dr=new Float32Array(1),ln=new Uint32Array(Dr.buffer),Pn=5123;function jn(dt){for(var gr=U.allocType(Pn,dt.length),br=0;br>>31<<15,mn=(Cn<<1>>>24)-127,dn=Cn>>13&1023;if(mn<-24)gr[br]=ua;else if(mn<-14){var Da=-14-mn;gr[br]=ua+(dn+1024>>Da)}else mn>15?gr[br]=ua+31744:gr[br]=ua+(mn+15<<10)+dn}return gr}function Un(dt){return Array.isArray(dt)||Ar(dt)}var un=34467,Rn=3553,di=34067,Ma=34069,Ei=6408,Hi=6406,io=6407,no=6409,bo=6410,li=32854,ts=32855,Ho=36194,Gs=32819,cs=32820,Jo=33635,Uo=34042,Xs=6402,js=34041,ol=35904,fs=35906,Zo=36193,ho=33776,hs=33777,sl=33778,El=33779,Ll=35986,Es=35987,ci=34798,Ji=35840,kl=35841,Rs=35842,zo=35843,Pl=36196,Ys=5121,ll=5123,_u=5125,Ki=5126,ms=10242,rs=10243,ql=10497,Vl=33071,Po=33648,ou=10240,cu=10241,zs=9728,xl=9729,Ol=9984,Nl=9985,Vu=9986,sf=9987,jc=33170,$c=4352,Ch=4353,gh=4354,bl=34046,Cc=3317,Lh=37440,tc=37441,Hu=37443,rc=37444,Jc=33984,Zl=[Ol,Vu,Nl,sf],Gu=[0,no,bo,io,Ei],qs={};qs[no]=qs[Hi]=qs[Xs]=1,qs[js]=qs[bo]=2,qs[io]=qs[ol]=3,qs[Ei]=qs[fs]=4;function Rl(dt){return"[object "+dt+"]"}var xf=Rl("HTMLCanvasElement"),gc=Rl("OffscreenCanvas"),Rf=Rl("CanvasRenderingContext2D"),su=Rl("ImageBitmap"),xv=Rl("HTMLImageElement"),Os=Rl("HTMLVideoElement"),Fv=Object.keys(Je).concat([xf,gc,Rf,su,xv,Os]),vl=[];vl[Ys]=1,vl[Ki]=4,vl[Zo]=2,vl[ll]=2,vl[_u]=4;var Do=[];Do[li]=2,Do[ts]=2,Do[Ho]=2,Do[js]=4,Do[ho]=.5,Do[hs]=.5,Do[sl]=1,Do[El]=1,Do[Ll]=.5,Do[Es]=1,Do[ci]=1,Do[Ji]=.5,Do[kl]=.25,Do[Rs]=.5,Do[zo]=.25,Do[Pl]=.5;function Wf(dt){return Array.isArray(dt)&&(dt.length===0||typeof dt[0]=="number")}function Qc(dt){if(!Array.isArray(dt))return!1;var gr=dt.length;return!(gr===0||!Un(dt[0]))}function Ru(dt){return Object.prototype.toString.call(dt)}function Ph(dt){return Ru(dt)===xf}function If(dt){return Ru(dt)===gc}function ah(dt){return Ru(dt)===Rf}function Xu(dt){return Ru(dt)===su}function ov(dt){return Ru(dt)===xv}function Nh(dt){return Ru(dt)===Os}function ih(dt){if(!dt)return!1;var gr=Ru(dt);return Fv.indexOf(gr)>=0?!0:Wf(dt)||Qc(dt)||Br(dt)}function Df(dt){return Je[Object.prototype.toString.call(dt)]|0}function Rh(dt,gr){var br=gr.length;switch(dt.type){case Ys:case ll:case _u:case Ki:var Cn=U.allocType(dt.type,br);Cn.set(gr),dt.data=Cn;break;case Zo:dt.data=jn(gr);break}}function Ih(dt,gr){return U.allocType(dt.type===Zo?Ki:dt.type,gr)}function ef(dt,gr){dt.type===Zo?(dt.data=jn(gr),U.freeType(gr)):dt.data=gr}function Uh(dt,gr,br,Cn,ua,mn){for(var dn=dt.width,Da=dt.height,Ra=dt.channels,Ia=dn*Da*Ra,Ya=Ih(dt,Ia),Oi=0,pi=0;pi=1;)Da+=dn*Ra*Ra,Ra/=2;return Da}else return dn*br*Cn}function lf(dt,gr,br,Cn,ua,mn,dn){var Da={"don't care":$c,"dont care":$c,nice:gh,fast:Ch},Ra={repeat:ql,clamp:Vl,mirror:Po},Ia={nearest:zs,linear:xl},Ya=h({mipmap:sf,"nearest mipmap nearest":Ol,"linear mipmap nearest":Nl,"nearest mipmap linear":Vu,"linear mipmap linear":sf},Ia),Oi={none:0,browser:rc},pi={uint8:Ys,rgba4:Gs,rgb565:Jo,"rgb5 a1":cs},Ha={alpha:Hi,luminance:no,"luminance alpha":bo,rgb:io,rgba:Ei,rgba4:li,"rgb5 a1":ts,rgb565:Ho},pa={};gr.ext_srgb&&(Ha.srgb=ol,Ha.srgba=fs),gr.oes_texture_float&&(pi.float32=pi.float=Ki),gr.oes_texture_half_float&&(pi.float16=pi["half float"]=Zo),gr.webgl_depth_texture&&(h(Ha,{depth:Xs,"depth stencil":js}),h(pi,{uint16:ll,uint32:_u,"depth stencil":Uo})),gr.webgl_compressed_texture_s3tc&&h(pa,{"rgb s3tc dxt1":ho,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":sl,"rgba s3tc dxt5":El}),gr.webgl_compressed_texture_atc&&h(pa,{"rgb atc":Ll,"rgba atc explicit alpha":Es,"rgba atc interpolated alpha":ci}),gr.webgl_compressed_texture_pvrtc&&h(pa,{"rgb pvrtc 4bppv1":Ji,"rgb pvrtc 2bppv1":kl,"rgba pvrtc 4bppv1":Rs,"rgba pvrtc 2bppv1":zo}),gr.webgl_compressed_texture_etc1&&(pa["rgb etc1"]=Pl);var tn=Array.prototype.slice.call(dt.getParameter(un));Object.keys(pa).forEach(function(q){var he=pa[q];tn.indexOf(he)>=0&&(Ha[q]=he)});var Fn=Object.keys(Ha);br.textureFormats=Fn;var ea=[];Object.keys(Ha).forEach(function(q){var he=Ha[q];ea[he]=q});var ma=[];Object.keys(pi).forEach(function(q){var he=pi[q];ma[he]=q});var na=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];na[he]=q});var ui=[];Object.keys(Ya).forEach(function(q){var he=Ya[q];ui[he]=q});var Na=[];Object.keys(Ra).forEach(function(q){var he=Ra[q];Na[he]=q});var Li=Fn.reduce(function(q,he){var J=Ha[he];return J===no||J===Hi||J===no||J===bo||J===Xs||J===js||gr.ext_srgb&&(J===ol||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ei:q[J]=io,q},{});function aa(){this.internalformat=Ei,this.format=Ei,this.type=Ys,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=rc,this.width=0,this.height=0,this.channels=0}function Xn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function ai(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Oi[he.colorSpace]),"type"in he){var J=he.type;q.type=pi[J]}var _e=q.width,qe=q.height,lt=q.channels,vt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(lt=he.shape[2],vt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(lt=he.channels,vt=!0)),q.width=_e|0,q.height=qe|0,q.channels=lt|0;var Ke=!1;if("format"in he){var at=he.format,bt=q.internalformat=Ha[at];q.format=Li[bt],at in pi&&("type"in he||(q.type=pi[at])),at in pa&&(q.compressed=!0),Ke=!0}!vt&&Ke?q.channels=qs[q.format]:vt&&!Ke&&q.channels!==Gu[q.format]&&(q.format=q.internalformat=Gu[q.channels])}}function In(q){dt.pixelStorei(Lh,q.flipY),dt.pixelStorei(tc,q.premultiplyAlpha),dt.pixelStorei(Hu,q.colorSpace),dt.pixelStorei(Cc,q.unpackAlignment)}function Wa(){aa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function za(q,he){var J=null;if(ih(he)?J=he:he&&(ai(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),ih(he.data)&&(J=he.data)),he.copy){var _e=ua.viewportWidth,qe=ua.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Ar(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Ys&&(q.type=Df(J));else if(Wf(J))q.channels=q.channels||4,Rh(q,J),q.alignment=1,q.needsFree=!0;else if(Br(J)){var lt=J.data;!Array.isArray(lt)&&q.type===Ys&&(q.type=Df(lt));var vt=J.shape,Ke=J.stride,at,bt,Zt,Vt,Kt,nr;vt.length===3?(Zt=vt[2],nr=Ke[2]):(Zt=1,nr=1),at=vt[0],bt=vt[1],Vt=Ke[0],Kt=Ke[1],q.alignment=1,q.width=at,q.height=bt,q.channels=Zt,q.format=q.internalformat=Gu[Zt],q.needsFree=!0,Uh(q,lt,Vt,Kt,nr,J.offset)}else if(Ph(J)||If(J)||ah(J))Ph(J)||If(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Xu(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(ov(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Nh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(Qc(J)){var er=q.width||J[0].length,Bt=q.height||J.length,Xt=q.channels;Un(J[0][0])?Xt=Xt||J[0][0].length:Xt=Xt||1;for(var Ht=je.shape(J),zr=1,Yr=0;Yr>=qe,J.height>>=qe,za(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Ia[_e]}var qe=q.wrapS,lt=q.wrapT;if("wrap"in he){var vt=he.wrap;typeof vt=="string"?qe=lt=Ra[vt]:Array.isArray(vt)&&(qe=Ra[vt[0]],lt=Ra[vt[1]])}else{if("wrapS"in he){var Ke=he.wrapS;qe=Ra[Ke]}if("wrapT"in he){var at=he.wrapT;lt=Ra[at]}}if(q.wrapS=qe,q.wrapT=lt,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var bt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=Da[he.mipmap],q.genMipmaps=!0,bt=!0;break;case"boolean":bt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,bt=!0;break}bt&&!("min"in he)&&(q.minFilter=Ol)}}function Zu(q,he){dt.texParameteri(he,cu,q.minFilter),dt.texParameteri(he,ou,q.magFilter),dt.texParameteri(he,ms,q.wrapS),dt.texParameteri(he,rs,q.wrapT),gr.ext_texture_filter_anisotropic&&dt.texParameteri(he,bl,q.anisotropic),q.genMipmaps&&(dt.hint(jc,q.mipmapHint),dt.generateMipmap(he))}var vf=0,$l={},uu=br.maxTextureUnits,uo=Array(uu).map(function(){return null});function Wu(q){aa.call(this),this.mipmask=0,this.internalformat=Ei,this.id=vf++,this.refCount=1,this.target=q,this.texture=dt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new vu,dn.profile&&(this.stats={size:0})}function Us(q){dt.activeTexture(Jc),dt.bindTexture(q.target,q.texture)}function zl(){var q=uo[0];q?dt.bindTexture(q.target,q.texture):dt.bindTexture(Rn,null)}function sc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(dt.activeTexture(Jc+J),dt.bindTexture(_e,null),uo[J]=null),dt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete $l[q.id],mn.textureCount--}h(Wu.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}uo[J]=q,he=J;break}dn.profile&&mn.maxTextureUnits>Kt)-Zt,nr.height=nr.height||(J.height>>Kt)-Vt,Us(J),Eo(nr,Rn,Zt,Vt,Kt),zl(),Xa(nr),_e}function lt(vt,Ke){var at=vt|0,bt=Ke|0||at;if(at===J.width&&bt===J.height)return _e;_e.width=J.width=at,_e.height=J.height=bt,Us(J);for(var Zt=0;J.mipmask>>Zt;++Zt){var Vt=at>>Zt,Kt=bt>>Zt;if(!Vt||!Kt)break;dt.texImage2D(Rn,Zt,J.format,Vt,Kt,0,J.format,J.type,null)}return zl(),dn.profile&&(J.stats.size=bf(J.internalformat,J.type,at,bt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=lt,_e._reglType="texture2d",_e._texture=J,dn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Ao(q,he,J,_e,qe,lt){var vt=new Wu(di);$l[vt.id]=vt,mn.cubeCount++;var Ke=new Array(6);function at(Vt,Kt,nr,er,Bt,Xt){var Ht,zr=vt.texInfo;for(vu.call(zr),Ht=0;Ht<6;++Ht)Ke[Ht]=wu();if(typeof Vt=="number"||!Vt){var Yr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo(Ke[Ht],Yr,Yr)}else if(typeof Vt=="object")if(Kt)Qo(Ke[0],Vt),Qo(Ke[1],Kt),Qo(Ke[2],nr),Qo(Ke[3],er),Qo(Ke[4],Bt),Qo(Ke[5],Xt);else if(Iu(zr,Vt),ai(vt,Vt),"faces"in Vt){var cn=Vt.faces;for(Ht=0;Ht<6;++Ht)Xn(Ke[Ht],vt),Qo(Ke[Ht],cn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo(Ke[Ht],Vt);for(Xn(vt,Ke[0]),zr.genMipmaps?vt.mipmask=(Ke[0].width<<1)-1:vt.mipmask=Ke[0].mipmask,vt.internalformat=Ke[0].internalformat,at.width=Ke[0].width,at.height=Ke[0].height,Us(vt),Ht=0;Ht<6;++Ht)ul(Ke[Ht],Ma+Ht);for(Zu(zr,di),zl(),dn.profile&&(vt.stats.size=bf(vt.internalformat,vt.type,at.width,at.height,zr.genMipmaps,!0)),at.format=ea[vt.internalformat],at.type=ma[vt.type],at.mag=na[zr.magFilter],at.min=ui[zr.minFilter],at.wrapS=Na[zr.wrapS],at.wrapT=Na[zr.wrapT],Ht=0;Ht<6;++Ht)Qs(Ke[Ht]);return at}function bt(Vt,Kt,nr,er,Bt){var Xt=nr|0,Ht=er|0,zr=Bt|0,Yr=Ui();return Xn(Yr,vt),Yr.width=0,Yr.height=0,za(Yr,Kt),Yr.width=Yr.width||(vt.width>>zr)-Xt,Yr.height=Yr.height||(vt.height>>zr)-Ht,Us(vt),Eo(Yr,Ma+Vt,Xt,Ht,zr),zl(),Xa(Yr),at}function Zt(Vt){var Kt=Vt|0;if(Kt!==vt.width){at.width=vt.width=Kt,at.height=vt.height=Kt,Us(vt);for(var nr=0;nr<6;++nr)for(var er=0;vt.mipmask>>er;++er)dt.texImage2D(Ma+nr,er,vt.format,Kt>>er,Kt>>er,0,vt.format,vt.type,null);return zl(),dn.profile&&(vt.stats.size=bf(vt.internalformat,vt.type,at.width,at.height,!1,!0)),at}}return at(q,he,J,_e,qe,lt),at.subimage=bt,at.resize=Zt,at._reglType="textureCube",at._texture=vt,dn.profile&&(at.stats=vt.stats),at.destroy=function(){vt.decRef()},at}function vs(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)dt.texImage2D(Ma+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Zu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?wu=!0:Ra.indexOf(Qs)>=0&&(wu=!1))),("depthTexture"in uo||"depthStencilTexture"in uo)&&(uu=!!(uo.depthTexture||uo.depthStencilTexture)),"depth"in uo&&(typeof uo.depth=="boolean"?Qo=uo.depth:(Zu=uo.depth,ul=!1)),"stencil"in uo&&(typeof uo.stencil=="boolean"?ul=uo.stencil:(vf=uo.stencil,Qo=!1)),"depthStencil"in uo&&(typeof uo.depthStencil=="boolean"?Qo=ul=uo.depthStencil:($l=uo.depthStencil,Qo=!1,ul=!1))}var Us=null,zl=null,sc=null,lc=null;if(Array.isArray(es))Us=es.map(Ha);else if(es)Us=[Ha(es)];else for(Us=new Array(Iu),Xa=0;Xa0&&(Ui.depth=Wa[0].depth,Ui.stencil=Wa[0].stencil,Ui.depthStencil=Wa[0].depthStencil),Wa[mi]?Wa[mi](Ui):Wa[mi]=aa(Ui)}return h(za,{width:Xa,height:Xa,color:Qs})}function Ii(Eo){var mi,Ui=Eo|0;if(Ui===za.width)return za;var Xa=za.color;for(mi=0;mi=xo.byteLength?qo.subdata(xo):(qo.destroy(),Xn.buffers[mi]=null)),Xn.buffers[mi]||(qo=Xn.buffers[mi]=ua.create(Ui,Qf,!1,!0)),Xa.buffer=ua.getBuffer(qo),Xa.size=Xa.buffer.dimension|0,Xa.normalized=!1,Xa.type=Xa.buffer.dtype,Xa.offset=0,Xa.stride=0,Xa.divisor=0,Xa.state=1,Ii[mi]=1}else ua.getBuffer(Ui)?(Xa.buffer=ua.getBuffer(Ui),Xa.size=Xa.buffer.dimension|0,Xa.normalized=!1,Xa.type=Xa.buffer.dtype,Xa.offset=0,Xa.stride=0,Xa.divisor=0,Xa.state=1):ua.getBuffer(Ui.buffer)?(Xa.buffer=ua.getBuffer(Ui.buffer),Xa.size=(+Ui.size||Xa.buffer.dimension)|0,Xa.normalized=!!Ui.normalized||!1,"type"in Ui?Xa.type=En[Ui.type]:Xa.type=Xa.buffer.dtype,Xa.offset=(Ui.offset||0)|0,Xa.stride=(Ui.stride||0)|0,Xa.divisor=(Ui.divisor||0)|0,Xa.state=1):"x"in Ui&&(Xa.x=+Ui.x||0,Xa.y=+Ui.y||0,Xa.z=+Ui.z||0,Xa.w=+Ui.w||0,Xa.state=2)}for(var Qo=0;Qo1)for(var In=0;Intn&&(tn=Fn.stats.uniformsCount)}),tn},br.getMaxAttributesCount=function(){var tn=0;return Ya.forEach(function(Fn){Fn.stats.attributesCount>tn&&(tn=Fn.stats.attributesCount)}),tn});function pa(){ua={},mn={};for(var tn=0;tn>>4&15)+gr.charAt(Cn&15);return br}function ff(dt){for(var gr="",br=-1,Cn,ua;++br>>6&31,128|Cn&63):Cn<=65535?gr+=String.fromCharCode(224|Cn>>>12&15,128|Cn>>>6&63,128|Cn&63):Cn<=2097151&&(gr+=String.fromCharCode(240|Cn>>>18&7,128|Cn>>>12&63,128|Cn>>>6&63,128|Cn&63));return gr}function xu(dt){for(var gr=Array(dt.length>>2),br=0;br>5]|=(dt.charCodeAt(br/8)&255)<<24-br%32;return gr}function yc(dt){for(var gr="",br=0;br>5]>>>24-br%32&255);return gr}function fu(dt,gr){return dt>>>gr|dt<<32-gr}function Bf(dt,gr){return dt>>>gr}function hf(dt,gr,br){return dt&gr^~dt&br}function Oh(dt,gr,br){return dt&gr^dt&br^gr&br}function ur(dt){return fu(dt,2)^fu(dt,13)^fu(dt,22)}function Pr(dt){return fu(dt,6)^fu(dt,11)^fu(dt,25)}function vn(dt){return fu(dt,7)^fu(dt,18)^Bf(dt,3)}function rn(dt){return fu(dt,17)^fu(dt,19)^Bf(dt,10)}var On=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 Ta(dt,gr){var br=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Cn=new Array(64),ua,mn,dn,Da,Ra,Ia,Ya,Oi,pi,Ha,pa,tn;for(dt[gr>>5]|=128<<24-gr%32,dt[(gr+64>>9<<4)+15]=gr,pi=0;pi>16)+(gr>>16)+(br>>16);return Cn<<16|br&65535}function ei(dt){return Array.prototype.slice.call(dt)}function si(dt){return ei(dt).join("")}function Bi(dt){var gr=dt&&dt.cache,br=0,Cn=[],ua=[],mn=[];function dn(pa,tn){var Fn=tn&&tn.stable;if(!Fn){for(var ea=0;ea0&&(pa.push(ma,"="),pa.push.apply(pa,ei(arguments)),pa.push(";")),ma}return h(tn,{def:ea,toString:function(){return si([Fn.length>0?"var "+Fn.join(",")+";":"",si(pa)])}})}function Ra(){var pa=Da(),tn=Da(),Fn=pa.toString,ea=tn.toString;function ma(na,ui){tn(na,ui,"=",pa.def(na,ui),";")}return h(function(){pa.apply(pa,ei(arguments))},{def:pa.def,entry:pa,exit:tn,save:ma,set:function(na,ui,Na){ma(na,ui),pa(na,ui,"=",Na,";")},toString:function(){return Fn()+ea()}})}function Ia(){var pa=si(arguments),tn=Ra(),Fn=Ra(),ea=tn.toString,ma=Fn.toString;return h(tn,{then:function(){return tn.apply(tn,ei(arguments)),this},else:function(){return Fn.apply(Fn,ei(arguments)),this},toString:function(){var na=ma();return na&&(na="else{"+na+"}"),si(["if(",pa,"){",ea(),"}",na])}})}var Ya=Da(),Oi={};function pi(pa,tn){var Fn=[];function ea(){var Li="a"+Fn.length;return Fn.push(Li),Li}tn=tn||0;for(var ma=0;ma":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},oa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Aa={cw:xt,ccw:At};function Pa(dt){return Array.isArray(dt)||Ar(dt)||Br(dt)}function ia(dt){return dt.sort(function(gr,br){return gr===Dc?-1:br===Dc?1:gr=1,Cn>=2,gr)}else if(br===jo){var ua=dt.data;return new ni(ua.thisDep,ua.contextDep,ua.propDep,gr)}else{if(br===Yi)return new ni(!1,!1,!1,gr);if(br===ki){for(var mn=!1,dn=!1,Da=!1,Ra=0;Ra=1&&(dn=!0),Ya>=2&&(Da=!0)}else Ia.type===jo&&(mn=mn||Ia.data.thisDep,dn=dn||Ia.data.contextDep,Da=Da||Ia.data.propDep)}return new ni(mn,dn,Da,gr)}else return new ni(br===Go,br===Ro,br===No,gr)}}var mo=new ni(!1,!1,!1,function(){});function To(dt,gr,br,Cn,ua,mn,dn,Da,Ra,Ia,Ya,Oi,pi,Ha,pa,tn){var Fn=Ia.Record,ea={add:32774,subtract:32778,"reverse subtract":32779};br.ext_blend_minmax&&(ea.min=It,ea.max=Qt);var ma=br.angle_instanced_arrays,na=br.webgl_draw_buffers,ui=br.oes_vertex_array_object,Na={dirty:!0,profile:tn.profile},Li={},aa=[],Xn={},ai={};function In(Ke){return Ke.replace(".","_")}function Wa(Ke,at,bt){var Zt=In(Ke);aa.push(Ke),Li[Zt]=Na[Zt]=!!bt,Xn[Zt]=at}function za(Ke,at,bt){var Zt=In(Ke);aa.push(Ke),Array.isArray(bt)?(Na[Zt]=bt.slice(),Li[Zt]=bt.slice()):Na[Zt]=Li[Zt]=bt,ai[Zt]=at}function Ii(Ke){return!!isNaN(Ke)}Wa(ns,Gr),Wa(Fs,Lr),za(wl,"blendColor",[0,0,0,0]),za(Hl,"blendEquationSeparate",[fn,fn]),za(Sl,"blendFuncSeparate",[Hr,Xr,Hr,Xr]),Wa(Gl,Mn,!0),za(el,"depthFunc",Sn),za(Su,"depthRange",[0,1]),za(bu,"depthMask",!0),za(Ul,Ul,[!0,!0,!0,!0]),Wa(po,wr),za(gs,"cullFace",tt),za(Il,Il,At),za(dl,dl,1),Wa(vc,Gn),za(dc,"polygonOffset",[0,0]),Wa(_c,ba),Wa(Hf,ti),za(pc,"sampleCoverage",[1,!1]),Wa(Af,an),za(Mu,"stencilMask",-1),za(Sf,"stencilFunc",[Jt,0,-1]),za(Xo,"stencilOpSeparate",[Oe,yr,yr,yr]),za(as,"stencilOpSeparate",[tt,yr,yr,yr]),Wa(Mf,Ln),za(Gc,"scissor",[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]),za(Dc,Dc,[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]);var Eo={gl:dt,context:pi,strings:gr,next:Li,current:Na,draw:Oi,elements:mn,buffer:ua,shader:Ya,attributes:Ia.state,vao:Ia,uniforms:Ra,framebuffer:Da,extensions:br,timer:Ha,isBufferArgs:Pa},mi={primTypes:Vn,compareFuncs:Jn,blendFuncs:Dn,blendEquations:ea,stencilOps:oa,glTypes:En,orientationType:Aa};na&&(mi.backBuffer=[tt],mi.drawBuffer=m(Cn.maxDrawbuffers,function(Ke){return Ke===0?[0]:m(Ke,function(at){return Ca+at})}));var Ui=0;function Xa(){var Ke=Bi({cache:pa}),at=Ke.link,bt=Ke.global;Ke.id=Ui++,Ke.batchId="0";var Zt=at(Eo),Vt=Ke.shared={props:"a0"};Object.keys(Eo).forEach(function(Xt){Vt[Xt]=bt.def(Zt,".",Xt)});var Kt=Ke.next={},nr=Ke.current={};Object.keys(ai).forEach(function(Xt){Array.isArray(Na[Xt])&&(Kt[Xt]=bt.def(Vt.next,".",Xt),nr[Xt]=bt.def(Vt.current,".",Xt))});var er=Ke.constants={};Object.keys(mi).forEach(function(Xt){er[Xt]=bt.def(JSON.stringify(mi[Xt]))}),Ke.invoke=function(Xt,Ht){switch(Ht.type){case Gi:var zr=["this",Vt.context,Vt.props,Ke.batchId];return Xt.def(at(Ht.data),".call(",zr.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Xt.def(Vt.props,Ht.data);case Ro:return Xt.def(Vt.context,Ht.data);case Go:return Xt.def("this",Ht.data);case jo:return Ht.data.append(Ke,Xt),Ht.data.ref;case Yi:return Ht.data.toString();case ki:return Ht.data.map(function(Yr){return Ke.invoke(Xt,Yr)})}},Ke.attribCache={};var Bt={};return Ke.scopeAttrib=function(Xt){var Ht=gr.id(Xt);if(Ht in Bt)return Bt[Ht];var zr=Ia.scope[Ht];zr||(zr=Ia.scope[Ht]=new Fn);var Yr=Bt[Ht]=at(zr);return Yr},Ke}function xo(Ke){var at=Ke.static,bt=Ke.dynamic,Zt;if(Ue in at){var Vt=!!at[Ue];Zt=Ri(function(nr,er){return Vt}),Zt.enable=Vt}else if(Ue in bt){var Kt=bt[Ue];Zt=Vi(Kt,function(nr,er){return nr.invoke(er,Kt)})}return Zt}function qo(Ke,at){var bt=Ke.static,Zt=Ke.dynamic;if(P in bt){var Vt=bt[P];return Vt?(Vt=Da.getFramebuffer(Vt),Ri(function(nr,er){var Bt=nr.link(Vt),Xt=nr.shared;er.set(Xt.framebuffer,".next",Bt);var Ht=Xt.context;return er.set(Ht,"."+Qr,Bt+".width"),er.set(Ht,"."+yn,Bt+".height"),Bt})):Ri(function(nr,er){var Bt=nr.shared;er.set(Bt.framebuffer,".next","null");var Xt=Bt.context;return er.set(Xt,"."+Qr,Xt+"."+_t),er.set(Xt,"."+yn,Xt+"."+zt),"null"})}else if(P in Zt){var Kt=Zt[P];return Vi(Kt,function(nr,er){var Bt=nr.invoke(er,Kt),Xt=nr.shared,Ht=Xt.framebuffer,zr=er.def(Ht,".getFramebuffer(",Bt,")");er.set(Ht,".next",zr);var Yr=Xt.context;return er.set(Yr,"."+Qr,zr+"?"+zr+".width:"+Yr+"."+_t),er.set(Yr,"."+yn,zr+"?"+zr+".height:"+Yr+"."+zt),zr})}else return null}function Qo(Ke,at,bt){var Zt=Ke.static,Vt=Ke.dynamic;function Kt(Bt){if(Bt in Zt){var Xt=Zt[Bt],Ht=!0,zr=Xt.x|0,Yr=Xt.y|0,cn,sa;return"width"in Xt?cn=Xt.width|0:Ht=!1,"height"in Xt?sa=Xt.height|0:Ht=!1,new ni(!Ht&&at&&at.thisDep,!Ht&&at&&at.contextDep,!Ht&&at&&at.propDep,function(la,ha){var La=la.shared.context,ca=cn;"width"in Xt||(ca=ha.def(La,".",Qr,"-",zr));var Oa=sa;return"height"in Xt||(Oa=ha.def(La,".",yn,"-",Yr)),[zr,Yr,ca,Oa]})}else if(Bt in Vt){var Yn=Vt[Bt],Hn=Vi(Yn,function(la,ha){var La=la.invoke(ha,Yn),ca=la.shared.context,Oa=ha.def(La,".x|0"),Ka=ha.def(La,".y|0"),xi=ha.def('"width" in ',La,"?",La,".width|0:","(",ca,".",Qr,"-",Oa,")"),qi=ha.def('"height" in ',La,"?",La,".height|0:","(",ca,".",yn,"-",Ka,")");return[Oa,Ka,xi,qi]});return at&&(Hn.thisDep=Hn.thisDep||at.thisDep,Hn.contextDep=Hn.contextDep||at.contextDep,Hn.propDep=Hn.propDep||at.propDep),Hn}else return at?new ni(at.thisDep,at.contextDep,at.propDep,function(la,ha){var La=la.shared.context;return[0,0,ha.def(La,".",Qr),ha.def(La,".",yn)]}):null}var nr=Kt(Dc);if(nr){var er=nr;nr=new ni(nr.thisDep,nr.contextDep,nr.propDep,function(Bt,Xt){var Ht=er.append(Bt,Xt),zr=Bt.shared.context;return Xt.set(zr,"."+Ze,Ht[2]),Xt.set(zr,"."+et,Ht[3]),Ht})}return{viewport:nr,scissor_box:Kt(Gc)}}function ul(Ke,at){var bt=Ke.static,Zt=typeof bt[Se]=="string"&&typeof bt[oe]=="string";if(Zt){if(Object.keys(at.dynamic).length>0)return null;var Vt=at.static,Kt=Object.keys(Vt);if(Kt.length>0&&typeof Vt[Kt[0]]=="number"){for(var nr=[],er=0;er"+Oa+"?"+Ht+".constant["+Oa+"]:0;"}).join(""),"}}else{","if(",cn,"(",Ht,".buffer)){",la,"=",sa,".createStream(",Ut,",",Ht,".buffer);","}else{",la,"=",sa,".getBuffer(",Ht,".buffer);","}",ha,'="type" in ',Ht,"?",Yr.glTypes,"[",Ht,".type]:",la,".dtype;",Yn.normalized,"=!!",Ht,".normalized;");function La(ca){Xt(Yn[ca],"=",Ht,".",ca,"|0;")}return La("size"),La("offset"),La("stride"),La("divisor"),Xt("}}"),Xt.exit("if(",Yn.isStream,"){",sa,".destroyStream(",la,");","}"),Yn}Vt[Kt]=Vi(nr,er)}),Vt}function Zu(Ke){var at=Ke.static,bt=Ke.dynamic,Zt={};return Object.keys(at).forEach(function(Vt){var Kt=at[Vt];Zt[Vt]=Ri(function(nr,er){return typeof Kt=="number"||typeof Kt=="boolean"?""+Kt:nr.link(Kt)})}),Object.keys(bt).forEach(function(Vt){var Kt=bt[Vt];Zt[Vt]=Vi(Kt,function(nr,er){return nr.invoke(er,Kt)})}),Zt}function vf(Ke,at,bt,Zt,Vt){Ke.static,Ke.dynamic;var Kt=ul(Ke,at),nr=qo(Ke),er=Qo(Ke,nr),Bt=wu(Ke),Xt=Qs(Ke),Ht=es(Ke,Vt,Kt);function zr(la){var ha=er[la];ha&&(Xt[la]=ha)}zr(Dc),zr(In(Gc));var Yr=Object.keys(Xt).length>0,cn={framebuffer:nr,draw:Bt,shader:Ht,state:Xt,dirty:Yr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(cn.profile=xo(Ke),cn.uniforms=vu(bt),cn.drawVAO=cn.scopeVAO=Bt.vao,!cn.drawVAO&&Ht.program&&!Kt&&br.angle_instanced_arrays&&Bt.static.elements){var sa=!0,Yn=Ht.program.attributes.map(function(la){var ha=at.static[la];return sa=sa&&!!ha,ha});if(sa&&Yn.length>0){var Hn=Ia.getVAO(Ia.createVAO({attributes:Yn,elements:Bt.static.elements}));cn.drawVAO=new ni(null,null,null,function(la,ha){return la.link(Hn)}),cn.useVAO=!0}}return Kt?cn.useVAO=!0:cn.attributes=Iu(at),cn.context=Zu(Zt),cn}function $l(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.context,Kt=Ke.scope();Object.keys(bt).forEach(function(nr){at.save(Vt,"."+nr);var er=bt[nr],Bt=er.append(Ke,at);Array.isArray(Bt)?Kt(Vt,".",nr,"=[",Bt.join(),"];"):Kt(Vt,".",nr,"=",Bt,";")}),at(Kt)}function uu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Vt.gl,nr=Vt.framebuffer,er;na&&(er=at.def(Vt.extensions,".webgl_draw_buffers"));var Bt=Ke.constants,Xt=Bt.drawBuffer,Ht=Bt.backBuffer,zr;bt?zr=bt.append(Ke,at):zr=at.def(nr,".next"),Zt||at("if(",zr,"!==",nr,".cur){"),at("if(",zr,"){",Kt,".bindFramebuffer(",kn,",",zr,".framebuffer);"),na&&at(er,".drawBuffersWEBGL(",Xt,"[",zr,".colorAttachments.length]);"),at("}else{",Kt,".bindFramebuffer(",kn,",null);"),na&&at(er,".drawBuffersWEBGL(",Ht,");"),at("}",nr,".cur=",zr,";"),Zt||at("}")}function uo(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.gl,Kt=Ke.current,nr=Ke.next,er=Zt.current,Bt=Zt.next,Xt=Ke.cond(er,".dirty");aa.forEach(function(Ht){var zr=In(Ht);if(!(zr in bt.state)){var Yr,cn;if(zr in nr){Yr=nr[zr],cn=Kt[zr];var sa=m(Na[zr].length,function(Hn){return Xt.def(Yr,"[",Hn,"]")});Xt(Ke.cond(sa.map(function(Hn,la){return Hn+"!=="+cn+"["+la+"]"}).join("||")).then(Vt,".",ai[zr],"(",sa,");",sa.map(function(Hn,la){return cn+"["+la+"]="+Hn}).join(";"),";"))}else{Yr=Xt.def(Bt,".",zr);var Yn=Ke.cond(Yr,"!==",er,".",zr);Xt(Yn),zr in Xn?Yn(Ke.cond(Yr).then(Vt,".enable(",Xn[zr],");").else(Vt,".disable(",Xn[zr],");"),er,".",zr,"=",Yr,";"):Yn(Vt,".",ai[zr],"(",Yr,");",er,".",zr,"=",Yr,";")}}}),Object.keys(bt.state).length===0&&Xt(er,".dirty=false;"),at(Xt)}function Wu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Ke.current,nr=Vt.current,er=Vt.gl,Bt;ia(Object.keys(bt)).forEach(function(Xt){var Ht=bt[Xt];if(!(Zt&&!Zt(Ht))){var zr=Ht.append(Ke,at);if(Xn[Xt]){var Yr=Xn[Xt];Xi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(Ke.cond(Bt).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",Bt,";")):(at(Ke.cond(zr).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",zr,";"))}else if(Un(zr)){var cn=Kt[Xt];at(er,".",ai[Xt],"(",zr,");",zr.map(function(sa,Yn){return cn+"["+Yn+"]="+sa}).join(";"),";")}else Xi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(er,".",ai[Xt],"(",Bt,");",nr,".",Xt,"=",Bt,";")):at(er,".",ai[Xt],"(",zr,");",nr,".",Xt,"=",zr,";")}})}function Us(Ke,at){ma&&(Ke.instancing=at.def(Ke.shared.extensions,".angle_instanced_arrays"))}function zl(Ke,at,bt,Zt,Vt){var Kt=Ke.shared,nr=Ke.stats,er=Kt.current,Bt=Kt.timer,Xt=bt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var zr,Yr;function cn(La){zr=at.def(),La(zr,"=",Ht(),";"),typeof Vt=="string"?La(nr,".count+=",Vt,";"):La(nr,".count++;"),Ha&&(Zt?(Yr=at.def(),La(Yr,"=",Bt,".getNumPendingQueries();")):La(Bt,".beginQuery(",nr,");"))}function sa(La){La(nr,".cpuTime+=",Ht(),"-",zr,";"),Ha&&(Zt?La(Bt,".pushScopeStats(",Yr,",",Bt,".getNumPendingQueries(),",nr,");"):La(Bt,".endQuery();"))}function Yn(La){var ca=at.def(er,".profile");at(er,".profile=",La,";"),at.exit(er,".profile=",ca,";")}var Hn;if(Xt){if(Xi(Xt)){Xt.enable?(cn(at),sa(at.exit),Yn("true")):Yn("false");return}Hn=Xt.append(Ke,at),Yn(Hn)}else Hn=at.def(er,".profile");var la=Ke.block();cn(la),at("if(",Hn,"){",la,"}");var ha=Ke.block();sa(ha),at.exit("if(",Hn,"){",ha,"}")}function sc(Ke,at,bt,Zt,Vt){var Kt=Ke.shared;function nr(Bt){switch(Bt){case ri:case Wo:case nl:return 2;case Zi:case Ks:case hu:return 3;case yo:case $s:case eu:return 4;default:return 1}}function er(Bt,Xt,Ht){var zr=Kt.gl,Yr=at.def(Bt,".location"),cn=at.def(Kt.attributes,"[",Yr,"]"),sa=Ht.state,Yn=Ht.buffer,Hn=[Ht.x,Ht.y,Ht.z,Ht.w],la=["buffer","normalized","offset","stride"];function ha(){at("if(!",cn,".buffer){",zr,".enableVertexAttribArray(",Yr,");}");var ca=Ht.type,Oa;if(Ht.size?Oa=at.def(Ht.size,"||",Xt):Oa=Xt,at("if(",cn,".type!==",ca,"||",cn,".size!==",Oa,"||",la.map(function(xi){return cn+"."+xi+"!=="+Ht[xi]}).join("||"),"){",zr,".bindBuffer(",Ut,",",Yn,".buffer);",zr,".vertexAttribPointer(",[Yr,Oa,ca,Ht.normalized,Ht.stride,Ht.offset],");",cn,".type=",ca,";",cn,".size=",Oa,";",la.map(function(xi){return cn+"."+xi+"="+Ht[xi]+";"}).join(""),"}"),ma){var Ka=Ht.divisor;at("if(",cn,".divisor!==",Ka,"){",Ke.instancing,".vertexAttribDivisorANGLE(",[Yr,Ka],");",cn,".divisor=",Ka,";}")}}function La(){at("if(",cn,".buffer){",zr,".disableVertexAttribArray(",Yr,");",cn,".buffer=null;","}if(",Va.map(function(ca,Oa){return cn+"."+ca+"!=="+Hn[Oa]}).join("||"),"){",zr,".vertexAttrib4f(",Yr,",",Hn,");",Va.map(function(ca,Oa){return cn+"."+ca+"="+Hn[Oa]+";"}).join(""),"}")}sa===Ja?ha():sa===Ba?La():(at("if(",sa,"===",Ja,"){"),ha(),at("}else{"),La(),at("}"))}Zt.forEach(function(Bt){var Xt=Bt.name,Ht=bt.attributes[Xt],zr;if(Ht){if(!Vt(Ht))return;zr=Ht.append(Ke,at)}else{if(!Vt(mo))return;var Yr=Ke.scopeAttrib(Xt);zr={},Object.keys(new Fn).forEach(function(cn){zr[cn]=at.def(Yr,".",cn)})}er(Ke.link(Bt),nr(Bt.info.type),zr)})}function lc(Ke,at,bt,Zt,Vt,Kt){for(var nr=Ke.shared,er=nr.gl,Bt,Xt=0;Xt1){for(var _s=[],ds=[],pl=0;pl>1)",Yn],");")}function Ka(){bt(Hn,".drawArraysInstancedANGLE(",[Yr,cn,sa,Yn],");")}Ht&&Ht!=="null"?ha?Oa():(bt("if(",Ht,"){"),Oa(),bt("}else{"),Ka(),bt("}")):Ka()}function ca(){function Oa(){bt(Kt+".drawElements("+[Yr,sa,la,cn+"<<(("+la+"-"+_i+")>>1)"]+");")}function Ka(){bt(Kt+".drawArrays("+[Yr,cn,sa]+");")}Ht&&Ht!=="null"?ha?Oa():(bt("if(",Ht,"){"),Oa(),bt("}else{"),Ka(),bt("}")):Ka()}ma&&(typeof Yn!="number"||Yn>=0)?typeof Yn=="string"?(bt("if(",Yn,">0){"),La(),bt("}else if(",Yn,"<0){"),ca(),bt("}")):La():ca()}function vs(Ke,at,bt,Zt,Vt){var Kt=Xa(),nr=Kt.proc("body",Vt);return ma&&(Kt.instancing=nr.def(Kt.shared.extensions,".angle_instanced_arrays")),Ke(Kt,nr,bt,Zt),Kt.compile().body}function ys(Ke,at,bt,Zt){Us(Ke,at),bt.useVAO?bt.drawVAO?at(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,at),");"):at(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(at(Ke.shared.vao,".setVAO(null);"),sc(Ke,at,bt,Zt.attributes,function(){return!0})),lc(Ke,at,bt,Zt.uniforms,function(){return!0},!1),Ao(Ke,at,at,bt)}function be(Ke,at){var bt=Ke.proc("draw",1);Us(Ke,bt),$l(Ke,bt,at.context),uu(Ke,bt,at.framebuffer),uo(Ke,bt,at),Wu(Ke,bt,at.state),zl(Ke,bt,at,!1,!0);var Zt=at.shader.progVar.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Zt,".program);"),at.shader.program)ys(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Vt=Ke.global.def("{}"),Kt=bt.def(Zt,".id"),nr=bt.def(Vt,"[",Kt,"]");bt(Ke.cond(nr).then(nr,".call(this,a0);").else(nr,"=",Vt,"[",Kt,"]=",Ke.link(function(er){return vs(ys,Ke,at,er,1)}),"(",Zt,");",nr,".call(this,a0);"))}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function q(Ke,at,bt,Zt){Ke.batchId="a1",Us(Ke,at);function Vt(){return!0}sc(Ke,at,bt,Zt.attributes,Vt),lc(Ke,at,bt,Zt.uniforms,Vt,!1),Ao(Ke,at,at,bt)}function he(Ke,at,bt,Zt){Us(Ke,at);var Vt=bt.contextDep,Kt=at.def(),nr="a0",er="a1",Bt=at.def();Ke.shared.props=Bt,Ke.batchId=Kt;var Xt=Ke.scope(),Ht=Ke.scope();at(Xt.entry,"for(",Kt,"=0;",Kt,"<",er,";++",Kt,"){",Bt,"=",nr,"[",Kt,"];",Ht,"}",Xt.exit);function zr(la){return la.contextDep&&Vt||la.propDep}function Yr(la){return!zr(la)}if(bt.needsContext&&$l(Ke,Ht,bt.context),bt.needsFramebuffer&&uu(Ke,Ht,bt.framebuffer),Wu(Ke,Ht,bt.state,zr),bt.profile&&zr(bt.profile)&&zl(Ke,Ht,bt,!1,!0),Zt)bt.useVAO?bt.drawVAO?zr(bt.drawVAO)?Ht(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Ht),");"):Xt(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Xt),");"):Xt(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(Xt(Ke.shared.vao,".setVAO(null);"),sc(Ke,Xt,bt,Zt.attributes,Yr),sc(Ke,Ht,bt,Zt.attributes,zr)),lc(Ke,Xt,bt,Zt.uniforms,Yr,!1),lc(Ke,Ht,bt,Zt.uniforms,zr,!0),Ao(Ke,Xt,Ht,bt);else{var cn=Ke.global.def("{}"),sa=bt.shader.progVar.append(Ke,Ht),Yn=Ht.def(sa,".id"),Hn=Ht.def(cn,"[",Yn,"]");Ht(Ke.shared.gl,".useProgram(",sa,".program);","if(!",Hn,"){",Hn,"=",cn,"[",Yn,"]=",Ke.link(function(la){return vs(q,Ke,bt,la,2)}),"(",sa,");}",Hn,".call(this,a0[",Kt,"],",Kt,");")}}function J(Ke,at){var bt=Ke.proc("batch",2);Ke.batchId="0",Us(Ke,bt);var Zt=!1,Vt=!0;Object.keys(at.context).forEach(function(cn){Zt=Zt||at.context[cn].propDep}),Zt||($l(Ke,bt,at.context),Vt=!1);var Kt=at.framebuffer,nr=!1;Kt?(Kt.propDep?Zt=nr=!0:Kt.contextDep&&Zt&&(nr=!0),nr||uu(Ke,bt,Kt)):uu(Ke,bt,null),at.state.viewport&&at.state.viewport.propDep&&(Zt=!0);function er(cn){return cn.contextDep&&Zt||cn.propDep}uo(Ke,bt,at),Wu(Ke,bt,at.state,function(cn){return!er(cn)}),(!at.profile||!er(at.profile))&&zl(Ke,bt,at,!1,"a1"),at.contextDep=Zt,at.needsContext=Vt,at.needsFramebuffer=nr;var Bt=at.shader.progVar;if(Bt.contextDep&&Zt||Bt.propDep)he(Ke,bt,at,null);else{var Xt=Bt.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Xt,".program);"),at.shader.program)he(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Ht=Ke.global.def("{}"),zr=bt.def(Xt,".id"),Yr=bt.def(Ht,"[",zr,"]");bt(Ke.cond(Yr).then(Yr,".call(this,a0,a1);").else(Yr,"=",Ht,"[",zr,"]=",Ke.link(function(cn){return vs(he,Ke,at,cn,2)}),"(",Xt,");",Yr,".call(this,a0,a1);"))}}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function _e(Ke,at){var bt=Ke.proc("scope",3);Ke.batchId="a2";var Zt=Ke.shared,Vt=Zt.current;if($l(Ke,bt,at.context),at.framebuffer&&at.framebuffer.append(Ke,bt),ia(Object.keys(at.state)).forEach(function(er){var Bt=at.state[er],Xt=Bt.append(Ke,bt);Un(Xt)?Xt.forEach(function(Ht,zr){Ii(Ht)?bt.set(Ke.next[er],"["+zr+"]",Ht):bt.set(Ke.next[er],"["+zr+"]",Ke.link(Ht,{stable:!0}))}):Xi(Bt)?bt.set(Zt.next,"."+er,Ke.link(Xt,{stable:!0})):bt.set(Zt.next,"."+er,Xt)}),zl(Ke,bt,at,!0,!0),[ke,kt,gt,Gt,Be].forEach(function(er){var Bt=at.draw[er];if(Bt){var Xt=Bt.append(Ke,bt);Ii(Xt)?bt.set(Zt.draw,"."+er,Xt):bt.set(Zt.draw,"."+er,Ke.link(Xt),{stable:!0})}}),Object.keys(at.uniforms).forEach(function(er){var Bt=at.uniforms[er].append(Ke,bt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Xt){return Ii(Xt)?Xt:Ke.link(Xt,{stable:!0})})+"]"),bt.set(Zt.uniforms,"["+Ke.link(gr.id(er),{stable:!0})+"]",Bt)}),Object.keys(at.attributes).forEach(function(er){var Bt=at.attributes[er].append(Ke,bt),Xt=Ke.scopeAttrib(er);Object.keys(new Fn).forEach(function(Ht){bt.set(Xt,"."+Ht,Bt[Ht])})}),at.scopeVAO){var Kt=at.scopeVAO.append(Ke,bt);Ii(Kt)?bt.set(Zt.vao,".targetVAO",Kt):bt.set(Zt.vao,".targetVAO",Ke.link(Kt,{stable:!0}))}function nr(er){var Bt=at.shader[er];if(Bt){var Xt=Bt.append(Ke,bt);Ii(Xt)?bt.set(Zt.shader,"."+er,Xt):bt.set(Zt.shader,"."+er,Ke.link(Xt,{stable:!0}))}}nr(oe),nr(Se),Object.keys(at.state).length>0&&(bt(Vt,".dirty=true;"),bt.exit(Vt,".dirty=true;")),bt("a1(",Ke.shared.context,",a0,",Ke.batchId,");")}function qe(Ke){if(!(typeof Ke!="object"||Un(Ke))){for(var at=Object.keys(Ke),bt=0;bt=0;--Ao){var vs=Ii[Ao];vs&&vs(Ha,null,0)}br.flush(),Ia&&Ia.update()}function qo(){!Xa&&Ii.length>0&&(Xa=c.next(xo))}function Qo(){Xa&&(c.cancel(xo),Xa=null)}function ul(Ao){Ao.preventDefault(),Qo(),Eo.forEach(function(vs){vs()})}function es(Ao){br.getError(),ua.restore(),Na.restore(),ea.restore(),Li.restore(),aa.restore(),Xn.restore(),na.restore(),Ia&&Ia.restore(),ai.procs.refresh(),qo(),mi.forEach(function(vs){vs()})}za&&(za.addEventListener(Xl,ul,!1),za.addEventListener(Dl,es,!1));function wu(){Ii.length=0,Qo(),za&&(za.removeEventListener(Xl,ul),za.removeEventListener(Dl,es)),Na.clear(),Xn.clear(),aa.clear(),na.clear(),Li.clear(),ma.clear(),ea.clear(),Ia&&Ia.clear(),Ui.forEach(function(Ao){Ao()})}function Qs(Ao){function vs(Vt){var Kt=h({},Vt);delete Kt.uniforms,delete Kt.attributes,delete Kt.context,delete Kt.vao,"stencil"in Kt&&Kt.stencil.op&&(Kt.stencil.opBack=Kt.stencil.opFront=Kt.stencil.op,delete Kt.stencil.op);function nr(er){if(er in Kt){var Bt=Kt[er];delete Kt[er],Object.keys(Bt).forEach(function(Xt){Kt[er+"."+Xt]=Bt[Xt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in Vt&&(Kt.vao=Vt.vao),Kt}function ys(Vt,Kt){var nr={},er={};return Object.keys(Vt).forEach(function(Bt){var Xt=Vt[Bt];if(f.isDynamic(Xt)){er[Bt]=f.unbox(Xt,Bt);return}else if(Kt&&Array.isArray(Xt)){for(var Ht=0;Ht0)return vt.call(this,bt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return vt.call(this,Vt,Vt.length)}else return lt.call(this,Vt)}return h(Zt,{stats:_e,destroy:function(){qe.destroy()}})}var vu=Xn.setFBO=Qs({framebuffer:f.define.call(null,xc,"framebuffer")});function Iu(Ao,vs){var ys=0;ai.procs.poll();var be=vs.color;be&&(br.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),ys|=Kl),"depth"in vs&&(br.clearDepth(+vs.depth),ys|=oo),"stencil"in vs&&(br.clearStencil(vs.stencil|0),ys|=Ps),br.clear(ys)}function Zu(Ao){if("framebuffer"in Ao)if(Ao.framebuffer&&Ao.framebuffer_reglType==="framebufferCube")for(var vs=0;vs<6;++vs)vu(h({framebuffer:Ao.framebuffer.faces[vs]},Ao),Iu);else vu(Ao,Iu);else Iu(null,Ao)}function vf(Ao){Ii.push(Ao);function vs(){var ys=Xc(Ii,Ao);function be(){var q=Xc(Ii,be);Ii[q]=Ii[Ii.length-1],Ii.length-=1,Ii.length<=0&&Qo()}Ii[ys]=be}return qo(),{cancel:vs}}function $l(){var Ao=Wa.viewport,vs=Wa.scissor_box;Ao[0]=Ao[1]=vs[0]=vs[1]=0,Ha.viewportWidth=Ha.framebufferWidth=Ha.drawingBufferWidth=Ao[2]=vs[2]=br.drawingBufferWidth,Ha.viewportHeight=Ha.framebufferHeight=Ha.drawingBufferHeight=Ao[3]=vs[3]=br.drawingBufferHeight}function uu(){Ha.tick+=1,Ha.time=Wu(),$l(),ai.procs.poll()}function uo(){Li.refresh(),$l(),ai.procs.refresh(),Ia&&Ia.update()}function Wu(){return(p()-Ya)/1e3}uo();function Us(Ao,vs){var ys;switch(Ao){case"frame":return vf(vs);case"lost":ys=Eo;break;case"restore":ys=mi;break;case"destroy":ys=Ui;break}return ys.push(vs),{cancel:function(){for(var be=0;be=0},read:In,destroy:wu,_gl:br,_refresh:uo,poll:function(){uu(),Ia&&Ia.update()},now:Wu,stats:dn,getCachedCode:zl,preloadCachedCode:sc});return gr.onDone(null,lc),lc}return Eu})}}),OI=Ge({"node_modules/gl-util/context.js"($,G){var h=Dg();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},S(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=h(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var n=document.querySelector(o.container);if(!n)throw Error("Element "+o.container+" is not found");o.container=n}S(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),b(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),b(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function b(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function S(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(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}}}),FI=Ge({"node_modules/font-atlas/index.js"($,G){var h=MC(),b=[32,126];G.exports=S;function S(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],n=E.chars||b;if(r&&typeof r!="string"&&(r=h(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var i=[],a=n[0],s=0;a<=n[1];a++)i[s++]=String.fromCharCode(a);n=i}e=e.slice(),t.width=e[0],t.height=e[1];var f=t.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,t.width,t.height),f.font=r,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";for(var c=o[0]/2,p=o[1]/2,a=0;ae[0]-o[0]/2&&(c=o[0]/2,p+=o[1]);return t}}}),EC=Ge({"node_modules/bit-twiddle/twiddle.js"($){"use restrict";var G=32;$.INT_BITS=G,$.INT_MAX=2147483647,$.INT_MIN=-1<0)-(S<0)},$.abs=function(S){var E=S>>G-1;return(S^E)-E},$.min=function(S,E){return E^(S^E)&-(S65535)<<4,S>>>=E,e=(S>255)<<3,S>>>=e,E|=e,e=(S>15)<<2,S>>>=e,E|=e,e=(S>3)<<1,S>>>=e,E|=e,E|S>>1},$.log10=function(S){return S>=1e9?9:S>=1e8?8:S>=1e7?7:S>=1e6?6:S>=1e5?5:S>=1e4?4:S>=1e3?3:S>=100?2:S>=10?1:0},$.popCount=function(S){return S=S-(S>>>1&1431655765),S=(S&858993459)+(S>>>2&858993459),(S+(S>>>4)&252645135)*16843009>>>24};function h(S){var E=32;return S&=-S,S&&E--,S&65535&&(E-=16),S&16711935&&(E-=8),S&252645135&&(E-=4),S&858993459&&(E-=2),S&1431655765&&(E-=1),E}$.countTrailingZeros=h,$.nextPow2=function(S){return S+=S===0,--S,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S+1},$.prevPow2=function(S){return S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S-(S>>>1)},$.parity=function(S){return S^=S>>>16,S^=S>>>8,S^=S>>>4,S&=15,27030>>>S&1};var b=new Array(256);(function(S){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;S[E]=t<>>8&255]<<16|b[S>>>16&255]<<8|b[S>>>24&255]},$.interleave2=function(S,E){return S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,S|E<<1},$.deinterleave2=function(S,E){return S=S>>>E&1431655765,S=(S|S>>>1)&858993459,S=(S|S>>>2)&252645135,S=(S|S>>>4)&16711935,S=(S|S>>>16)&65535,S<<16>>16},$.interleave3=function(S,E,e){return S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,S|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,S|e<<2},$.deinterleave3=function(S,E){return S=S>>>E&1227133513,S=(S|S>>>2)&3272356035,S=(S|S>>>4)&251719695,S=(S|S>>>8)&4278190335,S=(S|S>>>16)&1023,S<<22>>22},$.nextCombination=function(S){var E=S|S-1;return E+1|(~E&-~E)-1>>>h(S)+1}}}),BI=Ge({"node_modules/dup/dup.js"($,G){function h(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),n;if(t===E.length-1)for(n=0;n"u"&&(e=0),typeof E){case"number":if(E>0)return b(E|0,e);break;case"object":if(typeof E.length=="number")return h(E,e,0);break}return[]}G.exports=S}}),NI=Ge({"node_modules/typedarray-pool/pool.js"($){var G=EC(),h=BI(),b=yg().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:h([32,0]),UINT16:h([32,0]),UINT32:h([32,0]),BIGUINT64:h([32,0]),INT8:h([32,0]),INT16:h([32,0]),INT32:h([32,0]),BIGINT64:h([32,0]),FLOAT:h([32,0]),DOUBLE:h([32,0]),DATA:h([32,0]),UINT8C:h([32,0]),BUFFER:h([32,0])});var S=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=h([32,0])),t.BIGUINT64||(t.BIGUINT64=h([32,0])),t.BIGINT64||(t.BIGINT64=h([32,0])),t.BUFFER||(t.BUFFER=h([32,0]));var r=t.DATA,o=t.BUFFER;$.free=function(u){if(b.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var v=u.length||u.byteLength,y=G.log2(v)|0;r[y].push(u)}};function n(m){if(m){var u=m.length||m.byteLength,v=G.log2(u);r[v].push(m)}}function i(m){n(m.buffer)}$.freeUint8=$.freeUint16=$.freeUint32=$.freeBigUint64=$.freeInt8=$.freeInt16=$.freeInt32=$.freeBigInt64=$.freeFloat32=$.freeFloat=$.freeFloat64=$.freeDouble=$.freeUint8Clamped=$.freeDataView=i,$.freeArrayBuffer=n,$.freeBuffer=function(u){o[G.log2(u.length)].push(u)},$.malloc=function(u,v){if(v===void 0||v==="arraybuffer")return a(u);switch(v){case"uint8":return s(u);case"uint16":return f(u);case"uint32":return c(u);case"int8":return p(u);case"int16":return d(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return g(u);case"uint8_clamped":return x(u);case"bigint64":return M(u);case"biguint64":return A(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function a(u){var u=G.nextPow2(u),v=G.log2(u),y=r[v];return y.length>0?y.pop():new ArrayBuffer(u)}$.mallocArrayBuffer=a;function s(m){return new Uint8Array(a(m),0,m)}$.mallocUint8=s;function f(m){return new Uint16Array(a(2*m),0,m)}$.mallocUint16=f;function c(m){return new Uint32Array(a(4*m),0,m)}$.mallocUint32=c;function p(m){return new Int8Array(a(m),0,m)}$.mallocInt8=p;function d(m){return new Int16Array(a(2*m),0,m)}$.mallocInt16=d;function T(m){return new Int32Array(a(4*m),0,m)}$.mallocInt32=T;function l(m){return new Float32Array(a(4*m),0,m)}$.mallocFloat32=$.mallocFloat=l;function g(m){return new Float64Array(a(8*m),0,m)}$.mallocFloat64=$.mallocDouble=g;function x(m){return S?new Uint8ClampedArray(a(m),0,m):s(m)}$.mallocUint8Clamped=x;function A(m){return E?new BigUint64Array(a(8*m),0,m):null}$.mallocBigUint64=A;function M(m){return e?new BigInt64Array(a(8*m),0,m):null}$.mallocBigInt64=M;function _(m){return new DataView(a(m),0,m)}$.mallocDataView=_;function w(m){m=G.nextPow2(m);var u=G.log2(m),v=o[u];return v.length>0?v.pop():new b(m)}$.mallocBuffer=w,$.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),UI=Ge({"node_modules/is-plain-obj/index.js"($,G){var h=Object.prototype.toString;G.exports=function(b){var S;return h.call(b)==="[object Object]"&&(S=Object.getPrototypeOf(b),S===null||S===Object.getPrototypeOf({}))}}}),kC=Ge({"node_modules/parse-unit/index.js"($,G){G.exports=function(b,S){S||(S=[0,""]),b=String(b);var E=parseFloat(b,10);return S[0]=E,S[1]=b.match(/[\d.\-\+]*\s*(.*)/)[1]||"",S}}}),jI=Ge({"node_modules/to-px/topx.js"($,G){var h=kC();G.exports=e;var b=96;function S(t,r){var o=h(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var n=S(o,"font-size")/128;return r.removeChild(o),n}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 E(t,r);case"em":return S(r,"font-size");case"rem":return S(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 b;case"cm":return b/2.54;case"mm":return b/25.4;case"pt":return b/72;case"pc":return b/6}return 1}}}),qI=Ge({"node_modules/detect-kerning/index.js"($,G){G.exports=E;var h=E.canvas=document.createElement("canvas"),b=h.getContext("2d"),S=e([32,126]);E.createPairs=e,E.ascii=S;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},n,i=16,a=.05;r&&(r.length===2&&typeof r[0]=="number"?n=e(r):Array.isArray(r)?n=r:(r.o?n=e(r.o):r.pairs&&(n=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(a=r.threshold))),n||(n=S),b.font=i+"px "+t;for(var s=0;si*a){var d=(p-c)/i;o[f]=d*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var n=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),HI=Ge({"node_modules/gl-text/dist.js"($,G){var h=DI(),b=Dg(),S=zI(),E=OI(),e=yC(),t=P_(),r=FI(),o=NI(),n=N3(),i=UI(),a=kC(),s=jI(),f=qI(),c=_v(),p=VI(),d=Zb(),T=EC(),l=T.nextPow2,g=new e,x=!1;document.body&&(A=document.body.appendChild(document.createElement("div")),A.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(A).fontStretch&&(x=!0),document.body.removeChild(A));var A,M=function(m){_(m)?(m={regl:m},this.gl=m.regl._gl):this.gl=E(m),this.shader=g.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=m.regl||S({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(),g.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(m)?m:{})};M.prototype.createShader=function(){var m=this.regl,u=m({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:m.prop("count"),offset:m.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:m.this("sizeBuffer")},width:{offset:0,stride:8,buffer:m.this("sizeBuffer")},char:m.this("charBuffer"),position:m.this("position")},uniforms:{atlasSize:function(y,I){return[I.atlas.width,I.atlas.height]},atlasDim:function(y,I){return[I.atlas.cols,I.atlas.rows]},atlas:function(y,I){return I.atlas.texture},charStep:function(y,I){return I.atlas.step},em:function(y,I){return I.atlas.em},color:m.prop("color"),opacity:m.prop("opacity"),viewport:m.this("viewportArray"),scale:m.this("scale"),align:m.prop("align"),baseline:m.prop("baseline"),translate:m.this("translate"),positionOffset:m.prop("positionOffset")},primitive:"points",viewport:m.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; + }`}),v={};return{regl:m,draw:u,atlas:v}},M.prototype.update=function(m){var u=this;if(typeof m=="string")m={text:m};else if(!m)return;m=b(m,{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),m.opacity!=null&&(Array.isArray(m.opacity)?this.opacity=m.opacity.map(function(pe){return parseFloat(pe)}):this.opacity=parseFloat(m.opacity)),m.viewport!=null&&(this.viewport=n(m.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]),m.kerning!=null&&(this.kerning=m.kerning),m.offset!=null&&(typeof m.offset=="number"&&(m.offset=[m.offset,0]),this.positionOffset=d(m.offset)),m.direction&&(this.direction=m.direction),m.range&&(this.range=m.range,this.scale=[1/(m.range[2]-m.range[0]),1/(m.range[3]-m.range[1])],this.translate=[-m.range[0],-m.range[1]]),m.scale&&(this.scale=m.scale),m.translate&&(this.translate=m.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!m.font&&(m.font=M.baseFontSize+"px sans-serif");var v=!1,y=!1;if(m.font&&(Array.isArray(m.font)?m.font:[m.font]).forEach(function(pe,Ne){if(typeof pe=="string")try{pe=h.parse(pe)}catch{pe=h.parse(M.baseFontSize+"px "+pe)}else{var ot=pe.style,ct=pe.weight,rt=pe.stretch,Ft=pe.variant;pe=h.parse(h.stringify(pe)),ot&&(pe.style=ot),ct&&(pe.weight=ct),rt&&(pe.stretch=rt),Ft&&(pe.variant=Ft)}var Nt=h.stringify({size:M.baseFontSize,family:pe.family,stretch:x?pe.stretch:void 0,variant:pe.variant,weight:pe.weight,style:pe.style}),$t=a(pe.size),rr=Math.round($t[0]*s($t[1]));if(rr!==u.fontSize[Ne]&&(y=!0,u.fontSize[Ne]=rr),(!u.font[Ne]||Nt!=u.font[Ne].baseString)&&(v=!0,u.font[Ne]=M.fonts[Nt],!u.font[Ne])){var Mr=pe.family.join(", "),Sr=[pe.style];pe.style!=pe.variant&&Sr.push(pe.variant),pe.variant!=pe.weight&&Sr.push(pe.weight),x&&pe.weight!=pe.stretch&&Sr.push(pe.stretch),u.font[Ne]={baseString:Nt,family:Mr,weight:pe.weight,stretch:pe.stretch,style:pe.style,variant:pe.variant,width:{},kerning:{},metrics:p(Mr,{origin:"top",fontSize:M.baseFontSize,fontStyle:Sr.join(" ")})},M.fonts[Nt]=u.font[Ne]}}),(v||y)&&this.font.forEach(function(pe,Ne){var ot=h.stringify({size:u.fontSize[Ne],family:pe.family,stretch:x?pe.stretch:void 0,variant:pe.variant,weight:pe.weight,style:pe.style});if(u.fontAtlas[Ne]=u.shader.atlas[ot],!u.fontAtlas[Ne]){var ct=pe.metrics;u.shader.atlas[ot]=u.fontAtlas[Ne]={fontString:ot,step:Math.ceil(u.fontSize[Ne]*ct.bottom*.5)*2,em:u.fontSize[Ne],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}m.text==null&&(m.text=u.text)}),typeof m.text=="string"&&m.position&&m.position.length>2){for(var I=Array(m.position.length*.5),L=0;L2){for(var N=!m.position[0].length,B=o.mallocFloat(this.count*2),R=0,U=0;R1?u.align[Ne]:u.align[0]:u.align;if(typeof ot=="number")return ot;switch(ot){case"right":case"end":return-pe;case"center":case"centre":case"middle":return-pe*.5}return 0})),this.baseline==null&&m.baseline==null&&(m.baseline=0),m.baseline!=null&&(this.baseline=m.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(pe,Ne){var ot=(u.font[Ne]||u.font[0]).metrics,ct=0;return ct+=ot.bottom*.5,typeof pe=="number"?ct+=pe-ot.baseline:ct+=-ot[pe],ct*=-1,ct})),m.color!=null)if(m.color||(m.color="transparent"),typeof m.color=="string"||!isNaN(m.color))this.color=t(m.color,"uint8");else{var Fe;if(typeof m.color[0]=="number"&&m.color.length>this.counts.length){var ze=m.color.length;Fe=o.mallocUint8(ze);for(var Ye=(m.color.subarray||m.color.slice).bind(m.color),it=0;it4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Qe){var Le=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(Le);for(var Te=0;Te1?this.counts[Te]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Te]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Te*4,Te*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Te]:this.opacity,baseline:this.baselineOffset[Te]!=null?this.baselineOffset[Te]:this.baselineOffset[0],align:this.align?this.alignOffset[Te]!=null?this.alignOffset[Te]:this.alignOffset[0]:0,atlas:this.fontAtlas[Te]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Te*2,Te*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=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),GI=Ge({"node_modules/@plotly/regl/dist/regl.unchecked.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?G.exports=b():h.createREGL=b()})($,function(){var h=function(dt,gr){for(var br=Object.keys(gr),Cn=0;Cn1&&gr===br&&(gr==='"'||gr==="'"))return['"'+r(dt.substr(1,dt.length-2))+'"'];var Cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(dt);if(Cn)return o(dt.substr(0,Cn.index)).concat(o(Cn[1])).concat(o(dt.substr(Cn.index+Cn[0].length)));var ua=dt.split(".");if(ua.length===1)return['"'+r(dt)+'"'];for(var mn=[],dn=0;dn"u"?1:window.devicePixelRatio,Ya=!1,Oi={},pi=function(tn){},Ha=function(){};if(typeof gr=="string"?br=document.querySelector(gr):typeof gr=="object"&&(g(gr)?br=gr:x(gr)?(mn=gr,ua=mn.canvas):("gl"in gr?mn=gr.gl:"canvas"in gr?ua=M(gr.canvas):"container"in gr&&(Cn=M(gr.container)),"attributes"in gr&&(dn=gr.attributes),"extensions"in gr&&(Da=A(gr.extensions)),"optionalExtensions"in gr&&(Ra=A(gr.optionalExtensions)),"onDone"in gr&&(pi=gr.onDone),"profile"in gr&&(Ya=!!gr.profile),"pixelRatio"in gr&&(Ia=+gr.pixelRatio),"cachedCode"in gr&&(Oi=gr.cachedCode))),br&&(br.nodeName.toLowerCase()==="canvas"?ua=br:Cn=br),!mn){if(!ua){var pa=T(Cn||document.body,pi,Ia);if(!pa)return null;ua=pa.canvas,Ha=pa.onDestroy}dn.premultipliedAlpha===void 0&&(dn.premultipliedAlpha=!0),mn=l(ua,dn)}return mn?{gl:mn,canvas:ua,container:Cn,extensions:Da,optionalExtensions:Ra,pixelRatio:Ia,profile:Ya,cachedCode:Oi,onDone:pi,onDestroy:Ha}:(Ha(),pi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(dt,gr){var br={};function Cn(dn){var Da=dn.toLowerCase(),Ra;try{Ra=br[Da]=dt.getExtension(Da)}catch{}return!!Ra}for(var ua=0;ua65535)<<4,dt>>>=gr,br=(dt>255)<<3,dt>>>=br,gr|=br,br=(dt>15)<<2,dt>>>=br,gr|=br,br=(dt>3)<<1,dt>>>=br,gr|=br,gr|dt>>1}function R(){var dt=m(8,function(){return[]});function gr(mn){var dn=N(mn),Da=dt[B(dn)>>2];return Da.length>0?Da.pop():new ArrayBuffer(dn)}function br(mn){dt[B(mn.byteLength)>>2].push(mn)}function Cn(mn,dn){var Da=null;switch(mn){case u:Da=new Int8Array(gr(dn),0,dn);break;case v:Da=new Uint8Array(gr(dn),0,dn);break;case y:Da=new Int16Array(gr(2*dn),0,dn);break;case I:Da=new Uint16Array(gr(2*dn),0,dn);break;case L:Da=new Int32Array(gr(4*dn),0,dn);break;case z:Da=new Uint32Array(gr(4*dn),0,dn);break;case F:Da=new Float32Array(gr(4*dn),0,dn);break;default:return null}return Da.length!==dn?Da.subarray(0,dn):Da}function ua(mn){br(mn.buffer)}return{alloc:gr,free:br,allocType:Cn,freeType:ua}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,K=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,ve=35660,Ae=34930,Ce=36349,Fe=34076,ze=34024,Ye=7936,it=7937,st=7938,nt=35724,Qe=34047,Le=36063,Te=34852,pe=3553,Ne=34067,ot=34069,ct=33984,rt=6408,Ft=5126,Nt=5121,$t=36160,rr=36053,Mr=36064,Sr=16384,Zr=function(dt,gr){var br=1;gr.ext_texture_filter_anisotropic&&(br=dt.getParameter(Qe));var Cn=1,ua=1;gr.webgl_draw_buffers&&(Cn=dt.getParameter(Te),ua=dt.getParameter(Le));var mn=!!gr.oes_texture_float;if(mn){var dn=dt.createTexture();dt.bindTexture(pe,dn),dt.texImage2D(pe,0,rt,1,1,0,rt,Ft,null);var Da=dt.createFramebuffer();if(dt.bindFramebuffer($t,Da),dt.framebufferTexture2D($t,Mr,pe,dn,0),dt.bindTexture(pe,null),dt.checkFramebufferStatus($t)!==rr)mn=!1;else{dt.viewport(0,0,1,1),dt.clearColor(1,0,0,1),dt.clear(Sr);var Ra=U.allocType(Ft,4);dt.readPixels(0,0,1,1,rt,Ft,Ra),dt.getError()?mn=!1:(dt.deleteFramebuffer(Da),dt.deleteTexture(dn),mn=Ra[0]===1),U.freeType(Ra)}}var Ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ya=!0;if(!Ia){var Oi=dt.createTexture(),pi=U.allocType(Nt,36);dt.activeTexture(ct),dt.bindTexture(Ne,Oi),dt.texImage2D(ot,0,rt,3,3,0,rt,Nt,pi),U.freeType(pi),dt.bindTexture(Ne,null),dt.deleteTexture(Oi),Ya=!dt.getError()}return{colorBits:[dt.getParameter(Z),dt.getParameter(re),dt.getParameter(fe),dt.getParameter(le)],depthBits:dt.getParameter(ce),stencilBits:dt.getParameter(V),subpixelBits:dt.getParameter(j),extensions:Object.keys(gr).filter(function(Ha){return!!gr[Ha]}),maxAnisotropic:br,maxDrawbuffers:Cn,maxColorAttachments:ua,pointSizeDims:dt.getParameter(ee),lineWidthDims:dt.getParameter(ne),maxViewportDims:dt.getParameter(ue),maxCombinedTextureUnits:dt.getParameter(ie),maxCubeMapSize:dt.getParameter(Fe),maxRenderbufferSize:dt.getParameter(ze),maxTextureUnits:dt.getParameter(Ae),maxTextureSize:dt.getParameter(K),maxAttributes:dt.getParameter(te),maxVertexUniforms:dt.getParameter(H),maxVertexTextureUnits:dt.getParameter(ve),maxVaryingVectors:dt.getParameter(ae),maxFragmentUniforms:dt.getParameter(Ce),glsl:dt.getParameter(nt),renderer:dt.getParameter(it),vendor:dt.getParameter(Ye),version:dt.getParameter(st),readFloat:mn,npotTextureCube:Ya}},Ar=function(dt){return dt instanceof Uint8Array||dt instanceof Uint16Array||dt instanceof Uint32Array||dt instanceof Int8Array||dt instanceof Int16Array||dt instanceof Int32Array||dt instanceof Float32Array||dt instanceof Float64Array||dt instanceof Uint8ClampedArray};function Br(dt){return!!dt&&typeof dt=="object"&&Array.isArray(dt.shape)&&Array.isArray(dt.stride)&&typeof dt.offset=="number"&&dt.shape.length===dt.stride.length&&(Array.isArray(dt.data)||Ar(dt.data))}var Mt=function(dt){return Object.keys(dt).map(function(gr){return dt[gr]})},je={shape:Xe,flatten:Me};function $e(dt,gr,br){for(var Cn=0;Cn0){var Li;if(Array.isArray(Fn[0])){Na=Nn(Fn);for(var aa=1,Xn=1;Xn0){if(typeof aa[0]=="number"){var Wa=U.allocType(na.dtype,aa.length);Vr(Wa,aa),Na(Wa,ai),U.freeType(Wa)}else if(Array.isArray(aa[0])||Ar(aa[0])){In=Nn(aa);var za=ra(aa,In,na.dtype);Na(za,ai),U.freeType(za)}}}else if(Br(aa)){In=aa.shape;var Ii=aa.stride,Eo=0,mi=0,Ui=0,Xa=0;In.length===1?(Eo=In[0],mi=1,Ui=Ii[0],Xa=0):In.length===2&&(Eo=In[0],mi=In[1],Ui=Ii[0],Xa=Ii[1]);var xo=Array.isArray(aa.data)?na.dtype:sr(aa.data),qo=U.allocType(xo,Eo*mi);on(qo,aa.data,Eo,mi,Ui,Xa,aa.offset),Na(qo,ai),U.freeType(qo)}return ui}return ea||ui(tn),ui._reglType="buffer",ui._buffer=na,ui.subdata=Li,br.profile&&(ui.stats=na.stats),ui.destroy=function(){pi(na)},ui}function pa(){Mt(mn).forEach(function(tn){tn.buffer=dt.createBuffer(),dt.bindBuffer(tn.type,tn.buffer),dt.bufferData(tn.type,tn.persistentData||tn.byteLength,tn.usage)})}return br.profile&&(gr.getTotalBufferSize=function(){var tn=0;return Object.keys(mn).forEach(function(Fn){tn+=mn[Fn].stats.size}),tn}),{create:Ha,createStream:Ra,destroyStream:Ia,clear:function(){Mt(mn).forEach(pi),Da.forEach(pi)},getBuffer:function(tn){return tn&&tn._buffer instanceof dn?tn._buffer:null},restore:pa,_initBuffer:Oi}}var wn=0,Kn=0,da=1,fa=1,ga=4,ka=4,Vn={points:wn,point:Kn,lines:da,line:fa,triangles:ga,triangle:ka,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},hi=0,Ti=1,Dt=4,yt=5120,Er=5121,Nr=5122,jr=5123,Ir=5124,Ur=5125,sn=34963,Kr=35040,Tt=35044;function or(dt,gr,br,Cn){var ua={},mn=0,dn={uint8:Er,uint16:jr};gr.oes_element_index_uint&&(dn.uint32=Ur);function Da(pa){this.id=mn++,ua[this.id]=this,this.buffer=pa,this.primType=Dt,this.vertCount=0,this.type=0}Da.prototype.bind=function(){this.buffer.bind()};var Ra=[];function Ia(pa){var tn=Ra.pop();return tn||(tn=new Da(br.create(null,sn,!0,!1)._buffer)),Oi(tn,pa,Kr,-1,-1,0,0),tn}function Ya(pa){Ra.push(pa)}function Oi(pa,tn,Fn,ea,ma,na,ui){pa.buffer.bind();var Na;if(tn){var Li=ui;!ui&&(!Ar(tn)||Br(tn)&&!Ar(tn.data))&&(Li=gr.oes_element_index_uint?Ur:jr),br._initBuffer(pa.buffer,tn,Fn,Li,3)}else dt.bufferData(sn,na,Fn),pa.buffer.dtype=Na||Er,pa.buffer.usage=Fn,pa.buffer.dimension=3,pa.buffer.byteLength=na;if(Na=ui,!ui){switch(pa.buffer.dtype){case Er:case yt:Na=Er;break;case jr:case Nr:Na=jr;break;case Ur:case Ir:Na=Ur;break}pa.buffer.dtype=Na}pa.type=Na;var aa=ma;aa<0&&(aa=pa.buffer.byteLength,Na===jr?aa>>=1:Na===Ur&&(aa>>=2)),pa.vertCount=aa;var Xn=ea;if(ea<0){Xn=Dt;var ai=pa.buffer.dimension;ai===1&&(Xn=hi),ai===2&&(Xn=Ti),ai===3&&(Xn=Dt)}pa.primType=Xn}function pi(pa){Cn.elementsCount--,delete ua[pa.id],pa.buffer.destroy(),pa.buffer=null}function Ha(pa,tn){var Fn=br.create(null,sn,!0),ea=new Da(Fn._buffer);Cn.elementsCount++;function ma(na){if(!na)Fn(),ea.primType=Dt,ea.vertCount=0,ea.type=Er;else if(typeof na=="number")Fn(na),ea.primType=Dt,ea.vertCount=na|0,ea.type=Er;else{var ui=null,Na=Tt,Li=-1,aa=-1,Xn=0,ai=0;Array.isArray(na)||Ar(na)||Br(na)?ui=na:("data"in na&&(ui=na.data),"usage"in na&&(Na=ta[na.usage]),"primitive"in na&&(Li=Vn[na.primitive]),"count"in na&&(aa=na.count|0),"type"in na&&(ai=dn[na.type]),"length"in na?Xn=na.length|0:(Xn=aa,ai===jr||ai===Nr?Xn*=2:(ai===Ur||ai===Ir)&&(Xn*=4))),Oi(ea,ui,Na,Li,aa,Xn,ai)}return ma}return ma(pa),ma._reglType="elements",ma._elements=ea,ma.subdata=function(na,ui){return Fn.subdata(na,ui),ma},ma.destroy=function(){pi(ea)},ma}return{create:Ha,createStream:Ia,destroyStream:Ya,getElements:function(pa){return typeof pa=="function"&&pa._elements instanceof Da?pa._elements:null},clear:function(){Mt(ua).forEach(pi)}}}var Dr=new Float32Array(1),ln=new Uint32Array(Dr.buffer),Pn=5123;function jn(dt){for(var gr=U.allocType(Pn,dt.length),br=0;br>>31<<15,mn=(Cn<<1>>>24)-127,dn=Cn>>13&1023;if(mn<-24)gr[br]=ua;else if(mn<-14){var Da=-14-mn;gr[br]=ua+(dn+1024>>Da)}else mn>15?gr[br]=ua+31744:gr[br]=ua+(mn+15<<10)+dn}return gr}function Un(dt){return Array.isArray(dt)||Ar(dt)}var un=34467,Rn=3553,di=34067,Ma=34069,Ei=6408,Hi=6406,io=6407,no=6409,bo=6410,li=32854,ts=32855,Ho=36194,Gs=32819,cs=32820,Jo=33635,Uo=34042,Xs=6402,js=34041,ol=35904,fs=35906,Zo=36193,ho=33776,hs=33777,sl=33778,El=33779,Ll=35986,Es=35987,ci=34798,Ji=35840,kl=35841,Rs=35842,zo=35843,Pl=36196,Ys=5121,ll=5123,_u=5125,Ki=5126,ms=10242,rs=10243,ql=10497,Vl=33071,Po=33648,ou=10240,cu=10241,zs=9728,xl=9729,Ol=9984,Nl=9985,Vu=9986,sf=9987,jc=33170,$c=4352,Ch=4353,gh=4354,bl=34046,Cc=3317,Lh=37440,tc=37441,Hu=37443,rc=37444,Jc=33984,Zl=[Ol,Vu,Nl,sf],Gu=[0,no,bo,io,Ei],qs={};qs[no]=qs[Hi]=qs[Xs]=1,qs[js]=qs[bo]=2,qs[io]=qs[ol]=3,qs[Ei]=qs[fs]=4;function Rl(dt){return"[object "+dt+"]"}var xf=Rl("HTMLCanvasElement"),gc=Rl("OffscreenCanvas"),Rf=Rl("CanvasRenderingContext2D"),su=Rl("ImageBitmap"),xv=Rl("HTMLImageElement"),Os=Rl("HTMLVideoElement"),Fv=Object.keys(Je).concat([xf,gc,Rf,su,xv,Os]),vl=[];vl[Ys]=1,vl[Ki]=4,vl[Zo]=2,vl[ll]=2,vl[_u]=4;var Do=[];Do[li]=2,Do[ts]=2,Do[Ho]=2,Do[js]=4,Do[ho]=.5,Do[hs]=.5,Do[sl]=1,Do[El]=1,Do[Ll]=.5,Do[Es]=1,Do[ci]=1,Do[Ji]=.5,Do[kl]=.25,Do[Rs]=.5,Do[zo]=.25,Do[Pl]=.5;function Wf(dt){return Array.isArray(dt)&&(dt.length===0||typeof dt[0]=="number")}function Qc(dt){if(!Array.isArray(dt))return!1;var gr=dt.length;return!(gr===0||!Un(dt[0]))}function Ru(dt){return Object.prototype.toString.call(dt)}function Ph(dt){return Ru(dt)===xf}function If(dt){return Ru(dt)===gc}function ah(dt){return Ru(dt)===Rf}function Xu(dt){return Ru(dt)===su}function ov(dt){return Ru(dt)===xv}function Nh(dt){return Ru(dt)===Os}function ih(dt){if(!dt)return!1;var gr=Ru(dt);return Fv.indexOf(gr)>=0?!0:Wf(dt)||Qc(dt)||Br(dt)}function Df(dt){return Je[Object.prototype.toString.call(dt)]|0}function Rh(dt,gr){var br=gr.length;switch(dt.type){case Ys:case ll:case _u:case Ki:var Cn=U.allocType(dt.type,br);Cn.set(gr),dt.data=Cn;break;case Zo:dt.data=jn(gr);break}}function Ih(dt,gr){return U.allocType(dt.type===Zo?Ki:dt.type,gr)}function ef(dt,gr){dt.type===Zo?(dt.data=jn(gr),U.freeType(gr)):dt.data=gr}function Uh(dt,gr,br,Cn,ua,mn){for(var dn=dt.width,Da=dt.height,Ra=dt.channels,Ia=dn*Da*Ra,Ya=Ih(dt,Ia),Oi=0,pi=0;pi=1;)Da+=dn*Ra*Ra,Ra/=2;return Da}else return dn*br*Cn}function lf(dt,gr,br,Cn,ua,mn,dn){var Da={"don't care":$c,"dont care":$c,nice:gh,fast:Ch},Ra={repeat:ql,clamp:Vl,mirror:Po},Ia={nearest:zs,linear:xl},Ya=h({mipmap:sf,"nearest mipmap nearest":Ol,"linear mipmap nearest":Nl,"nearest mipmap linear":Vu,"linear mipmap linear":sf},Ia),Oi={none:0,browser:rc},pi={uint8:Ys,rgba4:Gs,rgb565:Jo,"rgb5 a1":cs},Ha={alpha:Hi,luminance:no,"luminance alpha":bo,rgb:io,rgba:Ei,rgba4:li,"rgb5 a1":ts,rgb565:Ho},pa={};gr.ext_srgb&&(Ha.srgb=ol,Ha.srgba=fs),gr.oes_texture_float&&(pi.float32=pi.float=Ki),gr.oes_texture_half_float&&(pi.float16=pi["half float"]=Zo),gr.webgl_depth_texture&&(h(Ha,{depth:Xs,"depth stencil":js}),h(pi,{uint16:ll,uint32:_u,"depth stencil":Uo})),gr.webgl_compressed_texture_s3tc&&h(pa,{"rgb s3tc dxt1":ho,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":sl,"rgba s3tc dxt5":El}),gr.webgl_compressed_texture_atc&&h(pa,{"rgb atc":Ll,"rgba atc explicit alpha":Es,"rgba atc interpolated alpha":ci}),gr.webgl_compressed_texture_pvrtc&&h(pa,{"rgb pvrtc 4bppv1":Ji,"rgb pvrtc 2bppv1":kl,"rgba pvrtc 4bppv1":Rs,"rgba pvrtc 2bppv1":zo}),gr.webgl_compressed_texture_etc1&&(pa["rgb etc1"]=Pl);var tn=Array.prototype.slice.call(dt.getParameter(un));Object.keys(pa).forEach(function(q){var he=pa[q];tn.indexOf(he)>=0&&(Ha[q]=he)});var Fn=Object.keys(Ha);br.textureFormats=Fn;var ea=[];Object.keys(Ha).forEach(function(q){var he=Ha[q];ea[he]=q});var ma=[];Object.keys(pi).forEach(function(q){var he=pi[q];ma[he]=q});var na=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];na[he]=q});var ui=[];Object.keys(Ya).forEach(function(q){var he=Ya[q];ui[he]=q});var Na=[];Object.keys(Ra).forEach(function(q){var he=Ra[q];Na[he]=q});var Li=Fn.reduce(function(q,he){var J=Ha[he];return J===no||J===Hi||J===no||J===bo||J===Xs||J===js||gr.ext_srgb&&(J===ol||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ei:q[J]=io,q},{});function aa(){this.internalformat=Ei,this.format=Ei,this.type=Ys,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=rc,this.width=0,this.height=0,this.channels=0}function Xn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function ai(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Oi[he.colorSpace]),"type"in he){var J=he.type;q.type=pi[J]}var _e=q.width,qe=q.height,lt=q.channels,vt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(lt=he.shape[2],vt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(lt=he.channels,vt=!0)),q.width=_e|0,q.height=qe|0,q.channels=lt|0;var Ke=!1;if("format"in he){var at=he.format,bt=q.internalformat=Ha[at];q.format=Li[bt],at in pi&&("type"in he||(q.type=pi[at])),at in pa&&(q.compressed=!0),Ke=!0}!vt&&Ke?q.channels=qs[q.format]:vt&&!Ke&&q.channels!==Gu[q.format]&&(q.format=q.internalformat=Gu[q.channels])}}function In(q){dt.pixelStorei(Lh,q.flipY),dt.pixelStorei(tc,q.premultiplyAlpha),dt.pixelStorei(Hu,q.colorSpace),dt.pixelStorei(Cc,q.unpackAlignment)}function Wa(){aa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function za(q,he){var J=null;if(ih(he)?J=he:he&&(ai(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),ih(he.data)&&(J=he.data)),he.copy){var _e=ua.viewportWidth,qe=ua.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Ar(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Ys&&(q.type=Df(J));else if(Wf(J))q.channels=q.channels||4,Rh(q,J),q.alignment=1,q.needsFree=!0;else if(Br(J)){var lt=J.data;!Array.isArray(lt)&&q.type===Ys&&(q.type=Df(lt));var vt=J.shape,Ke=J.stride,at,bt,Zt,Vt,Kt,nr;vt.length===3?(Zt=vt[2],nr=Ke[2]):(Zt=1,nr=1),at=vt[0],bt=vt[1],Vt=Ke[0],Kt=Ke[1],q.alignment=1,q.width=at,q.height=bt,q.channels=Zt,q.format=q.internalformat=Gu[Zt],q.needsFree=!0,Uh(q,lt,Vt,Kt,nr,J.offset)}else if(Ph(J)||If(J)||ah(J))Ph(J)||If(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Xu(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(ov(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Nh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(Qc(J)){var er=q.width||J[0].length,Bt=q.height||J.length,Xt=q.channels;Un(J[0][0])?Xt=Xt||J[0][0].length:Xt=Xt||1;for(var Ht=je.shape(J),zr=1,Yr=0;Yr>=qe,J.height>>=qe,za(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Ia[_e]}var qe=q.wrapS,lt=q.wrapT;if("wrap"in he){var vt=he.wrap;typeof vt=="string"?qe=lt=Ra[vt]:Array.isArray(vt)&&(qe=Ra[vt[0]],lt=Ra[vt[1]])}else{if("wrapS"in he){var Ke=he.wrapS;qe=Ra[Ke]}if("wrapT"in he){var at=he.wrapT;lt=Ra[at]}}if(q.wrapS=qe,q.wrapT=lt,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var bt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=Da[he.mipmap],q.genMipmaps=!0,bt=!0;break;case"boolean":bt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,bt=!0;break}bt&&!("min"in he)&&(q.minFilter=Ol)}}function Zu(q,he){dt.texParameteri(he,cu,q.minFilter),dt.texParameteri(he,ou,q.magFilter),dt.texParameteri(he,ms,q.wrapS),dt.texParameteri(he,rs,q.wrapT),gr.ext_texture_filter_anisotropic&&dt.texParameteri(he,bl,q.anisotropic),q.genMipmaps&&(dt.hint(jc,q.mipmapHint),dt.generateMipmap(he))}var vf=0,$l={},uu=br.maxTextureUnits,uo=Array(uu).map(function(){return null});function Wu(q){aa.call(this),this.mipmask=0,this.internalformat=Ei,this.id=vf++,this.refCount=1,this.target=q,this.texture=dt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new vu,dn.profile&&(this.stats={size:0})}function Us(q){dt.activeTexture(Jc),dt.bindTexture(q.target,q.texture)}function zl(){var q=uo[0];q?dt.bindTexture(q.target,q.texture):dt.bindTexture(Rn,null)}function sc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(dt.activeTexture(Jc+J),dt.bindTexture(_e,null),uo[J]=null),dt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete $l[q.id],mn.textureCount--}h(Wu.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}uo[J]=q,he=J;break}dn.profile&&mn.maxTextureUnits>Kt)-Zt,nr.height=nr.height||(J.height>>Kt)-Vt,Us(J),Eo(nr,Rn,Zt,Vt,Kt),zl(),Xa(nr),_e}function lt(vt,Ke){var at=vt|0,bt=Ke|0||at;if(at===J.width&&bt===J.height)return _e;_e.width=J.width=at,_e.height=J.height=bt,Us(J);for(var Zt=0;J.mipmask>>Zt;++Zt){var Vt=at>>Zt,Kt=bt>>Zt;if(!Vt||!Kt)break;dt.texImage2D(Rn,Zt,J.format,Vt,Kt,0,J.format,J.type,null)}return zl(),dn.profile&&(J.stats.size=bf(J.internalformat,J.type,at,bt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=lt,_e._reglType="texture2d",_e._texture=J,dn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Ao(q,he,J,_e,qe,lt){var vt=new Wu(di);$l[vt.id]=vt,mn.cubeCount++;var Ke=new Array(6);function at(Vt,Kt,nr,er,Bt,Xt){var Ht,zr=vt.texInfo;for(vu.call(zr),Ht=0;Ht<6;++Ht)Ke[Ht]=wu();if(typeof Vt=="number"||!Vt){var Yr=Vt|0||1;for(Ht=0;Ht<6;++Ht)qo(Ke[Ht],Yr,Yr)}else if(typeof Vt=="object")if(Kt)Qo(Ke[0],Vt),Qo(Ke[1],Kt),Qo(Ke[2],nr),Qo(Ke[3],er),Qo(Ke[4],Bt),Qo(Ke[5],Xt);else if(Iu(zr,Vt),ai(vt,Vt),"faces"in Vt){var cn=Vt.faces;for(Ht=0;Ht<6;++Ht)Xn(Ke[Ht],vt),Qo(Ke[Ht],cn[Ht])}else for(Ht=0;Ht<6;++Ht)Qo(Ke[Ht],Vt);for(Xn(vt,Ke[0]),zr.genMipmaps?vt.mipmask=(Ke[0].width<<1)-1:vt.mipmask=Ke[0].mipmask,vt.internalformat=Ke[0].internalformat,at.width=Ke[0].width,at.height=Ke[0].height,Us(vt),Ht=0;Ht<6;++Ht)ul(Ke[Ht],Ma+Ht);for(Zu(zr,di),zl(),dn.profile&&(vt.stats.size=bf(vt.internalformat,vt.type,at.width,at.height,zr.genMipmaps,!0)),at.format=ea[vt.internalformat],at.type=ma[vt.type],at.mag=na[zr.magFilter],at.min=ui[zr.minFilter],at.wrapS=Na[zr.wrapS],at.wrapT=Na[zr.wrapT],Ht=0;Ht<6;++Ht)Qs(Ke[Ht]);return at}function bt(Vt,Kt,nr,er,Bt){var Xt=nr|0,Ht=er|0,zr=Bt|0,Yr=Ui();return Xn(Yr,vt),Yr.width=0,Yr.height=0,za(Yr,Kt),Yr.width=Yr.width||(vt.width>>zr)-Xt,Yr.height=Yr.height||(vt.height>>zr)-Ht,Us(vt),Eo(Yr,Ma+Vt,Xt,Ht,zr),zl(),Xa(Yr),at}function Zt(Vt){var Kt=Vt|0;if(Kt!==vt.width){at.width=vt.width=Kt,at.height=vt.height=Kt,Us(vt);for(var nr=0;nr<6;++nr)for(var er=0;vt.mipmask>>er;++er)dt.texImage2D(Ma+nr,er,vt.format,Kt>>er,Kt>>er,0,vt.format,vt.type,null);return zl(),dn.profile&&(vt.stats.size=bf(vt.internalformat,vt.type,at.width,at.height,!1,!0)),at}}return at(q,he,J,_e,qe,lt),at.subimage=bt,at.resize=Zt,at._reglType="textureCube",at._texture=vt,dn.profile&&(at.stats=vt.stats),at.destroy=function(){vt.decRef()},at}function vs(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)dt.texImage2D(Ma+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Zu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?wu=!0:Ra.indexOf(Qs)>=0&&(wu=!1))),("depthTexture"in uo||"depthStencilTexture"in uo)&&(uu=!!(uo.depthTexture||uo.depthStencilTexture)),"depth"in uo&&(typeof uo.depth=="boolean"?Qo=uo.depth:(Zu=uo.depth,ul=!1)),"stencil"in uo&&(typeof uo.stencil=="boolean"?ul=uo.stencil:(vf=uo.stencil,Qo=!1)),"depthStencil"in uo&&(typeof uo.depthStencil=="boolean"?Qo=ul=uo.depthStencil:($l=uo.depthStencil,Qo=!1,ul=!1))}var Us=null,zl=null,sc=null,lc=null;if(Array.isArray(es))Us=es.map(Ha);else if(es)Us=[Ha(es)];else for(Us=new Array(Iu),Xa=0;Xa0&&(Ui.depth=Wa[0].depth,Ui.stencil=Wa[0].stencil,Ui.depthStencil=Wa[0].depthStencil),Wa[mi]?Wa[mi](Ui):Wa[mi]=aa(Ui)}return h(za,{width:Xa,height:Xa,color:Qs})}function Ii(Eo){var mi,Ui=Eo|0;if(Ui===za.width)return za;var Xa=za.color;for(mi=0;mi=xo.byteLength?qo.subdata(xo):(qo.destroy(),Xn.buffers[mi]=null)),Xn.buffers[mi]||(qo=Xn.buffers[mi]=ua.create(Ui,Qf,!1,!0)),Xa.buffer=ua.getBuffer(qo),Xa.size=Xa.buffer.dimension|0,Xa.normalized=!1,Xa.type=Xa.buffer.dtype,Xa.offset=0,Xa.stride=0,Xa.divisor=0,Xa.state=1,Ii[mi]=1}else ua.getBuffer(Ui)?(Xa.buffer=ua.getBuffer(Ui),Xa.size=Xa.buffer.dimension|0,Xa.normalized=!1,Xa.type=Xa.buffer.dtype,Xa.offset=0,Xa.stride=0,Xa.divisor=0,Xa.state=1):ua.getBuffer(Ui.buffer)?(Xa.buffer=ua.getBuffer(Ui.buffer),Xa.size=(+Ui.size||Xa.buffer.dimension)|0,Xa.normalized=!!Ui.normalized||!1,"type"in Ui?Xa.type=En[Ui.type]:Xa.type=Xa.buffer.dtype,Xa.offset=(Ui.offset||0)|0,Xa.stride=(Ui.stride||0)|0,Xa.divisor=(Ui.divisor||0)|0,Xa.state=1):"x"in Ui&&(Xa.x=+Ui.x||0,Xa.y=+Ui.y||0,Xa.z=+Ui.z||0,Xa.w=+Ui.w||0,Xa.state=2)}for(var Qo=0;Qo1)for(var In=0;Intn&&(tn=Fn.stats.uniformsCount)}),tn},br.getMaxAttributesCount=function(){var tn=0;return Ya.forEach(function(Fn){Fn.stats.attributesCount>tn&&(tn=Fn.stats.attributesCount)}),tn});function pa(){ua={},mn={};for(var tn=0;tn>>4&15)+gr.charAt(Cn&15);return br}function ff(dt){for(var gr="",br=-1,Cn,ua;++br>>6&31,128|Cn&63):Cn<=65535?gr+=String.fromCharCode(224|Cn>>>12&15,128|Cn>>>6&63,128|Cn&63):Cn<=2097151&&(gr+=String.fromCharCode(240|Cn>>>18&7,128|Cn>>>12&63,128|Cn>>>6&63,128|Cn&63));return gr}function xu(dt){for(var gr=Array(dt.length>>2),br=0;br>5]|=(dt.charCodeAt(br/8)&255)<<24-br%32;return gr}function yc(dt){for(var gr="",br=0;br>5]>>>24-br%32&255);return gr}function fu(dt,gr){return dt>>>gr|dt<<32-gr}function Bf(dt,gr){return dt>>>gr}function hf(dt,gr,br){return dt&gr^~dt&br}function Oh(dt,gr,br){return dt&gr^dt&br^gr&br}function ur(dt){return fu(dt,2)^fu(dt,13)^fu(dt,22)}function Pr(dt){return fu(dt,6)^fu(dt,11)^fu(dt,25)}function vn(dt){return fu(dt,7)^fu(dt,18)^Bf(dt,3)}function rn(dt){return fu(dt,17)^fu(dt,19)^Bf(dt,10)}var On=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 Ta(dt,gr){var br=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Cn=new Array(64),ua,mn,dn,Da,Ra,Ia,Ya,Oi,pi,Ha,pa,tn;for(dt[gr>>5]|=128<<24-gr%32,dt[(gr+64>>9<<4)+15]=gr,pi=0;pi>16)+(gr>>16)+(br>>16);return Cn<<16|br&65535}function ei(dt){return Array.prototype.slice.call(dt)}function si(dt){return ei(dt).join("")}function Bi(dt){var gr=dt&&dt.cache,br=0,Cn=[],ua=[],mn=[];function dn(pa,tn){var Fn=tn&&tn.stable;if(!Fn){for(var ea=0;ea0&&(pa.push(ma,"="),pa.push.apply(pa,ei(arguments)),pa.push(";")),ma}return h(tn,{def:ea,toString:function(){return si([Fn.length>0?"var "+Fn.join(",")+";":"",si(pa)])}})}function Ra(){var pa=Da(),tn=Da(),Fn=pa.toString,ea=tn.toString;function ma(na,ui){tn(na,ui,"=",pa.def(na,ui),";")}return h(function(){pa.apply(pa,ei(arguments))},{def:pa.def,entry:pa,exit:tn,save:ma,set:function(na,ui,Na){ma(na,ui),pa(na,ui,"=",Na,";")},toString:function(){return Fn()+ea()}})}function Ia(){var pa=si(arguments),tn=Ra(),Fn=Ra(),ea=tn.toString,ma=Fn.toString;return h(tn,{then:function(){return tn.apply(tn,ei(arguments)),this},else:function(){return Fn.apply(Fn,ei(arguments)),this},toString:function(){var na=ma();return na&&(na="else{"+na+"}"),si(["if(",pa,"){",ea(),"}",na])}})}var Ya=Da(),Oi={};function pi(pa,tn){var Fn=[];function ea(){var Li="a"+Fn.length;return Fn.push(Li),Li}tn=tn||0;for(var ma=0;ma":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},oa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Aa={cw:xt,ccw:At};function Pa(dt){return Array.isArray(dt)||Ar(dt)||Br(dt)}function ia(dt){return dt.sort(function(gr,br){return gr===Dc?-1:br===Dc?1:gr=1,Cn>=2,gr)}else if(br===jo){var ua=dt.data;return new ni(ua.thisDep,ua.contextDep,ua.propDep,gr)}else{if(br===Yi)return new ni(!1,!1,!1,gr);if(br===ki){for(var mn=!1,dn=!1,Da=!1,Ra=0;Ra=1&&(dn=!0),Ya>=2&&(Da=!0)}else Ia.type===jo&&(mn=mn||Ia.data.thisDep,dn=dn||Ia.data.contextDep,Da=Da||Ia.data.propDep)}return new ni(mn,dn,Da,gr)}else return new ni(br===Go,br===Ro,br===No,gr)}}var mo=new ni(!1,!1,!1,function(){});function To(dt,gr,br,Cn,ua,mn,dn,Da,Ra,Ia,Ya,Oi,pi,Ha,pa,tn){var Fn=Ia.Record,ea={add:32774,subtract:32778,"reverse subtract":32779};br.ext_blend_minmax&&(ea.min=It,ea.max=Qt);var ma=br.angle_instanced_arrays,na=br.webgl_draw_buffers,ui=br.oes_vertex_array_object,Na={dirty:!0,profile:tn.profile},Li={},aa=[],Xn={},ai={};function In(Ke){return Ke.replace(".","_")}function Wa(Ke,at,bt){var Zt=In(Ke);aa.push(Ke),Li[Zt]=Na[Zt]=!!bt,Xn[Zt]=at}function za(Ke,at,bt){var Zt=In(Ke);aa.push(Ke),Array.isArray(bt)?(Na[Zt]=bt.slice(),Li[Zt]=bt.slice()):Na[Zt]=Li[Zt]=bt,ai[Zt]=at}function Ii(Ke){return!!isNaN(Ke)}Wa(ns,Gr),Wa(Fs,Lr),za(wl,"blendColor",[0,0,0,0]),za(Hl,"blendEquationSeparate",[fn,fn]),za(Sl,"blendFuncSeparate",[Hr,Xr,Hr,Xr]),Wa(Gl,Mn,!0),za(el,"depthFunc",Sn),za(Su,"depthRange",[0,1]),za(bu,"depthMask",!0),za(Ul,Ul,[!0,!0,!0,!0]),Wa(po,wr),za(gs,"cullFace",tt),za(Il,Il,At),za(dl,dl,1),Wa(vc,Gn),za(dc,"polygonOffset",[0,0]),Wa(_c,ba),Wa(Hf,ti),za(pc,"sampleCoverage",[1,!1]),Wa(Af,an),za(Mu,"stencilMask",-1),za(Sf,"stencilFunc",[Jt,0,-1]),za(Xo,"stencilOpSeparate",[Oe,yr,yr,yr]),za(as,"stencilOpSeparate",[tt,yr,yr,yr]),Wa(Mf,Ln),za(Gc,"scissor",[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]),za(Dc,Dc,[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]);var Eo={gl:dt,context:pi,strings:gr,next:Li,current:Na,draw:Oi,elements:mn,buffer:ua,shader:Ya,attributes:Ia.state,vao:Ia,uniforms:Ra,framebuffer:Da,extensions:br,timer:Ha,isBufferArgs:Pa},mi={primTypes:Vn,compareFuncs:Jn,blendFuncs:Dn,blendEquations:ea,stencilOps:oa,glTypes:En,orientationType:Aa};na&&(mi.backBuffer=[tt],mi.drawBuffer=m(Cn.maxDrawbuffers,function(Ke){return Ke===0?[0]:m(Ke,function(at){return Ca+at})}));var Ui=0;function Xa(){var Ke=Bi({cache:pa}),at=Ke.link,bt=Ke.global;Ke.id=Ui++,Ke.batchId="0";var Zt=at(Eo),Vt=Ke.shared={props:"a0"};Object.keys(Eo).forEach(function(Xt){Vt[Xt]=bt.def(Zt,".",Xt)});var Kt=Ke.next={},nr=Ke.current={};Object.keys(ai).forEach(function(Xt){Array.isArray(Na[Xt])&&(Kt[Xt]=bt.def(Vt.next,".",Xt),nr[Xt]=bt.def(Vt.current,".",Xt))});var er=Ke.constants={};Object.keys(mi).forEach(function(Xt){er[Xt]=bt.def(JSON.stringify(mi[Xt]))}),Ke.invoke=function(Xt,Ht){switch(Ht.type){case Gi:var zr=["this",Vt.context,Vt.props,Ke.batchId];return Xt.def(at(Ht.data),".call(",zr.slice(0,Math.max(Ht.data.length+1,4)),")");case No:return Xt.def(Vt.props,Ht.data);case Ro:return Xt.def(Vt.context,Ht.data);case Go:return Xt.def("this",Ht.data);case jo:return Ht.data.append(Ke,Xt),Ht.data.ref;case Yi:return Ht.data.toString();case ki:return Ht.data.map(function(Yr){return Ke.invoke(Xt,Yr)})}},Ke.attribCache={};var Bt={};return Ke.scopeAttrib=function(Xt){var Ht=gr.id(Xt);if(Ht in Bt)return Bt[Ht];var zr=Ia.scope[Ht];zr||(zr=Ia.scope[Ht]=new Fn);var Yr=Bt[Ht]=at(zr);return Yr},Ke}function xo(Ke){var at=Ke.static,bt=Ke.dynamic,Zt;if(Ue in at){var Vt=!!at[Ue];Zt=Ri(function(nr,er){return Vt}),Zt.enable=Vt}else if(Ue in bt){var Kt=bt[Ue];Zt=Vi(Kt,function(nr,er){return nr.invoke(er,Kt)})}return Zt}function qo(Ke,at){var bt=Ke.static,Zt=Ke.dynamic;if(P in bt){var Vt=bt[P];return Vt?(Vt=Da.getFramebuffer(Vt),Ri(function(nr,er){var Bt=nr.link(Vt),Xt=nr.shared;er.set(Xt.framebuffer,".next",Bt);var Ht=Xt.context;return er.set(Ht,"."+Qr,Bt+".width"),er.set(Ht,"."+yn,Bt+".height"),Bt})):Ri(function(nr,er){var Bt=nr.shared;er.set(Bt.framebuffer,".next","null");var Xt=Bt.context;return er.set(Xt,"."+Qr,Xt+"."+_t),er.set(Xt,"."+yn,Xt+"."+zt),"null"})}else if(P in Zt){var Kt=Zt[P];return Vi(Kt,function(nr,er){var Bt=nr.invoke(er,Kt),Xt=nr.shared,Ht=Xt.framebuffer,zr=er.def(Ht,".getFramebuffer(",Bt,")");er.set(Ht,".next",zr);var Yr=Xt.context;return er.set(Yr,"."+Qr,zr+"?"+zr+".width:"+Yr+"."+_t),er.set(Yr,"."+yn,zr+"?"+zr+".height:"+Yr+"."+zt),zr})}else return null}function Qo(Ke,at,bt){var Zt=Ke.static,Vt=Ke.dynamic;function Kt(Bt){if(Bt in Zt){var Xt=Zt[Bt],Ht=!0,zr=Xt.x|0,Yr=Xt.y|0,cn,sa;return"width"in Xt?cn=Xt.width|0:Ht=!1,"height"in Xt?sa=Xt.height|0:Ht=!1,new ni(!Ht&&at&&at.thisDep,!Ht&&at&&at.contextDep,!Ht&&at&&at.propDep,function(la,ha){var La=la.shared.context,ca=cn;"width"in Xt||(ca=ha.def(La,".",Qr,"-",zr));var Oa=sa;return"height"in Xt||(Oa=ha.def(La,".",yn,"-",Yr)),[zr,Yr,ca,Oa]})}else if(Bt in Vt){var Yn=Vt[Bt],Hn=Vi(Yn,function(la,ha){var La=la.invoke(ha,Yn),ca=la.shared.context,Oa=ha.def(La,".x|0"),Ka=ha.def(La,".y|0"),xi=ha.def('"width" in ',La,"?",La,".width|0:","(",ca,".",Qr,"-",Oa,")"),qi=ha.def('"height" in ',La,"?",La,".height|0:","(",ca,".",yn,"-",Ka,")");return[Oa,Ka,xi,qi]});return at&&(Hn.thisDep=Hn.thisDep||at.thisDep,Hn.contextDep=Hn.contextDep||at.contextDep,Hn.propDep=Hn.propDep||at.propDep),Hn}else return at?new ni(at.thisDep,at.contextDep,at.propDep,function(la,ha){var La=la.shared.context;return[0,0,ha.def(La,".",Qr),ha.def(La,".",yn)]}):null}var nr=Kt(Dc);if(nr){var er=nr;nr=new ni(nr.thisDep,nr.contextDep,nr.propDep,function(Bt,Xt){var Ht=er.append(Bt,Xt),zr=Bt.shared.context;return Xt.set(zr,"."+Ze,Ht[2]),Xt.set(zr,"."+et,Ht[3]),Ht})}return{viewport:nr,scissor_box:Kt(Gc)}}function ul(Ke,at){var bt=Ke.static,Zt=typeof bt[Se]=="string"&&typeof bt[oe]=="string";if(Zt){if(Object.keys(at.dynamic).length>0)return null;var Vt=at.static,Kt=Object.keys(Vt);if(Kt.length>0&&typeof Vt[Kt[0]]=="number"){for(var nr=[],er=0;er"+Oa+"?"+Ht+".constant["+Oa+"]:0;"}).join(""),"}}else{","if(",cn,"(",Ht,".buffer)){",la,"=",sa,".createStream(",Ut,",",Ht,".buffer);","}else{",la,"=",sa,".getBuffer(",Ht,".buffer);","}",ha,'="type" in ',Ht,"?",Yr.glTypes,"[",Ht,".type]:",la,".dtype;",Yn.normalized,"=!!",Ht,".normalized;");function La(ca){Xt(Yn[ca],"=",Ht,".",ca,"|0;")}return La("size"),La("offset"),La("stride"),La("divisor"),Xt("}}"),Xt.exit("if(",Yn.isStream,"){",sa,".destroyStream(",la,");","}"),Yn}Vt[Kt]=Vi(nr,er)}),Vt}function Zu(Ke){var at=Ke.static,bt=Ke.dynamic,Zt={};return Object.keys(at).forEach(function(Vt){var Kt=at[Vt];Zt[Vt]=Ri(function(nr,er){return typeof Kt=="number"||typeof Kt=="boolean"?""+Kt:nr.link(Kt)})}),Object.keys(bt).forEach(function(Vt){var Kt=bt[Vt];Zt[Vt]=Vi(Kt,function(nr,er){return nr.invoke(er,Kt)})}),Zt}function vf(Ke,at,bt,Zt,Vt){Ke.static,Ke.dynamic;var Kt=ul(Ke,at),nr=qo(Ke),er=Qo(Ke,nr),Bt=wu(Ke),Xt=Qs(Ke),Ht=es(Ke,Vt,Kt);function zr(la){var ha=er[la];ha&&(Xt[la]=ha)}zr(Dc),zr(In(Gc));var Yr=Object.keys(Xt).length>0,cn={framebuffer:nr,draw:Bt,shader:Ht,state:Xt,dirty:Yr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(cn.profile=xo(Ke),cn.uniforms=vu(bt),cn.drawVAO=cn.scopeVAO=Bt.vao,!cn.drawVAO&&Ht.program&&!Kt&&br.angle_instanced_arrays&&Bt.static.elements){var sa=!0,Yn=Ht.program.attributes.map(function(la){var ha=at.static[la];return sa=sa&&!!ha,ha});if(sa&&Yn.length>0){var Hn=Ia.getVAO(Ia.createVAO({attributes:Yn,elements:Bt.static.elements}));cn.drawVAO=new ni(null,null,null,function(la,ha){return la.link(Hn)}),cn.useVAO=!0}}return Kt?cn.useVAO=!0:cn.attributes=Iu(at),cn.context=Zu(Zt),cn}function $l(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.context,Kt=Ke.scope();Object.keys(bt).forEach(function(nr){at.save(Vt,"."+nr);var er=bt[nr],Bt=er.append(Ke,at);Array.isArray(Bt)?Kt(Vt,".",nr,"=[",Bt.join(),"];"):Kt(Vt,".",nr,"=",Bt,";")}),at(Kt)}function uu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Vt.gl,nr=Vt.framebuffer,er;na&&(er=at.def(Vt.extensions,".webgl_draw_buffers"));var Bt=Ke.constants,Xt=Bt.drawBuffer,Ht=Bt.backBuffer,zr;bt?zr=bt.append(Ke,at):zr=at.def(nr,".next"),Zt||at("if(",zr,"!==",nr,".cur){"),at("if(",zr,"){",Kt,".bindFramebuffer(",kn,",",zr,".framebuffer);"),na&&at(er,".drawBuffersWEBGL(",Xt,"[",zr,".colorAttachments.length]);"),at("}else{",Kt,".bindFramebuffer(",kn,",null);"),na&&at(er,".drawBuffersWEBGL(",Ht,");"),at("}",nr,".cur=",zr,";"),Zt||at("}")}function uo(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.gl,Kt=Ke.current,nr=Ke.next,er=Zt.current,Bt=Zt.next,Xt=Ke.cond(er,".dirty");aa.forEach(function(Ht){var zr=In(Ht);if(!(zr in bt.state)){var Yr,cn;if(zr in nr){Yr=nr[zr],cn=Kt[zr];var sa=m(Na[zr].length,function(Hn){return Xt.def(Yr,"[",Hn,"]")});Xt(Ke.cond(sa.map(function(Hn,la){return Hn+"!=="+cn+"["+la+"]"}).join("||")).then(Vt,".",ai[zr],"(",sa,");",sa.map(function(Hn,la){return cn+"["+la+"]="+Hn}).join(";"),";"))}else{Yr=Xt.def(Bt,".",zr);var Yn=Ke.cond(Yr,"!==",er,".",zr);Xt(Yn),zr in Xn?Yn(Ke.cond(Yr).then(Vt,".enable(",Xn[zr],");").else(Vt,".disable(",Xn[zr],");"),er,".",zr,"=",Yr,";"):Yn(Vt,".",ai[zr],"(",Yr,");",er,".",zr,"=",Yr,";")}}}),Object.keys(bt.state).length===0&&Xt(er,".dirty=false;"),at(Xt)}function Wu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Ke.current,nr=Vt.current,er=Vt.gl,Bt;ia(Object.keys(bt)).forEach(function(Xt){var Ht=bt[Xt];if(!(Zt&&!Zt(Ht))){var zr=Ht.append(Ke,at);if(Xn[Xt]){var Yr=Xn[Xt];Xi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(Ke.cond(Bt).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",Bt,";")):(at(Ke.cond(zr).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",zr,";"))}else if(Un(zr)){var cn=Kt[Xt];at(er,".",ai[Xt],"(",zr,");",zr.map(function(sa,Yn){return cn+"["+Yn+"]="+sa}).join(";"),";")}else Xi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(er,".",ai[Xt],"(",Bt,");",nr,".",Xt,"=",Bt,";")):at(er,".",ai[Xt],"(",zr,");",nr,".",Xt,"=",zr,";")}})}function Us(Ke,at){ma&&(Ke.instancing=at.def(Ke.shared.extensions,".angle_instanced_arrays"))}function zl(Ke,at,bt,Zt,Vt){var Kt=Ke.shared,nr=Ke.stats,er=Kt.current,Bt=Kt.timer,Xt=bt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var zr,Yr;function cn(La){zr=at.def(),La(zr,"=",Ht(),";"),typeof Vt=="string"?La(nr,".count+=",Vt,";"):La(nr,".count++;"),Ha&&(Zt?(Yr=at.def(),La(Yr,"=",Bt,".getNumPendingQueries();")):La(Bt,".beginQuery(",nr,");"))}function sa(La){La(nr,".cpuTime+=",Ht(),"-",zr,";"),Ha&&(Zt?La(Bt,".pushScopeStats(",Yr,",",Bt,".getNumPendingQueries(),",nr,");"):La(Bt,".endQuery();"))}function Yn(La){var ca=at.def(er,".profile");at(er,".profile=",La,";"),at.exit(er,".profile=",ca,";")}var Hn;if(Xt){if(Xi(Xt)){Xt.enable?(cn(at),sa(at.exit),Yn("true")):Yn("false");return}Hn=Xt.append(Ke,at),Yn(Hn)}else Hn=at.def(er,".profile");var la=Ke.block();cn(la),at("if(",Hn,"){",la,"}");var ha=Ke.block();sa(ha),at.exit("if(",Hn,"){",ha,"}")}function sc(Ke,at,bt,Zt,Vt){var Kt=Ke.shared;function nr(Bt){switch(Bt){case ri:case Wo:case nl:return 2;case Zi:case Ks:case hu:return 3;case yo:case $s:case eu:return 4;default:return 1}}function er(Bt,Xt,Ht){var zr=Kt.gl,Yr=at.def(Bt,".location"),cn=at.def(Kt.attributes,"[",Yr,"]"),sa=Ht.state,Yn=Ht.buffer,Hn=[Ht.x,Ht.y,Ht.z,Ht.w],la=["buffer","normalized","offset","stride"];function ha(){at("if(!",cn,".buffer){",zr,".enableVertexAttribArray(",Yr,");}");var ca=Ht.type,Oa;if(Ht.size?Oa=at.def(Ht.size,"||",Xt):Oa=Xt,at("if(",cn,".type!==",ca,"||",cn,".size!==",Oa,"||",la.map(function(xi){return cn+"."+xi+"!=="+Ht[xi]}).join("||"),"){",zr,".bindBuffer(",Ut,",",Yn,".buffer);",zr,".vertexAttribPointer(",[Yr,Oa,ca,Ht.normalized,Ht.stride,Ht.offset],");",cn,".type=",ca,";",cn,".size=",Oa,";",la.map(function(xi){return cn+"."+xi+"="+Ht[xi]+";"}).join(""),"}"),ma){var Ka=Ht.divisor;at("if(",cn,".divisor!==",Ka,"){",Ke.instancing,".vertexAttribDivisorANGLE(",[Yr,Ka],");",cn,".divisor=",Ka,";}")}}function La(){at("if(",cn,".buffer){",zr,".disableVertexAttribArray(",Yr,");",cn,".buffer=null;","}if(",Va.map(function(ca,Oa){return cn+"."+ca+"!=="+Hn[Oa]}).join("||"),"){",zr,".vertexAttrib4f(",Yr,",",Hn,");",Va.map(function(ca,Oa){return cn+"."+ca+"="+Hn[Oa]+";"}).join(""),"}")}sa===Ja?ha():sa===Ba?La():(at("if(",sa,"===",Ja,"){"),ha(),at("}else{"),La(),at("}"))}Zt.forEach(function(Bt){var Xt=Bt.name,Ht=bt.attributes[Xt],zr;if(Ht){if(!Vt(Ht))return;zr=Ht.append(Ke,at)}else{if(!Vt(mo))return;var Yr=Ke.scopeAttrib(Xt);zr={},Object.keys(new Fn).forEach(function(cn){zr[cn]=at.def(Yr,".",cn)})}er(Ke.link(Bt),nr(Bt.info.type),zr)})}function lc(Ke,at,bt,Zt,Vt,Kt){for(var nr=Ke.shared,er=nr.gl,Bt,Xt=0;Xt1){for(var _s=[],ds=[],pl=0;pl>1)",Yn],");")}function Ka(){bt(Hn,".drawArraysInstancedANGLE(",[Yr,cn,sa,Yn],");")}Ht&&Ht!=="null"?ha?Oa():(bt("if(",Ht,"){"),Oa(),bt("}else{"),Ka(),bt("}")):Ka()}function ca(){function Oa(){bt(Kt+".drawElements("+[Yr,sa,la,cn+"<<(("+la+"-"+_i+")>>1)"]+");")}function Ka(){bt(Kt+".drawArrays("+[Yr,cn,sa]+");")}Ht&&Ht!=="null"?ha?Oa():(bt("if(",Ht,"){"),Oa(),bt("}else{"),Ka(),bt("}")):Ka()}ma&&(typeof Yn!="number"||Yn>=0)?typeof Yn=="string"?(bt("if(",Yn,">0){"),La(),bt("}else if(",Yn,"<0){"),ca(),bt("}")):La():ca()}function vs(Ke,at,bt,Zt,Vt){var Kt=Xa(),nr=Kt.proc("body",Vt);return ma&&(Kt.instancing=nr.def(Kt.shared.extensions,".angle_instanced_arrays")),Ke(Kt,nr,bt,Zt),Kt.compile().body}function ys(Ke,at,bt,Zt){Us(Ke,at),bt.useVAO?bt.drawVAO?at(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,at),");"):at(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(at(Ke.shared.vao,".setVAO(null);"),sc(Ke,at,bt,Zt.attributes,function(){return!0})),lc(Ke,at,bt,Zt.uniforms,function(){return!0},!1),Ao(Ke,at,at,bt)}function be(Ke,at){var bt=Ke.proc("draw",1);Us(Ke,bt),$l(Ke,bt,at.context),uu(Ke,bt,at.framebuffer),uo(Ke,bt,at),Wu(Ke,bt,at.state),zl(Ke,bt,at,!1,!0);var Zt=at.shader.progVar.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Zt,".program);"),at.shader.program)ys(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Vt=Ke.global.def("{}"),Kt=bt.def(Zt,".id"),nr=bt.def(Vt,"[",Kt,"]");bt(Ke.cond(nr).then(nr,".call(this,a0);").else(nr,"=",Vt,"[",Kt,"]=",Ke.link(function(er){return vs(ys,Ke,at,er,1)}),"(",Zt,");",nr,".call(this,a0);"))}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function q(Ke,at,bt,Zt){Ke.batchId="a1",Us(Ke,at);function Vt(){return!0}sc(Ke,at,bt,Zt.attributes,Vt),lc(Ke,at,bt,Zt.uniforms,Vt,!1),Ao(Ke,at,at,bt)}function he(Ke,at,bt,Zt){Us(Ke,at);var Vt=bt.contextDep,Kt=at.def(),nr="a0",er="a1",Bt=at.def();Ke.shared.props=Bt,Ke.batchId=Kt;var Xt=Ke.scope(),Ht=Ke.scope();at(Xt.entry,"for(",Kt,"=0;",Kt,"<",er,";++",Kt,"){",Bt,"=",nr,"[",Kt,"];",Ht,"}",Xt.exit);function zr(la){return la.contextDep&&Vt||la.propDep}function Yr(la){return!zr(la)}if(bt.needsContext&&$l(Ke,Ht,bt.context),bt.needsFramebuffer&&uu(Ke,Ht,bt.framebuffer),Wu(Ke,Ht,bt.state,zr),bt.profile&&zr(bt.profile)&&zl(Ke,Ht,bt,!1,!0),Zt)bt.useVAO?bt.drawVAO?zr(bt.drawVAO)?Ht(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Ht),");"):Xt(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Xt),");"):Xt(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(Xt(Ke.shared.vao,".setVAO(null);"),sc(Ke,Xt,bt,Zt.attributes,Yr),sc(Ke,Ht,bt,Zt.attributes,zr)),lc(Ke,Xt,bt,Zt.uniforms,Yr,!1),lc(Ke,Ht,bt,Zt.uniforms,zr,!0),Ao(Ke,Xt,Ht,bt);else{var cn=Ke.global.def("{}"),sa=bt.shader.progVar.append(Ke,Ht),Yn=Ht.def(sa,".id"),Hn=Ht.def(cn,"[",Yn,"]");Ht(Ke.shared.gl,".useProgram(",sa,".program);","if(!",Hn,"){",Hn,"=",cn,"[",Yn,"]=",Ke.link(function(la){return vs(q,Ke,bt,la,2)}),"(",sa,");}",Hn,".call(this,a0[",Kt,"],",Kt,");")}}function J(Ke,at){var bt=Ke.proc("batch",2);Ke.batchId="0",Us(Ke,bt);var Zt=!1,Vt=!0;Object.keys(at.context).forEach(function(cn){Zt=Zt||at.context[cn].propDep}),Zt||($l(Ke,bt,at.context),Vt=!1);var Kt=at.framebuffer,nr=!1;Kt?(Kt.propDep?Zt=nr=!0:Kt.contextDep&&Zt&&(nr=!0),nr||uu(Ke,bt,Kt)):uu(Ke,bt,null),at.state.viewport&&at.state.viewport.propDep&&(Zt=!0);function er(cn){return cn.contextDep&&Zt||cn.propDep}uo(Ke,bt,at),Wu(Ke,bt,at.state,function(cn){return!er(cn)}),(!at.profile||!er(at.profile))&&zl(Ke,bt,at,!1,"a1"),at.contextDep=Zt,at.needsContext=Vt,at.needsFramebuffer=nr;var Bt=at.shader.progVar;if(Bt.contextDep&&Zt||Bt.propDep)he(Ke,bt,at,null);else{var Xt=Bt.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Xt,".program);"),at.shader.program)he(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Ht=Ke.global.def("{}"),zr=bt.def(Xt,".id"),Yr=bt.def(Ht,"[",zr,"]");bt(Ke.cond(Yr).then(Yr,".call(this,a0,a1);").else(Yr,"=",Ht,"[",zr,"]=",Ke.link(function(cn){return vs(he,Ke,at,cn,2)}),"(",Xt,");",Yr,".call(this,a0,a1);"))}}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function _e(Ke,at){var bt=Ke.proc("scope",3);Ke.batchId="a2";var Zt=Ke.shared,Vt=Zt.current;if($l(Ke,bt,at.context),at.framebuffer&&at.framebuffer.append(Ke,bt),ia(Object.keys(at.state)).forEach(function(er){var Bt=at.state[er],Xt=Bt.append(Ke,bt);Un(Xt)?Xt.forEach(function(Ht,zr){Ii(Ht)?bt.set(Ke.next[er],"["+zr+"]",Ht):bt.set(Ke.next[er],"["+zr+"]",Ke.link(Ht,{stable:!0}))}):Xi(Bt)?bt.set(Zt.next,"."+er,Ke.link(Xt,{stable:!0})):bt.set(Zt.next,"."+er,Xt)}),zl(Ke,bt,at,!0,!0),[ke,kt,gt,Gt,Be].forEach(function(er){var Bt=at.draw[er];if(Bt){var Xt=Bt.append(Ke,bt);Ii(Xt)?bt.set(Zt.draw,"."+er,Xt):bt.set(Zt.draw,"."+er,Ke.link(Xt),{stable:!0})}}),Object.keys(at.uniforms).forEach(function(er){var Bt=at.uniforms[er].append(Ke,bt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Xt){return Ii(Xt)?Xt:Ke.link(Xt,{stable:!0})})+"]"),bt.set(Zt.uniforms,"["+Ke.link(gr.id(er),{stable:!0})+"]",Bt)}),Object.keys(at.attributes).forEach(function(er){var Bt=at.attributes[er].append(Ke,bt),Xt=Ke.scopeAttrib(er);Object.keys(new Fn).forEach(function(Ht){bt.set(Xt,"."+Ht,Bt[Ht])})}),at.scopeVAO){var Kt=at.scopeVAO.append(Ke,bt);Ii(Kt)?bt.set(Zt.vao,".targetVAO",Kt):bt.set(Zt.vao,".targetVAO",Ke.link(Kt,{stable:!0}))}function nr(er){var Bt=at.shader[er];if(Bt){var Xt=Bt.append(Ke,bt);Ii(Xt)?bt.set(Zt.shader,"."+er,Xt):bt.set(Zt.shader,"."+er,Ke.link(Xt,{stable:!0}))}}nr(oe),nr(Se),Object.keys(at.state).length>0&&(bt(Vt,".dirty=true;"),bt.exit(Vt,".dirty=true;")),bt("a1(",Ke.shared.context,",a0,",Ke.batchId,");")}function qe(Ke){if(!(typeof Ke!="object"||Un(Ke))){for(var at=Object.keys(Ke),bt=0;bt=0;--Ao){var vs=Ii[Ao];vs&&vs(Ha,null,0)}br.flush(),Ia&&Ia.update()}function qo(){!Xa&&Ii.length>0&&(Xa=c.next(xo))}function Qo(){Xa&&(c.cancel(xo),Xa=null)}function ul(Ao){Ao.preventDefault(),Qo(),Eo.forEach(function(vs){vs()})}function es(Ao){br.getError(),ua.restore(),Na.restore(),ea.restore(),Li.restore(),aa.restore(),Xn.restore(),na.restore(),Ia&&Ia.restore(),ai.procs.refresh(),qo(),mi.forEach(function(vs){vs()})}za&&(za.addEventListener(Xl,ul,!1),za.addEventListener(Dl,es,!1));function wu(){Ii.length=0,Qo(),za&&(za.removeEventListener(Xl,ul),za.removeEventListener(Dl,es)),Na.clear(),Xn.clear(),aa.clear(),na.clear(),Li.clear(),ma.clear(),ea.clear(),Ia&&Ia.clear(),Ui.forEach(function(Ao){Ao()})}function Qs(Ao){function vs(Vt){var Kt=h({},Vt);delete Kt.uniforms,delete Kt.attributes,delete Kt.context,delete Kt.vao,"stencil"in Kt&&Kt.stencil.op&&(Kt.stencil.opBack=Kt.stencil.opFront=Kt.stencil.op,delete Kt.stencil.op);function nr(er){if(er in Kt){var Bt=Kt[er];delete Kt[er],Object.keys(Bt).forEach(function(Xt){Kt[er+"."+Xt]=Bt[Xt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in Vt&&(Kt.vao=Vt.vao),Kt}function ys(Vt,Kt){var nr={},er={};return Object.keys(Vt).forEach(function(Bt){var Xt=Vt[Bt];if(f.isDynamic(Xt)){er[Bt]=f.unbox(Xt,Bt);return}else if(Kt&&Array.isArray(Xt)){for(var Ht=0;Ht0)return vt.call(this,bt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return vt.call(this,Vt,Vt.length)}else return lt.call(this,Vt)}return h(Zt,{stats:_e,destroy:function(){qe.destroy()}})}var vu=Xn.setFBO=Qs({framebuffer:f.define.call(null,xc,"framebuffer")});function Iu(Ao,vs){var ys=0;ai.procs.poll();var be=vs.color;be&&(br.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),ys|=Kl),"depth"in vs&&(br.clearDepth(+vs.depth),ys|=oo),"stencil"in vs&&(br.clearStencil(vs.stencil|0),ys|=Ps),br.clear(ys)}function Zu(Ao){if("framebuffer"in Ao)if(Ao.framebuffer&&Ao.framebuffer_reglType==="framebufferCube")for(var vs=0;vs<6;++vs)vu(h({framebuffer:Ao.framebuffer.faces[vs]},Ao),Iu);else vu(Ao,Iu);else Iu(null,Ao)}function vf(Ao){Ii.push(Ao);function vs(){var ys=Xc(Ii,Ao);function be(){var q=Xc(Ii,be);Ii[q]=Ii[Ii.length-1],Ii.length-=1,Ii.length<=0&&Qo()}Ii[ys]=be}return qo(),{cancel:vs}}function $l(){var Ao=Wa.viewport,vs=Wa.scissor_box;Ao[0]=Ao[1]=vs[0]=vs[1]=0,Ha.viewportWidth=Ha.framebufferWidth=Ha.drawingBufferWidth=Ao[2]=vs[2]=br.drawingBufferWidth,Ha.viewportHeight=Ha.framebufferHeight=Ha.drawingBufferHeight=Ao[3]=vs[3]=br.drawingBufferHeight}function uu(){Ha.tick+=1,Ha.time=Wu(),$l(),ai.procs.poll()}function uo(){Li.refresh(),$l(),ai.procs.refresh(),Ia&&Ia.update()}function Wu(){return(p()-Ya)/1e3}uo();function Us(Ao,vs){var ys;switch(Ao){case"frame":return vf(vs);case"lost":ys=Eo;break;case"restore":ys=mi;break;case"destroy":ys=Ui;break}return ys.push(vs),{cancel:function(){for(var be=0;be=0},read:In,destroy:wu,_gl:br,_refresh:uo,poll:function(){uu(),Ia&&Ia.update()},now:Wu,stats:dn,getCachedCode:zl,preloadCachedCode:sc});return gr.onDone(null,lc),lc}return Eu})}}),SE=Ge({"src/lib/prepare_regl.js"($,G){var h=Nk(),b=GI();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(n){if(n.regl){n.regl.preloadCachedCode(t);return}if(!(n.pick&&!r._has("parcoords"))){try{n.regl=b({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:n.key})},!1)}}),o||h({container:r._glcontainer.node()}),o}}}),CC=Ge({"src/traces/scattergl/plot.js"(f,G){var h=sC(),b=_C(),S=kI(),E=HI(),e=gn(),t=zp().selectMode,r=SE(),o=iu(),n=np(),i=aC().styleTextSelection,a={};function s(c,p,d,T){var l=c._size,g=c.width*T,x=c.height*T,A=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,m=l.w*T,u=l.h*T;return[A+p.domain[0]*m,M+d.domain[0]*u,g-_-(1-p.domain[1])*m,x-w-(1-d.domain[1])*u]}var f=G.exports=function(p,d,T){if(T.length){var l=p._fullLayout,g=d._scene,x=d.xaxis,A=d.yaxis,M,_;if(g){var w=r(p,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!w){g.init();return}var m=g.count,u=l._glcanvas.data()[0].regl;if(n(p,d,T),g.dirty){if((g.line2d||g.error2d)&&!(g.scatter2d||g.fill2d||g.glText)&&u.clear({color:!0,depth:!0}),g.error2d===!0&&(g.error2d=S(u)),g.line2d===!0&&(g.line2d=b(u)),g.scatter2d===!0&&(g.scatter2d=h(u)),g.fill2d===!0&&(g.fill2d=b(u)),g.glText===!0)for(g.glText=new Array(m),M=0;Mg.glText.length){var v=m-g.glText.length;for(M=0;Mie&&(isNaN(ae[ve])||isNaN(ae[ve+1]));)ve-=2;H.positions=ae.slice(ie,ve+2)}return H}),g.line2d.update(g.lineOptions)),g.error2d){var L=(g.errorXOptions||[]).concat(g.errorYOptions||[]);g.error2d.update(L)}g.scatter2d&&g.scatter2d.update(g.markerOptions),g.fillOrder=e.repeat(null,m),g.fill2d&&(g.fillOptions=g.fillOptions.map(function(H,ae){var ie=T[ae];if(!(!H||!ie||!ie[0]||!ie[0].trace)){var ve=ie[0],Ae=ve.trace,Ce=ve.t,Fe=g.lineOptions[ae],ze,Ye,it=[];Ae._ownfill&&it.push(ae),Ae._nexttrace&&it.push(ae+1),it.length&&(g.fillOrder[ae]=it);var st=[],nt=Fe&&Fe.positions||Ce.positions,Qe,Le;if(Ae.fill==="tozeroy"){for(Qe=0;QeQe&&isNaN(nt[Le+1]);)Le-=2;nt[Qe+1]!==0&&(st=[nt[Qe],0]),st=st.concat(nt.slice(Qe,Le+2)),nt[Le+1]!==0&&(st=st.concat([nt[Le],0]))}else if(Ae.fill==="tozerox"){for(Qe=0;QeQe&&isNaN(nt[Le]);)Le-=2;nt[Qe]!==0&&(st=[0,nt[Qe+1]]),st=st.concat(nt.slice(Qe,Le+2)),nt[Le]!==0&&(st=st.concat([0,nt[Le+1]]))}else if(Ae.fill==="toself"||Ae.fill==="tonext"){for(st=[],ze=0,H.splitNull=!0,Ye=0;Ye-1;for(M=0;Mx&&d||gi,y;for(v?y=d.sizeAvg||Math.max(d.size,3):y=S(f,p),A=0;A{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let p=0;py||!d.lower&&v{f[T+g]=p})}this.scatter.draw(...f)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function n(s,f,c){let p=s.id!=null?s.id:s,d=f,T=c;return p<<16|(d&255)<<8|T&255}function i(s,f,c){let p,d,T,l,g=s[f],x=s[c];return g.length>2?(g[0],g[2],p=g[1],d=g[3]):g.length?(p=g[0],d=g[1]):(g.x,p=g.y,g.x+g.width,d=g.y+g.height),x.length>2?(T=x[0],l=x[2],x[1],x[3]):x.length?(T=x[0],l=x[1]):(T=x.x,x.y,l=x.x+x.width,x.y+x.height),[T,p,l,d]}function a(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let f=t(s);return[f.x,f.y,f.x+f.width,f.y+f.height]}}}}),tD=Ge({"src/traces/splom/plot.js"($,G){var h=eD(),b=gn(),S=Cf(),E=zp().selectMode;G.exports=function(r,o,n){if(n.length)for(var i=0;i-1,N=E(d)||!!i.selectedpoints||F,B=!0;if(N){var R=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var U=i.selectedpoints,j={};for(g=0;g=Z[re][0]&&j<=Z[re][1])return!0;return!1}function f(j){j.attr("x",-h.bar.captureWidth/2).attr("width",h.bar.captureWidth)}function c(j){j.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function p(j){if(!j.brush.filterSpecified)return"0,"+j.height;for(var Z=d(j.brush.filter.getConsolidated(),j.height),re=[0],fe,le,ce,V=Z.length?Z[0][0]:null,ee=0;eej[1]+re||Z=.9*j[1]+.1*j[0]?"n":Z<=.9*j[0]+.1*j[1]?"s":"ns"}function l(){b.select(document.body).style("cursor",null)}function g(j){j.attr("stroke-dasharray",p)}function x(j,Z){var re=b.select(j).selectAll(".highlight, .highlight-shadow"),fe=Z?re.transition().duration(h.bar.snapDuration).each("end",Z):re;g(fe)}function A(j,Z){var re=j.brush,fe=re.filterSpecified,le=NaN,ce={},V;if(fe){var ee=j.height,ne=re.filter.getConsolidated(),K=d(ne,ee),ue=NaN,te=NaN,H=NaN;for(V=0;V<=K.length;V++){var ae=K[V];if(ae&&ae[0]<=Z&&Z<=ae[1]){ue=V;break}else if(te=V?V-1:NaN,ae&&ae[0]>Z){H=V;break}}if(le=ue,isNaN(le)&&(isNaN(te)||isNaN(H)?le=isNaN(te)?H:te:le=Z-K[te][1]=Fe[0]&&Ce<=Fe[1]){ce.clickableOrdinalRange=Fe;break}}}return ce}function M(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.unitToPaddedPx.invert(re),le=Z.brush,ce=A(Z,re),V=ce.interval,ee=le.svgBrush;if(ee.wasDragged=!1,ee.grabbingBar=ce.region==="ns",ee.grabbingBar){var ne=V.map(Z.unitToPaddedPx);ee.grabPoint=re-ne[0]-h.verticalPadding,ee.barLength=ne[1]-ne[0]}ee.clickableOrdinalRange=ce.clickableOrdinalRange,ee.stayingIntervals=Z.multiselect&&le.filterSpecified?le.filter.getConsolidated():[],V&&(ee.stayingIntervals=ee.stayingIntervals.filter(function(K){return K[0]!==V[0]&&K[1]!==V[1]})),ee.startExtent=ce.region?V[ce.region==="s"?1:0]:fe,Z.parent.inBrushDrag=!0,ee.brushStartCallback()}function _(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.brush.svgBrush;fe.wasDragged=!0,fe._dragging=!0,fe.grabbingBar?fe.newExtent=[re-fe.grabPoint,re+fe.barLength-fe.grabPoint].map(Z.unitToPaddedPx.invert):fe.newExtent=[fe.startExtent,Z.unitToPaddedPx.invert(re)].sort(e),Z.brush.filterSpecified=!0,fe.extent=fe.stayingIntervals.concat([fe.newExtent]),fe.brushCallback(Z),x(j.parentNode)}function w(j,Z){var re=Z.brush,fe=re.filter,le=re.svgBrush;le._dragging||(m(j,Z),_(j,Z),Z.brush.svgBrush.wasDragged=!1),le._dragging=!1;var ce=b.event;ce.sourceEvent.stopPropagation();var V=le.grabbingBar;if(le.grabbingBar=!1,le.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!le.wasDragged){le.wasDragged=void 0,le.clickableOrdinalRange?re.filterSpecified&&Z.multiselect?le.extent.push(le.clickableOrdinalRange):(le.extent=[le.clickableOrdinalRange],re.filterSpecified=!0):V?(le.extent=le.stayingIntervals,le.extent.length===0&&z(re)):z(re),le.brushCallback(Z),x(j.parentNode),le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[]);return}var ee=function(){fe.set(fe.getConsolidated())};if(Z.ordinal){var ne=Z.unitTickvals;ne[ne.length-1]le.newExtent[0];le.extent=le.stayingIntervals.concat(K?[le.newExtent]:[]),le.extent.length||z(re),le.brushCallback(Z),K?x(j.parentNode,ee):(ee(),x(j.parentNode))}else ee();le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[])}function m(j,Z){var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=A(Z,re),le="crosshair";fe.clickableOrdinalRange?le="pointer":fe.region&&(le=fe.region+"-resize"),b.select(document.body).style("cursor",le)}function u(j){j.on("mousemove",function(Z){b.event.preventDefault(),Z.parent.inBrushDrag||m(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(b.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function v(j,Z){return j[0]-Z[0]}function y(j,Z,re){var fe=re._context.staticPlot,le=j.selectAll(".background").data(E);le.enter().append("rect").classed("background",!0).call(f).call(c).style("pointer-events",fe?"none":"auto").attr("transform",t(0,h.verticalPadding)),le.call(u).attr("height",function(ee){return ee.height-h.verticalPadding});var ce=j.selectAll(".highlight-shadow").data(E);ce.enter().append("line").classed("highlight-shadow",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width+h.bar.strokeWidth).attr("stroke",Z).attr("opacity",h.bar.strokeOpacity).attr("stroke-linecap","butt"),ce.attr("y1",function(ee){return ee.height}).call(g);var V=j.selectAll(".highlight").data(E);V.enter().append("line").classed("highlight",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width-h.bar.strokeWidth).attr("stroke",h.bar.fillColor).attr("opacity",h.bar.fillOpacity).attr("stroke-linecap","butt"),V.attr("y1",function(ee){return ee.height}).call(g)}function I(j,Z,re){var fe=j.selectAll("."+h.cn.axisBrush).data(E,S);fe.enter().append("g").classed(h.cn.axisBrush,!0),y(fe,Z,re)}function L(j){return j.svgBrush.extent.map(function(Z){return Z.slice()})}function z(j){j.filterSpecified=!1,j.svgBrush.extent=[[-1/0,1/0]]}function F(j){return function(re){var fe=re.brush,le=L(fe),ce=le.slice();fe.filter.set(ce),j()}}function N(j){for(var Z=j.slice(),re=[],fe,le=Z.shift();le;){for(fe=le.slice();(le=Z.shift())&&le[0]<=fe[1];)fe[1]=Math.max(fe[1],le[1]);re.push(fe)}return re.length===1&&re[0][0]>re[0][1]&&(re=[]),re}function B(){var j=[],Z,re;return{set:function(fe){j=fe.map(function(le){return le.slice().sort(e)}).sort(v),j.length===1&&j[0][0]===-1/0&&j[0][1]===1/0&&(j=[[0,-1]]),Z=N(j),re=j.reduce(function(le,ce){return[Math.min(le[0],ce[0]),Math.max(le[1],ce[1])]},[1/0,-1/0])},get:function(){return j.slice()},getConsolidated:function(){return Z},getBounds:function(){return re}}}function R(j,Z,re,fe,le,ce){var V=B();return V.set(re),{filter:V,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:fe,brushCallback:F(le),brushEndCallback:ce}}}function U(j,Z){if(Array.isArray(j[0])?(j=j.map(function(fe){return fe.sort(e)}),Z.multiselect?j=N(j.sort(v)):j=[j[0]]):j=[j.sort(e)],Z.tickvals){var re=Z.tickvals.slice().sort(e);if(j=j.map(function(fe){var le=[a(0,re,fe[0],[]),a(1,re,fe[1],[])];if(le[1]>le[0])return le}).filter(function(fe){return fe}),!j.length)return}return j.length>1?j:j[0]}G.exports={makeBrush:R,ensureAxisBrush:I,cleanRanges:U}}}),uD=Ge({"src/traces/parcoords/defaults.js"($,G){var h=gn(),b=hv().hasColorscale,S=vh(),E=Ac().defaults,e=vv(),t=ws(),r=RC(),o=IC(),n=JA().maxDimensionCount,i=ME();function a(f,c,p,d,T){var l=T("line.color",p);if(b(f,"line")&&h.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),S(f,c,d,T,{prefix:"line.",cLetter:"c"}),l.length;c.line.color=p}return 1/0}function s(f,c,p,d){function T(M,_){return h.coerce(f,c,r.dimensions,M,_)}var l=T("values"),g=T("visible");if(l&&l.length||(g=c.visible=!1),g){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var x=T("range");c._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:x},t.setConvert(c._ax,d.layout),T("multiselect");var A=T("constraintrange");A&&(c.constraintrange=o.cleanRanges(A,c))}}G.exports=function(c,p,d,T){function l(_,w){return h.coerce(c,p,r,_,w)}var g=c.dimensions;Array.isArray(g)&&g.length>n&&(h.log("parcoords traces support up to "+n+" dimensions at the moment"),g.splice(n));var x=e(c,p,{name:"dimensions",layout:T,handleItemDefaults:s}),A=a(c,p,d,T,l);E(p,T,l),(!Array.isArray(x)||!x.length)&&(p.visible=!1),i(p,x,"values",A);var M=h.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});h.coerceFont(l,"labelfont",M),h.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),h.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),cD=Ge({"src/traces/parcoords/calc.js"($,G){var h=gn().isArrayOrTypedArray,b=Tc(),S=zg().wrap;G.exports=function(t,r){var o,n;return b.hasColorscale(r,"line")&&h(r.line.color)?(o=r.line.color,n=b.extractOpts(r.line).colorscale,b.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),n=[[0,r.line.color],[1,r.line.color]]),S({lineColor:o,cscale:n})};function E(e){for(var t=new Array(e),r=0;r>>16,($&65280)>>>8,$&255],alpha:1};if(typeof $=="number")return{space:"rgb",values:[$>>>16,($&65280)>>>8,$&255],alpha:1};if($=String($).toLowerCase(),EE.default[$])S=EE.default[$].slice(),e="rgb";else if($==="transparent")E=0,e="rgb",S=[0,0,0];else if($[0]==="#"){var t=$.slice(1),r=t.length,o=r<=4;E=1,o?(S=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(S=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),S[0]||(S[0]=0),S[1]||(S[1]=0),S[2]||(S[2]=0),e="rgb"}else if(b=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec($)){var n=b[1];e=n.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;S=b[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=S.shift()),S=S.map(function(a,s){if(a[a.length-1]==="%")return a=parseFloat(a)/100,s===3?a:e==="rgb"?a*255:e[0]==="h"||e[0]==="l"&&!s?a*100:e==="lab"?a*125:e==="lch"?s<2?a*150:a*360:e[0]==="o"&&!s?a:e==="oklab"?a*.4:e==="oklch"?s<2?a*.4:a*360:a;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(kE[a]!==void 0)return kE[a];if(a.endsWith("deg"))return parseFloat(a);if(a.endsWith("turn"))return parseFloat(a)*360;if(a.endsWith("grad"))return parseFloat(a)*360/400;if(a.endsWith("rad"))return parseFloat(a)*180/Math.PI}return a==="none"?0:parseFloat(a)}),E=S.length>i?S.pop():1}else/[0-9](?:\s|\/|,)/.test($)&&(S=$.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),e=((h=(G=$.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:e,values:S,alpha:E}}var EE,DC,kE,hD=bi({"node_modules/color-parse/index.js"(){EE=Mo(Ok()),DC=fD,kE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),QA,zC=bi({"node_modules/color-space/rgb.js"(){QA={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),eS,vD=bi({"node_modules/color-space/hsl.js"(){zC(),eS={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function($){var G=$[0]/360,h=$[1]/100,b=$[2]/100,S,E,e,t,r,o=0;if(h===0)return r=b*255,[r,r,r];for(E=b<.5?b*(1+h):b+h-b*h,S=2*b-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?S+(E-S)*6*e:2*e<1?E:3*e<2?S+(E-S)*(2/3-e)*6:S,t[o++]=r*255;return t}},QA.hsl=function($){var G=$[0]/255,h=$[1]/255,b=$[2]/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=E-S,t,r,o;return E===S?t=0:G===E?t=(h-b)/e:h===E?t=2+(b-G)/e:b===E&&(t=4+(G-h)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(S+E)/2,E===S?r=0:o<=.5?r=e/(E+S):r=e/(2-E-S),[t,r*100,o*100]}}}),OC={};ko(OC,{default:()=>dD});function dD($){Array.isArray($)&&$.raw&&($=String.raw(...arguments)),$ instanceof Number&&($=+$);var G,h=DC($);if(!h.space)return[];const b=h.space[0]==="h"?eS.min:QA.min,S=h.space[0]==="h"?eS.max:QA.max;return G=Array(3),G[0]=Math.min(Math.max(h.values[0],b[0]),S[0]),G[1]=Math.min(Math.max(h.values[1],b[1]),S[1]),G[2]=Math.min(Math.max(h.values[2],b[2]),S[2]),h.space[0]==="h"&&(G=eS.rgb(G)),G.push(Math.min(Math.max(h.alpha,0),1)),G}var pD=bi({"node_modules/color-rgba/index.js"(){hD(),zC(),vD()}}),FC=Ge({"src/traces/parcoords/helpers.js"($){var G=gn().isTypedArray;$.convertTypedArray=function(h){return G(h)?Array.prototype.slice.call(h):h},$.isOrdinal=function(h){return!!h.tickvals},$.isVisible=function(h){return h.visible||!("visible"in h)}}}),mD=Ge({"src/traces/parcoords/lines.js"($,G){var h=["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(` +`),b=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),S=JA().maxDimensionCount,E=gn(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function a(w,m,u,v,y){var I=w._gl;I.enable(I.SCISSOR_TEST),I.scissor(m,u,v,y),w.clear({color:[0,0,0,0],depth:1})}function s(w,m,u,v,y,I){var L=I.key;function z(F){var N=Math.min(v,y-F*v);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],a(w,I.scissorX,I.scissorY,I.scissorWidth,I.viewBoxSize[1])),!u.clearOnly&&(I.count=2*N,I.offset=2*F*v,m(I),F*v+N>>8*m)%256/255}function d(w,m,u){for(var v=new Array(w*(S+4)),y=0,I=0;Ize&&(ze=te[ve].dim1.canvasX,Ce=ve);ie===0&&a(y,0,0,N.canvasWidth,N.canvasHeight);var Ye=V(u);for(ve=0;veve._length&&(Qe=Qe.slice(0,ve._length));var Le=ve.tickvals,Te;function pe(Ft,Nt){return{val:Ft,text:Te[Nt]}}function Ne(Ft,Nt){return Ft.val-Nt.val}if(S(Le)&&Le.length){b.isTypedArray(Le)&&(Le=Array.from(Le)),Te=ve.ticktext,!S(Te)||!Te.length?Te=Le.map(E(ve.tickformat)):Te.length>Le.length?Te=Te.slice(0,Le.length):Le.length>Te.length&&(Le=Le.slice(0,Te.length));for(var ot=1;ot=Nt||Sr>=$t)return;var Zr=rt.lineLayer.readPixel(Mr,$t-1-Sr),Ar=Zr[3]!==0,Br=Ar?Zr[2]+256*(Zr[1]+256*Zr[0]):null,Mt={x:Mr,y:Sr,clientX:Ft.clientX,clientY:Ft.clientY,dataIndex:rt.model.key,curveNumber:Br};Br!==Ce&&(Ar?ee.hover(Mt):ee.unhover&&ee.unhover(Mt),Ce=Br)}}),Ae.style("opacity",function(rt){return rt.pick?0:1}),ue.style("background","rgba(255, 255, 255, 0)");var ze=ue.selectAll("."+T.cn.parcoords).data(ve,f);ze.exit().remove(),ze.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ze.attr("transform",function(rt){return o(rt.model.translateX,rt.model.translateY)});var Ye=ze.selectAll("."+T.cn.parcoordsControlView).data(c,f);Ye.enter().append("g").classed(T.cn.parcoordsControlView,!0),Ye.attr("transform",function(rt){return o(rt.model.pad.l,rt.model.pad.t)});var it=Ye.selectAll("."+T.cn.yAxis).data(function(rt){return rt.dimensions},f);it.enter().append("g").classed(T.cn.yAxis,!0),Ye.each(function(rt){U(it,rt,H)}),Ae.each(function(rt){if(rt.viewModel){!rt.lineLayer||ee?rt.lineLayer=g(this,rt):rt.lineLayer.update(rt),(rt.key||rt.key===0)&&(rt.viewModel[rt.key]=rt.lineLayer);var Ft=!rt.context||ee;rt.lineLayer.render(rt.viewModel.panels,Ft)}}),it.attr("transform",function(rt){return o(rt.xScale(rt.xIndex),0)}),it.call(h.behavior.drag().origin(function(rt){return rt}).on("drag",function(rt){var Ft=rt.parent;ie.linePickActive(!1),rt.x=Math.max(-T.overdrag,Math.min(rt.model.width+T.overdrag,h.event.x)),rt.canvasX=rt.x*rt.model.canvasPixelRatio,it.sort(function(Nt,$t){return Nt.x-$t.x}).each(function(Nt,$t){Nt.xIndex=$t,Nt.x=rt===Nt?Nt.x:Nt.xScale(Nt.xIndex),Nt.canvasX=Nt.x*Nt.model.canvasPixelRatio}),U(it,Ft,H),it.filter(function(Nt){return Math.abs(rt.xIndex-Nt.xIndex)!==0}).attr("transform",function(Nt){return o(Nt.xScale(Nt.xIndex),0)}),h.select(this).attr("transform",o(rt.x,0)),it.each(function(Nt,$t,rr){rr===rt.parent.key&&(Ft.dimensions[$t]=Nt)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer.render&&Ft.focusLayer.render(Ft.panels)}).on("dragend",function(rt){var Ft=rt.parent;rt.x=rt.xScale(rt.xIndex),rt.canvasX=rt.x*rt.model.canvasPixelRatio,U(it,Ft,H),h.select(this).attr("transform",function(Nt){return o(Nt.x,0)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer&&Ft.focusLayer.render(Ft.panels),Ft.pickLayer&&Ft.pickLayer.render(Ft.panels,!0),ie.linePickActive(!0),ee&&ee.axesMoved&&ee.axesMoved(Ft.key,Ft.dimensions.map(function(Nt){return Nt.crossfilterDimensionIndex}))})),it.exit().remove();var st=it.selectAll("."+T.cn.axisOverlays).data(c,f);st.enter().append("g").classed(T.cn.axisOverlays,!0),st.selectAll("."+T.cn.axis).remove();var nt=st.selectAll("."+T.cn.axis).data(c,f);nt.enter().append("g").classed(T.cn.axis,!0),nt.each(function(rt){var Ft=rt.model.height/rt.model.tickDistance,Nt=rt.domainScale,$t=Nt.domain();h.select(this).call(h.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Ft,rt.tickFormat).tickValues(rt.ordinal?$t:null).tickFormat(function(rr){return d.isOrdinal(rt)?rr:Z(rt.model.dimensions[rt.visibleIndex],rr)}).scale(Nt)),i.font(nt.selectAll("text"),rt.model.tickFont)}),nt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),nt.selectAll("text").style("cursor","default");var Qe=st.selectAll("."+T.cn.axisHeading).data(c,f);Qe.enter().append("g").classed(T.cn.axisHeading,!0);var Le=Qe.selectAll("."+T.cn.axisTitle).data(c,f);Le.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ne?"none":"auto"),Le.text(function(rt){return rt.label}).each(function(rt){var Ft=h.select(this);i.font(Ft,rt.model.labelFont),n.convertToTspans(Ft,le)}).attr("transform",function(rt){var Ft=R(rt.model.labelAngle,rt.model.labelSide),Nt=T.axisTitleOffset;return(Ft.dir>0?"":o(0,2*Nt+rt.model.height))+r(Ft.degrees)+o(-Nt*Ft.dx,-Nt*Ft.dy)}).attr("text-anchor",function(rt){var Ft=R(rt.model.labelAngle,rt.model.labelSide),Nt=Math.abs(Ft.dx),$t=Math.abs(Ft.dy);return 2*Nt>$t?Ft.dir*Ft.dx<0?"start":"end":"middle"});var Te=st.selectAll("."+T.cn.axisExtent).data(c,f);Te.enter().append("g").classed(T.cn.axisExtent,!0);var pe=Te.selectAll("."+T.cn.axisExtentTop).data(c,f);pe.enter().append("g").classed(T.cn.axisExtentTop,!0),pe.attr("transform",o(0,-T.axisExtentOffset));var Ne=pe.selectAll("."+T.cn.axisExtentTopText).data(c,f);Ne.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(N),Ne.text(function(rt){return re(rt,!0)}).each(function(rt){i.font(h.select(this),rt.model.rangeFont)});var ot=Te.selectAll("."+T.cn.axisExtentBottom).data(c,f);ot.enter().append("g").classed(T.cn.axisExtentBottom,!0),ot.attr("transform",function(rt){return o(0,rt.model.height+T.axisExtentOffset)});var ct=ot.selectAll("."+T.cn.axisExtentBottomText).data(c,f);ct.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(N),ct.text(function(rt){return re(rt,!1)}).each(function(rt){i.font(h.select(this),rt.model.rangeFont)}),l.ensureAxisBrush(st,ae,le)}}}),BC=Ge({"src/traces/parcoords/plot.js"(r,G){var h=gD(),b=SE(),S=FC().isVisible,E={};function e(o,n,i){var a=n.indexOf(i),s=o.indexOf(a);return s===-1&&(s+=n.length),s}function t(o,n){return function(a,s){return e(o,n,a)-e(o,n,s)}}var r=G.exports=function(n,i){var a=n._fullLayout,s=b(n,[],E);if(s){var f={},c={},p={},d={},T=a._size;i.forEach(function(M,_){var w=M[0].trace;p[_]=w.index;var m=d[_]=w.index;f[_]=n.data[m].dimensions,c[_]=n.data[m].dimensions.slice()});var l=function(M,_,w){var m=c[M][_],u=w.map(function(F){return F.slice()}),v="dimensions["+_+"].constraintrange",y=a._tracePreGUI[n._fullData[p[M]]._fullInput.uid];if(y[v]===void 0){var I=m.constraintrange;y[v]=I||null}var L=n._fullData[p[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),m.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete m.constraintrange,delete L.constraintrange,u=null);var z={};z[v]=u,n.emit("plotly_restyle",[z,[d[M]]])},g=function(M){n.emit("plotly_hover",M)},x=function(M){n.emit("plotly_unhover",M)},A=function(M,_){var w=t(_,c[M].filter(S));f[M].sort(w),c[M].filter(function(m){return!S(m)}).sort(function(m){return c[M].indexOf(m)}).forEach(function(m){f[M].splice(f[M].indexOf(m),1),f[M].splice(c[M].indexOf(m),0,m)}),n.emit("plotly_restyle",[{dimensions:[f[M]]},[d[M]]])};h(n,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:g,unhover:x,axesMoved:A})}};r.reglPrecompiled=E}}),yD=Ge({"src/traces/parcoords/base_plot.js"($){var G=Mi(),h=Rv().getModuleCalcData,b=BC(),S=Ad();$.name="parcoords",$.plot=function(E){var e=h(E.calcdata,"parcoords")[0];e.length&&b(E,e)},$.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),n=e._has&&e._has("parcoords");o&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},$.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(n,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var n=this,i=n.toDataURL("image/png"),a=e.append("svg:image");a.attr({xmlns:S.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),_D=Ge({"src/traces/parcoords/base_index.js"($,G){G.exports={attributes:RC(),supplyDefaults:uD(),calc:cD(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:yD(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),xD=Ge({"src/traces/parcoords/index.js"($,G){var h=_D();h.plot=BC(),G.exports=h}}),bD=Ge({"lib/parcoords.js"($,G){G.exports=xD()}}),NC=Ge({"src/traces/parcats/attributes.js"($,G){var h=Qi().extendFlat,b=ru(),S=Hs(),E=Pu(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Al(),r=Ac().attributes,o=h({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:t({editType:"plot"})});G.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:h({},b.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"]}),hovertemplatefallback:t({editType:"plot"}),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:S({editType:"calc"}),tickfont:S({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:o,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}}}),wD=Ge({"src/traces/parcats/defaults.js"($,G){var h=gn(),b=hv().hasColorscale,S=vh(),E=Ac().defaults,e=vv(),t=NC(),r=ME(),o=As().isTypedArraySpec;function n(a,s,f,c,p){p("line.shape"),p("line.hovertemplate"),p("line.hovertemplatefallback");var d=p("line.color",c.colorway[0]);if(b(a,"line")&&h.isArrayOrTypedArray(d)){if(d.length)return p("line.colorscale"),S(a,s,c,p,{prefix:"line.",cLetter:"c"}),d.length;s.line.color=f}return 1/0}function i(a,s){function f(x,A){return h.coerce(a,s,t.dimensions,x,A)}var c=f("values"),p=f("visible");if(c&&c.length||(p=s.visible=!1),p){f("label"),f("displayindex",s._index);var d=a.categoryarray,T=h.isArrayOrTypedArray(d)&&d.length>0||o(d),l;T&&(l="array");var g=f("categoryorder",l);g==="array"?(f("categoryarray"),f("ticktext")):(delete a.categoryarray,delete a.ticktext),!T&&g==="array"&&(s.categoryorder="trace")}}G.exports=function(s,f,c,p){function d(x,A){return h.coerce(s,f,t,x,A)}var T=e(s,f,{name:"dimensions",handleItemDefaults:i}),l=n(s,f,c,p,d);E(f,p,d),(!Array.isArray(T)||!T.length)&&(f.visible=!1),r(f,T,"values",l),d("hoveron"),d("hovertemplate"),d("hovertemplatefallback"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var g=p.font;h.coerceFont(d,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),h.coerceFont(d,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}}}),TD=Ge({"src/traces/parcats/calc.js"($,G){var h=zg().wrap,b=hv().hasColorscale,S=dv(),E=x1(),e=Ss(),t=gn(),r=Pi();G.exports=function(g,x){var A=t.filterVisible(x.dimensions);if(A.length===0)return[];var M=A.map(function(V){var ee;if(V.categoryorder==="trace")ee=null;else if(V.categoryorder==="array")ee=V.categoryarray;else{ee=E(V.values);for(var ne=!0,K=0;K=l.length||g[l[x]]!==void 0)return!1;g[l[x]]=!0}return!0}}}),AD=Ge({"src/traces/parcats/parcats.js"($,G){var h=Mi(),b=(to(),yi(gi)).interpolateNumber,S=_x(),E=jf(),e=gn(),t=e.strTranslate,r=Ss(),o=Bs(),n=Ju();function i(K,ue,te,H){var ae=ue._context.staticPlot,ie=K.map(le.bind(0,ue,te)),ve=H.selectAll("g.parcatslayer").data([null]);ve.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var Ae=ve.selectAll("g.trace.parcats").data(ie,a),Ce=Ae.enter().append("g").attr("class","trace parcats");Ae.attr("transform",function(pe){return t(pe.x,pe.y)}),Ce.append("g").attr("class","paths");var Fe=Ae.select("g.paths"),ze=Fe.selectAll("path.path").data(function(pe){return pe.paths},a);ze.attr("fill",function(pe){return pe.model.color});var Ye=ze.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(pe){return pe.model.color}).attr("fill-opacity",0);g(Ye),ze.attr("d",function(pe){return pe.svgD}),Ye.empty()||ze.sort(f),ze.exit().remove(),ze.on("mouseover",c).on("mouseout",p).on("click",l),Ce.append("g").attr("class","dimensions");var it=Ae.select("g.dimensions"),st=it.selectAll("g.dimension").data(function(pe){return pe.dimensions},a);st.enter().append("g").attr("class","dimension"),st.attr("transform",function(pe){return t(pe.x,0)}),st.exit().remove();var nt=st.selectAll("g.category").data(function(pe){return pe.categories},a),Qe=nt.enter().append("g").attr("class","category");nt.attr("transform",function(pe){return t(0,pe.y)}),Qe.append("rect").attr("class","catrect").attr("pointer-events","none"),nt.select("rect.catrect").attr("fill","none").attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}),M(Qe);var Le=nt.selectAll("rect.bandrect").data(function(pe){return pe.bands},a);Le.each(function(){e.raiseToTop(this)}),Le.attr("fill",function(pe){return pe.color});var Te=Le.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(pe){return pe.color}).attr("fill-opacity",0);Le.attr("fill",function(pe){return pe.color}).attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}).attr("y",function(pe){return pe.y}).attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":pe.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(Te),Le.exit().remove(),Qe.append("text").attr("class","catlabel").attr("pointer-events","none"),nt.select("text.catlabel").attr("text-anchor",function(pe){return s(pe)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(pe){return s(pe)?pe.width+5:-5}).attr("y",function(pe){return pe.height/2}).text(function(pe){return pe.model.categoryLabel}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.categorylabelfont),n.convertToTspans(h.select(this),ue)}),Qe.append("text").attr("class","dimlabel"),nt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(pe){return pe.width/2}).attr("y",-5).text(function(pe,Ne){return Ne===0?pe.parcatsViewModel.model.dimensions[pe.model.dimensionInd].dimensionLabel:null}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.labelfont)}),nt.selectAll("rect.bandrect").on("mouseover",N).on("mouseout",B),nt.exit().remove(),st.call(h.behavior.drag().origin(function(pe){return{x:pe.x,y:0}}).on("dragstart",R).on("drag",U).on("dragend",j)),Ae.each(function(pe){pe.traceSelection=h.select(this),pe.pathSelection=h.select(this).selectAll("g.paths").selectAll("path.path"),pe.dimensionSelection=h.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Ae.exit().remove()}G.exports=function(K,ue,te,H){i(te,K,H,ue)};function a(K){return K.key}function s(K){var ue=K.parcatsViewModel.dimensions.length,te=K.parcatsViewModel.dimensions[ue-1].model.dimensionInd;return K.model.dimensionInd===te}function f(K,ue){return K.model.rawColor>ue.model.rawColor?1:K.model.rawColor"),rt=h.mouse(ae)[0];E.loneHover({trace:ie,x:nt-Ae.left+Ce.left,y:Qe-Ae.top+Ce.top,text:ct,color:K.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Le,idealAlign:rt1&&Fe.displayInd===Ce.dimensions.length-1?(it=ve.left,st="left"):(it=ve.left+ve.width,st="right");var nt=Ae.model.count,Qe=Ae.model.categoryLabel,Le=nt/Ae.parcatsViewModel.model.count,Te={countLabel:nt,categoryLabel:Qe,probabilityLabel:Le.toFixed(3)},pe=[];Ae.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&pe.push(["Count:",Te.countLabel].join(" ")),Ae.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&pe.push(["P("+Te.categoryLabel+"):",Te.probabilityLabel].join(" "));var Ne=pe.join("
");return{trace:ze,x:H*(it-ue.left),y:ae*(Ye-ue.top),text:Ne,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:st,hovertemplate:ze.hovertemplate,hovertemplateLabels:Te,eventData:[{data:ze._input,fullData:ze,count:nt,category:Qe,probability:Le}]}}function z(K,ue,te){var H=[];return h.select(te.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;H.push(L(K,ue,ae))}),H}function F(K,ue,te){K._fullLayout._calcInverseTransform(K);var H=K._fullLayout._invScaleX,ae=K._fullLayout._invScaleY,ie=te.getBoundingClientRect(),ve=h.select(te).datum(),Ae=ve.categoryViewModel,Ce=Ae.parcatsViewModel,Fe=Ce.model.dimensions[Ae.model.dimensionInd],ze=Ce.trace,Ye=ie.y+ie.height/2,it,st;Ce.dimensions.length>1&&Fe.displayInd===Ce.dimensions.length-1?(it=ie.left,st="left"):(it=ie.left+ie.width,st="right");var nt=Ae.model.categoryLabel,Qe=ve.parcatsViewModel.model.count,Le=0;ve.categoryViewModel.bands.forEach(function(rr){rr.color===ve.color&&(Le+=rr.count)});var Te=Ae.model.count,pe=0;Ce.pathSelection.each(function(rr){rr.model.color===ve.color&&(pe+=rr.model.count)});var Ne=Le/Qe,ot=Le/pe,ct=Le/Te,rt={countLabel:Le,categoryLabel:nt,probabilityLabel:Ne.toFixed(3)},Ft=[];Ae.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ft.push(["Count:",rt.countLabel].join(" ")),Ae.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ft.push("P(color ∩ "+nt+"): "+rt.probabilityLabel),Ft.push("P("+nt+" | color): "+ot.toFixed(3)),Ft.push("P(color | "+nt+"): "+ct.toFixed(3)));var Nt=Ft.join("
"),$t=o.mostReadable(ve.color,["black","white"]);return{trace:ze,x:H*(it-ue.left),y:ae*(Ye-ue.top),text:Nt,color:ve.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:$t,fontSize:10,idealAlign:st,hovertemplate:ze.hovertemplate,hovertemplateLabels:rt,eventData:[{data:ze._input,fullData:ze,category:nt,count:Qe,probability:Ne,categorycount:Te,colorcount:pe,bandcolorcount:Le}]}}function N(K){if(!K.parcatsViewModel.dragDimension&&K.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ue=h.mouse(this)[1];if(ue<-1)return;var te=K.parcatsViewModel.graphDiv,H=te._fullLayout,ae=H._paperdiv.node().getBoundingClientRect(),ie=K.parcatsViewModel.hoveron,ve=this;if(ie==="color"?(v(ve),I(ve,"plotly_hover",h.event)):(u(ve),y(ve,"plotly_hover",h.event)),K.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Ae;ie==="category"?Ae=L(te,ae,ve):ie==="color"?Ae=F(te,ae,ve):ie==="dimension"&&(Ae=z(te,ae,ve)),Ae&&E.loneHover(Ae,{container:H._hoverlayer.node(),outerContainer:H._paper.node(),gd:te})}}}function B(K){var ue=K.parcatsViewModel;if(!ue.dragDimension&&(g(ue.pathSelection),M(ue.dimensionSelection.selectAll("g.category")),w(ue.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(ue.graphDiv._fullLayout._hoverlayer.node()),ue.pathSelection.sort(f),ue.hoverinfoItems.indexOf("skip")===-1)){var te=K.parcatsViewModel.hoveron,H=this;te==="color"?I(H,"plotly_unhover",h.event):y(H,"plotly_unhover",h.event)}}function R(K){K.parcatsViewModel.arrangement!=="fixed"&&(K.dragDimensionDisplayInd=K.model.displayInd,K.initialDragDimensionDisplayInds=K.parcatsViewModel.model.dimensions.map(function(ue){return ue.displayInd}),K.dragHasMoved=!1,K.dragCategoryDisplayInd=null,h.select(this).selectAll("g.category").select("rect.catrect").each(function(ue){var te=h.mouse(this)[0],H=h.mouse(this)[1];-2<=te&&te<=ue.width+2&&-2<=H&&H<=ue.height+2&&(K.dragCategoryDisplayInd=ue.model.displayInd,K.initialDragCategoryDisplayInds=K.model.categories.map(function(ae){return ae.displayInd}),ue.model.dragY=ue.y,e.raiseToTop(this.parentNode),h.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yze.y+ze.height/2&&(ie.model.displayInd=ze.model.displayInd,ze.model.displayInd=Ae),K.dragCategoryDisplayInd=ie.model.displayInd}if(K.dragCategoryDisplayInd===null||K.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=h.event.x;var Ye=K.parcatsViewModel.dimensions[te],it=K.parcatsViewModel.dimensions[H];Ye!==void 0&&ae.model.dragXit.x&&(ae.model.displayInd=it.model.displayInd,it.model.displayInd=K.dragDimensionDisplayInd),K.dragDimensionDisplayInd=ae.model.displayInd}ee(K.parcatsViewModel),V(K.parcatsViewModel),fe(K.parcatsViewModel),re(K.parcatsViewModel)}}function j(K){if(K.parcatsViewModel.arrangement!=="fixed"&&K.dragDimensionDisplayInd!==null){h.select(this).selectAll("text").attr("font-weight","normal");var ue={},te=Z(K.parcatsViewModel),H=K.parcatsViewModel.model.dimensions.map(function(it){return it.displayInd}),ae=K.initialDragDimensionDisplayInds.some(function(it,st){return it!==H[st]});ae&&H.forEach(function(it,st){var nt=K.parcatsViewModel.model.dimensions[st].containerInd;ue["dimensions["+nt+"].displayindex"]=it});var ie=!1;if(K.dragCategoryDisplayInd!==null){var ve=K.model.categories.map(function(it){return it.displayInd});if(ie=K.initialDragCategoryDisplayInds.some(function(it,st){return it!==ve[st]}),ie){var Ae=K.model.categories.slice().sort(function(it,st){return it.displayInd-st.displayInd}),Ce=Ae.map(function(it){return it.categoryValue}),Fe=Ae.map(function(it){return it.categoryLabel});ue["dimensions["+K.model.containerInd+"].categoryarray"]=[Ce],ue["dimensions["+K.model.containerInd+"].ticktext"]=[Fe],ue["dimensions["+K.model.containerInd+"].categoryorder"]="array"}}if(K.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!K.dragHasMoved&&K.potentialClickBand&&(K.parcatsViewModel.hoveron==="color"?I(K.potentialClickBand,"plotly_click",h.event.sourceEvent):y(K.potentialClickBand,"plotly_click",h.event.sourceEvent)),K.model.dragX=null,K.dragCategoryDisplayInd!==null){var ze=K.parcatsViewModel.dimensions[K.dragDimensionDisplayInd].categories[K.dragCategoryDisplayInd];ze.model.dragY=null,K.dragCategoryDisplayInd=null}K.dragDimensionDisplayInd=null,K.parcatsViewModel.dragDimension=null,K.dragHasMoved=null,K.potentialClickBand=null,ee(K.parcatsViewModel),V(K.parcatsViewModel);var Ye=h.transition().duration(300).ease("cubic-in-out");Ye.each(function(){fe(K.parcatsViewModel,!0),re(K.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&S.restyle(K.parcatsViewModel.graphDiv,ue,[te])})}}function Z(K){for(var ue,te=K.graphDiv._fullData,H=0;H=0;Ce--)Fe+="C"+ve[Ce]+","+(ue[Ce+1]+H)+" "+ie[Ce]+","+(ue[Ce]+H)+" "+(K[Ce]+te[Ce])+","+(ue[Ce]+H),Fe+="l-"+te[Ce]+",0 ";return Fe+="Z",Fe}function V(K){var ue=K.dimensions,te=K.model,H=ue.map(function(Zr){return Zr.categories.map(function(Ar){return Ar.y})}),ae=K.model.dimensions.map(function(Zr){return Zr.categories.map(function(Ar){return Ar.displayInd})}),ie=K.model.dimensions.map(function(Zr){return Zr.displayInd}),ve=K.dimensions.map(function(Zr){return Zr.model.dimensionInd}),Ae=ue.map(function(Zr){return Zr.x}),Ce=ue.map(function(Zr){return Zr.width}),Fe=[];for(var ze in te.paths)te.paths.hasOwnProperty(ze)&&Fe.push(te.paths[ze]);function Ye(Zr){var Ar=Zr.categoryInds.map(function(Mt,je){return ae[je][Mt]}),Br=ve.map(function(Mt){return Ar[Mt]});return Br}Fe.sort(function(Zr,Ar){var Br=Ye(Zr),Mt=Ye(Ar);return K.sortpaths==="backward"&&(Br.reverse(),Mt.reverse()),Br.push(Zr.valueInds[0]),Mt.push(Ar.valueInds[0]),K.bundlecolors&&(Br.unshift(Zr.rawColor),Mt.unshift(Ar.rawColor)),BrMt?1:0});for(var it=new Array(Fe.length),st=ue[0].model.count,nt=ue[0].categories.map(function(Zr){return Zr.height}).reduce(function(Zr,Ar){return Zr+Ar}),Qe=0;Qe0?Te=nt*(Le.count/st):Te=0;for(var pe=new Array(H.length),Ne=0;Ne1?ve=(K.width-2*te-H)/(ae-1):ve=0,Ae=te,Ce=Ae+ve*ie;var Fe=[],ze=K.model.maxCats,Ye=ue.categories.length,it=8,st=ue.count,nt=K.height-it*(ze-1),Qe,Le,Te,pe,Ne,ot=(ze-Ye)*it/2,ct=ue.categories.map(function(rt){return{displayInd:rt.displayInd,categoryInd:rt.categoryInd}});for(ct.sort(function(rt,Ft){return rt.displayInd-Ft.displayInd}),Ne=0;Ne0?Qe=Le.count/st*nt:Qe=0,Te={key:Le.valueInds[0],model:Le,width:H,height:Qe,y:Le.dragY!==null?Le.dragY:ot,bands:[],parcatsViewModel:K},ot=ot+Qe+it,Fe.push(Te);return{key:ue.dimensionInd,x:ue.dragX!==null?ue.dragX:Ce,y:0,width:H,model:ue,categories:Fe,parcatsViewModel:K,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),UC=Ge({"src/traces/parcats/plot.js"($,G){var h=AD();G.exports=function(S,E,e,t){var r=S._fullLayout,o=r._paper,n=r._size;h(S,o,E,{width:n.w,height:n.h,margin:{t:n.t,r:n.r,b:n.b,l:n.l}},e,t)}}}),SD=Ge({"src/traces/parcats/base_plot.js"($){var G=Rv().getModuleCalcData,h=UC(),b="parcats";$.name=b,$.plot=function(S,E,e,t){var r=G(S.calcdata,b);if(r.length){var o=r[0];h(S,o,e,t)}},$.clean=function(S,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),MD=Ge({"src/traces/parcats/index.js"($,G){G.exports={attributes:NC(),supplyDefaults:wD(),calc:TD(),plot:UC(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:SD(),categories:["noOpacity"],meta:{}}}}),ED=Ge({"lib/parcats.js"($,G){G.exports=MD()}}),Xy=Ge({"src/plots/mapbox/constants.js"($,G){var h=Lp(),b="1.13.4",S='© OpenStreetMap contributors',E=['© Carto',S].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:S,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:E,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:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=h(r);G.exports={requiredVersion:b,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+b+"."].join(` +`),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` +`),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",o.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` +`),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` +`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),tS=Ge({"src/plots/mapbox/layout_attributes.js"($,G){var h=gn(),b=_o().defaultLine,S=Ac().attributes,E=Hs(),e=Uc().textposition,t=Nc().overrideAll,r=pu().templatedArray,o=Xy(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("mapbox",".layers",!0)],domain:S({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},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:b}},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:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),CE=Ge({"src/traces/scattermapbox/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Al(),E=nd(),e=Xb(),t=Uc(),r=tS(),o=ru(),n=Pu(),i=Qi().extendFlat,a=Nc().overrideAll,s=tS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.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:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({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},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),jC=Ge({"src/traces/scattermapbox/constants.js"($,G){var h=["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"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),kD=Ge({"src/traces/scattermapbox/defaults.js"($,G){var h=gn(),b=iu(),S=Hv(),E=Bp(),e=ep(),t=Iv(),r=CE(),o=jC().isSupportedFont;G.exports=function(a,s,f,c){function p(v,y){return h.coerce(a,s,r,v,y)}function d(v,y){return h.coerce2(a,s,r,v,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),x=d("cluster.step"),A=d("cluster.color",s.marker&&s.marker.color||f),M=d("cluster.size"),_=d("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),qC=Ge({"src/traces/scattermapbox/format_labels.js"($,G){var h=ws();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),VC=Ge({"src/plots/mapbox/convert_text_opts.js"($,G){var h=gn();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),CD=Ge({"src/traces/scattermapbox/convert.js"($,G){var h=Pi(),b=gn(),S=zi().BADNUM,E=I_(),e=Tc(),t=Ss(),r=Rp(),o=iu(),n=jC().isSupportedFont,i=VC(),a=Vv().appendArrayPointValue,s=Ju().NEWLINES,f=Ju().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,v=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((v||y)&&(re=E.calcTraceToLineCoords(w)),v&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=d(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),v=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;v&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):v.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):v.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",v[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),LD=Ge({"src/traces/scattermapbox/plot.js"($,G){var h=gn(),b=CD(),S=Xy().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=v[y];a.removeLayer(d.layerIds[I])}u||a.removeSource(d.sourceIds.circle)}function g(u){for(var v=E.nonCluster,y=0;y=0;y--){var I=v[y];a.removeLayer(d.layerIds[I]),u||a.removeSource(d.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,v=0;v=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],d,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),d=0;d=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=d.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,v=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(v),I=p.c2p(v),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:d};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,d=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&d?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):d&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),PD=Ge({"src/traces/scattermapbox/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),RD=Ge({"src/traces/scattermapbox/select.js"($,G){var h=gn(),b=iu(),S=zi().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var X,se,we,De,He;for(we=k,He=0;He<8;He++){if(De=this.sampleCurveX(we)-k,Math.abs(De)se)return se;for(;XDe?X=we:se=we,we=(se-X)*.5+X}return we},n.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=a;function a(k,C){this.x=k,this.y=C}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},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(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,X=k.y-this.y;return C*C+X*X},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,X=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=X,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),X=Math.sin(k),se=C*this.x-X*this.y,we=X*this.x+C*this.y;return this.x=se,this.y=we,this},_rotateAround:function(k,C){var X=Math.cos(k),se=Math.sin(k),we=C.x+X*(this.x-C.x)-se*(this.y-C.y),De=C.y+se*(this.x-C.x)+X*(this.y-C.y);return this.x=we,this.y=De,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(k){return k instanceof a?k:Array.isArray(k)?new a(k[0],k[1]):k};var s=typeof self<"u"?self:{};function f(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var X=0;X=1)return 1;var C=k*k,X=C*k;return 4*(k<.5?X:3*(k-C)+X-.75)}function d(k,C,X,se){var we=new o(k,C,X,se);return function(De){return we.solve(De)}}var T=d(.25,.1,.25,1);function l(k,C,X){return Math.min(X,Math.max(C,k))}function g(k,C,X){var se=X-C,we=((k-C)%se+se)%se+C;return we===C?X:we}function x(k,C,X){if(!k.length)return X(null,[]);var se=k.length,we=new Array(k.length),De=null;k.forEach(function(He,mt){C(He,function(jt,tr){jt&&(De=jt),we[mt]=tr,--se===0&&X(De,we)})})}function A(k){var C=[];for(var X in k)C.push(k[X]);return C}function M(k,C){var X=[];for(var se in k)se in C||X.push(se);return X}function _(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,we=C;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function y(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function I(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(X){C[X]&&(C[X]=C[X].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,X){var se={};for(var we in k)se[we]=C.call(X||this,k[we],we,k);return se}function N(k,C,X){var se={};for(var we in k)C.call(X||this,k[we],we,k)&&(se[we]=k[we]);return se}function B(k){return Array.isArray(k)?k.map(B):typeof k=="object"&&k?F(k,B):k}function R(k,C){for(var X=0;X=0)return!0;return!1}var U={};function j(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function Z(k,C,X){return(X.y-k.y)*(C.x-k.x)>(C.y-k.y)*(X.x-k.x)}function re(k){for(var C=0,X=0,se=k.length,we=se-1,De=void 0,He=void 0;X@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,X={};if(k.replace(C,function(we,De,He,mt){var jt=He||mt;return X[De]=jt?jt.toLowerCase():!0,""}),X["max-age"]){var se=parseInt(X["max-age"],10);isNaN(se)?delete X["max-age"]:X["max-age"]=se}return X}var V=null;function ee(k){if(V==null){var C=k.navigator?k.navigator.userAgent:null;V=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return V}function ne(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function K(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,X){return String.fromCharCode(+("0x"+X))}))}function ue(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var te=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),H=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,ve,Ae={now:te,frame:function(C){var X=H(C);return{cancel:function(){return ae(X)}}},getImageData:function(C,X){X===void 0&&(X=0);var se=s.document.createElement("canvas"),we=se.getContext("2d");if(!we)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,we.drawImage(C,0,0,C.width,C.height),we.getImageData(-X,-X,C.width+2*X,C.height+2*X)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ve==null&&(ve=s.matchMedia("(prefers-reduced-motion: reduce)")),ve.matches):!1}},Ce={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},Fe={supported:!1,testSupport:nt},ze,Ye=!1,it,st=!1;s.document&&(it=s.document.createElement("img"),it.onload=function(){ze&&Qe(ze),ze=null,st=!0},it.onerror=function(){Ye=!0,ze=null},it.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function nt(k){Ye||!it||(st?Qe(k):ze=k)}function Qe(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,it),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),Ye=!0}var Le="01";function Te(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",X="",se=0;se<10;se++)X+=C[Math.floor(Math.random()*62)];var we=720*60*1e3,De=[k,Le,X].join(""),He=Date.now()+we;return{token:De,tokenExpiresAt:He}}var pe=function(C,X){this._transformRequestFn=C,this._customAccessToken=X,this._createSkuToken()};pe.prototype._createSkuToken=function(){var C=Te();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},pe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pe.prototype.transformRequest=function(C,X){return this._transformRequestFn?this._transformRequestFn(C,X)||{url:C}:{url:C}},pe.prototype.normalizeStyleURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeGlyphsURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSourceURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSpriteURL=function(C,X,se,we){var De=$t(C);return Ne(C)?(De.path="/styles/v1"+De.path+"/sprite"+X+se,this._makeAPIURL(De,this._customAccessToken||we)):(De.path+=""+X+se,rr(De))},pe.prototype.normalizeTileURL=function(C,X){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Ne(C))return C;var se=$t(C),we=/(\.(png|jpg)\d*)(?=$)/,De=/^.+\/v4\//,He=Ae.devicePixelRatio>=2||X===512?"@2x":"",mt=Fe.supported?".webp":"$1";se.path=se.path.replace(we,""+He+mt),se.path=se.path.replace(De,"/"),se.path="/v4"+se.path;var jt=this._customAccessToken||Ft(se.params)||Ce.ACCESS_TOKEN;return Ce.REQUIRE_ACCESS_TOKEN&&jt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,jt)},pe.prototype.canonicalizeTileURL=function(C,X){var se="/v4/",we=/\.[\w]+$/,De=$t(C);if(!De.path.match(/(^\/v4\/)/)||!De.path.match(we))return C;var He="mapbox://tiles/";He+=De.path.replace(se,"");var mt=De.params;return X&&(mt=mt.filter(function(jt){return!jt.match(/^access_token=/)})),mt.length&&(He+="?"+mt.join("&")),He},pe.prototype.canonicalizeTileset=function(C,X){for(var se=X?Ne(X):!1,we=[],De=0,He=C.tiles||[];De=0&&C.params.splice(De,1)}if(we.path!=="/"&&(C.path=""+we.path+C.path),!Ce.REQUIRE_ACCESS_TOKEN)return rr(C);if(X=X||Ce.ACCESS_TOKEN,!X)throw new Error("An API access token is required to use Mapbox GL. "+se);if(X[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(He){return He.indexOf("access_token")===-1}),C.params.push("access_token="+X),rr(C)};function Ne(k){return k.indexOf("mapbox:")===0}var ot=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ct(k){return ot.test(k)}function rt(k){return k.indexOf("sku=")>0&&ct(k)}function Ft(k){for(var C=0,X=k;C=1&&s.localStorage.setItem(X,JSON.stringify(this.eventData))}catch{j("Unable to write to LocalStorage")}},Zr.prototype.processRequests=function(C){},Zr.prototype.postEvent=function(C,X,se,we){var De=this;if(Ce.EVENTS_URL){var He=$t(Ce.EVENTS_URL);He.params.push("access_token="+(we||Ce.ACCESS_TOKEN||""));var mt={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Le,userId:this.anonId},jt=X?_(mt,X):mt,tr={url:rr(He),headers:{"Content-Type":"text/plain"},body:JSON.stringify([jt])};this.pendingRequest=wn(tr,function(fr){De.pendingRequest=null,se(fr),De.saveEventData(),De.processRequests(we)})}},Zr.prototype.queueRequest=function(C,X){this.queue.push(C),this.processRequests(X)};var Ar=(function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,we,De,He){this.skuToken=De,(Ce.EVENTS_URL&&He||Ce.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(mt){return Ne(mt)||ct(mt)}))&&this.queueRequest({id:we,timestamp:Date.now()},He)},C.prototype.processRequests=function(se){var we=this;if(!(this.pendingRequest||this.queue.length===0)){var De=this.queue.shift(),He=De.id,mt=De.timestamp;He&&this.success[He]||(this.anonId||this.fetchEventData(),I(this.anonId)||(this.anonId=v()),this.postEvent(mt,{skuToken:this.skuToken},function(jt){jt||He&&(we.success[He]=!0)},se))}},C})(Zr),Br=(function(k){function C(X){k.call(this,"appUserTurnstile"),this._customAccessToken=X}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,we){Ce.EVENTS_URL&&Ce.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(De){return Ne(De)||ct(De)})&&this.queueRequest(Date.now(),we)},C.prototype.processRequests=function(se){var we=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var De=Sr(Ce.ACCESS_TOKEN),He=De?De.u:Ce.ACCESS_TOKEN,mt=He!==this.eventData.tokenU;I(this.anonId)||(this.anonId=v(),mt=!0);var jt=this.queue.shift();if(this.eventData.lastSuccess){var tr=new Date(this.eventData.lastSuccess),fr=new Date(jt),Or=(jt-this.eventData.lastSuccess)/(1440*60*1e3);mt=mt||Or>=1||Or<-1||tr.getDate()!==fr.getDate()}else mt=!0;if(!mt)return this.processRequests();this.postEvent(jt,{"enabled.telemetry":!1},function(en){en||(we.eventData.lastSuccess=jt,we.eventData.tokenU=He)},se)}},C})(Zr),Mt=new Br,je=Mt.postTurnstileEvent.bind(Mt),$e=new Ar,Ee=$e.postMapLoadEvent.bind($e),xe="mapbox-tiles",ye=500,Me=50,Xe=1e3*60*7,Je;function Lt(){s.caches&&!Je&&(Je=s.caches.open(xe))}var Ct;function Ot(k,C){if(Ct===void 0)try{new Response(new ReadableStream),Ct=!0}catch{Ct=!1}Ct?C(k.body):k.blob().then(C)}function Wt(k,C,X){if(Lt(),!!Je){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(He,mt){return se.headers.set(mt,He)});var we=ce(C.headers.get("Cache-Control")||"");if(!we["no-store"]){we["max-age"]&&se.headers.set("Expires",new Date(X+we["max-age"]*1e3).toUTCString());var De=new Date(se.headers.get("Expires")).getTime()-X;DeDate.now()&&!X["no-cache"]}var Fr=1/0;function En(k){Fr++,Fr>Me&&(k.getActor().send("enforceCacheSizeLimit",ye),Fr=0)}function Zn(k){Lt(),Je&&Je.then(function(C){C.keys().then(function(X){for(var se=0;se=200&&X.status<300||X.status===0)&&X.response!==null){var we=X.response;if(k.type==="json")try{we=JSON.parse(X.response)}catch(De){return C(De)}C(null,we,X.getResponseHeader("Cache-Control"),X.getResponseHeader("Expires"))}else C(new ja(X.statusText,X.status,k.url))},X.send(k.body),{cancel:function(){return X.abort()}}}var Vr=function(k,C){if(!qt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return ar(k,C);if(le()&&self.worker&&self.worker.actor){var X=!0;return self.worker.actor.send("getResource",k,C,void 0,X)}}return sr(k,C)},on=function(k,C){return Vr(_(k,{type:"json"}),C)},pn=function(k,C){return Vr(_(k,{type:"arrayBuffer"}),C)},wn=function(k,C){return Vr(_(k,{method:"POST"}),C)};function Kn(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var da="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function fa(k,C,X,se){var we=new s.Image,De=s.URL;we.onload=function(){C(null,we),De.revokeObjectURL(we.src),we.onload=null,s.requestAnimationFrame(function(){we.src=da})},we.onerror=function(){return C(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 He=new s.Blob([new Uint8Array(k)],{type:"image/png"});we.cacheControl=X,we.expires=se,we.src=k.byteLength?De.createObjectURL(He):da}function ga(k,C){var X=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(X).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var ka,Vn,hi=function(){ka=[],Vn=0};hi();var Ti=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Vn>=Ce.MAX_PARALLEL_IMAGE_REQUESTS){var X={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return ka.push(X),X}Vn++;var se=!1,we=function(){if(!se)for(se=!0,Vn--;ka.length&&Vn0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Ir.prototype.setEventedParent=function(C,X){return this._eventedParent=C,this._eventedParentData=X,this};var Ur=8,sn={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"}},Kr={"*":{type:"source"}},Tt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],or={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:"*"}},Dr={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:"*"}},ln={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:"*"}},Pn={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"}},jn={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"}}},Un={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"}}},un={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"}},Rn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],di={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ma={"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"}},Ei={"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"}},Hi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},io={"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"}},no={"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"}},bo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},li={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ts={type:"array",value:"*"},Ho={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Gs={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},cs={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Jo={type:"array",value:"*",minimum:1},Uo={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}},Xs=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],js={"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"}},ol={"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"}},fs={"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"}},Zo={"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"}},ho={"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"}},hs={"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"}},sl={"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"}},El={"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"}},Ll={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Es={"*":{type:"string"}},ci={$version:Ur,$root:sn,sources:Kr,source:Tt,source_vector:or,source_raster:Dr,source_raster_dem:ln,source_geojson:Pn,source_video:jn,source_image:Un,layer:un,layout:Rn,layout_background:di,layout_fill:Ma,layout_circle:Ei,layout_heatmap:Hi,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:io,layout_symbol:no,layout_raster:bo,layout_hillshade:li,filter:ts,filter_operator:Ho,geometry_type:Gs,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:cs,expression:Jo,light:Uo,paint:Xs,paint_fill:js,"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:ol,paint_circle:fs,paint_heatmap:Zo,paint_symbol:ho,paint_raster:hs,paint_hillshade:sl,paint_background:El,transition:Ll,"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:Es},Ji=function(C,X,se,we){this.message=(C?C+": ":"")+se,we&&(this.identifier=we),X!=null&&X.__line__&&(this.line=X.__line__)};function kl(k){var C=k.key,X=k.value;return X?[new Ji(C,X,"constants have been deprecated as of v8")]:[]}function Rs(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,we=C;se":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Vu=[_u,Ki,ms,rs,ql,zs,Vl,Ol(Po),xl];function sf(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!sf(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var X=0,se=Vu;X255?255:tr}function we(tr){return tr<0?0:tr>1?1:tr}function De(tr){return tr[tr.length-1]==="%"?se(parseFloat(tr)/100*255):se(parseInt(tr))}function He(tr){return tr[tr.length-1]==="%"?we(parseFloat(tr)/100):we(parseFloat(tr))}function mt(tr,fr,Or){return Or<0?Or+=1:Or>1&&(Or-=1),Or*6<1?tr+(fr-tr)*Or*6:Or*2<1?fr:Or*3<2?tr+(fr-tr)*(2/3-Or)*6:tr}function jt(tr){var fr=tr.replace(/ /g,"").toLowerCase();if(fr in X)return X[fr].slice();if(fr[0]==="#"){if(fr.length===4){var Or=parseInt(fr.substr(1),16);return Or>=0&&Or<=4095?[(Or&3840)>>4|(Or&3840)>>8,Or&240|(Or&240)>>4,Or&15|(Or&15)<<4,1]:null}else if(fr.length===7){var Or=parseInt(fr.substr(1),16);return Or>=0&&Or<=16777215?[(Or&16711680)>>16,(Or&65280)>>8,Or&255,1]:null}return null}var en=fr.indexOf("("),Wr=fr.indexOf(")");if(en!==-1&&Wr+1===fr.length){var _n=fr.substr(0,en),Wn=fr.substr(en+1,Wr-(en+1)).split(","),Ua=1;switch(_n){case"rgba":if(Wn.length!==4)return null;Ua=He(Wn.pop());case"rgb":return Wn.length!==3?null:[De(Wn[0]),De(Wn[1]),De(Wn[2]),Ua];case"hsla":if(Wn.length!==4)return null;Ua=He(Wn.pop());case"hsl":if(Wn.length!==3)return null;var xa=(parseFloat(Wn[0])%360+360)%360/360,vi=He(Wn[1]),$a=He(Wn[2]),fi=$a<=.5?$a*(vi+1):$a+vi-$a*vi,Ai=$a*2-fi;return[se(mt(Ai,fi,xa+1/3)*255),se(mt(Ai,fi,xa)*255),se(mt(Ai,fi,xa-1/3)*255),Ua];default:return null}}return null}try{C.parseCSSColor=jt}catch{}}),gh=Ch.parseCSSColor,bl=function(C,X,se,we){we===void 0&&(we=1),this.r=C,this.g=X,this.b=se,this.a=we};bl.parse=function(C){if(C){if(C instanceof bl)return C;if(typeof C=="string"){var X=gh(C);if(X)return new bl(X[0]/255*X[3],X[1]/255*X[3],X[2]/255*X[3],X[3])}}},bl.prototype.toString=function(){var C=this.toArray(),X=C[0],se=C[1],we=C[2],De=C[3];return"rgba("+Math.round(X)+","+Math.round(se)+","+Math.round(we)+","+De+")"},bl.prototype.toArray=function(){var C=this,X=C.r,se=C.g,we=C.b,De=C.a;return De===0?[0,0,0,0]:[X*255/De,se*255/De,we*255/De,De]},bl.black=new bl(0,0,0,1),bl.white=new bl(1,1,1,1),bl.transparent=new bl(0,0,0,0),bl.red=new bl(1,0,0,1);var Cc=function(C,X,se){C?this.sensitivity=X?"variant":"case":this.sensitivity=X?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Cc.prototype.compare=function(C,X){return this.collator.compare(C,X)},Cc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Lh=function(C,X,se,we,De){this.text=C,this.image=X,this.scale=se,this.fontStack=we,this.textColor=De},tc=function(C){this.sections=C};tc.fromString=function(C){return new tc([new Lh(C,null,null,null,null)])},tc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},tc.factory=function(C){return C instanceof tc?C:tc.fromString(C)},tc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},tc.prototype.serialize=function(){for(var C=["format"],X=0,se=this.sections;X=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof X=="number"&&X>=0&&X<=255)){var we=typeof se=="number"?[k,C,X,se]:[k,C,X];return"Invalid rgba value ["+we.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,X,se].join(", ")+"]: 'a' must be between 0 and 1."}function Jc(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof bl)return!0;if(k instanceof Cc)return!0;if(k instanceof tc)return!0;if(k instanceof Hu)return!0;if(Array.isArray(k)){for(var C=0,X=k;C2){var mt=C[1];if(typeof mt!="string"||!(mt in xf)||mt==="object")return X.error('The item type argument of "array" must be one of string, number, boolean',1);He=xf[mt],se++}else He=Po;var jt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return X.error('The length argument to "array" must be a positive integer literal',2);jt=C[2],se++}we=Ol(He,jt)}else we=xf[De];for(var tr=[];se1)&&X.push(we)}}return X.concat(this.args.map(function(De){return De.serialize()}))};var Rf=function(C){this.type=zs,this.sections=C};Rf.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return X.error("First argument must be an image or text section.");for(var we=[],De=!1,He=1;He<=C.length-1;++He){var mt=C[He];if(De&&typeof mt=="object"&&!Array.isArray(mt)){De=!1;var jt=null;if(mt["font-scale"]&&(jt=X.parse(mt["font-scale"],1,Ki),!jt))return null;var tr=null;if(mt["text-font"]&&(tr=X.parse(mt["text-font"],1,Ol(ms)),!tr))return null;var fr=null;if(mt["text-color"]&&(fr=X.parse(mt["text-color"],1,ql),!fr))return null;var Or=we[we.length-1];Or.scale=jt,Or.font=tr,Or.textColor=fr}else{var en=X.parse(C[He],1,Po);if(!en)return null;var Wr=en.type.kind;if(Wr!=="string"&&Wr!=="value"&&Wr!=="null"&&Wr!=="resolvedImage")return X.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");De=!0,we.push({content:en,scale:null,font:null,textColor:null})}}return new Rf(we)},Rf.prototype.evaluate=function(C){var X=function(se){var we=se.content.evaluate(C);return Zl(we)===xl?new Lh("",we,null,null,null):new Lh(Gu(we),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new tc(this.sections.map(X))},Rf.prototype.eachChild=function(C){for(var X=0,se=this.sections;X-1),se},su.prototype.eachChild=function(C){C(this.input)},su.prototype.outputDefined=function(){return!1},su.prototype.serialize=function(){return["image",this.input.serialize()]};var xv={"to-boolean":rs,"to-color":ql,"to-number":Ki,"to-string":ms},Os=function(C,X){this.type=C,this.args=X};Os.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return X.error("Expected one argument.");for(var we=xv[se],De=[],He=1;He4?se="Invalid rbga value "+JSON.stringify(X)+": expected an array containing either three or four numeric values.":se=rc(X[0],X[1],X[2],X[3]),!se))return new bl(X[0]/255,X[1]/255,X[2]/255,X[3])}throw new Rl(se||"Could not parse color from value '"+(typeof X=="string"?X:String(JSON.stringify(X)))+"'")}else if(this.type.kind==="number"){for(var jt=null,tr=0,fr=this.args;tr=C[2]||k[1]<=C[1]||k[3]>=C[3])}function ov(k,C){var X=If(k[0]),se=ah(k[1]),we=Math.pow(2,C.z);return[Math.round(X*we*Ru),Math.round(se*we*Ru)]}function Nh(k,C,X){var se=k[0]-C[0],we=k[1]-C[1],De=k[0]-X[0],He=k[1]-X[1];return se*He-De*we===0&&se*De<=0&&we*He<=0}function ih(k,C,X){return C[1]>k[1]!=X[1]>k[1]&&k[0]<(X[0]-C[0])*(k[1]-C[1])/(X[1]-C[1])+C[0]}function Df(k,C){for(var X=!1,se=0,we=C.length;se0&&Or<0||fr<0&&Or>0}function Uh(k,C,X,se){var we=[C[0]-k[0],C[1]-k[1]],De=[se[0]-X[0],se[1]-X[1]];return Ih(De,we)===0?!1:!!(ef(k,C,X,se)&&ef(X,se,k,C))}function bf(k,C,X){for(var se=0,we=X;seX[2]){var we=se*.5,De=k[0]-X[0]>we?-se:X[0]-k[0]>we?se:0;De===0&&(De=k[0]-X[2]>we?-se:X[2]-k[0]>we?se:0),k[0]+=De}Ph(C,k)}function yh(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function bv(k,C,X,se){for(var we=Math.pow(2,se.z)*Ru,De=[se.x*Ru,se.y*Ru],He=[],mt=0,jt=k;mt=0)return!1;var X=!0;return k.eachChild(function(se){X&&!Pc(se,C)&&(X=!1)}),X}var zf=function(C,X){this.type=X.type,this.name=C,this.boundExpression=X};zf.parse=function(C,X){if(C.length!==2||typeof C[1]!="string")return X.error("'var' expression requires exactly one string literal argument.");var se=C[1];return X.scope.has(se)?new zf(se,X.scope.get(se)):X.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},zf.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},zf.prototype.eachChild=function(){},zf.prototype.outputDefined=function(){return!1},zf.prototype.serialize=function(){return["var",this.name]};var Wl=function(C,X,se,we,De){X===void 0&&(X=[]),we===void 0&&(we=new ll),De===void 0&&(De=[]),this.registry=C,this.path=X,this.key=X.map(function(He){return"["+He+"]"}).join(""),this.scope=we,this.errors=De,this.expectedType=se};Wl.prototype.parse=function(C,X,se,we,De){return De===void 0&&(De={}),X?this.concat(X,se,we)._parse(C,De):this._parse(C,De)},Wl.prototype._parse=function(C,X){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(fr,Or,en){return en==="assert"?new gc(Or,[fr]):en==="coerce"?new Os(Or,[fr]):fr}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var we=C[0];if(typeof we!="string")return this.error("Expression name must be a string, but found "+typeof we+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var De=this.registry[we];if(De){var He=De.parse(C,this);if(!He)return null;if(this.expectedType){var mt=this.expectedType,jt=He.type;if((mt.kind==="string"||mt.kind==="number"||mt.kind==="boolean"||mt.kind==="object"||mt.kind==="array")&&jt.kind==="value")He=se(He,mt,X.typeAnnotation||"assert");else if((mt.kind==="color"||mt.kind==="formatted"||mt.kind==="resolvedImage")&&(jt.kind==="value"||jt.kind==="string"))He=se(He,mt,X.typeAnnotation||"coerce");else if(this.checkSubtype(mt,jt))return null}if(!(He instanceof qs)&&He.type.kind!=="resolvedImage"&&wf(He)){var tr=new vl;try{He=new qs(He.type,He.evaluate(tr))}catch(fr){return this.error(fr.message),null}}return He}return this.error('Unknown expression "'+we+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},Wl.prototype.concat=function(C,X,se){var we=typeof C=="number"?this.path.concat(C):this.path,De=se?this.scope.concat(se):this.scope;return new Wl(this.registry,we,X||null,De,this.errors)},Wl.prototype.error=function(C){for(var X=[],se=arguments.length-1;se-- >0;)X[se]=arguments[se+1];var we=""+this.key+X.map(function(De){return"["+De+"]"}).join("");this.errors.push(new Ys(we,C))},Wl.prototype.checkSubtype=function(C,X){var se=sf(C,X);return se&&this.error(se),se};function wf(k){if(k instanceof zf)return wf(k.boundExpression);if(k instanceof Do&&k.name==="error")return!1;if(k instanceof Qc)return!1;if(k instanceof Lc)return!1;var C=k instanceof Os||k instanceof gc,X=!0;return k.eachChild(function(se){C?X=X&&wf(se):X=X&&se instanceof qs}),X?Vh(k)&&Pc(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function hc(k,C){for(var X=k.length-1,se=0,we=X,De=0,He,mt;se<=we;)if(De=Math.floor((se+we)/2),He=k[De],mt=k[De+1],He<=C){if(De===X||CC)we=De-1;else throw new Rl("Input is not a number.");return 0}var Rc=function(C,X,se){this.type=C,this.input=X,this.labels=[],this.outputs=[];for(var we=0,De=se;we=mt)return X.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',tr);var Or=X.parse(jt,fr,De);if(!Or)return null;De=De||Or.type,we.push([mt,Or])}return new Rc(De,se,we)},Rc.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var we=this.input.evaluate(C);if(we<=X[0])return se[0].evaluate(C);var De=X.length;if(we>=X[De-1])return se[De-1].evaluate(C);var He=hc(X,we);return se[He].evaluate(C)},Rc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X0&&C.push(this.labels[X]),C.push(this.outputs[X].serialize());return C};function lu(k,C,X){return k*(1-X)+C*X}function Kf(k,C,X){return new bl(lu(k.r,C.r,X),lu(k.g,C.g,X),lu(k.b,C.b,X),lu(k.a,C.a,X))}function uf(k,C,X){return k.map(function(se,we){return lu(se,C[we],X)})}var Of=Object.freeze({__proto__:null,number:lu,color:Kf,array:uf}),_h=.95047,wv=1,Yv=1.08883,$f=4/29,xh=6/29,qc=3*xh*xh,bh=xh*xh*xh,nc=Math.PI/180,Jf=180/Math.PI;function Hh(k){return k>bh?Math.pow(k,1/3):k/qc+$f}function Qf(k){return k>xh?k*k*k:qc*(k-$f)}function Ql(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Ic(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function tf(k){var C=Ic(k.r),X=Ic(k.g),se=Ic(k.b),we=Hh((.4124564*C+.3575761*X+.1804375*se)/_h),De=Hh((.2126729*C+.7151522*X+.072175*se)/wv),He=Hh((.0193339*C+.119192*X+.9503041*se)/Yv);return{l:116*De-16,a:500*(we-De),b:200*(De-He),alpha:k.a}}function zh(k){var C=(k.l+16)/116,X=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=wv*Qf(C),X=_h*Qf(X),se=Yv*Qf(se),new bl(Ql(3.2404542*X-1.5371385*C-.4985314*se),Ql(-.969266*X+1.8760108*C+.041556*se),Ql(.0556434*X-.2040259*C+1.0572252*se),k.alpha)}function au(k,C,X){return{l:lu(k.l,C.l,X),a:lu(k.a,C.a,X),b:lu(k.b,C.b,X),alpha:lu(k.alpha,C.alpha,X)}}function sh(k){var C=tf(k),X=C.l,se=C.a,we=C.b,De=Math.atan2(we,se)*Jf;return{h:De<0?De+360:De,c:Math.sqrt(se*se+we*we),l:X,alpha:k.a}}function Ff(k){var C=k.h*nc,X=k.c,se=k.l;return zh({l:se,a:Math.cos(C)*X,b:Math.sin(C)*X,alpha:k.alpha})}function Vc(k,C,X){var se=C-k;return k+X*(se>180||se<-180?se-360*Math.round(se/360):se)}function lh(k,C,X){return{h:Vc(k.h,C.h,X),c:lu(k.c,C.c,X),l:lu(k.l,C.l,X),alpha:lu(k.alpha,C.alpha,X)}}var cf={forward:tf,reverse:zh,interpolate:au},uh={forward:sh,reverse:Ff,interpolate:lh},Tv=Object.freeze({__proto__:null,lab:cf,hcl:uh}),oc=function(C,X,se,we,De){this.type=C,this.operator=X,this.interpolation=se,this.input=we,this.labels=[],this.outputs=[];for(var He=0,mt=De;He1}))return X.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);we={name:"cubic-bezier",controlPoints:jt}}else return X.error("Unknown interpolation type "+String(we[0]),1,0);if(C.length-1<4)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return X.error("Expected an even number of arguments.");if(De=X.parse(De,2,Ki),!De)return null;var tr=[],fr=null;se==="interpolate-hcl"||se==="interpolate-lab"?fr=ql:X.expectedType&&X.expectedType.kind!=="value"&&(fr=X.expectedType);for(var Or=0;Or=en)return X.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',_n);var Ua=X.parse(Wr,Wn,fr);if(!Ua)return null;fr=fr||Ua.type,tr.push([en,Ua])}return fr.kind!=="number"&&fr.kind!=="color"&&!(fr.kind==="array"&&fr.itemType.kind==="number"&&typeof fr.N=="number")?X.error("Type "+Nl(fr)+" is not interpolatable."):new oc(fr,se,we,De,tr)},oc.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var we=this.input.evaluate(C);if(we<=X[0])return se[0].evaluate(C);var De=X.length;if(we>=X[De-1])return se[De-1].evaluate(C);var He=hc(X,we),mt=X[He],jt=X[He+1],tr=oc.interpolationFactor(this.interpolation,we,mt,jt),fr=se[He].evaluate(C),Or=se[He+1].evaluate(C);return this.operator==="interpolate"?Of[this.type.kind.toLowerCase()](fr,Or,tr):this.operator==="interpolate-hcl"?uh.reverse(uh.interpolate(uh.forward(fr),uh.forward(Or),tr)):cf.reverse(cf.interpolate(cf.forward(fr),cf.forward(Or),tr))},oc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X=se.length)throw new Rl("Array index out of bounds: "+X+" > "+(se.length-1)+".");if(X!==Math.floor(X))throw new Rl("Array index must be an integer, but found "+X+" instead.");return se[X]},ff.prototype.eachChild=function(C){C(this.index),C(this.input)},ff.prototype.outputDefined=function(){return!1},ff.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xu=function(C,X){this.type=rs,this.needle=C,this.haystack=X};xu.parse=function(C,X){if(C.length!==3)return X.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Po),we=X.parse(C[2],2,Po);return!se||!we?null:jc(se.type,[rs,ms,Ki,_u,Po])?new xu(se,we):X.error("Expected first argument to be of type boolean, string, number or null, but found "+Nl(se.type)+" instead")},xu.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!$c(X,["boolean","string","number","null"]))throw new Rl("Expected first argument to be of type boolean, string, number or null, but found "+Nl(Zl(X))+" instead.");if(!$c(se,["string","array"]))throw new Rl("Expected second argument to be of type array or string, but found "+Nl(Zl(se))+" instead.");return se.indexOf(X)>=0},xu.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},xu.prototype.outputDefined=function(){return!0},xu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var yc=function(C,X,se){this.type=Ki,this.needle=C,this.haystack=X,this.fromIndex=se};yc.parse=function(C,X){if(C.length<=2||C.length>=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Po),we=X.parse(C[2],2,Po);if(!se||!we)return null;if(!jc(se.type,[rs,ms,Ki,_u,Po]))return X.error("Expected first argument to be of type boolean, string, number or null, but found "+Nl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ki);return De?new yc(se,we,De):null}else return new yc(se,we)},yc.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!$c(X,["boolean","string","number","null"]))throw new Rl("Expected first argument to be of type boolean, string, number or null, but found "+Nl(Zl(X))+" instead.");if(!$c(se,["string","array"]))throw new Rl("Expected second argument to be of type array or string, but found "+Nl(Zl(se))+" instead.");if(this.fromIndex){var we=this.fromIndex.evaluate(C);return se.indexOf(X,we)}return se.indexOf(X)},yc.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},yc.prototype.outputDefined=function(){return!1},yc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var fu=function(C,X,se,we,De,He){this.inputType=C,this.type=X,this.input=se,this.cases=we,this.outputs=De,this.otherwise=He};fu.parse=function(C,X){if(C.length<5)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return X.error("Expected an even number of arguments.");var se,we;X.expectedType&&X.expectedType.kind!=="value"&&(we=X.expectedType);for(var De={},He=[],mt=2;mtNumber.MAX_SAFE_INTEGER)return fr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Wr=="number"&&Math.floor(Wr)!==Wr)return fr.error("Numeric branch labels must be integer values.");if(!se)se=Zl(Wr);else if(fr.checkSubtype(se,Zl(Wr)))return null;if(typeof De[String(Wr)]<"u")return fr.error("Branch labels must be unique.");De[String(Wr)]=He.length}var _n=X.parse(tr,mt,we);if(!_n)return null;we=we||_n.type,He.push(_n)}var Wn=X.parse(C[1],1,Po);if(!Wn)return null;var Ua=X.parse(C[C.length-1],C.length-1,we);return!Ua||Wn.type.kind!=="value"&&X.concat(1).checkSubtype(se,Wn.type)?null:new fu(se,we,Wn,De,He,Ua)},fu.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=Zl(X)===this.inputType&&this.outputs[this.cases[X]]||this.otherwise;return se.evaluate(C)},fu.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},fu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},fu.prototype.serialize=function(){for(var C=this,X=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),we=[],De={},He=0,mt=se;He=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Po),we=X.parse(C[2],2,Ki);if(!se||!we)return null;if(!jc(se.type,[Ol(Po),ms,Po]))return X.error("Expected first argument to be of type array or string, but found "+Nl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Ki);return De?new hf(se.type,se,we,De):null}else return new hf(se.type,se,we)},hf.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!$c(X,["string","array"]))throw new Rl("Expected first argument to be of type array or string, but found "+Nl(Zl(X))+" instead.");if(this.endIndex){var we=this.endIndex.evaluate(C);return X.slice(se,we)}return X.slice(se)},hf.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},hf.prototype.outputDefined=function(){return!1},hf.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Oh(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function ur(k,C,X){return C===X}function Pr(k,C,X){return C!==X}function vn(k,C,X){return CX}function On(k,C,X){return C<=X}function Ta(k,C,X){return C>=X}function ya(k,C,X,se){return se.compare(C,X)===0}function ei(k,C,X,se){return!ya(k,C,X,se)}function si(k,C,X,se){return se.compare(C,X)<0}function Bi(k,C,X,se){return se.compare(C,X)>0}function Va(k,C,X,se){return se.compare(C,X)<=0}function _i(k,C,X,se){return se.compare(C,X)>=0}function Ja(k,C,X){var se=k!=="=="&&k!=="!=";return(function(){function we(De,He,mt){this.type=rs,this.lhs=De,this.rhs=He,this.collator=mt,this.hasUntypedArgument=De.type.kind==="value"||He.type.kind==="value"}return we.parse=function(He,mt){if(He.length!==3&&He.length!==4)return mt.error("Expected two or three arguments.");var jt=He[0],tr=mt.parse(He[1],1,Po);if(!tr)return null;if(!Oh(jt,tr.type))return mt.concat(1).error('"'+jt+`" comparisons are not supported for type '`+Nl(tr.type)+"'.");var fr=mt.parse(He[2],2,Po);if(!fr)return null;if(!Oh(jt,fr.type))return mt.concat(2).error('"'+jt+`" comparisons are not supported for type '`+Nl(fr.type)+"'.");if(tr.type.kind!==fr.type.kind&&tr.type.kind!=="value"&&fr.type.kind!=="value")return mt.error("Cannot compare types '"+Nl(tr.type)+"' and '"+Nl(fr.type)+"'.");se&&(tr.type.kind==="value"&&fr.type.kind!=="value"?tr=new gc(fr.type,[tr]):tr.type.kind!=="value"&&fr.type.kind==="value"&&(fr=new gc(tr.type,[fr])));var Or=null;if(He.length===4){if(tr.type.kind!=="string"&&fr.type.kind!=="string"&&tr.type.kind!=="value"&&fr.type.kind!=="value")return mt.error("Cannot use collator to compare non-string types.");if(Or=mt.parse(He[3],3,cu),!Or)return null}return new we(tr,fr,Or)},we.prototype.evaluate=function(He){var mt=this.lhs.evaluate(He),jt=this.rhs.evaluate(He);if(se&&this.hasUntypedArgument){var tr=Zl(mt),fr=Zl(jt);if(tr.kind!==fr.kind||!(tr.kind==="string"||tr.kind==="number"))throw new Rl('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+tr.kind+", "+fr.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var Or=Zl(mt),en=Zl(jt);if(Or.kind!=="string"||en.kind!=="string")return C(He,mt,jt)}return this.collator?X(He,mt,jt,this.collator.evaluate(He)):C(He,mt,jt)},we.prototype.eachChild=function(He){He(this.lhs),He(this.rhs),this.collator&&He(this.collator)},we.prototype.outputDefined=function(){return!0},we.prototype.serialize=function(){var He=[k];return this.eachChild(function(mt){He.push(mt.serialize())}),He},we})()}var Ba=Ja("==",ur,ya),Gi=Ja("!=",Pr,ei),No=Ja("<",vn,si),Ro=Ja(">",rn,Bi),Go=Ja("<=",On,Va),jo=Ja(">=",Ta,_i),Yi=function(C,X,se,we,De){this.type=ms,this.number=C,this.locale=X,this.currency=se,this.minFractionDigits=we,this.maxFractionDigits=De};Yi.parse=function(C,X){if(C.length!==3)return X.error("Expected two arguments.");var se=X.parse(C[1],1,Ki);if(!se)return null;var we=C[2];if(typeof we!="object"||Array.isArray(we))return X.error("NumberFormat options argument must be an object.");var De=null;if(we.locale&&(De=X.parse(we.locale,1,ms),!De))return null;var He=null;if(we.currency&&(He=X.parse(we.currency,1,ms),!He))return null;var mt=null;if(we["min-fraction-digits"]&&(mt=X.parse(we["min-fraction-digits"],1,Ki),!mt))return null;var jt=null;return we["max-fraction-digits"]&&(jt=X.parse(we["max-fraction-digits"],1,Ki),!jt)?null:new Yi(se,De,He,mt,jt)},Yi.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},Yi.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},Yi.prototype.outputDefined=function(){return!1},Yi.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var ki=function(C){this.type=Ki,this.input=C};ki.parse=function(C,X){if(C.length!==2)return X.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?X.error("Expected argument of type string or array, but found "+Nl(se.type)+" instead."):new ki(se):null},ki.prototype.evaluate=function(C){var X=this.input.evaluate(C);if(typeof X=="string")return X.length;if(Array.isArray(X))return X.length;throw new Rl("Expected value to be of type string or array, but found "+Nl(Zl(X))+" instead.")},ki.prototype.eachChild=function(C){C(this.input)},ki.prototype.outputDefined=function(){return!1},ki.prototype.serialize=function(){var C=["length"];return this.eachChild(function(X){C.push(X.serialize())}),C};var ns={"==":Ba,"!=":Gi,">":Ro,"<":No,">=":jo,"<=":Go,array:gc,at:ff,boolean:gc,case:Bf,coalesce:Hc,collator:Qc,format:Rf,image:su,in:xu,"index-of":yc,interpolate:oc,"interpolate-hcl":oc,"interpolate-lab":oc,length:ki,let:Tf,literal:qs,match:fu,number:gc,"number-format":Yi,object:gc,slice:hf,step:Rc,string:gc,"to-boolean":Os,"to-color":Os,"to-number":Os,"to-string":Os,var:zf,within:Lc};function Fs(k,C){var X=C[0],se=C[1],we=C[2],De=C[3];X=X.evaluate(k),se=se.evaluate(k),we=we.evaluate(k);var He=De?De.evaluate(k):1,mt=rc(X,se,we,He);if(mt)throw new Rl(mt);return new bl(X/255*He,se/255*He,we/255*He,He)}function wl(k,C){return k in C}function Hl(k,C){var X=C[k];return typeof X>"u"?null:X}function Sl(k,C,X,se){for(;X<=se;){var we=X+se>>1;if(C[we]===k)return!0;C[we]>k?se=we-1:X=we+1}return!1}function Gl(k){return{type:k}}Do.register(ns,{error:[ou,[ms],function(k,C){var X=C[0];throw new Rl(X.evaluate(k))}],typeof:[ms,[Po],function(k,C){var X=C[0];return Nl(Zl(X.evaluate(k)))}],"to-rgba":[Ol(Ki,4),[ql],function(k,C){var X=C[0];return X.evaluate(k).toArray()}],rgb:[ql,[Ki,Ki,Ki],Fs],rgba:[ql,[Ki,Ki,Ki,Ki],Fs],has:{type:rs,overloads:[[[ms],function(k,C){var X=C[0];return wl(X.evaluate(k),k.properties())}],[[ms,Vl],function(k,C){var X=C[0],se=C[1];return wl(X.evaluate(k),se.evaluate(k))}]]},get:{type:Po,overloads:[[[ms],function(k,C){var X=C[0];return Hl(X.evaluate(k),k.properties())}],[[ms,Vl],function(k,C){var X=C[0],se=C[1];return Hl(X.evaluate(k),se.evaluate(k))}]]},"feature-state":[Po,[ms],function(k,C){var X=C[0];return Hl(X.evaluate(k),k.featureState||{})}],properties:[Vl,[],function(k){return k.properties()}],"geometry-type":[ms,[],function(k){return k.geometryType()}],id:[Po,[],function(k){return k.id()}],zoom:[Ki,[],function(k){return k.globals.zoom}],"heatmap-density":[Ki,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Ki,[],function(k){return k.globals.lineProgress||0}],accumulated:[Po,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Ki,Gl(Ki),function(k,C){for(var X=0,se=0,we=C;se":[rs,[ms,Po],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we>De}],"filter-id->":[rs,[Po],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se>we}],"filter-<=":[rs,[ms,Po],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we<=De}],"filter-id-<=":[rs,[Po],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se<=we}],"filter->=":[rs,[ms,Po],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we>=De}],"filter-id->=":[rs,[Po],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se>=we}],"filter-has":[rs,[Po],function(k,C){var X=C[0];return X.value in k.properties()}],"filter-has-id":[rs,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[rs,[Ol(ms)],function(k,C){var X=C[0];return X.value.indexOf(k.geometryType())>=0}],"filter-id-in":[rs,[Ol(Po)],function(k,C){var X=C[0];return X.value.indexOf(k.id())>=0}],"filter-in-small":[rs,[ms,Ol(Po)],function(k,C){var X=C[0],se=C[1];return se.value.indexOf(k.properties()[X.value])>=0}],"filter-in-large":[rs,[ms,Ol(Po)],function(k,C){var X=C[0],se=C[1];return Sl(k.properties()[X.value],se.value,0,se.value.length-1)}],all:{type:rs,overloads:[[[rs,rs],function(k,C){var X=C[0],se=C[1];return X.evaluate(k)&&se.evaluate(k)}],[Gl(rs),function(k,C){for(var X=0,se=C;X-1}function po(k){return!!k.expression&&k.expression.interpolated}function gs(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function Il(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function dl(k){return k}function vc(k,C){var X=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",we=se||k.property!==void 0,De=se||!we,He=k.type||(po(C)?"exponential":"interval");if(X&&(k=Rs({},k),k.stops&&(k.stops=k.stops.map(function(vo){return[vo[0],bl.parse(vo[1])]})),k.default?k.default=bl.parse(k.default):k.default=bl.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Tv[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var mt,jt,tr;if(He==="exponential")mt=pc;else if(He==="interval")mt=Hf;else if(He==="categorical"){mt=_c,jt=Object.create(null);for(var fr=0,Or=k.stops;fr=k.stops[se-1][0])return k.stops[se-1][1];var we=hc(k.stops.map(function(De){return De[0]}),X);return k.stops[we][1]}function pc(k,C,X){var se=k.base!==void 0?k.base:1;if(gs(X)!=="number")return dc(k.default,C.default);var we=k.stops.length;if(we===1||X<=k.stops[0][0])return k.stops[0][1];if(X>=k.stops[we-1][0])return k.stops[we-1][1];var De=hc(k.stops.map(function(Or){return Or[0]}),X),He=Mu(X,se,k.stops[De][0],k.stops[De+1][0]),mt=k.stops[De][1],jt=k.stops[De+1][1],tr=Of[C.type]||dl;if(k.colorSpace&&k.colorSpace!=="rgb"){var fr=Tv[k.colorSpace];tr=function(Or,en){return fr.reverse(fr.interpolate(fr.forward(Or),fr.forward(en),He))}}return typeof mt.evaluate=="function"?{evaluate:function(){for(var en=[],Wr=arguments.length;Wr--;)en[Wr]=arguments[Wr];var _n=mt.evaluate.apply(void 0,en),Wn=jt.evaluate.apply(void 0,en);if(!(_n===void 0||Wn===void 0))return tr(_n,Wn,He)}}:tr(mt,jt,He)}function Af(k,C,X){return C.type==="color"?X=bl.parse(X):C.type==="formatted"?X=tc.fromString(X.toString()):C.type==="resolvedImage"?X=Hu.fromString(X.toString()):gs(X)!==C.type&&(C.type!=="enum"||!C.values[X])&&(X=void 0),dc(X,k.default,C.default)}function Mu(k,C,X,se){var we=se-X,De=k-X;return we===0?0:C===1?De/we:(Math.pow(C,De)-1)/(Math.pow(C,we)-1)}var Sf=function(C,X){this.expression=C,this._warningHistory={},this._evaluator=new vl,this._defaultValue=X?ke(X):null,this._enumValues=X&&X.type==="enum"?X.values:null};Sf.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._evaluator.globals=C,this._evaluator.feature=X,this._evaluator.featureState=se,this._evaluator.canonical=we,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He,this.expression.evaluate(this._evaluator)},Sf.prototype.evaluate=function(C,X,se,we,De,He){this._evaluator.globals=C,this._evaluator.feature=X||null,this._evaluator.featureState=se||null,this._evaluator.canonical=we,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He||null;try{var mt=this.expression.evaluate(this._evaluator);if(mt==null||typeof mt=="number"&&mt!==mt)return this._defaultValue;if(this._enumValues&&!(mt in this._enumValues))throw new Rl("Expected value to be one of "+Object.keys(this._enumValues).map(function(jt){return JSON.stringify(jt)}).join(", ")+", but found "+JSON.stringify(mt)+" instead.");return mt}catch(jt){return this._warningHistory[jt.message]||(this._warningHistory[jt.message]=!0,typeof console<"u"&&console.warn(jt.message)),this._defaultValue}};function Xo(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in ns}function as(k,C){var X=new Wl(ns,[],C?Se(C):void 0),se=X.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?el(new Sf(se,C)):Su(X.errors)}var Mf=function(C,X){this.kind=C,this._styleExpression=X,this.isStateDependent=C!=="constant"&&!gu(X.expression)};Mf.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,we,De,He)},Mf.prototype.evaluate=function(C,X,se,we,De,He){return this._styleExpression.evaluate(C,X,se,we,De,He)};var Gc=function(C,X,se,we){this.kind=C,this.zoomStops=se,this._styleExpression=X,this.isStateDependent=C!=="camera"&&!gu(X.expression),this.interpolationType=we};Gc.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,we,De,He)},Gc.prototype.evaluate=function(C,X,se,we,De,He){return this._styleExpression.evaluate(C,X,se,we,De,He)},Gc.prototype.interpolationFactor=function(C,X,se){return this.interpolationType?oc.interpolationFactor(this.interpolationType,C,X,se):0};function Dc(k,C){if(k=as(k,C),k.result==="error")return k;var X=k.value.expression,se=Vh(X);if(!se&&!bu(C))return Su([new Ys("","data expressions not supported")]);var we=Pc(X,["zoom"]);if(!we&&!Ul(C))return Su([new Ys("","zoom expressions not supported")]);var De=oe(X);if(!De&&!we)return Su([new Ys("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(De instanceof Ys)return Su([De]);if(De instanceof oc&&!po(C))return Su([new Ys("",'"interpolate" expressions cannot be used with this property')]);if(!De)return el(se?new Mf("constant",k.value):new Mf("source",k.value));var He=De instanceof oc?De.interpolation:void 0;return el(se?new Gc("camera",k.value,De.labels,He):new Gc("composite",k.value,De.labels,He))}var Ue=function(C,X){this._parameters=C,this._specification=X,Rs(this,vc(this._parameters,this._specification))};Ue.deserialize=function(C){return new Ue(C._parameters,C._specification)},Ue.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function P(k,C){if(Il(k))return new Ue(k,C);if(Xo(k)){var X=Dc(k,C);if(X.result==="error")throw new Error(X.value.map(function(we){return we.key+": "+we.message}).join(", "));return X.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=bl.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function oe(k){var C=null;if(k instanceof Tf)C=oe(k.result);else if(k instanceof Hc)for(var X=0,se=k.args;Xse.maximum?[new Ji(C,X,X+" is greater than the maximum value "+se.maximum)]:[]}function Gt(k){var C=k.valueSpec,X=zo(k.value.type),se,we={},De,He,mt=X!=="categorical"&&k.value.property===void 0,jt=!mt,tr=gs(k.value.stops)==="array"&&gs(k.value.stops[0])==="array"&&gs(k.value.stops[0][0])==="object",fr=Be({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Or,default:_n}});return X==="identity"&&mt&&fr.push(new Ji(k.key,k.value,'missing required property "property"')),X!=="identity"&&!k.value.stops&&fr.push(new Ji(k.key,k.value,'missing required property "stops"')),X==="exponential"&&k.valueSpec.expression&&!po(k.valueSpec)&&fr.push(new Ji(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(jt&&!bu(k.valueSpec)?fr.push(new Ji(k.key,k.value,"property functions not supported")):mt&&!Ul(k.valueSpec)&&fr.push(new Ji(k.key,k.value,"zoom functions not supported"))),(X==="categorical"||tr)&&k.value.property===void 0&&fr.push(new Ji(k.key,k.value,'"property" property is required')),fr;function Or(Wn){if(X==="identity")return[new Ji(Wn.key,Wn.value,'identity function may not have a "stops" property')];var Ua=[],xa=Wn.value;return Ua=Ua.concat(gt({key:Wn.key,value:xa,valueSpec:Wn.valueSpec,style:Wn.style,styleSpec:Wn.styleSpec,arrayElementValidator:en})),gs(xa)==="array"&&xa.length===0&&Ua.push(new Ji(Wn.key,xa,"array must have at least one stop")),Ua}function en(Wn){var Ua=[],xa=Wn.value,vi=Wn.key;if(gs(xa)!=="array")return[new Ji(vi,xa,"array expected, "+gs(xa)+" found")];if(xa.length!==2)return[new Ji(vi,xa,"array length 2 expected, length "+xa.length+" found")];if(tr){if(gs(xa[0])!=="object")return[new Ji(vi,xa,"object expected, "+gs(xa[0])+" found")];if(xa[0].zoom===void 0)return[new Ji(vi,xa,"object stop key must have zoom")];if(xa[0].value===void 0)return[new Ji(vi,xa,"object stop key must have value")];if(He&&He>zo(xa[0].zoom))return[new Ji(vi,xa[0].zoom,"stop zoom values must appear in ascending order")];zo(xa[0].zoom)!==He&&(He=zo(xa[0].zoom),De=void 0,we={}),Ua=Ua.concat(Be({key:vi+"[0]",value:xa[0],valueSpec:{zoom:{}},style:Wn.style,styleSpec:Wn.styleSpec,objectElementValidators:{zoom:kt,value:Wr}}))}else Ua=Ua.concat(Wr({key:vi+"[0]",value:xa[0],style:Wn.style,styleSpec:Wn.styleSpec},xa));return Xo(Pl(xa[1]))?Ua.concat([new Ji(vi+"[1]",xa[1],"expressions are not allowed in function stops.")]):Ua.concat($s({key:vi+"[1]",value:xa[1],valueSpec:C,style:Wn.style,styleSpec:Wn.styleSpec}))}function Wr(Wn,Ua){var xa=gs(Wn.value),vi=zo(Wn.value),$a=Wn.value!==null?Wn.value:Ua;if(!se)se=xa;else if(xa!==se)return[new Ji(Wn.key,$a,xa+" stop domain type must match previous stop domain type "+se)];if(xa!=="number"&&xa!=="string"&&xa!=="boolean")return[new Ji(Wn.key,$a,"stop domain value must be a number, string, or boolean")];if(xa!=="number"&&X!=="categorical"){var fi="number expected, "+xa+" found";return bu(C)&&X===void 0&&(fi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ji(Wn.key,$a,fi)]}return X==="categorical"&&xa==="number"&&(!isFinite(vi)||Math.floor(vi)!==vi)?[new Ji(Wn.key,$a,"integer expected, found "+vi)]:X!=="categorical"&&xa==="number"&&De!==void 0&&vi=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,X=k.slice(1);CC?1:0}function _t(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?Et(k[1],k[2],C):C==="any"?Ut(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(zt)):C==="none"?["all"].concat(k.slice(1).map(zt).map(Lr)):C==="in"?mr(k[1],k.slice(2)):C==="!in"?Lr(mr(k[1],k.slice(2))):C==="has"?wr(k[1]):C==="!has"?Lr(wr(k[1])):C==="within"?k:!0;return X}function Et(k,C,X){switch(k){case"$type":return["filter-type-"+X,C];case"$id":return["filter-id-"+X,C];default:return["filter-"+X,k,C]}}function Ut(k){return["any"].concat(k.map(zt))}function mr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(X){return typeof X!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(ft)]]:["filter-in-small",k,["literal",C]]}}function wr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function Lr(k){return["!",k]}function Gr(k){return yn(Pl(k.value))?cr(Rs({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):an(k)}function an(k){var C=k.value,X=k.key;if(gs(C)!=="array")return[new Ji(X,C,"array expected, "+gs(C)+" found")];var se=k.styleSpec,we,De=[];if(C.length<1)return[new Ji(X,C,"filter array must have at least 1 element")];switch(De=De.concat(Qr({key:X+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),zo(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&zo(C[1])==="$type"&&De.push(new Ji(X,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&De.push(new Ji(X,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(we=gs(C[1]),we!=="string"&&De.push(new Ji(X+"[1]",C[1],"string expected, "+we+" found")));for(var He=2;He=fr[Wr+0]&&se>=fr[Wr+1])?(He[en]=!0,De.push(tr[en])):He[en]=!1}}},tt.prototype._forEachCell=function(k,C,X,se,we,De,He,mt){for(var jt=this._convertToCellCoord(k),tr=this._convertToCellCoord(C),fr=this._convertToCellCoord(X),Or=this._convertToCellCoord(se),en=jt;en<=fr;en++)for(var Wr=tr;Wr<=Or;Wr++){var _n=this.d*Wr+en;if(!(mt&&!mt(this._convertFromCellCoord(en),this._convertFromCellCoord(Wr),this._convertFromCellCoord(en+1),this._convertFromCellCoord(Wr+1)))&&we.call(this,k,C,X,se,_n,De,He,mt))return}},tt.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},tt.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},tt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Oe+this.cells.length+1+1,X=0,se=0;se=0)){var Or=k[fr];tr[fr]=It[jt].shallow.indexOf(fr)>=0?Or:Hr(Or,C)}k instanceof Error&&(tr.message=k.message)}if(tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return jt!=="Object"&&(tr.$name=jt),tr}throw new Error("can't serialize object of type "+typeof k)}function fn(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||yr(k)||Xr(k)||ArrayBuffer.isView(k)||k instanceof xt)return k;if(Array.isArray(k))return k.map(fn);if(typeof k=="object"){var C=k.$name||"Object",X=It[C],se=X.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var we=Object.create(se.prototype),De=0,He=Object.keys(k);De=0?jt:fn(jt)}}return we}throw new Error("can't deserialize object of type "+typeof k)}var Sn=function(){this.first=!0};Sn.prototype.update=function(C,X){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=X):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function Ca(k){for(var C=0,X=k;C=65097&&k<=65103)||kn["CJK Compatibility Ideographs"](k)||kn["CJK Compatibility"](k)||kn["CJK Radicals Supplement"](k)||kn["CJK Strokes"](k)||kn["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||kn["CJK Unified Ideographs Extension A"](k)||kn["CJK Unified Ideographs"](k)||kn["Enclosed CJK Letters and Months"](k)||kn["Hangul Compatibility Jamo"](k)||kn["Hangul Jamo Extended-A"](k)||kn["Hangul Jamo Extended-B"](k)||kn["Hangul Jamo"](k)||kn["Hangul Syllables"](k)||kn.Hiragana(k)||kn["Ideographic Description Characters"](k)||kn.Kanbun(k)||kn["Kangxi Radicals"](k)||kn["Katakana Phonetic Extensions"](k)||kn.Katakana(k)&&k!==12540||kn["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||kn["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||kn["Unified Canadian Aboriginal Syllabics"](k)||kn["Unified Canadian Aboriginal Syllabics Extended"](k)||kn["Vertical Forms"](k)||kn["Yijing Hexagram Symbols"](k)||kn["Yi Syllables"](k)||kn["Yi Radicals"](k))}function Pa(k){return!!(kn["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||kn["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||kn["Letterlike Symbols"](k)||kn["Number Forms"](k)||kn["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||kn["Control Pictures"](k)&&k!==9251||kn["Optical Character Recognition"](k)||kn["Enclosed Alphanumerics"](k)||kn["Geometric Shapes"](k)||kn["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||kn["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||kn["CJK Symbols and Punctuation"](k)||kn.Katakana(k)||kn["Private Use Area"](k)||kn["CJK Compatibility Forms"](k)||kn["Small Form Variants"](k)||kn["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function ia(k){return!(Aa(k)||Pa(k))}function ni(k){return kn.Arabic(k)||kn["Arabic Supplement"](k)||kn["Arabic Extended-A"](k)||kn["Arabic Presentation Forms-A"](k)||kn["Arabic Presentation Forms-B"](k)}function Xi(k){return k>=1424&&k<=2303||kn["Arabic Presentation Forms-A"](k)||kn["Arabic Presentation Forms-B"](k)}function Ri(k,C){return!(!C&&Xi(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||kn.Khmer(k))}function Vi(k){for(var C=0,X=k;C-1&&(Co=To.error),Zs&&Zs(k)};function Cu(){Kl.fire(new Nr("pluginStateChange",{pluginStatus:Co,pluginURL:os}))}var Kl=new Ir,oo=function(){return Co},Ps=function(k){return k({pluginStatus:Co,pluginURL:os}),Kl.on("pluginStateChange",k),k},Js=function(k,C,X){if(X===void 0&&(X=!1),Co===To.deferred||Co===To.loading||Co===To.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");os=Ae.resolveURL(k),Co=To.deferred,Zs=C,Cu(),X||Xl()},Xl=function(){if(Co!==To.deferred||!os)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Co=To.loading,Cu(),os&&pn({url:os},function(k){k?tl(k):(Co=To.loaded,Cu())})},Dl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Co===To.loaded||Dl.applyArabicShaping!=null},isLoading:function(){return Co===To.loading},setState:function(C){Co=C.pluginStatus,os=C.pluginURL},isParsed:function(){return Dl.applyArabicShaping!=null&&Dl.processBidirectionalText!=null&&Dl.processStyledBidirectionalText!=null},getPluginURL:function(){return os}},xc=function(){!Dl.isLoading()&&!Dl.isLoaded()&&oo()==="deferred"&&Xl()},Ml=function(C,X){this.zoom=C,X?(this.now=X.now,this.fadeDuration=X.fadeDuration,this.zoomHistory=X.zoomHistory,this.transition=X.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Sn,this.transition={})};Ml.prototype.isSupportedScript=function(C){return mo(C,Dl.isLoaded())},Ml.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ml.prototype.getCrossfadeParameters=function(){var C=this.zoom,X=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:X+(1-X)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*X}};var Yl=function(C,X){this.property=C,this.value=X,this.expression=P(X===void 0?C.specification.default:X,C.specification)};Yl.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Yl.prototype.possiblyEvaluate=function(C,X,se){return this.property.possiblyEvaluate(this,C,X,se)};var Xc=function(C){this.property=C,this.value=new Yl(C,void 0)};Xc.prototype.transitioned=function(C,X){return new dt(this.property,this.value,X,_({},C.transition,this.transition),C.now)},Xc.prototype.untransitioned=function(){return new dt(this.property,this.value,null,{},0)};var Eu=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Eu.prototype.getValue=function(C){return B(this._values[C].value.value)},Eu.prototype.setValue=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Xc(this._values[C].property)),this._values[C].value=new Yl(this._values[C].property,X===null?void 0:B(X))},Eu.prototype.getTransition=function(C){return B(this._values[C].transition)},Eu.prototype.setTransition=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Xc(this._values[C].property)),this._values[C].transition=B(X)||void 0},Eu.prototype.serialize=function(){for(var C={},X=0,se=Object.keys(this._values);Xthis.end)return this.prior=null,De;if(this.value.isDataDriven())return this.prior=null,De;if(weHe.zoomHistory.lastIntegerZoom?{from:se,to:we}:{from:De,to:we}},C.prototype.interpolate=function(se){return se},C})(dn),Ra=function(C){this.specification=C};Ra.prototype.possiblyEvaluate=function(C,X,se,we){if(C.value!==void 0)if(C.expression.kind==="constant"){var De=C.expression.evaluate(X,null,{},se,we);return this._calculate(De,De,De,X)}else return this._calculate(C.expression.evaluate(new Ml(Math.floor(X.zoom-1),X)),C.expression.evaluate(new Ml(Math.floor(X.zoom),X)),C.expression.evaluate(new Ml(Math.floor(X.zoom+1),X)),X)},Ra.prototype._calculate=function(C,X,se,we){var De=we.zoom;return De>we.zoomHistory.lastIntegerZoom?{from:C,to:X}:{from:se,to:X}},Ra.prototype.interpolate=function(C){return C};var Ia=function(C){this.specification=C};Ia.prototype.possiblyEvaluate=function(C,X,se,we){return!!C.expression.evaluate(X,null,{},se,we)},Ia.prototype.interpolate=function(){return!1};var Ya=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var X in C){var se=C[X];se.specification.overridable&&this.overridableProperties.push(X);var we=this.defaultPropertyValues[X]=new Yl(se,void 0),De=this.defaultTransitionablePropertyValues[X]=new Xc(se);this.defaultTransitioningPropertyValues[X]=De.untransitioned(),this.defaultPossiblyEvaluatedValues[X]=we.possiblyEvaluate({})}};Qt("DataDrivenProperty",dn),Qt("DataConstantProperty",mn),Qt("CrossFadedDataDrivenProperty",Da),Qt("CrossFadedProperty",Ra),Qt("ColorRampProperty",Ia);var Oi="-transition",pi=(function(k){function C(X,se){if(k.call(this),this.id=X.id,this.type=X.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},X.type!=="custom"&&(X=X,this.metadata=X.metadata,this.minzoom=X.minzoom,this.maxzoom=X.maxzoom,X.type!=="background"&&(this.source=X.source,this.sourceLayer=X["source-layer"],this.filter=X.filter),se.layout&&(this._unevaluatedLayout=new br(se.layout)),se.paint)){this._transitionablePaint=new Eu(se.paint);for(var we in X.paint)this.setPaintProperty(we,X.paint[we],{validate:!1});for(var De in X.layout)this.setLayoutProperty(De,X.layout[De],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ua(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,we,De){if(De===void 0&&(De={}),we!=null){var He="layers."+this.id+".layout."+se;if(this._validate(ac,He,se,we,De))return}if(se==="visibility"){this.visibility=we;return}this._unevaluatedLayout.setValue(se,we)},C.prototype.getPaintProperty=function(se){return z(se,Oi)?this._transitionablePaint.getTransition(se.slice(0,-Oi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,we,De){if(De===void 0&&(De={}),we!=null){var He="layers."+this.id+".paint."+se;if(this._validate(ku,He,se,we,De))return!1}if(z(se,Oi))return this._transitionablePaint.setTransition(se.slice(0,-Oi.length),we||void 0),!1;var mt=this._transitionablePaint._values[se],jt=mt.property.specification["property-type"]==="cross-faded-data-driven",tr=mt.value.isDataDriven(),fr=mt.value;this._transitionablePaint.setValue(se,we),this._handleSpecialPaintPropertyUpdate(se);var Or=this._transitionablePaint._values[se].value,en=Or.isDataDriven();return en||tr||jt||this._handleOverridablePaintPropertyUpdate(se,fr,Or)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,we,De){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,we){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,we)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,we)},C.prototype.serialize=function(){var se={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&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),N(se,function(we,De){return we!==void 0&&!(De==="layout"&&!Object.keys(we).length)&&!(De==="paint"&&!Object.keys(we).length)})},C.prototype._validate=function(se,we,De,He,mt){return mt===void 0&&(mt={}),mt&&mt.validate===!1?!1:zc(this,se.call(Cs,{key:we,layerType:this.type,objectKey:De,value:He,styleSpec:ci,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var we=this.paint.get(se);if(!(!(we instanceof Cn)||!bu(we.property.specification))&&(we.value.kind==="source"||we.value.kind==="composite")&&we.value.isStateDependent)return!0}return!1},C})(Ir),Ha={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},pa=function(C,X){this._structArray=C,this._pos1=X*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},tn=128,Fn=5,ea=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};ea.serialize=function(C,X){return C._trim(),X&&(C.isTransferred=!0,X.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},ea.deserialize=function(C){var X=Object.create(this.prototype);return X.arrayBuffer=C.arrayBuffer,X.length=C.length,X.capacity=C.arrayBuffer.byteLength/X.bytesPerElement,X._refreshViews(),X},ea.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ea.prototype.clear=function(){this.length=0},ea.prototype.resize=function(C){this.reserve(C),this.length=C},ea.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*Fn),tn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var X=this.uint8;this._refreshViews(),X&&this.uint8.set(X)}},ea.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function ma(k,C){C===void 0&&(C=1);var X=0,se=0,we=k.map(function(He){var mt=na(He.type),jt=X=ui(X,Math.max(C,mt)),tr=He.components||1;return se=Math.max(se,mt),X+=mt*tr,{name:He.name,type:He.type,components:tr,offset:jt}}),De=ui(X,Math.max(se,C));return{members:we,size:De,alignment:C}}function na(k){return Ha[k].BYTES_PER_ELEMENT}function ui(k,C){return Math.ceil(k/C)*C}var Na=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.int16[He+0]=we,this.int16[He+1]=De,se},C})(ea);Na.prototype.bytesPerElement=4,Qt("StructArrayLayout2i4",Na);var Li=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*4;return this.int16[jt+0]=we,this.int16[jt+1]=De,this.int16[jt+2]=He,this.int16[jt+3]=mt,se},C})(ea);Li.prototype.bytesPerElement=8,Qt("StructArrayLayout4i8",Li);var aa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*6;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.int16[fr+2]=He,this.int16[fr+3]=mt,this.int16[fr+4]=jt,this.int16[fr+5]=tr,se},C})(ea);aa.prototype.bytesPerElement=12,Qt("StructArrayLayout2i4i12",aa);var Xn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*4,Or=se*8;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.uint8[Or+4]=He,this.uint8[Or+5]=mt,this.uint8[Or+6]=jt,this.uint8[Or+7]=tr,se},C})(ea);Xn.prototype.bytesPerElement=8,Qt("StructArrayLayout2i4ub8",Xn);var ai=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.float32[He+0]=we,this.float32[He+1]=De,se},C})(ea);ai.prototype.bytesPerElement=8,Qt("StructArrayLayout2f8",ai);var In=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en){var Wr=this.length;return this.resize(Wr+1),this.emplace(Wr,se,we,De,He,mt,jt,tr,fr,Or,en)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr){var _n=se*10;return this.uint16[_n+0]=we,this.uint16[_n+1]=De,this.uint16[_n+2]=He,this.uint16[_n+3]=mt,this.uint16[_n+4]=jt,this.uint16[_n+5]=tr,this.uint16[_n+6]=fr,this.uint16[_n+7]=Or,this.uint16[_n+8]=en,this.uint16[_n+9]=Wr,se},C})(ea);In.prototype.bytesPerElement=20,Qt("StructArrayLayout10ui20",In);var Wa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n){var Wn=this.length;return this.resize(Wn+1),this.emplace(Wn,se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn){var Ua=se*12;return this.int16[Ua+0]=we,this.int16[Ua+1]=De,this.int16[Ua+2]=He,this.int16[Ua+3]=mt,this.uint16[Ua+4]=jt,this.uint16[Ua+5]=tr,this.uint16[Ua+6]=fr,this.uint16[Ua+7]=Or,this.int16[Ua+8]=en,this.int16[Ua+9]=Wr,this.int16[Ua+10]=_n,this.int16[Ua+11]=Wn,se},C})(ea);Wa.prototype.bytesPerElement=24,Qt("StructArrayLayout4i4ui4i24",Wa);var za=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.float32[mt+0]=we,this.float32[mt+1]=De,this.float32[mt+2]=He,se},C})(ea);za.prototype.bytesPerElement=12,Qt("StructArrayLayout3f12",za);var Ii=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.uint32[De+0]=we,se},C})(ea);Ii.prototype.bytesPerElement=4,Qt("StructArrayLayout1ul4",Ii);var Eo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or){var en=this.length;return this.resize(en+1),this.emplace(en,se,we,De,He,mt,jt,tr,fr,Or)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en){var Wr=se*10,_n=se*5;return this.int16[Wr+0]=we,this.int16[Wr+1]=De,this.int16[Wr+2]=He,this.int16[Wr+3]=mt,this.int16[Wr+4]=jt,this.int16[Wr+5]=tr,this.uint32[_n+3]=fr,this.uint16[Wr+8]=Or,this.uint16[Wr+9]=en,se},C})(ea);Eo.prototype.bytesPerElement=20,Qt("StructArrayLayout6i1ul2ui20",Eo);var mi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*6;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.int16[fr+2]=He,this.int16[fr+3]=mt,this.int16[fr+4]=jt,this.int16[fr+5]=tr,se},C})(ea);mi.prototype.bytesPerElement=12,Qt("StructArrayLayout2i2i2i12",mi);var Ui=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt){var jt=this.length;return this.resize(jt+1),this.emplace(jt,se,we,De,He,mt)},C.prototype.emplace=function(se,we,De,He,mt,jt){var tr=se*4,fr=se*8;return this.float32[tr+0]=we,this.float32[tr+1]=De,this.float32[tr+2]=He,this.int16[fr+6]=mt,this.int16[fr+7]=jt,se},C})(ea);Ui.prototype.bytesPerElement=16,Qt("StructArrayLayout2f1f2i16",Ui);var Xa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*12,tr=se*3;return this.uint8[jt+0]=we,this.uint8[jt+1]=De,this.float32[tr+1]=He,this.float32[tr+2]=mt,se},C})(ea);Xa.prototype.bytesPerElement=12,Qt("StructArrayLayout2ub2f12",Xa);var xo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.uint16[mt+0]=we,this.uint16[mt+1]=De,this.uint16[mt+2]=He,se},C})(ea);xo.prototype.bytesPerElement=6,Qt("StructArrayLayout3ui6",xo);var qo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a){var fi=this.length;return this.resize(fi+1),this.emplace(fi,se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a,fi){var Ai=se*24,Wi=se*12,go=se*48;return this.int16[Ai+0]=we,this.int16[Ai+1]=De,this.uint16[Ai+2]=He,this.uint16[Ai+3]=mt,this.uint32[Wi+2]=jt,this.uint32[Wi+3]=tr,this.uint32[Wi+4]=fr,this.uint16[Ai+10]=Or,this.uint16[Ai+11]=en,this.uint16[Ai+12]=Wr,this.float32[Wi+7]=_n,this.float32[Wi+8]=Wn,this.uint8[go+36]=Ua,this.uint8[go+37]=xa,this.uint8[go+38]=vi,this.uint32[Wi+10]=$a,this.int16[Ai+22]=fi,se},C})(ea);qo.prototype.bytesPerElement=48,Qt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qo);var Qo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a,fi,Ai,Wi,go,vo,ss,Oo,$o,hl,ls,ps){var jl=this.length;return this.resize(jl+1),this.emplace(jl,se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a,fi,Ai,Wi,go,vo,ss,Oo,$o,hl,ls,ps)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a,fi,Ai,Wi,go,vo,ss,Oo,$o,hl,ls,ps,jl){var al=se*34,zu=se*17;return this.int16[al+0]=we,this.int16[al+1]=De,this.int16[al+2]=He,this.int16[al+3]=mt,this.int16[al+4]=jt,this.int16[al+5]=tr,this.int16[al+6]=fr,this.int16[al+7]=Or,this.uint16[al+8]=en,this.uint16[al+9]=Wr,this.uint16[al+10]=_n,this.uint16[al+11]=Wn,this.uint16[al+12]=Ua,this.uint16[al+13]=xa,this.uint16[al+14]=vi,this.uint16[al+15]=$a,this.uint16[al+16]=fi,this.uint16[al+17]=Ai,this.uint16[al+18]=Wi,this.uint16[al+19]=go,this.uint16[al+20]=vo,this.uint16[al+21]=ss,this.uint16[al+22]=Oo,this.uint32[zu+12]=$o,this.float32[zu+13]=hl,this.float32[zu+14]=ls,this.float32[zu+15]=ps,this.float32[zu+16]=jl,se},C})(ea);Qo.prototype.bytesPerElement=68,Qt("StructArrayLayout8i15ui1ul4f68",Qo);var ul=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.float32[De+0]=we,se},C})(ea);ul.prototype.bytesPerElement=4,Qt("StructArrayLayout1f4",ul);var es=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.int16[mt+0]=we,this.int16[mt+1]=De,this.int16[mt+2]=He,se},C})(ea);es.prototype.bytesPerElement=6,Qt("StructArrayLayout3i6",es);var wu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*2,jt=se*4;return this.uint32[mt+0]=we,this.uint16[jt+2]=De,this.uint16[jt+3]=He,se},C})(ea);wu.prototype.bytesPerElement=8,Qt("StructArrayLayout1ul2ui8",wu);var Qs=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.uint16[He+0]=we,this.uint16[He+1]=De,se},C})(ea);Qs.prototype.bytesPerElement=4,Qt("StructArrayLayout2ui4",Qs);var vu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.uint16[De+0]=we,se},C})(ea);vu.prototype.bytesPerElement=2,Qt("StructArrayLayout1ui2",vu);var Iu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*4;return this.float32[jt+0]=we,this.float32[jt+1]=De,this.float32[jt+2]=He,this.float32[jt+3]=mt,se},C})(ea);Iu.prototype.bytesPerElement=16,Qt("StructArrayLayout4f16",Iu);var Zu=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={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 X.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},X.x1.get=function(){return this._structArray.int16[this._pos2+2]},X.y1.get=function(){return this._structArray.int16[this._pos2+3]},X.x2.get=function(){return this._structArray.int16[this._pos2+4]},X.y2.get=function(){return this._structArray.int16[this._pos2+5]},X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,X),C})(pa);Zu.prototype.size=20;var vf=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Zu(this,se)},C})(Eo);Qt("CollisionBoxArray",vf);var $l=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={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 X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},X.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},X.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},X.segment.get=function(){return this._structArray.uint16[this._pos2+10]},X.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},X.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},X.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},X.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},X.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},X.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},X.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},X.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},X.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},X.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,X),C})(pa);$l.prototype.size=48;var uu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new $l(this,se)},C})(qo);Qt("PlacedSymbolArray",uu);var uo=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={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 X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},X.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},X.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},X.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},X.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},X.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},X.key.get=function(){return this._structArray.uint16[this._pos2+8]},X.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},X.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},X.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},X.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},X.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},X.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},X.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},X.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},X.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},X.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},X.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},X.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},X.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},X.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},X.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},X.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},X.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,X),C})(pa);uo.prototype.size=68;var Wu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new uo(this,se)},C})(Qo);Qt("SymbolInstanceArray",Wu);var Us=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C})(ul);Qt("GlyphOffsetArray",Us);var zl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C})(es);Qt("SymbolLineVertexArray",zl);var sc=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,X),C})(pa);sc.prototype.size=8;var lc=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new sc(this,se)},C})(wu);Qt("FeatureIndexArray",lc);var Ao=ma([{name:"a_pos",components:2,type:"Int16"}],4),vs=Ao.members,ys=function(C){C===void 0&&(C=[]),this.segments=C};ys.prototype.prepareSegment=function(C,X,se,we){var De=this.segments[this.segments.length-1];return C>ys.MAX_VERTEX_ARRAY_LENGTH&&j("Max vertices per segment is "+ys.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!De||De.vertexLength+C>ys.MAX_VERTEX_ARRAY_LENGTH||De.sortKey!==we)&&(De={vertexOffset:X.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},we!==void 0&&(De.sortKey=we),this.segments.push(De)),De},ys.prototype.get=function(){return this.segments},ys.prototype.destroy=function(){for(var C=0,X=this.segments;C>>16)*jt&65535)<<16)&4294967295,fr=fr<<15|fr>>>17,fr=(fr&65535)*tr+(((fr>>>16)*tr&65535)<<16)&4294967295,He^=fr,He=He<<13|He>>>19,mt=(He&65535)*5+(((He>>>16)*5&65535)<<16)&4294967295,He=(mt&65535)+27492+(((mt>>>16)+58964&65535)<<16);switch(fr=0,we){case 3:fr^=(X.charCodeAt(Or+2)&255)<<16;case 2:fr^=(X.charCodeAt(Or+1)&255)<<8;case 1:fr^=X.charCodeAt(Or)&255,fr=(fr&65535)*jt+(((fr>>>16)*jt&65535)<<16)&4294967295,fr=fr<<15|fr>>>17,fr=(fr&65535)*tr+(((fr>>>16)*tr&65535)<<16)&4294967295,He^=fr}return He^=X.length,He^=He>>>16,He=(He&65535)*2246822507+(((He>>>16)*2246822507&65535)<<16)&4294967295,He^=He>>>13,He=(He&65535)*3266489909+(((He>>>16)*3266489909&65535)<<16)&4294967295,He^=He>>>16,He>>>0}k.exports=C}),J=t(function(k){function C(X,se){for(var we=X.length,De=se^we,He=0,mt;we>=4;)mt=X.charCodeAt(He)&255|(X.charCodeAt(++He)&255)<<8|(X.charCodeAt(++He)&255)<<16|(X.charCodeAt(++He)&255)<<24,mt=(mt&65535)*1540483477+(((mt>>>16)*1540483477&65535)<<16),mt^=mt>>>24,mt=(mt&65535)*1540483477+(((mt>>>16)*1540483477&65535)<<16),De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)^mt,we-=4,++He;switch(we){case 3:De^=(X.charCodeAt(He+2)&255)<<16;case 2:De^=(X.charCodeAt(He+1)&255)<<8;case 1:De^=X.charCodeAt(He)&255,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)}return De^=De>>>13,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),De^=De>>>15,De>>>0}k.exports=C}),_e=he,qe=he,lt=J;_e.murmur3=qe,_e.murmur2=lt;var vt=function(){this.ids=[],this.positions=[],this.indexed=!1};vt.prototype.add=function(C,X,se,we){this.ids.push(at(C)),this.positions.push(X,se,we)},vt.prototype.getPositions=function(C){for(var X=at(C),se=0,we=this.ids.length-1;se>1;this.ids[De]>=X?we=De:se=De+1}for(var He=[];this.ids[se]===X;){var mt=this.positions[3*se],jt=this.positions[3*se+1],tr=this.positions[3*se+2];He.push({index:mt,start:jt,end:tr}),se++}return He},vt.serialize=function(C,X){var se=new Float64Array(C.ids),we=new Uint32Array(C.positions);return bt(se,we,0,se.length-1),X&&X.push(se.buffer,we.buffer),{ids:se,positions:we}},vt.deserialize=function(C){var X=new vt;return X.ids=C.ids,X.positions=C.positions,X.indexed=!0,X};var Ke=Math.pow(2,53)-1;function at(k){var C=+k;return!isNaN(C)&&C<=Ke?C:_e(String(k))}function bt(k,C,X,se){for(;X>1],De=X-1,He=se+1;;){do De++;while(k[De]we);if(De>=He)break;Zt(k,De,He),Zt(C,3*De,3*He),Zt(C,3*De+1,3*He+1),Zt(C,3*De+2,3*He+2)}He-XHe.x+1||jtHe.y+1)&&j("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return X}function yl(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?cl(k):[]}}function ml(k,C,X,se,we){k.emplaceBack(C*2+(se+1)/2,X*2+(we+1)/2)}var Ku=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Na,this.indexArray=new xo,this.segments=new ys,this.programConfigurations=new ca(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};Ku.prototype.populate=function(C,X,se){var we=this.layers[0],De=[],He=null;we.type==="circle"&&(He=we.layout.get("circle-sort-key"));for(var mt=0,jt=C;mt=qi||en<0||en>=qi)){var Wr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),_n=Wr.vertexLength;ml(this.layoutVertexArray,Or,en,-1,-1),ml(this.layoutVertexArray,Or,en,1,-1),ml(this.layoutVertexArray,Or,en,1,1),ml(this.layoutVertexArray,Or,en,-1,1),this.indexArray.emplaceBack(_n,_n+1,_n+2),this.indexArray.emplaceBack(_n,_n+3,_n+2),Wr.vertexLength+=4,Wr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},we)},Qt("CircleBucket",Ku,{omit:["layers"]});function il(k,C){for(var X=0;X=3){for(var De=0;De1){if(Nd(k,C))return!0;for(var se=0;se1?k.distSqr(X):k.distSqr(X.sub(C)._mult(we)._add(C))}function bp(k,C){for(var X=!1,se,we,De,He=0;HeC.y!=De.y>C.y&&C.x<(De.x-we.x)*(C.y-we.y)/(De.y-we.y)+we.x&&(X=!X)}return X}function Wv(k,C){for(var X=!1,se=0,we=k.length-1;seC.y!=He.y>C.y&&C.x<(He.x-De.x)*(C.y-De.y)/(He.y-De.y)+De.x&&(X=!X)}return X}function wp(k,C,X,se,we){for(var De=0,He=k;De=mt.x&&we>=mt.y)return!0}var jt=[new i(C,X),new i(C,we),new i(se,we),new i(se,X)];if(k.length>2)for(var tr=0,fr=jt;trwe.x&&C.x>we.x||k.ywe.y&&C.y>we.y)return!1;var De=Z(k,C,X[0]);return De!==Z(k,C,X[1])||De!==Z(k,C,X[2])||De!==Z(k,C,X[3])}function Kv(k,C,X){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:X.programConfigurations.get(C.id).getMaxValue(k)}function Ud(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function sp(k,C,X,se,we){if(!C[0]&&!C[1])return k;var De=i.convert(C)._mult(we);X==="viewport"&&De._rotate(-se);for(var He=[],mt=0;mt0&&(De=1/Math.sqrt(De)),k[0]=C[0]*De,k[1]=C[1]*De,k[2]=C[2]*De,k}function GE(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function XE(k,C,X){var se=C[0],we=C[1],De=C[2],He=X[0],mt=X[1],jt=X[2];return k[0]=we*jt-De*mt,k[1]=De*He-se*jt,k[2]=se*mt-we*He,k}function YE(k,C,X){var se=C[0],we=C[1],De=C[2];return k[0]=se*X[0]+we*X[3]+De*X[6],k[1]=se*X[1]+we*X[4]+De*X[7],k[2]=se*X[2]+we*X[5]+De*X[8],k}var ZE=Um;(function(){var k=Nm();return function(C,X,se,we,De,He){var mt,jt;for(X||(X=3),se||(se=0),we?jt=Math.min(we*X+se,C.length):jt=C.length,mt=se;mtk.width||we.height>k.height||X.x>k.width-we.width||X.y>k.height-we.height)throw new RangeError("out of range source coordinates for image copy");if(we.width>C.width||we.height>C.height||se.x>C.width-we.width||se.y>C.height-we.height)throw new RangeError("out of range destination coordinates for image copy");for(var He=k.data,mt=C.data,jt=0;jt80*X){mt=tr=k[0],jt=fr=k[1];for(var _n=X;_ntr&&(tr=Or),en>fr&&(fr=en);Wr=Math.max(tr-mt,fr-jt),Wr=Wr!==0?1/Wr:0}return Ug(De,He,X,mt,jt,Wr),He}function H3(k,C,X,se,we){var De,He;if(we===K3(k,C,X,se)>0)for(De=C;De=C;De-=se)He=fS(De,k[De],k[De+1],He);return He&&Qy(He,He.next)&&(G_(He),He=He.next),He}function J0(k,C){if(!k)return k;C||(C=k);var X=k,se;do if(se=!1,!X.steiner&&(Qy(X,X.next)||eh(X.prev,X,X.next)===0)){if(G_(X),X=C=X.prev,X===X.next)break;se=!0}else X=X.next;while(se||X!==C);return C}function Ug(k,C,X,se,we,De,He){if(k){!He&&De&&X3(k,se,we,De);for(var mt=k,jt,tr;k.prev!==k.next;){if(jt=k.prev,tr=k.next,De?t6(k,se,we,De):G3(k)){C.push(jt.i/X),C.push(k.i/X),C.push(tr.i/X),G_(k),k=tr.next,mt=tr.next;continue}if(k=tr,k===mt){He?He===1?(k=r6(J0(k),C,X),Ug(k,C,X,se,we,De,2)):He===2&&lS(k,C,X,se,we,De):Ug(J0(k),C,X,se,we,De,1);break}}}}function G3(k){var C=k.prev,X=k,se=k.next;if(eh(C,X,se)>=0)return!1;for(var we=k.next.next;we!==k.prev;){if(Vm(C.x,C.y,X.x,X.y,se.x,se.y,we.x,we.y)&&eh(we.prev,we,we.next)>=0)return!1;we=we.next}return!0}function t6(k,C,X,se){var we=k.prev,De=k,He=k.next;if(eh(we,De,He)>=0)return!1;for(var mt=we.xDe.x?we.x>He.x?we.x:He.x:De.x>He.x?De.x:He.x,fr=we.y>De.y?we.y>He.y?we.y:He.y:De.y>He.y?De.y:He.y,Or=Y3(mt,jt,C,X,se),en=Y3(tr,fr,C,X,se),Wr=k.prevZ,_n=k.nextZ;Wr&&Wr.z>=Or&&_n&&_n.z<=en;){if(Wr!==k.prev&&Wr!==k.next&&Vm(we.x,we.y,De.x,De.y,He.x,He.y,Wr.x,Wr.y)&&eh(Wr.prev,Wr,Wr.next)>=0||(Wr=Wr.prevZ,_n!==k.prev&&_n!==k.next&&Vm(we.x,we.y,De.x,De.y,He.x,He.y,_n.x,_n.y)&&eh(_n.prev,_n,_n.next)>=0))return!1;_n=_n.nextZ}for(;Wr&&Wr.z>=Or;){if(Wr!==k.prev&&Wr!==k.next&&Vm(we.x,we.y,De.x,De.y,He.x,He.y,Wr.x,Wr.y)&&eh(Wr.prev,Wr,Wr.next)>=0)return!1;Wr=Wr.prevZ}for(;_n&&_n.z<=en;){if(_n!==k.prev&&_n!==k.next&&Vm(we.x,we.y,De.x,De.y,He.x,He.y,_n.x,_n.y)&&eh(_n.prev,_n,_n.next)>=0)return!1;_n=_n.nextZ}return!0}function r6(k,C,X){var se=k;do{var we=se.prev,De=se.next.next;!Qy(we,De)&&jg(we,se,se.next,De)&&e1(we,De)&&e1(De,we)&&(C.push(we.i/X),C.push(se.i/X),C.push(De.i/X),G_(se),G_(se.next),se=k=De),se=se.next}while(se!==k);return J0(se)}function lS(k,C,X,se,we,De){var He=k;do{for(var mt=He.next.next;mt!==He.prev;){if(He.i!==mt.i&&a6(He,mt)){var jt=W3(He,mt);He=J0(He,He.next),jt=J0(jt,jt.next),Ug(He,C,X,se,we,De),Ug(jt,C,X,se,we,De);return}mt=mt.next}He=He.next}while(He!==k)}function uS(k,C,X,se){var we=[],De,He,mt,jt,tr;for(De=0,He=C.length;De=X.next.y&&X.next.y!==X.y){var mt=X.x+(we-X.y)*(X.next.x-X.x)/(X.next.y-X.y);if(mt<=se&&mt>De){if(De=mt,mt===se){if(we===X.y)return X;if(we===X.next.y)return X.next}He=X.x=X.x&&X.x>=tr&&se!==X.x&&Vm(weHe.x||X.x===He.x&&cS(He,X)))&&(He=X,Or=en)),X=X.next;while(X!==jt);return He}function cS(k,C){return eh(k.prev,k,C.prev)<0&&eh(C.next,k,k.next)<0}function X3(k,C,X,se){var we=k;do we.z===null&&(we.z=Y3(we.x,we.y,C,X,se)),we.prevZ=we.prev,we.nextZ=we.next,we=we.next;while(we!==k);we.prevZ.nextZ=null,we.prevZ=null,n6(we)}function n6(k){var C,X,se,we,De,He,mt,jt,tr=1;do{for(X=k,k=null,De=null,He=0;X;){for(He++,se=X,mt=0,C=0;C0||jt>0&&se;)mt!==0&&(jt===0||!se||X.z<=se.z)?(we=X,X=X.nextZ,mt--):(we=se,se=se.nextZ,jt--),De?De.nextZ=we:k=we,we.prevZ=De,De=we;X=se}De.nextZ=null,tr*=2}while(He>1);return k}function Y3(k,C,X,se,we){return k=32767*(k-X)*we,C=32767*(C-se)*we,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function sw(k){var C=k,X=k;do(C.x=0&&(k-He)*(se-mt)-(X-He)*(C-mt)>=0&&(X-He)*(De-mt)-(we-He)*(se-mt)>=0}function a6(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Z3(k,C)&&(e1(k,C)&&e1(C,k)&&lw(k,C)&&(eh(k.prev,k,C.prev)||eh(k,C.prev,C))||Qy(k,C)&&eh(k.prev,k,k.next)>0&&eh(C.prev,C,C.next)>0)}function eh(k,C,X){return(C.y-k.y)*(X.x-C.x)-(C.x-k.x)*(X.y-C.y)}function Qy(k,C){return k.x===C.x&&k.y===C.y}function jg(k,C,X,se){var we=H_(eh(k,C,X)),De=H_(eh(k,C,se)),He=H_(eh(X,se,k)),mt=H_(eh(X,se,C));return!!(we!==De&&He!==mt||we===0&&V_(k,X,C)||De===0&&V_(k,se,C)||He===0&&V_(X,k,se)||mt===0&&V_(X,C,se))}function V_(k,C,X){return C.x<=Math.max(k.x,X.x)&&C.x>=Math.min(k.x,X.x)&&C.y<=Math.max(k.y,X.y)&&C.y>=Math.min(k.y,X.y)}function H_(k){return k>0?1:k<0?-1:0}function Z3(k,C){var X=k;do{if(X.i!==k.i&&X.next.i!==k.i&&X.i!==C.i&&X.next.i!==C.i&&jg(X,X.next,k,C))return!0;X=X.next}while(X!==k);return!1}function e1(k,C){return eh(k.prev,k,k.next)<0?eh(k,C,k.next)>=0&&eh(k,k.prev,C)>=0:eh(k,C,k.prev)<0||eh(k,k.next,C)<0}function lw(k,C){var X=k,se=!1,we=(k.x+C.x)/2,De=(k.y+C.y)/2;do X.y>De!=X.next.y>De&&X.next.y!==X.y&&we<(X.next.x-X.x)*(De-X.y)/(X.next.y-X.y)+X.x&&(se=!se),X=X.next;while(X!==k);return se}function W3(k,C){var X=new uw(k.i,k.x,k.y),se=new uw(C.i,C.x,C.y),we=k.next,De=C.prev;return k.next=C,C.prev=k,X.next=we,we.prev=X,se.next=X,X.prev=se,De.next=se,se.prev=De,se}function fS(k,C,X,se){var we=new uw(k,C,X);return se?(we.next=se.next,we.prev=se,se.next.prev=we,se.next=we):(we.prev=we,we.next=we),we}function G_(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function uw(k,C,X){this.i=k,this.x=C,this.y=X,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}ow.deviation=function(k,C,X,se){var we=C&&C.length,De=we?C[0]*X:k.length,He=Math.abs(K3(k,0,De,X));if(we)for(var mt=0,jt=C.length;mt0&&(se+=k[we-1].length,X.holes.push(se))}return X},iw.default=sS;function i6(k,C,X,se,we){hS(k,C,X,se||k.length-1,we||$3)}function hS(k,C,X,se,we){for(;se>X;){if(se-X>600){var De=se-X+1,He=C-X+1,mt=Math.log(De),jt=.5*Math.exp(2*mt/3),tr=.5*Math.sqrt(mt*jt*(De-jt)/De)*(He-De/2<0?-1:1),fr=Math.max(X,Math.floor(C-He*jt/De+tr)),Or=Math.min(se,Math.floor(C+(De-He)*jt/De+tr));hS(k,C,fr,Or,we)}var en=k[C],Wr=X,_n=se;for(X_(k,X,C),we(k[se],en)>0&&X_(k,X,se);Wr<_n;){for(X_(k,Wr,_n),Wr++,_n--;we(k[Wr],en)<0;)Wr++;for(;we(k[_n],en)>0;)_n--}we(k[X],en)===0?X_(k,X,_n):(_n++,X_(k,_n,se)),_n<=C&&(X=_n+1),C<=_n&&(se=_n-1)}}function X_(k,C,X){var se=k[C];k[C]=k[X],k[X]=se}function $3(k,C){return kC?1:0}function b0(k,C){var X=k.length;if(X<=1)return[k];for(var se=[],we,De,He=0;He1)for(var jt=0;jt>3}if(se--,X===1||X===2)we+=k.readSVarint(),De+=k.readSVarint(),X===1&&(mt&&He.push(mt),mt=[]),mt.push(new i(we,De));else if(X===7)mt&&mt.push(mt[0].clone());else throw new Error("unknown command "+X)}return mt&&He.push(mt),He},qg.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,X=1,se=0,we=0,De=0,He=1/0,mt=-1/0,jt=1/0,tr=-1/0;k.pos>3}if(se--,X===1||X===2)we+=k.readSVarint(),De+=k.readSVarint(),wemt&&(mt=we),Detr&&(tr=De);else if(X!==7)throw new Error("unknown command "+X)}return[He,jt,mt,tr]},qg.prototype.toGeoJSON=function(k,C,X){var se=this.extent*Math.pow(2,X),we=this.extent*k,De=this.extent*C,He=this.loadGeometry(),mt=qg.types[this.type],jt,tr;function fr(Wr){for(var _n=0;_n>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}bS.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new t1(this._pbf,C,this.extent,this._keys,this._values)};var TS=AS;function AS(k,C){this.layers=k.readFields(SS,{},C)}function SS(k,C,X){if(k===3){var se=new eT(X,X.readVarint()+X.pos);se.length&&(C[se.name]=se)}}var MS=TS,o6=t1,s6=eT,Vg={VectorTile:MS,VectorTileFeature:o6,VectorTileLayer:s6},r1=Vg.VectorTileFeature.types,ES=500,n1=Math.pow(2,13);function a1(k,C,X,se,we,De,He,mt){k.emplaceBack(C,X,Math.floor(se*n1)*2+He,we*n1*2,De*n1*2,Math.round(mt))}var Vd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new aa,this.indexArray=new xo,this.programConfigurations=new ca(C.layers,C.zoom),this.segments=new ys,this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};Vd.prototype.populate=function(C,X,se){this.features=[],this.hasPattern=cw("fill-extrusion",this.layers,X);for(var we=0,De=C;we=1){var fi=Ua[vi-1];if(!hw($a,fi)){Wr.vertexLength+4>ys.MAX_VERTEX_ARRAY_LENGTH&&(Wr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Ai=$a.sub(fi)._perp()._unit(),Wi=fi.dist($a);xa+Wi>32768&&(xa=0),a1(this.layoutVertexArray,$a.x,$a.y,Ai.x,Ai.y,0,0,xa),a1(this.layoutVertexArray,$a.x,$a.y,Ai.x,Ai.y,0,1,xa),xa+=Wi,a1(this.layoutVertexArray,fi.x,fi.y,Ai.x,Ai.y,0,0,xa),a1(this.layoutVertexArray,fi.x,fi.y,Ai.x,Ai.y,0,1,xa);var go=Wr.vertexLength;this.indexArray.emplaceBack(go,go+2,go+1),this.indexArray.emplaceBack(go+1,go+2,go+3),Wr.vertexLength+=4,Wr.primitiveLength+=2}}}}if(Wr.vertexLength+tr>ys.MAX_VERTEX_ARRAY_LENGTH&&(Wr=this.segments.prepareSegment(tr,this.layoutVertexArray,this.indexArray)),r1[C.type]==="Polygon"){for(var vo=[],ss=[],Oo=Wr.vertexLength,$o=0,hl=jt;$oqi)||k.y===C.y&&(k.y<0||k.y>qi)}function vw(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>qi})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>qi})}var l6=new Ya({"fill-extrusion-opacity":new mn(ci["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new dn(ci["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new mn(ci["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new mn(ci["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Da(ci["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new dn(ci["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new dn(ci["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new mn(ci["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),u6={paint:l6},c6=(function(k){function C(X){k.call(this,X,u6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new Vd(se)},C.prototype.queryRadius=function(){return Ud(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,we,De,He,mt,jt,tr,fr){var Or=sp(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,tr),en=this.paint.get("fill-extrusion-height").evaluate(we,De),Wr=this.paint.get("fill-extrusion-base").evaluate(we,De),_n=kS(Or,fr,jt,0),Wn=tT(He,Wr,en,fr),Ua=Wn[0],xa=Wn[1];return Gm(Ua,xa,_n)},C})(pi);function w0(k,C){return k.x*C.x+k.y*C.y}function Sv(k,C){if(k.length===1){for(var X=0,se=C[X++],we;!we||se.equals(we);)if(we=C[X++],!we)return 1/0;for(;X=2&&C[tr-1].equals(C[tr-2]);)tr--;for(var fr=0;fr0;if(vo&&vi>fr){var Oo=Wr.dist(_n);if(Oo>2*Or){var $o=Wr.sub(Wr.sub(_n)._mult(Or/Oo)._round());this.updateDistance(_n,$o),this.addCurrentVertex($o,Ua,0,0,en),_n=$o}}var hl=_n&&Wn,ls=hl?se:jt?"butt":we;if(hl&&ls==="round"&&(WiDe&&(ls="bevel"),ls==="bevel"&&(Wi>2&&(ls="flipbevel"),Wi100)$a=xa.mult(-1);else{var ps=Wi*Ua.add(xa).mag()/Ua.sub(xa).mag();$a._perp()._mult(ps*(ss?-1:1))}this.addCurrentVertex(Wr,$a,0,0,en),this.addCurrentVertex(Wr,$a.mult(-1),0,0,en)}else if(ls==="bevel"||ls==="fakeround"){var jl=-Math.sqrt(Wi*Wi-1),al=ss?jl:0,zu=ss?0:jl;if(_n&&this.addCurrentVertex(Wr,Ua,al,zu,en),ls==="fakeround")for(var Bc=Math.round(go*180/Math.PI/aT),Ou=1;Ou2*Or){var Jh=Wr.add(Wn.sub(Wr)._mult(Or/Cv)._round());this.updateDistance(Wr,Jh),this.addCurrentVertex(Jh,xa,0,0,en),Wr=Jh}}}}},Nv.prototype.addCurrentVertex=function(C,X,se,we,De,He){He===void 0&&(He=!1);var mt=X.x+X.y*se,jt=X.y-X.x*se,tr=-X.x+X.y*we,fr=-X.y-X.x*we;this.addHalfVertex(C,mt,jt,He,!1,se,De),this.addHalfVertex(C,tr,fr,He,!0,-we,De),this.distance>dw/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,X,se,we,De,He))},Nv.prototype.addHalfVertex=function(C,X,se,we,De,He,mt){var jt=C.x,tr=C.y,fr=this.lineClips?this.scaledDistance*(dw-1):this.scaledDistance,Or=fr*i1;if(this.layoutVertexArray.emplaceBack((jt<<1)+(we?1:0),(tr<<1)+(De?1:0),Math.round(RS*X)+128,Math.round(RS*se)+128,(He===0?0:He<0?-1:1)+1|(Or&63)<<2,Or>>6),this.lineClips){var en=this.scaledDistance-this.lineClips.start,Wr=this.lineClips.end-this.lineClips.start,_n=en/Wr;this.layoutVertexArray2.emplaceBack(_n,this.lineClipsArray.length)}var Wn=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Wn),mt.primitiveLength++),De?this.e2=Wn:this.e1=Wn},Nv.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Nv.prototype.updateDistance=function(C,X){this.distance+=C.dist(X),this.updateScaledDistance()},Qt("LineBucket",Nv,{omit:["layers","patternFeatures"]});var iT=new Ya({"line-cap":new mn(ci.layout_line["line-cap"]),"line-join":new dn(ci.layout_line["line-join"]),"line-miter-limit":new mn(ci.layout_line["line-miter-limit"]),"line-round-limit":new mn(ci.layout_line["line-round-limit"]),"line-sort-key":new dn(ci.layout_line["line-sort-key"])}),pw=new Ya({"line-opacity":new dn(ci.paint_line["line-opacity"]),"line-color":new dn(ci.paint_line["line-color"]),"line-translate":new mn(ci.paint_line["line-translate"]),"line-translate-anchor":new mn(ci.paint_line["line-translate-anchor"]),"line-width":new dn(ci.paint_line["line-width"]),"line-gap-width":new dn(ci.paint_line["line-gap-width"]),"line-offset":new dn(ci.paint_line["line-offset"]),"line-blur":new dn(ci.paint_line["line-blur"]),"line-dasharray":new Ra(ci.paint_line["line-dasharray"]),"line-pattern":new Da(ci.paint_line["line-pattern"]),"line-gradient":new Ia(ci.paint_line["line-gradient"])}),o1={paint:pw,layout:iT},oT=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,we){return we=new Ml(Math.floor(we.zoom),{now:we.now,fadeDuration:we.fadeDuration,zoomHistory:we.zoomHistory,transition:we.transition}),k.prototype.possiblyEvaluate.call(this,se,we)},C.prototype.evaluate=function(se,we,De,He){return we=_({},we,{zoom:Math.floor(we.zoom)}),k.prototype.evaluate.call(this,se,we,De,He)},C})(dn),mw=new oT(o1.paint.properties["line-width"].specification);mw.useIntegerZoom=!0;var sT=(function(k){function C(X){k.call(this,X,o1),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var we=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=we._styleExpression.expression instanceof Rc,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,we){k.prototype.recalculate.call(this,se,we),this.paint._values["line-floorwidth"]=mw.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new Nv(se)},C.prototype.queryRadius=function(se){var we=se,De=zS(Kv("line-width",this,we),Kv("line-gap-width",this,we)),He=Kv("line-offset",this,we);return De/2+Math.abs(He)+Ud(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,we,De,He,mt,jt,tr){var fr=sp(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,tr),Or=tr/2*zS(this.paint.get("line-width").evaluate(we,De),this.paint.get("line-gap-width").evaluate(we,De)),en=this.paint.get("line-offset").evaluate(we,De);return en&&(He=Y(He,en*tr)),wh(fr,He,Or)},C.prototype.isTileClipped=function(){return!0},C})(pi);function zS(k,C){return C>0?C+2*k:k}function Y(k,C){for(var X=[],se=new i(0,0),we=0;we":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function dr(k){for(var C="",X=0;X>1,fr=-7,Or=X?we-1:0,en=X?-1:1,Wr=k[C+Or];for(Or+=en,De=Wr&(1<<-fr)-1,Wr>>=-fr,fr+=mt;fr>0;De=De*256+k[C+Or],Or+=en,fr-=8);for(He=De&(1<<-fr)-1,De>>=-fr,fr+=se;fr>0;He=He*256+k[C+Or],Or+=en,fr-=8);if(De===0)De=1-tr;else{if(De===jt)return He?NaN:(Wr?-1:1)*(1/0);He=He+Math.pow(2,se),De=De-tr}return(Wr?-1:1)*He*Math.pow(2,De-se)},$r=function(k,C,X,se,we,De){var He,mt,jt,tr=De*8-we-1,fr=(1<>1,en=we===23?Math.pow(2,-24)-Math.pow(2,-77):0,Wr=se?0:De-1,_n=se?1:-1,Wn=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(mt=isNaN(C)?1:0,He=fr):(He=Math.floor(Math.log(C)/Math.LN2),C*(jt=Math.pow(2,-He))<1&&(He--,jt*=2),He+Or>=1?C+=en/jt:C+=en*Math.pow(2,1-Or),C*jt>=2&&(He++,jt/=2),He+Or>=fr?(mt=0,He=fr):He+Or>=1?(mt=(C*jt-1)*Math.pow(2,we),He=He+Or):(mt=C*Math.pow(2,Or-1)*Math.pow(2,we),He=0));we>=8;k[X+Wr]=mt&255,Wr+=_n,mt/=256,we-=8);for(He=He<0;k[X+Wr]=He&255,Wr+=_n,He/=256,tr-=8);k[X+Wr-_n]|=Wn*128},hn={read:qr,write:$r},An=Bn;function Bn(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Bn.Varint=0,Bn.Fixed64=1,Bn.Bytes=2,Bn.Fixed32=5;var va=65536*65536,ii=1/va,Fa=12,Qa=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Bn.prototype={destroy:function(){this.buf=null},readFields:function(k,C,X){for(X=X||this.length;this.pos>3,De=this.pos;this.type=se&7,k(we,C,this),this.pos===De&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=_d(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Zh(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=_d(this.buf,this.pos)+_d(this.buf,this.pos+4)*va;return this.pos+=8,k},readSFixed64:function(){var k=_d(this.buf,this.pos)+Zh(this.buf,this.pos+4)*va;return this.pos+=8,k},readFloat:function(){var k=hn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=hn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,X,se;return se=C[this.pos++],X=se&127,se<128||(se=C[this.pos++],X|=(se&127)<<7,se<128)||(se=C[this.pos++],X|=(se&127)<<14,se<128)||(se=C[this.pos++],X|=(se&127)<<21,se<128)?X:(se=C[this.pos],X|=(se&15)<<28,Di(X,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Fa&&Qa?ud(this.buf,C,k):ld(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Bn.Bytes)return k.push(this.readVarint(C));var X=lo(this);for(k=k||[];this.pos127;);else if(C===Bn.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Bn.Fixed32)this.pos+=4;else if(C===Bn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){fl(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=cd(this.buf,k,this.pos);var X=this.pos-C;X>=128&&Is(C,X,this),this.pos=C-1,this.writeVarint(X),this.pos+=X},writeFloat:function(k){this.realloc(4),hn.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),hn.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var X=0;X=128&&Is(X,se,this),this.pos=X-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,X){this.writeTag(k,Bn.Bytes),this.writeRawMessage(C,X)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,Ms,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,bs,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Ds,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,$i,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Vs,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Cl,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,rf,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Yc,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,sv,C)},writeBytesField:function(k,C){this.writeTag(k,Bn.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Bn.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Bn.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Bn.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Di(k,C,X){var se=X.buf,we,De;if(De=se[X.pos++],we=(De&112)>>4,De<128||(De=se[X.pos++],we|=(De&127)<<3,De<128)||(De=se[X.pos++],we|=(De&127)<<10,De<128)||(De=se[X.pos++],we|=(De&127)<<17,De<128)||(De=se[X.pos++],we|=(De&127)<<24,De<128)||(De=se[X.pos++],we|=(De&1)<<31,De<128))return Ko(k,we,C);throw new Error("Expected varint not more than 10 bytes")}function lo(k){return k.type===Bn.Bytes?k.readVarint()+k.pos:k.pos+1}function Ko(k,C,X){return X?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function fl(k,C){var X,se;if(k>=0?(X=k%4294967296|0,se=k/4294967296|0):(X=~(-k%4294967296),se=~(-k/4294967296),X^4294967295?X=X+1|0:(X=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),is(X,se,C),Yo(se,C)}function is(k,C,X){X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos]=k&127}function Yo(k,C){var X=(k&7)<<4;C.buf[C.pos++]|=X|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function Is(k,C,X){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));X.realloc(se);for(var we=X.pos-1;we>=k;we--)X.buf[we+se]=X.buf[we]}function Ms(k,C){for(var X=0;X>>8,k[X+2]=C>>>16,k[X+3]=C>>>24}function Zh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function ld(k,C,X){for(var se="",we=C;we239?4:De>223?3:De>191?2:1;if(we+mt>X)break;var jt,tr,fr;mt===1?De<128&&(He=De):mt===2?(jt=k[we+1],(jt&192)===128&&(He=(De&31)<<6|jt&63,He<=127&&(He=null))):mt===3?(jt=k[we+1],tr=k[we+2],(jt&192)===128&&(tr&192)===128&&(He=(De&15)<<12|(jt&63)<<6|tr&63,(He<=2047||He>=55296&&He<=57343)&&(He=null))):mt===4&&(jt=k[we+1],tr=k[we+2],fr=k[we+3],(jt&192)===128&&(tr&192)===128&&(fr&192)===128&&(He=(De&15)<<18|(jt&63)<<12|(tr&63)<<6|fr&63,(He<=65535||He>=1114112)&&(He=null))),He===null?(He=65533,mt=1):He>65535&&(He-=65536,se+=String.fromCharCode(He>>>10&1023|55296),He=56320|He&1023),se+=String.fromCharCode(He),we+=mt}return se}function ud(k,C,X){return Qa.decode(k.subarray(C,X))}function cd(k,C,X){for(var se=0,we,De;se55295&&we<57344)if(De)if(we<56320){k[X++]=239,k[X++]=191,k[X++]=189,De=we;continue}else we=De-55296<<10|we-56320|65536,De=null;else{we>56319||se+1===C.length?(k[X++]=239,k[X++]=191,k[X++]=189):De=we;continue}else De&&(k[X++]=239,k[X++]=191,k[X++]=189,De=null);we<128?k[X++]=we:(we<2048?k[X++]=we>>6|192:(we<65536?k[X++]=we>>12|224:(k[X++]=we>>18|240,k[X++]=we>>12&63|128),k[X++]=we>>6&63|128),k[X++]=we&63|128)}return X}var Xf=3;function lv(k,C,X){k===1&&X.readMessage(Jv,C)}function Jv(k,C,X){if(k===3){var se=X.readMessage(Uv,{}),we=se.id,De=se.bitmap,He=se.width,mt=se.height,jt=se.left,tr=se.top,fr=se.advance;C.push({id:we,bitmap:new Yh({width:He+2*Xf,height:mt+2*Xf},De),metrics:{width:He,height:mt,left:jt,top:tr,advance:fr}})}}function Uv(k,C,X){k===1?C.id=X.readVarint():k===2?C.bitmap=X.readBytes():k===3?C.width=X.readVarint():k===4?C.height=X.readVarint():k===5?C.left=X.readSVarint():k===6?C.top=X.readSVarint():k===7&&(C.advance=X.readVarint())}function fd(k){return new An(k).readFields(lv,[])}var Mv=Xf;function Hd(k){for(var C=0,X=0,se=0,we=k;se=0;Wr--){var _n=mt[Wr];if(!(en.w>_n.w||en.h>_n.h)){if(en.x=_n.x,en.y=_n.y,tr=Math.max(tr,en.y+en.h),jt=Math.max(jt,en.x+en.w),en.w===_n.w&&en.h===_n.h){var Wn=mt.pop();Wr=0&&we>=C&&Gd[this.text.charCodeAt(we)];we--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},nf.prototype.substring=function(C,X){var se=new nf;return se.text=this.text.substring(C,X),se.sectionIndex=this.sectionIndex.slice(C,X),se.sections=this.sections,se},nf.prototype.toString=function(){return this.text},nf.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(X,se){return Math.max(X,C.sections[se].scale)},0)},nf.prototype.addTextSection=function(C,X){this.text+=C.text,this.sections.push(Qv.forText(C.scale,C.fontStack||X));for(var se=this.sections.length-1,we=0;we=$p?null:++this.imageSectionID:(this.imageSectionID=Kp,this.imageSectionID)};function Ev(k,C){for(var X=[],se=k.text,we=0,De=0,He=C;De=0,fr=0,Or=0;Or0&&Jh>ss&&(ss=Jh)}else{var Fu=X[$o.fontStack],Lu=Fu&&Fu[ls];if(Lu&&Lu.rect)al=Lu.rect,jl=Lu.metrics;else{var af=C[$o.fontStack],gf=af&&af[ls];if(!gf)continue;jl=gf.metrics}ps=(Ai-$o.scale)*xr}Ou?(k.verticalizable=!0,vo.push({glyph:ls,imageName:zu,x:en,y:Wr+ps,vertical:Ou,scale:$o.scale,fontStack:$o.fontStack,sectionIndex:hl,metrics:jl,rect:al}),en+=Bc*$o.scale+tr):(vo.push({glyph:ls,imageName:zu,x:en,y:Wr+ps,vertical:Ou,scale:$o.scale,fontStack:$o.fontStack,sectionIndex:hl,metrics:jl,rect:al}),en+=jl.advance*$o.scale+tr)}if(vo.length!==0){var vd=en-tr;_n=Math.max(vd,_n),v6(vo,0,vo.length-1,Ua,ss)}en=0;var dd=De*Ai+ss;go.lineOffset=Math.max(ss,Wi),Wr+=dd,Wn=Math.max(dd,Wn),++xa}var Lv=Wr-mf,xd=vT(He),bd=xd.horizontalAlign,uv=xd.verticalAlign;d6(k.positionedLines,Ua,bd,uv,_n,Wn,De,Lv,we.length),k.top+=-uv*Lv,k.bottom=k.top+Lv,k.left+=-bd*_n,k.right=k.left+_n}function v6(k,C,X,se,we){if(!(!se&&!we))for(var De=k[X],He=De.metrics.advance*De.scale,mt=(k[X].x+He)*se,jt=C;jt<=X;jt++)k[jt].x-=mt,k[jt].y+=we}function d6(k,C,X,se,we,De,He,mt,jt){var tr=(C-X)*we,fr=0;De!==He?fr=-mt*se-mf:fr=(-se*jt+.5)*He;for(var Or=0,en=k;Or-X/2;){if(He--,He<0)return!1;mt-=k[He].dist(De),De=k[He]}mt+=k[He].dist(k[He+1]),He++;for(var jt=[],tr=0;mtse;)tr-=jt.shift().angleDelta;if(tr>we)return!1;He++,mt+=Or.dist(en)}return!0}function jv(k){for(var C=0,X=0;Xtr){var _n=(tr-jt)/Wr,Wn=lu(Or.x,en.x,_n),Ua=lu(Or.y,en.y,_n),xa=new l1(Wn,Ua,en.angleTo(Or),fr);return xa._round(),!He||BS(k,xa,mt,He,C)?xa:void 0}jt+=Wr}}function Hg(k,C,X,se,we,De,He,mt,jt){var tr=Xd(se,De,He),fr=Xm(se,we),Or=fr*He,en=k[0].x===0||k[0].x===jt||k[0].y===0||k[0].y===jt;C-Or=0&&fi=0&&Ai=0&&en+tr<=fr){var Wi=new l1(fi,Ai,vi,_n);Wi._round(),(!se||BS(k,Wi,De,se,we))&&Wr.push(Wi)}}Or+=xa}return!mt&&!Wr.length&&!He&&(Wr=Qp(k,Or/2,X,se,we,De,He,!0,jt)),Wr}function PL(k,C,X,se,we){for(var De=[],He=0;He=se&&Or.x>=se)&&(fr.x>=se?fr=new i(se,fr.y+(Or.y-fr.y)*((se-fr.x)/(Or.x-fr.x)))._round():Or.x>=se&&(Or=new i(se,fr.y+(Or.y-fr.y)*((se-fr.x)/(Or.x-fr.x)))._round()),!(fr.y>=we&&Or.y>=we)&&(fr.y>=we?fr=new i(fr.x+(Or.x-fr.x)*((we-fr.y)/(Or.y-fr.y)),we)._round():Or.y>=we&&(Or=new i(fr.x+(Or.x-fr.x)*((we-fr.y)/(Or.y-fr.y)),we)._round()),(!jt||!fr.equals(jt[jt.length-1]))&&(jt=[fr],De.push(jt)),jt.push(Or)))))}return De}var yw=pf;function RL(k,C,X,se){var we=[],De=k.image,He=De.pixelRatio,mt=De.paddedRect.w-2*yw,jt=De.paddedRect.h-2*yw,tr=k.right-k.left,fr=k.bottom-k.top,Or=De.stretchX||[[0,mt]],en=De.stretchY||[[0,jt]],Wr=function(Fu,Lu){return Fu+Lu[1]-Lu[0]},_n=Or.reduce(Wr,0),Wn=en.reduce(Wr,0),Ua=mt-_n,xa=jt-Wn,vi=0,$a=_n,fi=0,Ai=Wn,Wi=0,go=Ua,vo=0,ss=xa;if(De.content&&se){var Oo=De.content;vi=NS(Or,0,Oo[0]),fi=NS(en,0,Oo[1]),$a=NS(Or,Oo[0],Oo[2]),Ai=NS(en,Oo[1],Oo[3]),Wi=Oo[0]-vi,vo=Oo[1]-fi,go=Oo[2]-Oo[0]-$a,ss=Oo[3]-Oo[1]-Ai}var $o=function(Fu,Lu,af,gf){var ch=US(Fu.stretch-vi,$a,tr,k.left),Ah=jS(Fu.fixed-Wi,go,Fu.stretch,_n),Cv=US(Lu.stretch-fi,Ai,fr,k.top),Jh=jS(Lu.fixed-vo,ss,Lu.stretch,Wn),vd=US(af.stretch-vi,$a,tr,k.left),dd=jS(af.fixed-Wi,go,af.stretch,_n),Lv=US(gf.stretch-fi,Ai,fr,k.top),xd=jS(gf.fixed-vo,ss,gf.stretch,Wn),bd=new i(ch,Cv),uv=new i(vd,Cv),wd=new i(vd,Lv),Sp=new i(ch,Lv),Yg=new i(Ah/He,Jh/He),h1=new i(dd/He,xd/He),v1=C*Math.PI/180;if(v1){var d1=Math.sin(v1),Mw=Math.cos(v1),T0=[Mw,-d1,d1,Mw];bd._matMult(T0),uv._matMult(T0),Sp._matMult(T0),wd._matMult(T0)}var YS=Fu.stretch+Fu.fixed,A6=af.stretch+af.fixed,ZS=Lu.stretch+Lu.fixed,S6=gf.stretch+gf.fixed,e0={x:De.paddedRect.x+yw+YS,y:De.paddedRect.y+yw+ZS,w:A6-YS,h:S6-ZS},Ew=go/He/tr,WS=ss/He/fr;return{tl:bd,tr:uv,bl:Sp,br:wd,tex:e0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Yg,pixelOffsetBR:h1,minFontScaleX:Ew,minFontScaleY:WS,isSDF:X}};if(!se||!De.stretchX&&!De.stretchY)we.push($o({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:mt+1},{fixed:0,stretch:jt+1}));else for(var hl=IL(Or,Ua,_n),ls=IL(en,xa,Wn),ps=0;ps0&&(_n=Math.max(10,_n),this.circleDiameter=_n)}else{var Wn=He.top*mt-jt,Ua=He.bottom*mt+jt,xa=He.left*mt-jt,vi=He.right*mt+jt,$a=He.collisionPadding;if($a&&(xa-=$a[0]*mt,Wn-=$a[1]*mt,vi+=$a[2]*mt,Ua+=$a[3]*mt),fr){var fi=new i(xa,Wn),Ai=new i(vi,Wn),Wi=new i(xa,Ua),go=new i(vi,Ua),vo=fr*Math.PI/180;fi._rotate(vo),Ai._rotate(vo),Wi._rotate(vo),go._rotate(vo),xa=Math.min(fi.x,Ai.x,Wi.x,go.x),vi=Math.max(fi.x,Ai.x,Wi.x,go.x),Wn=Math.min(fi.y,Ai.y,Wi.y,go.y),Ua=Math.max(fi.y,Ai.y,Wi.y,go.y)}C.emplaceBack(X.x,X.y,xa,Wn,vi,Ua,se,we,De)}this.boxEndIndex=C.length},_w=function(C,X){if(C===void 0&&(C=[]),X===void 0&&(X=D9),this.data=C,this.length=this.data.length,this.compare=X,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};_w.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},_w.prototype.pop=function(){if(this.length!==0){var C=this.data[0],X=this.data.pop();return this.length--,this.length>0&&(this.data[0]=X,this._down(0)),C}},_w.prototype.peek=function(){return this.data[0]},_w.prototype._up=function(C){for(var X=this,se=X.data,we=X.compare,De=se[C];C>0;){var He=C-1>>1,mt=se[He];if(we(De,mt)>=0)break;se[C]=mt,C=He}se[C]=De},_w.prototype._down=function(C){for(var X=this,se=X.data,we=X.compare,De=this.length>>1,He=se[C];C=0)break;se[C]=jt,C=mt}se[C]=He};function D9(k,C){return kC?1:0}function z9(k,C,X){X===void 0&&(X=!1);for(var se=1/0,we=1/0,De=-1/0,He=-1/0,mt=k[0],jt=0;jtDe)&&(De=tr.x),(!jt||tr.y>He)&&(He=tr.y)}var fr=De-se,Or=He-we,en=Math.min(fr,Or),Wr=en/2,_n=new _w([],O9);if(en===0)return new i(se,we);for(var Wn=se;Wnxa.d||!xa.d)&&(xa=$a,X&&console.log("found best %d after %d probes",Math.round(1e4*$a.d)/1e4,vi)),!($a.max-xa.d<=C)&&(Wr=$a.h/2,_n.push(new xw($a.p.x-Wr,$a.p.y-Wr,Wr,k)),_n.push(new xw($a.p.x+Wr,$a.p.y-Wr,Wr,k)),_n.push(new xw($a.p.x-Wr,$a.p.y+Wr,Wr,k)),_n.push(new xw($a.p.x+Wr,$a.p.y+Wr,Wr,k)),vi+=4)}return X&&(console.log("num probes: "+vi),console.log("best distance: "+xa.d)),xa.p}function O9(k,C){return C.max-k.max}function xw(k,C,X,se){this.p=new i(k,C),this.h=X,this.d=F9(this.p,se),this.max=this.d+this.h*Math.SQRT2}function F9(k,C){for(var X=!1,se=1/0,we=0;wek.y!=fr.y>k.y&&k.x<(fr.x-tr.x)*(k.y-tr.y)/(fr.y-tr.y)+tr.x&&(X=!X),se=Math.min(se,W0(k,tr,fr))}return(X?1:-1)*Math.sqrt(se)}function B9(k){for(var C=0,X=0,se=0,we=k[0],De=0,He=we.length,mt=He-1;De=qi||T0.y<0||T0.y>=qi||j9(k,T0,Mw,X,se,we,ls,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,xa,Ai,vo,jt,$a,Wi,ss,Wr,C,De,tr,fr,He)};if(Oo==="line")for(var jl=0,al=PL(C.geometry,0,0,qi,qi);jl1){var Cv=Jp(Ah,go,X.vertical||_n,se,Wn,vi);Cv&&ps(Ah,Cv)}}else if(C.type==="Polygon")for(var Jh=0,vd=b0(C.geometry,0);Jhc1&&j(k.layerIds[0]+': Value for "text-size" is >= '+pT+'. Reduce your "text-size".')):Ua.kind==="composite"&&(xa=[Wh*Wr.compositeTextSizes[0].evaluate(He,{},_n),Wh*Wr.compositeTextSizes[1].evaluate(He,{},_n)],(xa[0]>c1||xa[1]>c1)&&j(k.layerIds[0]+': Value for "text-size" is >= '+pT+'. Reduce your "text-size".')),k.addSymbols(k.text,Wn,xa,mt,De,He,tr,C,jt.lineStartIndex,jt.lineLength,en,_n);for(var vi=0,$a=fr;vi<$a.length;vi+=1){var fi=$a[vi];Or[fi]=k.text.placedSymbolArray.length-1}return Wn.length*4}function OL(k){for(var C in k)return k[C];return null}function j9(k,C,X,se,we,De,He,mt,jt,tr,fr,Or,en,Wr,_n,Wn,Ua,xa,vi,$a,fi,Ai,Wi,go,vo){var ss,Oo=k.addToLineVertexArray(C,X),$o,hl,ls,ps,jl=0,al=0,zu=0,Bc=0,Ou=-1,Fu=-1,Lu={},af=_e(""),gf=0,ch=0;if(mt._unevaluatedLayout.getValue("text-radial-offset")===void 0?(ss=mt.layout.get("text-offset").evaluate(fi,{},go).map(function(yT){return yT*xr}),gf=ss[0],ch=ss[1]):(gf=mt.layout.get("text-radial-offset").evaluate(fi,{},go)*xr,ch=g6),k.allowVerticalPlacement&&se.vertical){var Ah=mt.layout.get("text-rotate").evaluate(fi,{},go),Cv=Ah+90,Jh=se.vertical;ls=new qS(jt,C,tr,fr,Or,Jh,en,Wr,_n,Cv),He&&(ps=new qS(jt,C,tr,fr,Or,He,Ua,xa,_n,Cv))}if(we){var vd=mt.layout.get("icon-rotate").evaluate(fi,{}),dd=mt.layout.get("icon-text-fit")!=="none",Lv=RL(we,vd,Wi,dd),xd=He?RL(He,vd,Wi,dd):void 0;hl=new qS(jt,C,tr,fr,Or,we,Ua,xa,!1,vd),jl=Lv.length*4;var bd=k.iconSizeData,uv=null;bd.kind==="source"?(uv=[Wh*mt.layout.get("icon-size").evaluate(fi,{})],uv[0]>c1&&j(k.layerIds[0]+': Value for "icon-size" is >= '+pT+'. Reduce your "icon-size".')):bd.kind==="composite"&&(uv=[Wh*Ai.compositeIconSizes[0].evaluate(fi,{},go),Wh*Ai.compositeIconSizes[1].evaluate(fi,{},go)],(uv[0]>c1||uv[1]>c1)&&j(k.layerIds[0]+': Value for "icon-size" is >= '+pT+'. Reduce your "icon-size".')),k.addSymbols(k.icon,Lv,uv,$a,vi,fi,!1,C,Oo.lineStartIndex,Oo.lineLength,-1,go),Ou=k.icon.placedSymbolArray.length-1,xd&&(al=xd.length*4,k.addSymbols(k.icon,xd,uv,$a,vi,fi,Nf.vertical,C,Oo.lineStartIndex,Oo.lineLength,-1,go),Fu=k.icon.placedSymbolArray.length-1)}for(var wd in se.horizontal){var Sp=se.horizontal[wd];if(!$o){af=_e(Sp.text);var Yg=mt.layout.get("text-rotate").evaluate(fi,{},go);$o=new qS(jt,C,tr,fr,Or,Sp,en,Wr,_n,Yg)}var h1=Sp.positionedLines.length===1;if(zu+=zL(k,C,Sp,De,mt,_n,fi,Wn,Oo,se.vertical?Nf.horizontal:Nf.horizontalOnly,h1?Object.keys(se.horizontal):[wd],Lu,Ou,Ai,go),h1)break}se.vertical&&(Bc+=zL(k,C,se.vertical,De,mt,_n,fi,Wn,Oo,Nf.vertical,["vertical"],Lu,Fu,Ai,go));var v1=$o?$o.boxStartIndex:k.collisionBoxArray.length,d1=$o?$o.boxEndIndex:k.collisionBoxArray.length,Mw=ls?ls.boxStartIndex:k.collisionBoxArray.length,T0=ls?ls.boxEndIndex:k.collisionBoxArray.length,YS=hl?hl.boxStartIndex:k.collisionBoxArray.length,A6=hl?hl.boxEndIndex:k.collisionBoxArray.length,ZS=ps?ps.boxStartIndex:k.collisionBoxArray.length,S6=ps?ps.boxEndIndex:k.collisionBoxArray.length,e0=-1,Ew=function(yT,JL){return yT&&yT.circleDiameter?Math.max(yT.circleDiameter,JL):JL};e0=Ew($o,e0),e0=Ew(ls,e0),e0=Ew(hl,e0),e0=Ew(ps,e0);var WS=e0>-1?1:0;WS&&(e0*=vo/xr),k.glyphOffsetArray.length>=Fc.MAX_GLYPHS&&j("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),fi.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,fi.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Lu.right>=0?Lu.right:-1,Lu.center>=0?Lu.center:-1,Lu.left>=0?Lu.left:-1,Lu.vertical||-1,Ou,Fu,af,v1,d1,Mw,T0,YS,A6,ZS,S6,tr,zu,Bc,jl,al,WS,0,en,gf,ch,e0)}function q9(k,C,X,se){var we=k.compareText;if(!(C in we))we[C]=[];else for(var De=we[C],He=De.length-1;He>=0;He--)if(se.dist(De[He])0)&&(He.value.kind!=="constant"||He.value.value.length>0),fr=jt.value.kind!=="constant"||!!jt.value.value||Object.keys(jt.parameters).length>0,Or=De.get("symbol-sort-key");if(this.features=[],!(!tr&&!fr)){for(var en=X.iconDependencies,Wr=X.glyphDependencies,_n=X.availableImages,Wn=new Ml(this.zoom),Ua=0,xa=C;Ua=0;for(var Bc=0,Ou=ss.sections;Bc=0;jt--)He[jt]={x:X[jt].x,y:X[jt].y,tileUnitDistanceFromAnchor:De},jt>0&&(De+=X[jt-1].dist(X[jt]));for(var tr=0;tr0},Fc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Fc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Fc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Fc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Fc.prototype.addIndicesForPlacedSymbol=function(C,X){for(var se=C.placedSymbolArray.get(X),we=se.vertexStartIndex+se.numGlyphs*4,De=se.vertexStartIndex;De1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var se=0,we=this.symbolInstanceIndexes;se=0&&tr.indexOf(mt)===jt&&X.addIndicesForPlacedSymbol(X.text,mt)}),He.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,He.verticalPlacedTextSymbolIndex),He.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.placedIconSymbolIndex),He.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Qt("SymbolBucket",Fc,{omit:["layers","collisionBoxArray","features","compareText"]}),Fc.MAX_GLYPHS=65535,Fc.addDynamicAttributes=_6;function X9(k,C){return C.replace(/{([^{}]+)}/g,function(X,se){return se in k?String(k[se]):""})}var Y9=new Ya({"symbol-placement":new mn(ci.layout_symbol["symbol-placement"]),"symbol-spacing":new mn(ci.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mn(ci.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new dn(ci.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mn(ci.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mn(ci.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new mn(ci.layout_symbol["icon-ignore-placement"]),"icon-optional":new mn(ci.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mn(ci.layout_symbol["icon-rotation-alignment"]),"icon-size":new dn(ci.layout_symbol["icon-size"]),"icon-text-fit":new mn(ci.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mn(ci.layout_symbol["icon-text-fit-padding"]),"icon-image":new dn(ci.layout_symbol["icon-image"]),"icon-rotate":new dn(ci.layout_symbol["icon-rotate"]),"icon-padding":new mn(ci.layout_symbol["icon-padding"]),"icon-keep-upright":new mn(ci.layout_symbol["icon-keep-upright"]),"icon-offset":new dn(ci.layout_symbol["icon-offset"]),"icon-anchor":new dn(ci.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mn(ci.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mn(ci.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mn(ci.layout_symbol["text-rotation-alignment"]),"text-field":new dn(ci.layout_symbol["text-field"]),"text-font":new dn(ci.layout_symbol["text-font"]),"text-size":new dn(ci.layout_symbol["text-size"]),"text-max-width":new dn(ci.layout_symbol["text-max-width"]),"text-line-height":new mn(ci.layout_symbol["text-line-height"]),"text-letter-spacing":new dn(ci.layout_symbol["text-letter-spacing"]),"text-justify":new dn(ci.layout_symbol["text-justify"]),"text-radial-offset":new dn(ci.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mn(ci.layout_symbol["text-variable-anchor"]),"text-anchor":new dn(ci.layout_symbol["text-anchor"]),"text-max-angle":new mn(ci.layout_symbol["text-max-angle"]),"text-writing-mode":new mn(ci.layout_symbol["text-writing-mode"]),"text-rotate":new dn(ci.layout_symbol["text-rotate"]),"text-padding":new mn(ci.layout_symbol["text-padding"]),"text-keep-upright":new mn(ci.layout_symbol["text-keep-upright"]),"text-transform":new dn(ci.layout_symbol["text-transform"]),"text-offset":new dn(ci.layout_symbol["text-offset"]),"text-allow-overlap":new mn(ci.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new mn(ci.layout_symbol["text-ignore-placement"]),"text-optional":new mn(ci.layout_symbol["text-optional"])}),Z9=new Ya({"icon-opacity":new dn(ci.paint_symbol["icon-opacity"]),"icon-color":new dn(ci.paint_symbol["icon-color"]),"icon-halo-color":new dn(ci.paint_symbol["icon-halo-color"]),"icon-halo-width":new dn(ci.paint_symbol["icon-halo-width"]),"icon-halo-blur":new dn(ci.paint_symbol["icon-halo-blur"]),"icon-translate":new mn(ci.paint_symbol["icon-translate"]),"icon-translate-anchor":new mn(ci.paint_symbol["icon-translate-anchor"]),"text-opacity":new dn(ci.paint_symbol["text-opacity"]),"text-color":new dn(ci.paint_symbol["text-color"],{runtimeType:ql,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new dn(ci.paint_symbol["text-halo-color"]),"text-halo-width":new dn(ci.paint_symbol["text-halo-width"]),"text-halo-blur":new dn(ci.paint_symbol["text-halo-blur"]),"text-translate":new mn(ci.paint_symbol["text-translate"]),"text-translate-anchor":new mn(ci.paint_symbol["text-translate-anchor"])}),x6={paint:Z9,layout:Y9},Tw=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:_u,this.defaultValue=C};Tw.prototype.evaluate=function(C){if(C.formattedSection){var X=this.defaultValue.property.overrides;if(X&&X.hasOverride(C.formattedSection))return X.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},Tw.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var X=this.defaultValue.value;C(X._styleExpression.expression)}},Tw.prototype.outputDefined=function(){return!1},Tw.prototype.serialize=function(){return null},Qt("FormatSectionOverride",Tw,{omit:["defaultValue"]});var W9=(function(k){function C(X){k.call(this,X,x6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,we){if(k.prototype.recalculate.call(this,se,we),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 De=this.layout.get("text-writing-mode");if(De){for(var He=[],mt=0,jt=De;mt",targetMapId:we,sourceMapId:He.mapId})}}},Aw.prototype.receive=function(C){var X=C.data,se=X.id;if(se&&!(X.targetMapId&&this.mapId!==X.targetMapId))if(X.type===""){delete this.tasks[se];var we=this.cancelCallbacks[se];delete this.cancelCallbacks[se],we&&we()}else le()||X.mustQueue?(this.tasks[se]=X,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,X)},Aw.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),X=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),X&&this.processTask(C,X)}},Aw.prototype.processTask=function(C,X){var se=this;if(X.type===""){var we=this.callbacks[C];delete this.callbacks[C],we&&(X.error?we(fn(X.error)):we(null,fn(X.data)))}else{var De=!1,He=ee(this.globalScope)?void 0:[],mt=X.hasCallback?function(en,Wr){De=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:en?Hr(en):null,data:Hr(Wr,He)},He)}:function(en){De=!0},jt=null,tr=fn(X.data);if(this.parent[X.type])jt=this.parent[X.type](X.sourceMapId,tr,mt);else if(this.parent.getWorkerSource){var fr=X.type.split("."),Or=this.parent.getWorkerSource(X.sourceMapId,fr[0],tr.source);jt=Or[fr[1]](tr,mt)}else mt(new Error("Could not find function "+X.type));!De&&jt&&jt.cancel&&(this.cancelCallbacks[C]=jt.cancel)}},Aw.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function oO(k,C,X){C=Math.pow(2,X)-C-1;var se=jL(k*256,C*256,X),we=jL((k+1)*256,(C+1)*256,X);return se[0]+","+se[1]+","+we[0]+","+we[1]}function jL(k,C,X){var se=2*Math.PI*6378137/256/Math.pow(2,X),we=k*se-2*Math.PI*6378137/2,De=C*se-2*Math.PI*6378137/2;return[we,De]}var Kh=function(C,X){C&&(X?this.setSouthWest(C).setNorthEast(X):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};Kh.prototype.setNorthEast=function(C){return this._ne=C instanceof Uf?new Uf(C.lng,C.lat):Uf.convert(C),this},Kh.prototype.setSouthWest=function(C){return this._sw=C instanceof Uf?new Uf(C.lng,C.lat):Uf.convert(C),this},Kh.prototype.extend=function(C){var X=this._sw,se=this._ne,we,De;if(C instanceof Uf)we=C,De=C;else if(C instanceof Kh){if(we=C._sw,De=C._ne,!we||!De)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var He=C;return this.extend(Kh.convert(He))}else{var mt=C;return this.extend(Uf.convert(mt))}return this}return!X&&!se?(this._sw=new Uf(we.lng,we.lat),this._ne=new Uf(De.lng,De.lat)):(X.lng=Math.min(we.lng,X.lng),X.lat=Math.min(we.lat,X.lat),se.lng=Math.max(De.lng,se.lng),se.lat=Math.max(De.lat,se.lat)),this},Kh.prototype.getCenter=function(){return new Uf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Kh.prototype.getSouthWest=function(){return this._sw},Kh.prototype.getNorthEast=function(){return this._ne},Kh.prototype.getNorthWest=function(){return new Uf(this.getWest(),this.getNorth())},Kh.prototype.getSouthEast=function(){return new Uf(this.getEast(),this.getSouth())},Kh.prototype.getWest=function(){return this._sw.lng},Kh.prototype.getSouth=function(){return this._sw.lat},Kh.prototype.getEast=function(){return this._ne.lng},Kh.prototype.getNorth=function(){return this._ne.lat},Kh.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Kh.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Kh.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Kh.prototype.contains=function(C){var X=Uf.convert(C),se=X.lng,we=X.lat,De=this._sw.lat<=we&&we<=this._ne.lat,He=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(He=this._sw.lng>=se&&se>=this._ne.lng),De&&He},Kh.convert=function(C){return!C||C instanceof Kh?C:new Kh(C)};var qL=63710088e-1,Uf=function(C,X){if(isNaN(C)||isNaN(X))throw new Error("Invalid LngLat object: ("+C+", "+X+")");if(this.lng=+C,this.lat=+X,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Uf.prototype.wrap=function(){return new Uf(g(this.lng,-180,180),this.lat)},Uf.prototype.toArray=function(){return[this.lng,this.lat]},Uf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Uf.prototype.distanceTo=function(C){var X=Math.PI/180,se=this.lat*X,we=C.lat*X,De=Math.sin(se)*Math.sin(we)+Math.cos(se)*Math.cos(we)*Math.cos((C.lng-this.lng)*X),He=qL*Math.acos(Math.min(De,1));return He},Uf.prototype.toBounds=function(C){C===void 0&&(C=0);var X=40075017,se=360*C/X,we=se/Math.cos(Math.PI/180*this.lat);return new Kh(new Uf(this.lng-we,this.lat-se),new Uf(this.lng+we,this.lat+se))},Uf.convert=function(C){if(C instanceof Uf)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Uf(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Uf(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var VL=2*Math.PI*qL;function HL(k){return VL*Math.cos(k*Math.PI/180)}function GL(k){return(180+k)/360}function XL(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function YL(k,C){return k/HL(C)}function sO(k){return k*360-180}function w6(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function lO(k,C){return k*HL(w6(C))}function uO(k){return 1/Math.cos(k*Math.PI/180)}var W_=function(C,X,se){se===void 0&&(se=0),this.x=+C,this.y=+X,this.z=+se};W_.fromLngLat=function(C,X){X===void 0&&(X=0);var se=Uf.convert(C);return new W_(GL(se.lng),XL(se.lat),YL(X,se.lat))},W_.prototype.toLngLat=function(){return new Uf(sO(this.x),w6(this.y))},W_.prototype.toAltitude=function(){return lO(this.z,this.y)},W_.prototype.meterInMercatorCoordinateUnits=function(){return 1/VL*uO(w6(this.y))};var K_=function(C,X,se){this.z=C,this.x=X,this.y=se,this.key=gT(0,C,C,X,se)};K_.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},K_.prototype.url=function(C,X){var se=oO(this.x,this.y,this.z),we=cO(this.z,this.x,this.y);return C[(this.x+this.y)%C.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(X==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",we).replace("{bbox-epsg-3857}",se)},K_.prototype.getTilePoint=function(C){var X=Math.pow(2,this.z);return new i((C.x*X-this.x)*qi,(C.y*X-this.y)*qi)},K_.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ZL=function(C,X){this.wrap=C,this.canonical=X,this.key=gT(C,X.z,X.z,X.x,X.y)},$h=function(C,X,se,we,De){this.overscaledZ=C,this.wrap=X,this.canonical=new K_(se,+we,+De),this.key=gT(X,C,se,we,De)};$h.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},$h.prototype.scaledTo=function(C){var X=this.canonical.z-C;return C>this.canonical.z?new $h(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new $h(C,this.wrap,C,this.canonical.x>>X,this.canonical.y>>X)},$h.prototype.calculateScaledKey=function(C,X){var se=this.canonical.z-C;return C>this.canonical.z?gT(this.wrap*+X,C,this.canonical.z,this.canonical.x,this.canonical.y):gT(this.wrap*+X,C,C,this.canonical.x>>se,this.canonical.y>>se)},$h.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var X=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>X&&C.canonical.y===this.canonical.y>>X},$h.prototype.children=function(C){if(this.overscaledZ>=C)return[new $h(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var X=this.canonical.z+1,se=this.canonical.x*2,we=this.canonical.y*2;return[new $h(X,this.wrap,X,se,we),new $h(X,this.wrap,X,se+1,we),new $h(X,this.wrap,X,se,we+1),new $h(X,this.wrap,X,se+1,we+1)]},$h.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;De--)we=1<=this.dim+1||X<-1||X>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(X+1)*this.stride+(C+1)},Gg.prototype._unpackMapbox=function(C,X,se){return(C*256*256+X*256+se)/10-1e4},Gg.prototype._unpackTerrarium=function(C,X,se){return C*256+X+se/256-32768},Gg.prototype.getPixels=function(){return new Bv({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Gg.prototype.backfillBorder=function(C,X,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var we=X*this.dim,De=X*this.dim+this.dim,He=se*this.dim,mt=se*this.dim+this.dim;switch(X){case-1:we=De-1;break;case 1:De=we+1;break}switch(se){case-1:He=mt-1;break;case 1:mt=He+1;break}for(var jt=-X*this.dim,tr=-se*this.dim,fr=He;fr=0&&Or[3]>=0&&jt.insert(mt,Or[0],Or[1],Or[2],Or[3])}},Xg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Vg.VectorTile(new An(this.rawTileData)).layers,this.sourceLayerCoder=new GS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Xg.prototype.query=function(C,X,se,we){var De=this;this.loadVTLayers();for(var He=C.params||{},mt=qi/C.tileSize/C.scale,jt=et(He.filter),tr=C.queryGeometry,fr=C.queryPadding*mt,Or=KL(tr),en=this.grid.query(Or.minX-fr,Or.minY-fr,Or.maxX+fr,Or.maxY+fr),Wr=KL(C.cameraQueryGeometry),_n=this.grid3D.query(Wr.minX-fr,Wr.minY-fr,Wr.maxX+fr,Wr.maxY+fr,function(Wi,go,vo,ss){return wp(C.cameraQueryGeometry,Wi-fr,go-fr,vo+fr,ss+fr)}),Wn=0,Ua=_n;Wnwe)De=!1;else if(!X)De=!0;else if(this.expirationTime=Ur.maxzoom)&&Ur.visibility!=="none"){f(Ir,this.zoom,sr);var sn=da[Ur.id]=Ur.createBucket({index:Kn.bucketLayerIDs.length,layers:Ir,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:hi,sourceID:this.source});sn.populate(Ti,fa,this.tileID.canonical),Kn.bucketLayerIDs.push(Ir.map(function(un){return un.id}))}}}}var Kr,Tt,or,Dr,ln=e.mapObject(fa.glyphDependencies,function(un){return Object.keys(un).map(Number)});Object.keys(ln).length?Vr.send("getGlyphs",{uid:this.uid,stacks:ln},function(un,Rn){Kr||(Kr=un,Tt=Rn,Un.call(pn))}):Tt={};var Pn=Object.keys(fa.iconDependencies);Pn.length?Vr.send("getImages",{icons:Pn,source:this.source,tileID:this.tileID,type:"icons"},function(un,Rn){Kr||(Kr=un,or=Rn,Un.call(pn))}):or={};var jn=Object.keys(fa.patternDependencies);jn.length?Vr.send("getImages",{icons:jn,source:this.source,tileID:this.tileID,type:"patterns"},function(un,Rn){Kr||(Kr=un,Dr=Rn,Un.call(pn))}):Dr={},Un.call(this);function Un(){if(Kr)return on(Kr);if(Tt&&or&&Dr){var un=new a(Tt),Rn=new e.ImageAtlas(or,Dr);for(var di in da){var Ma=da[di];Ma instanceof e.SymbolBucket?(f(Ma.layers,this.zoom,sr),e.performSymbolLayout(Ma,Tt,un.positions,or,Rn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ma.hasPattern&&(Ma instanceof e.LineBucket||Ma instanceof e.FillBucket||Ma instanceof e.FillExtrusionBucket)&&(f(Ma.layers,this.zoom,sr),Ma.addFeatures(fa,this.tileID.canonical,Rn.patternPositions))}this.status="done",on(null,{buckets:e.values(da).filter(function(Ei){return!Ei.isEmpty()}),featureIndex:Kn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:un.image,imageAtlas:Rn,glyphMap:this.returnDependencies?Tt:null,iconMap:this.returnDependencies?or:null,glyphPositions:this.returnDependencies?un.positions:null})}}};function f(ir,qt,ar){for(var sr=new e.EvaluationParameters(qt),Vr=0,on=ir;Vr=0!=!!qt&&ir.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(qt){this._feature=qt,this.extent=e.EXTENT,this.type=qt.type,this.properties=qt.tags,"id"in qt&&!isNaN(qt.id)&&(this.id=parseInt(qt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var qt=[],ar=0,sr=this._feature.geometry;ar"u"&&(sr.push(wn),Kn=sr.length-1,on[wn]=Kn),qt.writeVarint(Kn);var da=ar.properties[wn],fa=typeof da;fa!=="string"&&fa!=="boolean"&&fa!=="number"&&(da=JSON.stringify(da));var ga=fa+":"+da,ka=pn[ga];typeof ka>"u"&&(Vr.push(da),ka=Vr.length-1,pn[ga]=ka),qt.writeVarint(ka)}}function re(ir,qt){return(qt<<3)+(ir&7)}function fe(ir){return ir<<1^ir>>31}function le(ir,qt){for(var ar=ir.loadGeometry(),sr=ir.type,Vr=0,on=0,pn=ar.length,wn=0;wn>1;ee(ir,qt,pn,sr,Vr,on%2),V(ir,qt,ar,sr,pn-1,on+1),V(ir,qt,ar,pn+1,Vr,on+1)}}function ee(ir,qt,ar,sr,Vr,on){for(;Vr>sr;){if(Vr-sr>600){var pn=Vr-sr+1,wn=ar-sr+1,Kn=Math.log(pn),da=.5*Math.exp(2*Kn/3),fa=.5*Math.sqrt(Kn*da*(pn-da)/pn)*(wn-pn/2<0?-1:1),ga=Math.max(sr,Math.floor(ar-wn*da/pn+fa)),ka=Math.min(Vr,Math.floor(ar+(pn-wn)*da/pn+fa));ee(ir,qt,ar,ga,ka,on)}var Vn=qt[2*ar+on],hi=sr,Ti=Vr;for(ne(ir,qt,sr,ar),qt[2*Vr+on]>Vn&&ne(ir,qt,sr,Vr);hiVn;)Ti--}qt[2*sr+on]===Vn?ne(ir,qt,sr,Ti):(Ti++,ne(ir,qt,Ti,Vr)),Ti<=ar&&(sr=Ti+1),ar<=Ti&&(Vr=Ti-1)}}function ne(ir,qt,ar,sr){K(ir,ar,sr),K(qt,2*ar,2*sr),K(qt,2*ar+1,2*sr+1)}function K(ir,qt,ar){var sr=ir[qt];ir[qt]=ir[ar],ir[ar]=sr}function ue(ir,qt,ar,sr,Vr,on,pn){for(var wn=[0,ir.length-1,0],Kn=[],da,fa;wn.length;){var ga=wn.pop(),ka=wn.pop(),Vn=wn.pop();if(ka-Vn<=pn){for(var hi=Vn;hi<=ka;hi++)da=qt[2*hi],fa=qt[2*hi+1],da>=ar&&da<=Vr&&fa>=sr&&fa<=on&&Kn.push(ir[hi]);continue}var Ti=Math.floor((Vn+ka)/2);da=qt[2*Ti],fa=qt[2*Ti+1],da>=ar&&da<=Vr&&fa>=sr&&fa<=on&&Kn.push(ir[Ti]);var Dt=(ga+1)%2;(ga===0?ar<=da:sr<=fa)&&(wn.push(Vn),wn.push(Ti-1),wn.push(Dt)),(ga===0?Vr>=da:on>=fa)&&(wn.push(Ti+1),wn.push(ka),wn.push(Dt))}return Kn}function te(ir,qt,ar,sr,Vr,on){for(var pn=[0,ir.length-1,0],wn=[],Kn=Vr*Vr;pn.length;){var da=pn.pop(),fa=pn.pop(),ga=pn.pop();if(fa-ga<=on){for(var ka=ga;ka<=fa;ka++)H(qt[2*ka],qt[2*ka+1],ar,sr)<=Kn&&wn.push(ir[ka]);continue}var Vn=Math.floor((ga+fa)/2),hi=qt[2*Vn],Ti=qt[2*Vn+1];H(hi,Ti,ar,sr)<=Kn&&wn.push(ir[Vn]);var Dt=(da+1)%2;(da===0?ar-Vr<=hi:sr-Vr<=Ti)&&(pn.push(ga),pn.push(Vn-1),pn.push(Dt)),(da===0?ar+Vr>=hi:sr+Vr>=Ti)&&(pn.push(Vn+1),pn.push(fa),pn.push(Dt))}return wn}function H(ir,qt,ar,sr){var Vr=ir-ar,on=qt-sr;return Vr*Vr+on*on}var ae=function(ir){return ir[0]},ie=function(ir){return ir[1]},ve=function(qt,ar,sr,Vr,on){ar===void 0&&(ar=ae),sr===void 0&&(sr=ie),Vr===void 0&&(Vr=64),on===void 0&&(on=Float64Array),this.nodeSize=Vr,this.points=qt;for(var pn=qt.length<65536?Uint16Array:Uint32Array,wn=this.ids=new pn(qt.length),Kn=this.coords=new on(qt.length*2),da=0;da=Vr;fa--){var ga=+Date.now();Kn=this._cluster(Kn,fa),this.trees[fa]=new ve(Kn,pe,Ne,pn,Float32Array),sr&&console.log("z%d: %d clusters in %dms",fa,Kn.length,+Date.now()-ga)}return sr&&console.timeEnd("total time"),this},Ce.prototype.getClusters=function(qt,ar){var sr=((qt[0]+180)%360+360)%360-180,Vr=Math.max(-90,Math.min(90,qt[1])),on=qt[2]===180?180:((qt[2]+180)%360+360)%360-180,pn=Math.max(-90,Math.min(90,qt[3]));if(qt[2]-qt[0]>=360)sr=-180,on=180;else if(sr>on){var wn=this.getClusters([sr,Vr,180,pn],ar),Kn=this.getClusters([-180,Vr,on,pn],ar);return wn.concat(Kn)}for(var da=this.trees[this._limitZoom(ar)],fa=da.range(st(sr),nt(pn),st(on),nt(Vr)),ga=[],ka=0,Vn=fa;kaar&&(Ti+=Nr.numPoints||1)}if(Ti>=Kn){for(var jr=ga.x*hi,Ir=ga.y*hi,Ur=wn&&hi>1?this._map(ga,!0):null,sn=(fa<<5)+(ar+1)+this.points.length,Kr=0,Tt=Vn;Kr1)for(var Pn=0,jn=Vn;Pn>5},Ce.prototype._getOriginZoom=function(qt){return(qt-this.points.length)%32},Ce.prototype._map=function(qt,ar){if(qt.numPoints)return ar?Te({},qt.properties):qt.properties;var sr=this.points[qt.index].properties,Vr=this.options.map(sr);return ar&&Vr===sr?Te({},Vr):Vr};function Fe(ir,qt,ar,sr,Vr){return{x:ir,y:qt,zoom:1/0,id:ar,parentId:-1,numPoints:sr,properties:Vr}}function ze(ir,qt){var ar=ir.geometry.coordinates,sr=ar[0],Vr=ar[1];return{x:st(sr),y:nt(Vr),zoom:1/0,index:qt,parentId:-1}}function Ye(ir){return{type:"Feature",id:ir.id,properties:it(ir),geometry:{type:"Point",coordinates:[Qe(ir.x),Le(ir.y)]}}}function it(ir){var qt=ir.numPoints,ar=qt>=1e4?Math.round(qt/1e3)+"k":qt>=1e3?Math.round(qt/100)/10+"k":qt;return Te(Te({},ir.properties),{cluster:!0,cluster_id:ir.id,point_count:qt,point_count_abbreviated:ar})}function st(ir){return ir/360+.5}function nt(ir){var qt=Math.sin(ir*Math.PI/180),ar=.5-.25*Math.log((1+qt)/(1-qt))/Math.PI;return ar<0?0:ar>1?1:ar}function Qe(ir){return(ir-.5)*360}function Le(ir){var qt=(180-ir*360)*Math.PI/180;return 360*Math.atan(Math.exp(qt))/Math.PI-90}function Te(ir,qt){for(var ar in qt)ir[ar]=qt[ar];return ir}function pe(ir){return ir.x}function Ne(ir){return ir.y}function ot(ir,qt,ar,sr){for(var Vr=sr,on=ar-qt>>1,pn=ar-qt,wn,Kn=ir[qt],da=ir[qt+1],fa=ir[ar],ga=ir[ar+1],ka=qt+3;kaVr)wn=ka,Vr=Vn;else if(Vn===Vr){var hi=Math.abs(ka-on);hisr&&(wn-qt>3&&ot(ir,qt,wn,sr),ir[wn+2]=Vr,ar-wn>3&&ot(ir,wn,ar,sr))}function ct(ir,qt,ar,sr,Vr,on){var pn=Vr-ar,wn=on-sr;if(pn!==0||wn!==0){var Kn=((ir-ar)*pn+(qt-sr)*wn)/(pn*pn+wn*wn);Kn>1?(ar=Vr,sr=on):Kn>0&&(ar+=pn*Kn,sr+=wn*Kn)}return pn=ir-ar,wn=qt-sr,pn*pn+wn*wn}function rt(ir,qt,ar,sr){var Vr={id:typeof ir>"u"?null:ir,type:qt,geometry:ar,tags:sr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ft(Vr),Vr}function Ft(ir){var qt=ir.geometry,ar=ir.type;if(ar==="Point"||ar==="MultiPoint"||ar==="LineString")Nt(ir,qt);else if(ar==="Polygon"||ar==="MultiLineString")for(var sr=0;sr0&&(sr?pn+=(Vr*da-Kn*on)/2:pn+=Math.sqrt(Math.pow(Kn-Vr,2)+Math.pow(da-on,2))),Vr=Kn,on=da}var fa=qt.length-3;qt[2]=1,ot(qt,0,fa,ar),qt[fa+2]=1,qt.size=Math.abs(pn),qt.start=0,qt.end=qt.size}function Zr(ir,qt,ar,sr){for(var Vr=0;Vr1?1:ar}function Mt(ir,qt,ar,sr,Vr,on,pn,wn){if(ar/=qt,sr/=qt,on>=ar&&pn=sr)return null;for(var Kn=[],da=0;da=ar&&hi=sr)continue;var Ti=[];if(ka==="Point"||ka==="MultiPoint")je(ga,Ti,ar,sr,Vr);else if(ka==="LineString")$e(ga,Ti,ar,sr,Vr,!1,wn.lineMetrics);else if(ka==="MultiLineString")xe(ga,Ti,ar,sr,Vr,!1);else if(ka==="Polygon")xe(ga,Ti,ar,sr,Vr,!0);else if(ka==="MultiPolygon")for(var Dt=0;Dt=ar&&pn<=sr&&(qt.push(ir[on]),qt.push(ir[on+1]),qt.push(ir[on+2]))}}function $e(ir,qt,ar,sr,Vr,on,pn){for(var wn=Ee(ir),Kn=Vr===0?Me:Xe,da=ir.start,fa,ga,ka=0;kaar&&(ga=Kn(wn,Vn,hi,Dt,yt,ar),pn&&(wn.start=da+fa*ga)):Er>sr?Nr=ar&&(ga=Kn(wn,Vn,hi,Dt,yt,ar),jr=!0),Nr>sr&&Er<=sr&&(ga=Kn(wn,Vn,hi,Dt,yt,sr),jr=!0),!on&&jr&&(pn&&(wn.end=da+fa*ga),qt.push(wn),wn=Ee(ir)),pn&&(da+=fa)}var Ir=ir.length-3;Vn=ir[Ir],hi=ir[Ir+1],Ti=ir[Ir+2],Er=Vr===0?Vn:hi,Er>=ar&&Er<=sr&&ye(wn,Vn,hi,Ti),Ir=wn.length-3,on&&Ir>=3&&(wn[Ir]!==wn[0]||wn[Ir+1]!==wn[1])&&ye(wn,wn[0],wn[1],wn[2]),wn.length&&qt.push(wn)}function Ee(ir){var qt=[];return qt.size=ir.size,qt.start=ir.start,qt.end=ir.end,qt}function xe(ir,qt,ar,sr,Vr,on){for(var pn=0;pnpn.maxX&&(pn.maxX=fa),ga>pn.maxY&&(pn.maxY=ga)}return pn}function pr(ir,qt,ar,sr){var Vr=qt.geometry,on=qt.type,pn=[];if(on==="Point"||on==="MultiPoint")for(var wn=0;wn0&&qt.size<(Vr?pn:sr)){ar.numPoints+=qt.length/3;return}for(var wn=[],Kn=0;Knpn)&&(ar.numSimplified++,wn.push(qt[Kn]),wn.push(qt[Kn+1])),ar.numPoints++;Vr&&Fr(wn,on),ir.push(wn)}function Fr(ir,qt){for(var ar=0,sr=0,Vr=ir.length,on=Vr-2;sr0===qt)for(sr=0,Vr=ir.length;sr24)throw new Error("maxZoom should be in the 0-24 range");if(qt.promoteId&&qt.generateId)throw new Error("promoteId and generateId cannot be used together.");var sr=$t(ir,qt);this.tiles={},this.tileCoords=[],ar&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),sr=Je(sr,qt),sr.length&&this.splitTile(sr,0,0,0),ar&&(sr.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)))}Zn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Zn.prototype.splitTile=function(ir,qt,ar,sr,Vr,on,pn){for(var wn=[ir,qt,ar,sr],Kn=this.options,da=Kn.debug;wn.length;){sr=wn.pop(),ar=wn.pop(),qt=wn.pop(),ir=wn.pop();var fa=1<1&&console.time("creation"),ka=this.tiles[ga]=_r(ir,qt,ar,sr,Kn),this.tileCoords.push({z:qt,x:ar,y:sr}),da)){da>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,ar,sr,ka.numFeatures,ka.numPoints,ka.numSimplified),console.timeEnd("creation"));var Vn="z"+qt;this.stats[Vn]=(this.stats[Vn]||0)+1,this.total++}if(ka.source=ir,Vr){if(qt===Kn.maxZoom||qt===Vr)continue;var hi=1<1&&console.time("clipping");var Ti=.5*Kn.buffer/Kn.extent,Dt=.5-Ti,yt=.5+Ti,Er=1+Ti,Nr,jr,Ir,Ur,sn,Kr;Nr=jr=Ir=Ur=null,sn=Mt(ir,fa,ar-Ti,ar+yt,0,ka.minX,ka.maxX,Kn),Kr=Mt(ir,fa,ar+Dt,ar+Er,0,ka.minX,ka.maxX,Kn),ir=null,sn&&(Nr=Mt(sn,fa,sr-Ti,sr+yt,1,ka.minY,ka.maxY,Kn),jr=Mt(sn,fa,sr+Dt,sr+Er,1,ka.minY,ka.maxY,Kn),sn=null),Kr&&(Ir=Mt(Kr,fa,sr-Ti,sr+yt,1,ka.minY,ka.maxY,Kn),Ur=Mt(Kr,fa,sr+Dt,sr+Er,1,ka.minY,ka.maxY,Kn),Kr=null),da>1&&console.timeEnd("clipping"),wn.push(Nr||[],qt+1,ar*2,sr*2),wn.push(jr||[],qt+1,ar*2,sr*2+1),wn.push(Ir||[],qt+1,ar*2+1,sr*2),wn.push(Ur||[],qt+1,ar*2+1,sr*2+1)}}},Zn.prototype.getTile=function(ir,qt,ar){var sr=this.options,Vr=sr.extent,on=sr.debug;if(ir<0||ir>24)return null;var pn=1<1&&console.log("drilling down to z%d-%d-%d",ir,qt,ar);for(var Kn=ir,da=qt,fa=ar,ga;!ga&&Kn>0;)Kn--,da=Math.floor(da/2),fa=Math.floor(fa/2),ga=this.tiles[qn(Kn,da,fa)];return!ga||!ga.source?null:(on>1&&console.log("found parent tile z%d-%d-%d",Kn,da,fa),on>1&&console.time("drilling down"),this.splitTile(ga.source,Kn,da,fa,ir,qt,ar),on>1&&console.timeEnd("drilling down"),this.tiles[wn]?Ot(this.tiles[wn],Vr):null)};function qn(ir,qt,ar){return((1<=0?0:be.button},r.remove=function(be){be.parentNode&&be.parentNode.removeChild(be)};function d(be,q,he){var J,_e,qe,lt=e.browser.devicePixelRatio>1?"@2x":"",vt=e.getJSON(q.transformRequest(q.normalizeSpriteURL(be,lt,".json"),e.ResourceType.SpriteJSON),function(bt,Zt){vt=null,qe||(qe=bt,J=Zt,at())}),Ke=e.getImage(q.transformRequest(q.normalizeSpriteURL(be,lt,".png"),e.ResourceType.SpriteImage),function(bt,Zt){Ke=null,qe||(qe=bt,_e=Zt,at())});function at(){if(qe)he(qe);else if(J&&_e){var bt=e.browser.getImageData(_e),Zt={};for(var Vt in J){var Kt=J[Vt],nr=Kt.width,er=Kt.height,Bt=Kt.x,Xt=Kt.y,Ht=Kt.sdf,zr=Kt.pixelRatio,Yr=Kt.stretchX,cn=Kt.stretchY,sa=Kt.content,Yn=new e.RGBAImage({width:nr,height:er});e.RGBAImage.copy(bt,Yn,{x:Bt,y:Xt},{x:0,y:0},{width:nr,height:er}),Zt[Vt]={data:Yn,pixelRatio:zr,sdf:Ht,stretchX:Yr,stretchY:cn,content:sa}}he(null,Zt)}}return{cancel:function(){vt&&(vt.cancel(),vt=null),Ke&&(Ke.cancel(),Ke=null)}}}function T(be){var q=be.userImage;if(q&&q.render){var he=q.render();if(he)return be.data.replace(new Uint8Array(q.data.buffer)),!0}return!1}var l=1,g=(function(be){function q(){be.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 be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.isLoaded=function(){return this.loaded},q.prototype.setLoaded=function(J){if(this.loaded!==J&&(this.loaded=J,J)){for(var _e=0,qe=this.requestors;_e=0?1.2:1))}w.prototype.draw=function(be){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(be,this.buffer,this.middle);for(var q=this.ctx.getImageData(0,0,this.size,this.size),he=new Uint8ClampedArray(this.size*this.size),J=0;J65535){bt(new Error("glyphs > 65535 not supported"));return}if(Kt.ranges[er]){bt(null,{stack:Zt,id:Vt,glyph:nr});return}var Bt=Kt.requests[er];Bt||(Bt=Kt.requests[er]=[],v.loadGlyphRange(Zt,er,J.url,J.requestManager,function(Xt,Ht){if(Ht){for(var zr in Ht)J._doesCharSupportLocalGlyph(+zr)||(Kt.glyphs[+zr]=Ht[+zr]);Kt.ranges[er]=!0}for(var Yr=0,cn=Bt;Yr1&&(at=q[++Ke]);var Zt=Math.abs(bt-at.left),Vt=Math.abs(bt-at.right),Kt=Math.min(Zt,Vt),nr=void 0,er=qe/J*(_e+1);if(at.isDash){var Bt=_e-Math.abs(er);nr=Math.sqrt(Kt*Kt+Bt*Bt)}else nr=_e-Math.sqrt(Kt*Kt+er*er);this.data[vt+bt]=Math.max(0,Math.min(255,nr+128))}},F.prototype.addRegularDash=function(q){for(var he=q.length-1;he>=0;--he){var J=q[he],_e=q[he+1];J.zeroLength?q.splice(he,1):_e&&_e.isDash===J.isDash&&(_e.left=J.left,q.splice(he,1))}var qe=q[0],lt=q[q.length-1];qe.isDash===lt.isDash&&(qe.left=lt.left-this.width,lt.right=qe.right+this.width);for(var vt=this.width*this.nextRow,Ke=0,at=q[Ke],bt=0;bt1&&(at=q[++Ke]);var Zt=Math.abs(bt-at.left),Vt=Math.abs(bt-at.right),Kt=Math.min(Zt,Vt),nr=at.isDash?Kt:-Kt;this.data[vt+bt]=Math.max(0,Math.min(255,nr+128))}},F.prototype.addDash=function(q,he){var J=he?7:0,_e=2*J+1;if(this.nextRow+_e>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var qe=0,lt=0;lt=J.minX&&q.x=J.minY&&q.y0&&(bt[new e.OverscaledTileID(J.overscaledZ,vt,_e.z,lt,_e.y-1).key]={backfilled:!1},bt[new e.OverscaledTileID(J.overscaledZ,J.wrap,_e.z,_e.x,_e.y-1).key]={backfilled:!1},bt[new e.OverscaledTileID(J.overscaledZ,at,_e.z,Ke,_e.y-1).key]={backfilled:!1}),_e.y+10&&(qe.resourceTiming=J._resourceTiming,J._resourceTiming=[]),J.fire(new e.Event("data",qe))})},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setData=function(J){var _e=this;return this._data=J,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(qe){if(qe){_e.fire(new e.ErrorEvent(qe));return}var lt={dataType:"source",sourceDataType:"content"};_e._collectResourceTiming&&_e._resourceTiming&&_e._resourceTiming.length>0&&(lt.resourceTiming=_e._resourceTiming,_e._resourceTiming=[]),_e.fire(new e.Event("data",lt))}),this},q.prototype.getClusterExpansionZoom=function(J,_e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterChildren=function(J,_e){return this.actor.send("geojson.getClusterChildren",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterLeaves=function(J,_e,qe,lt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:J,limit:_e,offset:qe},lt),this},q.prototype._updateWorkerData=function(J){var _e=this;this._loaded=!1;var qe=e.extend({},this.workerOptions),lt=this._data;typeof lt=="string"?(qe.request=this.map._requestManager.transformRequest(e.browser.resolveURL(lt),e.ResourceType.Source),qe.request.collectResourceTiming=this._collectResourceTiming):qe.data=JSON.stringify(lt),this.actor.send(this.type+".loadData",qe,function(vt,Ke){_e._removed||Ke&&Ke.abandoned||(_e._loaded=!0,Ke&&Ke.resourceTiming&&Ke.resourceTiming[_e.id]&&(_e._resourceTiming=Ke.resourceTiming[_e.id].slice(0)),_e.actor.send(_e.type+".coalesce",{source:qe.source},null),J(vt))})},q.prototype.loaded=function(){return this._loaded},q.prototype.loadTile=function(J,_e){var qe=this,lt=J.actor?"reloadTile":"loadTile";J.actor=this.actor;var vt={type:this.type,uid:J.uid,tileID:J.tileID,zoom:J.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};J.request=this.actor.send(lt,vt,function(Ke,at){return delete J.request,J.unloadVectorData(),J.aborted?_e(null):Ke?_e(Ke):(J.loadVectorData(at,qe.map.painter,lt==="reloadTile"),_e(null))})},q.prototype.abortTile=function(J){J.request&&(J.request.cancel(),delete J.request),J.aborted=!0},q.prototype.unloadTile=function(J){J.unloadVectorData(),this.actor.send("removeTile",{uid:J.uid,type:this.type,source:this.id})},q.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},q.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},q.prototype.hasTransition=function(){return!1},q})(e.Evented),fe=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=(function(be){function q(he,J,_e,qe){be.call(this),this.id=he,this.dispatcher=_e,this.coordinates=J.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(qe),this.options=J}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.load=function(J,_e){var qe=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(lt,vt){qe._loaded=!0,lt?qe.fire(new e.ErrorEvent(lt)):vt&&(qe.image=vt,J&&(qe.coordinates=J),_e&&_e(),qe._finishLoading())})},q.prototype.loaded=function(){return this._loaded},q.prototype.updateImage=function(J){var _e=this;return!this.image||!J.url?this:(this.options.url=J.url,this.load(J.coordinates,function(){_e.texture=null}),this)},q.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setCoordinates=function(J){var _e=this;this.coordinates=J;var qe=J.map(e.MercatorCoordinate.fromLngLat);this.tileID=ce(qe),this.minzoom=this.maxzoom=this.tileID.z;var lt=qe.map(function(vt){return _e.tileID.getTilePoint(vt)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(lt[0].x,lt[0].y,0,0),this._boundsArray.emplaceBack(lt[1].x,lt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(lt[3].x,lt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(lt[2].x,lt[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},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(J,this.image,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var lt=this.tiles[qe];lt.state!=="loaded"&&(lt.state="loaded",lt.texture=this.texture)}}},q.prototype.loadTile=function(J,_e){this.tileID&&this.tileID.equals(J.tileID.canonical)?(this.tiles[String(J.tileID.wrap)]=J,J.buckets={},_e(null)):(J.state="errored",_e(null))},q.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return!1},q})(e.Evented);function ce(be){for(var q=1/0,he=1/0,J=-1/0,_e=-1/0,qe=0,lt=be;qe_e.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+_e.start(0)+" and "+_e.end(0)+"-second mark."))):this.video.currentTime=J}},q.prototype.getVideo=function(){return this.video},q.prototype.onAdd=function(J){this.map||(this.map=J,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE),_e.texSubImage2D(_e.TEXTURE_2D,0,0,0,_e.RGBA,_e.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(J,this.video,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var lt=this.tiles[qe];lt.state!=="loaded"&&(lt.state="loaded",lt.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this.video&&!this.video.paused},q})(le),ee=(function(be){function q(he,J,_e,qe){be.call(this,he,J,_e,qe),J.coordinates?(!Array.isArray(J.coordinates)||J.coordinates.length!==4||J.coordinates.some(function(lt){return!Array.isArray(lt)||lt.length!==2||lt.some(function(vt){return typeof vt!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'missing required property "coordinates"'))),J.animate&&typeof J.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'optional "animate" property must be a boolean value'))),J.canvas?typeof J.canvas!="string"&&!(J.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,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."+he,null,'missing required property "canvas"'))),this.options=J,this.animate=J.animate!==void 0?J.animate:!0}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.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()},q.prototype.getCanvas=function(){return this.canvas},q.prototype.onAdd=function(J){this.map=J,this.load(),this.canvas&&this.animate&&this.play()},q.prototype.onRemove=function(){this.pause()},q.prototype.prepare=function(){var J=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,J=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,J=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var _e=this.map.painter.context,qe=_e.gl;this.boundsBuffer||(this.boundsBuffer=_e.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(J||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(_e,this.canvas,qe.RGBA,{premultiply:!0});for(var lt in this.tiles){var vt=this.tiles[lt];vt.state!=="loaded"&&(vt.state="loaded",vt.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this._playing},q.prototype._hasInvalidDimensions=function(){for(var J=0,_e=[this.canvas.width,this.canvas.height];J<_e.length;J+=1){var qe=_e[J];if(isNaN(qe)||qe<=0)return!0}return!1},q})(le),ne={vector:U,raster:j,"raster-dem":Z,geojson:re,video:V,image:le,canvas:ee},K=function(be,q,he,J){var _e=new ne[q.type](be,q,he,J);if(_e.id!==be)throw new Error("Expected Source id to be "+be+" instead of "+_e.id);return e.bindAll(["load","abort","unload","serialize","prepare"],_e),_e},ue=function(be){return ne[be]},te=function(be,q){ne[be]=q};function H(be,q){var he=e.identity([]);return e.translate(he,he,[1,1,0]),e.scale(he,he,[be.width*.5,be.height*.5,1]),e.multiply(he,he,be.calculatePosMatrix(q.toUnwrapped()))}function ae(be,q,he){if(be)for(var J=0,_e=be;J<_e.length;J+=1){var qe=_e[J],lt=q[qe];if(lt&<.source===he&<.type==="fill-extrusion")return!0}else for(var vt in q){var Ke=q[vt];if(Ke.source===he&&Ke.type==="fill-extrusion")return!0}return!1}function ie(be,q,he,J,_e,qe){var lt=ae(_e&&_e.layers,q,be.id),vt=qe.maxPitchScaleFactor(),Ke=be.tilesIn(J,vt,lt);Ke.sort(Ce);for(var at=[],bt=0,Zt=Ke;btthis.max){var vt=this._getAndRemoveByKey(this.order[0]);vt&&this.onRemove(vt)}return this},ze.prototype.has=function(q){return q.wrapped().key in this.data},ze.prototype.getAndRemove=function(q){return this.has(q)?this._getAndRemoveByKey(q.wrapped().key):null},ze.prototype._getAndRemoveByKey=function(q){var he=this.data[q].shift();return he.timeout&&clearTimeout(he.timeout),this.data[q].length===0&&delete this.data[q],this.order.splice(this.order.indexOf(q),1),he.value},ze.prototype.getByKey=function(q){var he=this.data[q];return he?he[0].value:null},ze.prototype.get=function(q){if(!this.has(q))return null;var he=this.data[q.wrapped().key][0];return he.value},ze.prototype.remove=function(q,he){if(!this.has(q))return this;var J=q.wrapped().key,_e=he===void 0?0:this.data[J].indexOf(he),qe=this.data[J][_e];return this.data[J].splice(_e,1),qe.timeout&&clearTimeout(qe.timeout),this.data[J].length===0&&delete this.data[J],this.onRemove(qe.value),this.order.splice(this.order.indexOf(J),1),this},ze.prototype.setMaxSize=function(q){for(this.max=q;this.order.length>this.max;){var he=this._getAndRemoveByKey(this.order[0]);he&&this.onRemove(he)}return this},ze.prototype.filter=function(q){var he=[];for(var J in this.data)for(var _e=0,qe=this.data[J];_e1||(Math.abs(Zt)>1&&(Math.abs(Zt+Kt)===1?Zt+=Kt:Math.abs(Zt-Kt)===1&&(Zt-=Kt)),!(!bt.dem||!at.dem)&&(at.dem.backfillBorder(bt.dem,Zt,Vt),at.neighboringTiles&&at.neighboringTiles[nr]&&(at.neighboringTiles[nr].backfilled=!0)))}},q.prototype.getTile=function(J){return this.getTileByID(J.key)},q.prototype.getTileByID=function(J){return this._tiles[J]},q.prototype._retainLoadedChildren=function(J,_e,qe,lt){for(var vt in this._tiles){var Ke=this._tiles[vt];if(!(lt[vt]||!Ke.hasData()||Ke.tileID.overscaledZ<=_e||Ke.tileID.overscaledZ>qe)){for(var at=Ke.tileID;Ke&&Ke.tileID.overscaledZ>_e+1;){var bt=Ke.tileID.scaledTo(Ke.tileID.overscaledZ-1);Ke=this._tiles[bt.key],Ke&&Ke.hasData()&&(at=bt)}for(var Zt=at;Zt.overscaledZ>_e;)if(Zt=Zt.scaledTo(Zt.overscaledZ-1),J[Zt.key]){lt[at.key]=at;break}}}},q.prototype.findLoadedParent=function(J,_e){if(J.key in this._loadedParentTiles){var qe=this._loadedParentTiles[J.key];return qe&&qe.tileID.overscaledZ>=_e?qe:null}for(var lt=J.overscaledZ-1;lt>=_e;lt--){var vt=J.scaledTo(lt),Ke=this._getLoadedTile(vt);if(Ke)return Ke}},q.prototype._getLoadedTile=function(J){var _e=this._tiles[J.key];if(_e&&_e.hasData())return _e;var qe=this._cache.getByKey(J.wrapped().key);return qe},q.prototype.updateCacheSize=function(J){var _e=Math.ceil(J.width/this._source.tileSize)+1,qe=Math.ceil(J.height/this._source.tileSize)+1,lt=_e*qe,vt=5,Ke=Math.floor(lt*vt),at=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ke):Ke;this._cache.setMaxSize(at)},q.prototype.handleWrapJump=function(J){var _e=this._prevLng===void 0?J:this._prevLng,qe=J-_e,lt=qe/360,vt=Math.round(lt);if(this._prevLng=J,vt){var Ke={};for(var at in this._tiles){var bt=this._tiles[at];bt.tileID=bt.tileID.unwrapTo(bt.tileID.wrap+vt),Ke[bt.tileID.key]=bt}this._tiles=Ke;for(var Zt in this._timers)clearTimeout(this._timers[Zt]),delete this._timers[Zt];for(var Vt in this._tiles){var Kt=this._tiles[Vt];this._setTileReloadTimer(Vt,Kt)}}},q.prototype.update=function(J){var _e=this;if(this.transform=J,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(J),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var qe;this.used?this._source.tileID?qe=J.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ha){return new e.OverscaledTileID(ha.canonical.z,ha.wrap,ha.canonical.z,ha.canonical.x,ha.canonical.y)}):(qe=J.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(qe=qe.filter(function(ha){return _e._source.hasTile(ha)}))):qe=[];var lt=J.coveringZoomLevel(this._source),vt=Math.max(lt-q.maxOverzooming,this._source.minzoom),Ke=Math.max(lt+q.maxUnderzooming,this._source.minzoom),at=this._updateRetainedTiles(qe,lt);if(Kn(this._source.type)){for(var bt={},Zt={},Vt=Object.keys(at),Kt=0,nr=Vt;Ktthis._source.maxzoom){var Ht=Bt.children(this._source.maxzoom)[0],zr=this.getTile(Ht);if(zr&&zr.hasData()){qe[Ht.key]=Ht;continue}}else{var Yr=Bt.children(this._source.maxzoom);if(qe[Yr[0].key]&&qe[Yr[1].key]&&qe[Yr[2].key]&&qe[Yr[3].key])continue}for(var cn=Xt.wasRequested(),sa=Bt.overscaledZ-1;sa>=vt;--sa){var Yn=Bt.scaledTo(sa);if(lt[Yn.key]||(lt[Yn.key]=!0,Xt=this.getTile(Yn),!Xt&&cn&&(Xt=this._addTile(Yn)),Xt&&(qe[Yn.key]=Yn,cn=Xt.wasRequested(),Xt.hasData())))break}}}return qe},q.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var J in this._tiles){for(var _e=[],qe=void 0,lt=this._tiles[J].tileID;lt.overscaledZ>0;){if(lt.key in this._loadedParentTiles){qe=this._loadedParentTiles[lt.key];break}_e.push(lt.key);var vt=lt.scaledTo(lt.overscaledZ-1);if(qe=this._getLoadedTile(vt),qe)break;lt=vt}for(var Ke=0,at=_e;Ke0)&&(_e.hasData()&&_e.state!=="reloading"?this._cache.add(_e.tileID,_e,_e.getExpiryTimeout()):(_e.aborted=!0,this._abortTile(_e),this._unloadTile(_e))))},q.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var J in this._tiles)this._removeTile(J);this._cache.reset()},q.prototype.tilesIn=function(J,_e,qe){var lt=this,vt=[],Ke=this.transform;if(!Ke)return vt;for(var at=qe?Ke.getCameraQueryGeometry(J):J,bt=J.map(function(sa){return Ke.pointCoordinate(sa)}),Zt=at.map(function(sa){return Ke.pointCoordinate(sa)}),Vt=this.getIds(),Kt=1/0,nr=1/0,er=-1/0,Bt=-1/0,Xt=0,Ht=Zt;Xt=0&&La[1].y+ha>=0){var ca=bt.map(function(Ka){return Hn.getTilePoint(Ka)}),Oa=Zt.map(function(Ka){return Hn.getTilePoint(Ka)});vt.push({tile:Yn,tileID:Hn,queryGeometry:ca,cameraQueryGeometry:Oa,scale:la})}}},cn=0;cn=e.browser.now())return!0}return!1},q.prototype.setFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.updateState(J,_e,qe)},q.prototype.removeFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.removeFeatureState(J,_e,qe)},q.prototype.getFeatureState=function(J,_e){return J=J||"_geojsonTileLayer",this._state.getState(J,_e)},q.prototype.setDependencies=function(J,_e,qe){var lt=this._tiles[J];lt&<.setDependencies(_e,qe)},q.prototype.reloadTilesForDependencies=function(J,_e){for(var qe in this._tiles){var lt=this._tiles[qe];lt.hasDependency(J,_e)&&this._reloadTile(qe,"reloading")}this._cache.filter(function(vt){return!vt.hasDependency(J,_e)})},q})(e.Evented);pn.maxOverzooming=10,pn.maxUnderzooming=3;function wn(be,q){var he=Math.abs(be.wrap*2)-+(be.wrap<0),J=Math.abs(q.wrap*2)-+(q.wrap<0);return be.overscaledZ-q.overscaledZ||J-he||q.canonical.y-be.canonical.y||q.canonical.x-be.canonical.x}function Kn(be){return be==="raster"||be==="image"||be==="video"}function da(){return new e.window.Worker(ys.workerUrl)}var fa="mapboxgl_preloaded_worker_pool",ga=function(){this.active={}};ga.prototype.acquire=function(q){if(!this.workers)for(this.workers=[];this.workers.length0?(_e-lt)/vt:0;return this.points[qe].mult(1-Ke).add(this.points[he].mult(Ke))};var un=function(q,he,J){var _e=this.boxCells=[],qe=this.circleCells=[];this.xCellCount=Math.ceil(q/J),this.yCellCount=Math.ceil(he/J);for(var lt=0;ltthis.width||_e<0||he>this.height)return qe?!1:[];var vt=[];if(q<=0&&he<=0&&this.width<=J&&this.height<=_e){if(qe)return!0;for(var Ke=0;Ke0:vt}},un.prototype._queryCircle=function(q,he,J,_e,qe){var lt=q-J,vt=q+J,Ke=he-J,at=he+J;if(vt<0||lt>this.width||at<0||Ke>this.height)return _e?!1:[];var bt=[],Zt={hitTest:_e,circle:{x:q,y:he,radius:J},seenUids:{box:{},circle:{}}};return this._forEachCell(lt,Ke,vt,at,this._queryCellCircle,bt,Zt,qe),_e?bt.length>0:bt},un.prototype.query=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!1,qe)},un.prototype.hitTest=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!0,qe)},un.prototype.hitTestCircle=function(q,he,J,_e){return this._queryCircle(q,he,J,!0,_e)},un.prototype._queryCell=function(q,he,J,_e,qe,lt,vt,Ke){var at=vt.seenUids,bt=this.boxCells[qe];if(bt!==null)for(var Zt=this.bboxes,Vt=0,Kt=bt;Vt=Zt[er+0]&&_e>=Zt[er+1]&&(!Ke||Ke(this.boxKeys[nr]))){if(vt.hitTest)return lt.push(!0),!0;lt.push({key:this.boxKeys[nr],x1:Zt[er],y1:Zt[er+1],x2:Zt[er+2],y2:Zt[er+3]})}}}var Bt=this.circleCells[qe];if(Bt!==null)for(var Xt=this.circles,Ht=0,zr=Bt;Htvt*vt+Ke*Ke},un.prototype._circleAndRectCollide=function(q,he,J,_e,qe,lt,vt){var Ke=(lt-_e)/2,at=Math.abs(q-(_e+Ke));if(at>Ke+J)return!1;var bt=(vt-qe)/2,Zt=Math.abs(he-(qe+bt));if(Zt>bt+J)return!1;if(at<=Ke||Zt<=bt)return!0;var Vt=at-Ke,Kt=Zt-bt;return Vt*Vt+Kt*Kt<=J*J};function Rn(be,q,he,J,_e){var qe=e.create();return q?(e.scale(qe,qe,[1/_e,1/_e,1]),he||e.rotateZ(qe,qe,J.angle)):e.multiply(qe,J.labelPlaneMatrix,be),qe}function di(be,q,he,J,_e){if(q){var qe=e.clone(be);return e.scale(qe,qe,[_e,_e,1]),he||e.rotateZ(qe,qe,-J.angle),qe}else return J.glCoordMatrix}function Ma(be,q){var he=[be.x,be.y,0,1];Jo(he,he,q);var J=he[3];return{point:new e.Point(he[0]/J,he[1]/J),signedDistanceFromCamera:J}}function Ei(be,q){return .5+.5*(be/q)}function Hi(be,q){var he=be[0]/be[3],J=be[1]/be[3],_e=he>=-q[0]&&he<=q[0]&&J>=-q[1]&&J<=q[1];return _e}function io(be,q,he,J,_e,qe,lt,vt){var Ke=J?be.textSizeData:be.iconSizeData,at=e.evaluateSizeForZoom(Ke,he.transform.zoom),bt=[256/he.width*2+1,256/he.height*2+1],Zt=J?be.text.dynamicLayoutVertexArray:be.icon.dynamicLayoutVertexArray;Zt.clear();for(var Vt=be.lineVertexArray,Kt=J?be.text.placedSymbolArray:be.icon.placedSymbolArray,nr=he.transform.width/he.transform.height,er=!1,Bt=0;Btqe)return{useVertical:!0}}return(be===e.WritingMode.vertical?q.yhe.x)?{needsFlipping:!0}:null}function li(be,q,he,J,_e,qe,lt,vt,Ke,at,bt,Zt,Vt,Kt){var nr=q/24,er=be.lineOffsetX*nr,Bt=be.lineOffsetY*nr,Xt;if(be.numGlyphs>1){var Ht=be.glyphStartIndex+be.numGlyphs,zr=be.lineStartIndex,Yr=be.lineStartIndex+be.lineLength,cn=no(nr,vt,er,Bt,he,bt,Zt,be,Ke,qe,Vt);if(!cn)return{notEnoughRoom:!0};var sa=Ma(cn.first.point,lt).point,Yn=Ma(cn.last.point,lt).point;if(J&&!he){var Hn=bo(be.writingMode,sa,Yn,Kt);if(Hn)return Hn}Xt=[cn.first];for(var la=be.glyphStartIndex+1;la0?Oa.point:ts(Zt,ca,ha,1,_e),xi=bo(be.writingMode,ha,Ka,Kt);if(xi)return xi}var qi=Ho(nr*vt.getoffsetX(be.glyphStartIndex),er,Bt,he,bt,Zt,be.segment,be.lineStartIndex,be.lineStartIndex+be.lineLength,Ke,qe,Vt);if(!qi)return{notEnoughRoom:!0};Xt=[qi]}for(var _s=0,ds=Xt;_s0?1:-1,nr=0;J&&(Kt*=-1,nr=Math.PI),Kt<0&&(nr+=Math.PI);for(var er=Kt>0?vt+lt:vt+lt+1,Bt=_e,Xt=_e,Ht=0,zr=0,Yr=Math.abs(Vt),cn=[];Ht+zr<=Yr;){if(er+=Kt,er=Ke)return null;if(Xt=Bt,cn.push(Bt),Bt=Zt[er],Bt===void 0){var sa=new e.Point(at.getx(er),at.gety(er)),Yn=Ma(sa,bt);if(Yn.signedDistanceFromCamera>0)Bt=Zt[er]=Yn.point;else{var Hn=er-Kt,la=Ht===0?qe:new e.Point(at.getx(Hn),at.gety(Hn));Bt=ts(la,sa,Xt,Yr-Ht+1,bt)}}Ht+=zr,zr=Xt.dist(Bt)}var ha=(Yr-Ht)/zr,La=Bt.sub(Xt),ca=La.mult(ha)._add(Xt);ca._add(La._unit()._perp()._mult(he*Kt));var Oa=nr+Math.atan2(Bt.y-Xt.y,Bt.x-Xt.x);return cn.push(ca),{point:ca,angle:Oa,path:cn}}var Gs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function cs(be,q){for(var he=0;he=1;pl--)ds.push(qi.path[pl]);for(var cl=1;cl<_s.path.length;cl++)ds.push(_s.path[cl]);var yl=ca*2.5;if(Ke){var ml=ds.map(function(jd){return Ma(jd,Ke)});ml.some(function(jd){return jd.signedDistanceFromCamera<=0})?ds=[]:ds=ml.map(function(jd){return jd.point})}var Ku=[];if(ds.length>0){for(var il=ds[0].clone(),yu=ds[0].clone(),Gf=1;Gf=Oa.x&&yu.x<=Ka.x&&il.y>=Oa.y&&yu.y<=Ka.y?Ku=[ds]:yu.xKa.x||yu.yKa.y?Ku=[]:Ku=e.clipLine([ds],Oa.x,Oa.y,Ka.x,Ka.y)}for(var wh=0,Bd=Ku;wh=this.screenRightBoundary||_ethis.screenBottomBoundary},Xs.prototype.isInsideGrid=function(q,he,J,_e){return J>=0&&q=0&&he0){var Yr;return this.prevPlacement&&this.prevPlacement.variableOffsets[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID].text&&(Yr=this.prevPlacement.variableOffsets[Vt.crossTileID].anchor),this.variableOffsets[Vt.crossTileID]={textOffset:Bt,width:J,height:_e,anchor:q,textBoxScale:qe,prevAnchor:Yr},this.markUsedJustification(Kt,q,Vt,nr),Kt.allowVerticalPlacement&&(this.markUsedOrientation(Kt,nr,Vt),this.placedOrientations[Vt.crossTileID]=nr),{shift:Xt,placedGlyphBoxes:Ht}}},Es.prototype.placeLayerBucketPart=function(q,he,J){var _e=this,qe=q.parameters,lt=qe.bucket,vt=qe.layout,Ke=qe.posMatrix,at=qe.textLabelPlaneMatrix,bt=qe.labelToScreenMatrix,Zt=qe.textPixelRatio,Vt=qe.holdingForFade,Kt=qe.collisionBoxArray,nr=qe.partiallyEvaluatedTextSize,er=qe.collisionGroup,Bt=vt.get("text-optional"),Xt=vt.get("icon-optional"),Ht=vt.get("text-allow-overlap"),zr=vt.get("icon-allow-overlap"),Yr=vt.get("text-rotation-alignment")==="map",cn=vt.get("text-pitch-alignment")==="map",sa=vt.get("icon-text-fit")!=="none",Yn=vt.get("symbol-z-order")==="viewport-y",Hn=Ht&&(zr||!lt.hasIconData()||Xt),la=zr&&(Ht||!lt.hasTextData()||Bt);!lt.collisionArrays&&Kt&<.deserializeCollisionBoxes(Kt);var ha=function(qi,_s){if(!he[qi.crossTileID]){if(Vt){_e.placements[qi.crossTileID]=new Zo(!1,!1,!1);return}var ds=!1,pl=!1,cl=!0,yl=null,ml={box:null,offscreen:null},Ku={box:null},il=null,yu=null,Gf=null,wh=0,Bd=0,Nd=0;_s.textFeatureIndex?wh=_s.textFeatureIndex:qi.useRuntimeCollisionCircles&&(wh=qi.featureIndex),_s.verticalTextFeatureIndex&&(Bd=_s.verticalTextFeatureIndex);var Zv=_s.textBox;if(Zv){var op=function(df){var uc=e.WritingMode.horizontal;if(lt.allowVerticalPlacement&&!df&&_e.prevPlacement){var $v=_e.prevPlacement.placedOrientations[qi.crossTileID];$v&&(_e.placedOrientations[qi.crossTileID]=$v,uc=$v,_e.markUsedOrientation(lt,uc,qi))}return uc},W0=function(df,uc){if(lt.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&_s.verticalTextBox)for(var $v=0,Ng=lt.writingModes;$v0&&(sd=sd.filter(function(df){return df!==Kv.anchor}),sd.unshift(Kv.anchor))}var Ud=function(df,uc,$v){for(var Ng=df.x2-df.x1,Wy=df.y2-df.y1,bc=qi.textBoxScale,N_=sa&&!zr?uc:null,Nm={box:[],offscreen:!1},$b=Ht?sd.length*2:sd.length,qd=0;qd<$b;++qd){var Um=sd[qd%sd.length],Jb=qd>=sd.length,U_=_e.attemptAnchorPlacement(Um,df,Ng,Wy,bc,Yr,cn,Zt,Ke,er,Jb,qi,lt,$v,N_);if(U_&&(Nm=U_.placedGlyphBoxes,Nm&&Nm.box&&Nm.box.length)){ds=!0,yl=U_.shift;break}}return Nm},sp=function(){return Ud(Zv,_s.iconBox,e.WritingMode.horizontal)},jd=function(){var df=_s.verticalTextBox,uc=ml&&ml.box&&ml.box.length;return lt.allowVerticalPlacement&&!uc&&qi.numVerticalGlyphVertices>0&&df?Ud(df,_s.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};W0(sp,jd),ml&&(ds=ml.box,cl=ml.offscreen);var Og=op(ml&&ml.box);if(!ds&&_e.prevPlacement){var K0=_e.prevPlacement.variableOffsets[qi.crossTileID];K0&&(_e.variableOffsets[qi.crossTileID]=K0,_e.markUsedJustification(lt,K0.anchor,qi,Og))}}else{var bp=function(df,uc){var $v=_e.collisionIndex.placeCollisionBox(df,Ht,Zt,Ke,er.predicate);return $v&&$v.box&&$v.box.length&&(_e.markUsedOrientation(lt,uc,qi),_e.placedOrientations[qi.crossTileID]=uc),$v},Wv=function(){return bp(Zv,e.WritingMode.horizontal)},wp=function(){var df=_s.verticalTextBox;return lt.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&df?bp(df,e.WritingMode.vertical):{box:null,offscreen:null}};W0(Wv,wp),op(ml&&ml.box&&ml.box.length)}}if(il=ml,ds=il&&il.box&&il.box.length>0,cl=il&&il.offscreen,qi.useRuntimeCollisionCircles){var Xh=lt.text.placedSymbolArray.get(qi.centerJustifiedTextSymbolIndex),$0=e.evaluateSizeForFeature(lt.textSizeData,nr,Xh),Fg=vt.get("text-padding"),Av=qi.collisionCircleDiameter;yu=_e.collisionIndex.placeCollisionCircles(Ht,Xh,lt.lineVertexArray,lt.glyphOffsetArray,$0,Ke,at,bt,J,cn,er.predicate,Av,Fg),ds=Ht||yu.circles.length>0&&!yu.collisionDetected,cl=cl&&yu.offscreen}if(_s.iconFeatureIndex&&(Nd=_s.iconFeatureIndex),_s.iconBox){var Om=function(df){var uc=sa&&yl?Ll(df,yl.x,yl.y,Yr,cn,_e.transform.angle):df;return _e.collisionIndex.placeCollisionBox(uc,zr,Zt,Ke,er.predicate)};Ku&&Ku.box&&Ku.box.length&&_s.verticalIconBox?(Gf=Om(_s.verticalIconBox),pl=Gf.box.length>0):(Gf=Om(_s.iconBox),pl=Gf.box.length>0),cl=cl&&Gf.offscreen}var Yy=Bt||qi.numHorizontalGlyphVertices===0&&qi.numVerticalGlyphVertices===0,Zy=Xt||qi.numIconVertices===0;if(!Yy&&!Zy?pl=ds=pl&&ds:Zy?Yy||(pl=pl&&ds):ds=pl&&ds,ds&&il&&il.box&&(Ku&&Ku.box&&Bd?_e.collisionIndex.insertCollisionBox(il.box,vt.get("text-ignore-placement"),lt.bucketInstanceId,Bd,er.ID):_e.collisionIndex.insertCollisionBox(il.box,vt.get("text-ignore-placement"),lt.bucketInstanceId,wh,er.ID)),pl&&Gf&&_e.collisionIndex.insertCollisionBox(Gf.box,vt.get("icon-ignore-placement"),lt.bucketInstanceId,Nd,er.ID),yu&&(ds&&_e.collisionIndex.insertCollisionCircles(yu.circles,vt.get("text-ignore-placement"),lt.bucketInstanceId,wh,er.ID),J)){var Bg=lt.bucketInstanceId,Fm=_e.collisionCircleArrays[Bg];Fm===void 0&&(Fm=_e.collisionCircleArrays[Bg]=new ho);for(var Bm=0;Bm=0;--ca){var Oa=La[ca];ha(lt.symbolInstances.get(Oa),lt.collisionArrays[Oa])}else for(var Ka=q.symbolInstanceStart;Ka=0&&(lt>=0&&bt!==lt?q.text.placedSymbolArray.get(bt).crossTileID=0:q.text.placedSymbolArray.get(bt).crossTileID=J.crossTileID)}},Es.prototype.markUsedOrientation=function(q,he,J){for(var _e=he===e.WritingMode.horizontal||he===e.WritingMode.horizontalOnly?he:0,qe=he===e.WritingMode.vertical?he:0,lt=[J.leftJustifiedTextSymbolIndex,J.centerJustifiedTextSymbolIndex,J.rightJustifiedTextSymbolIndex],vt=0,Ke=lt;vt0||cn>0,ha=zr.numIconVertices>0,La=_e.placedOrientations[zr.crossTileID],ca=La===e.WritingMode.vertical,Oa=La===e.WritingMode.horizontal||La===e.WritingMode.horizontalOnly;if(la){var Ka=_u(Hn.text),xi=ca?Ki:Ka;nr(q.text,Yr,xi);var qi=Oa?Ki:Ka;nr(q.text,cn,qi);var _s=Hn.text.isHidden();[zr.rightJustifiedTextSymbolIndex,zr.centerJustifiedTextSymbolIndex,zr.leftJustifiedTextSymbolIndex].forEach(function(Nd){Nd>=0&&(q.text.placedSymbolArray.get(Nd).hidden=_s||ca?1:0)}),zr.verticalPlacedTextSymbolIndex>=0&&(q.text.placedSymbolArray.get(zr.verticalPlacedTextSymbolIndex).hidden=_s||Oa?1:0);var ds=_e.variableOffsets[zr.crossTileID];ds&&_e.markUsedJustification(q,ds.anchor,zr,La);var pl=_e.placedOrientations[zr.crossTileID];pl&&(_e.markUsedJustification(q,"left",zr,pl),_e.markUsedOrientation(q,pl,zr))}if(ha){var cl=_u(Hn.icon),yl=!(Vt&&zr.verticalPlacedIconSymbolIndex&&ca);if(zr.placedIconSymbolIndex>=0){var ml=yl?cl:Ki;nr(q.icon,zr.numIconVertices,ml),q.icon.placedSymbolArray.get(zr.placedIconSymbolIndex).hidden=Hn.icon.isHidden()}if(zr.verticalPlacedIconSymbolIndex>=0){var Ku=yl?Ki:cl;nr(q.icon,zr.numVerticalIconVertices,Ku),q.icon.placedSymbolArray.get(zr.verticalPlacedIconSymbolIndex).hidden=Hn.icon.isHidden()}}if(q.hasIconCollisionBoxData()||q.hasTextCollisionBoxData()){var il=q.collisionArrays[Ht];if(il){var yu=new e.Point(0,0);if(il.textBox||il.verticalTextBox){var Gf=!0;if(at){var wh=_e.variableOffsets[sa];wh?(yu=El(wh.anchor,wh.width,wh.height,wh.textOffset,wh.textBoxScale),bt&&yu._rotate(Zt?_e.transform.angle:-_e.transform.angle)):Gf=!1}il.textBox&&ci(q.textCollisionBox.collisionVertexArray,Hn.text.placed,!Gf||ca,yu.x,yu.y),il.verticalTextBox&&ci(q.textCollisionBox.collisionVertexArray,Hn.text.placed,!Gf||Oa,yu.x,yu.y)}var Bd=!!(!Oa&&il.verticalIconBox);il.iconBox&&ci(q.iconCollisionBox.collisionVertexArray,Hn.icon.placed,Bd,Vt?yu.x:0,Vt?yu.y:0),il.verticalIconBox&&ci(q.iconCollisionBox.collisionVertexArray,Hn.icon.placed,!Bd,Vt?yu.x:0,Vt?yu.y:0)}}},Bt=0;Btq},Es.prototype.setStale=function(){this.stale=!0};function ci(be,q,he,J,_e){be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0)}var Ji=Math.pow(2,25),kl=Math.pow(2,24),Rs=Math.pow(2,17),zo=Math.pow(2,16),Pl=Math.pow(2,9),Ys=Math.pow(2,8),ll=Math.pow(2,1);function _u(be){if(be.opacity===0&&!be.placed)return 0;if(be.opacity===1&&be.placed)return 4294967295;var q=be.placed?1:0,he=Math.floor(be.opacity*127);return he*Ji+q*kl+he*Rs+q*zo+he*Pl+q*Ys+he*ll+q}var Ki=0,ms=function(q){this._sortAcrossTiles=q.layout.get("symbol-z-order")!=="viewport-y"&&q.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ms.prototype.continuePlacement=function(q,he,J,_e,qe){for(var lt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var vt=q[this._currentPlacementIndex],Ke=he[vt],at=this.placement.collisionIndex.transform.zoom;if(Ke.type==="symbol"&&(!Ke.minzoom||Ke.minzoom<=at)&&(!Ke.maxzoom||Ke.maxzoom>at)){this._inProgressLayer||(this._inProgressLayer=new ms(Ke));var bt=this._inProgressLayer.continuePlacement(J[Ke.source],this.placement,this._showCollisionBoxes,Ke,lt);if(bt)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},rs.prototype.commit=function(q){return this.placement.commit(q),this.placement};var ql=512/e.EXTENT/2,Vl=function(q,he,J){this.tileID=q,this.indexedSymbolInstances={},this.bucketInstanceId=J;for(var _e=0;_eq.overscaledZ)for(var at in Ke){var bt=Ke[at];bt.tileID.isChildOf(q)&&bt.findMatches(he.symbolInstances,q,lt)}else{var Zt=q.scaledTo(Number(vt)),Vt=Ke[Zt.key];Vt&&Vt.findMatches(he.symbolInstances,q,lt)}}for(var Kt=0;Kt0)throw new Error("Unimplemented: "+lt.map(function(vt){return vt.command}).join(", ")+".");return qe.forEach(function(vt){vt.command!=="setTransition"&&_e[vt.command].apply(_e,vt.args)}),this.stylesheet=J,!0},q.prototype.addImage=function(J,_e){if(this.getImage(J))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(J,_e),this._afterImageUpdated(J)},q.prototype.updateImage=function(J,_e){this.imageManager.updateImage(J,_e)},q.prototype.getImage=function(J){return this.imageManager.getImage(J)},q.prototype.removeImage=function(J){if(!this.getImage(J))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(J),this._afterImageUpdated(J)},q.prototype._afterImageUpdated=function(J){this._availableImages=this.imageManager.listImages(),this._changedImages[J]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},q.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},q.prototype.addSource=function(J,_e,qe){var lt=this;if(qe===void 0&&(qe={}),this._checkLoaded(),this.sourceCaches[J]!==void 0)throw new Error("There is already a source with this ID");if(!_e.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(_e).join(", ")+".");var vt=["vector","raster","geojson","video","image"],Ke=vt.indexOf(_e.type)>=0;if(!(Ke&&this._validate(e.validateStyle.source,"sources."+J,_e,null,qe))){this.map&&this.map._collectResourceTiming&&(_e.collectResourceTiming=!0);var at=this.sourceCaches[J]=new pn(J,_e,this.dispatcher);at.style=this,at.setEventedParent(this,function(){return{isSourceLoaded:lt.loaded(),source:at.serialize(),sourceId:J}}),at.onAdd(this.map),this._changed=!0}},q.prototype.removeSource=function(J){if(this._checkLoaded(),this.sourceCaches[J]===void 0)throw new Error("There is no source with this ID");for(var _e in this._layers)if(this._layers[_e].source===J)return this.fire(new e.ErrorEvent(new Error('Source "'+J+'" cannot be removed while layer "'+_e+'" is using it.')));var qe=this.sourceCaches[J];delete this.sourceCaches[J],delete this._updatedSources[J],qe.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:J})),qe.setEventedParent(null),qe.clearTiles(),qe.onRemove&&qe.onRemove(this.map),this._changed=!0},q.prototype.setGeoJSONSourceData=function(J,_e){this._checkLoaded();var qe=this.sourceCaches[J].getSource();qe.setData(_e),this._changed=!0},q.prototype.getSource=function(J){return this.sourceCaches[J]&&this.sourceCaches[J].getSource()},q.prototype.addLayer=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var lt=J.id;if(this.getLayer(lt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+lt+'" already exists on this map')));return}var vt;if(J.type==="custom"){if(zs(this,e.validateCustomStyleLayer(J)))return;vt=e.createStyleLayer(J)}else{if(typeof J.source=="object"&&(this.addSource(lt,J.source),J=e.clone$1(J),J=e.extend(J,{source:lt})),this._validate(e.validateStyle.layer,"layers."+lt,J,{arrayIndex:-1},qe))return;vt=e.createStyleLayer(J),this._validateLayer(vt),vt.setEventedParent(this,{layer:{id:lt}}),this._serializedLayers[vt.id]=vt.serialize()}var Ke=_e?this._order.indexOf(_e):this._order.length;if(_e&&Ke===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}if(this._order.splice(Ke,0,lt),this._layerOrderChanged=!0,this._layers[lt]=vt,this._removedLayers[lt]&&vt.source&&vt.type!=="custom"){var at=this._removedLayers[lt];delete this._removedLayers[lt],at.type!==vt.type?this._updatedSources[vt.source]="clear":(this._updatedSources[vt.source]="reload",this.sourceCaches[vt.source].pause())}this._updateLayer(vt),vt.onAdd&&vt.onAdd(this.map)},q.prototype.moveLayer=function(J,_e){this._checkLoaded(),this._changed=!0;var qe=this._layers[J];if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be moved.")));return}if(J!==_e){var lt=this._order.indexOf(J);this._order.splice(lt,1);var vt=_e?this._order.indexOf(_e):this._order.length;if(_e&&vt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}this._order.splice(vt,0,J),this._layerOrderChanged=!0}},q.prototype.removeLayer=function(J){this._checkLoaded();var _e=this._layers[J];if(!_e){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be removed.")));return}_e.setEventedParent(null);var qe=this._order.indexOf(J);this._order.splice(qe,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[J]=_e,delete this._layers[J],delete this._serializedLayers[J],delete this._updatedLayers[J],delete this._updatedPaintProps[J],_e.onRemove&&_e.onRemove(this.map)},q.prototype.getLayer=function(J){return this._layers[J]},q.prototype.hasLayer=function(J){return J in this._layers},q.prototype.setLayerZoomRange=function(J,_e,qe){this._checkLoaded();var lt=this.getLayer(J);if(!lt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot have zoom extent.")));return}lt.minzoom===_e&<.maxzoom===qe||(_e!=null&&(lt.minzoom=_e),qe!=null&&(lt.maxzoom=qe),this._updateLayer(lt))},q.prototype.setFilter=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var lt=this.getLayer(J);if(!lt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(lt.filter,_e)){if(_e==null){lt.filter=void 0,this._updateLayer(lt);return}this._validate(e.validateStyle.filter,"layers."+lt.id+".filter",_e,null,qe)||(lt.filter=e.clone$1(_e),this._updateLayer(lt))}},q.prototype.getFilter=function(J){return e.clone$1(this.getLayer(J).filter)},q.prototype.setLayoutProperty=function(J,_e,qe,lt){lt===void 0&&(lt={}),this._checkLoaded();var vt=this.getLayer(J);if(!vt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(vt.getLayoutProperty(_e),qe)||(vt.setLayoutProperty(_e,qe,lt),this._updateLayer(vt))},q.prototype.getLayoutProperty=function(J,_e){var qe=this.getLayer(J);if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style.")));return}return qe.getLayoutProperty(_e)},q.prototype.setPaintProperty=function(J,_e,qe,lt){lt===void 0&&(lt={}),this._checkLoaded();var vt=this.getLayer(J);if(!vt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(vt.getPaintProperty(_e),qe)){var Ke=vt.setPaintProperty(_e,qe,lt);Ke&&this._updateLayer(vt),this._changed=!0,this._updatedPaintProps[J]=!0}},q.prototype.getPaintProperty=function(J,_e){return this.getLayer(J).getPaintProperty(_e)},q.prototype.setFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,lt=J.sourceLayer,vt=this.sourceCaches[qe];if(vt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var Ke=vt.getSource().type;if(Ke==="geojson"&<){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Ke==="vector"&&!lt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),vt.setFeatureState(lt,J.id,_e)},q.prototype.removeFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,lt=this.sourceCaches[qe];if(lt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var vt=lt.getSource().type,Ke=vt==="vector"?J.sourceLayer:void 0;if(vt==="vector"&&!Ke){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(_e&&typeof J.id!="string"&&typeof J.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}lt.removeFeatureState(Ke,J.id,_e)},q.prototype.getFeatureState=function(J){this._checkLoaded();var _e=J.source,qe=J.sourceLayer,lt=this.sourceCaches[_e];if(lt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+_e+"' does not exist in the map's style.")));return}var vt=lt.getSource().type;if(vt==="vector"&&!qe){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),lt.getFeatureState(qe,J.id)},q.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},q.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(J){return J.serialize()}),layers:this._serializeLayers(this._order)},function(J){return J!==void 0})},q.prototype._updateLayer=function(J){this._updatedLayers[J.id]=!0,J.source&&!this._updatedSources[J.source]&&this.sourceCaches[J.source].getSource().type!=="raster"&&(this._updatedSources[J.source]="reload",this.sourceCaches[J.source].pause()),this._changed=!0},q.prototype._flattenAndSortRenderedFeatures=function(J){for(var _e=this,qe=function(Oa){return _e._layers[Oa].type==="fill-extrusion"},lt={},vt=[],Ke=this._order.length-1;Ke>=0;Ke--){var at=this._order[Ke];if(qe(at)){lt[at]=Ke;for(var bt=0,Zt=J;bt=0;Ht--){var zr=this._order[Ht];if(qe(zr))for(var Yr=vt.length-1;Yr>=0;Yr--){var cn=vt[Yr].feature;if(lt[cn.layer.id] 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Xu=`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 +}`,ov=`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;}`,Nh=`#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 +}`,ih="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;}",Df=`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 +}`,Rh="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;}",Ih=`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 +}`,ef=` +#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);}`,Uh=`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 +}`,bf=` +#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);}`,lf=`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 +}`,Yu=` +#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;}`,Vf=`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 +}`,Dh=` +#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);}`,Fl=`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 +}`,yh="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;}",bv=`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 +}`,jh=`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));}`,oh=`#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 +}`,qh=`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);}`,Lc=`#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 +}`,Vh=`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);}`,gu=au(jc,$c),Pc=au(Ch,gh),zf=au(bl,Cc),Wl=au(Lh,tc),wf=au(Hu,rc),hc=au(Jc,Zl),Rc=au(Gu,qs),lu=au(Rl,xf),Kf=au(gc,Rf),uf=au(su,xv),Of=au(Os,Fv),_h=au(vl,Do),wv=au(Wf,Qc),Yv=au(Ru,Ph),$f=au(If,ah),xh=au(Xu,ov),qc=au(Nh,ih),bh=au(Df,Rh),nc=au(Ih,ef),Jf=au(Uh,bf),Hh=au(lf,Yu),Qf=au(Vf,Dh),Ql=au(Fl,yh),Ic=au(bv,jh),tf=au(oh,qh),zh=au(Lc,Vh);function au(be,q){var he=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,J=q.match(/attribute ([\w]+) ([\w]+)/g),_e=be.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),qe=q.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),lt=qe?qe.concat(_e):_e,vt={};return be=be.replace(he,function(Ke,at,bt,Zt,Vt){return vt[Vt]=!0,at==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +varying `+bt+" "+Zt+" "+Vt+`; +#else +uniform `+bt+" "+Zt+" u_"+Vt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Vt+` + `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; +#endif +`}),q=q.replace(he,function(Ke,at,bt,Zt,Vt){var Kt=Zt==="float"?"vec2":"vec4",nr=Vt.match(/color/)?"color":Kt;return vt[Vt]?at==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+bt+" "+Kt+" a_"+Vt+`; +varying `+bt+" "+Zt+" "+Vt+`; +#else +uniform `+bt+" "+Zt+" u_"+Vt+`; +#endif +`:nr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = a_"+Vt+`; +#else + `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+Vt+" = unpack_mix_"+nr+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; +#endif +`:at==="define"?` +#ifndef HAS_UNIFORM_u_`+Vt+` +uniform lowp float u_`+Vt+`_t; +attribute `+bt+" "+Kt+" a_"+Vt+`; +#else +uniform `+bt+" "+Zt+" u_"+Vt+`; +#endif +`:nr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+bt+" "+Zt+" "+Vt+" = a_"+Vt+`; +#else + `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Vt+` + `+bt+" "+Zt+" "+Vt+" = unpack_mix_"+nr+"(a_"+Vt+", u_"+Vt+`_t); +#else + `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; +#endif +`}),{fragmentSource:be,vertexSource:q,staticAttributes:J,staticUniforms:lt}}var sh=Object.freeze({__proto__:null,prelude:gu,background:Pc,backgroundPattern:zf,circle:Wl,clippingMask:wf,heatmap:hc,heatmapTexture:Rc,collisionBox:lu,collisionCircle:Kf,debug:uf,fill:Of,fillOutline:_h,fillOutlinePattern:wv,fillPattern:Yv,fillExtrusion:$f,fillExtrusionPattern:xh,hillshadePrepare:qc,hillshade:bh,line:nc,lineGradient:Jf,linePattern:Hh,lineSDF:Qf,raster:Ql,symbolIcon:Ic,symbolSDF:tf,symbolTextAndIcon:zh}),Ff=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Ff.prototype.bind=function(q,he,J,_e,qe,lt,vt,Ke){this.context=q;for(var at=this.boundPaintVertexBuffers.length!==_e.length,bt=0;!at&&bt<_e.length;bt++)this.boundPaintVertexBuffers[bt]!==_e[bt]&&(at=!0);var Zt=!this.vao||this.boundProgram!==he||this.boundLayoutVertexBuffer!==J||at||this.boundIndexBuffer!==qe||this.boundVertexOffset!==lt||this.boundDynamicVertexBuffer!==vt||this.boundDynamicVertexBuffer2!==Ke;!q.extVertexArrayObject||Zt?this.freshBind(he,J,_e,qe,lt,vt,Ke):(q.bindVertexArrayOES.set(this.vao),vt&&vt.bind(),qe&&qe.dynamicDraw&&qe.bind(),Ke&&Ke.bind())},Ff.prototype.freshBind=function(q,he,J,_e,qe,lt,vt){var Ke,at=q.numAttributes,bt=this.context,Zt=bt.gl;if(bt.extVertexArrayObject)this.vao&&this.destroy(),this.vao=bt.extVertexArrayObject.createVertexArrayOES(),bt.bindVertexArrayOES.set(this.vao),Ke=0,this.boundProgram=q,this.boundLayoutVertexBuffer=he,this.boundPaintVertexBuffers=J,this.boundIndexBuffer=_e,this.boundVertexOffset=qe,this.boundDynamicVertexBuffer=lt,this.boundDynamicVertexBuffer2=vt;else{Ke=bt.currentNumAttributes||0;for(var Vt=at;Vt>16,vt>>16],u_pixel_coord_lower:[lt&65535,vt&65535]}}function uh(be,q,he,J){var _e=he.imageManager.getPattern(be.from.toString()),qe=he.imageManager.getPattern(be.to.toString()),lt=he.imageManager.getPixelSize(),vt=lt.width,Ke=lt.height,at=Math.pow(2,J.tileID.overscaledZ),bt=J.tileSize*Math.pow(2,he.transform.tileZoom)/at,Zt=bt*(J.tileID.canonical.x+J.tileID.wrap*at),Vt=bt*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:_e.tl,u_pattern_br_a:_e.br,u_pattern_tl_b:qe.tl,u_pattern_br_b:qe.br,u_texsize:[vt,Ke],u_mix:q.t,u_pattern_size_a:_e.displaySize,u_pattern_size_b:qe.displaySize,u_scale_a:q.fromScale,u_scale_b:q.toScale,u_tile_units_to_pixels:1/js(J,1,he.transform.tileZoom),u_pixel_coord_upper:[Zt>>16,Vt>>16],u_pixel_coord_lower:[Zt&65535,Vt&65535]}}var Tv=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_opacity:new e.Uniform1f(be,q.u_opacity)}},oc=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_height_factor:new e.Uniform1f(be,q.u_height_factor),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade),u_opacity:new e.Uniform1f(be,q.u_opacity)}},Gh=function(be,q,he,J){var _e=q.style.light,qe=_e.properties.get("position"),lt=[qe.x,qe.y,qe.z],vt=e.create$1();_e.properties.get("anchor")==="viewport"&&e.fromRotation(vt,-q.transform.angle),e.transformMat3(lt,lt,vt);var Ke=_e.properties.get("color");return{u_matrix:be,u_lightpos:lt,u_lightintensity:_e.properties.get("intensity"),u_lightcolor:[Ke.r,Ke.g,Ke.b],u_vertical_gradient:+he,u_opacity:J}},Hc=function(be,q,he,J,_e,qe,lt){return e.extend(Gh(be,q,he,J),cf(qe,q,lt),{u_height_factor:-Math.pow(2,_e.overscaledZ)/lt.tileSize/8})},Tf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},ff=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},xu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world)}},yc=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},fu=function(be){return{u_matrix:be}},Bf=function(be,q,he,J){return e.extend(fu(be),cf(he,q,J))},hf=function(be,q){return{u_matrix:be,u_world:q}},Oh=function(be,q,he,J,_e){return e.extend(Bf(be,q,he,J),{u_world:_e})},ur=function(be,q){return{u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(be,q.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Pr=function(be,q,he,J){var _e=be.transform,qe,lt;if(J.paint.get("circle-pitch-alignment")==="map"){var vt=js(he,1,_e.zoom);qe=!0,lt=[vt,vt]}else qe=!1,lt=_e.pixelsToGLUnits;return{u_camera_to_center_distance:_e.cameraToCenterDistance,u_scale_with_map:+(J.paint.get("circle-pitch-scale")==="map"),u_matrix:be.translatePosMatrix(q.posMatrix,he,J.paint.get("circle-translate"),J.paint.get("circle-translate-anchor")),u_pitch_with_map:+qe,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:lt}},vn=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(be,q.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_overscale_factor:new e.Uniform1f(be,q.u_overscale_factor)}},rn=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_inv_matrix:new e.UniformMatrix4f(be,q.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(be,q.u_viewport_size)}},On=function(be,q,he){var J=js(he,1,q.zoom),_e=Math.pow(2,q.zoom-he.tileID.overscaledZ),qe=he.tileID.overscaleFactor();return{u_matrix:be,u_camera_to_center_distance:q.cameraToCenterDistance,u_pixels_to_tile_units:J,u_extrude_scale:[q.pixelsToGLUnits[0]/(J*_e),q.pixelsToGLUnits[1]/(J*_e)],u_overscale_factor:qe}},Ta=function(be,q,he){return{u_matrix:be,u_inv_matrix:q,u_camera_to_center_distance:he.cameraToCenterDistance,u_viewport_size:[he.width,he.height]}},ya=function(be,q){return{u_color:new e.UniformColor(be,q.u_color),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_overlay:new e.Uniform1i(be,q.u_overlay),u_overlay_scale:new e.Uniform1f(be,q.u_overlay_scale)}},ei=function(be,q,he){return he===void 0&&(he=1),{u_matrix:be,u_color:q,u_overlay:0,u_overlay_scale:he}},si=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Bi=function(be){return{u_matrix:be}},Va=function(be,q){return{u_extrude_scale:new e.Uniform1f(be,q.u_extrude_scale),u_intensity:new e.Uniform1f(be,q.u_intensity),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},_i=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_color_ramp:new e.Uniform1i(be,q.u_color_ramp),u_opacity:new e.Uniform1f(be,q.u_opacity)}},Ja=function(be,q,he,J){return{u_matrix:be,u_extrude_scale:js(q,1,he),u_intensity:J}},Ba=function(be,q,he,J){var _e=e.create();e.ortho(_e,0,be.width,be.height,0,0,1);var qe=be.context.gl;return{u_matrix:_e,u_world:[qe.drawingBufferWidth,qe.drawingBufferHeight],u_image:he,u_color_ramp:J,u_opacity:q.paint.get("heatmap-opacity")}},Gi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_latrange:new e.Uniform2f(be,q.u_latrange),u_light:new e.Uniform2f(be,q.u_light),u_shadow:new e.UniformColor(be,q.u_shadow),u_highlight:new e.UniformColor(be,q.u_highlight),u_accent:new e.UniformColor(be,q.u_accent)}},No=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_dimension:new e.Uniform2f(be,q.u_dimension),u_zoom:new e.Uniform1f(be,q.u_zoom),u_unpack:new e.Uniform4f(be,q.u_unpack)}},Ro=function(be,q,he){var J=he.paint.get("hillshade-shadow-color"),_e=he.paint.get("hillshade-highlight-color"),qe=he.paint.get("hillshade-accent-color"),lt=he.paint.get("hillshade-illumination-direction")*(Math.PI/180);he.paint.get("hillshade-illumination-anchor")==="viewport"&&(lt-=be.transform.angle);var vt=!be.options.moving;return{u_matrix:be.transform.calculatePosMatrix(q.tileID.toUnwrapped(),vt),u_image:0,u_latrange:jo(be,q.tileID),u_light:[he.paint.get("hillshade-exaggeration"),lt],u_shadow:J,u_highlight:_e,u_accent:qe}},Go=function(be,q){var he=q.stride,J=e.create();return e.ortho(J,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(J,J,[0,-e.EXTENT,0]),{u_matrix:J,u_image:1,u_dimension:[he,he],u_zoom:be.overscaledZ,u_unpack:q.getUnpackVector()}};function jo(be,q){var he=Math.pow(2,q.canonical.z),J=q.canonical.y;return[new e.MercatorCoordinate(0,J/he).toLngLat().lat,new e.MercatorCoordinate(0,(J+1)/he).toLngLat().lat]}var Yi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels)}},ki=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_image:new e.Uniform1i(be,q.u_image),u_image_height:new e.Uniform1f(be,q.u_image_height)}},ns=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_texsize:new e.Uniform2f(be,q.u_texsize),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_image:new e.Uniform1i(be,q.u_image),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},Fs=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(be,q.u_patternscale_a),u_patternscale_b:new e.Uniform2f(be,q.u_patternscale_b),u_sdfgamma:new e.Uniform1f(be,q.u_sdfgamma),u_image:new e.Uniform1i(be,q.u_image),u_tex_y_a:new e.Uniform1f(be,q.u_tex_y_a),u_tex_y_b:new e.Uniform1f(be,q.u_tex_y_b),u_mix:new e.Uniform1f(be,q.u_mix)}},wl=function(be,q,he){var J=be.transform;return{u_matrix:Su(be,q,he),u_ratio:1/js(q,1,J.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/J.pixelsToGLUnits[0],1/J.pixelsToGLUnits[1]]}},Hl=function(be,q,he,J){return e.extend(wl(be,q,he),{u_image:0,u_image_height:J})},Sl=function(be,q,he,J){var _e=be.transform,qe=el(q,_e);return{u_matrix:Su(be,q,he),u_texsize:q.imageAtlasTexture.size,u_ratio:1/js(q,1,_e.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[qe,J.fromScale,J.toScale],u_fade:J.t,u_units_to_pixels:[1/_e.pixelsToGLUnits[0],1/_e.pixelsToGLUnits[1]]}},Gl=function(be,q,he,J,_e){var qe=be.transform,lt=be.lineAtlas,vt=el(q,qe),Ke=he.layout.get("line-cap")==="round",at=lt.getDash(J.from,Ke),bt=lt.getDash(J.to,Ke),Zt=at.width*_e.fromScale,Vt=bt.width*_e.toScale;return e.extend(wl(be,q,he),{u_patternscale_a:[vt/Zt,-at.height/2],u_patternscale_b:[vt/Vt,-bt.height/2],u_sdfgamma:lt.width/(Math.min(Zt,Vt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:at.y,u_tex_y_b:bt.y,u_mix:_e.t})};function el(be,q){return 1/js(be,1,q.tileZoom)}function Su(be,q,he){return be.translatePosMatrix(q.tileID.posMatrix,q,he.paint.get("line-translate"),he.paint.get("line-translate-anchor"))}var bu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_tl_parent:new e.Uniform2f(be,q.u_tl_parent),u_scale_parent:new e.Uniform1f(be,q.u_scale_parent),u_buffer_scale:new e.Uniform1f(be,q.u_buffer_scale),u_fade_t:new e.Uniform1f(be,q.u_fade_t),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image0:new e.Uniform1i(be,q.u_image0),u_image1:new e.Uniform1i(be,q.u_image1),u_brightness_low:new e.Uniform1f(be,q.u_brightness_low),u_brightness_high:new e.Uniform1f(be,q.u_brightness_high),u_saturation_factor:new e.Uniform1f(be,q.u_saturation_factor),u_contrast_factor:new e.Uniform1f(be,q.u_contrast_factor),u_spin_weights:new e.Uniform3f(be,q.u_spin_weights)}},Ul=function(be,q,he,J,_e){return{u_matrix:be,u_tl_parent:q,u_scale_parent:he,u_buffer_scale:1,u_fade_t:J.mix,u_opacity:J.opacity*_e.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_e.paint.get("raster-brightness-min"),u_brightness_high:_e.paint.get("raster-brightness-max"),u_saturation_factor:Il(_e.paint.get("raster-saturation")),u_contrast_factor:gs(_e.paint.get("raster-contrast")),u_spin_weights:po(_e.paint.get("raster-hue-rotate"))}};function po(be){be*=Math.PI/180;var q=Math.sin(be),he=Math.cos(be);return[(2*he+1)/3,(-Math.sqrt(3)*q-he+1)/3,(Math.sqrt(3)*q-he+1)/3]}function gs(be){return be>0?1/(1-be):1+be}function Il(be){return be>0?1-1/(1.001-be):-be}var dl=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture)}},vc=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},dc=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texsize_icon:new e.Uniform2f(be,q.u_texsize_icon),u_texture:new e.Uniform1i(be,q.u_texture),u_texture_icon:new e.Uniform1i(be,q.u_texture_icon),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},_c=function(be,q,he,J,_e,qe,lt,vt,Ke,at){var bt=_e.transform;return{u_is_size_zoom_constant:+(be==="constant"||be==="source"),u_is_size_feature_constant:+(be==="constant"||be==="camera"),u_size_t:q?q.uSizeT:0,u_size:q?q.uSize:0,u_camera_to_center_distance:bt.cameraToCenterDistance,u_pitch:bt.pitch/360*2*Math.PI,u_rotate_symbol:+he,u_aspect_ratio:bt.width/bt.height,u_fade_change:_e.options.fadeDuration?_e.symbolFadeChange:1,u_matrix:qe,u_label_plane_matrix:lt,u_coord_matrix:vt,u_is_text:+Ke,u_pitch_with_map:+J,u_texsize:at,u_texture:0}},Hf=function(be,q,he,J,_e,qe,lt,vt,Ke,at,bt){var Zt=_e.transform;return e.extend(_c(be,q,he,J,_e,qe,lt,vt,Ke,at),{u_gamma_scale:J?Math.cos(Zt._pitch)*Zt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},pc=function(be,q,he,J,_e,qe,lt,vt,Ke,at){return e.extend(Hf(be,q,he,J,_e,qe,lt,vt,!0,Ke),{u_texsize_icon:at,u_texture_icon:1})},Af=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_color:new e.UniformColor(be,q.u_color)}},Mu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image:new e.Uniform1i(be,q.u_image),u_pattern_tl_a:new e.Uniform2f(be,q.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(be,q.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(be,q.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(be,q.u_pattern_br_b),u_texsize:new e.Uniform2f(be,q.u_texsize),u_mix:new e.Uniform1f(be,q.u_mix),u_pattern_size_a:new e.Uniform2f(be,q.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(be,q.u_pattern_size_b),u_scale_a:new e.Uniform1f(be,q.u_scale_a),u_scale_b:new e.Uniform1f(be,q.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(be,q.u_tile_units_to_pixels)}},Sf=function(be,q,he){return{u_matrix:be,u_opacity:q,u_color:he}},Xo=function(be,q,he,J,_e,qe){return e.extend(uh(J,qe,he,_e),{u_matrix:be,u_opacity:q})},as={fillExtrusion:Tv,fillExtrusionPattern:oc,fill:Tf,fillPattern:ff,fillOutline:xu,fillOutlinePattern:yc,circle:ur,collisionBox:vn,collisionCircle:rn,debug:ya,clippingMask:si,heatmap:Va,heatmapTexture:_i,hillshade:Gi,hillshadePrepare:No,line:Yi,lineGradient:ki,linePattern:ns,lineSDF:Fs,raster:bu,symbolIcon:dl,symbolSDF:vc,symbolTextAndIcon:dc,background:Af,backgroundPattern:Mu},Mf;function Gc(be,q,he,J,_e,qe,lt){for(var vt=be.context,Ke=vt.gl,at=be.useProgram("collisionBox"),bt=[],Zt=0,Vt=0,Kt=0;Kt0){var Yr=e.create(),cn=Xt;e.mul(Yr,Bt.placementInvProjMatrix,be.transform.glCoordMatrix),e.mul(Yr,Yr,Bt.placementViewportMatrix),bt.push({circleArray:zr,circleOffset:Vt,transform:cn,invTransform:Yr}),Zt+=zr.length/4,Vt=Zt}Ht&&at.draw(vt,Ke.LINES,qn.disabled,Nn.disabled,be.colorModeForRenderPass(),Vr.disabled,On(Xt,be.transform,er),he.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,null,be.transform.zoom,null,null,Ht.collisionVertexBuffer)}}if(!(!lt||!bt.length)){var sa=be.useProgram("collisionCircle"),Yn=new e.StructArrayLayout2f1f2i16;Yn.resize(Zt*4),Yn._trim();for(var Hn=0,la=0,ha=bt;la=0&&(nr[Bt.associatedIconIndex]={shiftedAnchor:Oa,angle:Ka})}}if(bt){Kt.clear();for(var qi=be.icon.placedSymbolArray,_s=0;_s0){var lt=e.browser.now(),vt=(lt-be.timeAdded)/qe,Ke=q?(lt-q.timeAdded)/qe:-1,at=he.getSource(),bt=_e.coveringZoomLevel({tileSize:at.tileSize,roundZoom:at.roundZoom}),Zt=!q||Math.abs(q.tileID.overscaledZ-bt)>Math.abs(be.tileID.overscaledZ-bt),Vt=Zt&&be.refreshedUponExpiration?1:e.clamp(Zt?vt:1-Ke,0,1);return be.refreshedUponExpiration&&vt>=1&&(be.refreshedUponExpiration=!1),q?{opacity:1,mix:1-Vt}:{opacity:Vt,mix:0}}else return{opacity:1,mix:0}}function Lr(be,q,he){var J=he.paint.get("background-color"),_e=he.paint.get("background-opacity");if(_e!==0){var qe=be.context,lt=qe.gl,vt=be.transform,Ke=vt.tileSize,at=he.paint.get("background-pattern");if(!be.isPatternMissing(at)){var bt=!at&&J.a===1&&_e===1&&be.opaquePassEnabledForLayer()?"opaque":"translucent";if(be.renderPass===bt){var Zt=Nn.disabled,Vt=be.depthModeForSublayer(0,bt==="opaque"?qn.ReadWrite:qn.ReadOnly),Kt=be.colorModeForRenderPass(),nr=be.useProgram(at?"backgroundPattern":"background"),er=vt.coveringTiles({tileSize:Ke});at&&(qe.activeTexture.set(lt.TEXTURE0),be.imageManager.bind(be.context));for(var Bt=he.getCrossfadeParameters(),Xt=0,Ht=er;Xt "+he.overscaledZ);var Xt=Bt+" "+Kt+"kb";Wo(be,Xt),lt.draw(J,_e.TRIANGLES,vt,Ke,qt.alphaBlended,Vr.disabled,ei(qe,e.Color.transparent,er),bt,be.debugBuffer,be.quadTriangleIndexBuffer,be.debugSegments)}function Wo(be,q){be.initDebugOverlayCanvas();var he=be.debugOverlayCanvas,J=be.context.gl,_e=be.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,he.width,he.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(q,5,5),_e.strokeText(q,5,5),be.debugOverlayTexture.update(he),be.debugOverlayTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE)}function Ks(be,q,he){var J=be.context,_e=he.implementation;if(be.renderPass==="offscreen"){var qe=_e.prerender;qe&&(be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),qe.call(_e,J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState())}else if(be.renderPass==="translucent"){be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),J.setStencilMode(Nn.disabled);var lt=_e.renderingMode==="3d"?new qn(be.context.gl.LEQUAL,qn.ReadWrite,be.depthRangeFor3D):be.depthModeForSublayer(0,qn.ReadOnly);J.setDepthMode(lt),_e.render(J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState(),J.bindFramebuffer.set(null)}}var $s={symbol:P,circle:Gt,heatmap:cr,line:yn,fill:Ze,"fill-extrusion":ft,hillshade:zt,raster:mr,background:Lr,debug:yo,custom:Ks},ks=function(q,he){this.context=new on(q),this.transform=he,this._tileTextures={},this.setup(),this.numSublayers=pn.maxUnderzooming+pn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new cu,this.gpuTimers={}};ks.prototype.resize=function(q,he){if(this.width=q*e.browser.devicePixelRatio,this.height=he*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var J=0,_e=this.style._order;J<_e.length;J+=1){var qe=_e[J];this.style._layers[qe].resize()}},ks.prototype.setup=function(){var q=this.context,he=new e.StructArrayLayout2i4;he.emplaceBack(0,0),he.emplaceBack(e.EXTENT,0),he.emplaceBack(0,e.EXTENT),he.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=q.createVertexBuffer(he,sf.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var J=new e.StructArrayLayout2i4;J.emplaceBack(0,0),J.emplaceBack(e.EXTENT,0),J.emplaceBack(0,e.EXTENT),J.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=q.createVertexBuffer(J,sf.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var _e=new e.StructArrayLayout4i8;_e.emplaceBack(0,0,0,0),_e.emplaceBack(e.EXTENT,0,e.EXTENT,0),_e.emplaceBack(0,e.EXTENT,0,e.EXTENT),_e.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=q.createVertexBuffer(_e,fe.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var qe=new e.StructArrayLayout2i4;qe.emplaceBack(0,0),qe.emplaceBack(1,0),qe.emplaceBack(0,1),qe.emplaceBack(1,1),this.viewportBuffer=q.createVertexBuffer(qe,sf.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var lt=new e.StructArrayLayout1ui2;lt.emplaceBack(0),lt.emplaceBack(1),lt.emplaceBack(3),lt.emplaceBack(2),lt.emplaceBack(0),this.tileBorderIndexBuffer=q.createIndexBuffer(lt);var vt=new e.StructArrayLayout3ui6;vt.emplaceBack(0,1,2),vt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=q.createIndexBuffer(vt),this.emptyTexture=new e.Texture(q,{width:1,height:1,data:new Uint8Array([0,0,0,0])},q.gl.RGBA);var Ke=this.context.gl;this.stencilClearMode=new Nn({func:Ke.ALWAYS,mask:0},0,255,Ke.ZERO,Ke.ZERO,Ke.ZERO)},ks.prototype.clearStencil=function(){var q=this.context,he=q.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var J=e.create();e.ortho(J,0,this.width,this.height,0,0,1),e.scale(J,J,[he.drawingBufferWidth,he.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(q,he.TRIANGLES,qn.disabled,this.stencilClearMode,qt.disabled,Vr.disabled,Bi(J),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ks.prototype._renderTileClippingMasks=function(q,he){if(!(this.currentStencilSource===q.source||!q.isTileClipped()||!he||!he.length)){this.currentStencilSource=q.source;var J=this.context,_e=J.gl;this.nextStencilID+he.length>256&&this.clearStencil(),J.setColorMode(qt.disabled),J.setDepthMode(qn.disabled);var qe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var lt=0,vt=he;lt256&&this.clearStencil();var q=this.nextStencilID++,he=this.context.gl;return new Nn({func:he.NOTEQUAL,mask:255},q,255,he.KEEP,he.KEEP,he.REPLACE)},ks.prototype.stencilModeForClipping=function(q){var he=this.context.gl;return new Nn({func:he.EQUAL,mask:255},this._tileClippingMaskIDs[q.key],0,he.KEEP,he.KEEP,he.REPLACE)},ks.prototype.stencilConfigForOverlap=function(q){var he,J=this.context.gl,_e=q.sort(function(at,bt){return bt.overscaledZ-at.overscaledZ}),qe=_e[_e.length-1].overscaledZ,lt=_e[0].overscaledZ-qe+1;if(lt>1){this.currentStencilSource=void 0,this.nextStencilID+lt>256&&this.clearStencil();for(var vt={},Ke=0;Ke=0;this.currentLayer--){var Yr=this.style._layers[_e[this.currentLayer]],cn=qe[Yr.source],sa=Ke[Yr.source];this._renderTileClippingMasks(Yr,sa),this.renderLayer(this,cn,Yr,sa)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<_e.length;this.currentLayer++){var Yn=this.style._layers[_e[this.currentLayer]],Hn=qe[Yn.source],la=(Yn.type==="symbol"?bt:at)[Yn.source];this._renderTileClippingMasks(Yn,Ke[Yn.source]),this.renderLayer(this,Hn,Yn,la)}if(this.options.showTileBoundaries){var ha,La,ca=e.values(this.style._layers);ca.forEach(function(Oa){Oa.source&&!Oa.isHidden(J.transform.zoom)&&(Oa.source!==(La&&La.id)&&(La=J.style.sourceCaches[Oa.source]),(!ha||ha.getSource().maxzoom0?he.pop():null},ks.prototype.isPatternMissing=function(q){if(!q)return!1;if(!q.from||!q.to)return!0;var he=this.imageManager.getPattern(q.from.toString()),J=this.imageManager.getPattern(q.to.toString());return!he||!J},ks.prototype.useProgram=function(q,he){this.cache=this.cache||{};var J=""+q+(he?he.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[J]||(this.cache[J]=new lh(this.context,q,sh[q],he,as[q],this._showOverdrawInspector)),this.cache[J]},ks.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()},ks.prototype.setBaseState=function(){var q=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(q.FUNC_ADD)},ks.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var q=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,q.RGBA)}},ks.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var nl=function(q,he){this.points=q,this.planes=he};nl.fromInvProjectionMatrix=function(q,he,J){var _e=[[-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]],qe=Math.pow(2,J),lt=_e.map(function(at){return e.transformMat4([],at,q)}).map(function(at){return e.scale$1([],at,1/at[3]/he*qe)}),vt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Ke=vt.map(function(at){var bt=e.sub([],lt[at[0]],lt[at[1]]),Zt=e.sub([],lt[at[2]],lt[at[1]]),Vt=e.normalize([],e.cross([],bt,Zt)),Kt=-e.dot(Vt,lt[at[1]]);return Vt.concat(Kt)});return new nl(lt,Ke)};var hu=function(q,he){this.min=q,this.max=he,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};hu.prototype.quadrant=function(q){for(var he=[q%2===0,q<2],J=e.clone$2(this.min),_e=e.clone$2(this.max),qe=0;qe=0;if(lt===0)return 0;lt!==he.length&&(J=!1)}if(J)return 2;for(var Ke=0;Ke<3;Ke++){for(var at=Number.MAX_VALUE,bt=-Number.MAX_VALUE,Zt=0;Ztthis.max[Ke]-this.min[Ke])return 0}return 1};var eu=function(q,he,J,_e){if(q===void 0&&(q=0),he===void 0&&(he=0),J===void 0&&(J=0),_e===void 0&&(_e=0),isNaN(q)||q<0||isNaN(he)||he<0||isNaN(J)||J<0||isNaN(_e)||_e<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=q,this.bottom=he,this.left=J,this.right=_e};eu.prototype.interpolate=function(q,he,J){return he.top!=null&&q.top!=null&&(this.top=e.number(q.top,he.top,J)),he.bottom!=null&&q.bottom!=null&&(this.bottom=e.number(q.bottom,he.bottom,J)),he.left!=null&&q.left!=null&&(this.left=e.number(q.left,he.left,J)),he.right!=null&&q.right!=null&&(this.right=e.number(q.right,he.right,J)),this},eu.prototype.getCenter=function(q,he){var J=e.clamp((this.left+q-this.right)/2,0,q),_e=e.clamp((this.top+he-this.bottom)/2,0,he);return new e.Point(J,_e)},eu.prototype.equals=function(q){return this.top===q.top&&this.bottom===q.bottom&&this.left===q.left&&this.right===q.right},eu.prototype.clone=function(){return new eu(this.top,this.bottom,this.left,this.right)},eu.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cs=function(q,he,J,_e,qe){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=qe===void 0?!0:qe,this._minZoom=q||0,this._maxZoom=he||22,this._minPitch=J??0,this._maxPitch=_e??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 eu,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ls={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}};Cs.prototype.clone=function(){var q=new Cs(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return q.tileSize=this.tileSize,q.latRange=this.latRange,q.width=this.width,q.height=this.height,q._center=this._center,q.zoom=this.zoom,q.angle=this.angle,q._fov=this._fov,q._pitch=this._pitch,q._unmodified=this._unmodified,q._edgeInsets=this._edgeInsets.clone(),q._calcMatrices(),q},Ls.minZoom.get=function(){return this._minZoom},Ls.minZoom.set=function(be){this._minZoom!==be&&(this._minZoom=be,this.zoom=Math.max(this.zoom,be))},Ls.maxZoom.get=function(){return this._maxZoom},Ls.maxZoom.set=function(be){this._maxZoom!==be&&(this._maxZoom=be,this.zoom=Math.min(this.zoom,be))},Ls.minPitch.get=function(){return this._minPitch},Ls.minPitch.set=function(be){this._minPitch!==be&&(this._minPitch=be,this.pitch=Math.max(this.pitch,be))},Ls.maxPitch.get=function(){return this._maxPitch},Ls.maxPitch.set=function(be){this._maxPitch!==be&&(this._maxPitch=be,this.pitch=Math.min(this.pitch,be))},Ls.renderWorldCopies.get=function(){return this._renderWorldCopies},Ls.renderWorldCopies.set=function(be){be===void 0?be=!0:be===null&&(be=!1),this._renderWorldCopies=be},Ls.worldSize.get=function(){return this.tileSize*this.scale},Ls.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ls.size.get=function(){return new e.Point(this.width,this.height)},Ls.bearing.get=function(){return-this.angle/Math.PI*180},Ls.bearing.set=function(be){var q=-e.wrap(be,-180,180)*Math.PI/180;this.angle!==q&&(this._unmodified=!1,this.angle=q,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Ls.pitch.get=function(){return this._pitch/Math.PI*180},Ls.pitch.set=function(be){var q=e.clamp(be,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==q&&(this._unmodified=!1,this._pitch=q,this._calcMatrices())},Ls.fov.get=function(){return this._fov/Math.PI*180},Ls.fov.set=function(be){be=Math.max(.01,Math.min(60,be)),this._fov!==be&&(this._unmodified=!1,this._fov=be/180*Math.PI,this._calcMatrices())},Ls.zoom.get=function(){return this._zoom},Ls.zoom.set=function(be){var q=Math.min(Math.max(be,this.minZoom),this.maxZoom);this._zoom!==q&&(this._unmodified=!1,this._zoom=q,this.scale=this.zoomScale(q),this.tileZoom=Math.floor(q),this.zoomFraction=q-this.tileZoom,this._constrain(),this._calcMatrices())},Ls.center.get=function(){return this._center},Ls.center.set=function(be){be.lat===this._center.lat&&be.lng===this._center.lng||(this._unmodified=!1,this._center=be,this._constrain(),this._calcMatrices())},Ls.padding.get=function(){return this._edgeInsets.toJSON()},Ls.padding.set=function(be){this._edgeInsets.equals(be)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,be,1),this._calcMatrices())},Ls.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cs.prototype.isPaddingEqual=function(q){return this._edgeInsets.equals(q)},Cs.prototype.interpolatePadding=function(q,he,J){this._unmodified=!1,this._edgeInsets.interpolate(q,he,J),this._constrain(),this._calcMatrices()},Cs.prototype.coveringZoomLevel=function(q){var he=(q.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/q.tileSize));return Math.max(0,he)},Cs.prototype.getVisibleUnwrappedCoordinates=function(q){var he=[new e.UnwrappedTileID(0,q)];if(this._renderWorldCopies)for(var J=this.pointCoordinate(new e.Point(0,0)),_e=this.pointCoordinate(new e.Point(this.width,0)),qe=this.pointCoordinate(new e.Point(this.width,this.height)),lt=this.pointCoordinate(new e.Point(0,this.height)),vt=Math.floor(Math.min(J.x,_e.x,qe.x,lt.x)),Ke=Math.floor(Math.max(J.x,_e.x,qe.x,lt.x)),at=1,bt=vt-at;bt<=Ke+at;bt++)bt!==0&&he.push(new e.UnwrappedTileID(bt,q));return he},Cs.prototype.coveringTiles=function(q){var he=this.coveringZoomLevel(q),J=he;if(q.minzoom!==void 0&&heq.maxzoom&&(he=q.maxzoom);var _e=e.MercatorCoordinate.fromLngLat(this.center),qe=Math.pow(2,he),lt=[qe*_e.x,qe*_e.y,0],vt=nl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,he),Ke=q.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Ke=he);var at=3,bt=function(ca){return{aabb:new hu([ca*qe,0,0],[(ca+1)*qe,qe,0]),zoom:0,x:0,y:0,wrap:ca,fullyVisible:!1}},Zt=[],Vt=[],Kt=he,nr=q.reparseOverscaled?J:he;if(this._renderWorldCopies)for(var er=1;er<=3;er++)Zt.push(bt(-er)),Zt.push(bt(er));for(Zt.push(bt(0));Zt.length>0;){var Bt=Zt.pop(),Xt=Bt.x,Ht=Bt.y,zr=Bt.fullyVisible;if(!zr){var Yr=Bt.aabb.intersects(vt);if(Yr===0)continue;zr=Yr===2}var cn=Bt.aabb.distanceX(lt),sa=Bt.aabb.distanceY(lt),Yn=Math.max(Math.abs(cn),Math.abs(sa)),Hn=at+(1<Hn&&Bt.zoom>=Ke){Vt.push({tileID:new e.OverscaledTileID(Bt.zoom===Kt?nr:Bt.zoom,Bt.wrap,Bt.zoom,Xt,Ht),distanceSq:e.sqrLen([lt[0]-.5-Xt,lt[1]-.5-Ht])});continue}for(var la=0;la<4;la++){var ha=(Xt<<1)+la%2,La=(Ht<<1)+(la>>1);Zt.push({aabb:Bt.aabb.quadrant(la),zoom:Bt.zoom+1,x:ha,y:La,wrap:Bt.wrap,fullyVisible:zr})}}return Vt.sort(function(ca,Oa){return ca.distanceSq-Oa.distanceSq}).map(function(ca){return ca.tileID})},Cs.prototype.resize=function(q,he){this.width=q,this.height=he,this.pixelsToGLUnits=[2/q,-2/he],this._constrain(),this._calcMatrices()},Ls.unmodified.get=function(){return this._unmodified},Cs.prototype.zoomScale=function(q){return Math.pow(2,q)},Cs.prototype.scaleZoom=function(q){return Math.log(q)/Math.LN2},Cs.prototype.project=function(q){var he=e.clamp(q.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(q.lng)*this.worldSize,e.mercatorYfromLat(he)*this.worldSize)},Cs.prototype.unproject=function(q){return new e.MercatorCoordinate(q.x/this.worldSize,q.y/this.worldSize).toLngLat()},Ls.point.get=function(){return this.project(this.center)},Cs.prototype.setLocationAtPoint=function(q,he){var J=this.pointCoordinate(he),_e=this.pointCoordinate(this.centerPoint),qe=this.locationCoordinate(q),lt=new e.MercatorCoordinate(qe.x-(J.x-_e.x),qe.y-(J.y-_e.y));this.center=this.coordinateLocation(lt),this._renderWorldCopies&&(this.center=this.center.wrap())},Cs.prototype.locationPoint=function(q){return this.coordinatePoint(this.locationCoordinate(q))},Cs.prototype.pointLocation=function(q){return this.coordinateLocation(this.pointCoordinate(q))},Cs.prototype.locationCoordinate=function(q){return e.MercatorCoordinate.fromLngLat(q)},Cs.prototype.coordinateLocation=function(q){return q.toLngLat()},Cs.prototype.pointCoordinate=function(q){var he=0,J=[q.x,q.y,0,1],_e=[q.x,q.y,1,1];e.transformMat4(J,J,this.pixelMatrixInverse),e.transformMat4(_e,_e,this.pixelMatrixInverse);var qe=J[3],lt=_e[3],vt=J[0]/qe,Ke=_e[0]/lt,at=J[1]/qe,bt=_e[1]/lt,Zt=J[2]/qe,Vt=_e[2]/lt,Kt=Zt===Vt?0:(he-Zt)/(Vt-Zt);return new e.MercatorCoordinate(e.number(vt,Ke,Kt)/this.worldSize,e.number(at,bt,Kt)/this.worldSize)},Cs.prototype.coordinatePoint=function(q){var he=[q.x*this.worldSize,q.y*this.worldSize,0,1];return e.transformMat4(he,he,this.pixelMatrix),new e.Point(he[0]/he[3],he[1]/he[3])},Cs.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)))},Cs.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]])},Cs.prototype.setMaxBounds=function(q){q?(this.lngRange=[q.getWest(),q.getEast()],this.latRange=[q.getSouth(),q.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Cs.prototype.calculatePosMatrix=function(q,he){he===void 0&&(he=!1);var J=q.key,_e=he?this._alignedPosMatrixCache:this._posMatrixCache;if(_e[J])return _e[J];var qe=q.canonical,lt=this.worldSize/this.zoomScale(qe.z),vt=qe.x+Math.pow(2,qe.z)*q.wrap,Ke=e.identity(new Float64Array(16));return e.translate(Ke,Ke,[vt*lt,qe.y*lt,0]),e.scale(Ke,Ke,[lt/e.EXTENT,lt/e.EXTENT,1]),e.multiply(Ke,he?this.alignedProjMatrix:this.projMatrix,Ke),_e[J]=new Float32Array(Ke),_e[J]},Cs.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cs.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var q=-90,he=90,J=-180,_e=180,qe,lt,vt,Ke,at=this.size,bt=this._unmodified;if(this.latRange){var Zt=this.latRange;q=e.mercatorYfromLat(Zt[1])*this.worldSize,he=e.mercatorYfromLat(Zt[0])*this.worldSize,qe=he-qhe&&(Ke=he-Bt)}if(this.lngRange){var Xt=Kt.x,Ht=at.x/2;Xt-Ht_e&&(vt=_e-Ht)}(vt!==void 0||Ke!==void 0)&&(this.center=this.unproject(new e.Point(vt!==void 0?vt:Kt.x,Ke!==void 0?Ke:Kt.y))),this._unmodified=bt,this._constraining=!1}},Cs.prototype._calcMatrices=function(){if(this.height){var q=this._fov/2,he=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(q)*this.height;var J=Math.PI/2+this._pitch,_e=this._fov*(.5+he.y/this.height),qe=Math.sin(_e)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-J-_e,.01,Math.PI-.01)),lt=this.point,vt=lt.x,Ke=lt.y,at=Math.cos(Math.PI/2-this._pitch)*qe+this.cameraToCenterDistance,bt=at*1.01,Zt=this.height/50,Vt=new Float64Array(16);e.perspective(Vt,this._fov,this.width/this.height,Zt,bt),Vt[8]=-he.x*2/this.width,Vt[9]=he.y*2/this.height,e.scale(Vt,Vt,[1,-1,1]),e.translate(Vt,Vt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Vt,Vt,this._pitch),e.rotateZ(Vt,Vt,this.angle),e.translate(Vt,Vt,[-vt,-Ke,0]),this.mercatorMatrix=e.scale([],Vt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Vt,Vt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Vt,this.invProjMatrix=e.invert([],this.projMatrix);var Kt=this.width%2/2,nr=this.height%2/2,er=Math.cos(this.angle),Bt=Math.sin(this.angle),Xt=vt-Math.round(vt)+er*Kt+Bt*nr,Ht=Ke-Math.round(Ke)+er*nr+Bt*Kt,zr=new Float64Array(Vt);if(e.translate(zr,zr,[Xt>.5?Xt-1:Xt,Ht>.5?Ht-1:Ht,0]),this.alignedProjMatrix=zr,Vt=e.create(),e.scale(Vt,Vt,[this.width/2,-this.height/2,1]),e.translate(Vt,Vt,[1,-1,0]),this.labelPlaneMatrix=Vt,Vt=e.create(),e.scale(Vt,Vt,[1,-1,1]),e.translate(Vt,Vt,[-1,-1,0]),e.scale(Vt,Vt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Vt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Vt=e.invert(new Float64Array(16),this.pixelMatrix),!Vt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Vt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cs.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var q=this.pointCoordinate(new e.Point(0,0)),he=[q.x*this.worldSize,q.y*this.worldSize,0,1],J=e.transformMat4(he,he,this.pixelMatrix);return J[3]/this.cameraToCenterDistance},Cs.prototype.getCameraPoint=function(){var q=this._pitch,he=Math.tan(q)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,he))},Cs.prototype.getCameraQueryGeometry=function(q){var he=this.getCameraPoint();if(q.length===1)return[q[0],he];for(var J=he.x,_e=he.y,qe=he.x,lt=he.y,vt=0,Ke=q;vt=3&&!q.some(function(J){return isNaN(J)})){var he=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(q[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+q[2],+q[1]],zoom:+q[0],bearing:he,pitch:+(q[4]||0)}),!0}return!1},ac.prototype._updateHashUnthrottled=function(){var q=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,q)}catch{}};var zc={linearity:.3,easing:e.bezier(0,0,.3,1)},ge=e.extend({deceleration:2500,maxSpeed:1400},zc),Oe=e.extend({deceleration:20,maxSpeed:1400},zc),tt=e.extend({deceleration:1e3,maxSpeed:360},zc),xt=e.extend({deceleration:1e3,maxSpeed:90},zc),At=function(q){this._map=q,this.clear()};At.prototype.clear=function(){this._inertiaBuffer=[]},At.prototype.record=function(q){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:q})},At.prototype._drainInertiaBuffer=function(){for(var q=this._inertiaBuffer,he=e.browser.now(),J=160;q.length>0&&he-q[0].time>J;)q.shift()},At.prototype._onMoveEnd=function(q){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var he={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},J=0,_e=this._inertiaBuffer;J<_e.length;J+=1){var qe=_e[J],lt=qe.settings;he.zoom+=lt.zoomDelta||0,he.bearing+=lt.bearingDelta||0,he.pitch+=lt.pitchDelta||0,lt.panDelta&&he.pan._add(lt.panDelta),lt.around&&(he.around=lt.around),lt.pinchAround&&(he.pinchAround=lt.pinchAround)}var vt=this._inertiaBuffer[this._inertiaBuffer.length-1],Ke=vt.time-this._inertiaBuffer[0].time,at={};if(he.pan.mag()){var bt=Qt(he.pan.mag(),Ke,e.extend({},ge,q||{}));at.offset=he.pan.mult(bt.amount/he.pan.mag()),at.center=this._map.transform.center,It(at,bt)}if(he.zoom){var Zt=Qt(he.zoom,Ke,Oe);at.zoom=this._map.transform.zoom+Zt.amount,It(at,Zt)}if(he.bearing){var Vt=Qt(he.bearing,Ke,tt);at.bearing=this._map.transform.bearing+e.clamp(Vt.amount,-179,179),It(at,Vt)}if(he.pitch){var Kt=Qt(he.pitch,Ke,xt);at.pitch=this._map.transform.pitch+Kt.amount,It(at,Kt)}if(at.zoom||at.bearing){var nr=he.pinchAround===void 0?he.around:he.pinchAround;at.around=nr?this._map.unproject(nr):this._map.getCenter()}return this.clear(),e.extend(at,{noMoveStart:!0})}};function It(be,q){(!be.duration||be.duration=this._clickTolerance||this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.dblclick=function(q){return this._firePreventable(new Jt(q.type,this._map,q))},Hr.prototype.mouseover=function(q){this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.mouseout=function(q){this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.touchstart=function(q){return this._firePreventable(new yr(q.type,this._map,q))},Hr.prototype.touchmove=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype.touchend=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype.touchcancel=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype._firePreventable=function(q){if(this._map.fire(q),q.defaultPrevented)return{}},Hr.prototype.isEnabled=function(){return!0},Hr.prototype.isActive=function(){return!1},Hr.prototype.enable=function(){},Hr.prototype.disable=function(){};var fn=function(q){this._map=q};fn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},fn.prototype.mousemove=function(q){this._map.fire(new Jt(q.type,this._map,q))},fn.prototype.mousedown=function(){this._delayContextMenu=!0},fn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Jt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},fn.prototype.contextmenu=function(q){this._delayContextMenu?this._contextMenuEvent=q:this._map.fire(new Jt(q.type,this._map,q)),this._map.listens("contextmenu")&&q.preventDefault()},fn.prototype.isEnabled=function(){return!0},fn.prototype.isActive=function(){return!1},fn.prototype.enable=function(){},fn.prototype.disable=function(){};var Sn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._container=q.getContainer(),this._clickTolerance=he.clickTolerance||1};Sn.prototype.isEnabled=function(){return!!this._enabled},Sn.prototype.isActive=function(){return!!this._active},Sn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Sn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sn.prototype.mousedown=function(q,he){this.isEnabled()&&q.shiftKey&&q.button===0&&(r.disableDrag(),this._startPos=this._lastPos=he,this._active=!0)},Sn.prototype.mousemoveWindow=function(q,he){if(this._active){var J=he;if(!(this._lastPos.equals(J)||!this._box&&J.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=q.timeStamp),J.length===this.numTouches&&(this.centroid=Ca(he),this.touches=kn(J,he)))},Aa.prototype.touchmove=function(q,he,J){if(!(this.aborted||!this.centroid)){var _e=kn(J,he);for(var qe in this.touches){var lt=this.touches[qe],vt=_e[qe];(!vt||vt.dist(lt)>oa)&&(this.aborted=!0)}}},Aa.prototype.touchend=function(q,he,J){if((!this.centroid||q.timeStamp-this.startTime>Jn)&&(this.aborted=!0),J.length===0){var _e=!this.aborted&&this.centroid;if(this.reset(),_e)return _e}};var Pa=function(q){this.singleTap=new Aa(q),this.numTaps=q.numTaps,this.reset()};Pa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Pa.prototype.touchstart=function(q,he,J){this.singleTap.touchstart(q,he,J)},Pa.prototype.touchmove=function(q,he,J){this.singleTap.touchmove(q,he,J)},Pa.prototype.touchend=function(q,he,J){var _e=this.singleTap.touchend(q,he,J);if(_e){var qe=q.timeStamp-this.lastTime0&&(this._active=!0);var _e=kn(J,he),qe=new e.Point(0,0),lt=new e.Point(0,0),vt=0;for(var Ke in _e){var at=_e[Ke],bt=this._touches[Ke];bt&&(qe._add(at),lt._add(at.sub(bt)),vt++,_e[Ke]=at)}if(this._touches=_e,!(vtMath.abs(be.x)}var Ml=100,Yl=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.reset=function(){be.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},q.prototype._start=function(J){this._lastPoints=J,xc(J[0].sub(J[1]))&&(this._valid=!1)},q.prototype._move=function(J,_e,qe){var lt=J[0].sub(this._lastPoints[0]),vt=J[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(lt,vt,qe.timeStamp),!!this._valid){this._lastPoints=J,this._active=!0;var Ke=(lt.y+vt.y)/2,at=-.5;return{pitchDelta:Ke*at}}},q.prototype.gestureBeginsVertically=function(J,_e,qe){if(this._valid!==void 0)return this._valid;var lt=2,vt=J.mag()>=lt,Ke=_e.mag()>=lt;if(!(!vt&&!Ke)){if(!vt||!Ke)return this._firstMove===void 0&&(this._firstMove=qe),qe-this._firstMove0==_e.y>0;return xc(J)&&xc(_e)&&at}},q})(tl),Xc={panStep:100,bearingStep:15,pitchStep:10},Eu=function(){var q=Xc;this._panStep=q.panStep,this._bearingStep=q.bearingStep,this._pitchStep=q.pitchStep,this._rotationDisabled=!1};Eu.prototype.reset=function(){this._active=!1},Eu.prototype.keydown=function(q){var he=this;if(!(q.altKey||q.ctrlKey||q.metaKey)){var J=0,_e=0,qe=0,lt=0,vt=0;switch(q.keyCode){case 61:case 107:case 171:case 187:J=1;break;case 189:case 109:case 173:J=-1;break;case 37:q.shiftKey?_e=-1:(q.preventDefault(),lt=-1);break;case 39:q.shiftKey?_e=1:(q.preventDefault(),lt=1);break;case 38:q.shiftKey?qe=1:(q.preventDefault(),vt=-1);break;case 40:q.shiftKey?qe=-1:(q.preventDefault(),vt=1);break;default:return}return this._rotationDisabled&&(_e=0,qe=0),{cameraAnimation:function(Ke){var at=Ke.getZoom();Ke.easeTo({duration:300,easeId:"keyboardHandler",easing:dt,zoom:J?Math.round(at)+J*(q.shiftKey?2:1):at,bearing:Ke.getBearing()+_e*he._bearingStep,pitch:Ke.getPitch()+qe*he._pitchStep,offset:[-lt*he._panStep,-vt*he._panStep],center:Ke.getCenter()},{originalEvent:q})}}}},Eu.prototype.enable=function(){this._enabled=!0},Eu.prototype.disable=function(){this._enabled=!1,this.reset()},Eu.prototype.isEnabled=function(){return this._enabled},Eu.prototype.isActive=function(){return this._active},Eu.prototype.disableRotation=function(){this._rotationDisabled=!0},Eu.prototype.enableRotation=function(){this._rotationDisabled=!1};function dt(be){return be*(2-be)}var gr=4.000244140625,br=1/100,Cn=1/450,ua=2,mn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._handler=he,this._delta=0,this._defaultZoomRate=br,this._wheelZoomRate=Cn,e.bindAll(["_onTimeout"],this)};mn.prototype.setZoomRate=function(q){this._defaultZoomRate=q},mn.prototype.setWheelZoomRate=function(q){this._wheelZoomRate=q},mn.prototype.isEnabled=function(){return!!this._enabled},mn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},mn.prototype.isZooming=function(){return!!this._zooming},mn.prototype.enable=function(q){this.isEnabled()||(this._enabled=!0,this._aroundCenter=q&&q.around==="center")},mn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mn.prototype.wheel=function(q){if(this.isEnabled()){var he=q.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?q.deltaY*40:q.deltaY,J=e.browser.now(),_e=J-(this._lastWheelEventTime||0);this._lastWheelEventTime=J,he!==0&&he%gr===0?this._type="wheel":he!==0&&Math.abs(he)<4?this._type="trackpad":_e>400?(this._type=null,this._lastValue=he,this._timeout=setTimeout(this._onTimeout,40,q)):this._type||(this._type=Math.abs(_e*he)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,he+=this._lastValue)),q.shiftKey&&he&&(he=he/4),this._type&&(this._lastWheelEvent=q,this._delta-=he,this._active||this._start(q)),q.preventDefault()}},mn.prototype._onTimeout=function(q){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(q)},mn.prototype._start=function(q){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 he=r.mousePos(this._el,q);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(he)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mn.prototype.renderFrame=function(){var q=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var he=this._map.transform;if(this._delta!==0){var J=this._type==="wheel"&&Math.abs(this._delta)>gr?this._wheelZoomRate:this._defaultZoomRate,_e=ua/(1+Math.exp(-Math.abs(this._delta*J)));this._delta<0&&_e!==0&&(_e=1/_e);var qe=typeof this._targetZoom=="number"?he.zoomScale(this._targetZoom):he.scale;this._targetZoom=Math.min(he.maxZoom,Math.max(he.minZoom,he.scaleZoom(qe*_e))),this._type==="wheel"&&(this._startZoom=he.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var lt=typeof this._targetZoom=="number"?this._targetZoom:he.zoom,vt=this._startZoom,Ke=this._easing,at=!1,bt;if(this._type==="wheel"&&vt&&Ke){var Zt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Vt=Ke(Zt);bt=e.number(vt,lt,Vt),Zt<1?this._frameId||(this._frameId=!0):at=!0}else bt=lt,at=!0;return this._active=!0,at&&(this._active=!1,this._finishTimeout=setTimeout(function(){q._zooming=!1,q._handler._triggerRenderFrame(),delete q._targetZoom,delete q._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!at,zoomDelta:bt-he.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mn.prototype._smoothOutEasing=function(q){var he=e.ease;if(this._prevEase){var J=this._prevEase,_e=(e.browser.now()-J.start)/J.duration,qe=J.easing(_e+.01)-J.easing(_e),lt=.27/Math.sqrt(qe*qe+1e-4)*.01,vt=Math.sqrt(.27*.27-lt*lt);he=e.bezier(lt,vt,.25,1)}return this._prevEase={start:e.browser.now(),duration:q,easing:he},he},mn.prototype.reset=function(){this._active=!1};var dn=function(q,he){this._clickZoom=q,this._tapZoom=he};dn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},dn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},dn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},dn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Da=function(){this.reset()};Da.prototype.reset=function(){this._active=!1},Da.prototype.dblclick=function(q,he){return q.preventDefault(),{cameraAnimation:function(J){J.easeTo({duration:300,zoom:J.getZoom()+(q.shiftKey?-1:1),around:J.unproject(he)},{originalEvent:q})}}},Da.prototype.enable=function(){this._enabled=!0},Da.prototype.disable=function(){this._enabled=!1,this.reset()},Da.prototype.isEnabled=function(){return this._enabled},Da.prototype.isActive=function(){return this._active};var Ra=function(){this._tap=new Pa({numTouches:1,numTaps:1}),this.reset()};Ra.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ra.prototype.touchstart=function(q,he,J){this._swipePoint||(this._tapTime&&q.timeStamp-this._tapTime>Dn&&this.reset(),this._tapTime?J.length>0&&(this._swipePoint=he[0],this._swipeTouch=J[0].identifier):this._tap.touchstart(q,he,J))},Ra.prototype.touchmove=function(q,he,J){if(!this._tapTime)this._tap.touchmove(q,he,J);else if(this._swipePoint){if(J[0].identifier!==this._swipeTouch)return;var _e=he[0],qe=_e.y-this._swipePoint.y;return this._swipePoint=_e,q.preventDefault(),this._active=!0,{zoomDelta:qe/128}}},Ra.prototype.touchend=function(q,he,J){if(this._tapTime)this._swipePoint&&J.length===0&&this.reset();else{var _e=this._tap.touchend(q,he,J);_e&&(this._tapTime=q.timeStamp)}},Ra.prototype.touchcancel=function(){this.reset()},Ra.prototype.enable=function(){this._enabled=!0},Ra.prototype.disable=function(){this._enabled=!1,this.reset()},Ra.prototype.isEnabled=function(){return this._enabled},Ra.prototype.isActive=function(){return this._active};var Ia=function(q,he,J){this._el=q,this._mousePan=he,this._touchPan=J};Ia.prototype.enable=function(q){this._inertiaOptions=q||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Ia.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Ia.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Ia.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Ya=function(q,he,J){this._pitchWithRotate=q.pitchWithRotate,this._mouseRotate=he,this._mousePitch=J};Ya.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Ya.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Ya.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Ya.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Oi=function(q,he,J,_e){this._el=q,this._touchZoom=he,this._touchRotate=J,this._tapDragZoom=_e,this._rotationDisabled=!1,this._enabled=!0};Oi.prototype.enable=function(q){this._touchZoom.enable(q),this._rotationDisabled||this._touchRotate.enable(q),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Oi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Oi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Oi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Oi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Oi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var pi=function(be){return be.zoom||be.drag||be.pitch||be.rotate},Ha=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q})(e.Event);function pa(be){return be.panDelta&&be.panDelta.mag()||be.zoomDelta||be.bearingDelta||be.pitchDelta}var tn=function(q,he){this._map=q,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new At(q),this._bearingSnap=he.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(he),e.bindAll(["handleEvent","handleWindowEvent"],this);var J=this._el;this._listeners=[[J,"touchstart",{passive:!0}],[J,"touchmove",{passive:!1}],[J,"touchend",void 0],[J,"touchcancel",void 0],[J,"mousedown",void 0],[J,"mousemove",void 0],[J,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[J,"mouseover",void 0],[J,"mouseout",void 0],[J,"dblclick",void 0],[J,"click",void 0],[J,"keydown",{capture:!1}],[J,"keyup",void 0],[J,"wheel",{passive:!1}],[J,"contextmenu",void 0],[e.window,"blur",void 0]];for(var _e=0,qe=this._listeners;_evt?Math.min(2,cn):Math.max(.5,cn),ca=Math.pow(La,1-la),Oa=lt.unproject(zr.add(Yr.mult(la*ca)).mult(ha));lt.setLocationAtPoint(lt.renderWorldCopies?Oa.wrap():Oa,Bt)}qe._fireMoveEvents(_e)},function(la){qe._afterEase(_e,la)},J),this},q.prototype._prepareEase=function(J,_e,qe){qe===void 0&&(qe={}),this._moving=!0,!_e&&!qe.moving&&this.fire(new e.Event("movestart",J)),this._zooming&&!qe.zooming&&this.fire(new e.Event("zoomstart",J)),this._rotating&&!qe.rotating&&this.fire(new e.Event("rotatestart",J)),this._pitching&&!qe.pitching&&this.fire(new e.Event("pitchstart",J))},q.prototype._fireMoveEvents=function(J){this.fire(new e.Event("move",J)),this._zooming&&this.fire(new e.Event("zoom",J)),this._rotating&&this.fire(new e.Event("rotate",J)),this._pitching&&this.fire(new e.Event("pitch",J))},q.prototype._afterEase=function(J,_e){if(!(this._easeId&&_e&&this._easeId===_e)){delete this._easeId;var qe=this._zooming,lt=this._rotating,vt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,qe&&this.fire(new e.Event("zoomend",J)),lt&&this.fire(new e.Event("rotateend",J)),vt&&this.fire(new e.Event("pitchend",J)),this.fire(new e.Event("moveend",J))}},q.prototype.flyTo=function(J,_e){var qe=this;if(!J.essential&&e.browser.prefersReducedMotion){var lt=e.pick(J,["center","zoom","bearing","pitch","around"]);return this.jumpTo(lt,_e)}this.stop(),J=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},J);var vt=this.transform,Ke=this.getZoom(),at=this.getBearing(),bt=this.getPitch(),Zt=this.getPadding(),Vt="zoom"in J?e.clamp(+J.zoom,vt.minZoom,vt.maxZoom):Ke,Kt="bearing"in J?this._normalizeBearing(J.bearing,at):at,nr="pitch"in J?+J.pitch:bt,er="padding"in J?J.padding:vt.padding,Bt=vt.zoomScale(Vt-Ke),Xt=e.Point.convert(J.offset),Ht=vt.centerPoint.add(Xt),zr=vt.pointLocation(Ht),Yr=e.LngLat.convert(J.center||zr);this._normalizeCenter(Yr);var cn=vt.project(zr),sa=vt.project(Yr).sub(cn),Yn=J.curve,Hn=Math.max(vt.width,vt.height),la=Hn/Bt,ha=sa.mag();if("minZoom"in J){var La=e.clamp(Math.min(J.minZoom,Ke,Vt),vt.minZoom,vt.maxZoom),ca=Hn/vt.zoomScale(La-Ke);Yn=Math.sqrt(ca/ha*2)}var Oa=Yn*Yn;function Ka(il){var yu=(la*la-Hn*Hn+(il?-1:1)*Oa*Oa*ha*ha)/(2*(il?la:Hn)*Oa*ha);return Math.log(Math.sqrt(yu*yu+1)-yu)}function xi(il){return(Math.exp(il)-Math.exp(-il))/2}function qi(il){return(Math.exp(il)+Math.exp(-il))/2}function _s(il){return xi(il)/qi(il)}var ds=Ka(0),pl=function(il){return qi(ds)/qi(ds+Yn*il)},cl=function(il){return Hn*((qi(ds)*_s(ds+Yn*il)-xi(ds))/Oa)/ha},yl=(Ka(1)-ds)/Yn;if(Math.abs(ha)<1e-6||!isFinite(yl)){if(Math.abs(Hn-la)<1e-6)return this.easeTo(J,_e);var ml=laJ.maxDuration&&(J.duration=0),this._zooming=!0,this._rotating=at!==Kt,this._pitching=nr!==bt,this._padding=!vt.isPaddingEqual(er),this._prepareEase(_e,!1),this._ease(function(il){var yu=il*yl,Gf=1/pl(yu);vt.zoom=il===1?Vt:Ke+vt.scaleZoom(Gf),qe._rotating&&(vt.bearing=e.number(at,Kt,il)),qe._pitching&&(vt.pitch=e.number(bt,nr,il)),qe._padding&&(vt.interpolatePadding(Zt,er,il),Ht=vt.centerPoint.add(Xt));var wh=il===1?Yr:vt.unproject(cn.add(sa.mult(cl(yu))).mult(Gf));vt.setLocationAtPoint(vt.renderWorldCopies?wh.wrap():wh,Ht),qe._fireMoveEvents(_e)},function(){return qe._afterEase(_e)},J),this},q.prototype.isEasing=function(){return!!this._easeFrameId},q.prototype.stop=function(){return this._stop()},q.prototype._stop=function(J,_e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var qe=this._onEaseEnd;delete this._onEaseEnd,qe.call(this,_e)}if(!J){var lt=this.handlers;lt&<.stop(!1)}return this},q.prototype._ease=function(J,_e,qe){qe.animate===!1||qe.duration===0?(J(1),_e()):(this._easeStart=e.browser.now(),this._easeOptions=qe,this._onEaseFrame=J,this._onEaseEnd=_e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},q.prototype._renderFrameCallback=function(){var J=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(J)),J<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},q.prototype._normalizeBearing=function(J,_e){J=e.wrap(J,-180,180);var qe=Math.abs(J-_e);return Math.abs(J-360-_e)180?-360:qe<-180?360:0}},q})(e.Evented),ea=function(q){q===void 0&&(q={}),this.options=q,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ea.prototype.getDefaultPosition=function(){return"bottom-right"},ea.prototype.onAdd=function(q){var he=this.options&&this.options.compact;return this._map=q,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"),he&&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),he===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ea.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},ea.prototype._setElementTitle=function(q,he){var J=this._map._getUIString("AttributionControl."+he);q.title=J,q.setAttribute("aria-label",J)},ea.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"))},ea.prototype._updateEditLink=function(){var q=this._editLink;q||(q=this._editLink=this._container.querySelector(".mapbox-improve-map"));var he=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(q){var J=he.reduce(function(_e,qe,lt){return qe.value&&(_e+=qe.key+"="+qe.value+(lt=0)return!1;return!0});var vt=q.join(" | ");vt!==this._attribHTML&&(this._attribHTML=vt,q.length?(this._innerContainer.innerHTML=vt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ea.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ma=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ma.prototype.onAdd=function(q){this._map=q,this._container=r.create("div","mapboxgl-ctrl");var he=r.create("a","mapboxgl-ctrl-logo");return he.target="_blank",he.rel="noopener nofollow",he.href="https://www.mapbox.com/",he.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),he.setAttribute("rel","noopener nofollow"),this._container.appendChild(he),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ma.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ma.prototype.getDefaultPosition=function(){return"bottom-left"},ma.prototype._updateLogo=function(q){(!q||q.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},ma.prototype._logoRequired=function(){if(this._map.style){var q=this._map.style.sourceCaches;for(var he in q){var J=q[he].getSource();if(J.mapbox_logo)return!0}return!1}},ma.prototype._updateCompact=function(){var q=this._container.children;if(q.length){var he=q[0];this._map.getCanvasContainer().offsetWidth<250?he.classList.add("mapboxgl-compact"):he.classList.remove("mapboxgl-compact")}};var na=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};na.prototype.add=function(q){var he=++this._id,J=this._queue;return J.push({callback:q,id:he,cancelled:!1}),he},na.prototype.remove=function(q){for(var he=this._currentlyRunning,J=he?this._queue.concat(he):this._queue,_e=0,qe=J;_eJ.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(J.minPitch!=null&&J.maxPitch!=null&&J.minPitch>J.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(J.minPitch!=null&&J.minPitchWa)throw new Error("maxPitch must be less than or equal to "+Wa);var qe=new Cs(J.minZoom,J.maxZoom,J.minPitch,J.maxPitch,J.renderWorldCopies);if(be.call(this,qe,J),this._interactive=J.interactive,this._maxTileCacheSize=J.maxTileCacheSize,this._failIfMajorPerformanceCaveat=J.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=J.preserveDrawingBuffer,this._antialias=J.antialias,this._trackResize=J.trackResize,this._bearingSnap=J.bearingSnap,this._refreshExpiredTiles=J.refreshExpiredTiles,this._fadeDuration=J.fadeDuration,this._crossSourceCollisions=J.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=J.collectResourceTiming,this._renderTaskQueue=new na,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ui,J.locale),this._clickTolerance=J.clickTolerance,this._requestManager=new e.RequestManager(J.transformRequest,J.accessToken),typeof J.container=="string"){if(this._container=e.window.document.getElementById(J.container),!this._container)throw new Error("Container '"+J.container+"' not found.")}else if(J.container instanceof Li)this._container=J.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(J.maxBounds&&this.setMaxBounds(J.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 _e._update(!1)}),this.on("moveend",function(){return _e._update(!1)}),this.on("zoom",function(){return _e._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 tn(this,J);var lt=typeof J.hash=="string"&&J.hash||void 0;this._hash=J.hash&&new ac(lt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:J.center,zoom:J.zoom,bearing:J.bearing,pitch:J.pitch}),J.bounds&&(this.resize(),this.fitBounds(J.bounds,e.extend({},J.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=J.localIdeographFontFamily,J.style&&this.setStyle(J.style,{localIdeographFontFamily:J.localIdeographFontFamily}),J.attributionControl&&this.addControl(new ea({customAttribution:J.customAttribution})),this.addControl(new ma,J.logoPosition),this.on("style.load",function(){_e.transform.unmodified&&_e.jumpTo(_e.style.stylesheet)}),this.on("data",function(vt){_e._update(vt.dataType==="style"),_e.fire(new e.Event(vt.dataType+"data",vt))}),this.on("dataloading",function(vt){_e.fire(new e.Event(vt.dataType+"dataloading",vt))})}be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q;var he={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return q.prototype._getMapId=function(){return this._mapId},q.prototype.addControl=function(_e,qe){if(qe===void 0&&(_e.getDefaultPosition?qe=_e.getDefaultPosition():qe="top-right"),!_e||!_e.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 lt=_e.onAdd(this);this._controls.push(_e);var vt=this._controlPositions[qe];return qe.indexOf("bottom")!==-1?vt.insertBefore(lt,vt.firstChild):vt.appendChild(lt),this},q.prototype.removeControl=function(_e){if(!_e||!_e.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 qe=this._controls.indexOf(_e);return qe>-1&&this._controls.splice(qe,1),_e.onRemove(this),this},q.prototype.hasControl=function(_e){return this._controls.indexOf(_e)>-1},q.prototype.resize=function(_e){var qe=this._containerDimensions(),lt=qe[0],vt=qe[1];this._resizeCanvas(lt,vt),this.transform.resize(lt,vt),this.painter.resize(lt,vt);var Ke=!this._moving;return Ke&&(this.stop(),this.fire(new e.Event("movestart",_e)).fire(new e.Event("move",_e))),this.fire(new e.Event("resize",_e)),Ke&&this.fire(new e.Event("moveend",_e)),this},q.prototype.getBounds=function(){return this.transform.getBounds()},q.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},q.prototype.setMaxBounds=function(_e){return this.transform.setMaxBounds(e.LngLatBounds.convert(_e)),this._update()},q.prototype.setMinZoom=function(_e){if(_e=_e??Xn,_e>=Xn&&_e<=this.transform.maxZoom)return this.transform.minZoom=_e,this._update(),this.getZoom()<_e&&this.setZoom(_e),this;throw new Error("minZoom must be between "+Xn+" and the current maxZoom, inclusive")},q.prototype.getMinZoom=function(){return this.transform.minZoom},q.prototype.setMaxZoom=function(_e){if(_e=_e??ai,_e>=this.transform.minZoom)return this.transform.maxZoom=_e,this._update(),this.getZoom()>_e&&this.setZoom(_e),this;throw new Error("maxZoom must be greater than the current minZoom")},q.prototype.getMaxZoom=function(){return this.transform.maxZoom},q.prototype.setMinPitch=function(_e){if(_e=_e??In,_e=In&&_e<=this.transform.maxPitch)return this.transform.minPitch=_e,this._update(),this.getPitch()<_e&&this.setPitch(_e),this;throw new Error("minPitch must be between "+In+" and the current maxPitch, inclusive")},q.prototype.getMinPitch=function(){return this.transform.minPitch},q.prototype.setMaxPitch=function(_e){if(_e=_e??Wa,_e>Wa)throw new Error("maxPitch must be less than or equal to "+Wa);if(_e>=this.transform.minPitch)return this.transform.maxPitch=_e,this._update(),this.getPitch()>_e&&this.setPitch(_e),this;throw new Error("maxPitch must be greater than the current minPitch")},q.prototype.getMaxPitch=function(){return this.transform.maxPitch},q.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},q.prototype.setRenderWorldCopies=function(_e){return this.transform.renderWorldCopies=_e,this._update()},q.prototype.project=function(_e){return this.transform.locationPoint(e.LngLat.convert(_e))},q.prototype.unproject=function(_e){return this.transform.pointLocation(e.Point.convert(_e))},q.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},q.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},q.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},q.prototype._createDelegatedListener=function(_e,qe,lt){var vt=this,Ke;if(_e==="mouseenter"||_e==="mouseover"){var at=!1,bt=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length?at||(at=!0,lt.call(vt,new Jt(_e,vt,Bt.originalEvent,{features:Xt}))):at=!1},Zt=function(){at=!1};return{layer:qe,listener:lt,delegates:{mousemove:bt,mouseout:Zt}}}else if(_e==="mouseleave"||_e==="mouseout"){var Vt=!1,Kt=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length?Vt=!0:Vt&&(Vt=!1,lt.call(vt,new Jt(_e,vt,Bt.originalEvent)))},nr=function(Bt){Vt&&(Vt=!1,lt.call(vt,new Jt(_e,vt,Bt.originalEvent)))};return{layer:qe,listener:lt,delegates:{mousemove:Kt,mouseout:nr}}}else{var er=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length&&(Bt.features=Xt,lt.call(vt,Bt),delete Bt.features)};return{layer:qe,listener:lt,delegates:(Ke={},Ke[_e]=er,Ke)}}},q.prototype.on=function(_e,qe,lt){if(lt===void 0)return be.prototype.on.call(this,_e,qe);var vt=this._createDelegatedListener(_e,qe,lt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_e]=this._delegatedListeners[_e]||[],this._delegatedListeners[_e].push(vt);for(var Ke in vt.delegates)this.on(Ke,vt.delegates[Ke]);return this},q.prototype.once=function(_e,qe,lt){if(lt===void 0)return be.prototype.once.call(this,_e,qe);var vt=this._createDelegatedListener(_e,qe,lt);for(var Ke in vt.delegates)this.once(Ke,vt.delegates[Ke]);return this},q.prototype.off=function(_e,qe,lt){var vt=this;if(lt===void 0)return be.prototype.off.call(this,_e,qe);var Ke=function(at){for(var bt=at[_e],Zt=0;Zt180;){var lt=he.locationPoint(be);if(lt.x>=0&<.y>=0&<.x<=he.width&<.y<=he.height)break;be.lng>he.center.lng?be.lng-=360:be.lng+=360}return be}var qo={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 Qo(be,q,he){var J=be.classList;for(var _e in qo)J.remove("mapboxgl-"+he+"-anchor-"+_e);J.add("mapboxgl-"+he+"-anchor-"+q)}var ul=(function(be){function q(he,J){if(be.call(this),(he instanceof e.window.HTMLElement||J)&&(he=e.extend({element:he},J)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=he&&he.anchor||"center",this._color=he&&he.color||"#3FB1CE",this._scale=he&&he.scale||1,this._draggable=he&&he.draggable||!1,this._clickTolerance=he&&he.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=he&&he.rotation||0,this._rotationAlignment=he&&he.rotationAlignment||"auto",this._pitchAlignment=he&&he.pitchAlignment&&he.pitchAlignment!=="auto"?he.pitchAlignment:this._rotationAlignment,!he||!he.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var _e=r.createNS("http://www.w3.org/2000/svg","svg"),qe=41,lt=27;_e.setAttributeNS(null,"display","block"),_e.setAttributeNS(null,"height",qe+"px"),_e.setAttributeNS(null,"width",lt+"px"),_e.setAttributeNS(null,"viewBox","0 0 "+lt+" "+qe);var vt=r.createNS("http://www.w3.org/2000/svg","g");vt.setAttributeNS(null,"stroke","none"),vt.setAttributeNS(null,"stroke-width","1"),vt.setAttributeNS(null,"fill","none"),vt.setAttributeNS(null,"fill-rule","evenodd");var Ke=r.createNS("http://www.w3.org/2000/svg","g");Ke.setAttributeNS(null,"fill-rule","nonzero");var at=r.createNS("http://www.w3.org/2000/svg","g");at.setAttributeNS(null,"transform","translate(3.0, 29.0)"),at.setAttributeNS(null,"fill","#000000");for(var 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"}],Zt=0,Vt=bt;Zt=_e}this._isDragging&&(this._pos=J.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")))},q.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"},q.prototype._addDragHandler=function(J){this._element.contains(J.originalEvent.target)&&(J.preventDefault(),this._positionDelta=J.point.sub(this._pos).add(this._offset),this._pointerdownPos=J.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))},q.prototype.setDraggable=function(J){return this._draggable=!!J,this._map&&(J?(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},q.prototype.isDraggable=function(){return this._draggable},q.prototype.setRotation=function(J){return this._rotation=J||0,this._update(),this},q.prototype.getRotation=function(){return this._rotation},q.prototype.setRotationAlignment=function(J){return this._rotationAlignment=J||"auto",this._update(),this},q.prototype.getRotationAlignment=function(){return this._rotationAlignment},q.prototype.setPitchAlignment=function(J){return this._pitchAlignment=J&&J!=="auto"?J:this._rotationAlignment,this._update(),this},q.prototype.getPitchAlignment=function(){return this._pitchAlignment},q})(e.Evented),es={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},wu;function Qs(be){wu!==void 0?be(wu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(q){wu=q.state!=="denied",be(wu)}):(wu=!!e.window.navigator.geolocation,be(wu))}var vu=0,Iu=!1,Zu=(function(be){function q(he){be.call(this),this.options=e.extend({},es,he),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.onAdd=function(J){return this._map=J,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Qs(this._setupUI),this._container},q.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,vu=0,Iu=!1},q.prototype._isOutOfMapMaxBounds=function(J){var _e=this._map.getMaxBounds(),qe=J.coords;return _e&&(qe.longitude<_e.getWest()||qe.longitude>_e.getEast()||qe.latitude<_e.getSouth()||qe.latitude>_e.getNorth())},q.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}},q.prototype._onSuccess=function(J){if(this._map){if(this._isOutOfMapMaxBounds(J)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",J)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=J,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(J),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(J),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",J)),this._finish()}},q.prototype._updateCamera=function(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude),qe=J.coords.accuracy,lt=this._map.getBearing(),vt=e.extend({bearing:lt},this.options.fitBoundsOptions);this._map.fitBounds(_e.toBounds(qe),vt,{geolocateSource:!0})},q.prototype._updateMarker=function(J){if(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude);this._accuracyCircleMarker.setLngLat(_e).addTo(this._map),this._userLocationDotMarker.setLngLat(_e).addTo(this._map),this._accuracy=J.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},q.prototype._updateCircleRadius=function(){var J=this._map._container.clientHeight/2,_e=this._map.unproject([0,J]),qe=this._map.unproject([1,J]),lt=_e.distanceTo(qe),vt=Math.ceil(2*this._accuracy/lt);this._circleElement.style.width=vt+"px",this._circleElement.style.height=vt+"px"},q.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},q.prototype._onError=function(J){if(this._map){if(this.options.trackUserLocation)if(J.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 _e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=_e,this._geolocateButton.setAttribute("aria-label",_e),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(J.code===3&&Iu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",J)),this._finish()}},q.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},q.prototype._setupUI=function(J){var _e=this;if(this._container.addEventListener("contextmenu",function(vt){return vt.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",J===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var qe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=qe,this._geolocateButton.setAttribute("aria-label",qe)}else{var lt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=lt,this._geolocateButton.setAttribute("aria-label",lt)}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 ul(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ul({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(vt){var Ke=vt.originalEvent&&vt.originalEvent.type==="resize";!vt.geolocateSource&&_e._watchState==="ACTIVE_LOCK"&&!Ke&&(_e._watchState="BACKGROUND",_e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),_e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),_e.fire(new e.Event("trackuserlocationend")))})},q.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":vu--,Iu=!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"),vu++;var J;vu>1?(J={maximumAge:6e5,timeout:0},Iu=!0):(J=this.options.positionOptions,Iu=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,J)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},q.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)},q})(e.Evented),vf={maxWidth:100,unit:"metric"},$l=function(q){this.options=e.extend({},vf,q),e.bindAll(["_onMove","setUnit"],this)};$l.prototype.getDefaultPosition=function(){return"bottom-left"},$l.prototype._onMove=function(){uu(this._map,this._container,this.options)},$l.prototype.onAdd=function(q){return this._map=q,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",q.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},$l.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},$l.prototype.setUnit=function(q){this.options.unit=q,uu(this._map,this._container,this.options)};function uu(be,q,he){var J=he&&he.maxWidth||100,_e=be._container.clientHeight/2,qe=be.unproject([0,_e]),lt=be.unproject([J,_e]),vt=qe.distanceTo(lt);if(he&&he.unit==="imperial"){var Ke=3.2808*vt;if(Ke>5280){var at=Ke/5280;uo(q,J,at,be._getUIString("ScaleControl.Miles"))}else uo(q,J,Ke,be._getUIString("ScaleControl.Feet"))}else if(he&&he.unit==="nautical"){var bt=vt/1852;uo(q,J,bt,be._getUIString("ScaleControl.NauticalMiles"))}else vt>=1e3?uo(q,J,vt/1e3,be._getUIString("ScaleControl.Kilometers")):uo(q,J,vt,be._getUIString("ScaleControl.Meters"))}function uo(be,q,he,J){var _e=Us(he),qe=_e/he;be.style.width=q*qe+"px",be.innerHTML=_e+" "+J}function Wu(be){var q=Math.pow(10,Math.ceil(-Math.log(be)/Math.LN10));return Math.round(be*q)/q}function Us(be){var q=Math.pow(10,(""+Math.floor(be)).length-1),he=be/q;return he=he>=10?10:he>=5?5:he>=3?3:he>=2?2:he>=1?1:Wu(he),q*he}var zl=function(q){this._fullscreen=!1,q&&q.container&&(q.container instanceof e.window.HTMLElement?this._container=q.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")};zl.prototype.onAdd=function(q){return this._map=q,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},zl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},zl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},zl.prototype._setupUI=function(){var q=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",q).setAttribute("aria-hidden",!0),q.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},zl.prototype._updateTitle=function(){var q=this._getTitle();this._fullscreenButton.setAttribute("aria-label",q),this._fullscreenButton.title=q},zl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},zl.prototype._isFullscreen=function(){return this._fullscreen},zl.prototype._changeIcon=function(){var q=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;q===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},zl.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 sc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},lc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Ao=(function(be){function q(he){be.call(this),this.options=e.extend(Object.create(sc),he),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.addTo=function(J){return this._map&&this.remove(),this._map=J,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},q.prototype.isOpen=function(){return!!this._map},q.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},q.prototype.getLngLat=function(){return this._lngLat},q.prototype.setLngLat=function(J){return this._lngLat=e.LngLat.convert(J),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},q.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},q.prototype.getElement=function(){return this._container},q.prototype.setText=function(J){return this.setDOMContent(e.window.document.createTextNode(J))},q.prototype.setHTML=function(J){var _e=e.window.document.createDocumentFragment(),qe=e.window.document.createElement("body"),lt;for(qe.innerHTML=J;lt=qe.firstChild,!!lt;)_e.appendChild(lt);return this.setDOMContent(_e)},q.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},q.prototype.setMaxWidth=function(J){return this.options.maxWidth=J,this._update(),this},q.prototype.setDOMContent=function(J){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(J),this._createCloseButton(),this._update(),this._focusFirstElement(),this},q.prototype.addClassName=function(J){this._container&&this._container.classList.add(J)},q.prototype.removeClassName=function(J){this._container&&this._container.classList.remove(J)},q.prototype.setOffset=function(J){return this.options.offset=J,this._update(),this},q.prototype.toggleClassName=function(J){if(this._container)return this._container.classList.toggle(J)},q.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))},q.prototype._onMouseUp=function(J){this._update(J.point)},q.prototype._onMouseMove=function(J){this._update(J.point)},q.prototype._onDrag=function(J){this._update(J.point)},q.prototype._update=function(J){var _e=this,qe=this._lngLat||this._trackPointer;if(!(!this._map||!qe||!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(Kt){return _e._container.classList.add(Kt)}),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=xo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!J))){var lt=this._pos=this._trackPointer&&J?J:this._map.project(this._lngLat),vt=this.options.anchor,Ke=vs(this.options.offset);if(!vt){var at=this._container.offsetWidth,bt=this._container.offsetHeight,Zt;lt.y+Ke.bottom.ythis._map.transform.height-bt?Zt=["bottom"]:Zt=[],lt.xthis._map.transform.width-at/2&&Zt.push("right"),Zt.length===0?vt="bottom":vt=Zt.join("-")}var Vt=lt.add(Ke[vt]).round();r.setTransform(this._container,qo[vt]+" translate("+Vt.x+"px,"+Vt.y+"px)"),Qo(this._container,vt,"popup")}},q.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var J=this._container.querySelector(lc);J&&J.focus()}},q.prototype._onClose=function(){this.remove()},q})(e.Evented);function vs(be){if(be)if(typeof be=="number"){var q=Math.round(Math.sqrt(.5*Math.pow(be,2)));return{center:new e.Point(0,0),top:new e.Point(0,be),"top-left":new e.Point(q,q),"top-right":new e.Point(-q,q),bottom:new e.Point(0,-be),"bottom-left":new e.Point(q,-q),"bottom-right":new e.Point(-q,-q),left:new e.Point(be,0),right:new e.Point(-be,0)}}else if(be instanceof e.Point||Array.isArray(be)){var he=e.Point.convert(be);return{center:he,top:he,"top-left":he,"top-right":he,bottom:he,"bottom-left":he,"bottom-right":he,left:he,right:he}}else return{center:e.Point.convert(be.center||[0,0]),top:e.Point.convert(be.top||[0,0]),"top-left":e.Point.convert(be["top-left"]||[0,0]),"top-right":e.Point.convert(be["top-right"]||[0,0]),bottom:e.Point.convert(be.bottom||[0,0]),"bottom-left":e.Point.convert(be["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(be["bottom-right"]||[0,0]),left:e.Point.convert(be.left||[0,0]),right:e.Point.convert(be.right||[0,0])};else return vs(new e.Point(0,0))}var ys={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Ii,NavigationControl:Ui,GeolocateControl:Zu,AttributionControl:ea,ScaleControl:$l,FullscreenControl:zl,Popup:Ao,Marker:ul,Style:Vu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Ti,clearPrewarmedResources:Dt,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(be){e.config.ACCESS_TOKEN=be},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(be){e.config.API_URL=be},get workerCount(){return ga.workerCount},set workerCount(be){ga.workerCount=be},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(be){e.config.MAX_PARALLEL_IMAGE_REQUESTS=be},clearStorage:function(q){e.clearTileCache(q)},workerUrl:""};return ys}),S})}}),ID=Ge({"src/plots/mapbox/layers.js"($,G){var h=gn(),b=Ju().sanitizeHTML,S=VC(),E=Xy();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.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(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),DD=Ge({"src/plots/mapbox/mapbox.js"($,G){var h=HC(),b=gn(),S=D_(),E=Lo(),e=ws(),t=rd(),r=jf(),o=zp(),n=o.drawMode,i=o.selectMode,a=Yf().prepSelect,s=Yf().clearOutline,f=Yf().clearSelectionsCache,c=Yf().selectOnClick,p=Xy(),d=ID();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),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(_,w,m){var u=this,v=w[u.id];u.map&&v.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var y;u.map?y=new Promise(function(I,L){u.updateMap(_,w,I,L)}):y=new Promise(function(I,L){u.createMap(_,w,I,L)}),m.push(y)},l.createMap=function(_,w,m,u){var v=this,y=w[v.id],I=v.styleObj=x(y.style,w);v.accessToken=y.accesstoken;var L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=v.map=new h.Map({container:v.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!v.isStatic,preserveDrawingBuffer:v.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",v.rejectOnError(u),v.isStatic||v.initFx(_,w);var N=[];N.push(new Promise(function(B){F.once("load",B)})),N=N.concat(S.fetchTraceGeoData(_)),Promise.all(N).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var v=this,y=v.map,I=w[this.id];v.rejectOnError(u);var L=[],z=x(I.style,w);JSON.stringify(v.styleObj)!==JSON.stringify(z)&&(v.styleObj=z,y.setStyle(z.style),v.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,v,y,I=this.belowLookup={},L=!1;for(v=0;v<_.length;v++){var z=_[v][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(v=0;v1)for(v=0;v-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function v(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[v([F.xmin,F.ymin]),v([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(v)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,v;if(m.length!==u.length){for(v=0;vN/2){var B=I.split("|").join("
");z.text(B).attr("data-unformatted",B).call(o.convertToTspans,d),F=r.bBox(z.node())}z.attr("transform",b(-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 R=1;F.width+6>N&&(R=N/(F.width+6));var U=[g.l+g.w*M.x[1],g.t+g.h*(1-M.y[0])];L.attr("transform",b(U[0],U[1])+S(R))}};function c(d,T){var l=d._fullLayout,g=d._context;if(g.mapboxAccessToken==="")return"";for(var x=[],A=[],M=!1,_=!1,w=0;w1&&h.warn(a.multipleTokensErrorMsg),x[0]):(A.length&&h.log(["Listed mapbox access token(s)",A.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function p(d){return typeof d=="string"&&(a.styleValuesMapbox.indexOf(d)!==-1||d.indexOf("mapbox://")===0||d.indexOf("stamen")===0)}$.updateFx=function(d){for(var T=d._fullLayout,l=T._subplots[i],g=0;g=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),UD=Ge({"src/traces/choroplethmapbox/index.js"($,G){G.exports={attributes:GC(),supplyDefaults:BD(),colorbar:bm(),calc:vE(),plot:ND(),hoverPoints:pE(),eventData:mE(),selectPoints:gE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+d[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),v=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),XD=Ge({"src/traces/densitymapbox/hover.js"($,G){var h=ws(),b=LE().hoverPoints,S=LE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),YD=Ge({"src/traces/densitymapbox/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),ZD=Ge({"src/traces/densitymapbox/index.js"($,G){G.exports={attributes:YC(),supplyDefaults:qD(),colorbar:bm(),formatLabels:qC(),calc:VD(),plot:GD(),hoverPoints:XD(),eventData:YD(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),$D=Ge({"src/plots/map/styles/arcgis-sat.js"($,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),B_=Ge({"src/plots/map/constants.js"($,G){var h=Lp(),b=KD(),S=$D(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",a={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:S,"satellite-streets":b,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":i},s=h(a);G.exports={styleValueDflt:"basic",stylesMap:a,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."}}}),rS=Ge({"src/plots/map/layout_attributes.js"($,G){var h=gn(),b=_o().defaultLine,S=Ac().attributes,E=Hs(),e=Uc().textposition,t=Nc().overrideAll,r=pu().templatedArray,o=B_(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("map",".layers",!0)],domain:S({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},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:b}},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:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),RE=Ge({"src/traces/scattermap/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Al(),E=nd(),e=Xb(),t=Uc(),r=rS(),o=ru(),n=Pu(),i=Qi().extendFlat,a=Nc().overrideAll,s=rS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.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:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({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},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),ZC=Ge({"src/traces/scattermap/constants.js"($,G){var h=["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"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),JD=Ge({"src/traces/scattermap/defaults.js"($,G){var h=gn(),b=iu(),S=Hv(),E=Bp(),e=ep(),t=Iv(),r=RE(),o=ZC().isSupportedFont;G.exports=function(a,s,f,c){function p(v,y){return h.coerce(a,s,r,v,y)}function d(v,y){return h.coerce2(a,s,r,v,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),x=d("cluster.step"),A=d("cluster.color",s.marker&&s.marker.color||f),M=d("cluster.size"),_=d("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),WC=Ge({"src/traces/scattermap/format_labels.js"($,G){var h=ws();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),KC=Ge({"src/plots/map/convert_text_opts.js"($,G){var h=gn();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),QD=Ge({"src/traces/scattermap/convert.js"($,G){var h=Pi(),b=gn(),S=zi().BADNUM,E=I_(),e=Tc(),t=Ss(),r=Rp(),o=iu(),n=ZC().isSupportedFont,i=KC(),a=Vv().appendArrayPointValue,s=Ju().NEWLINES,f=Ju().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,v=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((v||y)&&(re=E.calcTraceToLineCoords(w)),v&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=d(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),v=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;v&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):v.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):v.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",v[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),ez=Ge({"src/traces/scattermap/plot.js"($,G){var h=gn(),b=QD(),S=B_().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=v[y];a.removeLayer(d.layerIds[I])}u||a.removeSource(d.sourceIds.circle)}function g(u){for(var v=E.nonCluster,y=0;y=0;y--){var I=v[y];a.removeLayer(d.layerIds[I]),u||a.removeSource(d.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,v=0;v=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],d,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),d=0;d=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=d.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,v=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(v),I=p.c2p(v),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:d};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,d=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&d?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):d&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),tz=Ge({"src/traces/scattermap/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),rz=Ge({"src/traces/scattermap/select.js"($,G){var h=gn(),b=iu(),S=zi().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s1)return 1;for(var Q=Y,me=0;me<8;me++){var Pe=this.sampleCurveX(Q)-Y;if(Math.abs(Pe)Pe?We=Q:pt=Q,Q=.5*(pt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var f=r(a);let c,p;function d(){return c==null&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),c}function T(){if(p==null&&(p=!1,d())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let me=0;me<25;me++){const Pe=4*me;D.fillStyle=`rgb(${Pe},${Pe+1},${Pe+2})`,D.fillRect(me%5,Math.floor(me/5),1,1)}const Q=D.getImageData(0,0,5,5).data;for(let me=0;me<100;me++)if(me%4!=3&&Q[me]!==me){p=!0;break}}}return p||!1}function l(Y,D,Q,me){const Pe=new f(Y,D,Q,me);return Ve=>Pe.solve(Ve)}const g=l(.25,.1,.25,1);function x(Y,D,Q){return Math.min(Q,Math.max(D,Y))}function A(Y,D,Q){const me=Q-D,Pe=((Y-D)%me+me)%me+D;return Pe===D?Q:Pe}function M(Y,...D){for(const Q of D)for(const me in Q)Y[me]=Q[me];return Y}let _=1;function w(Y,D,Q){const me={};for(const Pe in Y)me[Pe]=D.call(this,Y[Pe],Pe,Y);return me}function m(Y,D,Q){const me={};for(const Pe in Y)D.call(this,Y[Pe],Pe,Y)&&(me[Pe]=Y[Pe]);return me}function u(Y){return Array.isArray(Y)?Y.map(u):typeof Y=="object"&&Y?w(Y,u):Y}const v={};function y(Y){v[Y]||(typeof console<"u"&&console.warn(Y),v[Y]=!0)}function I(Y,D,Q){return(Q.y-Y.y)*(D.x-Y.x)>(D.y-Y.y)*(Q.x-Y.x)}function L(Y){return typeof WorkerGlobalScope<"u"&&Y!==void 0&&Y instanceof WorkerGlobalScope}let z=null;function F(Y){return typeof ImageBitmap<"u"&&Y instanceof ImageBitmap}const N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function B(Y,D,Q,me,Pe){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Ve=new VideoFrame(Y,{timestamp:0});try{const We=Ve?.format;if(!We||!We.startsWith("BGR")&&!We.startsWith("RGB"))throw new Error(`Unrecognized format ${We}`);const pt=We.startsWith("BGR"),Rt=new Uint8ClampedArray(me*Pe*4);if(yield Ve.copyTo(Rt,(function(Yt,dr,xr,qr,$r){const hn=4*Math.max(-dr,0),An=(Math.max(0,xr)-xr)*qr*4+hn,Bn=4*qr,va=Math.max(0,dr),ii=Math.max(0,xr);return{rect:{x:va,y:ii,width:Math.min(Yt.width,dr+qr)-va,height:Math.min(Yt.height,xr+$r)-ii},layout:[{offset:An,stride:Bn}]}})(Y,D,Q,me,Pe)),pt)for(let Yt=0;YtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ee=function(Y,D){if(/:\/\//.test(Y.url)&&!/^https?:|^file:/.test(Y.url)){const me=fe(Y.url);if(me)return me(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,targetMapId:le},D)}if(!(/^file:/.test(Q=Y.url)||/^file:/.test(V())&&!/^\w+:/.test(Q))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(me,Pe){return t(this,void 0,void 0,function*(){const Ve=new Request(me.url,{method:me.method||"GET",body:me.body,credentials:me.credentials,headers:me.headers,cache:me.cache,referrer:V(),signal:Pe.signal});me.type!=="json"||Ve.headers.has("Accept")||Ve.headers.set("Accept","application/json");const We=yield fetch(Ve);if(!We.ok){const Yt=yield We.blob();throw new ce(We.status,We.statusText,me.url,Yt)}let pt;pt=me.type==="arrayBuffer"||me.type==="image"?We.arrayBuffer():me.type==="json"?We.json():We.text();const Rt=yield pt;if(Pe.signal.aborted)throw Z();return{data:Rt,cacheControl:We.headers.get("Cache-Control"),expires:We.headers.get("Expires")}})})(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,mustQueue:!0,targetMapId:le},D)}var Q;return(function(me,Pe){return new Promise((Ve,We)=>{var pt;const Rt=new XMLHttpRequest;Rt.open(me.method||"GET",me.url,!0),me.type!=="arrayBuffer"&&me.type!=="image"||(Rt.responseType="arraybuffer");for(const Yt in me.headers)Rt.setRequestHeader(Yt,me.headers[Yt]);me.type==="json"&&(Rt.responseType="text",!((pt=me.headers)===null||pt===void 0)&&pt.Accept||Rt.setRequestHeader("Accept","application/json")),Rt.withCredentials=me.credentials==="include",Rt.onerror=()=>{We(new Error(Rt.statusText))},Rt.onload=()=>{if(!Pe.signal.aborted)if((Rt.status>=200&&Rt.status<300||Rt.status===0)&&Rt.response!==null){let Yt=Rt.response;if(me.type==="json")try{Yt=JSON.parse(Rt.response)}catch(dr){return void We(dr)}Ve({data:Yt,cacheControl:Rt.getResponseHeader("Cache-Control"),expires:Rt.getResponseHeader("Expires")})}else{const Yt=new Blob([Rt.response],{type:Rt.getResponseHeader("Content-Type")});We(new ce(Rt.status,Rt.statusText,me.url,Yt))}},Pe.signal.addEventListener("abort",()=>{Rt.abort(),We(Z())}),Rt.send(me.body)})})(Y,D)};function ne(Y){if(!Y||Y.indexOf("://")<=0||Y.indexOf("data:image/")===0||Y.indexOf("blob:")===0)return!0;const D=new URL(Y),Q=window.location;return D.protocol===Q.protocol&&D.host===Q.host}function K(Y,D,Q){Q[Y]&&Q[Y].indexOf(D)!==-1||(Q[Y]=Q[Y]||[],Q[Y].push(D))}function ue(Y,D,Q){if(Q&&Q[Y]){const me=Q[Y].indexOf(D);me!==-1&&Q[Y].splice(me,1)}}class te{constructor(D,Q={}){M(this,Q),this.type=D}}class H extends te{constructor(D,Q={}){super("error",M({error:D},Q))}}class ae{on(D,Q){return this._listeners=this._listeners||{},K(D,Q,this._listeners),this}off(D,Q){return ue(D,Q,this._listeners),ue(D,Q,this._oneTimeListeners),this}once(D,Q){return Q?(this._oneTimeListeners=this._oneTimeListeners||{},K(D,Q,this._oneTimeListeners),this):new Promise(me=>this.once(D,me))}fire(D,Q){typeof D=="string"&&(D=new te(D,Q||{}));const me=D.type;if(this.listens(me)){D.target=this;const Pe=this._listeners&&this._listeners[me]?this._listeners[me].slice():[];for(const pt of Pe)pt.call(this,D);const Ve=this._oneTimeListeners&&this._oneTimeListeners[me]?this._oneTimeListeners[me].slice():[];for(const pt of Ve)ue(me,pt,this._oneTimeListeners),pt.call(this,D);const We=this._eventedParent;We&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),We.fire(D))}else D instanceof H&&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,Q){return this._eventedParent=D,this._eventedParentData=Q,this}}var ie={$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"}}};const ve=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ae(Y,D){const Q={};for(const me in Y)me!=="ref"&&(Q[me]=Y[me]);return ve.forEach(me=>{me in D&&(Q[me]=D[me])}),Q}function Ce(Y,D){if(Array.isArray(Y)){if(!Array.isArray(D)||Y.length!==D.length)return!1;for(let Q=0;Q`:Y.itemType.kind==="value"?"array":`array<${D}>`}return Y.kind}const Ee=[ct,rt,Ft,Nt,$t,Zr,rr,je(Mr),Ar,Br,Mt];function xe(Y,D){if(D.kind==="error")return null;if(Y.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!xe(Y.itemType,D.itemType))&&(typeof Y.N!="number"||Y.N===D.N))return null}else{if(Y.kind===D.kind)return null;if(Y.kind==="value"){for(const Q of Ee)if(!xe(Q,D))return null}}return`Expected ${$e(Y)} but found ${$e(D)} instead.`}function ye(Y,D){return D.some(Q=>Q.kind===Y.kind)}function Me(Y,D){return D.some(Q=>Q==="null"?Y===null:Q==="array"?Array.isArray(Y):Q==="object"?Y&&!Array.isArray(Y)&&typeof Y=="object":Q===typeof Y)}function Xe(Y,D){return Y.kind==="array"&&D.kind==="array"?Y.itemType.kind===D.itemType.kind&&typeof Y.N=="number":Y.kind===D.kind}const Je=.96422,Lt=.82521,Ct=4/29,Ot=6/29,Wt=3*Ot*Ot,_r=Ot*Ot*Ot,pr=Math.PI/180,hr=180/Math.PI;function Fr(Y){return(Y%=360)<0&&(Y+=360),Y}function En([Y,D,Q,me]){let Pe,Ve;const We=qn((.2225045*(Y=Zn(Y))+.7168786*(D=Zn(D))+.0606169*(Q=Zn(Q)))/1);Y===D&&D===Q?Pe=Ve=We:(Pe=qn((.4360747*Y+.3850649*D+.1430804*Q)/Je),Ve=qn((.0139322*Y+.0971045*D+.7141733*Q)/Lt));const pt=116*We-16;return[pt<0?0:pt,500*(Pe-We),200*(We-Ve),me]}function Zn(Y){return Y<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function qn(Y){return Y>_r?Math.pow(Y,1/3):Y/Wt+Ct}function ta([Y,D,Q,me]){let Pe=(Y+16)/116,Ve=isNaN(D)?Pe:Pe+D/500,We=isNaN(Q)?Pe:Pe-Q/200;return Pe=1*Nn(Pe),Ve=Je*Nn(Ve),We=Lt*Nn(We),[ra(3.1338561*Ve-1.6168667*Pe-.4906146*We),ra(-.9787684*Ve+1.9161415*Pe+.033454*We),ra(.0719453*Ve-.2289914*Pe+1.4052427*We),me]}function ra(Y){return(Y=Y<=.00304?12.92*Y:1.055*Math.pow(Y,1/2.4)-.055)<0?0:Y>1?1:Y}function Nn(Y){return Y>Ot?Y*Y*Y:Wt*(Y-Ct)}function Ea(Y){return parseInt(Y.padEnd(2,Y),16)/255}function ja(Y,D){return ir(D?Y/100:Y,0,1)}function ir(Y,D,Q){return Math.min(Math.max(D,Y),Q)}function qt(Y){return!Y.some(Number.isNaN)}const ar={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 sr{constructor(D,Q,me,Pe=1,Ve=!0){this.r=D,this.g=Q,this.b=me,this.a=Pe,Ve||(this.r*=Pe,this.g*=Pe,this.b*=Pe,Pe||this.overwriteGetter("rgb",[D,Q,me,Pe]))}static parse(D){if(D instanceof sr)return D;if(typeof D!="string")return;const Q=(function(me){if((me=me.toLowerCase().trim())==="transparent")return[0,0,0,0];const Pe=ar[me];if(Pe){const[We,pt,Rt]=Pe;return[We/255,pt/255,Rt/255,1]}if(me.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(me)){const We=me.length<6?1:2;let pt=1;return[Ea(me.slice(pt,pt+=We)),Ea(me.slice(pt,pt+=We)),Ea(me.slice(pt,pt+=We)),Ea(me.slice(pt,pt+We)||"ff")]}if(me.startsWith("rgb")){const We=me.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(We){const[pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va,ii]=We,Fa=[dr||" ",$r||" ",Bn].join("");if(Fa===" "||Fa===" /"||Fa===",,"||Fa===",,,"){const Qa=[Yt,qr,An].join(""),Di=Qa==="%%%"?100:Qa===""?255:0;if(Di){const lo=[ir(+Rt/Di,0,1),ir(+xr/Di,0,1),ir(+hn/Di,0,1),va?ja(+va,ii):1];if(qt(lo))return lo}}return}}const Ve=me.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[We,pt,Rt,Yt,dr,xr,qr,$r,hn]=Ve,An=[Rt||" ",dr||" ",qr].join("");if(An===" "||An===" /"||An===",,"||An===",,,"){const Bn=[+pt,ir(+Yt,0,100),ir(+xr,0,100),$r?ja(+$r,hn):1];if(qt(Bn))return(function([va,ii,Fa,Qa]){function Di(lo){const Ko=(lo+va/30)%12,fl=ii*Math.min(Fa,1-Fa);return Fa-fl*Math.max(-1,Math.min(Ko-3,9-Ko,1))}return va=Fr(va),ii/=100,Fa/=100,[Di(0),Di(8),Di(4),Qa]})(Bn)}}})(D);return Q?new sr(...Q,!1):void 0}get rgb(){const{r:D,g:Q,b:me,a:Pe}=this,Ve=Pe||1/0;return this.overwriteGetter("rgb",[D/Ve,Q/Ve,me/Ve,Pe])}get hcl(){return this.overwriteGetter("hcl",(function(D){const[Q,me,Pe,Ve]=En(D),We=Math.sqrt(me*me+Pe*Pe);return[Math.round(1e4*We)?Fr(Math.atan2(Pe,me)*hr):NaN,We,Q,Ve]})(this.rgb))}get lab(){return this.overwriteGetter("lab",En(this.rgb))}overwriteGetter(D,Q){return Object.defineProperty(this,D,{value:Q}),Q}toString(){const[D,Q,me,Pe]=this.rgb;return`rgba(${[D,Q,me].map(Ve=>Math.round(255*Ve)).join(",")},${Pe})`}}sr.black=new sr(0,0,0,1),sr.white=new sr(1,1,1,1),sr.transparent=new sr(0,0,0,0),sr.red=new sr(1,0,0,1);class Vr{constructor(D,Q,me){this.sensitivity=D?Q?"variant":"case":Q?"accent":"base",this.locale=me,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,Q){return this.collator.compare(D,Q)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class on{constructor(D,Q,me,Pe,Ve){this.text=D,this.image=Q,this.scale=me,this.fontStack=Pe,this.textColor=Ve}}class pn{constructor(D){this.sections=D}static fromString(D){return new pn([new on(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 pn?D:pn.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class wn{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof wn)return D;if(typeof D=="number")return new wn([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const Q of D)if(typeof Q!="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 wn(D)}}toString(){return JSON.stringify(this.values)}}const Kn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class da{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof da)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let Q=0;Q=0&&Y<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof Q=="number"&&Q>=0&&Q<=255?me===void 0||typeof me=="number"&&me>=0&&me<=1?null:`Invalid rgba value [${[Y,D,Q,me].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof me=="number"?[Y,D,Q,me]:[Y,D,Q]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ka(Y){if(Y===null||typeof Y=="string"||typeof Y=="boolean"||typeof Y=="number"||Y instanceof sr||Y instanceof Vr||Y instanceof pn||Y instanceof wn||Y instanceof da||Y instanceof fa)return!0;if(Array.isArray(Y)){for(const D of Y)if(!ka(D))return!1;return!0}if(typeof Y=="object"){for(const D in Y)if(!ka(Y[D]))return!1;return!0}return!1}function Vn(Y){if(Y===null)return ct;if(typeof Y=="string")return Ft;if(typeof Y=="boolean")return Nt;if(typeof Y=="number")return rt;if(Y instanceof sr)return $t;if(Y instanceof Vr)return Sr;if(Y instanceof pn)return Zr;if(Y instanceof wn)return Ar;if(Y instanceof da)return Mt;if(Y instanceof fa)return Br;if(Array.isArray(Y)){const D=Y.length;let Q;for(const me of Y){const Pe=Vn(me);if(Q){if(Q===Pe)continue;Q=Mr;break}Q=Pe}return je(Q||Mr,D)}return rr}function hi(Y){const D=typeof Y;return Y===null?"":D==="string"||D==="number"||D==="boolean"?String(Y):Y instanceof sr||Y instanceof pn||Y instanceof wn||Y instanceof da||Y instanceof fa?Y.toString():JSON.stringify(Y)}class Ti{constructor(D,Q){this.type=D,this.value=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!ka(D[1]))return Q.error("invalid value");const me=D[1];let Pe=Vn(me);const Ve=Q.expectedType;return Pe.kind!=="array"||Pe.N!==0||!Ve||Ve.kind!=="array"||typeof Ve.N=="number"&&Ve.N!==0||(Pe=Ve),new Ti(Pe,me)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Dt{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const yt={string:Ft,number:rt,boolean:Nt,object:rr};class Er{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");let me,Pe=1;const Ve=D[0];if(Ve==="array"){let pt,Rt;if(D.length>2){const Yt=D[1];if(typeof Yt!="string"||!(Yt in yt)||Yt==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);pt=yt[Yt],Pe++}else pt=Mr;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return Q.error('The length argument to "array" must be a positive integer literal',2);Rt=D[2],Pe++}me=je(pt,Rt)}else{if(!yt[Ve])throw new Error(`Types doesn't contain name = ${Ve}`);me=yt[Ve]}const We=[];for(;PeD.outputDefined())}}const Nr={"to-boolean":Nt,"to-color":$t,"to-number":rt,"to-string":Ft};class jr{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[0];if(!Nr[me])throw new Error(`Can't parse ${me} as it is not part of the known types`);if((me==="to-boolean"||me==="to-string")&&D.length!==2)return Q.error("Expected one argument.");const Pe=Nr[me],Ve=[];for(let We=1;We4?`Invalid rbga value ${JSON.stringify(Q)}: expected an array containing either three or four numeric values.`:ga(Q[0],Q[1],Q[2],Q[3]),!me))return new sr(Q[0]/255,Q[1]/255,Q[2]/255,Q[3])}throw new Dt(me||`Could not parse color from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"padding":{let Q;for(const me of this.args){Q=me.evaluate(D);const Pe=wn.parse(Q);if(Pe)return Pe}throw new Dt(`Could not parse padding from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"variableAnchorOffsetCollection":{let Q;for(const me of this.args){Q=me.evaluate(D);const Pe=da.parse(Q);if(Pe)return Pe}throw new Dt(`Could not parse variableAnchorOffsetCollection from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"number":{let Q=null;for(const me of this.args){if(Q=me.evaluate(D),Q===null)return 0;const Pe=Number(Q);if(!isNaN(Pe))return Pe}throw new Dt(`Could not convert ${JSON.stringify(Q)} to number.`)}case"formatted":return pn.fromString(hi(this.args[0].evaluate(D)));case"resolvedImage":return fa.fromString(hi(this.args[0].evaluate(D)));default:return hi(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Ir=["Unknown","Point","LineString","Polygon"];class Ur{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"?Ir[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 Q=this._parseColorCache[D];return Q||(Q=this._parseColorCache[D]=sr.parse(D)),Q}}class sn{constructor(D,Q,me=[],Pe,Ve=new ot,We=[]){this.registry=D,this.path=me,this.key=me.map(pt=>`[${pt}]`).join(""),this.scope=Ve,this.errors=We,this.expectedType=Pe,this._isConstant=Q}parse(D,Q,me,Pe,Ve={}){return Q?this.concat(Q,me,Pe)._parse(D,Ve):this._parse(D,Ve)}_parse(D,Q){function me(Pe,Ve,We){return We==="assert"?new Er(Ve,[Pe]):We==="coerce"?new jr(Ve,[Pe]):Pe}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", []].');const Pe=D[0];if(typeof Pe!="string")return this.error(`Expression name must be a string, but found ${typeof Pe} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Ve=this.registry[Pe];if(Ve){let We=Ve.parse(D,this);if(!We)return null;if(this.expectedType){const pt=this.expectedType,Rt=We.type;if(pt.kind!=="string"&&pt.kind!=="number"&&pt.kind!=="boolean"&&pt.kind!=="object"&&pt.kind!=="array"||Rt.kind!=="value")if(pt.kind!=="color"&&pt.kind!=="formatted"&&pt.kind!=="resolvedImage"||Rt.kind!=="value"&&Rt.kind!=="string")if(pt.kind!=="padding"||Rt.kind!=="value"&&Rt.kind!=="number"&&Rt.kind!=="array")if(pt.kind!=="variableAnchorOffsetCollection"||Rt.kind!=="value"&&Rt.kind!=="array"){if(this.checkSubtype(pt,Rt))return null}else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"assert")}if(!(We instanceof Ti)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){const pt=new Ur;try{We=new Ti(We.type,We.evaluate(pt))}catch(Rt){return this.error(Rt.message),null}}return We}return this.error(`Unknown expression "${Pe}". 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,Q,me){const Pe=typeof D=="number"?this.path.concat(D):this.path,Ve=me?this.scope.concat(me):this.scope;return new sn(this.registry,this._isConstant,Pe,Q||null,Ve,this.errors)}error(D,...Q){const me=`${this.key}${Q.map(Pe=>`[${Pe}]`).join("")}`;this.errors.push(new Ne(me,D))}checkSubtype(D,Q){const me=xe(D,Q);return me&&this.error(me),me}}class Kr{constructor(D,Q){this.type=Q.type,this.bindings=[].concat(D),this.result=Q}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const Q of this.bindings)D(Q[1]);D(this.result)}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const me=[];for(let Ve=1;Ve=me.length)throw new Dt(`Array index out of bounds: ${Q} > ${me.length-1}.`);if(Q!==Math.floor(Q))throw new Dt(`Array index must be an integer, but found ${Q} instead.`);return me[Q]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class Dr{constructor(D,Q){this.type=Nt,this.needle=D,this.haystack=Q}static parse(D,Q){if(D.length!==3)return Q.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Mr),Pe=Q.parse(D[2],2,Mr);return me&&Pe?ye(me.type,[Nt,Ft,rt,ct,Mr])?new Dr(me,Pe):Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(me.type)} instead`):null}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!me)return!1;if(!Me(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(Vn(Q))} instead.`);if(!Me(me,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${$e(Vn(me))} instead.`);return me.indexOf(Q)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class ln{constructor(D,Q,me){this.type=rt,this.needle=D,this.haystack=Q,this.fromIndex=me}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Mr),Pe=Q.parse(D[2],2,Mr);if(!me||!Pe)return null;if(!ye(me.type,[Nt,Ft,rt,ct,Mr]))return Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,rt);return Ve?new ln(me,Pe,Ve):null}return new ln(me,Pe)}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!Me(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(Vn(Q))} instead.`);let Pe;if(this.fromIndex&&(Pe=this.fromIndex.evaluate(D)),Me(me,["string"])){const Ve=me.indexOf(Q,Pe);return Ve===-1?-1:[...me.slice(0,Ve)].length}if(Me(me,["array"]))return me.indexOf(Q,Pe);throw new Dt(`Expected second argument to be of type array or string, but found ${$e(Vn(me))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class Pn{constructor(D,Q,me,Pe,Ve,We){this.inputType=D,this.type=Q,this.input=me,this.cases=Pe,this.outputs=Ve,this.otherwise=We}static parse(D,Q){if(D.length<5)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return Q.error("Expected an even number of arguments.");let me,Pe;Q.expectedType&&Q.expectedType.kind!=="value"&&(Pe=Q.expectedType);const Ve={},We=[];for(let Yt=2;YtNumber.MAX_SAFE_INTEGER)return qr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof hn=="number"&&Math.floor(hn)!==hn)return qr.error("Numeric branch labels must be integer values.");if(me){if(qr.checkSubtype(me,Vn(hn)))return null}else me=Vn(hn);if(Ve[String(hn)]!==void 0)return qr.error("Branch labels must be unique.");Ve[String(hn)]=We.length}const $r=Q.parse(xr,Yt,Pe);if(!$r)return null;Pe=Pe||$r.type,We.push($r)}const pt=Q.parse(D[1],1,Mr);if(!pt)return null;const Rt=Q.parse(D[D.length-1],D.length-1,Pe);return Rt?pt.type.kind!=="value"&&Q.concat(1).checkSubtype(me,pt.type)?null:new Pn(me,Pe,pt,Ve,We,Rt):null}evaluate(D){const Q=this.input.evaluate(D);return(Vn(Q)===this.inputType&&this.outputs[this.cases[Q]]||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 jn{constructor(D,Q,me){this.type=D,this.branches=Q,this.otherwise=me}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return Q.error("Expected an odd number of arguments.");let me;Q.expectedType&&Q.expectedType.kind!=="value"&&(me=Q.expectedType);const Pe=[];for(let We=1;WeQ.outputDefined())&&this.otherwise.outputDefined()}}class Un{constructor(D,Q,me,Pe){this.type=D,this.input=Q,this.beginIndex=me,this.endIndex=Pe}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Mr),Pe=Q.parse(D[2],2,rt);if(!me||!Pe)return null;if(!ye(me.type,[je(Mr),Ft,Mr]))return Q.error(`Expected first argument to be of type array or string, but found ${$e(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,rt);return Ve?new Un(me.type,me,Pe,Ve):null}return new Un(me.type,me,Pe)}evaluate(D){const Q=this.input.evaluate(D),me=this.beginIndex.evaluate(D);let Pe;if(this.endIndex&&(Pe=this.endIndex.evaluate(D)),Me(Q,["string"]))return[...Q].slice(me,Pe).join("");if(Me(Q,["array"]))return Q.slice(me,Pe);throw new Dt(`Expected first argument to be of type array or string, but found ${$e(Vn(Q))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function un(Y,D){const Q=Y.length-1;let me,Pe,Ve=0,We=Q,pt=0;for(;Ve<=We;)if(pt=Math.floor((Ve+We)/2),me=Y[pt],Pe=Y[pt+1],me<=D){if(pt===Q||DD))throw new Dt("Input is not a number.");We=pt-1}return 0}class Rn{constructor(D,Q,me){this.type=D,this.input=Q,this.labels=[],this.outputs=[];for(const[Pe,Ve]of me)this.labels.push(Pe),this.outputs.push(Ve)}static parse(D,Q){if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");const me=Q.parse(D[1],1,rt);if(!me)return null;const Pe=[];let Ve=null;Q.expectedType&&Q.expectedType.kind!=="value"&&(Ve=Q.expectedType);for(let We=1;We=pt)return Q.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Yt);const xr=Q.parse(Rt,dr,Ve);if(!xr)return null;Ve=Ve||xr.type,Pe.push([pt,xr])}return new Rn(Ve,me,Pe)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Pe=this.input.evaluate(D);if(Pe<=Q[0])return me[0].evaluate(D);const Ve=Q.length;return Pe>=Q[Ve-1]?me[Ve-1].evaluate(D):me[un(Q,Pe)].evaluate(D)}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function di(Y){return Y&&Y.__esModule&&Object.prototype.hasOwnProperty.call(Y,"default")?Y.default:Y}var Ma=Ei;function Ei(Y,D,Q,me){this.cx=3*Y,this.bx=3*(Q-Y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(me-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Y,this.p1y=D,this.p2x=Q,this.p2y=me}Ei.prototype={sampleCurveX:function(Y){return((this.ax*Y+this.bx)*Y+this.cx)*Y},sampleCurveY:function(Y){return((this.ay*Y+this.by)*Y+this.cy)*Y},sampleCurveDerivativeX:function(Y){return(3*this.ax*Y+2*this.bx)*Y+this.cx},solveCurveX:function(Y,D){if(D===void 0&&(D=1e-6),Y<0)return 0;if(Y>1)return 1;for(var Q=Y,me=0;me<8;me++){var Pe=this.sampleCurveX(Q)-Y;if(Math.abs(Pe)Pe?We=Q:pt=Q,Q=.5*(pt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var Hi=di(Ma);function io(Y,D,Q){return Y+Q*(D-Y)}function no(Y,D,Q){return Y.map((me,Pe)=>io(me,D[Pe],Q))}const bo={number:io,color:function(Y,D,Q,me="rgb"){switch(me){case"rgb":{const[Pe,Ve,We,pt]=no(Y.rgb,D.rgb,Q);return new sr(Pe,Ve,We,pt,!1)}case"hcl":{const[Pe,Ve,We,pt]=Y.hcl,[Rt,Yt,dr,xr]=D.hcl;let qr,$r;if(isNaN(Pe)||isNaN(Rt))isNaN(Pe)?isNaN(Rt)?qr=NaN:(qr=Rt,We!==1&&We!==0||($r=Yt)):(qr=Pe,dr!==1&&dr!==0||($r=Ve));else{let ii=Rt-Pe;Rt>Pe&&ii>180?ii-=360:Rt180&&(ii+=360),qr=Pe+Q*ii}const[hn,An,Bn,va]=(function([ii,Fa,Qa,Di]){return ii=isNaN(ii)?0:ii*pr,ta([Qa,Math.cos(ii)*Fa,Math.sin(ii)*Fa,Di])})([qr,$r??io(Ve,Yt,Q),io(We,dr,Q),io(pt,xr,Q)]);return new sr(hn,An,Bn,va,!1)}case"lab":{const[Pe,Ve,We,pt]=ta(no(Y.lab,D.lab,Q));return new sr(Pe,Ve,We,pt,!1)}}},array:no,padding:function(Y,D,Q){return new wn(no(Y.values,D.values,Q))},variableAnchorOffsetCollection:function(Y,D,Q){const me=Y.values,Pe=D.values;if(me.length!==Pe.length)throw new Dt(`Cannot interpolate values of different length. from: ${Y.toString()}, to: ${D.toString()}`);const Ve=[];for(let We=0;Wetypeof dr!="number"||dr<0||dr>1))return Q.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Pe={name:"cubic-bezier",controlPoints:Yt}}}if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");if(Ve=Q.parse(Ve,2,rt),!Ve)return null;const pt=[];let Rt=null;me==="interpolate-hcl"||me==="interpolate-lab"?Rt=$t:Q.expectedType&&Q.expectedType.kind!=="value"&&(Rt=Q.expectedType);for(let Yt=0;Yt=dr)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',qr);const hn=Q.parse(xr,$r,Rt);if(!hn)return null;Rt=Rt||hn.type,pt.push([dr,hn])}return Xe(Rt,rt)||Xe(Rt,$t)||Xe(Rt,Ar)||Xe(Rt,Mt)||Xe(Rt,je(rt))?new li(Rt,me,Pe,Ve,pt):Q.error(`Type ${$e(Rt)} is not interpolatable.`)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Pe=this.input.evaluate(D);if(Pe<=Q[0])return me[0].evaluate(D);const Ve=Q.length;if(Pe>=Q[Ve-1])return me[Ve-1].evaluate(D);const We=un(Q,Pe),pt=li.interpolationFactor(this.interpolation,Pe,Q[We],Q[We+1]),Rt=me[We].evaluate(D),Yt=me[We+1].evaluate(D);switch(this.operator){case"interpolate":return bo[this.type.kind](Rt,Yt,pt);case"interpolate-hcl":return bo.color(Rt,Yt,pt,"hcl");case"interpolate-lab":return bo.color(Rt,Yt,pt,"lab")}}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ts(Y,D,Q,me){const Pe=me-Q,Ve=Y-Q;return Pe===0?0:D===1?Ve/Pe:(Math.pow(D,Ve)-1)/(Math.pow(D,Pe)-1)}class Ho{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expectected at least one argument.");let me=null;const Pe=Q.expectedType;Pe&&Pe.kind!=="value"&&(me=Pe);const Ve=[];for(const pt of D.slice(1)){const Rt=Q.parse(pt,1+Ve.length,me,void 0,{typeAnnotation:"omit"});if(!Rt)return null;me=me||Rt.type,Ve.push(Rt)}if(!me)throw new Error("No output type");const We=Pe&&Ve.some(pt=>xe(Pe,pt.type));return new Ho(We?Mr:me,Ve)}evaluate(D){let Q,me=null,Pe=0;for(const Ve of this.args)if(Pe++,me=Ve.evaluate(D),me&&me instanceof fa&&!me.available&&(Q||(Q=me.name),me=null,Pe===this.args.length&&(me=Q)),me!==null)break;return me}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function Gs(Y,D){return Y==="=="||Y==="!="?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 cs(Y,D,Q,me){return me.compare(D,Q)===0}function Jo(Y,D,Q){const me=Y!=="=="&&Y!=="!=";return class t4{constructor(Ve,We,pt){this.type=Nt,this.lhs=Ve,this.rhs=We,this.collator=pt,this.hasUntypedArgument=Ve.type.kind==="value"||We.type.kind==="value"}static parse(Ve,We){if(Ve.length!==3&&Ve.length!==4)return We.error("Expected two or three arguments.");const pt=Ve[0];let Rt=We.parse(Ve[1],1,Mr);if(!Rt)return null;if(!Gs(pt,Rt.type))return We.concat(1).error(`"${pt}" comparisons are not supported for type '${$e(Rt.type)}'.`);let Yt=We.parse(Ve[2],2,Mr);if(!Yt)return null;if(!Gs(pt,Yt.type))return We.concat(2).error(`"${pt}" comparisons are not supported for type '${$e(Yt.type)}'.`);if(Rt.type.kind!==Yt.type.kind&&Rt.type.kind!=="value"&&Yt.type.kind!=="value")return We.error(`Cannot compare types '${$e(Rt.type)}' and '${$e(Yt.type)}'.`);me&&(Rt.type.kind==="value"&&Yt.type.kind!=="value"?Rt=new Er(Yt.type,[Rt]):Rt.type.kind!=="value"&&Yt.type.kind==="value"&&(Yt=new Er(Rt.type,[Yt])));let dr=null;if(Ve.length===4){if(Rt.type.kind!=="string"&&Yt.type.kind!=="string"&&Rt.type.kind!=="value"&&Yt.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(dr=We.parse(Ve[3],3,Sr),!dr)return null}return new t4(Rt,Yt,dr)}evaluate(Ve){const We=this.lhs.evaluate(Ve),pt=this.rhs.evaluate(Ve);if(me&&this.hasUntypedArgument){const Rt=Vn(We),Yt=Vn(pt);if(Rt.kind!==Yt.kind||Rt.kind!=="string"&&Rt.kind!=="number")throw new Dt(`Expected arguments for "${Y}" to be (string, string) or (number, number), but found (${Rt.kind}, ${Yt.kind}) instead.`)}if(this.collator&&!me&&this.hasUntypedArgument){const Rt=Vn(We),Yt=Vn(pt);if(Rt.kind!=="string"||Yt.kind!=="string")return D(Ve,We,pt)}return this.collator?Q(Ve,We,pt,this.collator.evaluate(Ve)):D(Ve,We,pt)}eachChild(Ve){Ve(this.lhs),Ve(this.rhs),this.collator&&Ve(this.collator)}outputDefined(){return!0}}}const Uo=Jo("==",function(Y,D,Q){return D===Q},cs),Xs=Jo("!=",function(Y,D,Q){return D!==Q},function(Y,D,Q,me){return!cs(0,D,Q,me)}),js=Jo("<",function(Y,D,Q){return D",function(Y,D,Q){return D>Q},function(Y,D,Q,me){return me.compare(D,Q)>0}),fs=Jo("<=",function(Y,D,Q){return D<=Q},function(Y,D,Q,me){return me.compare(D,Q)<=0}),Zo=Jo(">=",function(Y,D,Q){return D>=Q},function(Y,D,Q,me){return me.compare(D,Q)>=0});class ho{constructor(D,Q,me){this.type=Sr,this.locale=me,this.caseSensitive=D,this.diacriticSensitive=Q}static parse(D,Q){if(D.length!==2)return Q.error("Expected one argument.");const me=D[1];if(typeof me!="object"||Array.isArray(me))return Q.error("Collator options argument must be an object.");const Pe=Q.parse(me["case-sensitive"]!==void 0&&me["case-sensitive"],1,Nt);if(!Pe)return null;const Ve=Q.parse(me["diacritic-sensitive"]!==void 0&&me["diacritic-sensitive"],1,Nt);if(!Ve)return null;let We=null;return me.locale&&(We=Q.parse(me.locale,1,Ft),!We)?null:new ho(Pe,Ve,We)}evaluate(D){return new Vr(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 hs{constructor(D,Q,me,Pe,Ve){this.type=Ft,this.number=D,this.locale=Q,this.currency=me,this.minFractionDigits=Pe,this.maxFractionDigits=Ve}static parse(D,Q){if(D.length!==3)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,rt);if(!me)return null;const Pe=D[2];if(typeof Pe!="object"||Array.isArray(Pe))return Q.error("NumberFormat options argument must be an object.");let Ve=null;if(Pe.locale&&(Ve=Q.parse(Pe.locale,1,Ft),!Ve))return null;let We=null;if(Pe.currency&&(We=Q.parse(Pe.currency,1,Ft),!We))return null;let pt=null;if(Pe["min-fraction-digits"]&&(pt=Q.parse(Pe["min-fraction-digits"],1,rt),!pt))return null;let Rt=null;return Pe["max-fraction-digits"]&&(Rt=Q.parse(Pe["max-fraction-digits"],1,rt),!Rt)?null:new hs(me,Ve,We,pt,Rt)}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 sl{constructor(D){this.type=Zr,this.sections=D}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[1];if(!Array.isArray(me)&&typeof me=="object")return Q.error("First argument must be an image or text section.");const Pe=[];let Ve=!1;for(let We=1;We<=D.length-1;++We){const pt=D[We];if(Ve&&typeof pt=="object"&&!Array.isArray(pt)){Ve=!1;let Rt=null;if(pt["font-scale"]&&(Rt=Q.parse(pt["font-scale"],1,rt),!Rt))return null;let Yt=null;if(pt["text-font"]&&(Yt=Q.parse(pt["text-font"],1,je(Ft)),!Yt))return null;let dr=null;if(pt["text-color"]&&(dr=Q.parse(pt["text-color"],1,$t),!dr))return null;const xr=Pe[Pe.length-1];xr.scale=Rt,xr.font=Yt,xr.textColor=dr}else{const Rt=Q.parse(D[We],1,Mr);if(!Rt)return null;const Yt=Rt.type.kind;if(Yt!=="string"&&Yt!=="value"&&Yt!=="null"&&Yt!=="resolvedImage")return Q.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ve=!0,Pe.push({content:Rt,scale:null,font:null,textColor:null})}}return new sl(Pe)}evaluate(D){return new pn(this.sections.map(Q=>{const me=Q.content.evaluate(D);return Vn(me)===Br?new on("",me,null,null,null):new on(hi(me),null,Q.scale?Q.scale.evaluate(D):null,Q.font?Q.font.evaluate(D).join(","):null,Q.textColor?Q.textColor.evaluate(D):null)}))}eachChild(D){for(const Q of this.sections)D(Q.content),Q.scale&&D(Q.scale),Q.font&&D(Q.font),Q.textColor&&D(Q.textColor)}outputDefined(){return!1}}class El{constructor(D){this.type=Br,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,Ft);return me?new El(me):Q.error("No image name provided.")}evaluate(D){const Q=this.input.evaluate(D),me=fa.fromString(Q);return me&&D.availableImages&&(me.available=D.availableImages.indexOf(Q)>-1),me}eachChild(D){D(this.input)}outputDefined(){return!1}}class Ll{constructor(D){this.type=rt,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error(`Expected 1 argument, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1);return me?me.type.kind!=="array"&&me.type.kind!=="string"&&me.type.kind!=="value"?Q.error(`Expected argument of type string or array, but found ${$e(me.type)} instead.`):new Ll(me):null}evaluate(D){const Q=this.input.evaluate(D);if(typeof Q=="string")return[...Q].length;if(Array.isArray(Q))return Q.length;throw new Dt(`Expected value to be of type string or array, but found ${$e(Vn(Q))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Es=8192;function ci(Y,D){const Q=(180+Y[0])/360,me=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y[1]*Math.PI/360)))/360,Pe=Math.pow(2,D.z);return[Math.round(Q*Pe*Es),Math.round(me*Pe*Es)]}function Ji(Y,D){const Q=Math.pow(2,D.z);return[(Pe=(Y[0]/Es+D.x)/Q,360*Pe-180),(me=(Y[1]/Es+D.y)/Q,360/Math.PI*Math.atan(Math.exp((180-360*me)*Math.PI/180))-90)];var me,Pe}function kl(Y,D){Y[0]=Math.min(Y[0],D[0]),Y[1]=Math.min(Y[1],D[1]),Y[2]=Math.max(Y[2],D[0]),Y[3]=Math.max(Y[3],D[1])}function Rs(Y,D){return!(Y[0]<=D[0]||Y[2]>=D[2]||Y[1]<=D[1]||Y[3]>=D[3])}function zo(Y,D,Q){const me=Y[0]-D[0],Pe=Y[1]-D[1],Ve=Y[0]-Q[0],We=Y[1]-Q[1];return me*We-Ve*Pe==0&&me*Ve<=0&&Pe*We<=0}function Pl(Y,D,Q,me){return(Pe=[me[0]-Q[0],me[1]-Q[1]])[0]*(Ve=[D[0]-Y[0],D[1]-Y[1]])[1]-Pe[1]*Ve[0]!=0&&!(!rs(Y,D,Q,me)||!rs(Q,me,Y,D));var Pe,Ve}function Ys(Y,D,Q){for(const me of Q)for(let Pe=0;Pe(Pe=Y)[1]!=(We=pt[Rt+1])[1]>Pe[1]&&Pe[0]<(We[0]-Ve[0])*(Pe[1]-Ve[1])/(We[1]-Ve[1])+Ve[0]&&(me=!me)}var Pe,Ve,We;return me}function _u(Y,D){for(const Q of D)if(ll(Y,Q))return!0;return!1}function Ki(Y,D){for(const Q of Y)if(!ll(Q,D))return!1;for(let Q=0;Q0&&pt<0||We<0&&pt>0}function ql(Y,D,Q){const me=[];for(let Pe=0;PeQ[2]){const Pe=.5*me;let Ve=Y[0]-Q[0]>Pe?-me:Q[0]-Y[0]>Pe?me:0;Ve===0&&(Ve=Y[0]-Q[2]>Pe?-me:Q[2]-Y[0]>Pe?me:0),Y[0]+=Ve}kl(D,Y)}function ou(Y,D,Q,me){const Pe=Math.pow(2,me.z)*Es,Ve=[me.x*Es,me.y*Es],We=[];for(const pt of Y)for(const Rt of pt){const Yt=[Rt.x+Ve[0],Rt.y+Ve[1]];Po(Yt,D,Q,Pe),We.push(Yt)}return We}function cu(Y,D,Q,me){const Pe=Math.pow(2,me.z)*Es,Ve=[me.x*Es,me.y*Es],We=[];for(const Rt of Y){const Yt=[];for(const dr of Rt){const xr=[dr.x+Ve[0],dr.y+Ve[1]];kl(D,xr),Yt.push(xr)}We.push(Yt)}if(D[2]-D[0]<=Pe/2){(pt=D)[0]=pt[1]=1/0,pt[2]=pt[3]=-1/0;for(const Rt of We)for(const Yt of Rt)Po(Yt,D,Q,Pe)}var pt;return We}class zs{constructor(D,Q){this.type=Nt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(ka(D[1])){const me=D[1];if(me.type==="FeatureCollection"){const Pe=[];for(const Ve of me.features){const{type:We,coordinates:pt}=Ve.geometry;We==="Polygon"&&Pe.push(pt),We==="MultiPolygon"&&Pe.push(...pt)}if(Pe.length)return new zs(me,{type:"MultiPolygon",coordinates:Pe})}else if(me.type==="Feature"){const Pe=me.geometry.type;if(Pe==="Polygon"||Pe==="MultiPolygon")return new zs(me,me.geometry)}else if(me.type==="Polygon"||me.type==="MultiPolygon")return new zs(me,me)}return Q.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(Q,me){const Pe=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const pt=ql(me.coordinates,Ve,We),Rt=ou(Q.geometry(),Pe,Ve,We);if(!Rs(Pe,Ve))return!1;for(const Yt of Rt)if(!ll(Yt,pt))return!1}if(me.type==="MultiPolygon"){const pt=Vl(me.coordinates,Ve,We),Rt=ou(Q.geometry(),Pe,Ve,We);if(!Rs(Pe,Ve))return!1;for(const Yt of Rt)if(!_u(Yt,pt))return!1}return!0})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Pe=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const pt=ql(me.coordinates,Ve,We),Rt=cu(Q.geometry(),Pe,Ve,We);if(!Rs(Pe,Ve))return!1;for(const Yt of Rt)if(!Ki(Yt,pt))return!1}if(me.type==="MultiPolygon"){const pt=Vl(me.coordinates,Ve,We),Rt=cu(Q.geometry(),Pe,Ve,We);if(!Rs(Pe,Ve))return!1;for(const Yt of Rt)if(!ms(Yt,pt))return!1}return!0})(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xl=class{constructor(Y=[],D=(Q,me)=>Qme?1:0){if(this.data=Y,this.length=this.data.length,this.compare=D,this.length>0)for(let Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)}push(Y){this.data.push(Y),this._up(this.length++)}pop(){if(this.length===0)return;const Y=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),Y}peek(){return this.data[0]}_up(Y){const{data:D,compare:Q}=this,me=D[Y];for(;Y>0;){const Pe=Y-1>>1,Ve=D[Pe];if(Q(me,Ve)>=0)break;D[Y]=Ve,Y=Pe}D[Y]=me}_down(Y){const{data:D,compare:Q}=this,me=this.length>>1,Pe=D[Y];for(;Y=0)break;D[Y]=D[Ve],Y=Ve}D[Y]=Pe}};function Ol(Y,D,Q,me,Pe){Nl(Y,D,Q,me||Y.length-1,Pe||sf)}function Nl(Y,D,Q,me,Pe){for(;me>Q;){if(me-Q>600){var Ve=me-Q+1,We=D-Q+1,pt=Math.log(Ve),Rt=.5*Math.exp(2*pt/3),Yt=.5*Math.sqrt(pt*Rt*(Ve-Rt)/Ve)*(We-Ve/2<0?-1:1);Nl(Y,D,Math.max(Q,Math.floor(D-We*Rt/Ve+Yt)),Math.min(me,Math.floor(D+(Ve-We)*Rt/Ve+Yt)),Pe)}var dr=Y[D],xr=Q,qr=me;for(Vu(Y,Q,D),Pe(Y[me],dr)>0&&Vu(Y,Q,me);xr0;)qr--}Pe(Y[Q],dr)===0?Vu(Y,Q,qr):Vu(Y,++qr,me),qr<=D&&(Q=qr+1),D<=qr&&(me=qr-1)}}function Vu(Y,D,Q){var me=Y[D];Y[D]=Y[Q],Y[Q]=me}function sf(Y,D){return YD?1:0}function jc(Y,D){if(Y.length<=1)return[Y];const Q=[];let me,Pe;for(const Ve of Y){const We=Ch(Ve);We!==0&&(Ve.area=Math.abs(We),Pe===void 0&&(Pe=We<0),Pe===We<0?(me&&Q.push(me),me=[Ve]):me.push(Ve))}if(me&&Q.push(me),D>1)for(let Ve=0;Ve1?(Yt=D[Rt+1][0],dr=D[Rt+1][1]):$r>0&&(Yt+=xr/this.kx*$r,dr+=qr/this.ky*$r)),xr=this.wrap(Q[0]-Yt)*this.kx,qr=(Q[1]-dr)*this.ky;const hn=xr*xr+qr*qr;hn180;)D-=360;return D}}function tc(Y,D){return D[0]-Y[0]}function Hu(Y){return Y[1]-Y[0]+1}function rc(Y,D){return Y[1]>=Y[0]&&Y[1]Y[1])return[null,null];const Q=Hu(Y);if(D){if(Q===2)return[Y,null];const Pe=Math.floor(Q/2);return[[Y[0],Y[0]+Pe],[Y[0]+Pe,Y[1]]]}if(Q===1)return[Y,null];const me=Math.floor(Q/2)-1;return[[Y[0],Y[0]+me],[Y[0]+me+1,Y[1]]]}function Zl(Y,D){if(!rc(D,Y.length))return[1/0,1/0,-1/0,-1/0];const Q=[1/0,1/0,-1/0,-1/0];for(let me=D[0];me<=D[1];++me)kl(Q,Y[me]);return Q}function Gu(Y){const D=[1/0,1/0,-1/0,-1/0];for(const Q of Y)for(const me of Q)kl(D,me);return D}function qs(Y){return Y[0]!==-1/0&&Y[1]!==-1/0&&Y[2]!==1/0&&Y[3]!==1/0}function Rl(Y,D,Q){if(!qs(Y)||!qs(D))return NaN;let me=0,Pe=0;return Y[2]D[2]&&(me=Y[0]-D[2]),Y[1]>D[3]&&(Pe=Y[1]-D[3]),Y[3]=me)return me;if(Rs(Pe,Ve)){if(Fv(Y,D))return 0}else if(Fv(D,Y))return 0;let We=1/0;for(const pt of Y)for(let Rt=0,Yt=pt.length,dr=Yt-1;Rt0;){const Rt=We.pop();if(Rt[0]>=Ve)continue;const Yt=Rt[1],dr=D?50:100;if(Hu(Yt)<=dr){if(!rc(Yt,Y.length))return NaN;if(D){const xr=Os(Y,Yt,Q,me);if(isNaN(xr)||xr===0)return xr;Ve=Math.min(Ve,xr)}else for(let xr=Yt[0];xr<=Yt[1];++xr){const qr=xv(Y[xr],Q,me);if(Ve=Math.min(Ve,qr),Ve===0)return 0}}else{const xr=Jc(Yt,D);Do(We,Ve,me,Y,pt,xr[0]),Do(We,Ve,me,Y,pt,xr[1])}}return Ve}function Ru(Y,D,Q,me,Pe,Ve=1/0){let We=Math.min(Ve,Pe.distance(Y[0],Q[0]));if(We===0)return We;const pt=new xl([[0,[0,Y.length-1],[0,Q.length-1]]],tc);for(;pt.length>0;){const Rt=pt.pop();if(Rt[0]>=We)continue;const Yt=Rt[1],dr=Rt[2],xr=D?50:100,qr=me?50:100;if(Hu(Yt)<=xr&&Hu(dr)<=qr){if(!rc(Yt,Y.length)&&rc(dr,Q.length))return NaN;let $r;if(D&&me)$r=Rf(Y,Yt,Q,dr,Pe),We=Math.min(We,$r);else if(D&&!me){const hn=Y.slice(Yt[0],Yt[1]+1);for(let An=dr[0];An<=dr[1];++An)if($r=xf(Q[An],hn,Pe),We=Math.min(We,$r),We===0)return We}else if(!D&&me){const hn=Q.slice(dr[0],dr[1]+1);for(let An=Yt[0];An<=Yt[1];++An)if($r=xf(Y[An],hn,Pe),We=Math.min(We,$r),We===0)return We}else $r=su(Y,Yt,Q,dr,Pe),We=Math.min(We,$r)}else{const $r=Jc(Yt,D),hn=Jc(dr,me);Wf(pt,We,Pe,Y,Q,$r[0],hn[0]),Wf(pt,We,Pe,Y,Q,$r[0],hn[1]),Wf(pt,We,Pe,Y,Q,$r[1],hn[0]),Wf(pt,We,Pe,Y,Q,$r[1],hn[1])}}return We}function Ph(Y){return Y.type==="MultiPolygon"?Y.coordinates.map(D=>({type:"Polygon",coordinates:D})):Y.type==="MultiLineString"?Y.coordinates.map(D=>({type:"LineString",coordinates:D})):Y.type==="MultiPoint"?Y.coordinates.map(D=>({type:"Point",coordinates:D})):[Y]}class If{constructor(D,Q){this.type=rt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(ka(D[1])){const me=D[1];if(me.type==="FeatureCollection")return new If(me,me.features.map(Pe=>Ph(Pe.geometry)).flat());if(me.type==="Feature")return new If(me,Ph(me.geometry));if("type"in me&&"coordinates"in me)return new If(me,Ph(me))}return Q.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(Q,me){const Pe=Q.geometry(),Ve=Pe.flat().map(Rt=>Ji([Rt.x,Rt.y],Q.canonical));if(Pe.length===0)return NaN;const We=new Lh(Ve[0][1]);let pt=1/0;for(const Rt of me){switch(Rt.type){case"Point":pt=Math.min(pt,Ru(Ve,!1,[Rt.coordinates],!1,We,pt));break;case"LineString":pt=Math.min(pt,Ru(Ve,!1,Rt.coordinates,!0,We,pt));break;case"Polygon":pt=Math.min(pt,Qc(Ve,!1,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Pe=Q.geometry(),Ve=Pe.flat().map(Rt=>Ji([Rt.x,Rt.y],Q.canonical));if(Pe.length===0)return NaN;const We=new Lh(Ve[0][1]);let pt=1/0;for(const Rt of me){switch(Rt.type){case"Point":pt=Math.min(pt,Ru(Ve,!0,[Rt.coordinates],!1,We,pt));break;case"LineString":pt=Math.min(pt,Ru(Ve,!0,Rt.coordinates,!0,We,pt));break;case"Polygon":pt=Math.min(pt,Qc(Ve,!0,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries);if(D.geometryType()==="Polygon")return(function(Q,me){const Pe=Q.geometry();if(Pe.length===0||Pe[0].length===0)return NaN;const Ve=jc(Pe,0).map(Rt=>Rt.map(Yt=>Yt.map(dr=>Ji([dr.x,dr.y],Q.canonical)))),We=new Lh(Ve[0][0][0][1]);let pt=1/0;for(const Rt of me)for(const Yt of Ve){switch(Rt.type){case"Point":pt=Math.min(pt,Qc([Rt.coordinates],!1,Yt,We,pt));break;case"LineString":pt=Math.min(pt,Qc(Rt.coordinates,!0,Yt,We,pt));break;case"Polygon":pt=Math.min(pt,vl(Yt,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const ah={"==":Uo,"!=":Xs,">":ol,"<":js,">=":Zo,"<=":fs,array:Er,at:or,boolean:Er,case:jn,coalesce:Ho,collator:ho,format:sl,image:El,in:Dr,"index-of":ln,interpolate:li,"interpolate-hcl":li,"interpolate-lab":li,length:Ll,let:Kr,literal:Ti,match:Pn,number:Er,"number-format":hs,object:Er,slice:Un,step:Rn,string:Er,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:Tt,within:zs,distance:If};class Xu{constructor(D,Q,me,Pe){this.name=D,this.type=Q,this._evaluate=me,this.args=Pe}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,Q){const me=D[0],Pe=Xu.definitions[me];if(!Pe)return Q.error(`Unknown expression "${me}". If you wanted a literal array, use ["literal", [...]].`,0);const Ve=Array.isArray(Pe)?Pe[0]:Pe.type,We=Array.isArray(Pe)?[[Pe[1],Pe[2]]]:Pe.overloads,pt=We.filter(([Yt])=>!Array.isArray(Yt)||Yt.length===D.length-1);let Rt=null;for(const[Yt,dr]of pt){Rt=new sn(Q.registry,Rh,Q.path,null,Q.scope);const xr=[];let qr=!1;for(let $r=1;$r{return qr=xr,Array.isArray(qr)?`(${qr.map($e).join(", ")})`:`(${$e(qr.type)}...)`;var qr}).join(" | "),dr=[];for(let xr=1;xr{Q=D?Q&&Rh(me):Q&&me instanceof Ti}),!!Q&&Ih(Y)&&Uh(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ih(Y){if(Y instanceof Xu&&(Y.name==="get"&&Y.args.length===1||Y.name==="feature-state"||Y.name==="has"&&Y.args.length===1||Y.name==="properties"||Y.name==="geometry-type"||Y.name==="id"||/^filter-/.test(Y.name))||Y instanceof zs||Y instanceof If)return!1;let D=!0;return Y.eachChild(Q=>{D&&!Ih(Q)&&(D=!1)}),D}function ef(Y){if(Y instanceof Xu&&Y.name==="feature-state")return!1;let D=!0;return Y.eachChild(Q=>{D&&!ef(Q)&&(D=!1)}),D}function Uh(Y,D){if(Y instanceof Xu&&D.indexOf(Y.name)>=0)return!1;let Q=!0;return Y.eachChild(me=>{Q&&!Uh(me,D)&&(Q=!1)}),Q}function bf(Y){return{result:"success",value:Y}}function lf(Y){return{result:"error",value:Y}}function Yu(Y){return Y["property-type"]==="data-driven"||Y["property-type"]==="cross-faded-data-driven"}function Vf(Y){return!!Y.expression&&Y.expression.parameters.indexOf("zoom")>-1}function Dh(Y){return!!Y.expression&&Y.expression.interpolated}function Fl(Y){return Y instanceof Number?"number":Y instanceof String?"string":Y instanceof Boolean?"boolean":Array.isArray(Y)?"array":Y===null?"null":typeof Y}function yh(Y){return typeof Y=="object"&&Y!==null&&!Array.isArray(Y)}function bv(Y){return Y}function jh(Y,D){const Q=D.type==="color",me=Y.stops&&typeof Y.stops[0][0]=="object",Pe=me||!(me||Y.property!==void 0),Ve=Y.type||(Dh(D)?"exponential":"interval");if(Q||D.type==="padding"){const dr=Q?sr.parse:wn.parse;(Y=pe({},Y)).stops&&(Y.stops=Y.stops.map(xr=>[xr[0],dr(xr[1])])),Y.default=dr(Y.default?Y.default:D.default)}if(Y.colorSpace&&(We=Y.colorSpace)!=="rgb"&&We!=="hcl"&&We!=="lab")throw new Error(`Unknown color space: "${Y.colorSpace}"`);var We;let pt,Rt,Yt;if(Ve==="exponential")pt=Vh;else if(Ve==="interval")pt=Lc;else if(Ve==="categorical"){pt=qh,Rt=Object.create(null);for(const dr of Y.stops)Rt[dr[0]]=dr[1];Yt=typeof Y.stops[0][0]}else{if(Ve!=="identity")throw new Error(`Unknown function type "${Ve}"`);pt=gu}if(me){const dr={},xr=[];for(let hn=0;hnhn[0]),evaluate:({zoom:hn},An)=>Vh({stops:qr,base:Y.base},D,hn).evaluate(hn,An)}}if(Pe){const dr=Ve==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:dr,interpolationFactor:li.interpolationFactor.bind(void 0,dr),zoomStops:Y.stops.map(xr=>xr[0]),evaluate:({zoom:xr})=>pt(Y,D,xr,Rt,Yt)}}return{kind:"source",evaluate(dr,xr){const qr=xr&&xr.properties?xr.properties[Y.property]:void 0;return qr===void 0?oh(Y.default,D.default):pt(Y,D,qr,Rt,Yt)}}}function oh(Y,D,Q){return Y!==void 0?Y:D!==void 0?D:Q!==void 0?Q:void 0}function qh(Y,D,Q,me,Pe){return oh(typeof Q===Pe?me[Q]:void 0,Y.default,D.default)}function Lc(Y,D,Q){if(Fl(Q)!=="number")return oh(Y.default,D.default);const me=Y.stops.length;if(me===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[me-1][0])return Y.stops[me-1][1];const Pe=un(Y.stops.map(Ve=>Ve[0]),Q);return Y.stops[Pe][1]}function Vh(Y,D,Q){const me=Y.base!==void 0?Y.base:1;if(Fl(Q)!=="number")return oh(Y.default,D.default);const Pe=Y.stops.length;if(Pe===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[Pe-1][0])return Y.stops[Pe-1][1];const Ve=un(Y.stops.map(dr=>dr[0]),Q),We=(function(dr,xr,qr,$r){const hn=$r-qr,An=dr-qr;return hn===0?0:xr===1?An/hn:(Math.pow(xr,An)-1)/(Math.pow(xr,hn)-1)})(Q,me,Y.stops[Ve][0],Y.stops[Ve+1][0]),pt=Y.stops[Ve][1],Rt=Y.stops[Ve+1][1],Yt=bo[D.type]||bv;return typeof pt.evaluate=="function"?{evaluate(...dr){const xr=pt.evaluate.apply(void 0,dr),qr=Rt.evaluate.apply(void 0,dr);if(xr!==void 0&&qr!==void 0)return Yt(xr,qr,We,Y.colorSpace)}}:Yt(pt,Rt,We,Y.colorSpace)}function gu(Y,D,Q){switch(D.type){case"color":Q=sr.parse(Q);break;case"formatted":Q=pn.fromString(Q.toString());break;case"resolvedImage":Q=fa.fromString(Q.toString());break;case"padding":Q=wn.parse(Q);break;default:Fl(Q)===D.type||D.type==="enum"&&D.values[Q]||(Q=void 0)}return oh(Q,Y.default,D.default)}Xu.register(ah,{error:[{kind:"error"},[Ft],(Y,[D])=>{throw new Dt(D.evaluate(Y))}],typeof:[Ft,[Mr],(Y,[D])=>$e(Vn(D.evaluate(Y)))],"to-rgba":[je(rt,4),[$t],(Y,[D])=>{const[Q,me,Pe,Ve]=D.evaluate(Y).rgb;return[255*Q,255*me,255*Pe,Ve]}],rgb:[$t,[rt,rt,rt],ov],rgba:[$t,[rt,rt,rt,rt],ov],has:{type:Nt,overloads:[[[Ft],(Y,[D])=>Nh(D.evaluate(Y),Y.properties())],[[Ft,rr],(Y,[D,Q])=>Nh(D.evaluate(Y),Q.evaluate(Y))]]},get:{type:Mr,overloads:[[[Ft],(Y,[D])=>ih(D.evaluate(Y),Y.properties())],[[Ft,rr],(Y,[D,Q])=>ih(D.evaluate(Y),Q.evaluate(Y))]]},"feature-state":[Mr,[Ft],(Y,[D])=>ih(D.evaluate(Y),Y.featureState||{})],properties:[rr,[],Y=>Y.properties()],"geometry-type":[Ft,[],Y=>Y.geometryType()],id:[Mr,[],Y=>Y.id()],zoom:[rt,[],Y=>Y.globals.zoom],"heatmap-density":[rt,[],Y=>Y.globals.heatmapDensity||0],"line-progress":[rt,[],Y=>Y.globals.lineProgress||0],accumulated:[Mr,[],Y=>Y.globals.accumulated===void 0?null:Y.globals.accumulated],"+":[rt,Df(rt),(Y,D)=>{let Q=0;for(const me of D)Q+=me.evaluate(Y);return Q}],"*":[rt,Df(rt),(Y,D)=>{let Q=1;for(const me of D)Q*=me.evaluate(Y);return Q}],"-":{type:rt,overloads:[[[rt,rt],(Y,[D,Q])=>D.evaluate(Y)-Q.evaluate(Y)],[[rt],(Y,[D])=>-D.evaluate(Y)]]},"/":[rt,[rt,rt],(Y,[D,Q])=>D.evaluate(Y)/Q.evaluate(Y)],"%":[rt,[rt,rt],(Y,[D,Q])=>D.evaluate(Y)%Q.evaluate(Y)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(Y,[D,Q])=>Math.pow(D.evaluate(Y),Q.evaluate(Y))],sqrt:[rt,[rt],(Y,[D])=>Math.sqrt(D.evaluate(Y))],log10:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN10],ln:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))],log2:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN2],sin:[rt,[rt],(Y,[D])=>Math.sin(D.evaluate(Y))],cos:[rt,[rt],(Y,[D])=>Math.cos(D.evaluate(Y))],tan:[rt,[rt],(Y,[D])=>Math.tan(D.evaluate(Y))],asin:[rt,[rt],(Y,[D])=>Math.asin(D.evaluate(Y))],acos:[rt,[rt],(Y,[D])=>Math.acos(D.evaluate(Y))],atan:[rt,[rt],(Y,[D])=>Math.atan(D.evaluate(Y))],min:[rt,Df(rt),(Y,D)=>Math.min(...D.map(Q=>Q.evaluate(Y)))],max:[rt,Df(rt),(Y,D)=>Math.max(...D.map(Q=>Q.evaluate(Y)))],abs:[rt,[rt],(Y,[D])=>Math.abs(D.evaluate(Y))],round:[rt,[rt],(Y,[D])=>{const Q=D.evaluate(Y);return Q<0?-Math.round(-Q):Math.round(Q)}],floor:[rt,[rt],(Y,[D])=>Math.floor(D.evaluate(Y))],ceil:[rt,[rt],(Y,[D])=>Math.ceil(D.evaluate(Y))],"filter-==":[Nt,[Ft,Mr],(Y,[D,Q])=>Y.properties()[D.value]===Q.value],"filter-id-==":[Nt,[Mr],(Y,[D])=>Y.id()===D.value],"filter-type-==":[Nt,[Ft],(Y,[D])=>Y.geometryType()===D.value],"filter-<":[Nt,[Ft,Mr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q":[Nt,[Ft,Mr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me>Pe}],"filter-id->":[Nt,[Mr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>me}],"filter-<=":[Nt,[Ft,Mr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me<=Pe}],"filter-id-<=":[Nt,[Mr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q<=me}],"filter->=":[Nt,[Ft,Mr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me>=Pe}],"filter-id->=":[Nt,[Mr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>=me}],"filter-has":[Nt,[Mr],(Y,[D])=>D.value in Y.properties()],"filter-has-id":[Nt,[],Y=>Y.id()!==null&&Y.id()!==void 0],"filter-type-in":[Nt,[je(Ft)],(Y,[D])=>D.value.indexOf(Y.geometryType())>=0],"filter-id-in":[Nt,[je(Mr)],(Y,[D])=>D.value.indexOf(Y.id())>=0],"filter-in-small":[Nt,[Ft,je(Mr)],(Y,[D,Q])=>Q.value.indexOf(Y.properties()[D.value])>=0],"filter-in-large":[Nt,[Ft,je(Mr)],(Y,[D,Q])=>(function(me,Pe,Ve,We){for(;Ve<=We;){const pt=Ve+We>>1;if(Pe[pt]===me)return!0;Pe[pt]>me?We=pt-1:Ve=pt+1}return!1})(Y.properties()[D.value],Q.value,0,Q.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)&&Q.evaluate(Y)],[Df(Nt),(Y,D)=>{for(const Q of D)if(!Q.evaluate(Y))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)||Q.evaluate(Y)],[Df(Nt),(Y,D)=>{for(const Q of D)if(Q.evaluate(Y))return!0;return!1}]]},"!":[Nt,[Nt],(Y,[D])=>!D.evaluate(Y)],"is-supported-script":[Nt,[Ft],(Y,[D])=>{const Q=Y.globals&&Y.globals.isSupportedScript;return!Q||Q(D.evaluate(Y))}],upcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toUpperCase()],downcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toLowerCase()],concat:[Ft,Df(Mr),(Y,D)=>D.map(Q=>hi(Q.evaluate(Y))).join("")],"resolved-locale":[Ft,[Sr],(Y,[D])=>D.evaluate(Y).resolvedLocale()]});class Pc{constructor(D,Q){var me;this.expression=D,this._warningHistory={},this._evaluator=new Ur,this._defaultValue=Q?(me=Q).type==="color"&&yh(me.default)?new sr(0,0,0,0):me.type==="color"?sr.parse(me.default)||null:me.type==="padding"?wn.parse(me.default)||null:me.type==="variableAnchorOffsetCollection"?da.parse(me.default)||null:me.default===void 0?null:me.default:null,this._enumValues=Q&&Q.type==="enum"?Q.values:null}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._evaluator.globals=D,this._evaluator.feature=Q,this._evaluator.featureState=me,this._evaluator.canonical=Pe,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We,this.expression.evaluate(this._evaluator)}evaluate(D,Q,me,Pe,Ve,We){this._evaluator.globals=D,this._evaluator.feature=Q||null,this._evaluator.featureState=me||null,this._evaluator.canonical=Pe,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We||null;try{const pt=this.expression.evaluate(this._evaluator);if(pt==null||typeof pt=="number"&&pt!=pt)return this._defaultValue;if(this._enumValues&&!(pt in this._enumValues))throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map(Rt=>JSON.stringify(Rt)).join(", ")}, but found ${JSON.stringify(pt)} instead.`);return pt}catch(pt){return this._warningHistory[pt.message]||(this._warningHistory[pt.message]=!0,typeof console<"u"&&console.warn(pt.message)),this._defaultValue}}}function zf(Y){return Array.isArray(Y)&&Y.length>0&&typeof Y[0]=="string"&&Y[0]in ah}function Wl(Y,D){const Q=new sn(ah,Rh,[],D?(function(Pe){const Ve={color:$t,string:Ft,number:rt,enum:Ft,boolean:Nt,formatted:Zr,padding:Ar,resolvedImage:Br,variableAnchorOffsetCollection:Mt};return Pe.type==="array"?je(Ve[Pe.value]||Mr,Pe.length):Ve[Pe.type]})(D):void 0),me=Q.parse(Y,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return me?bf(new Pc(me,D)):lf(Q.errors)}class wf{constructor(D,Q){this.kind=D,this._styleExpression=Q,this.isStateDependent=D!=="constant"&&!ef(Q.expression)}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We)}evaluate(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluate(D,Q,me,Pe,Ve,We)}}class hc{constructor(D,Q,me,Pe){this.kind=D,this.zoomStops=me,this._styleExpression=Q,this.isStateDependent=D!=="camera"&&!ef(Q.expression),this.interpolationType=Pe}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We)}evaluate(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluate(D,Q,me,Pe,Ve,We)}interpolationFactor(D,Q,me){return this.interpolationType?li.interpolationFactor(this.interpolationType,D,Q,me):0}}function Rc(Y,D){const Q=Wl(Y,D);if(Q.result==="error")return Q;const me=Q.value.expression,Pe=Ih(me);if(!Pe&&!Yu(D))return lf([new Ne("","data expressions not supported")]);const Ve=Uh(me,["zoom"]);if(!Ve&&!Vf(D))return lf([new Ne("","zoom expressions not supported")]);const We=Kf(me);return We||Ve?We instanceof Ne?lf([We]):We instanceof li&&!Dh(D)?lf([new Ne("",'"interpolate" expressions cannot be used with this property')]):bf(We?new hc(Pe?"camera":"composite",Q.value,We.labels,We instanceof li?We.interpolation:void 0):new wf(Pe?"constant":"source",Q.value)):lf([new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class lu{constructor(D,Q){this._parameters=D,this._specification=Q,pe(this,jh(this._parameters,this._specification))}static deserialize(D){return new lu(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function Kf(Y){let D=null;if(Y instanceof Kr)D=Kf(Y.result);else if(Y instanceof Ho){for(const Q of Y.args)if(D=Kf(Q),D)break}else(Y instanceof Rn||Y instanceof li)&&Y.input instanceof Xu&&Y.input.name==="zoom"&&(D=Y);return D instanceof Ne||Y.eachChild(Q=>{const me=Kf(Q);me instanceof Ne?D=me:!D&&me?D=new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&me&&D!==me&&(D=new Ne("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function uf(Y){if(Y===!0||Y===!1)return!0;if(!Array.isArray(Y)||Y.length===0)return!1;switch(Y[0]){case"has":return Y.length>=2&&Y[1]!=="$id"&&Y[1]!=="$type";case"in":return Y.length>=3&&(typeof Y[1]!="string"||Array.isArray(Y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Y.length!==3||Array.isArray(Y[1])||Array.isArray(Y[2]);case"any":case"all":for(const D of Y.slice(1))if(!uf(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const Of={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function _h(Y){if(Y==null)return{filter:()=>!0,needGeometry:!1};uf(Y)||(Y=$f(Y));const D=Wl(Y,Of);if(D.result==="error")throw new Error(D.value.map(Q=>`${Q.key}: ${Q.message}`).join(", "));return{filter:(Q,me,Pe)=>D.value.evaluate(Q,me,{},Pe),needGeometry:Yv(Y)}}function wv(Y,D){return YD?1:0}function Yv(Y){if(!Array.isArray(Y))return!1;if(Y[0]==="within"||Y[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?xh(Y[1],Y[2],D):D==="any"?(Q=Y.slice(1),["any"].concat(Q.map($f))):D==="all"?["all"].concat(Y.slice(1).map($f)):D==="none"?["all"].concat(Y.slice(1).map($f).map(nc)):D==="in"?qc(Y[1],Y.slice(2)):D==="!in"?nc(qc(Y[1],Y.slice(2))):D==="has"?bh(Y[1]):D!=="!has"||nc(bh(Y[1]));var Q}function xh(Y,D,Q){switch(Y){case"$type":return[`filter-type-${Q}`,D];case"$id":return[`filter-id-${Q}`,D];default:return[`filter-${Q}`,Y,D]}}function qc(Y,D){if(D.length===0)return!1;switch(Y){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(Q=>typeof Q!=typeof D[0])?["filter-in-large",Y,["literal",D.sort(wv)]]:["filter-in-small",Y,["literal",D]]}}function bh(Y){switch(Y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Y]}}function nc(Y){return["!",Y]}function Jf(Y){const D=typeof Y;if(D==="number"||D==="boolean"||D==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let Pe="[";for(const Ve of Y)Pe+=`${Jf(Ve)},`;return`${Pe}]`}const Q=Object.keys(Y).sort();let me="{";for(let Pe=0;Peme.maximum?[new Te(D,Q,`${Q} is greater than the maximum value ${me.maximum}`)]:[]}function sh(Y){const D=Y.valueSpec,Q=Ql(Y.value.type);let me,Pe,Ve,We={};const pt=Q!=="categorical"&&Y.value.property===void 0,Rt=!pt,Yt=Fl(Y.value.stops)==="array"&&Fl(Y.value.stops[0])==="array"&&Fl(Y.value.stops[0][0])==="object",dr=tf({key:Y.key,value:Y.value,valueSpec:Y.styleSpec.function,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{stops:function($r){if(Q==="identity")return[new Te($r.key,$r.value,'identity function may not have a "stops" property')];let hn=[];const An=$r.value;return hn=hn.concat(zh({key:$r.key,value:An,valueSpec:$r.valueSpec,validateSpec:$r.validateSpec,style:$r.style,styleSpec:$r.styleSpec,arrayElementValidator:xr})),Fl(An)==="array"&&An.length===0&&hn.push(new Te($r.key,An,"array must have at least one stop")),hn},default:function($r){return $r.validateSpec({key:$r.key,value:$r.value,valueSpec:D,validateSpec:$r.validateSpec,style:$r.style,styleSpec:$r.styleSpec})}}});return Q==="identity"&&pt&&dr.push(new Te(Y.key,Y.value,'missing required property "property"')),Q==="identity"||Y.value.stops||dr.push(new Te(Y.key,Y.value,'missing required property "stops"')),Q==="exponential"&&Y.valueSpec.expression&&!Dh(Y.valueSpec)&&dr.push(new Te(Y.key,Y.value,"exponential functions not supported")),Y.styleSpec.$version>=8&&(Rt&&!Yu(Y.valueSpec)?dr.push(new Te(Y.key,Y.value,"property functions not supported")):pt&&!Vf(Y.valueSpec)&&dr.push(new Te(Y.key,Y.value,"zoom functions not supported"))),Q!=="categorical"&&!Yt||Y.value.property!==void 0||dr.push(new Te(Y.key,Y.value,'"property" property is required')),dr;function xr($r){let hn=[];const An=$r.value,Bn=$r.key;if(Fl(An)!=="array")return[new Te(Bn,An,`array expected, ${Fl(An)} found`)];if(An.length!==2)return[new Te(Bn,An,`array length 2 expected, length ${An.length} found`)];if(Yt){if(Fl(An[0])!=="object")return[new Te(Bn,An,`object expected, ${Fl(An[0])} found`)];if(An[0].zoom===void 0)return[new Te(Bn,An,"object stop key must have zoom")];if(An[0].value===void 0)return[new Te(Bn,An,"object stop key must have value")];if(Ve&&Ve>Ql(An[0].zoom))return[new Te(Bn,An[0].zoom,"stop zoom values must appear in ascending order")];Ql(An[0].zoom)!==Ve&&(Ve=Ql(An[0].zoom),Pe=void 0,We={}),hn=hn.concat(tf({key:`${Bn}[0]`,value:An[0],valueSpec:{zoom:{}},validateSpec:$r.validateSpec,style:$r.style,styleSpec:$r.styleSpec,objectElementValidators:{zoom:au,value:qr}}))}else hn=hn.concat(qr({key:`${Bn}[0]`,value:An[0],validateSpec:$r.validateSpec,style:$r.style,styleSpec:$r.styleSpec},An));return zf(Ic(An[1]))?hn.concat([new Te(`${Bn}[1]`,An[1],"expressions are not allowed in function stops.")]):hn.concat($r.validateSpec({key:`${Bn}[1]`,value:An[1],valueSpec:D,validateSpec:$r.validateSpec,style:$r.style,styleSpec:$r.styleSpec}))}function qr($r,hn){const An=Fl($r.value),Bn=Ql($r.value),va=$r.value!==null?$r.value:hn;if(me){if(An!==me)return[new Te($r.key,va,`${An} stop domain type must match previous stop domain type ${me}`)]}else me=An;if(An!=="number"&&An!=="string"&&An!=="boolean")return[new Te($r.key,va,"stop domain value must be a number, string, or boolean")];if(An!=="number"&&Q!=="categorical"){let ii=`number expected, ${An} found`;return Yu(D)&&Q===void 0&&(ii+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Te($r.key,va,ii)]}return Q!=="categorical"||An!=="number"||isFinite(Bn)&&Math.floor(Bn)===Bn?Q!=="categorical"&&An==="number"&&Pe!==void 0&&Bnnew Te(`${Y.key}${me.key}`,Y.value,me.message));const Q=D.value.expression||D.value._styleExpression.expression;if(Y.expressionContext==="property"&&Y.propertyKey==="text-font"&&!Q.outputDefined())return[new Te(Y.key,Y.value,`Invalid data expression for "${Y.propertyKey}". Output values must be contained as literals within the expression.`)];if(Y.expressionContext==="property"&&Y.propertyType==="layout"&&!ef(Q))return[new Te(Y.key,Y.value,'"feature-state" data expressions are not supported with layout properties.')];if(Y.expressionContext==="filter"&&!ef(Q))return[new Te(Y.key,Y.value,'"feature-state" data expressions are not supported with filters.')];if(Y.expressionContext&&Y.expressionContext.indexOf("cluster")===0){if(!Uh(Q,["zoom","feature-state"]))return[new Te(Y.key,Y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Y.expressionContext==="cluster-initial"&&!Ih(Q))return[new Te(Y.key,Y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Vc(Y){const D=Y.key,Q=Y.value,me=Y.valueSpec,Pe=[];return Array.isArray(me.values)?me.values.indexOf(Ql(Q))===-1&&Pe.push(new Te(D,Q,`expected one of [${me.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(me.values).indexOf(Ql(Q))===-1&&Pe.push(new Te(D,Q,`expected one of [${Object.keys(me.values).join(", ")}], ${JSON.stringify(Q)} found`)),Pe}function lh(Y){return uf(Ic(Y.value))?Ff(pe({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cf(Y)}function cf(Y){const D=Y.value,Q=Y.key;if(Fl(D)!=="array")return[new Te(Q,D,`array expected, ${Fl(D)} found`)];const me=Y.styleSpec;let Pe,Ve=[];if(D.length<1)return[new Te(Q,D,"filter array must have at least 1 element")];switch(Ve=Ve.concat(Vc({key:`${Q}[0]`,value:D[0],valueSpec:me.filter_operator,style:Y.style,styleSpec:Y.styleSpec})),Ql(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&Ql(D[1])==="$type"&&Ve.push(new Te(Q,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Ve.push(new Te(Q,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Pe=Fl(D[1]),Pe!=="string"&&Ve.push(new Te(`${Q}[1]`,D[1],`string expected, ${Pe} found`)));for(let We=2;We{Yt in Q&&D.push(new Te(me,Q[Yt],`"${Yt}" is prohibited for ref layers`))}),Pe.layers.forEach(Yt=>{Ql(Yt.id)===pt&&(Rt=Yt)}),Rt?Rt.ref?D.push(new Te(me,Q.ref,"ref cannot reference another ref layer")):We=Ql(Rt.type):D.push(new Te(me,Q.ref,`ref layer "${pt}" not found`))}else if(We!=="background")if(Q.source){const Rt=Pe.sources&&Pe.sources[Q.source],Yt=Rt&&Ql(Rt.type);Rt?Yt==="vector"&&We==="raster"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a raster source`)):Yt!=="raster-dem"&&We==="hillshade"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a raster-dem source`)):Yt==="raster"&&We!=="raster"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a vector source`)):Yt!=="vector"||Q["source-layer"]?Yt==="raster-dem"&&We!=="hillshade"?D.push(new Te(me,Q.source,"raster-dem source can only be used with layer type 'hillshade'.")):We!=="line"||!Q.paint||!Q.paint["line-gradient"]||Yt==="geojson"&&Rt.lineMetrics||D.push(new Te(me,Q,`layer "${Q.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new Te(me,Q,`layer "${Q.id}" must specify a "source-layer"`)):D.push(new Te(me,Q.source,`source "${Q.source}" not found`))}else D.push(new Te(me,Q,'missing required property "source"'));return D=D.concat(tf({key:me,value:Q,valueSpec:Ve.layer,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,objectElementValidators:{"*":()=>[],type:()=>Y.validateSpec({key:`${me}.type`,value:Q.type,valueSpec:Ve.layer.type,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,object:Q,objectKey:"type"}),filter:lh,layout:Rt=>tf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Yt=>oc(pe({layerType:We},Yt))}}),paint:Rt=>tf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Yt=>Tv(pe({layerType:We},Yt))}})}})),D}function Hc(Y){const D=Y.value,Q=Y.key,me=Fl(D);return me!=="string"?[new Te(Q,D,`string expected, ${me} found`)]:[]}const Tf={promoteId:function({key:Y,value:D}){if(Fl(D)==="string")return Hc({key:Y,value:D});{const Q=[];for(const me in D)Q.push(...Hc({key:`${Y}.${me}`,value:D[me]}));return Q}}};function ff(Y){const D=Y.value,Q=Y.key,me=Y.styleSpec,Pe=Y.style,Ve=Y.validateSpec;if(!D.type)return[new Te(Q,D,'"type" is required')];const We=Ql(D.type);let pt;switch(We){case"vector":case"raster":return pt=tf({key:Q,value:D,valueSpec:me[`source_${We.replace("-","_")}`],style:Y.style,styleSpec:me,objectElementValidators:Tf,validateSpec:Ve}),pt;case"raster-dem":return pt=(function(Rt){var Yt;const dr=(Yt=Rt.sourceName)!==null&&Yt!==void 0?Yt:"",xr=Rt.value,qr=Rt.styleSpec,$r=qr.source_raster_dem,hn=Rt.style;let An=[];const Bn=Fl(xr);if(xr===void 0)return An;if(Bn!=="object")return An.push(new Te("source_raster_dem",xr,`object expected, ${Bn} found`)),An;const va=Ql(xr.encoding)==="custom",ii=["redFactor","greenFactor","blueFactor","baseShift"],Fa=Rt.value.encoding?`"${Rt.value.encoding}"`:"Default";for(const Qa in xr)!va&&ii.includes(Qa)?An.push(new Te(Qa,xr[Qa],`In "${dr}": "${Qa}" is only valid when "encoding" is set to "custom". ${Fa} encoding found`)):$r[Qa]?An=An.concat(Rt.validateSpec({key:Qa,value:xr[Qa],valueSpec:$r[Qa],validateSpec:Rt.validateSpec,style:hn,styleSpec:qr})):An.push(new Te(Qa,xr[Qa],`unknown property "${Qa}"`));return An})({sourceName:Q,value:D,style:Y.style,styleSpec:me,validateSpec:Ve}),pt;case"geojson":if(pt=tf({key:Q,value:D,valueSpec:me.source_geojson,style:Pe,styleSpec:me,validateSpec:Ve,objectElementValidators:Tf}),D.cluster)for(const Rt in D.clusterProperties){const[Yt,dr]=D.clusterProperties[Rt],xr=typeof Yt=="string"?[Yt,["accumulated"],["get",Rt]]:Yt;pt.push(...Ff({key:`${Q}.${Rt}.map`,value:dr,expressionContext:"cluster-map"})),pt.push(...Ff({key:`${Q}.${Rt}.reduce`,value:xr,expressionContext:"cluster-reduce"}))}return pt;case"video":return tf({key:Q,value:D,valueSpec:me.source_video,style:Pe,validateSpec:Ve,styleSpec:me});case"image":return tf({key:Q,value:D,valueSpec:me.source_image,style:Pe,validateSpec:Ve,styleSpec:me});case"canvas":return[new Te(Q,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Vc({key:`${Q}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function xu(Y){const D=Y.value,Q=Y.styleSpec,me=Q.light,Pe=Y.style;let Ve=[];const We=Fl(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Te("light",D,`object expected, ${We} found`)]),Ve;for(const pt in D){const Rt=pt.match(/^(.*)-transition$/);Ve=Ve.concat(Rt&&me[Rt[1]]&&me[Rt[1]].transition?Y.validateSpec({key:pt,value:D[pt],valueSpec:Q.transition,validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)])}return Ve}function yc(Y){const D=Y.value,Q=Y.styleSpec,me=Q.sky,Pe=Y.style,Ve=Fl(D);if(D===void 0)return[];if(Ve!=="object")return[new Te("sky",D,`object expected, ${Ve} found`)];let We=[];for(const pt in D)We=We.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return We}function fu(Y){const D=Y.value,Q=Y.styleSpec,me=Q.terrain,Pe=Y.style;let Ve=[];const We=Fl(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Te("terrain",D,`object expected, ${We} found`)]),Ve;for(const pt in D)Ve=Ve.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return Ve}function Bf(Y){let D=[];const Q=Y.value,me=Y.key;if(Array.isArray(Q)){const Pe=[],Ve=[];for(const We in Q)Q[We].id&&Pe.includes(Q[We].id)&&D.push(new Te(me,Q,`all the sprites' ids must be unique, but ${Q[We].id} is duplicated`)),Pe.push(Q[We].id),Q[We].url&&Ve.includes(Q[We].url)&&D.push(new Te(me,Q,`all the sprites' URLs must be unique, but ${Q[We].url} is duplicated`)),Ve.push(Q[We].url),D=D.concat(tf({key:`${me}[${We}]`,value:Q[We],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:Y.validateSpec}));return D}return Hc({key:me,value:Q})}const hf={"*":()=>[],array:zh,boolean:function(Y){const D=Y.value,Q=Y.key,me=Fl(D);return me!=="boolean"?[new Te(Q,D,`boolean expected, ${me} found`)]:[]},number:au,color:function(Y){const D=Y.key,Q=Y.value,me=Fl(Q);return me!=="string"?[new Te(D,Q,`color expected, ${me} found`)]:sr.parse(String(Q))?[]:[new Te(D,Q,`color expected, "${Q}" found`)]},constants:Qf,enum:Vc,filter:lh,function:sh,layer:Gh,object:tf,source:ff,light:xu,sky:yc,terrain:fu,projection:function(Y){const D=Y.value,Q=Y.styleSpec,me=Q.projection,Pe=Y.style,Ve=Fl(D);if(D===void 0)return[];if(Ve!=="object")return[new Te("projection",D,`object expected, ${Ve} found`)];let We=[];for(const pt in D)We=We.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return We},string:Hc,formatted:function(Y){return Hc(Y).length===0?[]:Ff(Y)},resolvedImage:function(Y){return Hc(Y).length===0?[]:Ff(Y)},padding:function(Y){const D=Y.key,Q=Y.value;if(Fl(Q)==="array"){if(Q.length<1||Q.length>4)return[new Te(D,Q,`padding requires 1 to 4 values; ${Q.length} values found`)];const me={type:"number"};let Pe=[];for(let Ve=0;Ve[]}})),Y.constants&&(Q=Q.concat(Qf({key:"constants",value:Y.constants}))),rn(Q)}function vn(Y){return function(D){return Y(So(fo({},D),{validateSpec:Oh}))}}function rn(Y){return[].concat(Y).sort((D,Q)=>D.line-Q.line)}function On(Y){return function(...D){return rn(Y.apply(this,D))}}Pr.source=On(vn(ff)),Pr.sprite=On(vn(Bf)),Pr.glyphs=On(vn(ur)),Pr.light=On(vn(xu)),Pr.sky=On(vn(yc)),Pr.terrain=On(vn(fu)),Pr.layer=On(vn(Gh)),Pr.filter=On(vn(lh)),Pr.paintProperty=On(vn(Tv)),Pr.layoutProperty=On(vn(oc));const Ta=Pr,ya=Ta.light,ei=Ta.sky,si=Ta.paintProperty,Bi=Ta.layoutProperty;function Va(Y,D){let Q=!1;if(D&&D.length)for(const me of D)Y.fire(new H(new Error(me.message))),Q=!0;return Q}class _i{constructor(D,Q,me){const Pe=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const We=new Int32Array(this.arrayBuffer);D=We[0],this.d=(Q=We[1])+2*(me=We[2]);for(let Rt=0;Rt=xr[hn+0]&&Pe>=xr[hn+1])?(pt[$r]=!0,We.push(dr[$r])):pt[$r]=!1}}}}_forEachCell(D,Q,me,Pe,Ve,We,pt,Rt){const Yt=this._convertToCellCoord(D),dr=this._convertToCellCoord(Q),xr=this._convertToCellCoord(me),qr=this._convertToCellCoord(Pe);for(let $r=Yt;$r<=xr;$r++)for(let hn=dr;hn<=qr;hn++){const An=this.d*hn+$r;if((!Rt||Rt(this._convertFromCellCoord($r),this._convertFromCellCoord(hn),this._convertFromCellCoord($r+1),this._convertFromCellCoord(hn+1)))&&Ve.call(this,D,Q,me,Pe,An,We,pt,Rt))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;const D=this.cells,Q=3+this.cells.length+1+1;let me=0;for(let We=0;We=0)continue;const We=Y[Ve];Pe[Ve]=Ja[Q].shallow.indexOf(Ve)>=0?We:Go(We,D)}Y instanceof Error&&(Pe.message=Y.message)}if(Pe.$name)throw new Error("$name property is reserved for worker serialization logic.");return Q!=="Object"&&(Pe.$name=Q),Pe}function jo(Y){if(Ro(Y))return Y;if(Array.isArray(Y))return Y.map(jo);if(typeof Y!="object")throw new Error("can't deserialize object of type "+typeof Y);const D=No(Y)||"Object";if(!Ja[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:Q}=Ja[D];if(!Q)throw new Error(`can't deserialize unregistered class ${D}`);if(Q.deserialize)return Q.deserialize(Y);const me=Object.create(Q.prototype);for(const Pe of Object.keys(Y)){if(Pe==="$name")continue;const Ve=Y[Pe];me[Pe]=Ja[D].shallow.indexOf(Pe)>=0?Ve:jo(Ve)}return me}class Yi{constructor(){this.first=!0}update(D,Q){const me=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=me,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=me,!0):(this.lastFloorZoom>me?(this.lastIntegerZoom=me+1,this.lastIntegerZoomTime=Q):this.lastFloorZoomY>=128&&Y<=255,"Hangul Jamo":Y=>Y>=4352&&Y<=4607,Khmer:Y=>Y>=6016&&Y<=6143,"General Punctuation":Y=>Y>=8192&&Y<=8303,"Letterlike Symbols":Y=>Y>=8448&&Y<=8527,"Number Forms":Y=>Y>=8528&&Y<=8591,"Miscellaneous Technical":Y=>Y>=8960&&Y<=9215,"Control Pictures":Y=>Y>=9216&&Y<=9279,"Optical Character Recognition":Y=>Y>=9280&&Y<=9311,"Enclosed Alphanumerics":Y=>Y>=9312&&Y<=9471,"Geometric Shapes":Y=>Y>=9632&&Y<=9727,"Miscellaneous Symbols":Y=>Y>=9728&&Y<=9983,"Miscellaneous Symbols and Arrows":Y=>Y>=11008&&Y<=11263,"Ideographic Description Characters":Y=>Y>=12272&&Y<=12287,"CJK Symbols and Punctuation":Y=>Y>=12288&&Y<=12351,Katakana:Y=>Y>=12448&&Y<=12543,Kanbun:Y=>Y>=12688&&Y<=12703,"CJK Strokes":Y=>Y>=12736&&Y<=12783,"Enclosed CJK Letters and Months":Y=>Y>=12800&&Y<=13055,"CJK Compatibility":Y=>Y>=13056&&Y<=13311,"Yijing Hexagram Symbols":Y=>Y>=19904&&Y<=19967,"Private Use Area":Y=>Y>=57344&&Y<=63743,"Vertical Forms":Y=>Y>=65040&&Y<=65055,"CJK Compatibility Forms":Y=>Y>=65072&&Y<=65103,"Small Form Variants":Y=>Y>=65104&&Y<=65135,"Halfwidth and Fullwidth Forms":Y=>Y>=65280&&Y<=65519};function ns(Y){for(const D of Y)if(el(D.charCodeAt(0)))return!0;return!1}function Fs(Y){for(const D of Y)if(!Sl(D.charCodeAt(0)))return!1;return!0}function wl(Y){const D=Y.map(Q=>{try{return new RegExp(`\\p{sc=${Q}}`,"u").source}catch{return null}}).filter(Q=>Q);return new RegExp(D.join("|"),"u")}const Hl=wl(["Arab","Dupl","Mong","Ougr","Syrc"]);function Sl(Y){return!Hl.test(String.fromCodePoint(Y))}const Gl=wl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function el(Y){return!(Y!==746&&Y!==747&&(Y<4352||!(ki["CJK Compatibility Forms"](Y)&&!(Y>=65097&&Y<=65103)||ki["CJK Compatibility"](Y)||ki["CJK Strokes"](Y)||!(!ki["CJK Symbols and Punctuation"](Y)||Y>=12296&&Y<=12305||Y>=12308&&Y<=12319||Y===12336)||ki["Enclosed CJK Letters and Months"](Y)||ki["Ideographic Description Characters"](Y)||ki.Kanbun(Y)||ki.Katakana(Y)&&Y!==12540||!(!ki["Halfwidth and Fullwidth Forms"](Y)||Y===65288||Y===65289||Y===65293||Y>=65306&&Y<=65310||Y===65339||Y===65341||Y===65343||Y>=65371&&Y<=65503||Y===65507||Y>=65512&&Y<=65519)||!(!ki["Small Form Variants"](Y)||Y>=65112&&Y<=65118||Y>=65123&&Y<=65126)||ki["Vertical Forms"](Y)||ki["Yijing Hexagram Symbols"](Y)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(Y))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(Y))||Gl.test(String.fromCodePoint(Y)))))}function Su(Y){return!(el(Y)||(function(D){return!!(ki["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||ki["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)||ki["Letterlike Symbols"](D)||ki["Number Forms"](D)||ki["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)||ki["Control Pictures"](D)&&D!==9251||ki["Optical Character Recognition"](D)||ki["Enclosed Alphanumerics"](D)||ki["Geometric Shapes"](D)||ki["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||ki["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||ki["CJK Symbols and Punctuation"](D)||ki.Katakana(D)||ki["Private Use Area"](D)||ki["CJK Compatibility Forms"](D)||ki["Small Form Variants"](D)||ki["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)})(Y))}const bu=wl(["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 Ul(Y){return bu.test(String.fromCodePoint(Y))}function po(Y,D){return!(!D&&Ul(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||ki.Khmer(Y))}function gs(Y){for(const D of Y)if(Ul(D.charCodeAt(0)))return!0;return!1}const Il=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Y){this.pluginStatus=Y.pluginStatus,this.pluginURL=Y.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Y){this.applyArabicShaping=Y.applyArabicShaping,this.processBidirectionalText=Y.processBidirectionalText,this.processStyledBidirectionalText=Y.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class dl{constructor(D,Q){this.zoom=D,Q?(this.now=Q.now,this.fadeDuration=Q.fadeDuration,this.zoomHistory=Q.zoomHistory,this.transition=Q.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yi,this.transition={})}isSupportedScript(D){return(function(Q,me){for(const Pe of Q)if(!po(Pe.charCodeAt(0),me))return!1;return!0})(D,Il.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,Q=D-Math.floor(D),me=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:Q+(1-Q)*me}:{fromScale:.5,toScale:1,t:1-(1-me)*Q}}}class vc{constructor(D,Q){this.property=D,this.value=Q,this.expression=(function(me,Pe){if(yh(me))return new lu(me,Pe);if(zf(me)){const Ve=Rc(me,Pe);if(Ve.result==="error")throw new Error(Ve.value.map(We=>`${We.key}: ${We.message}`).join(", "));return Ve.value}{let Ve=me;return Pe.type==="color"&&typeof me=="string"?Ve=sr.parse(me):Pe.type!=="padding"||typeof me!="number"&&!Array.isArray(me)?Pe.type==="variableAnchorOffsetCollection"&&Array.isArray(me)&&(Ve=da.parse(me)):Ve=wn.parse(me),{kind:"constant",evaluate:()=>Ve}}})(Q===void 0?D.specification.default:Q,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,Q,me){return this.property.possiblyEvaluate(this,D,Q,me)}}class dc{constructor(D){this.property=D,this.value=new vc(D,void 0)}transitioned(D,Q){return new Hf(this.property,this.value,Q,M({},D.transition,this.transition),D.now)}untransitioned(){return new Hf(this.property,this.value,null,{},0)}}class _c{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new dc(this._values[D].property)),this._values[D].value=new vc(this._values[D].property,Q===null?void 0:u(Q))}getTransition(D){return u(this._values[D].transition)}setTransition(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new dc(this._values[D].property)),this._values[D].transition=u(Q)||void 0}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me);const Pe=this.getTransition(Q);Pe!==void 0&&(D[`${Q}-transition`]=Pe)}return D}transitioned(D,Q){const me=new pc(this._properties);for(const Pe of Object.keys(this._values))me._values[Pe]=this._values[Pe].transitioned(D,Q._values[Pe]);return me}untransitioned(){const D=new pc(this._properties);for(const Q of Object.keys(this._values))D._values[Q]=this._values[Q].untransitioned();return D}}class Hf{constructor(D,Q,me,Pe,Ve){this.property=D,this.value=Q,this.begin=Ve+Pe.delay||0,this.end=this.begin+Pe.duration||0,D.specification.transition&&(Pe.delay||Pe.duration)&&(this.prior=me)}possiblyEvaluate(D,Q,me){const Pe=D.now||0,Ve=this.value.possiblyEvaluate(D,Q,me),We=this.prior;if(We){if(Pe>this.end)return this.prior=null,Ve;if(this.value.isDataDriven())return this.prior=null,Ve;if(Pe=1)return 1;const Yt=Rt*Rt,dr=Yt*Rt;return 4*(Rt<.5?dr:3*(Rt-Yt)+dr-.75)})(pt))}}return Ve}}class pc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,Q,me){const Pe=new Sf(this._properties);for(const Ve of Object.keys(this._values))Pe._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Pe}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Af{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,Q){this._values[D]=new vc(this._values[D].property,Q===null?void 0:u(Q))}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me)}return D}possiblyEvaluate(D,Q,me){const Pe=new Sf(this._properties);for(const Ve of Object.keys(this._values))Pe._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Pe}}class Mu{constructor(D,Q,me){this.property=D,this.value=Q,this.parameters=me}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,Q,me,Pe){return this.property.evaluate(this.value,this.parameters,D,Q,me,Pe)}}class Sf{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Xo{constructor(D){this.specification=D}possiblyEvaluate(D,Q){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(Q)}interpolate(D,Q,me){const Pe=bo[this.specification.type];return Pe?Pe(D,Q,me):D}}class as{constructor(D,Q){this.specification=D,this.overrides=Q}possiblyEvaluate(D,Q,me,Pe){return new Mu(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(Q,null,{},me,Pe)}:D.expression,Q)}interpolate(D,Q,me){if(D.value.kind!=="constant"||Q.value.kind!=="constant")return D;if(D.value.value===void 0||Q.value.value===void 0)return new Mu(this,{kind:"constant",value:void 0},D.parameters);const Pe=bo[this.specification.type];if(Pe){const Ve=Pe(D.value.value,Q.value.value,me);return new Mu(this,{kind:"constant",value:Ve},D.parameters)}return D}evaluate(D,Q,me,Pe,Ve,We){return D.kind==="constant"?D.value:D.evaluate(Q,me,Pe,Ve,We)}}class Mf extends as{possiblyEvaluate(D,Q,me,Pe){if(D.value===void 0)return new Mu(this,{kind:"constant",value:void 0},Q);if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Pe),We=D.property.specification.type==="resolvedImage"&&typeof Ve!="string"?Ve.name:Ve,pt=this._calculate(We,We,We,Q);return new Mu(this,{kind:"constant",value:pt},Q)}if(D.expression.kind==="camera"){const Ve=this._calculate(D.expression.evaluate({zoom:Q.zoom-1}),D.expression.evaluate({zoom:Q.zoom}),D.expression.evaluate({zoom:Q.zoom+1}),Q);return new Mu(this,{kind:"constant",value:Ve},Q)}return new Mu(this,D.expression,Q)}evaluate(D,Q,me,Pe,Ve,We){if(D.kind==="source"){const pt=D.evaluate(Q,me,Pe,Ve,We);return this._calculate(pt,pt,pt,Q)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(Q.zoom)-1},me,Pe),D.evaluate({zoom:Math.floor(Q.zoom)},me,Pe),D.evaluate({zoom:Math.floor(Q.zoom)+1},me,Pe),Q):D.value}_calculate(D,Q,me,Pe){return Pe.zoom>Pe.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class Gc{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Pe){if(D.value!==void 0){if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Pe);return this._calculate(Ve,Ve,Ve,Q)}return this._calculate(D.expression.evaluate(new dl(Math.floor(Q.zoom-1),Q)),D.expression.evaluate(new dl(Math.floor(Q.zoom),Q)),D.expression.evaluate(new dl(Math.floor(Q.zoom+1),Q)),Q)}}_calculate(D,Q,me,Pe){return Pe.zoom>Pe.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class Dc{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Pe){return!!D.expression.evaluate(Q,null,{},me,Pe)}interpolate(){return!1}}class Ue{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const Q in D){const me=D[Q];me.specification.overridable&&this.overridableProperties.push(Q);const Pe=this.defaultPropertyValues[Q]=new vc(me,void 0),Ve=this.defaultTransitionablePropertyValues[Q]=new dc(me);this.defaultTransitioningPropertyValues[Q]=Ve.untransitioned(),this.defaultPossiblyEvaluatedValues[Q]=Pe.possiblyEvaluate({})}}}Ba("DataDrivenProperty",as),Ba("DataConstantProperty",Xo),Ba("CrossFadedDataDrivenProperty",Mf),Ba("CrossFadedProperty",Gc),Ba("ColorRampProperty",Dc);const P="-transition";class oe extends ae{constructor(D,Q){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),Q.layout&&(this._unevaluatedLayout=new Af(Q.layout)),Q.paint)){this._transitionablePaint=new _c(Q.paint);for(const me in D.paint)this.setPaintProperty(me,D.paint[me],{validate:!1});for(const me in D.layout)this.setLayoutProperty(me,D.layout[me],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Sf(Q.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,Q,me={}){Q!=null&&this._validate(Bi,`layers.${this.id}.layout.${D}`,D,Q,me)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,Q):this.visibility=Q)}getPaintProperty(D){return D.endsWith(P)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,Q,me={}){if(Q!=null&&this._validate(si,`layers.${this.id}.paint.${D}`,D,Q,me))return!1;if(D.endsWith(P))return this._transitionablePaint.setTransition(D.slice(0,-11),Q||void 0),!1;{const Pe=this._transitionablePaint._values[D],Ve=Pe.property.specification["property-type"]==="cross-faded-data-driven",We=Pe.value.isDataDriven(),pt=Pe.value;this._transitionablePaint.setValue(D,Q),this._handleSpecialPaintPropertyUpdate(D);const Rt=this._transitionablePaint._values[D].value;return Rt.isDataDriven()||We||Ve||this._handleOverridablePaintPropertyUpdate(D,pt,Rt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,Q,me){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,Q){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,Q)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,Q)}serialize(){const 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),m(D,(Q,me)=>!(Q===void 0||me==="layout"&&!Object.keys(Q).length||me==="paint"&&!Object.keys(Q).length))}_validate(D,Q,me,Pe,Ve={}){return(!Ve||Ve.validate!==!1)&&Va(this,D.call(Ta,{key:Q,layerType:this.type,objectKey:me,value:Pe,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const Q=this.paint.get(D);if(Q instanceof Mu&&Yu(Q.property.specification)&&(Q.value.kind==="source"||Q.value.kind==="composite")&&Q.value.isStateDependent)return!0}return!1}}const Se={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ke{constructor(D,Q){this._structArray=D,this._pos1=Q*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Be{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,Q){return D._trim(),Q&&(D.isTransferred=!0,Q.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const Q=Object.create(this.prototype);return Q.arrayBuffer=D.arrayBuffer,Q.length=D.length,Q.capacity=D.arrayBuffer.byteLength/Q.bytesPerElement,Q._refreshViews(),Q}_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);const Q=this.uint8;this._refreshViews(),Q&&this.uint8.set(Q)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function gt(Y,D=1){let Q=0,me=0;return{members:Y.map(Pe=>{const Ve=Se[Pe.type].BYTES_PER_ELEMENT,We=Q=kt(Q,Math.max(D,Ve)),pt=Pe.components||1;return me=Math.max(me,Ve),Q+=Ve*pt,{name:Pe.name,type:Pe.type,components:pt,offset:We}}),size:kt(Q,Math.max(me,D)),alignment:D}}function kt(Y,D){return Math.ceil(Y/D)*D}class Gt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.int16[Pe+0]=Q,this.int16[Pe+1]=me,D}}Gt.prototype.bytesPerElement=4,Ba("StructArrayLayout2i4",Gt);class cr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.int16[Ve+0]=Q,this.int16[Ve+1]=me,this.int16[Ve+2]=Pe,D}}cr.prototype.bytesPerElement=6,Ba("StructArrayLayout3i6",cr);class Tr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Pe)}emplace(D,Q,me,Pe,Ve){const We=4*D;return this.int16[We+0]=Q,this.int16[We+1]=me,this.int16[We+2]=Pe,this.int16[We+3]=Ve,D}}Tr.prototype.bytesPerElement=8,Ba("StructArrayLayout4i8",Tr);class kr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Pe,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=pt,D}}kr.prototype.bytesPerElement=12,Ba("StructArrayLayout2i4i12",kr);class Qr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=4*D,Yt=8*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.uint8[Yt+4]=Pe,this.uint8[Yt+5]=Ve,this.uint8[Yt+6]=We,this.uint8[Yt+7]=pt,D}}Qr.prototype.bytesPerElement=8,Ba("StructArrayLayout2i4ub8",Qr);class yn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.float32[Pe+0]=Q,this.float32[Pe+1]=me,D}}yn.prototype.bytesPerElement=8,Ba("StructArrayLayout2f8",yn);class Ze extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){const xr=this.length;return this.resize(xr+1),this.emplace(xr,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr){const qr=10*D;return this.uint16[qr+0]=Q,this.uint16[qr+1]=me,this.uint16[qr+2]=Pe,this.uint16[qr+3]=Ve,this.uint16[qr+4]=We,this.uint16[qr+5]=pt,this.uint16[qr+6]=Rt,this.uint16[qr+7]=Yt,this.uint16[qr+8]=dr,this.uint16[qr+9]=xr,D}}Ze.prototype.bytesPerElement=20,Ba("StructArrayLayout10ui20",Ze);class et extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr){const $r=this.length;return this.resize($r+1),this.emplace($r,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r){const hn=12*D;return this.int16[hn+0]=Q,this.int16[hn+1]=me,this.int16[hn+2]=Pe,this.int16[hn+3]=Ve,this.uint16[hn+4]=We,this.uint16[hn+5]=pt,this.uint16[hn+6]=Rt,this.uint16[hn+7]=Yt,this.int16[hn+8]=dr,this.int16[hn+9]=xr,this.int16[hn+10]=qr,this.int16[hn+11]=$r,D}}et.prototype.bytesPerElement=24,Ba("StructArrayLayout4i4ui4i24",et);class ft extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.float32[Ve+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Pe,D}}ft.prototype.bytesPerElement=12,Ba("StructArrayLayout3f12",ft);class _t extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint32[1*D+0]=Q,D}}_t.prototype.bytesPerElement=4,Ba("StructArrayLayout1ul4",_t);class zt extends Be{_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,Q,me,Pe,Ve,We,pt,Rt,Yt){const dr=this.length;return this.resize(dr+1),this.emplace(dr,D,Q,me,Pe,Ve,We,pt,Rt,Yt)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){const xr=10*D,qr=5*D;return this.int16[xr+0]=Q,this.int16[xr+1]=me,this.int16[xr+2]=Pe,this.int16[xr+3]=Ve,this.int16[xr+4]=We,this.int16[xr+5]=pt,this.uint32[qr+3]=Rt,this.uint16[xr+8]=Yt,this.uint16[xr+9]=dr,D}}zt.prototype.bytesPerElement=20,Ba("StructArrayLayout6i1ul2ui20",zt);class Et extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Pe,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=pt,D}}Et.prototype.bytesPerElement=12,Ba("StructArrayLayout2i2i2i12",Et);class Ut extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve){const We=this.length;return this.resize(We+1),this.emplace(We,D,Q,me,Pe,Ve)}emplace(D,Q,me,Pe,Ve,We){const pt=4*D,Rt=8*D;return this.float32[pt+0]=Q,this.float32[pt+1]=me,this.float32[pt+2]=Pe,this.int16[Rt+6]=Ve,this.int16[Rt+7]=We,D}}Ut.prototype.bytesPerElement=16,Ba("StructArrayLayout2f1f2i16",Ut);class mr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=16*D,Yt=4*D,dr=8*D;return this.uint8[Rt+0]=Q,this.uint8[Rt+1]=me,this.float32[Yt+1]=Pe,this.float32[Yt+2]=Ve,this.int16[dr+6]=We,this.int16[dr+7]=pt,D}}mr.prototype.bytesPerElement=16,Ba("StructArrayLayout2ub2f2i16",mr);class wr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.uint16[Ve+0]=Q,this.uint16[Ve+1]=me,this.uint16[Ve+2]=Pe,D}}wr.prototype.bytesPerElement=6,Ba("StructArrayLayout3ui6",wr);class Lr extends Be{_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,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va){const ii=this.length;return this.resize(ii+1),this.emplace(ii,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va,ii){const Fa=24*D,Qa=12*D,Di=48*D;return this.int16[Fa+0]=Q,this.int16[Fa+1]=me,this.uint16[Fa+2]=Pe,this.uint16[Fa+3]=Ve,this.uint32[Qa+2]=We,this.uint32[Qa+3]=pt,this.uint32[Qa+4]=Rt,this.uint16[Fa+10]=Yt,this.uint16[Fa+11]=dr,this.uint16[Fa+12]=xr,this.float32[Qa+7]=qr,this.float32[Qa+8]=$r,this.uint8[Di+36]=hn,this.uint8[Di+37]=An,this.uint8[Di+38]=Bn,this.uint32[Qa+10]=va,this.int16[Fa+22]=ii,D}}Lr.prototype.bytesPerElement=48,Ba("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Lr);class Gr extends Be{_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,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va,ii,Fa,Qa,Di,lo,Ko,fl,is,Yo,Is,Ms){const bs=this.length;return this.resize(bs+1),this.emplace(bs,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va,ii,Fa,Qa,Di,lo,Ko,fl,is,Yo,Is,Ms)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An,Bn,va,ii,Fa,Qa,Di,lo,Ko,fl,is,Yo,Is,Ms,bs){const $i=32*D,Vs=16*D;return this.int16[$i+0]=Q,this.int16[$i+1]=me,this.int16[$i+2]=Pe,this.int16[$i+3]=Ve,this.int16[$i+4]=We,this.int16[$i+5]=pt,this.int16[$i+6]=Rt,this.int16[$i+7]=Yt,this.uint16[$i+8]=dr,this.uint16[$i+9]=xr,this.uint16[$i+10]=qr,this.uint16[$i+11]=$r,this.uint16[$i+12]=hn,this.uint16[$i+13]=An,this.uint16[$i+14]=Bn,this.uint16[$i+15]=va,this.uint16[$i+16]=ii,this.uint16[$i+17]=Fa,this.uint16[$i+18]=Qa,this.uint16[$i+19]=Di,this.uint16[$i+20]=lo,this.uint16[$i+21]=Ko,this.uint16[$i+22]=fl,this.uint32[Vs+12]=is,this.float32[Vs+13]=Yo,this.float32[Vs+14]=Is,this.uint16[$i+30]=Ms,this.uint16[$i+31]=bs,D}}Gr.prototype.bytesPerElement=64,Ba("StructArrayLayout8i15ui1ul2f2ui64",Gr);class an extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.float32[1*D+0]=Q,D}}an.prototype.bytesPerElement=4,Ba("StructArrayLayout1f4",an);class Mn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.uint16[6*D+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Pe,D}}Mn.prototype.bytesPerElement=12,Ba("StructArrayLayout1ui2f12",Mn);class Ln extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=4*D;return this.uint32[2*D+0]=Q,this.uint16[Ve+2]=me,this.uint16[Ve+3]=Pe,D}}Ln.prototype.bytesPerElement=8,Ba("StructArrayLayout1ul2ui8",Ln);class Gn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.uint16[Pe+0]=Q,this.uint16[Pe+1]=me,D}}Gn.prototype.bytesPerElement=4,Ba("StructArrayLayout2ui4",Gn);class ba extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint16[1*D+0]=Q,D}}ba.prototype.bytesPerElement=2,Ba("StructArrayLayout1ui2",ba);class ti extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Pe)}emplace(D,Q,me,Pe,Ve){const We=4*D;return this.float32[We+0]=Q,this.float32[We+1]=me,this.float32[We+2]=Pe,this.float32[We+3]=Ve,D}}ti.prototype.bytesPerElement=16,Ba("StructArrayLayout4f16",ti);class Za extends ke{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}Za.prototype.size=20;class ri extends zt{get(D){return new Za(this,D)}}Ba("CollisionBoxArray",ri);class Zi extends ke{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]}}Zi.prototype.size=48;class yo extends Lr{get(D){return new Zi(this,D)}}Ba("PlacedSymbolArray",yo);class co extends ke{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]}}co.prototype.size=64;class Wo extends Gr{get(D){return new co(this,D)}}Ba("SymbolInstanceArray",Wo);class Ks extends an{getoffsetX(D){return this.float32[1*D+0]}}Ba("GlyphOffsetArray",Ks);class $s extends cr{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Ba("SymbolLineVertexArray",$s);class ks extends ke{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]}}ks.prototype.size=12;class nl extends Mn{get(D){return new ks(this,D)}}Ba("TextAnchorOffsetArray",nl);class hu extends ke{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]}}hu.prototype.size=8;class eu extends Ln{get(D){return new hu(this,D)}}Ba("FeatureIndexArray",eu);class Cs extends Gt{}class Ls extends Gt{}class ku extends Gt{}class ac extends kr{}class zc extends Qr{}class ge extends yn{}class Oe extends Ze{}class tt extends et{}class xt extends ft{}class At extends _t{}class It extends Et{}class Qt extends mr{}class Jt extends wr{}class yr extends Gn{}const Xr=gt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hr}=Xr;class fn{constructor(D=[]){this.segments=D}prepareSegment(D,Q,me,Pe){let Ve=this.segments[this.segments.length-1];return D>fn.MAX_VERTEX_ARRAY_LENGTH&&y(`Max vertices per segment is ${fn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Ve||Ve.vertexLength+D>fn.MAX_VERTEX_ARRAY_LENGTH||Ve.sortKey!==Pe)&&(Ve={vertexOffset:Q.length,primitiveOffset:me.length,vertexLength:0,primitiveLength:0},Pe!==void 0&&(Ve.sortKey=Pe),this.segments.push(Ve)),Ve}get(){return this.segments}destroy(){for(const D of this.segments)for(const Q in D.vaos)D.vaos[Q].destroy()}static simpleSegment(D,Q,me,Pe){return new fn([{vertexOffset:D,primitiveOffset:Q,vertexLength:me,primitiveLength:Pe,vaos:{},sortKey:0}])}}function Sn(Y,D){return 256*(Y=x(Math.floor(Y),0,255))+x(Math.floor(D),0,255)}fn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ba("SegmentVector",fn);const kn=gt([{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 Ca={exports:{}},Dn={exports:{}};Dn.exports=function(Y,D){var Q,me,Pe,Ve,We,pt,Rt,Yt;for(me=Y.length-(Q=3&Y.length),Pe=D,We=3432918353,pt=461845907,Yt=0;Yt>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*pt+(((Rt>>>16)*pt&65535)<<16)&4294967295)<<13|Pe>>>19))+((5*(Pe>>>16)&65535)<<16)&4294967295))+((58964+(Ve>>>16)&65535)<<16);switch(Rt=0,Q){case 3:Rt^=(255&Y.charCodeAt(Yt+2))<<16;case 2:Rt^=(255&Y.charCodeAt(Yt+1))<<8;case 1:Pe^=Rt=(65535&(Rt=(Rt=(65535&(Rt^=255&Y.charCodeAt(Yt)))*We+(((Rt>>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*pt+(((Rt>>>16)*pt&65535)<<16)&4294967295}return Pe^=Y.length,Pe=2246822507*(65535&(Pe^=Pe>>>16))+((2246822507*(Pe>>>16)&65535)<<16)&4294967295,Pe=3266489909*(65535&(Pe^=Pe>>>13))+((3266489909*(Pe>>>16)&65535)<<16)&4294967295,(Pe^=Pe>>>16)>>>0};var Jn=Dn.exports,oa={exports:{}};oa.exports=function(Y,D){for(var Q,me=Y.length,Pe=D^me,Ve=0;me>=4;)Q=1540483477*(65535&(Q=255&Y.charCodeAt(Ve)|(255&Y.charCodeAt(++Ve))<<8|(255&Y.charCodeAt(++Ve))<<16|(255&Y.charCodeAt(++Ve))<<24))+((1540483477*(Q>>>16)&65535)<<16),Pe=1540483477*(65535&Pe)+((1540483477*(Pe>>>16)&65535)<<16)^(Q=1540483477*(65535&(Q^=Q>>>24))+((1540483477*(Q>>>16)&65535)<<16)),me-=4,++Ve;switch(me){case 3:Pe^=(255&Y.charCodeAt(Ve+2))<<16;case 2:Pe^=(255&Y.charCodeAt(Ve+1))<<8;case 1:Pe=1540483477*(65535&(Pe^=255&Y.charCodeAt(Ve)))+((1540483477*(Pe>>>16)&65535)<<16)}return Pe=1540483477*(65535&(Pe^=Pe>>>13))+((1540483477*(Pe>>>16)&65535)<<16),(Pe^=Pe>>>15)>>>0};var Aa=Jn,Pa=oa.exports;Ca.exports=Aa,Ca.exports.murmur3=Aa,Ca.exports.murmur2=Pa;var ia=r(Ca.exports);class ni{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,Q,me,Pe){this.ids.push(Xi(D)),this.positions.push(Q,me,Pe)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const Q=Xi(D);let me=0,Pe=this.ids.length-1;for(;me>1;this.ids[We]>=Q?Pe=We:me=We+1}const Ve=[];for(;this.ids[me]===Q;)Ve.push({index:this.positions[3*me],start:this.positions[3*me+1],end:this.positions[3*me+2]}),me++;return Ve}static serialize(D,Q){const me=new Float64Array(D.ids),Pe=new Uint32Array(D.positions);return Ri(me,Pe,0,me.length-1),Q&&Q.push(me.buffer,Pe.buffer),{ids:me,positions:Pe}}static deserialize(D){const Q=new ni;return Q.ids=D.ids,Q.positions=D.positions,Q.indexed=!0,Q}}function Xi(Y){const D=+Y;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:ia(String(Y))}function Ri(Y,D,Q,me){for(;Q>1];let Ve=Q-1,We=me+1;for(;;){do Ve++;while(Y[Ve]Pe);if(Ve>=We)break;Vi(Y,Ve,We),Vi(D,3*Ve,3*We),Vi(D,3*Ve+1,3*We+1),Vi(D,3*Ve+2,3*We+2)}We-Q`u_${Pe}`),this.type=me}setUniform(D,Q,me){D.set(me.constantOr(this.value))}getBinding(D,Q,me){return this.type==="color"?new Co(D,Q):new To(D,Q)}}class Kl{constructor(D,Q){this.uniformNames=Q.map(me=>`u_${me}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,Q){this.pixelRatioFrom=Q.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=Q.tlbr,this.patternTo=D.tlbr}setUniform(D,Q,me,Pe){const Ve=Pe==="u_pattern_to"?this.patternTo:Pe==="u_pattern_from"?this.patternFrom:Pe==="u_pixel_ratio_to"?this.pixelRatioTo:Pe==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ve&&D.set(Ve)}getBinding(D,Q,me){return me.substr(0,9)==="u_pattern"?new Zs(D,Q):new To(D,Q)}}class oo{constructor(D,Q,me,Pe){this.expression=D,this.type=me,this.maxValue=0,this.paintVertexAttributes=Q.map(Ve=>({name:`a_${Ve}`,type:"Float32",components:me==="color"?2:1,offset:0})),this.paintVertexArray=new Pe}populatePaintArray(D,Q,me,Pe,Ve){const We=this.paintVertexArray.length,pt=this.expression.evaluate(new dl(0),Q,{},Pe,[],Ve);this.paintVertexArray.resize(D),this._setPaintValue(We,D,pt)}updatePaintArray(D,Q,me,Pe){const Ve=this.expression.evaluate({zoom:0},me,Pe);this._setPaintValue(D,Q,Ve)}_setPaintValue(D,Q,me){if(this.type==="color"){const Pe=tl(me);for(let Ve=D;Ve`u_${pt}_t`),this.type=me,this.useIntegerZoom=Pe,this.zoom=Ve,this.maxValue=0,this.paintVertexAttributes=Q.map(pt=>({name:`a_${pt}`,type:"Float32",components:me==="color"?4:2,offset:0})),this.paintVertexArray=new We}populatePaintArray(D,Q,me,Pe,Ve){const We=this.expression.evaluate(new dl(this.zoom),Q,{},Pe,[],Ve),pt=this.expression.evaluate(new dl(this.zoom+1),Q,{},Pe,[],Ve),Rt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Rt,D,We,pt)}updatePaintArray(D,Q,me,Pe){const Ve=this.expression.evaluate({zoom:this.zoom},me,Pe),We=this.expression.evaluate({zoom:this.zoom+1},me,Pe);this._setPaintValue(D,Q,Ve,We)}_setPaintValue(D,Q,me,Pe){if(this.type==="color"){const Ve=tl(me),We=tl(Pe);for(let pt=D;pt`#define HAS_UNIFORM_${Pe}`))}return D}getBinderAttributes(){const D=[];for(const Q in this.binders){const me=this.binders[Q];if(me instanceof oo||me instanceof Ps)for(let Pe=0;Pe!0){this.programConfigurations={};for(const Pe of D)this.programConfigurations[Pe.id]=new Xl(Pe,Q,me);this.needsUpload=!1,this._featureMap=new ni,this._bufferOffset=0}populatePaintArrays(D,Q,me,Pe,Ve,We){for(const pt in this.programConfigurations)this.programConfigurations[pt].populatePaintArrays(D,Q,Pe,Ve,We);Q.id!==void 0&&this._featureMap.add(Q.id,me,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,Q,me,Pe){for(const Ve of me)this.needsUpload=this.programConfigurations[Ve.id].updatePaintArrays(D,this._featureMap,Q,Ve,Pe)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const Q in this.programConfigurations)this.programConfigurations[Q].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function xc(Y,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"]}[Y]||[Y.replace(`${D}-`,"").replace(/-/g,"_")]}function Ml(Y,D,Q){const me={color:{source:yn,composite:ti},number:{source:an,composite:yn}},Pe=(function(Ve){return{"line-pattern":{source:Oe,composite:Oe},"fill-pattern":{source:Oe,composite:Oe},"fill-extrusion-pattern":{source:Oe,composite:Oe}}[Ve]})(Y);return Pe&&Pe[Q]||me[D][Q]}Ba("ConstantBinder",Cu),Ba("CrossFadedConstantBinder",Kl),Ba("SourceExpressionBinder",oo),Ba("CrossFadedCompositeBinder",Js),Ba("CompositeExpressionBinder",Ps),Ba("ProgramConfiguration",Xl,{omit:["_buffers"]}),Ba("ProgramConfigurationSet",Dl);const Yl=8192,Xc=Math.pow(2,14)-1,Eu=-Xc-1;function dt(Y){const D=Yl/Y.extent,Q=Y.loadGeometry();for(let me=0;meWe.x+1||RtWe.y+1)&&y("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return Q}function gr(Y,D){return{type:Y.type,id:Y.id,properties:Y.properties,geometry:D?dt(Y):[]}}function br(Y,D,Q,me,Pe){Y.emplaceBack(2*D+(me+1)/2,2*Q+(Pe+1)/2)}class Cn{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Ls,this.indexArray=new Jt,this.segments=new fn,this.programConfigurations=new Dl(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){const Pe=this.layers[0],Ve=[];let We=null,pt=!1;Pe.type==="circle"&&(We=Pe.layout.get("circle-sort-key"),pt=!We.isConstant());for(const{feature:Rt,id:Yt,index:dr,sourceLayerIndex:xr}of D){const qr=this.layers[0]._featureFilter.needGeometry,$r=gr(Rt,qr);if(!this.layers[0]._featureFilter.filter(new dl(this.zoom),$r,me))continue;const hn=pt?We.evaluate($r,{},me):void 0,An={id:Yt,properties:Rt.properties,type:Rt.type,sourceLayerIndex:xr,index:dr,geometry:qr?$r.geometry:dt(Rt),patterns:{},sortKey:hn};Ve.push(An)}pt&&Ve.sort((Rt,Yt)=>Rt.sortKey-Yt.sortKey);for(const Rt of Ve){const{geometry:Yt,index:dr,sourceLayerIndex:xr}=Rt,qr=D[dr].feature;this.addFeature(Rt,Yt,dr,me),Q.featureIndex.insert(qr,Yt,dr,xr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Hr),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,Q,me,Pe){for(const Ve of Q)for(const We of Ve){const pt=We.x,Rt=We.y;if(pt<0||pt>=Yl||Rt<0||Rt>=Yl)continue;const Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),dr=Yt.vertexLength;br(this.layoutVertexArray,pt,Rt,-1,-1),br(this.layoutVertexArray,pt,Rt,1,-1),br(this.layoutVertexArray,pt,Rt,1,1),br(this.layoutVertexArray,pt,Rt,-1,1),this.indexArray.emplaceBack(dr,dr+1,dr+2),this.indexArray.emplaceBack(dr,dr+3,dr+2),Yt.vertexLength+=4,Yt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,{},Pe)}}function ua(Y,D){for(let Q=0;Q1){if(Ra(Y,D))return!0;for(let me=0;me1?Q:Q.sub(D)._mult(Pe)._add(D))}function pi(Y,D){let Q,me,Pe,Ve=!1;for(let We=0;WeD.y!=Pe.y>D.y&&D.x<(Pe.x-me.x)*(D.y-me.y)/(Pe.y-me.y)+me.x&&(Ve=!Ve)}return Ve}function Ha(Y,D){let Q=!1;for(let me=0,Pe=Y.length-1;meD.y!=We.y>D.y&&D.x<(We.x-Ve.x)*(D.y-Ve.y)/(We.y-Ve.y)+Ve.x&&(Q=!Q)}return Q}function pa(Y,D,Q){const me=Q[0],Pe=Q[2];if(Y.xPe.x&&D.x>Pe.x||Y.yPe.y&&D.y>Pe.y)return!1;const Ve=I(Y,D,Q[0]);return Ve!==I(Y,D,Q[1])||Ve!==I(Y,D,Q[2])||Ve!==I(Y,D,Q[3])}function tn(Y,D,Q){const me=D.paint.get(Y).value;return me.kind==="constant"?me.value:Q.programConfigurations.get(D.id).getMaxValue(Y)}function Fn(Y){return Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])}function ea(Y,D,Q,me,Pe){if(!D[0]&&!D[1])return Y;const Ve=i.convert(D)._mult(Pe);Q==="viewport"&&Ve._rotate(-me);const We=[];for(let pt=0;ptIi(Bn,An))})(Yt,Rt),$r=xr?dr*pt:dr;for(const hn of Pe)for(const An of hn){const Bn=xr?An:Ii(An,Rt);let va=$r;const ii=Wa([],[An.x,An.y,0,1],Rt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?va*=ii[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(va*=We.cameraToCenterDistance/ii[3]),mn(qr,Bn,va))return!0}return!1}}function Ii(Y,D){const Q=Wa([],[Y.x,Y.y,0,1],D);return new i(Q[0]/Q[3],Q[1]/Q[3])}class Eo extends Cn{}let mi;Ba("HeatmapBucket",Eo,{omit:["layers"]});var Ui={get paint(){return mi=mi||new Ue({"heatmap-radius":new as(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new as(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xo(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Dc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xo(ie.paint_heatmap["heatmap-opacity"])})}};function Xa(Y,{width:D,height:Q},me,Pe){if(Pe){if(Pe instanceof Uint8ClampedArray)Pe=new Uint8Array(Pe.buffer);else if(Pe.length!==D*Q*me)throw new RangeError(`mismatched image size. expected: ${Pe.length} but got: ${D*Q*me}`)}else Pe=new Uint8Array(D*Q*me);return Y.width=D,Y.height=Q,Y.data=Pe,Y}function xo(Y,{width:D,height:Q},me){if(D===Y.width&&Q===Y.height)return;const Pe=Xa({},{width:D,height:Q},me);qo(Y,Pe,{x:0,y:0},{x:0,y:0},{width:Math.min(Y.width,D),height:Math.min(Y.height,Q)},me),Y.width=D,Y.height=Q,Y.data=Pe.data}function qo(Y,D,Q,me,Pe,Ve){if(Pe.width===0||Pe.height===0)return D;if(Pe.width>Y.width||Pe.height>Y.height||Q.x>Y.width-Pe.width||Q.y>Y.height-Pe.height)throw new RangeError("out of range source coordinates for image copy");if(Pe.width>D.width||Pe.height>D.height||me.x>D.width-Pe.width||me.y>D.height-Pe.height)throw new RangeError("out of range destination coordinates for image copy");const We=Y.data,pt=D.data;if(We===pt)throw new Error("srcData equals dstData, so image is already copied");for(let Rt=0;Rt{D[Y.evaluationKey]=Rt;const Yt=Y.expression.evaluate(D);Pe.data[We+pt+0]=Math.floor(255*Yt.r/Yt.a),Pe.data[We+pt+1]=Math.floor(255*Yt.g/Yt.a),Pe.data[We+pt+2]=Math.floor(255*Yt.b/Yt.a),Pe.data[We+pt+3]=Math.floor(255*Yt.a)};if(Y.clips)for(let We=0,pt=0;We80*Q){pt=1/0,Rt=1/0;let dr=-1/0,xr=-1/0;for(let qr=Q;qrdr&&(dr=$r),hn>xr&&(xr=hn)}Yt=Math.max(dr-pt,xr-Rt),Yt=Yt!==0?32767/Yt:0}return Us(Ve,We,Q,pt,Rt,Yt,0),We}function uo(Y,D,Q,me,Pe){let Ve;if(Pe===(function(We,pt,Rt,Yt){let dr=0;for(let xr=pt,qr=Rt-Yt;xr0)for(let We=D;We=D;We-=me)Ve=Vt(We/me|0,Y[We],Y[We+1],Ve);return Ve&<(Ve,Ve.next)&&(Kt(Ve),Ve=Ve.next),Ve}function Wu(Y,D){if(!Y)return Y;D||(D=Y);let Q,me=Y;do if(Q=!1,me.steiner||!lt(me,me.next)&&qe(me.prev,me,me.next)!==0)me=me.next;else{if(Kt(me),me=D=me.prev,me===me.next)break;Q=!0}while(Q||me!==D);return D}function Us(Y,D,Q,me,Pe,Ve,We){if(!Y)return;!We&&Ve&&(function(Rt,Yt,dr,xr){let qr=Rt;do qr.z===0&&(qr.z=q(qr.x,qr.y,Yt,dr,xr)),qr.prevZ=qr.prev,qr.nextZ=qr.next,qr=qr.next;while(qr!==Rt);qr.prevZ.nextZ=null,qr.prevZ=null,(function($r){let hn,An=1;do{let Bn,va=$r;$r=null;let ii=null;for(hn=0;va;){hn++;let Fa=va,Qa=0;for(let lo=0;lo0||Di>0&&Fa;)Qa!==0&&(Di===0||!Fa||va.z<=Fa.z)?(Bn=va,va=va.nextZ,Qa--):(Bn=Fa,Fa=Fa.nextZ,Di--),ii?ii.nextZ=Bn:$r=Bn,Bn.prevZ=ii,ii=Bn;va=Fa}ii.nextZ=null,An*=2}while(hn>1)})(qr)})(Y,me,Pe,Ve);let pt=Y;for(;Y.prev!==Y.next;){const Rt=Y.prev,Yt=Y.next;if(Ve?sc(Y,me,Pe,Ve):zl(Y))D.push(Rt.i,Y.i,Yt.i),Kt(Y),Y=Yt.next,pt=Yt.next;else if((Y=Yt)===pt){We?We===1?Us(Y=lc(Wu(Y),D),D,Q,me,Pe,Ve,2):We===2&&Ao(Y,D,Q,me,Pe,Ve):Us(Wu(Y),D,Q,me,Pe,Ve,1);break}}}function zl(Y){const D=Y.prev,Q=Y,me=Y.next;if(qe(D,Q,me)>=0)return!1;const Pe=D.x,Ve=Q.x,We=me.x,pt=D.y,Rt=Q.y,Yt=me.y,dr=PeVe?Pe>We?Pe:We:Ve>We?Ve:We,$r=pt>Rt?pt>Yt?pt:Yt:Rt>Yt?Rt:Yt;let hn=me.next;for(;hn!==D;){if(hn.x>=dr&&hn.x<=qr&&hn.y>=xr&&hn.y<=$r&&J(Pe,pt,Ve,Rt,We,Yt,hn.x,hn.y)&&qe(hn.prev,hn,hn.next)>=0)return!1;hn=hn.next}return!0}function sc(Y,D,Q,me){const Pe=Y.prev,Ve=Y,We=Y.next;if(qe(Pe,Ve,We)>=0)return!1;const pt=Pe.x,Rt=Ve.x,Yt=We.x,dr=Pe.y,xr=Ve.y,qr=We.y,$r=ptRt?pt>Yt?pt:Yt:Rt>Yt?Rt:Yt,Bn=dr>xr?dr>qr?dr:qr:xr>qr?xr:qr,va=q($r,hn,D,Q,me),ii=q(An,Bn,D,Q,me);let Fa=Y.prevZ,Qa=Y.nextZ;for(;Fa&&Fa.z>=va&&Qa&&Qa.z<=ii;){if(Fa.x>=$r&&Fa.x<=An&&Fa.y>=hn&&Fa.y<=Bn&&Fa!==Pe&&Fa!==We&&J(pt,dr,Rt,xr,Yt,qr,Fa.x,Fa.y)&&qe(Fa.prev,Fa,Fa.next)>=0||(Fa=Fa.prevZ,Qa.x>=$r&&Qa.x<=An&&Qa.y>=hn&&Qa.y<=Bn&&Qa!==Pe&&Qa!==We&&J(pt,dr,Rt,xr,Yt,qr,Qa.x,Qa.y)&&qe(Qa.prev,Qa,Qa.next)>=0))return!1;Qa=Qa.nextZ}for(;Fa&&Fa.z>=va;){if(Fa.x>=$r&&Fa.x<=An&&Fa.y>=hn&&Fa.y<=Bn&&Fa!==Pe&&Fa!==We&&J(pt,dr,Rt,xr,Yt,qr,Fa.x,Fa.y)&&qe(Fa.prev,Fa,Fa.next)>=0)return!1;Fa=Fa.prevZ}for(;Qa&&Qa.z<=ii;){if(Qa.x>=$r&&Qa.x<=An&&Qa.y>=hn&&Qa.y<=Bn&&Qa!==Pe&&Qa!==We&&J(pt,dr,Rt,xr,Yt,qr,Qa.x,Qa.y)&&qe(Qa.prev,Qa,Qa.next)>=0)return!1;Qa=Qa.nextZ}return!0}function lc(Y,D){let Q=Y;do{const me=Q.prev,Pe=Q.next.next;!lt(me,Pe)&&vt(me,Q,Q.next,Pe)&&bt(me,Pe)&&bt(Pe,me)&&(D.push(me.i,Q.i,Pe.i),Kt(Q),Kt(Q.next),Q=Y=Pe),Q=Q.next}while(Q!==Y);return Wu(Q)}function Ao(Y,D,Q,me,Pe,Ve){let We=Y;do{let pt=We.next.next;for(;pt!==We.prev;){if(We.i!==pt.i&&_e(We,pt)){let Rt=Zt(We,pt);return We=Wu(We,We.next),Rt=Wu(Rt,Rt.next),Us(We,D,Q,me,Pe,Ve,0),void Us(Rt,D,Q,me,Pe,Ve,0)}pt=pt.next}We=We.next}while(We!==Y)}function vs(Y,D){return Y.x-D.x}function ys(Y,D){const Q=(function(Pe,Ve){let We=Ve;const pt=Pe.x,Rt=Pe.y;let Yt,dr=-1/0;do{if(Rt<=We.y&&Rt>=We.next.y&&We.next.y!==We.y){const An=We.x+(Rt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(An<=pt&&An>dr&&(dr=An,Yt=We.x=We.x&&We.x>=qr&&pt!==We.x&&J(Rt<$r?pt:dr,Rt,qr,$r,Rt<$r?dr:pt,Rt,We.x,We.y)){const An=Math.abs(Rt-We.y)/(pt-We.x);bt(We,Pe)&&(AnYt.x||We.x===Yt.x&&be(Yt,We)))&&(Yt=We,hn=An)}We=We.next}while(We!==xr);return Yt})(Y,D);if(!Q)return D;const me=Zt(Q,Y);return Wu(me,me.next),Wu(Q,Q.next)}function be(Y,D){return qe(Y.prev,Y,D.prev)<0&&qe(D.next,Y,Y.next)<0}function q(Y,D,Q,me,Pe){return(Y=1431655765&((Y=858993459&((Y=252645135&((Y=16711935&((Y=(Y-Q)*Pe|0)|Y<<8))|Y<<4))|Y<<2))|Y<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-me)*Pe|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function he(Y){let D=Y,Q=Y;do(D.x=(Y-We)*(Ve-pt)&&(Y-We)*(me-pt)>=(Q-We)*(D-pt)&&(Q-We)*(Ve-pt)>=(Pe-We)*(me-pt)}function _e(Y,D){return Y.next.i!==D.i&&Y.prev.i!==D.i&&!(function(Q,me){let Pe=Q;do{if(Pe.i!==Q.i&&Pe.next.i!==Q.i&&Pe.i!==me.i&&Pe.next.i!==me.i&&vt(Pe,Pe.next,Q,me))return!0;Pe=Pe.next}while(Pe!==Q);return!1})(Y,D)&&(bt(Y,D)&&bt(D,Y)&&(function(Q,me){let Pe=Q,Ve=!1;const We=(Q.x+me.x)/2,pt=(Q.y+me.y)/2;do Pe.y>pt!=Pe.next.y>pt&&Pe.next.y!==Pe.y&&We<(Pe.next.x-Pe.x)*(pt-Pe.y)/(Pe.next.y-Pe.y)+Pe.x&&(Ve=!Ve),Pe=Pe.next;while(Pe!==Q);return Ve})(Y,D)&&(qe(Y.prev,Y,D.prev)||qe(Y,D.prev,D))||lt(Y,D)&&qe(Y.prev,Y,Y.next)>0&&qe(D.prev,D,D.next)>0)}function qe(Y,D,Q){return(D.y-Y.y)*(Q.x-D.x)-(D.x-Y.x)*(Q.y-D.y)}function lt(Y,D){return Y.x===D.x&&Y.y===D.y}function vt(Y,D,Q,me){const Pe=at(qe(Y,D,Q)),Ve=at(qe(Y,D,me)),We=at(qe(Q,me,Y)),pt=at(qe(Q,me,D));return Pe!==Ve&&We!==pt||!(Pe!==0||!Ke(Y,Q,D))||!(Ve!==0||!Ke(Y,me,D))||!(We!==0||!Ke(Q,Y,me))||!(pt!==0||!Ke(Q,D,me))}function Ke(Y,D,Q){return D.x<=Math.max(Y.x,Q.x)&&D.x>=Math.min(Y.x,Q.x)&&D.y<=Math.max(Y.y,Q.y)&&D.y>=Math.min(Y.y,Q.y)}function at(Y){return Y>0?1:Y<0?-1:0}function bt(Y,D){return qe(Y.prev,Y,Y.next)<0?qe(Y,D,Y.next)>=0&&qe(Y,Y.prev,D)>=0:qe(Y,D,Y.prev)<0||qe(Y,Y.next,D)<0}function Zt(Y,D){const Q=nr(Y.i,Y.x,Y.y),me=nr(D.i,D.x,D.y),Pe=Y.next,Ve=D.prev;return Y.next=D,D.prev=Y,Q.next=Pe,Pe.prev=Q,me.next=Q,Q.prev=me,Ve.next=me,me.prev=Ve,me}function Vt(Y,D,Q,me){const Pe=nr(Y,D,Q);return me?(Pe.next=me.next,Pe.prev=me,me.next.prev=Pe,me.next=Pe):(Pe.prev=Pe,Pe.next=Pe),Pe}function Kt(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function nr(Y,D,Q){return{i:Y,x:D,y:Q,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function er(Y,D,Q){const me=Q.patternDependencies;let Pe=!1;for(const Ve of D){const We=Ve.paint.get(`${Y}-pattern`);We.isConstant()||(Pe=!0);const pt=We.constantOr(null);pt&&(Pe=!0,me[pt.to]=!0,me[pt.from]=!0)}return Pe}function Bt(Y,D,Q,me,Pe){const Ve=Pe.patternDependencies;for(const We of D){const pt=We.paint.get(`${Y}-pattern`).value;if(pt.kind!=="constant"){let Rt=pt.evaluate({zoom:me-1},Q,{},Pe.availableImages),Yt=pt.evaluate({zoom:me},Q,{},Pe.availableImages),dr=pt.evaluate({zoom:me+1},Q,{},Pe.availableImages);Rt=Rt&&Rt.name?Rt.name:Rt,Yt=Yt&&Yt.name?Yt.name:Yt,dr=dr&&dr.name?dr.name:dr,Ve[Rt]=!0,Ve[Yt]=!0,Ve[dr]=!0,Q.patterns[We.id]={min:Rt,mid:Yt,max:dr}}}return Q}class Xt{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ku,this.indexArray=new Jt,this.indexArray2=new yr,this.programConfigurations=new Dl(D.layers,D.zoom),this.segments=new fn,this.segments2=new fn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=er("fill",this.layers,Q);const Pe=this.layers[0].layout.get("fill-sort-key"),Ve=!Pe.isConstant(),We=[];for(const{feature:pt,id:Rt,index:Yt,sourceLayerIndex:dr}of D){const xr=this.layers[0]._featureFilter.needGeometry,qr=gr(pt,xr);if(!this.layers[0]._featureFilter.filter(new dl(this.zoom),qr,me))continue;const $r=Ve?Pe.evaluate(qr,{},me,Q.availableImages):void 0,hn={id:Rt,properties:pt.properties,type:pt.type,sourceLayerIndex:dr,index:Yt,geometry:xr?qr.geometry:dt(pt),patterns:{},sortKey:$r};We.push(hn)}Ve&&We.sort((pt,Rt)=>pt.sortKey-Rt.sortKey);for(const pt of We){const{geometry:Rt,index:Yt,sourceLayerIndex:dr}=pt;if(this.hasPattern){const xr=Bt("fill",this.layers,pt,this.zoom,Q);this.patternFeatures.push(xr)}else this.addFeature(pt,Rt,Yt,me,{});Q.featureIndex.insert(D[Yt].feature,Rt,Yt,dr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Pe of this.patternFeatures)this.addFeature(Pe,Pe.geometry,Pe.index,Q,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,$l),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,Q,me,Pe,Ve){for(const We of jc(Q,500)){let pt=0;for(const $r of We)pt+=$r.length;const Rt=this.segments.prepareSegment(pt,this.layoutVertexArray,this.indexArray),Yt=Rt.vertexLength,dr=[],xr=[];for(const $r of We){if($r.length===0)continue;$r!==We[0]&&xr.push(dr.length/2);const hn=this.segments2.prepareSegment($r.length,this.layoutVertexArray,this.indexArray2),An=hn.vertexLength;this.layoutVertexArray.emplaceBack($r[0].x,$r[0].y),this.indexArray2.emplaceBack(An+$r.length-1,An),dr.push($r[0].x),dr.push($r[0].y);for(let Bn=1;Bn<$r.length;Bn++)this.layoutVertexArray.emplaceBack($r[Bn].x,$r[Bn].y),this.indexArray2.emplaceBack(An+Bn-1,An+Bn),dr.push($r[Bn].x),dr.push($r[Bn].y);hn.vertexLength+=$r.length,hn.primitiveLength+=$r.length}const qr=uu(dr,xr);for(let $r=0;$r>3}if(Pe--,me===1||me===2)Ve+=Y.readSVarint(),We+=Y.readSVarint(),me===1&&(D&&pt.push(D),D=[]),D.push(new ha(Ve,We));else{if(me!==7)throw new Error("unknown command "+me);D&&D.push(D[0].clone())}}return D&&pt.push(D),pt},ca.prototype.bbox=function(){var Y=this._pbf;Y.pos=this._geometry;for(var D=Y.readVarint()+Y.pos,Q=1,me=0,Pe=0,Ve=0,We=1/0,pt=-1/0,Rt=1/0,Yt=-1/0;Y.pos>3}if(me--,Q===1||Q===2)(Pe+=Y.readSVarint())pt&&(pt=Pe),(Ve+=Y.readSVarint())Yt&&(Yt=Ve);else if(Q!==7)throw new Error("unknown command "+Q)}return[We,Rt,pt,Yt]},ca.prototype.toGeoJSON=function(Y,D,Q){var me,Pe,Ve=this.extent*Math.pow(2,Q),We=this.extent*Y,pt=this.extent*D,Rt=this.loadGeometry(),Yt=ca.types[this.type];function dr($r){for(var hn=0;hn<$r.length;hn++){var An=$r[hn];$r[hn]=[360*(An.x+We)/Ve-180,360/Math.PI*Math.atan(Math.exp((180-360*(An.y+pt)/Ve)*Math.PI/180))-90]}}switch(this.type){case 1:var xr=[];for(me=0;me>3;Pe=We===1?me.readString():We===2?me.readFloat():We===3?me.readDouble():We===4?me.readVarint64():We===5?me.readVarint():We===6?me.readSVarint():We===7?me.readBoolean():null}return Pe})(Q))}_s.prototype.feature=function(Y){if(Y<0||Y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Y];var D=this._pbf.readVarint()+this._pbf.pos;return new xi(this._pbf,D,this.extent,this._keys,this._values)};var pl=qi;function cl(Y,D,Q){if(Y===3){var me=new pl(Q,Q.readVarint()+Q.pos);me.length&&(D[me.name]=me)}}la.VectorTile=function(Y,D){this.layers=Y.readFields(cl,{},D)},la.VectorTileFeature=La,la.VectorTileLayer=qi;const yl=la.VectorTileFeature.types,ml=Math.pow(2,13);function Ku(Y,D,Q,me,Pe,Ve,We,pt){Y.emplaceBack(D,Q,2*Math.floor(me*ml)+We,Pe*ml*2,Ve*ml*2,Math.round(pt))}class il{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new ac,this.centroidVertexArray=new Cs,this.indexArray=new Jt,this.programConfigurations=new Dl(D.layers,D.zoom),this.segments=new fn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.features=[],this.hasPattern=er("fill-extrusion",this.layers,Q);for(const{feature:Pe,id:Ve,index:We,sourceLayerIndex:pt}of D){const Rt=this.layers[0]._featureFilter.needGeometry,Yt=gr(Pe,Rt);if(!this.layers[0]._featureFilter.filter(new dl(this.zoom),Yt,me))continue;const dr={id:Ve,sourceLayerIndex:pt,index:We,geometry:Rt?Yt.geometry:dt(Pe),properties:Pe.properties,type:Pe.type,patterns:{}};this.hasPattern?this.features.push(Bt("fill-extrusion",this.layers,dr,this.zoom,Q)):this.addFeature(dr,dr.geometry,We,me,{}),Q.featureIndex.insert(Pe,dr.geometry,We,pt,this.index,!0)}}addFeatures(D,Q,me){for(const Pe of this.features){const{geometry:Ve}=Pe;this.addFeature(Pe,Ve,Pe.index,Q,me)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}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,Hn),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Yn.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,Q,me,Pe,Ve){for(const We of jc(Q,500)){const pt={x:0,y:0,vertexCount:0};let Rt=0;for(const hn of We)Rt+=hn.length;let Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const hn of We){if(hn.length===0||Gf(hn))continue;let An=0;for(let Bn=0;Bn=1){const ii=hn[Bn-1];if(!yu(va,ii)){Yt.vertexLength+4>fn.MAX_VERTEX_ARRAY_LENGTH&&(Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Fa=va.sub(ii)._perp()._unit(),Qa=ii.dist(va);An+Qa>32768&&(An=0),Ku(this.layoutVertexArray,va.x,va.y,Fa.x,Fa.y,0,0,An),Ku(this.layoutVertexArray,va.x,va.y,Fa.x,Fa.y,0,1,An),pt.x+=2*va.x,pt.y+=2*va.y,pt.vertexCount+=2,An+=Qa,Ku(this.layoutVertexArray,ii.x,ii.y,Fa.x,Fa.y,0,0,An),Ku(this.layoutVertexArray,ii.x,ii.y,Fa.x,Fa.y,0,1,An),pt.x+=2*ii.x,pt.y+=2*ii.y,pt.vertexCount+=2;const Di=Yt.vertexLength;this.indexArray.emplaceBack(Di,Di+2,Di+1),this.indexArray.emplaceBack(Di+1,Di+2,Di+3),Yt.vertexLength+=4,Yt.primitiveLength+=2}}}}if(Yt.vertexLength+Rt>fn.MAX_VERTEX_ARRAY_LENGTH&&(Yt=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),yl[D.type]!=="Polygon")continue;const dr=[],xr=[],qr=Yt.vertexLength;for(const hn of We)if(hn.length!==0){hn!==We[0]&&xr.push(dr.length/2);for(let An=0;AnYl)||Y.y===D.y&&(Y.y<0||Y.y>Yl)}function Gf(Y){return Y.every(D=>D.x<0)||Y.every(D=>D.x>Yl)||Y.every(D=>D.y<0)||Y.every(D=>D.y>Yl)}let wh;Ba("FillExtrusionBucket",il,{omit:["layers","features"]});var Bd={get paint(){return wh=wh||new Ue({"fill-extrusion-opacity":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new as(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Mf(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new as(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new as(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Nd extends oe{constructor(D){super(D,Bd)}createBucket(D){return new il(D)}queryRadius(){return Fn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,Q,me,Pe,Ve,We,pt,Rt){const Yt=ea(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),We.angle,pt),dr=this.paint.get("fill-extrusion-height").evaluate(Q,me),xr=this.paint.get("fill-extrusion-base").evaluate(Q,me),qr=(function(hn,An,Bn,va){const ii=[];for(const Fa of hn){const Qa=[Fa.x,Fa.y,0,1];Wa(Qa,Qa,An),ii.push(new i(Qa[0]/Qa[3],Qa[1]/Qa[3]))}return ii})(Yt,Rt),$r=(function(hn,An,Bn,va){const ii=[],Fa=[],Qa=va[8]*An,Di=va[9]*An,lo=va[10]*An,Ko=va[11]*An,fl=va[8]*Bn,is=va[9]*Bn,Yo=va[10]*Bn,Is=va[11]*Bn;for(const Ms of hn){const bs=[],$i=[];for(const Vs of Ms){const Ds=Vs.x,Cl=Vs.y,rf=va[0]*Ds+va[4]*Cl+va[12],Yc=va[1]*Ds+va[5]*Cl+va[13],sv=va[2]*Ds+va[6]*Cl+va[14],_d=va[3]*Ds+va[7]*Cl+va[15],Th=sv+lo,Zh=_d+Ko,ld=rf+fl,ud=Yc+is,cd=sv+Yo,Xf=_d+Is,lv=new i((rf+Qa)/Zh,(Yc+Di)/Zh);lv.z=Th/Zh,bs.push(lv);const Jv=new i(ld/Xf,ud/Xf);Jv.z=cd/Xf,$i.push(Jv)}ii.push(bs),Fa.push($i)}return[ii,Fa]})(Pe,xr,dr,Rt);return(function(hn,An,Bn){let va=1/0;dn(Bn,An)&&(va=op(Bn,An[0]));for(let ii=0;iiQ.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(Q=>{this.gradients[Q.id]={}}),this.layoutVertexArray=new zc,this.layoutVertexArray2=new ge,this.indexArray=new Jt,this.programConfigurations=new Dl(D.layers,D.zoom),this.segments=new fn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=er("line",this.layers,Q);const Pe=this.layers[0].layout.get("line-sort-key"),Ve=!Pe.isConstant(),We=[];for(const{feature:pt,id:Rt,index:Yt,sourceLayerIndex:dr}of D){const xr=this.layers[0]._featureFilter.needGeometry,qr=gr(pt,xr);if(!this.layers[0]._featureFilter.filter(new dl(this.zoom),qr,me))continue;const $r=Ve?Pe.evaluate(qr,{},me):void 0,hn={id:Rt,properties:pt.properties,type:pt.type,sourceLayerIndex:dr,index:Yt,geometry:xr?qr.geometry:dt(pt),patterns:{},sortKey:$r};We.push(hn)}Ve&&We.sort((pt,Rt)=>pt.sortKey-Rt.sortKey);for(const pt of We){const{geometry:Rt,index:Yt,sourceLayerIndex:dr}=pt;if(this.hasPattern){const xr=Bt("line",this.layers,pt,this.zoom,Q);this.patternFeatures.push(xr)}else this.addFeature(pt,Rt,Yt,me,{});Q.featureIndex.insert(D[Yt].feature,Rt,Yt,dr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Pe of this.patternFeatures)this.addFeature(Pe,Pe.geometry,Pe.index,Q,me)}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,wp)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,bp),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,Q,me,Pe,Ve){const We=this.layers[0].layout,pt=We.get("line-join").evaluate(D,{}),Rt=We.get("line-cap"),Yt=We.get("line-miter-limit"),dr=We.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const xr of Q)this.addLine(xr,D,pt,Rt,Yt,dr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,Ve,Pe)}addLine(D,Q,me,Pe,Ve,We){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let va=0;va=2&&D[Rt-1].equals(D[Rt-2]);)Rt--;let Yt=0;for(;Yt0;if(Ko&&va>Yt){const Is=qr.dist($r);if(Is>2*dr){const Ms=qr.sub(qr.sub($r)._mult(dr/Is)._round());this.updateDistance($r,Ms),this.addCurrentVertex(Ms,An,0,0,xr),$r=Ms}}const is=$r&&hn;let Yo=is?me:pt?"butt":Pe;if(is&&Yo==="round"&&(DiVe&&(Yo="bevel"),Yo==="bevel"&&(Di>2&&(Yo="flipbevel"),Di100)ii=Bn.mult(-1);else{const Is=Di*An.add(Bn).mag()/An.sub(Bn).mag();ii._perp()._mult(Is*(fl?-1:1))}this.addCurrentVertex(qr,ii,0,0,xr),this.addCurrentVertex(qr,ii.mult(-1),0,0,xr)}else if(Yo==="bevel"||Yo==="fakeround"){const Is=-Math.sqrt(Di*Di-1),Ms=fl?Is:0,bs=fl?0:Is;if($r&&this.addCurrentVertex(qr,An,Ms,bs,xr),Yo==="fakeround"){const $i=Math.round(180*lo/Math.PI/20);for(let Vs=1;Vs<$i;Vs++){let Ds=Vs/$i;if(Ds!==.5){const rf=Ds-.5;Ds+=Ds*rf*(Ds-1)*((1.0904+Fa*(Fa*(3.55645-1.43519*Fa)-3.2452))*rf*rf+(.848013+Fa*(.215638*Fa-1.06021)))}const Cl=Bn.sub(An)._mult(Ds)._add(An)._unit()._mult(fl?-1:1);this.addHalfVertex(qr,Cl.x,Cl.y,!1,fl,0,xr)}}hn&&this.addCurrentVertex(qr,Bn,-Ms,-bs,xr)}else if(Yo==="butt")this.addCurrentVertex(qr,ii,0,0,xr);else if(Yo==="square"){const Is=$r?1:-1;this.addCurrentVertex(qr,ii,Is,Is,xr)}else Yo==="round"&&($r&&(this.addCurrentVertex(qr,An,0,0,xr),this.addCurrentVertex(qr,An,1,1,xr,!0)),hn&&(this.addCurrentVertex(qr,Bn,-1,-1,xr,!0),this.addCurrentVertex(qr,Bn,0,0,xr)));if(Ko&&va2*dr){const Ms=qr.add(hn.sub(qr)._mult(dr/Is)._round());this.updateDistance(qr,Ms),this.addCurrentVertex(Ms,Bn,0,0,xr),qr=Ms}}}}addCurrentVertex(D,Q,me,Pe,Ve,We=!1){const pt=Q.y*Pe-Q.x,Rt=-Q.y-Q.x*Pe;this.addHalfVertex(D,Q.x+Q.y*me,Q.y-Q.x*me,We,!1,me,Ve),this.addHalfVertex(D,pt,Rt,We,!0,-Pe,Ve),this.distance>Ud/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,Q,me,Pe,Ve,We))}addHalfVertex({x:D,y:Q},me,Pe,Ve,We,pt,Rt){const Yt=.5*(this.lineClips?this.scaledDistance*(Ud-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Ve?1:0),(Q<<1)+(We?1:0),Math.round(63*me)+128,Math.round(63*Pe)+128,1+(pt===0?0:pt<0?-1:1)|(63&Yt)<<2,Yt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const dr=Rt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,dr),Rt.primitiveLength++),We?this.e2=dr:this.e1=dr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,Q){this.distance+=D.dist(Q),this.updateScaledDistance()}}let jd,Og;Ba("LineBucket",sp,{omit:["layers","patternFeatures"]});var K0={get paint(){return Og=Og||new Ue({"line-opacity":new as(ie.paint_line["line-opacity"]),"line-color":new as(ie.paint_line["line-color"]),"line-translate":new Xo(ie.paint_line["line-translate"]),"line-translate-anchor":new Xo(ie.paint_line["line-translate-anchor"]),"line-width":new as(ie.paint_line["line-width"]),"line-gap-width":new as(ie.paint_line["line-gap-width"]),"line-offset":new as(ie.paint_line["line-offset"]),"line-blur":new as(ie.paint_line["line-blur"]),"line-dasharray":new Gc(ie.paint_line["line-dasharray"]),"line-pattern":new Mf(ie.paint_line["line-pattern"]),"line-gradient":new Dc(ie.paint_line["line-gradient"])})},get layout(){return jd=jd||new Ue({"line-cap":new Xo(ie.layout_line["line-cap"]),"line-join":new as(ie.layout_line["line-join"]),"line-miter-limit":new Xo(ie.layout_line["line-miter-limit"]),"line-round-limit":new Xo(ie.layout_line["line-round-limit"]),"line-sort-key":new as(ie.layout_line["line-sort-key"])})}};class Xh extends as{possiblyEvaluate(D,Q){return Q=new dl(Math.floor(Q.zoom),{now:Q.now,fadeDuration:Q.fadeDuration,zoomHistory:Q.zoomHistory,transition:Q.transition}),super.possiblyEvaluate(D,Q)}evaluate(D,Q,me,Pe){return Q=M({},Q,{zoom:Math.floor(Q.zoom)}),super.evaluate(D,Q,me,Pe)}}let $0;class Fg extends oe{constructor(D){super(D,K0),this.gradientVersion=0,$0||($0=new Xh(K0.paint.properties["line-width"].specification),$0.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const Q=this.gradientExpression();this.stepInterpolant=!!(function(me){return me._styleExpression!==void 0})(Q)&&Q._styleExpression.expression instanceof Rn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,Q){super.recalculate(D,Q),this.paint._values["line-floorwidth"]=$0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new sp(D)}queryRadius(D){const Q=D,me=Av(tn("line-width",this,Q),tn("line-gap-width",this,Q)),Pe=tn("line-offset",this,Q);return me/2+Math.abs(Pe)+Fn(this.paint.get("line-translate"))}queryIntersectsFeature(D,Q,me,Pe,Ve,We,pt){const Rt=ea(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),We.angle,pt),Yt=pt/2*Av(this.paint.get("line-width").evaluate(Q,me),this.paint.get("line-gap-width").evaluate(Q,me)),dr=this.paint.get("line-offset").evaluate(Q,me);return dr&&(Pe=(function(xr,qr){const $r=[];for(let hn=0;hn=3){for(let Bn=0;Bn0?D+2*Y:Y}const Om=gt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Yy=gt([{name:"a_projected_pos",components:3,type:"Float32"}],4);gt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Zy=gt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);gt([{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"}]);const Bg=gt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Fm=gt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bm(Y,D,Q){return Y.sections.forEach(me=>{me.text=(function(Pe,Ve,We){const pt=Ve.layout.get("text-transform").evaluate(We,{});return pt==="uppercase"?Pe=Pe.toLocaleUpperCase():pt==="lowercase"&&(Pe=Pe.toLocaleLowerCase()),Il.applyArabicShaping&&(Pe=Il.applyArabicShaping(Pe)),Pe})(me.text,D,Q)}),Y}gt([{name:"triangle",components:3,type:"Uint16"}]),gt([{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"}]),gt([{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"}]),gt([{type:"Float32",name:"offsetX"}]),gt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),gt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const df={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var uc=24,$v=bc,Ng=function(Y,D,Q,me,Pe){var Ve,We,pt=8*Pe-me-1,Rt=(1<>1,dr=-7,xr=Pe-1,qr=-1,$r=Y[D+xr];for(xr+=qr,Ve=$r&(1<<-dr)-1,$r>>=-dr,dr+=pt;dr>0;Ve=256*Ve+Y[D+xr],xr+=qr,dr-=8);for(We=Ve&(1<<-dr)-1,Ve>>=-dr,dr+=me;dr>0;We=256*We+Y[D+xr],xr+=qr,dr-=8);if(Ve===0)Ve=1-Yt;else{if(Ve===Rt)return We?NaN:1/0*($r?-1:1);We+=Math.pow(2,me),Ve-=Yt}return($r?-1:1)*We*Math.pow(2,Ve-me)},Wy=function(Y,D,Q,me,Pe,Ve){var We,pt,Rt,Yt=8*Ve-Pe-1,dr=(1<>1,qr=Pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,$r=0,hn=1,An=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(pt=isNaN(D)?1:0,We=dr):(We=Math.floor(Math.log(D)/Math.LN2),D*(Rt=Math.pow(2,-We))<1&&(We--,Rt*=2),(D+=We+xr>=1?qr/Rt:qr*Math.pow(2,1-xr))*Rt>=2&&(We++,Rt/=2),We+xr>=dr?(pt=0,We=dr):We+xr>=1?(pt=(D*Rt-1)*Math.pow(2,Pe),We+=xr):(pt=D*Math.pow(2,xr-1)*Math.pow(2,Pe),We=0));Pe>=8;Y[Q+$r]=255&pt,$r+=hn,pt/=256,Pe-=8);for(We=We<0;Y[Q+$r]=255&We,$r+=hn,We/=256,Yt-=8);Y[Q+$r-hn]|=128*An};function bc(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}bc.Varint=0,bc.Fixed64=1,bc.Bytes=2,bc.Fixed32=5;var N_=4294967296,Nm=1/N_,$b=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function qd(Y){return Y.type===bc.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function Um(Y,D,Q){return Q?4294967296*D+(Y>>>0):4294967296*(D>>>0)+(Y>>>0)}function Jb(Y,D,Q){var me=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));Q.realloc(me);for(var Pe=Q.pos-1;Pe>=Y;Pe--)Q.buf[Pe+me]=Q.buf[Pe]}function U_(Y,D){for(var Q=0;Q>>8,Y[Q+2]=D>>>16,Y[Q+3]=D>>>24}function aS(Y,D){return(Y[D]|Y[D+1]<<8|Y[D+2]<<16)+(Y[D+3]<<24)}bc.prototype={destroy:function(){this.buf=null},readFields:function(Y,D,Q){for(Q=Q||this.length;this.pos>3,Ve=this.pos;this.type=7&me,Y(Pe,D,this),this.pos===Ve&&this.skip(me)}return D},readMessage:function(Y,D){return this.readFields(Y,D,this.readVarint()+this.pos)},readFixed32:function(){var Y=ew(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=aS(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=ew(this.buf,this.pos)+ew(this.buf,this.pos+4)*N_;return this.pos+=8,Y},readSFixed64:function(){var Y=ew(this.buf,this.pos)+aS(this.buf,this.pos+4)*N_;return this.pos+=8,Y},readFloat:function(){var Y=Ng(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=Ng(this.buf,this.pos,!0,52,8);return this.pos+=8,Y},readVarint:function(Y){var D,Q,me=this.buf;return D=127&(Q=me[this.pos++]),Q<128?D:(D|=(127&(Q=me[this.pos++]))<<7,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<14,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<21,Q<128?D:(function(Pe,Ve,We){var pt,Rt,Yt=We.buf;if(pt=(112&(Rt=Yt[We.pos++]))>>4,Rt<128||(pt|=(127&(Rt=Yt[We.pos++]))<<3,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<10,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<17,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<24,Rt<128)||(pt|=(1&(Rt=Yt[We.pos++]))<<31,Rt<128))return Um(Pe,pt,Ve);throw new Error("Expected varint not more than 10 bytes")})(D|=(15&(Q=me[this.pos]))<<28,Y,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Y=this.readVarint();return Y%2==1?(Y+1)/-2:Y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Y=this.readVarint()+this.pos,D=this.pos;return this.pos=Y,Y-D>=12&&$b?(function(Q,me,Pe){return $b.decode(Q.subarray(me,Pe))})(this.buf,D,Y):(function(Q,me,Pe){for(var Ve="",We=me;We239?4:dr>223?3:dr>191?2:1;if(We+qr>Pe)break;qr===1?dr<128&&(xr=dr):qr===2?(192&(pt=Q[We+1]))==128&&(xr=(31&dr)<<6|63&pt)<=127&&(xr=null):qr===3?(Rt=Q[We+2],(192&(pt=Q[We+1]))==128&&(192&Rt)==128&&((xr=(15&dr)<<12|(63&pt)<<6|63&Rt)<=2047||xr>=55296&&xr<=57343)&&(xr=null)):qr===4&&(Rt=Q[We+2],Yt=Q[We+3],(192&(pt=Q[We+1]))==128&&(192&Rt)==128&&(192&Yt)==128&&((xr=(15&dr)<<18|(63&pt)<<12|(63&Rt)<<6|63&Yt)<=65535||xr>=1114112)&&(xr=null)),xr===null?(xr=65533,qr=1):xr>65535&&(xr-=65536,Ve+=String.fromCharCode(xr>>>10&1023|55296),xr=56320|1023&xr),Ve+=String.fromCharCode(xr),We+=qr}return Ve})(this.buf,D,Y)},readBytes:function(){var Y=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,Y);return this.pos=Y,D},readPackedVarint:function(Y,D){if(this.type!==bc.Bytes)return Y.push(this.readVarint(D));var Q=qd(this);for(Y=Y||[];this.pos127;);else if(D===bc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===bc.Fixed32)this.pos+=4;else{if(D!==bc.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(Y,D){this.writeVarint(Y<<3|D)},realloc:function(Y){for(var D=this.length||16;D268435455||Y<0?(function(D,Q){var me,Pe;if(D>=0?(me=D%4294967296|0,Pe=D/4294967296|0):(Pe=~(-D/4294967296),4294967295^(me=~(-D%4294967296))?me=me+1|0:(me=0,Pe=Pe+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Q.realloc(10),(function(Ve,We,pt){pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,pt.buf[pt.pos]=127&(Ve>>>=7)})(me,0,Q),(function(Ve,We){var pt=(7&Ve)<<4;We.buf[We.pos++]|=pt|((Ve>>>=3)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve)))))})(Pe,Q)})(Y,this):(this.realloc(4),this.buf[this.pos++]=127&Y|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=Y>>>7&127))))},writeSVarint:function(Y){this.writeVarint(Y<0?2*-Y-1:2*Y)},writeBoolean:function(Y){this.writeVarint(!!Y)},writeString:function(Y){Y=String(Y),this.realloc(4*Y.length),this.pos++;var D=this.pos;this.pos=(function(me,Pe,Ve){for(var We,pt,Rt=0;Rt55295&&We<57344){if(!pt){We>56319||Rt+1===Pe.length?(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189):pt=We;continue}if(We<56320){me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,pt=We;continue}We=pt-55296<<10|We-56320|65536,pt=null}else pt&&(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,pt=null);We<128?me[Ve++]=We:(We<2048?me[Ve++]=We>>6|192:(We<65536?me[Ve++]=We>>12|224:(me[Ve++]=We>>18|240,me[Ve++]=We>>12&63|128),me[Ve++]=We>>6&63|128),me[Ve++]=63&We|128)}return Ve})(this.buf,Y,this.pos);var Q=this.pos-D;Q>=128&&Jb(D,Q,this),this.pos=D-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(Y){this.realloc(4),Wy(this.buf,Y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Y){this.realloc(8),Wy(this.buf,Y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Y){var D=Y.length;this.writeVarint(D),this.realloc(D);for(var Q=0;Q=128&&Jb(Q,me,this),this.pos=Q-1,this.writeVarint(me),this.pos+=me},writeMessage:function(Y,D,Q){this.writeTag(Y,bc.Bytes),this.writeRawMessage(D,Q)},writePackedVarint:function(Y,D){D.length&&this.writeMessage(Y,U_,D)},writePackedSVarint:function(Y,D){D.length&&this.writeMessage(Y,GE,D)},writePackedBoolean:function(Y,D){D.length&&this.writeMessage(Y,ZE,D)},writePackedFloat:function(Y,D){D.length&&this.writeMessage(Y,XE,D)},writePackedDouble:function(Y,D){D.length&&this.writeMessage(Y,YE,D)},writePackedFixed32:function(Y,D){D.length&&this.writeMessage(Y,WE,D)},writePackedSFixed32:function(Y,D){D.length&&this.writeMessage(Y,KE,D)},writePackedFixed64:function(Y,D){D.length&&this.writeMessage(Y,$E,D)},writePackedSFixed64:function(Y,D){D.length&&this.writeMessage(Y,Qb,D)},writeBytesField:function(Y,D){this.writeTag(Y,bc.Bytes),this.writeBytes(D)},writeFixed32Field:function(Y,D){this.writeTag(Y,bc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(Y,D){this.writeTag(Y,bc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(Y,D){this.writeTag(Y,bc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(Y,D){this.writeTag(Y,bc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(Y,D){this.writeTag(Y,bc.Varint),this.writeVarint(D)},writeSVarintField:function(Y,D){this.writeTag(Y,bc.Varint),this.writeSVarint(D)},writeStringField:function(Y,D){this.writeTag(Y,bc.Bytes),this.writeString(D)},writeFloatField:function(Y,D){this.writeTag(Y,bc.Fixed32),this.writeFloat(D)},writeDoubleField:function(Y,D){this.writeTag(Y,bc.Fixed64),this.writeDouble(D)},writeBooleanField:function(Y,D){this.writeVarintField(Y,!!D)}};var j3=r($v);const tw=3;function JE(Y,D,Q){Y===1&&Q.readMessage(iS,D)}function iS(Y,D,Q){if(Y===3){const{id:me,bitmap:Pe,width:Ve,height:We,left:pt,top:Rt,advance:Yt}=Q.readMessage(q3,{});D.push({id:me,bitmap:new Qo({width:Ve+2*tw,height:We+2*tw},Pe),metrics:{width:Ve,height:We,left:pt,top:Rt,advance:Yt}})}}function q3(Y,D,Q){Y===1?D.id=Q.readVarint():Y===2?D.bitmap=Q.readBytes():Y===3?D.width=Q.readVarint():Y===4?D.height=Q.readVarint():Y===5?D.left=Q.readSVarint():Y===6?D.top=Q.readSVarint():Y===7&&(D.advance=Q.readVarint())}const V3=tw;function rw(Y){let D=0,Q=0;for(const We of Y)D+=We.w*We.h,Q=Math.max(Q,We.w);Y.sort((We,pt)=>pt.h-We.h);const me=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),Q),h:1/0}];let Pe=0,Ve=0;for(const We of Y)for(let pt=me.length-1;pt>=0;pt--){const Rt=me[pt];if(!(We.w>Rt.w||We.h>Rt.h)){if(We.x=Rt.x,We.y=Rt.y,Ve=Math.max(Ve,We.y+We.h),Pe=Math.max(Pe,We.x+We.w),We.w===Rt.w&&We.h===Rt.h){const Yt=me.pop();pt=0&&me>=D&&aw[this.text.charCodeAt(me)];me--)Q--;this.text=this.text.substring(D,Q),this.sectionIndex=this.sectionIndex.slice(D,Q)}substring(D,Q){const me=new Jy;return me.text=this.text.substring(D,Q),me.sectionIndex=this.sectionIndex.slice(D,Q),me.sections=this.sections,me}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,Q)=>Math.max(D,this.sections[Q].scale),0)}addTextSection(D,Q){this.text+=D.text,this.sections.push(j_.forText(D.scale,D.fontStack||Q));const me=this.sections.length-1;for(let Pe=0;Pe=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function nw(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn){const An=Jy.fromFeature(Y,Pe);let Bn;xr===e.ah.vertical&&An.verticalizePunctuation();const{processBidirectionalText:va,processStyledBidirectionalText:ii}=Il;if(va&&An.sections.length===1){Bn=[];const Di=va(An.toString(),Ug(An,Yt,Ve,D,me,$r));for(const lo of Di){const Ko=new Jy;Ko.text=lo,Ko.sections=An.sections;for(let fl=0;fl0&&Ap>Mv&&(Mv=Ap)}else{const nf=Ko[Du.fontStack],Ev=nf&&nf[Oc];if(Ev&&Ev.rect)s1=Ev.rect,mf=Ev.metrics;else{const Ap=lo[Du.fontStack],Gd=Ap&&Ap[Oc];if(!Gd)continue;mf=Gd.metrics}Nf=(lv-Du.scale)*uc}Qv?(Di.verticalizable=!0,fd.push({glyph:Oc,imageName:Kp,x:Cl,y:rf+Nf,vertical:Qv,scale:Du.scale,fontStack:Du.fontStack,sectionIndex:wc,metrics:mf,rect:s1}),Cl+=$p*Du.scale+$i):(fd.push({glyph:Oc,imageName:Kp,x:Cl,y:rf+Nf,vertical:Qv,scale:Du.scale,fontStack:Du.fontStack,sectionIndex:wc,metrics:mf,rect:s1}),Cl+=mf.advance*Du.scale+$i)}fd.length!==0&&(Yc=Math.max(Cl-$i,Yc),t6(fd,0,fd.length-1,_d,Mv)),Cl=0;const Hd=Yo*lv+Mv;Uv.lineOffset=Math.max(Mv,Jv),rf+=Hd,sv=Math.max(Hd,sv),++Th}var Zh;const ld=rf-$y,{horizontalAlign:ud,verticalAlign:cd}=G3(Is);(function(Xf,lv,Jv,Uv,fd,Mv,Hd,pf,Du){const wc=(lv-Jv)*fd;let Oc=0;Oc=Mv!==Hd?-pf*Uv-$y:(-Uv*Du+.5)*Hd;for(const Nf of Xf)for(const mf of Nf.positionedGlyphs)mf.x+=wc,mf.y+=Oc})(Di.positionedLines,_d,ud,cd,Yc,sv,Yo,ld,is.length),Di.top+=-cd*ld,Di.bottom=Di.top+ld,Di.left+=-ud*Yc,Di.right=Di.left+Yc})(Qa,D,Q,me,Bn,We,pt,Rt,xr,Yt,qr,hn),!(function(Di){for(const lo of Di)if(lo.positionedGlyphs.length!==0)return!1;return!0})(Fa)&&Qa}const aw={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},QE={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},e6={40:!0};function iw(Y,D,Q,me,Pe,Ve){if(D.imageName){const We=me[D.imageName];return We?We.displaySize[0]*D.scale*uc/Ve+Pe:0}{const We=Q[D.fontStack],pt=We&&We[Y];return pt?pt.metrics.advance*D.scale+Pe:0}}function sS(Y,D,Q,me){const Pe=Math.pow(Y-D,2);return me?Y=0;let Yt=0;for(let xr=0;xrYt){const dr=Math.ceil(Ve/Yt);Pe*=dr/We,We=dr}return{x1:me,y1:Pe,x2:me+Ve,y2:Pe+We}}function uS(Y,D,Q,me,Pe,Ve){const We=Y.image;let pt;if(We.content){const Bn=We.content,va=We.pixelRatio||1;pt=[Bn[0]/va,Bn[1]/va,We.displaySize[0]-Bn[2]/va,We.displaySize[1]-Bn[3]/va]}const Rt=D.left*Ve,Yt=D.right*Ve;let dr,xr,qr,$r;Q==="width"||Q==="both"?($r=Pe[0]+Rt-me[3],xr=Pe[0]+Yt+me[1]):($r=Pe[0]+(Rt+Yt-We.displaySize[0])/2,xr=$r+We.displaySize[0]);const hn=D.top*Ve,An=D.bottom*Ve;return Q==="height"||Q==="both"?(dr=Pe[1]+hn-me[0],qr=Pe[1]+An+me[2]):(dr=Pe[1]+(hn+An-We.displaySize[1])/2,qr=dr+We.displaySize[1]),{image:We,top:dr,right:xr,bottom:qr,left:$r,collisionPadding:pt}}const q_=255,x0=128,qm=q_*x0;function cS(Y,D){const{expression:Q}=D;if(Q.kind==="constant")return{kind:"constant",layoutSize:Q.evaluate(new dl(Y+1))};if(Q.kind==="source")return{kind:"source"};{const{zoomStops:me,interpolationType:Pe}=Q;let Ve=0;for(;VeWe.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=aa([]),this.placementViewportMatrix=aa([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cS(this.zoom,Q["text-size"]),this.iconSizeData=cS(this.zoom,Q["icon-size"]);const me=this.layers[0].layout,Pe=me.get("symbol-sort-key"),Ve=me.get("symbol-z-order");this.canOverlap=X3(me,"text-overlap","text-allow-overlap")!=="never"||X3(me,"icon-overlap","icon-allow-overlap")!=="never"||me.get("text-ignore-placement")||me.get("icon-ignore-placement"),this.sortFeaturesByKey=Ve!=="viewport-y"&&!Pe.isConstant(),this.sortFeaturesByY=(Ve==="viewport-y"||Ve==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,me.get("symbol-placement")==="point"&&(this.writingModes=me.get("text-writing-mode").map(We=>e.ah[We])),this.stateDependentLayerIds=this.layers.filter(We=>We.isStateDependent()).map(We=>We.id),this.sourceID=D.sourceID}createArrays(){this.text=new eh(new Dl(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new eh(new Dl(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Ks,this.lineVertexArray=new $s,this.symbolInstances=new Wo,this.textAnchorOffsets=new nl}calculateGlyphDependencies(D,Q,me,Pe,Ve){for(let We=0;We0)&&(We.value.kind!=="constant"||We.value.value.length>0),dr=Rt.value.kind!=="constant"||!!Rt.value.value||Object.keys(Rt.parameters).length>0,xr=Ve.get("symbol-sort-key");if(this.features=[],!Yt&&!dr)return;const qr=Q.iconDependencies,$r=Q.glyphDependencies,hn=Q.availableImages,An=new dl(this.zoom);for(const{feature:Bn,id:va,index:ii,sourceLayerIndex:Fa}of D){const Qa=Pe._featureFilter.needGeometry,Di=gr(Bn,Qa);if(!Pe._featureFilter.filter(An,Di,me))continue;let lo,Ko;if(Qa||(Di.geometry=dt(Bn)),Yt){const is=Pe.getValueAndResolveTokens("text-field",Di,me,hn),Yo=pn.factory(is),Is=this.hasRTLText=this.hasRTLText||a6(Yo);(!Is||Il.getRTLTextPluginStatus()==="unavailable"||Is&&Il.isParsed())&&(lo=Bm(Yo,Pe,Di))}if(dr){const is=Pe.getValueAndResolveTokens("icon-image",Di,me,hn);Ko=is instanceof fa?is:fa.fromString(is)}if(!lo&&!Ko)continue;const fl=this.sortFeaturesByKey?xr.evaluate(Di,{},me):void 0;if(this.features.push({id:va,text:lo,icon:Ko,index:ii,sourceLayerIndex:Fa,geometry:Di.geometry,properties:Bn.properties,type:n6[Bn.type],sortKey:fl}),Ko&&(qr[Ko.name]=!0),lo){const is=We.evaluate(Di,{},me).join(","),Yo=Ve.get("text-rotation-alignment")!=="viewport"&&Ve.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const Is of lo.sections)if(Is.image)qr[Is.image.name]=!0;else{const Ms=ns(lo.toString()),bs=Is.fontStack||is,$i=$r[bs]=$r[bs]||{};this.calculateGlyphDependencies(Is.text,$i,Yo,this.allowVerticalPlacement,Ms)}}}Ve.get("symbol-placement")==="line"&&(this.features=(function(Bn){const va={},ii={},Fa=[];let Qa=0;function Di(is){Fa.push(Bn[is]),Qa++}function lo(is,Yo,Is){const Ms=ii[is];return delete ii[is],ii[Yo]=Ms,Fa[Ms].geometry[0].pop(),Fa[Ms].geometry[0]=Fa[Ms].geometry[0].concat(Is[0]),Ms}function Ko(is,Yo,Is){const Ms=va[Yo];return delete va[Yo],va[is]=Ms,Fa[Ms].geometry[0].shift(),Fa[Ms].geometry[0]=Is[0].concat(Fa[Ms].geometry[0]),Ms}function fl(is,Yo,Is){const Ms=Is?Yo[0][Yo[0].length-1]:Yo[0][0];return`${is}:${Ms.x}:${Ms.y}`}for(let is=0;isis.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((Bn,va)=>Bn.sortKey-va.sortKey)}update(D,Q,me){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,Q,this.layers,me),this.icon.programConfigurations.updatePaintArrays(D,Q,this.layers,me))}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,Q){const me=this.lineVertexArray.length;if(D.segment!==void 0){let Pe=D.dist(Q[D.segment+1]),Ve=D.dist(Q[D.segment]);const We={};for(let pt=D.segment+1;pt=0;pt--)We[pt]={x:Q[pt].x,y:Q[pt].y,tileUnitDistanceFromAnchor:Ve},pt>0&&(Ve+=Q[pt-1].dist(Q[pt]));for(let pt=0;pt0}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,Q){const me=D.placedSymbolArray.get(Q),Pe=me.vertexStartIndex+4*me.numGlyphs;for(let Ve=me.vertexStartIndex;VePe[pt]-Pe[Rt]||Ve[Rt]-Ve[pt]),We}addToSortKeyRanges(D,Q){const me=this.sortKeyRanges[this.sortKeyRanges.length-1];me&&me.sortKey===Q?me.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:Q,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(const Q of this.symbolInstanceIndexes){const me=this.symbolInstances.get(Q);this.featureSortOrder.push(me.featureIndex),[me.rightJustifiedTextSymbolIndex,me.centerJustifiedTextSymbolIndex,me.leftJustifiedTextSymbolIndex].forEach((Pe,Ve,We)=>{Pe>=0&&We.indexOf(Pe)===Ve&&this.addIndicesForPlacedSymbol(this.text,Pe)}),me.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,me.verticalPlacedTextSymbolIndex),me.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.placedIconSymbolIndex),me.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let V_,H_;Ba("SymbolBucket",jg,{omit:["layers","collisionBoxArray","features","compareText"]}),jg.MAX_GLYPHS=65535,jg.addDynamicAttributes=Vm;var Z3={get paint(){return H_=H_||new Ue({"icon-opacity":new as(ie.paint_symbol["icon-opacity"]),"icon-color":new as(ie.paint_symbol["icon-color"]),"icon-halo-color":new as(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new as(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new as(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Xo(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xo(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new as(ie.paint_symbol["text-opacity"]),"text-color":new as(ie.paint_symbol["text-color"],{runtimeType:$t,getOverride:Y=>Y.textColor,hasOverride:Y=>!!Y.textColor}),"text-halo-color":new as(ie.paint_symbol["text-halo-color"]),"text-halo-width":new as(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new as(ie.paint_symbol["text-halo-blur"]),"text-translate":new Xo(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Xo(ie.paint_symbol["text-translate-anchor"])})},get layout(){return V_=V_||new Ue({"symbol-placement":new Xo(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Xo(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xo(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new as(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xo(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Xo(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Xo(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Xo(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xo(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xo(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new as(ie.layout_symbol["icon-size"]),"icon-text-fit":new Xo(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xo(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new as(ie.layout_symbol["icon-image"]),"icon-rotate":new as(ie.layout_symbol["icon-rotate"]),"icon-padding":new as(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Xo(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new as(ie.layout_symbol["icon-offset"]),"icon-anchor":new as(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xo(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xo(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xo(ie.layout_symbol["text-rotation-alignment"]),"text-field":new as(ie.layout_symbol["text-field"]),"text-font":new as(ie.layout_symbol["text-font"]),"text-size":new as(ie.layout_symbol["text-size"]),"text-max-width":new as(ie.layout_symbol["text-max-width"]),"text-line-height":new Xo(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new as(ie.layout_symbol["text-letter-spacing"]),"text-justify":new as(ie.layout_symbol["text-justify"]),"text-radial-offset":new as(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xo(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new as(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new as(ie.layout_symbol["text-anchor"]),"text-max-angle":new Xo(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Xo(ie.layout_symbol["text-writing-mode"]),"text-rotate":new as(ie.layout_symbol["text-rotate"]),"text-padding":new Xo(ie.layout_symbol["text-padding"]),"text-keep-upright":new Xo(ie.layout_symbol["text-keep-upright"]),"text-transform":new as(ie.layout_symbol["text-transform"]),"text-offset":new as(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Xo(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Xo(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Xo(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Xo(ie.layout_symbol["text-optional"])})}};class e1{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:ct,this.defaultValue=D}evaluate(D){if(D.formattedSection){const Q=this.defaultValue.property.overrides;if(Q&&Q.hasOverride(D.formattedSection))return Q.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}}Ba("FormatSectionOverride",e1,{omit:["defaultValue"]});class lw extends oe{constructor(D){super(D,Z3)}recalculate(D,Q){if(super.recalculate(D,Q),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"){const me=this.layout.get("text-writing-mode");if(me){const Pe=[];for(const Ve of me)Pe.indexOf(Ve)<0&&Pe.push(Ve);this.layout._values["text-writing-mode"]=Pe}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,Q,me,Pe){const Ve=this.layout.get(D).evaluate(Q,{},me,Pe),We=this._unevaluatedLayout._values[D];return We.isDataDriven()||zf(We.value)||!Ve?Ve:(function(pt,Rt){return Rt.replace(/{([^{}]+)}/g,(Yt,dr)=>pt&&dr in pt?String(pt[dr]):"")})(Q.properties,Ve)}createBucket(D){return new jg(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of Z3.paint.overridableProperties){if(!lw.hasPaintOverride(this.layout,D))continue;const Q=this.paint.get(D),me=new e1(Q),Pe=new Pc(me,Q.property.specification);let Ve=null;Ve=Q.value.kind==="constant"||Q.value.kind==="source"?new wf("source",Pe):new hc("composite",Pe,Q.value.zoomStops),this.paint._values[D]=new Mu(Q.property,Ve,Q.parameters)}}_handleOverridablePaintPropertyUpdate(D,Q,me){return!(!this.layout||Q.isDataDriven()||me.isDataDriven())&&lw.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,Q){const me=D.get("text-field"),Pe=Z3.paint.properties[Q];let Ve=!1;const We=pt=>{for(const Rt of pt)if(Pe.overrides&&Pe.overrides.hasOverride(Rt))return void(Ve=!0)};if(me.value.kind==="constant"&&me.value.value instanceof pn)We(me.value.value.sections);else if(me.value.kind==="source"){const pt=Yt=>{Ve||(Yt instanceof Ti&&Vn(Yt.value)===Zr?We(Yt.value.sections):Yt instanceof sl?We(Yt.sections):Yt.eachChild(pt))},Rt=me.value;Rt._styleExpression&&pt(Rt._styleExpression.expression)}return Ve}}let W3;var fS={get paint(){return W3=W3||new Ue({"background-color":new Xo(ie.paint_background["background-color"]),"background-pattern":new Gc(ie.paint_background["background-pattern"]),"background-opacity":new Xo(ie.paint_background["background-opacity"])})}};class G_ extends oe{constructor(D){super(D,fS)}}let uw;var K3={get paint(){return uw=uw||new Ue({"raster-opacity":new Xo(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Xo(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xo(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xo(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Xo(ie.paint_raster["raster-saturation"]),"raster-contrast":new Xo(ie.paint_raster["raster-contrast"]),"raster-resampling":new Xo(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Xo(ie.paint_raster["raster-fade-duration"])})}};class i6 extends oe{constructor(D){super(D,K3)}}class hS extends oe{constructor(D){super(D,{}),this.onAdd=Q=>{this.implementation.onAdd&&this.implementation.onAdd(Q,Q.painter.context.gl)},this.onRemove=Q=>{this.implementation.onRemove&&this.implementation.onRemove(Q,Q.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 X_{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=()=>{}}}const $3=63710088e-1;class b0{constructor(D,Q){if(isNaN(D)||isNaN(Q))throw new Error(`Invalid LngLat object: (${D}, ${Q})`);if(this.lng=+D,this.lat=+Q,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new b0(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const Q=Math.PI/180,me=this.lat*Q,Pe=D.lat*Q,Ve=Math.sin(me)*Math.sin(Pe)+Math.cos(me)*Math.cos(Pe)*Math.cos((D.lng-this.lng)*Q);return $3*Math.acos(Math.min(Ve,1))}static convert(D){if(D instanceof b0)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new b0(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new b0(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const vS=2*Math.PI*$3;function cw(Y){return vS*Math.cos(Y*Math.PI/180)}function fw(Y){return(180+Y)/360}function dS(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function Tp(Y,D){return Y/cw(D)}function J3(Y){return 360/Math.PI*Math.atan(Math.exp((180-360*Y)*Math.PI/180))-90}class Y_{constructor(D,Q,me=0){this.x=+D,this.y=+Q,this.z=+me}static fromLngLat(D,Q=0){const me=b0.convert(D);return new Y_(fw(me.lng),dS(me.lat),Tp(Q,me.lat))}toLngLat(){return new b0(360*this.x-180,J3(this.y))}toAltitude(){return this.z*cw(J3(this.y))}meterInMercatorCoordinateUnits(){return 1/vS*(D=J3(this.y),1/Math.cos(D*Math.PI/180));var D}}function pS(Y,D,Q){var me=2*Math.PI*6378137/256/Math.pow(2,Q);return[Y*me-2*Math.PI*6378137/2,D*me-2*Math.PI*6378137/2]}class Q3{constructor(D,Q,me){if(!(function(Pe,Ve,We){return!(Pe<0||Pe>25||We<0||We>=Math.pow(2,Pe)||Ve<0||Ve>=Math.pow(2,Pe))})(D,Q,me))throw new Error(`x=${Q}, y=${me}, 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=Q,this.y=me,this.key=t1(0,D,D,Q,me)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,Q,me){const Pe=(We=this.y,pt=this.z,Rt=pS(256*(Ve=this.x),256*(We=Math.pow(2,pt)-We-1),pt),Yt=pS(256*(Ve+1),256*(We+1),pt),Rt[0]+","+Rt[1]+","+Yt[0]+","+Yt[1]);var Ve,We,pt,Rt,Yt;const dr=(function(xr,qr,$r){let hn,An="";for(let Bn=xr;Bn>0;Bn--)hn=1<1?"@2x":"").replace(/{quadkey}/g,dr).replace(/{bbox-epsg-3857}/g,Pe)}isChildOf(D){const Q=this.z-D.z;return Q>0&&D.x===this.x>>Q&&D.y===this.y>>Q}getTilePoint(D){const Q=Math.pow(2,this.z);return new i((D.x*Q-this.x)*Yl,(D.y*Q-this.y)*Yl)}toString(){return`${this.z}/${this.x}/${this.y}`}}class mS{constructor(D,Q){this.wrap=D,this.canonical=Q,this.key=t1(D,Q.z,Q.z,Q.x,Q.y)}}class lp{constructor(D,Q,me,Pe,Ve){if(D= z; overscaledZ = ${D}; z = ${me}`);this.overscaledZ=D,this.wrap=Q,this.canonical=new Q3(me,+Pe,+Ve),this.key=t1(Q,D,me,Pe,Ve)}clone(){return new lp(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}`);const Q=this.canonical.z-D;return D>this.canonical.z?new lp(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new lp(D,this.wrap,D,this.canonical.x>>Q,this.canonical.y>>Q)}calculateScaledKey(D,Q){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const me=this.canonical.z-D;return D>this.canonical.z?t1(this.wrap*+Q,D,this.canonical.z,this.canonical.x,this.canonical.y):t1(this.wrap*+Q,D,D,this.canonical.x>>me,this.canonical.y>>me)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const Q=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>Q&&D.canonical.y===this.canonical.y>>Q}children(D){if(this.overscaledZ>=D)return[new lp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const Q=this.canonical.z+1,me=2*this.canonical.x,Pe=2*this.canonical.y;return[new lp(Q,this.wrap,Q,me,Pe),new lp(Q,this.wrap,Q,me+1,Pe),new lp(Q,this.wrap,Q,me,Pe+1),new lp(Q,this.wrap,Q,me+1,Pe+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=xr),xr=this.dim+1||Q<-1||Q>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(Q+1)*this.stride+(D+1)}unpack(D,Q,me){return D*this.redFactor+Q*this.greenFactor+me*this.blueFactor-this.baseShift}getPixels(){return new ul({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,Q,me){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Pe=Q*this.dim,Ve=Q*this.dim+this.dim,We=me*this.dim,pt=me*this.dim+this.dim;switch(Q){case-1:Pe=Ve-1;break;case 1:Ve=Pe+1}switch(me){case-1:We=pt-1;break;case 1:pt=We+1}const Rt=-Q*this.dim,Yt=-me*this.dim;for(let dr=We;dr=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 yS{constructor(D,Q,me,Pe,Ve){this.type="Feature",this._vectorTileFeature=D,D._z=Q,D._x=me,D._y=Pe,this.properties=D.properties,this.id=Ve}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(){const D={geometry:this.geometry};for(const Q in this)Q!=="_geometry"&&Q!=="_vectorTileFeature"&&(D[Q]=this[Q]);return D}}class _S{constructor(D,Q){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new _i(Yl,16,0),this.grid3D=new _i(Yl,16,0),this.featureIndexArray=new eu,this.promoteId=Q}insert(D,Q,me,Pe,Ve,We){const pt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(me,Pe,Ve);const Rt=We?this.grid3D:this.grid;for(let Yt=0;Yt=0&&xr[3]>=0&&Rt.insert(pt,xr[0],xr[1],xr[2],xr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new la.VectorTile(new j3(this.rawTileData)).layers,this.sourceLayerCoder=new gS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,Q,me,Pe){this.loadVTLayers();const Ve=D.params||{},We=Yl/D.tileSize/D.scale,pt=_h(Ve.filter),Rt=D.queryGeometry,Yt=D.queryPadding*We,dr=eT(Rt),xr=this.grid.query(dr.minX-Yt,dr.minY-Yt,dr.maxX+Yt,dr.maxY+Yt),qr=eT(D.cameraQueryGeometry),$r=this.grid3D.query(qr.minX-Yt,qr.minY-Yt,qr.maxX+Yt,qr.maxY+Yt,(Bn,va,ii,Fa)=>(function(Qa,Di,lo,Ko,fl){for(const Yo of Qa)if(Di<=Yo.x&&lo<=Yo.y&&Ko>=Yo.x&&fl>=Yo.y)return!0;const is=[new i(Di,lo),new i(Di,fl),new i(Ko,fl),new i(Ko,lo)];if(Qa.length>2){for(const Yo of is)if(Ha(Qa,Yo))return!0}for(let Yo=0;Yo(Fa||(Fa=dt(Qa)),Di.queryIntersectsFeature(Rt,Qa,lo,Fa,this.z,D.transform,We,D.pixelPosMatrix)))}return hn}loadMatchingFeature(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr){const qr=this.bucketLayerIDs[Q];if(We&&!(function(Bn,va){for(let ii=0;ii=0)return!0;return!1})(We,qr))return;const $r=this.sourceLayerCoder.decode(me),hn=this.vtLayers[$r].feature(Pe);if(Ve.needGeometry){const Bn=gr(hn,!0);if(!Ve.filter(new dl(this.tileID.overscaledZ),Bn,this.tileID.canonical))return}else if(!Ve.filter(new dl(this.tileID.overscaledZ),hn))return;const An=this.getId(hn,$r);for(let Bn=0;Bn{const pt=D instanceof Sf?D.get(We):null;return pt&&pt.evaluate?pt.evaluate(Q,me,Pe):pt})}function eT(Y){let D=1/0,Q=1/0,me=-1/0,Pe=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Pe=Math.max(Pe,Ve.y);return{minX:D,minY:Q,maxX:me,maxY:Pe}}function bS(Y,D){return D-Y}function wS(Y,D,Q,me,Pe){const Ve=[];for(let We=0;We=me&&xr.x>=me||(dr.x>=me?dr=new i(me,dr.y+(me-dr.x)/(xr.x-dr.x)*(xr.y-dr.y))._round():xr.x>=me&&(xr=new i(me,dr.y+(me-dr.x)/(xr.x-dr.x)*(xr.y-dr.y))._round()),dr.y>=Pe&&xr.y>=Pe||(dr.y>=Pe?dr=new i(dr.x+(Pe-dr.y)/(xr.y-dr.y)*(xr.x-dr.x),Pe)._round():xr.y>=Pe&&(xr=new i(dr.x+(Pe-dr.y)/(xr.y-dr.y)*(xr.x-dr.x),Pe)._round()),Rt&&dr.equals(Rt[Rt.length-1])||(Rt=[dr],Ve.push(Rt)),Rt.push(xr)))))}}return Ve}Ba("FeatureIndex",_S,{omit:["rawTileData","sourceLayerCoder"]});class Hm extends i{constructor(D,Q,me,Pe){super(D,Q),this.angle=me,Pe!==void 0&&(this.segment=Pe)}clone(){return new Hm(this.x,this.y,this.angle,this.segment)}}function TS(Y,D,Q,me,Pe){if(D.segment===void 0||Q===0)return!0;let Ve=D,We=D.segment+1,pt=0;for(;pt>-Q/2;){if(We--,We<0)return!1;pt-=Y[We].dist(Ve),Ve=Y[We]}pt+=Y[We].dist(Y[We+1]),We++;const Rt=[];let Yt=0;for(;ptme;)Yt-=Rt.shift().angleDelta;if(Yt>Pe)return!1;We++,pt+=dr.dist(xr)}return!0}function AS(Y){let D=0;for(let Q=0;QYt){const hn=(Yt-Rt)/$r,An=bo.number(xr.x,qr.x,hn),Bn=bo.number(xr.y,qr.y,hn),va=new Hm(An,Bn,qr.angleTo(xr),dr);return va._round(),!We||TS(Y,va,pt,We,D)?va:void 0}Rt+=$r}}function s6(Y,D,Q,me,Pe,Ve,We,pt,Rt){const Yt=SS(me,Ve,We),dr=MS(me,Pe),xr=dr*We,qr=Y[0].x===0||Y[0].x===Rt||Y[0].y===0||Y[0].y===Rt;return D-xr=0&&Qa=0&&Di=0&&qr+Yt<=dr){const lo=new Hm(Qa,Di,ii,hn);lo._round(),me&&!TS(Y,lo,Ve,me,Pe)||$r.push(lo)}}xr+=va}return pt||$r.length||We||($r=Vg(Y,xr/2,Q,me,Pe,Ve,We,!0,Rt)),$r}Ba("Anchor",Hm);const r1=Yh;function ES(Y,D,Q,me){const Pe=[],Ve=Y.image,We=Ve.pixelRatio,pt=Ve.paddedRect.w-2*r1,Rt=Ve.paddedRect.h-2*r1;let Yt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const dr=Ve.stretchX||[[0,pt]],xr=Ve.stretchY||[[0,Rt]],qr=($i,Vs)=>$i+Vs[1]-Vs[0],$r=dr.reduce(qr,0),hn=xr.reduce(qr,0),An=pt-$r,Bn=Rt-hn;let va=0,ii=$r,Fa=0,Qa=hn,Di=0,lo=An,Ko=0,fl=Bn;if(Ve.content&&me){const $i=Ve.content,Vs=$i[2]-$i[0],Ds=$i[3]-$i[1];(Ve.textFitWidth||Ve.textFitHeight)&&(Yt=lS(Y)),va=n1(dr,0,$i[0]),Fa=n1(xr,0,$i[1]),ii=n1(dr,$i[0],$i[2]),Qa=n1(xr,$i[1],$i[3]),Di=$i[0]-va,Ko=$i[1]-Fa,lo=Vs-ii,fl=Ds-Qa}const is=Yt.x1,Yo=Yt.y1,Is=Yt.x2-is,Ms=Yt.y2-Yo,bs=($i,Vs,Ds,Cl)=>{const rf=Vd($i.stretch-va,ii,Is,is),Yc=hw($i.fixed-Di,lo,$i.stretch,$r),sv=Vd(Vs.stretch-Fa,Qa,Ms,Yo),_d=hw(Vs.fixed-Ko,fl,Vs.stretch,hn),Th=Vd(Ds.stretch-va,ii,Is,is),Zh=hw(Ds.fixed-Di,lo,Ds.stretch,$r),ld=Vd(Cl.stretch-Fa,Qa,Ms,Yo),ud=hw(Cl.fixed-Ko,fl,Cl.stretch,hn),cd=new i(rf,sv),Xf=new i(Th,sv),lv=new i(Th,ld),Jv=new i(rf,ld),Uv=new i(Yc/We,_d/We),fd=new i(Zh/We,ud/We),Mv=D*Math.PI/180;if(Mv){const Du=Math.sin(Mv),wc=Math.cos(Mv),Oc=[wc,-Du,Du,wc];cd._matMult(Oc),Xf._matMult(Oc),Jv._matMult(Oc),lv._matMult(Oc)}const Hd=$i.stretch+$i.fixed,pf=Vs.stretch+Vs.fixed;return{tl:cd,tr:Xf,bl:Jv,br:lv,tex:{x:Ve.paddedRect.x+r1+Hd,y:Ve.paddedRect.y+r1+pf,w:Ds.stretch+Ds.fixed-Hd,h:Cl.stretch+Cl.fixed-pf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Uv,pixelOffsetBR:fd,minFontScaleX:lo/We/Is,minFontScaleY:fl/We/Ms,isSDF:Q}};if(me&&(Ve.stretchX||Ve.stretchY)){const $i=a1(dr,An,$r),Vs=a1(xr,Bn,hn);for(let Ds=0;Ds<$i.length-1;Ds++){const Cl=$i[Ds],rf=$i[Ds+1];for(let Yc=0;Yc0&&(An=Math.max(10,An),this.circleDiameter=An)}else{const qr=!((xr=We.image)===null||xr===void 0)&&xr.content&&(We.image.textFitWidth||We.image.textFitHeight)?lS(We):{x1:We.left,y1:We.top,x2:We.right,y2:We.bottom};qr.y1=qr.y1*pt-Rt[0],qr.y2=qr.y2*pt+Rt[2],qr.x1=qr.x1*pt-Rt[3],qr.x2=qr.x2*pt+Rt[1];const $r=We.collisionPadding;if($r&&(qr.x1-=$r[0]*pt,qr.y1-=$r[1]*pt,qr.x2+=$r[2]*pt,qr.y2+=$r[3]*pt),dr){const hn=new i(qr.x1,qr.y1),An=new i(qr.x2,qr.y1),Bn=new i(qr.x1,qr.y2),va=new i(qr.x2,qr.y2),ii=dr*Math.PI/180;hn._rotate(ii),An._rotate(ii),Bn._rotate(ii),va._rotate(ii),qr.x1=Math.min(hn.x,An.x,Bn.x,va.x),qr.x2=Math.max(hn.x,An.x,Bn.x,va.x),qr.y1=Math.min(hn.y,An.y,Bn.y,va.y),qr.y2=Math.max(hn.y,An.y,Bn.y,va.y)}D.emplaceBack(Q.x,Q.y,qr.x1,qr.y1,qr.x2,qr.y2,me,Pe,Ve)}this.boxEndIndex=D.length}}class l6{constructor(D=[],Q=(me,Pe)=>mePe?1:0){if(this.data=D,this.length=this.data.length,this.compare=Q,this.length>0)for(let me=(this.length>>1)-1;me>=0;me--)this._down(me)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],Q=this.data.pop();return--this.length>0&&(this.data[0]=Q,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:Q,compare:me}=this,Pe=Q[D];for(;D>0;){const Ve=D-1>>1,We=Q[Ve];if(me(Pe,We)>=0)break;Q[D]=We,D=Ve}Q[D]=Pe}_down(D){const{data:Q,compare:me}=this,Pe=this.length>>1,Ve=Q[D];for(;D=0)break;Q[D]=Q[We],D=We}Q[D]=Ve}}function u6(Y,D=1,Q=!1){let me=1/0,Pe=1/0,Ve=-1/0,We=-1/0;const pt=Y[0];for(let $r=0;$rVe)&&(Ve=hn.x),(!$r||hn.y>We)&&(We=hn.y)}const Rt=Math.min(Ve-me,We-Pe);let Yt=Rt/2;const dr=new l6([],c6);if(Rt===0)return new i(me,Pe);for(let $r=me;$rxr.d||!xr.d)&&(xr=$r,Q&&console.log("found best %d after %d probes",Math.round(1e4*$r.d)/1e4,qr)),$r.max-xr.d<=D||(Yt=$r.h/2,dr.push(new w0($r.p.x-Yt,$r.p.y-Yt,Yt,Y)),dr.push(new w0($r.p.x+Yt,$r.p.y-Yt,Yt,Y)),dr.push(new w0($r.p.x-Yt,$r.p.y+Yt,Yt,Y)),dr.push(new w0($r.p.x+Yt,$r.p.y+Yt,Yt,Y)),qr+=4)}return Q&&(console.log(`num probes: ${qr}`),console.log(`best distance: ${xr.d}`)),xr.p}function c6(Y,D){return D.max-Y.max}function w0(Y,D,Q,me){this.p=new i(Y,D),this.h=Q,this.d=(function(Pe,Ve){let We=!1,pt=1/0;for(let Rt=0;RtPe.y!=hn.y>Pe.y&&Pe.x<(hn.x-$r.x)*(Pe.y-$r.y)/(hn.y-$r.y)+$r.x&&(We=!We),pt=Math.min(pt,Oi(Pe,$r,hn))}}return(We?1:-1)*Math.sqrt(pt)})(this.p,me),this.max=this.d+this.h*Math.SQRT2}var Sv;e.aq=void 0,(Sv=e.aq||(e.aq={}))[Sv.center=1]="center",Sv[Sv.left=2]="left",Sv[Sv.right=3]="right",Sv[Sv.top=4]="top",Sv[Sv.bottom=5]="bottom",Sv[Sv["top-left"]=6]="top-left",Sv[Sv["top-right"]=7]="top-right",Sv[Sv["bottom-left"]=8]="bottom-left",Sv[Sv["bottom-right"]=9]="bottom-right";const Gm=7,tT=Number.POSITIVE_INFINITY;function kS(Y,D){return D[1]!==tT?(function(Q,me,Pe){let Ve=0,We=0;switch(me=Math.abs(me),Pe=Math.abs(Pe),Q){case"top-right":case"top-left":case"top":We=Pe-Gm;break;case"bottom-right":case"bottom-left":case"bottom":We=-Pe+Gm}switch(Q){case"top-right":case"bottom-right":case"right":Ve=-me;break;case"top-left":case"bottom-left":case"left":Ve=me}return[Ve,We]})(Y,D[0],D[1]):(function(Q,me){let Pe=0,Ve=0;me<0&&(me=0);const We=me/Math.SQRT2;switch(Q){case"top-right":case"top-left":Ve=We-Gm;break;case"bottom-right":case"bottom-left":Ve=-We+Gm;break;case"bottom":Ve=-me+Gm;break;case"top":Ve=me-Gm}switch(Q){case"top-right":case"bottom-right":Pe=-We;break;case"top-left":case"bottom-left":Pe=We;break;case"left":Pe=me;break;case"right":Pe=-me}return[Pe,Ve]})(Y,D[0])}function CS(Y,D,Q){var me;const Pe=Y.layout,Ve=(me=Pe.get("text-variable-anchor-offset"))===null||me===void 0?void 0:me.evaluate(D,{},Q);if(Ve){const pt=Ve.values,Rt=[];for(let Yt=0;Ytqr*uc);dr.startsWith("top")?xr[1]-=Gm:dr.startsWith("bottom")&&(xr[1]+=Gm),Rt[Yt+1]=xr}return new da(Rt)}const We=Pe.get("text-variable-anchor");if(We){let pt;pt=Y._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Pe.get("text-radial-offset").evaluate(D,{},Q)*uc,tT]:Pe.get("text-offset").evaluate(D,{},Q).map(Yt=>Yt*uc);const Rt=[];for(const Yt of We)Rt.push(Yt,kS(Yt,pt));return new da(Rt)}return null}function rT(Y){switch(Y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function f6(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){let xr=Ve.textMaxSize.evaluate(D,{});xr===void 0&&(xr=We);const qr=Y.layers[0].layout,$r=qr.get("icon-offset").evaluate(D,{},dr),hn=PS(Q.horizontal),An=We/24,Bn=Y.tilePixelRatio*An,va=Y.tilePixelRatio*xr/24,ii=Y.tilePixelRatio*pt,Fa=Y.tilePixelRatio*qr.get("symbol-spacing"),Qa=qr.get("text-padding")*Y.tilePixelRatio,Di=(function($i,Vs,Ds,Cl=1){const rf=$i.get("icon-padding").evaluate(Vs,{},Ds),Yc=rf&&rf.values;return[Yc[0]*Cl,Yc[1]*Cl,Yc[2]*Cl,Yc[3]*Cl]})(qr,D,dr,Y.tilePixelRatio),lo=qr.get("text-max-angle")/180*Math.PI,Ko=qr.get("text-rotation-alignment")!=="viewport"&&qr.get("symbol-placement")!=="point",fl=qr.get("icon-rotation-alignment")==="map"&&qr.get("symbol-placement")!=="point",is=qr.get("symbol-placement"),Yo=Fa/2,Is=qr.get("icon-text-fit");let Ms;me&&Is!=="none"&&(Y.allowVerticalPlacement&&Q.vertical&&(Ms=uS(me,Q.vertical,Is,qr.get("icon-text-fit-padding"),$r,An)),hn&&(me=uS(me,hn,Is,qr.get("icon-text-fit-padding"),$r,An)));const bs=($i,Vs)=>{Vs.x<0||Vs.x>=Yl||Vs.y<0||Vs.y>=Yl||(function(Ds,Cl,rf,Yc,sv,_d,Th,Zh,ld,ud,cd,Xf,lv,Jv,Uv,fd,Mv,Hd,pf,Du,wc,Oc,Nf,mf,s1){const Kp=Ds.addToLineVertexArray(Cl,rf);let $p,Qv,nf,Ev,Ap=0,Gd=0,hd=0,lT=0,uT=-1,gw=-1;const Q0={};let cT=ia("");if(Ds.allowVerticalPlacement&&Yc.vertical){const jv=Zh.layout.get("text-rotate").evaluate(wc,{},mf)+90;nf=new vw(ld,Cl,ud,cd,Xf,Yc.vertical,lv,Jv,Uv,jv),Th&&(Ev=new vw(ld,Cl,ud,cd,Xf,Th,Mv,Hd,Uv,jv))}if(sv){const jv=Zh.layout.get("icon-rotate").evaluate(wc,{}),Xd=Zh.layout.get("icon-text-fit")!=="none",Xm=ES(sv,jv,Nf,Xd),Jp=Th?ES(Th,jv,Nf,Xd):void 0;Qv=new vw(ld,Cl,ud,cd,Xf,sv,Mv,Hd,!1,jv),Ap=4*Xm.length;const Hg=Ds.iconSizeData;let Qp=null;Hg.kind==="source"?(Qp=[x0*Zh.layout.get("icon-size").evaluate(wc,{})],Qp[0]>qm&&y(`${Ds.layerIds[0]}: Value for "icon-size" is >= ${q_}. Reduce your "icon-size".`)):Hg.kind==="composite"&&(Qp=[x0*Oc.compositeIconSizes[0].evaluate(wc,{},mf),x0*Oc.compositeIconSizes[1].evaluate(wc,{},mf)],(Qp[0]>qm||Qp[1]>qm)&&y(`${Ds.layerIds[0]}: Value for "icon-size" is >= ${q_}. Reduce your "icon-size".`)),Ds.addSymbols(Ds.icon,Xm,Qp,Du,pf,wc,e.ah.none,Cl,Kp.lineStartIndex,Kp.lineLength,-1,mf),uT=Ds.icon.placedSymbolArray.length-1,Jp&&(Gd=4*Jp.length,Ds.addSymbols(Ds.icon,Jp,Qp,Du,pf,wc,e.ah.vertical,Cl,Kp.lineStartIndex,Kp.lineLength,-1,mf),gw=Ds.icon.placedSymbolArray.length-1)}const fT=Object.keys(Yc.horizontal);for(const jv of fT){const Xd=Yc.horizontal[jv];if(!$p){cT=ia(Xd.text);const Jp=Zh.layout.get("text-rotate").evaluate(wc,{},mf);$p=new vw(ld,Cl,ud,cd,Xf,Xd,lv,Jv,Uv,Jp)}const Xm=Xd.positionedLines.length===1;if(hd+=LS(Ds,Cl,Xd,_d,Zh,Uv,wc,fd,Kp,Yc.vertical?e.ah.horizontal:e.ah.horizontalOnly,Xm?fT:[jv],Q0,uT,Oc,mf),Xm)break}Yc.vertical&&(lT+=LS(Ds,Cl,Yc.vertical,_d,Zh,Uv,wc,fd,Kp,e.ah.vertical,["vertical"],Q0,gw,Oc,mf));const hT=$p?$p.boxStartIndex:Ds.collisionBoxArray.length,vT=$p?$p.boxEndIndex:Ds.collisionBoxArray.length,h6=nf?nf.boxStartIndex:Ds.collisionBoxArray.length,v6=nf?nf.boxEndIndex:Ds.collisionBoxArray.length,d6=Qv?Qv.boxStartIndex:Ds.collisionBoxArray.length,p6=Qv?Qv.boxEndIndex:Ds.collisionBoxArray.length,OS=Ev?Ev.boxStartIndex:Ds.collisionBoxArray.length,l1=Ev?Ev.boxEndIndex:Ds.collisionBoxArray.length;let Wh=-1;const u1=(jv,Xd)=>jv&&jv.circleDiameter?Math.max(jv.circleDiameter,Xd):Xd;Wh=u1($p,Wh),Wh=u1(nf,Wh),Wh=u1(Qv,Wh),Wh=u1(Ev,Wh);const dT=Wh>-1?1:0;dT&&(Wh*=s1/uc),Ds.glyphOffsetArray.length>=jg.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),wc.sortKey!==void 0&&Ds.addToSortKeyRanges(Ds.symbolInstances.length,wc.sortKey);const FS=CS(Zh,wc,mf),[m6,BS]=(function(jv,Xd){const Xm=jv.length,Jp=Xd?.values;if(Jp?.length>0)for(let Hg=0;Hg=0?Q0.right:-1,Q0.center>=0?Q0.center:-1,Q0.left>=0?Q0.left:-1,Q0.vertical||-1,uT,gw,cT,hT,vT,h6,v6,d6,p6,OS,l1,ud,hd,lT,Ap,Gd,dT,0,lv,Wh,m6,BS)})(Y,Vs,$i,Q,me,Pe,Ms,Y.layers[0],Y.collisionBoxArray,D.index,D.sourceLayerIndex,Y.index,Bn,[Qa,Qa,Qa,Qa],Ko,Rt,ii,Di,fl,$r,D,Ve,Yt,dr,We)};if(is==="line")for(const $i of wS(D.geometry,0,0,Yl,Yl)){const Vs=s6($i,Fa,lo,Q.vertical||hn,me,24,va,Y.overscaling,Yl);for(const Ds of Vs)hn&&RS(Y,hn.text,Yo,Ds)||bs($i,Ds)}else if(is==="line-center"){for(const $i of D.geometry)if($i.length>1){const Vs=o6($i,lo,Q.vertical||hn,me,24,va);Vs&&bs($i,Vs)}}else if(D.type==="Polygon")for(const $i of jc(D.geometry,0)){const Vs=u6($i,16);bs($i[0],new Hm(Vs.x,Vs.y,0))}else if(D.type==="LineString")for(const $i of D.geometry)bs($i,new Hm($i[0].x,$i[0].y,0));else if(D.type==="Point")for(const $i of D.geometry)for(const Vs of $i)bs([Vs],new Hm(Vs.x,Vs.y,0))}function LS(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn){const An=(function(ii,Fa,Qa,Di,lo,Ko,fl,is){const Yo=Di.layout.get("text-rotate").evaluate(Ko,{})*Math.PI/180,Is=[];for(const Ms of Fa.positionedLines)for(const bs of Ms.positionedGlyphs){if(!bs.rect)continue;const $i=bs.rect||{};let Vs=V3+1,Ds=!0,Cl=1,rf=0;const Yc=(lo||is)&&bs.vertical,sv=bs.metrics.advance*bs.scale/2;if(is&&Fa.verticalizable&&(rf=Ms.lineOffset/2-(bs.imageName?-(uc-bs.metrics.width*bs.scale)/2:(bs.scale-1)*uc)),bs.imageName){const Du=fl[bs.imageName];Ds=Du.sdf,Cl=Du.pixelRatio,Vs=Yh/Cl}const _d=lo?[bs.x+sv,bs.y]:[0,0];let Th=lo?[0,0]:[bs.x+sv+Qa[0],bs.y+Qa[1]-rf],Zh=[0,0];Yc&&(Zh=Th,Th=[0,0]);const ld=bs.metrics.isDoubleResolution?2:1,ud=(bs.metrics.left-Vs)*bs.scale-sv+Th[0],cd=(-bs.metrics.top-Vs)*bs.scale+Th[1],Xf=ud+$i.w/ld*bs.scale/Cl,lv=cd+$i.h/ld*bs.scale/Cl,Jv=new i(ud,cd),Uv=new i(Xf,cd),fd=new i(ud,lv),Mv=new i(Xf,lv);if(Yc){const Du=new i(-sv,sv-$y),wc=-Math.PI/2,Oc=uc/2-sv,Nf=new i(5-$y-Oc,-(bs.imageName?Oc:0)),mf=new i(...Zh);Jv._rotateAround(wc,Du)._add(Nf)._add(mf),Uv._rotateAround(wc,Du)._add(Nf)._add(mf),fd._rotateAround(wc,Du)._add(Nf)._add(mf),Mv._rotateAround(wc,Du)._add(Nf)._add(mf)}if(Yo){const Du=Math.sin(Yo),wc=Math.cos(Yo),Oc=[wc,-Du,Du,wc];Jv._matMult(Oc),Uv._matMult(Oc),fd._matMult(Oc),Mv._matMult(Oc)}const Hd=new i(0,0),pf=new i(0,0);Is.push({tl:Jv,tr:Uv,bl:fd,br:Mv,tex:$i,writingMode:Fa.writingMode,glyphOffset:_d,sectionIndex:bs.sectionIndex,isSDF:Ds,pixelOffsetTL:Hd,pixelOffsetBR:pf,minFontScaleX:0,minFontScaleY:0})}return Is})(0,Q,pt,Pe,Ve,We,me,Y.allowVerticalPlacement),Bn=Y.textSizeData;let va=null;Bn.kind==="source"?(va=[x0*Pe.layout.get("text-size").evaluate(We,{})],va[0]>qm&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${q_}. Reduce your "text-size".`)):Bn.kind==="composite"&&(va=[x0*$r.compositeTextSizes[0].evaluate(We,{},hn),x0*$r.compositeTextSizes[1].evaluate(We,{},hn)],(va[0]>qm||va[1]>qm)&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${q_}. Reduce your "text-size".`)),Y.addSymbols(Y.text,An,va,pt,Ve,We,Yt,D,Rt.lineStartIndex,Rt.lineLength,qr,hn);for(const ii of dr)xr[ii]=Y.text.placedSymbolArray.length-1;return 4*An.length}function PS(Y){for(const D in Y)return Y[D];return null}function RS(Y,D,Q,me){const Pe=Y.compareText;if(D in Pe){const Ve=Pe[D];for(let We=Ve.length-1;We>=0;We--)if(me.dist(Ve[We])>4;if(Pe!==1)throw new Error(`Got v${Pe} data when expected v1.`);const Ve=IS[15&me];if(!Ve)throw new Error("Unrecognized array type.");const[We]=new Uint16Array(D,2,1),[pt]=new Uint32Array(D,4,1);return new nT(pt,We,Ve,D)}constructor(D,Q=64,me=Float64Array,Pe){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+Q,2),65535),this.ArrayType=me,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Ve=IS.indexOf(this.ArrayType),We=2*D*this.ArrayType.BYTES_PER_ELEMENT,pt=D*this.IndexArrayType.BYTES_PER_ELEMENT,Rt=(8-pt%8)%8;if(Ve<0)throw new Error(`Unexpected typed array class: ${me}.`);Pe&&Pe instanceof ArrayBuffer?(this.data=Pe,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+pt+Rt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+We+pt+Rt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+pt+Rt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ve]),new Uint16Array(this.data,2,1)[0]=Q,new Uint32Array(this.data,4,1)[0]=D)}add(D,Q){const me=this._pos>>1;return this.ids[me]=me,this.coords[this._pos++]=D,this.coords[this._pos++]=Q,me}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return aT(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,Q,me,Pe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ve,coords:We,nodeSize:pt}=this,Rt=[0,Ve.length-1,0],Yt=[];for(;Rt.length;){const dr=Rt.pop()||0,xr=Rt.pop()||0,qr=Rt.pop()||0;if(xr-qr<=pt){for(let Bn=qr;Bn<=xr;Bn++){const va=We[2*Bn],ii=We[2*Bn+1];va>=D&&va<=me&&ii>=Q&&ii<=Pe&&Yt.push(Ve[Bn])}continue}const $r=qr+xr>>1,hn=We[2*$r],An=We[2*$r+1];hn>=D&&hn<=me&&An>=Q&&An<=Pe&&Yt.push(Ve[$r]),(dr===0?D<=hn:Q<=An)&&(Rt.push(qr),Rt.push($r-1),Rt.push(1-dr)),(dr===0?me>=hn:Pe>=An)&&(Rt.push($r+1),Rt.push(xr),Rt.push(1-dr))}return Yt}within(D,Q,me){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Pe,coords:Ve,nodeSize:We}=this,pt=[0,Pe.length-1,0],Rt=[],Yt=me*me;for(;pt.length;){const dr=pt.pop()||0,xr=pt.pop()||0,qr=pt.pop()||0;if(xr-qr<=We){for(let Bn=qr;Bn<=xr;Bn++)Nv(Ve[2*Bn],Ve[2*Bn+1],D,Q)<=Yt&&Rt.push(Pe[Bn]);continue}const $r=qr+xr>>1,hn=Ve[2*$r],An=Ve[2*$r+1];Nv(hn,An,D,Q)<=Yt&&Rt.push(Pe[$r]),(dr===0?D-me<=hn:Q-me<=An)&&(pt.push(qr),pt.push($r-1),pt.push(1-dr)),(dr===0?D+me>=hn:Q+me>=An)&&(pt.push($r+1),pt.push(xr),pt.push(1-dr))}return Rt}}function aT(Y,D,Q,me,Pe,Ve){if(Pe-me<=Q)return;const We=me+Pe>>1;DS(Y,D,We,me,Pe,Ve),aT(Y,D,Q,me,We-1,1-Ve),aT(Y,D,Q,We+1,Pe,1-Ve)}function DS(Y,D,Q,me,Pe,Ve){for(;Pe>me;){if(Pe-me>600){const Yt=Pe-me+1,dr=Q-me+1,xr=Math.log(Yt),qr=.5*Math.exp(2*xr/3),$r=.5*Math.sqrt(xr*qr*(Yt-qr)/Yt)*(dr-Yt/2<0?-1:1);DS(Y,D,Q,Math.max(me,Math.floor(Q-dr*qr/Yt+$r)),Math.min(Pe,Math.floor(Q+(Yt-dr)*qr/Yt+$r)),Ve)}const We=D[2*Q+Ve];let pt=me,Rt=Pe;for(i1(Y,D,me,Q),D[2*Pe+Ve]>We&&i1(Y,D,me,Pe);ptWe;)Rt--}D[2*me+Ve]===We?i1(Y,D,me,Rt):(Rt++,i1(Y,D,Rt,Pe)),Rt<=Q&&(me=Rt+1),Q<=Rt&&(Pe=Rt-1)}}function i1(Y,D,Q,me){dw(Y,Q,me),dw(D,2*Q,2*me),dw(D,2*Q+1,2*me+1)}function dw(Y,D,Q){const me=Y[D];Y[D]=Y[Q],Y[Q]=me}function Nv(Y,D,Q,me){const Pe=Y-Q,Ve=D-me;return Pe*Pe+Ve*Ve}var iT;e.bg=void 0,(iT=e.bg||(e.bg={})).create="create",iT.load="load",iT.fullLoad="fullLoad";let pw=null,o1=[];const oT=1e3/60,mw="loadTime",sT="fullLoadTime",zS={mark(Y){performance.mark(Y)},frame(Y){const D=Y;pw!=null&&o1.push(D-pw),pw=D},clearMetrics(){pw=null,o1=[],performance.clearMeasures(mw),performance.clearMeasures(sT);for(const Y in e.bg)performance.clearMarks(e.bg[Y])},getPerformanceMetrics(){performance.measure(mw,e.bg.create,e.bg.load),performance.measure(sT,e.bg.create,e.bg.fullLoad);const Y=performance.getEntriesByName(mw)[0].duration,D=performance.getEntriesByName(sT)[0].duration,Q=o1.length,me=1/(o1.reduce((Ve,We)=>Ve+We,0)/Q/1e3),Pe=o1.filter(Ve=>Ve>oT).reduce((Ve,We)=>Ve+(We-oT)/oT,0);return{loadTime:Y,fullLoadTime:D,fps:me,percentDroppedFrames:Pe/(Q+Pe)*100,totalFrames:Q}}};e.$=class extends Tr{},e.A=Li,e.B=ei,e.C=function(Y){if(z==null){const D=Y.navigator?Y.navigator.userAgent:null;z=!!Y.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Xo,e.E=ae,e.F=class{constructor(Y,D){this.target=Y,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new X_(()=>this.process()),this.subscription=(function(Q,me,Pe,Ve){return Q.addEventListener(me,Pe,!1),{unsubscribe:()=>{Q.removeEventListener(me,Pe,!1)}}})(this.target,"message",Q=>this.receive(Q)),this.globalScope=L(self)?Y:window}registerMessageHandler(Y,D){this.messageHandlers[Y]=D}sendAsync(Y,D){return new Promise((Q,me)=>{const Pe=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Pe]={resolve:Q,reject:me},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Pe];const pt={id:Pe,type:"",origin:location.origin,targetMapId:Y.targetMapId,sourceMapId:this.mapId};this.target.postMessage(pt)},{once:!0});const Ve=[],We=Object.assign(Object.assign({},Y),{id:Pe,sourceMapId:this.mapId,origin:location.origin,data:Go(Y.data,Ve)});this.target.postMessage(We,{transfer:Ve})})}receive(Y){const D=Y.data,Q=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[Q];const me=this.abortControllers[Q];return delete this.abortControllers[Q],void(me&&me.abort())}if(L(self)||D.mustQueue)return this.tasks[Q]=D,this.taskQueue.push(Q),void this.invoker.trigger();this.processTask(Q,D)}}process(){if(this.taskQueue.length===0)return;const Y=this.taskQueue.shift(),D=this.tasks[Y];delete this.tasks[Y],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(Y,D)}processTask(Y,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Pe=this.resolveRejects[Y];return delete this.resolveRejects[Y],Pe?void(D.error?Pe.reject(jo(D.error)):Pe.resolve(jo(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(Y,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const Q=jo(D.data),me=new AbortController;this.abortControllers[Y]=me;try{const Pe=yield this.messageHandlers[D.type](D.sourceMapId,Q,me);this.completeTask(Y,null,Pe)}catch(Pe){this.completeTask(Y,Pe)}})}completeTask(Y,D,Q){const me=[];delete this.abortControllers[Y];const Pe={id:Y,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Go(D):null,data:Go(Q,me)};this.target.postMessage(Pe,{transfer:me})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=le,e.H=function(){var Y=new Li(16);return Li!=Float32Array&&(Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0),Y[0]=1,Y[5]=1,Y[10]=1,Y[15]=1,Y},e.I=Bv,e.J=function(Y,D,Q){var me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,$r,hn,An=Q[0],Bn=Q[1],va=Q[2];return D===Y?(Y[12]=D[0]*An+D[4]*Bn+D[8]*va+D[12],Y[13]=D[1]*An+D[5]*Bn+D[9]*va+D[13],Y[14]=D[2]*An+D[6]*Bn+D[10]*va+D[14],Y[15]=D[3]*An+D[7]*Bn+D[11]*va+D[15]):(Pe=D[1],Ve=D[2],We=D[3],pt=D[4],Rt=D[5],Yt=D[6],dr=D[7],xr=D[8],qr=D[9],$r=D[10],hn=D[11],Y[0]=me=D[0],Y[1]=Pe,Y[2]=Ve,Y[3]=We,Y[4]=pt,Y[5]=Rt,Y[6]=Yt,Y[7]=dr,Y[8]=xr,Y[9]=qr,Y[10]=$r,Y[11]=hn,Y[12]=me*An+pt*Bn+xr*va+D[12],Y[13]=Pe*An+Rt*Bn+qr*va+D[13],Y[14]=Ve*An+Yt*Bn+$r*va+D[14],Y[15]=We*An+dr*Bn+hn*va+D[15]),Y},e.K=function(Y,D,Q){var me=Q[0],Pe=Q[1],Ve=Q[2];return Y[0]=D[0]*me,Y[1]=D[1]*me,Y[2]=D[2]*me,Y[3]=D[3]*me,Y[4]=D[4]*Pe,Y[5]=D[5]*Pe,Y[6]=D[6]*Pe,Y[7]=D[7]*Pe,Y[8]=D[8]*Ve,Y[9]=D[9]*Ve,Y[10]=D[10]*Ve,Y[11]=D[11]*Ve,Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15],Y},e.L=Xn,e.M=function(Y,D){const Q={};for(let me=0;me{const D=window.document.createElement("video");return D.muted=!0,new Promise(Q=>{D.onloadstart=()=>{Q(D)};for(const me of Y){const Pe=window.document.createElement("source");ne(me)||(D.crossOrigin="Anonymous"),Pe.src=me,D.appendChild(Pe)}})},e.a4=function(){return _++},e.a5=ri,e.a6=jg,e.a7=_h,e.a8=gr,e.a9=yS,e.aA=function(Y){if(Y.type==="custom")return new hS(Y);switch(Y.type){case"background":return new G_(Y);case"circle":return new za(Y);case"fill":return new cn(Y);case"fill-extrusion":return new Nd(Y);case"heatmap":return new Qs(Y);case"hillshade":return new Zu(Y);case"line":return new Fg(Y);case"raster":return new i6(Y);case"symbol":return new lw(Y)}},e.aB=u,e.aC=function(Y,D){if(!Y)return[{command:"setStyle",args:[D]}];let Q=[];try{if(!Ce(Y.version,D.version))return[{command:"setStyle",args:[D]}];Ce(Y.center,D.center)||Q.push({command:"setCenter",args:[D.center]}),Ce(Y.zoom,D.zoom)||Q.push({command:"setZoom",args:[D.zoom]}),Ce(Y.bearing,D.bearing)||Q.push({command:"setBearing",args:[D.bearing]}),Ce(Y.pitch,D.pitch)||Q.push({command:"setPitch",args:[D.pitch]}),Ce(Y.sprite,D.sprite)||Q.push({command:"setSprite",args:[D.sprite]}),Ce(Y.glyphs,D.glyphs)||Q.push({command:"setGlyphs",args:[D.glyphs]}),Ce(Y.transition,D.transition)||Q.push({command:"setTransition",args:[D.transition]}),Ce(Y.light,D.light)||Q.push({command:"setLight",args:[D.light]}),Ce(Y.terrain,D.terrain)||Q.push({command:"setTerrain",args:[D.terrain]}),Ce(Y.sky,D.sky)||Q.push({command:"setSky",args:[D.sky]}),Ce(Y.projection,D.projection)||Q.push({command:"setProjection",args:[D.projection]});const me={},Pe=[];(function(We,pt,Rt,Yt){let dr;for(dr in pt=pt||{},We=We||{})Object.prototype.hasOwnProperty.call(We,dr)&&(Object.prototype.hasOwnProperty.call(pt,dr)||Ye(dr,Rt,Yt));for(dr in pt)Object.prototype.hasOwnProperty.call(pt,dr)&&(Object.prototype.hasOwnProperty.call(We,dr)?Ce(We[dr],pt[dr])||(We[dr].type==="geojson"&&pt[dr].type==="geojson"&&st(We,pt,dr)?Fe(Rt,{command:"setGeoJSONSourceData",args:[dr,pt[dr].data]}):it(dr,pt,Rt,Yt)):ze(dr,pt,Rt))})(Y.sources,D.sources,Pe,me);const Ve=[];Y.layers&&Y.layers.forEach(We=>{"source"in We&&me[We.source]?Q.push({command:"removeLayer",args:[We.id]}):Ve.push(We)}),Q=Q.concat(Pe),(function(We,pt,Rt){pt=pt||[];const Yt=(We=We||[]).map(Qe),dr=pt.map(Qe),xr=We.reduce(Le,{}),qr=pt.reduce(Le,{}),$r=Yt.slice(),hn=Object.create(null);let An,Bn,va,ii,Fa;for(let Qa=0,Di=0;Qa@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(Q,me,Pe,Ve)=>{const We=Pe||Ve;return D[me]=!We||We.toLowerCase(),""}),D["max-age"]){const Q=parseInt(D["max-age"],10);isNaN(Q)?delete D["max-age"]:D["max-age"]=Q}return D},e.ab=function(Y,D){const Q=[];for(const me in Y)me in D||Q.push(me);return Q},e.ac=x,e.ad=function(Y,D,Q){var me=Math.sin(Q),Pe=Math.cos(Q),Ve=D[0],We=D[1],pt=D[2],Rt=D[3],Yt=D[4],dr=D[5],xr=D[6],qr=D[7];return D!==Y&&(Y[8]=D[8],Y[9]=D[9],Y[10]=D[10],Y[11]=D[11],Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15]),Y[0]=Ve*Pe+Yt*me,Y[1]=We*Pe+dr*me,Y[2]=pt*Pe+xr*me,Y[3]=Rt*Pe+qr*me,Y[4]=Yt*Pe-Ve*me,Y[5]=dr*Pe-We*me,Y[6]=xr*Pe-pt*me,Y[7]=qr*Pe-Rt*me,Y},e.ae=function(Y){var D=new Li(16);return D[0]=Y[0],D[1]=Y[1],D[2]=Y[2],D[3]=Y[3],D[4]=Y[4],D[5]=Y[5],D[6]=Y[6],D[7]=Y[7],D[8]=Y[8],D[9]=Y[9],D[10]=Y[10],D[11]=Y[11],D[12]=Y[12],D[13]=Y[13],D[14]=Y[14],D[15]=Y[15],D},e.af=Wa,e.ag=function(Y,D){let Q=0,me=0;if(Y.kind==="constant")me=Y.layoutSize;else if(Y.kind!=="source"){const{interpolationType:Pe,minZoom:Ve,maxZoom:We}=Y,pt=Pe?x(li.interpolationFactor(Pe,D,Ve,We),0,1):0;Y.kind==="camera"?me=bo.number(Y.minSize,Y.maxSize,pt):Q=pt}return{uSizeT:Q,uSize:me}},e.ai=function(Y,{uSize:D,uSizeT:Q},{lowerSize:me,upperSize:Pe}){return Y.kind==="source"?me/x0:Y.kind==="composite"?bo.number(me/x0,Pe/x0,Q):D},e.aj=Vm,e.ak=function(Y,D,Q,me){const Pe=D.y-Y.y,Ve=D.x-Y.x,We=me.y-Q.y,pt=me.x-Q.x,Rt=We*Ve-pt*Pe;if(Rt===0)return null;const Yt=(pt*(Y.y-Q.y)-We*(Y.x-Q.x))/Rt;return new i(Y.x+Yt*Ve,Y.y+Yt*Pe)},e.al=wS,e.am=ua,e.an=aa,e.ao=function(Y){let D=1/0,Q=1/0,me=-1/0,Pe=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Pe=Math.max(Pe,Ve.y);return[D,Q,me,Pe]},e.ap=uc,e.ar=X3,e.as=function(Y,D){var Q=D[0],me=D[1],Pe=D[2],Ve=D[3],We=D[4],pt=D[5],Rt=D[6],Yt=D[7],dr=D[8],xr=D[9],qr=D[10],$r=D[11],hn=D[12],An=D[13],Bn=D[14],va=D[15],ii=Q*pt-me*We,Fa=Q*Rt-Pe*We,Qa=Q*Yt-Ve*We,Di=me*Rt-Pe*pt,lo=me*Yt-Ve*pt,Ko=Pe*Yt-Ve*Rt,fl=dr*An-xr*hn,is=dr*Bn-qr*hn,Yo=dr*va-$r*hn,Is=xr*Bn-qr*An,Ms=xr*va-$r*An,bs=qr*va-$r*Bn,$i=ii*bs-Fa*Ms+Qa*Is+Di*Yo-lo*is+Ko*fl;return $i?(Y[0]=(pt*bs-Rt*Ms+Yt*Is)*($i=1/$i),Y[1]=(Pe*Ms-me*bs-Ve*Is)*$i,Y[2]=(An*Ko-Bn*lo+va*Di)*$i,Y[3]=(qr*lo-xr*Ko-$r*Di)*$i,Y[4]=(Rt*Yo-We*bs-Yt*is)*$i,Y[5]=(Q*bs-Pe*Yo+Ve*is)*$i,Y[6]=(Bn*Qa-hn*Ko-va*Fa)*$i,Y[7]=(dr*Ko-qr*Qa+$r*Fa)*$i,Y[8]=(We*Ms-pt*Yo+Yt*fl)*$i,Y[9]=(me*Yo-Q*Ms-Ve*fl)*$i,Y[10]=(hn*lo-An*Qa+va*ii)*$i,Y[11]=(xr*Qa-dr*lo-$r*ii)*$i,Y[12]=(pt*is-We*Is-Rt*fl)*$i,Y[13]=(Q*Is-me*is+Pe*fl)*$i,Y[14]=(An*Fa-hn*Di-Bn*ii)*$i,Y[15]=(dr*Di-xr*Fa+qr*ii)*$i,Y):null},e.at=rT,e.au=G3,e.av=nT,e.aw=function(){const Y={},D=ie.$version;for(const Q in ie.$root){const me=ie.$root[Q];if(me.required){let Pe=null;Pe=Q==="version"?D:me.type==="array"?[]:{},Pe!=null&&(Y[Q]=Pe)}}return Y},e.ax=Yi,e.ay=V,e.az=function(Y){Y=Y.slice();const D=Object.create(null);for(let Q=0;Q25||me<0||me>=1||Q<0||Q>=1)},e.bc=function(Y,D){return Y[0]=D[0],Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[5]=D[1],Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[10]=D[2],Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0,Y[15]=1,Y},e.bd=class extends cr{},e.be=$3,e.bf=zS,e.bh=ce,e.bi=function(Y,D){re.REGISTERED_PROTOCOLS[Y]=D},e.bj=function(Y){delete re.REGISTERED_PROTOCOLS[Y]},e.bk=function(Y,D){const Q={};for(let Pe=0;Pebs*uc)}let is=We?"center":Q.get("text-justify").evaluate(Yt,{},Y.canonical);const Yo=Q.get("symbol-placement")==="point"?Q.get("text-max-width").evaluate(Yt,{},Y.canonical)*uc:1/0,Is=()=>{Y.bucket.allowVerticalPlacement&&ns(Qa)&&(hn.vertical=nw(An,Y.glyphMap,Y.glyphPositions,Y.imagePositions,dr,Yo,Ve,Ko,"left",lo,va,e.ah.vertical,!0,qr,xr))};if(!We&&fl){const Ms=new Set;if(is==="auto")for(let $i=0;$it(void 0,void 0,void 0,function*(){if(Y.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(Y)],{type:"image/png"});try{return createImageBitmap(D)}catch(Q){throw new Error(`Could not load image because of ${Q.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=Y=>new Promise((D,Q)=>{const me=new Image;me.onload=()=>{D(me),URL.revokeObjectURL(me.src),me.onload=null,window.requestAnimationFrame(()=>{me.src=N})},me.onerror=()=>Q(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."));const Pe=new Blob([new Uint8Array(Y)],{type:"image/png"});me.src=Y.byteLength?URL.createObjectURL(Pe):N}),e.g=fe,e.h=(Y,D)=>ee(M(Y,{type:"json"}),D),e.i=L,e.j=H,e.k=te,e.l=(Y,D)=>ee(M(Y,{type:"arrayBuffer"}),D),e.m=ee,e.n=function(Y){return new j3(Y).readFields(JE,[])},e.o=Qo,e.p=rw,e.q=Ue,e.r=ya,e.s=ne,e.t=Va,e.u=Ta,e.v=ie,e.w=y,e.x=function([Y,D,Q]){return D+=90,D*=Math.PI/180,Q*=Math.PI/180,{x:Y*Math.cos(D)*Math.sin(Q),y:Y*Math.sin(D)*Math.sin(Q),z:Y*Math.cos(Q)}},e.y=bo,e.z=dl}),S("worker",["./shared"],function(e){class t{constructor(je){this.keyCache={},je&&this.replace(je)}replace(je){this._layerConfigs={},this._layers={},this.update(je,[])}update(je,$e){for(const xe of je){this._layerConfigs[xe.id]=xe;const ye=this._layers[xe.id]=e.aA(xe);ye._featureFilter=e.a7(ye.filter),this.keyCache[xe.id]&&delete this.keyCache[xe.id]}for(const xe of $e)delete this.keyCache[xe],delete this._layerConfigs[xe],delete this._layers[xe];this.familiesBySource={};const Ee=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const xe of Ee){const ye=xe.map(Ot=>this._layers[Ot.id]),Me=ye[0];if(Me.visibility==="none")continue;const Xe=Me.source||"";let Je=this.familiesBySource[Xe];Je||(Je=this.familiesBySource[Xe]={});const Lt=Me.sourceLayer||"_geojsonTileLayer";let Ct=Je[Lt];Ct||(Ct=Je[Lt]=[]),Ct.push(ye)}}}class r{constructor(je){const $e={},Ee=[];for(const Xe in je){const Je=je[Xe],Lt=$e[Xe]={};for(const Ct in Je){const Ot=Je[+Ct];if(!Ot||Ot.bitmap.width===0||Ot.bitmap.height===0)continue;const Wt={x:0,y:0,w:Ot.bitmap.width+2,h:Ot.bitmap.height+2};Ee.push(Wt),Lt[Ct]={rect:Wt,metrics:Ot.metrics}}}const{w:xe,h:ye}=e.p(Ee),Me=new e.o({width:xe||1,height:ye||1});for(const Xe in je){const Je=je[Xe];for(const Lt in Je){const Ct=Je[+Lt];if(!Ct||Ct.bitmap.width===0||Ct.bitmap.height===0)continue;const Ot=$e[Xe][Lt].rect;e.o.copy(Ct.bitmap,Me,{x:0,y:0},{x:Ot.x+1,y:Ot.y+1},Ct.bitmap)}}this.image=Me,this.positions=$e}}e.bl("GlyphAtlas",r);class o{constructor(je){this.tileID=new e.S(je.tileID.overscaledZ,je.tileID.wrap,je.tileID.canonical.z,je.tileID.canonical.x,je.tileID.canonical.y),this.uid=je.uid,this.zoom=je.zoom,this.pixelRatio=je.pixelRatio,this.tileSize=je.tileSize,this.source=je.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=je.showCollisionBoxes,this.collectResourceTiming=!!je.collectResourceTiming,this.returnDependencies=!!je.returnDependencies,this.promoteId=je.promoteId,this.inFlightDependencies=[]}parse(je,$e,Ee,xe){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=je,this.collisionBoxArray=new e.a5;const ye=new e.bm(Object.keys(je.layers).sort()),Me=new e.bn(this.tileID,this.promoteId);Me.bucketLayerIDs=[];const Xe={},Je={featureIndex:Me,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ee},Lt=$e.familiesBySource[this.source];for(const ra in Lt){const Nn=je.layers[ra];if(!Nn)continue;Nn.version===1&&e.w(`Vector tile source "${this.source}" layer "${ra}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Ea=ye.encode(ra),ja=[];for(let ir=0;ir=qt.maxzoom||qt.visibility!=="none"&&(n(ir,this.zoom,Ee),(Xe[qt.id]=qt.createBucket({index:Me.bucketLayerIDs.length,layers:ir,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ea,sourceID:this.source})).populate(ja,Je,this.tileID.canonical),Me.bucketLayerIDs.push(ir.map(ar=>ar.id)))}}const Ct=e.aF(Je.glyphDependencies,ra=>Object.keys(ra).map(Number));this.inFlightDependencies.forEach(ra=>ra?.abort()),this.inFlightDependencies=[];let Ot=Promise.resolve({});if(Object.keys(Ct).length){const ra=new AbortController;this.inFlightDependencies.push(ra),Ot=xe.sendAsync({type:"GG",data:{stacks:Ct,source:this.source,tileID:this.tileID,type:"glyphs"}},ra)}const Wt=Object.keys(Je.iconDependencies);let _r=Promise.resolve({});if(Wt.length){const ra=new AbortController;this.inFlightDependencies.push(ra),_r=xe.sendAsync({type:"GI",data:{icons:Wt,source:this.source,tileID:this.tileID,type:"icons"}},ra)}const pr=Object.keys(Je.patternDependencies);let hr=Promise.resolve({});if(pr.length){const ra=new AbortController;this.inFlightDependencies.push(ra),hr=xe.sendAsync({type:"GI",data:{icons:pr,source:this.source,tileID:this.tileID,type:"patterns"}},ra)}const[Fr,En,Zn]=yield Promise.all([Ot,_r,hr]),qn=new r(Fr),ta=new e.bo(En,Zn);for(const ra in Xe){const Nn=Xe[ra];Nn instanceof e.a6?(n(Nn.layers,this.zoom,Ee),e.bp({bucket:Nn,glyphMap:Fr,glyphPositions:qn.positions,imageMap:En,imagePositions:ta.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Nn.hasPattern&&(Nn instanceof e.bq||Nn instanceof e.br||Nn instanceof e.bs)&&(n(Nn.layers,this.zoom,Ee),Nn.addFeatures(Je,this.tileID.canonical,ta.patternPositions))}return this.status="done",{buckets:Object.values(Xe).filter(ra=>!ra.isEmpty()),featureIndex:Me,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:qn.image,imageAtlas:ta,glyphMap:this.returnDependencies?Fr:null,iconMap:this.returnDependencies?En:null,glyphPositions:this.returnDependencies?qn.positions:null}})}}function n(Mt,je,$e){const Ee=new e.z(je);for(const xe of Mt)xe.recalculate(Ee,$e)}class i{constructor(je,$e,Ee){this.actor=je,this.layerIndex=$e,this.availableImages=Ee,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(je,$e){return e._(this,void 0,void 0,function*(){const Ee=yield e.l(je.request,$e);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Ee.data)),rawData:Ee.data,cacheControl:Ee.cacheControl,expires:Ee.expires}}catch(xe){const ye=new Uint8Array(Ee.data);let Me=`Unable to parse the tile at ${je.request.url}, `;throw Me+=ye[0]===31&&ye[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${xe.message}`,new Error(Me)}})}loadTile(je){return e._(this,void 0,void 0,function*(){const $e=je.uid,Ee=!!(je&&je.request&&je.request.collectResourceTiming)&&new e.bv(je.request),xe=new o(je);this.loading[$e]=xe;const ye=new AbortController;xe.abort=ye;try{const Me=yield this.loadVectorTile(je,ye);if(delete this.loading[$e],!Me)return null;const Xe=Me.rawData,Je={};Me.expires&&(Je.expires=Me.expires),Me.cacheControl&&(Je.cacheControl=Me.cacheControl);const Lt={};if(Ee){const Ot=Ee.finish();Ot&&(Lt.resourceTiming=JSON.parse(JSON.stringify(Ot)))}xe.vectorTile=Me.vectorTile;const Ct=xe.parse(Me.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[$e]=xe,this.fetching[$e]={rawTileData:Xe,cacheControl:Je,resourceTiming:Lt};try{const Ot=yield Ct;return e.e({rawTileData:Xe.slice(0)},Ot,Je,Lt)}finally{delete this.fetching[$e]}}catch(Me){throw delete this.loading[$e],xe.status="done",this.loaded[$e]=xe,Me}})}reloadTile(je){return e._(this,void 0,void 0,function*(){const $e=je.uid;if(!this.loaded||!this.loaded[$e])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Ee=this.loaded[$e];if(Ee.showCollisionBoxes=je.showCollisionBoxes,Ee.status==="parsing"){const xe=yield Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor);let ye;if(this.fetching[$e]){const{rawTileData:Me,cacheControl:Xe,resourceTiming:Je}=this.fetching[$e];delete this.fetching[$e],ye=e.e({rawTileData:Me.slice(0)},xe,Xe,Je)}else ye=xe;return ye}if(Ee.status==="done"&&Ee.vectorTile)return Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(je){return e._(this,void 0,void 0,function*(){const $e=this.loading,Ee=je.uid;$e&&$e[Ee]&&$e[Ee].abort&&($e[Ee].abort.abort(),delete $e[Ee])})}removeTile(je){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[je.uid]&&delete this.loaded[je.uid]})}}class a{constructor(){this.loaded={}}loadTile(je){return e._(this,void 0,void 0,function*(){const{uid:$e,encoding:Ee,rawImageData:xe,redFactor:ye,greenFactor:Me,blueFactor:Xe,baseShift:Je}=je,Lt=xe.width+2,Ct=xe.height+2,Ot=e.b(xe)?new e.R({width:Lt,height:Ct},yield e.bw(xe,-1,-1,Lt,Ct)):xe,Wt=new e.bx($e,Ot,Ee,ye,Me,Xe,Je);return this.loaded=this.loaded||{},this.loaded[$e]=Wt,Wt})}removeTile(je){const $e=this.loaded,Ee=je.uid;$e&&$e[Ee]&&delete $e[Ee]}}function s(Mt,je){if(Mt.length!==0){f(Mt[0],je);for(var $e=1;$e=Math.abs(Xe)?$e-Je+Xe:Xe-Je+$e,$e=Je}$e+Ee>=0!=!!je&&Mt.reverse()}var c=e.by(function Mt(je,$e){var Ee,xe=je&&je.type;if(xe==="FeatureCollection")for(Ee=0;Ee>31}function L(Mt,je){for(var $e=Mt.loadGeometry(),Ee=Mt.type,xe=0,ye=0,Me=$e.length,Xe=0;XeMt},B=Math.fround||(R=new Float32Array(1),Mt=>(R[0]=+Mt,R[0]));var R;const U=3,j=5,Z=6;class re{constructor(je){this.options=Object.assign(Object.create(N),je),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(je){const{log:$e,minZoom:Ee,maxZoom:xe}=this.options;$e&&console.time("total time");const ye=`prepare ${je.length} points`;$e&&console.time(ye),this.points=je;const Me=[];for(let Je=0;Je=Ee;Je--){const Lt=+Date.now();Xe=this.trees[Je]=this._createTree(this._cluster(Xe,Je)),$e&&console.log("z%d: %d clusters in %dms",Je,Xe.numItems,+Date.now()-Lt)}return $e&&console.timeEnd("total time"),this}getClusters(je,$e){let Ee=((je[0]+180)%360+360)%360-180;const xe=Math.max(-90,Math.min(90,je[1]));let ye=je[2]===180?180:((je[2]+180)%360+360)%360-180;const Me=Math.max(-90,Math.min(90,je[3]));if(je[2]-je[0]>=360)Ee=-180,ye=180;else if(Ee>ye){const Ot=this.getClusters([Ee,xe,180,Me],$e),Wt=this.getClusters([-180,xe,ye,Me],$e);return Ot.concat(Wt)}const Xe=this.trees[this._limitZoom($e)],Je=Xe.range(ce(Ee),V(Me),ce(ye),V(xe)),Lt=Xe.data,Ct=[];for(const Ot of Je){const Wt=this.stride*Ot;Ct.push(Lt[Wt+j]>1?fe(Lt,Wt,this.clusterProps):this.points[Lt[Wt+U]])}return Ct}getChildren(je){const $e=this._getOriginId(je),Ee=this._getOriginZoom(je),xe="No cluster with the specified id.",ye=this.trees[Ee];if(!ye)throw new Error(xe);const Me=ye.data;if($e*this.stride>=Me.length)throw new Error(xe);const Xe=this.options.radius/(this.options.extent*Math.pow(2,Ee-1)),Je=ye.within(Me[$e*this.stride],Me[$e*this.stride+1],Xe),Lt=[];for(const Ct of Je){const Ot=Ct*this.stride;Me[Ot+4]===je&&Lt.push(Me[Ot+j]>1?fe(Me,Ot,this.clusterProps):this.points[Me[Ot+U]])}if(Lt.length===0)throw new Error(xe);return Lt}getLeaves(je,$e,Ee){const xe=[];return this._appendLeaves(xe,je,$e=$e||10,Ee=Ee||0,0),xe}getTile(je,$e,Ee){const xe=this.trees[this._limitZoom(je)],ye=Math.pow(2,je),{extent:Me,radius:Xe}=this.options,Je=Xe/Me,Lt=(Ee-Je)/ye,Ct=(Ee+1+Je)/ye,Ot={features:[]};return this._addTileFeatures(xe.range(($e-Je)/ye,Lt,($e+1+Je)/ye,Ct),xe.data,$e,Ee,ye,Ot),$e===0&&this._addTileFeatures(xe.range(1-Je/ye,Lt,1,Ct),xe.data,ye,Ee,ye,Ot),$e===ye-1&&this._addTileFeatures(xe.range(0,Lt,Je/ye,Ct),xe.data,-1,Ee,ye,Ot),Ot.features.length?Ot:null}getClusterExpansionZoom(je){let $e=this._getOriginZoom(je)-1;for(;$e<=this.options.maxZoom;){const Ee=this.getChildren(je);if($e++,Ee.length!==1)break;je=Ee[0].properties.cluster_id}return $e}_appendLeaves(je,$e,Ee,xe,ye){const Me=this.getChildren($e);for(const Xe of Me){const Je=Xe.properties;if(Je&&Je.cluster?ye+Je.point_count<=xe?ye+=Je.point_count:ye=this._appendLeaves(je,Je.cluster_id,Ee,xe,ye):ye1;let Ct,Ot,Wt;if(Lt)Ct=le($e,Je,this.clusterProps),Ot=$e[Je],Wt=$e[Je+1];else{const hr=this.points[$e[Je+U]];Ct=hr.properties;const[Fr,En]=hr.geometry.coordinates;Ot=ce(Fr),Wt=V(En)}const _r={type:1,geometry:[[Math.round(this.options.extent*(Ot*ye-Ee)),Math.round(this.options.extent*(Wt*ye-xe))]],tags:Ct};let pr;pr=Lt||this.options.generateId?$e[Je+U]:this.points[$e[Je+U]].id,pr!==void 0&&(_r.id=pr),Me.features.push(_r)}}_limitZoom(je){return Math.max(this.options.minZoom,Math.min(Math.floor(+je),this.options.maxZoom+1))}_cluster(je,$e){const{radius:Ee,extent:xe,reduce:ye,minPoints:Me}=this.options,Xe=Ee/(xe*Math.pow(2,$e)),Je=je.data,Lt=[],Ct=this.stride;for(let Ot=0;Ot$e&&(Fr+=Je[Zn+j])}if(Fr>hr&&Fr>=Me){let En,Zn=Wt*hr,qn=_r*hr,ta=-1;const ra=((Ot/Ct|0)<<5)+($e+1)+this.points.length;for(const Nn of pr){const Ea=Nn*Ct;if(Je[Ea+2]<=$e)continue;Je[Ea+2]=$e;const ja=Je[Ea+j];Zn+=Je[Ea]*ja,qn+=Je[Ea+1]*ja,Je[Ea+4]=ra,ye&&(En||(En=this._map(Je,Ot,!0),ta=this.clusterProps.length,this.clusterProps.push(En)),ye(En,this._map(Je,Ea)))}Je[Ot+4]=ra,Lt.push(Zn/Fr,qn/Fr,1/0,ra,-1,Fr),ye&&Lt.push(ta)}else{for(let En=0;En1)for(const En of pr){const Zn=En*Ct;if(!(Je[Zn+2]<=$e)){Je[Zn+2]=$e;for(let qn=0;qn>5}_getOriginZoom(je){return(je-this.points.length)%32}_map(je,$e,Ee){if(je[$e+j]>1){const Me=this.clusterProps[je[$e+Z]];return Ee?Object.assign({},Me):Me}const xe=this.points[je[$e+U]].properties,ye=this.options.map(xe);return Ee&&ye===xe?Object.assign({},ye):ye}}function fe(Mt,je,$e){return{type:"Feature",id:Mt[je+U],properties:le(Mt,je,$e),geometry:{type:"Point",coordinates:[(Ee=Mt[je],360*(Ee-.5)),ee(Mt[je+1])]}};var Ee}function le(Mt,je,$e){const Ee=Mt[je+j],xe=Ee>=1e4?`${Math.round(Ee/1e3)}k`:Ee>=1e3?Math.round(Ee/100)/10+"k":Ee,ye=Mt[je+Z],Me=ye===-1?{}:Object.assign({},$e[ye]);return Object.assign(Me,{cluster:!0,cluster_id:Mt[je+U],point_count:Ee,point_count_abbreviated:xe})}function ce(Mt){return Mt/360+.5}function V(Mt){const je=Math.sin(Mt*Math.PI/180),$e=.5-.25*Math.log((1+je)/(1-je))/Math.PI;return $e<0?0:$e>1?1:$e}function ee(Mt){const je=(180-360*Mt)*Math.PI/180;return 360*Math.atan(Math.exp(je))/Math.PI-90}function ne(Mt,je,$e,Ee){let xe=Ee;const ye=je+($e-je>>1);let Me,Xe=$e-je;const Je=Mt[je],Lt=Mt[je+1],Ct=Mt[$e],Ot=Mt[$e+1];for(let Wt=je+3;Wt<$e;Wt+=3){const _r=K(Mt[Wt],Mt[Wt+1],Je,Lt,Ct,Ot);if(_r>xe)Me=Wt,xe=_r;else if(_r===xe){const pr=Math.abs(Wt-ye);prEe&&(Me-je>3&&ne(Mt,je,Me,Ee),Mt[Me+2]=xe,$e-Me>3&&ne(Mt,Me,$e,Ee))}function K(Mt,je,$e,Ee,xe,ye){let Me=xe-$e,Xe=ye-Ee;if(Me!==0||Xe!==0){const Je=((Mt-$e)*Me+(je-Ee)*Xe)/(Me*Me+Xe*Xe);Je>1?($e=xe,Ee=ye):Je>0&&($e+=Me*Je,Ee+=Xe*Je)}return Me=Mt-$e,Xe=je-Ee,Me*Me+Xe*Xe}function ue(Mt,je,$e,Ee){const xe={id:Mt??null,type:je,geometry:$e,tags:Ee,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(je==="Point"||je==="MultiPoint"||je==="LineString")te(xe,$e);else if(je==="Polygon")te(xe,$e[0]);else if(je==="MultiLineString")for(const ye of $e)te(xe,ye);else if(je==="MultiPolygon")for(const ye of $e)te(xe,ye[0]);return xe}function te(Mt,je){for(let $e=0;$e0&&(Me+=Ee?(xe*Ct-Lt*ye)/2:Math.sqrt(Math.pow(Lt-xe,2)+Math.pow(Ct-ye,2))),xe=Lt,ye=Ct}const Xe=je.length-3;je[2]=1,ne(je,0,Xe,$e),je[Xe+2]=1,je.size=Math.abs(Me),je.start=0,je.end=je.size}function ve(Mt,je,$e,Ee){for(let xe=0;xe1?1:$e}function Fe(Mt,je,$e,Ee,xe,ye,Me,Xe){if(Ee/=je,ye>=($e/=je)&&Me=Ee)return null;const Je=[];for(const Lt of Mt){const Ct=Lt.geometry;let Ot=Lt.type;const Wt=xe===0?Lt.minX:Lt.minY,_r=xe===0?Lt.maxX:Lt.maxY;if(Wt>=$e&&_r=Ee)continue;let pr=[];if(Ot==="Point"||Ot==="MultiPoint")ze(Ct,pr,$e,Ee,xe);else if(Ot==="LineString")Ye(Ct,pr,$e,Ee,xe,!1,Xe.lineMetrics);else if(Ot==="MultiLineString")st(Ct,pr,$e,Ee,xe,!1);else if(Ot==="Polygon")st(Ct,pr,$e,Ee,xe,!0);else if(Ot==="MultiPolygon")for(const hr of Ct){const Fr=[];st(hr,Fr,$e,Ee,xe,!0),Fr.length&&pr.push(Fr)}if(pr.length){if(Xe.lineMetrics&&Ot==="LineString"){for(const hr of pr)Je.push(ue(Lt.id,Ot,hr,Lt.tags));continue}Ot!=="LineString"&&Ot!=="MultiLineString"||(pr.length===1?(Ot="LineString",pr=pr[0]):Ot="MultiLineString"),Ot!=="Point"&&Ot!=="MultiPoint"||(Ot=pr.length===3?"Point":"MultiPoint"),Je.push(ue(Lt.id,Ot,pr,Lt.tags))}}return Je.length?Je:null}function ze(Mt,je,$e,Ee,xe){for(let ye=0;ye=$e&&Me<=Ee&&nt(je,Mt[ye],Mt[ye+1],Mt[ye+2])}}function Ye(Mt,je,$e,Ee,xe,ye,Me){let Xe=it(Mt);const Je=xe===0?Qe:Le;let Lt,Ct,Ot=Mt.start;for(let Fr=0;Fr$e&&(Ct=Je(Xe,En,Zn,ta,ra,$e),Me&&(Xe.start=Ot+Lt*Ct)):Nn>Ee?Ea=$e&&(Ct=Je(Xe,En,Zn,ta,ra,$e),ja=!0),Ea>Ee&&Nn<=Ee&&(Ct=Je(Xe,En,Zn,ta,ra,Ee),ja=!0),!ye&&ja&&(Me&&(Xe.end=Ot+Lt*Ct),je.push(Xe),Xe=it(Mt)),Me&&(Ot+=Lt)}let Wt=Mt.length-3;const _r=Mt[Wt],pr=Mt[Wt+1],hr=xe===0?_r:pr;hr>=$e&&hr<=Ee&&nt(Xe,_r,pr,Mt[Wt+2]),Wt=Xe.length-3,ye&&Wt>=3&&(Xe[Wt]!==Xe[0]||Xe[Wt+1]!==Xe[1])&&nt(Xe,Xe[0],Xe[1],Xe[2]),Xe.length&&je.push(Xe)}function it(Mt){const je=[];return je.size=Mt.size,je.start=Mt.start,je.end=Mt.end,je}function st(Mt,je,$e,Ee,xe,ye){for(const Me of Mt)Ye(Me,je,$e,Ee,xe,ye,!1)}function nt(Mt,je,$e,Ee){Mt.push(je,$e,Ee)}function Qe(Mt,je,$e,Ee,xe,ye){const Me=(ye-je)/(Ee-je);return nt(Mt,ye,$e+(xe-$e)*Me,1),Me}function Le(Mt,je,$e,Ee,xe,ye){const Me=(ye-$e)/(xe-$e);return nt(Mt,je+(Ee-je)*Me,ye,1),Me}function Te(Mt,je){const $e=[];for(let Ee=0;Ee0&&je.size<(xe?Me:Ee))return void($e.numPoints+=je.length/3);const Xe=[];for(let Je=0;JeMe)&&($e.numSimplified++,Xe.push(je[Je],je[Je+1])),$e.numPoints++;xe&&(function(Je,Lt){let Ct=0;for(let Ot=0,Wt=Je.length,_r=Wt-2;Ot0===Lt)for(let Ot=0,Wt=Je.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if($e.promoteId&&$e.generateId)throw new Error("promoteId and generateId cannot be used together.");let xe=(function(ye,Me){const Xe=[];if(ye.type==="FeatureCollection")for(let Je=0;Je1&&console.time("creation"),_r=this.tiles[Wt]=ct(je,$e,Ee,xe,Lt),this.tileCoords.push({z:$e,x:Ee,y:xe}),Ct)){Ct>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",$e,Ee,xe,_r.numFeatures,_r.numPoints,_r.numSimplified),console.timeEnd("creation"));const ja=`z${$e}`;this.stats[ja]=(this.stats[ja]||0)+1,this.total++}if(_r.source=je,ye==null){if($e===Lt.indexMaxZoom||_r.numPoints<=Lt.indexMaxPoints)continue}else{if($e===Lt.maxZoom||$e===ye)continue;if(ye!=null){const ja=ye-$e;if(Ee!==Me>>ja||xe!==Xe>>ja)continue}}if(_r.source=null,je.length===0)continue;Ct>1&&console.time("clipping");const pr=.5*Lt.buffer/Lt.extent,hr=.5-pr,Fr=.5+pr,En=1+pr;let Zn=null,qn=null,ta=null,ra=null,Nn=Fe(je,Ot,Ee-pr,Ee+Fr,0,_r.minX,_r.maxX,Lt),Ea=Fe(je,Ot,Ee+hr,Ee+En,0,_r.minX,_r.maxX,Lt);je=null,Nn&&(Zn=Fe(Nn,Ot,xe-pr,xe+Fr,1,_r.minY,_r.maxY,Lt),qn=Fe(Nn,Ot,xe+hr,xe+En,1,_r.minY,_r.maxY,Lt),Nn=null),Ea&&(ta=Fe(Ea,Ot,xe-pr,xe+Fr,1,_r.minY,_r.maxY,Lt),ra=Fe(Ea,Ot,xe+hr,xe+En,1,_r.minY,_r.maxY,Lt),Ea=null),Ct>1&&console.timeEnd("clipping"),Je.push(Zn||[],$e+1,2*Ee,2*xe),Je.push(qn||[],$e+1,2*Ee,2*xe+1),Je.push(ta||[],$e+1,2*Ee+1,2*xe),Je.push(ra||[],$e+1,2*Ee+1,2*xe+1)}}getTile(je,$e,Ee){je=+je,$e=+$e,Ee=+Ee;const xe=this.options,{extent:ye,debug:Me}=xe;if(je<0||je>24)return null;const Xe=1<1&&console.log("drilling down to z%d-%d-%d",je,$e,Ee);let Lt,Ct=je,Ot=$e,Wt=Ee;for(;!Lt&&Ct>0;)Ct--,Ot>>=1,Wt>>=1,Lt=this.tiles[rr(Ct,Ot,Wt)];return Lt&&Lt.source?(Me>1&&(console.log("found parent tile z%d-%d-%d",Ct,Ot,Wt),console.time("drilling down")),this.splitTile(Lt.source,Ct,Ot,Wt,je,$e,Ee),Me>1&&console.timeEnd("drilling down"),this.tiles[Je]?Ne(this.tiles[Je],ye):null):null}}function rr(Mt,je,$e){return 32*((1<{Ot.properties=_r;const pr={};for(const hr of Wt)pr[hr]=Je[hr].evaluate(Ct,Ot);return pr},Me.reduce=(_r,pr)=>{Ot.properties=pr;for(const hr of Wt)Ct.accumulated=_r[hr],_r[hr]=Lt[hr].evaluate(Ct,Ot)},Me})(je)).load((yield this._pendingData).features):(xe=yield this._pendingData,new $t(xe,je.geojsonVtOptions)),this.loaded={};const ye={};if(Ee){const Me=Ee.finish();Me&&(ye.resourceTiming={},ye.resourceTiming[je.source]=JSON.parse(JSON.stringify(Me)))}return ye}catch(ye){if(delete this._pendingRequest,e.bB(ye))return{abandoned:!0};throw ye}var xe})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(je){const $e=this.loaded;return $e&&$e[je.uid]?super.reloadTile(je):this.loadTile(je)}loadAndProcessGeoJSON(je,$e){return e._(this,void 0,void 0,function*(){let Ee=yield this.loadGeoJSON(je,$e);if(delete this._pendingRequest,typeof Ee!="object")throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(c(Ee,!0),je.filter){const xe=e.bC(je.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(xe.result==="error")throw new Error(xe.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(Me=>xe.value.evaluate({zoom:0},Me))}}return Ee})}loadGeoJSON(je,$e){return e._(this,void 0,void 0,function*(){const{promoteId:Ee}=je;if(je.request){const xe=yield e.h(je.request,$e);return this._dataUpdateable=Sr(xe.data,Ee)?Zr(xe.data,Ee):void 0,xe.data}if(typeof je.data=="string")try{const xe=JSON.parse(je.data);return this._dataUpdateable=Sr(xe,Ee)?Zr(xe,Ee):void 0,xe}catch{throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`)}if(!je.dataDiff)throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${je.source}`);return(function(xe,ye,Me){var Xe,Je,Lt,Ct;if(ye.removeAll&&xe.clear(),ye.remove)for(const Ot of ye.remove)xe.delete(Ot);if(ye.add)for(const Ot of ye.add){const Wt=Mr(Ot,Me);Wt!=null&&xe.set(Wt,Ot)}if(ye.update)for(const Ot of ye.update){let Wt=xe.get(Ot.id);if(Wt==null)continue;const _r=!Ot.removeAllProperties&&(((Xe=Ot.removeProperties)===null||Xe===void 0?void 0:Xe.length)>0||((Je=Ot.addOrUpdateProperties)===null||Je===void 0?void 0:Je.length)>0);if((Ot.newGeometry||Ot.removeAllProperties||_r)&&(Wt=Object.assign({},Wt),xe.set(Ot.id,Wt),_r&&(Wt.properties=Object.assign({},Wt.properties))),Ot.newGeometry&&(Wt.geometry=Ot.newGeometry),Ot.removeAllProperties)Wt.properties={};else if(((Lt=Ot.removeProperties)===null||Lt===void 0?void 0:Lt.length)>0)for(const pr of Ot.removeProperties)Object.prototype.hasOwnProperty.call(Wt.properties,pr)&&delete Wt.properties[pr];if(((Ct=Ot.addOrUpdateProperties)===null||Ct===void 0?void 0:Ct.length)>0)for(const{key:pr,value:hr}of Ot.addOrUpdateProperties)Wt.properties[pr]=hr}})(this._dataUpdateable,je.dataDiff,Ee),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(je){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(je){return this._geoJSONIndex.getClusterExpansionZoom(je.clusterId)}getClusterChildren(je){return this._geoJSONIndex.getChildren(je.clusterId)}getClusterLeaves(je){return this._geoJSONIndex.getLeaves(je.clusterId,je.limit,je.offset)}}class Br{constructor(je){this.self=je,this.actor=new e.F(je),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=($e,Ee)=>{if(this.externalWorkerSourceTypes[$e])throw new Error(`Worker source with name "${$e}" already registered.`);this.externalWorkerSourceTypes[$e]=Ee},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=$e=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods($e)},this.actor.registerMessageHandler("LDT",($e,Ee)=>this._getDEMWorkerSource($e,Ee.source).loadTile(Ee)),this.actor.registerMessageHandler("RDT",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource($e,Ee.source).removeTile(Ee)})),this.actor.registerMessageHandler("GCEZ",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterExpansionZoom(Ee)})),this.actor.registerMessageHandler("GCC",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterChildren(Ee)})),this.actor.registerMessageHandler("GCL",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterLeaves(Ee)})),this.actor.registerMessageHandler("LD",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).loadData(Ee)),this.actor.registerMessageHandler("GD",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).getData()),this.actor.registerMessageHandler("LT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).loadTile(Ee)),this.actor.registerMessageHandler("RT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).reloadTile(Ee)),this.actor.registerMessageHandler("AT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).abortTile(Ee)),this.actor.registerMessageHandler("RMT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).removeTile(Ee)),this.actor.registerMessageHandler("RS",($e,Ee)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[$e]||!this.workerSources[$e][Ee.type]||!this.workerSources[$e][Ee.type][Ee.source])return;const xe=this.workerSources[$e][Ee.type][Ee.source];delete this.workerSources[$e][Ee.type][Ee.source],xe.removeSource!==void 0&&xe.removeSource(Ee)})),this.actor.registerMessageHandler("RM",$e=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[$e],delete this.availableImages[$e],delete this.workerSources[$e],delete this.demWorkerSources[$e]})),this.actor.registerMessageHandler("SR",($e,Ee)=>e._(this,void 0,void 0,function*(){this.referrer=Ee})),this.actor.registerMessageHandler("SRPS",($e,Ee)=>this._syncRTLPluginState($e,Ee)),this.actor.registerMessageHandler("IS",($e,Ee)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Ee)})),this.actor.registerMessageHandler("SI",($e,Ee)=>this._setImages($e,Ee)),this.actor.registerMessageHandler("UL",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getLayerIndex($e).update(Ee.layers,Ee.removedIds)})),this.actor.registerMessageHandler("SL",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getLayerIndex($e).replace(Ee)}))}_setImages(je,$e){return e._(this,void 0,void 0,function*(){this.availableImages[je]=$e;for(const Ee in this.workerSources[je]){const xe=this.workerSources[je][Ee];for(const ye in xe)xe[ye].availableImages=$e}})}_syncRTLPluginState(je,$e){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if($e.pluginStatus!=="loading")return e.bD.setState($e),$e;const Ee=$e.pluginURL;if(this.self.importScripts(Ee),e.bD.isParsed()){const xe={pluginStatus:"loaded",pluginURL:Ee};return e.bD.setState(xe),xe}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Ee}`)})}_getAvailableImages(je){let $e=this.availableImages[je];return $e||($e=[]),$e}_getLayerIndex(je){let $e=this.layerIndexes[je];return $e||($e=this.layerIndexes[je]=new t),$e}_getWorkerSource(je,$e,Ee){if(this.workerSources[je]||(this.workerSources[je]={}),this.workerSources[je][$e]||(this.workerSources[je][$e]={}),!this.workerSources[je][$e][Ee]){const xe={sendAsync:(ye,Me)=>(ye.targetMapId=je,this.actor.sendAsync(ye,Me))};switch($e){case"vector":this.workerSources[je][$e][Ee]=new i(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;case"geojson":this.workerSources[je][$e][Ee]=new Ar(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;default:this.workerSources[je][$e][Ee]=new this.externalWorkerSourceTypes[$e](xe,this._getLayerIndex(je),this._getAvailableImages(je))}}return this.workerSources[je][$e][Ee]}_getDEMWorkerSource(je,$e){return this.demWorkerSources[je]||(this.demWorkerSources[je]={}),this.demWorkerSources[je][$e]||(this.demWorkerSources[je][$e]=new a),this.demWorkerSources[je][$e]}}return e.i(self)&&(self.worker=new Br(self)),Br}),S("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,n;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ue=>new Promise((P,oe)=>{const Se=requestAnimationFrame(P);Ue.signal.addEventListener("abort",()=>{cancelAnimationFrame(Se),oe(t.c())})}),getImageData(Ue,P=0){return this.getImageCanvasContext(Ue).getImageData(-P,-P,Ue.width+2*P,Ue.height+2*P)},getImageCanvasContext(Ue){const P=window.document.createElement("canvas"),oe=P.getContext("2d",{willReadFrequently:!0});if(!oe)throw new Error("failed to create canvas 2d context");return P.width=Ue.width,P.height=Ue.height,oe.drawImage(Ue,0,0,Ue.width,Ue.height),oe},resolveURL:Ue=>(o||(o=document.createElement("a")),o.href=Ue,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(P){if(!a.docStyle)return P[0];for(let oe=0;oe{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(P){const oe=P.getBoundingClientRect();return{x:oe.width/P.offsetWidth||1,y:oe.height/P.offsetHeight||1,boundingClientRect:oe}}static getPoint(P,oe,Se){const ke=oe.boundingClientRect;return new t.P((Se.clientX-ke.left)/oe.x-P.clientLeft,(Se.clientY-ke.top)/oe.y-P.clientTop)}static mousePos(P,oe){const Se=a.getScale(P);return a.getPoint(P,Se,oe)}static touchPos(P,oe){const Se=[],ke=a.getScale(P);for(let Be=0;Be{f&&T(f),f=null,d=!0},c.onerror=()=>{p=!0,f=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Ue){let P,oe,Se,ke;Ue.resetRequestQueue=()=>{P=[],oe=0,Se=0,ke={}},Ue.addThrottleControl=Gt=>{const cr=Se++;return ke[cr]=Gt,cr},Ue.removeThrottleControl=Gt=>{delete ke[Gt],gt()},Ue.getImage=(Gt,cr,Tr=!0)=>new Promise((kr,Qr)=>{s.supported&&(Gt.headers||(Gt.headers={}),Gt.headers.accept="image/webp,*/*"),t.e(Gt,{type:"image"}),P.push({abortController:cr,requestParameters:Gt,supportImageRefresh:Tr,state:"queued",onError:yn=>{Qr(yn)},onSuccess:yn=>{kr(yn)}}),gt()});const Be=Gt=>t._(this,void 0,void 0,function*(){Gt.state="running";const{requestParameters:cr,supportImageRefresh:Tr,onError:kr,onSuccess:Qr,abortController:yn}=Gt,Ze=Tr===!1&&!t.i(self)&&!t.g(cr.url)&&(!cr.headers||Object.keys(cr.headers).reduce((_t,zt)=>_t&&zt==="accept",!0));oe++;const et=Ze?kt(cr,yn):t.m(cr,yn);try{const _t=yield et;delete Gt.abortController,Gt.state="completed",_t.data instanceof HTMLImageElement||t.b(_t.data)?Qr(_t):_t.data&&Qr({data:yield(ft=_t.data,typeof createImageBitmap=="function"?t.d(ft):t.f(ft)),cacheControl:_t.cacheControl,expires:_t.expires})}catch(_t){delete Gt.abortController,kr(_t)}finally{oe--,gt()}var ft}),gt=()=>{const Gt=(()=>{for(const cr of Object.keys(ke))if(ke[cr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let cr=oe;cr0;cr++){const Tr=P.shift();Tr.abortController.signal.aborted?cr--:Be(Tr)}},kt=(Gt,cr)=>new Promise((Tr,kr)=>{const Qr=new Image,yn=Gt.url,Ze=Gt.credentials;Ze&&Ze==="include"?Qr.crossOrigin="use-credentials":(Ze&&Ze==="same-origin"||!t.s(yn))&&(Qr.crossOrigin="anonymous"),cr.signal.addEventListener("abort",()=>{Qr.src="",kr(t.c())}),Qr.fetchPriority="high",Qr.onload=()=>{Qr.onerror=Qr.onload=null,Tr({data:Qr})},Qr.onerror=()=>{Qr.onerror=Qr.onload=null,cr.signal.aborted||kr(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."))},Qr.src=yn})})(l||(l={})),l.resetRequestQueue();class g{constructor(P){this._transformRequestFn=P}transformRequest(P,oe){return this._transformRequestFn&&this._transformRequestFn(P,oe)||{url:P}}setTransformRequest(P){this._transformRequestFn=P}}function x(Ue){var P=new t.A(3);return P[0]=Ue[0],P[1]=Ue[1],P[2]=Ue[2],P}var A,M=function(Ue,P,oe){return Ue[0]=P[0]-oe[0],Ue[1]=P[1]-oe[1],Ue[2]=P[2]-oe[2],Ue};A=new t.A(3),t.A!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0);var _=function(Ue){var P=Ue[0],oe=Ue[1];return P*P+oe*oe};function w(Ue){const P=[];if(typeof Ue=="string")P.push({id:"default",url:Ue});else if(Ue&&Ue.length>0){const oe=[];for(const{id:Se,url:ke}of Ue){const Be=`${Se}${ke}`;oe.indexOf(Be)===-1&&(oe.push(Be),P.push({id:Se,url:ke}))}}return P}function m(Ue,P,oe){const Se=Ue.split("?");return Se[0]+=`${P}${oe}`,Se.join("?")}(function(){var Ue=new t.A(2);t.A!=Float32Array&&(Ue[0]=0,Ue[1]=0)})();class u{constructor(P,oe,Se,ke){this.context=P,this.format=Se,this.texture=P.gl.createTexture(),this.update(oe,ke)}update(P,oe,Se){const{width:ke,height:Be}=P,gt=!(this.size&&this.size[0]===ke&&this.size[1]===Be||Se),{context:kt}=this,{gl:Gt}=kt;if(this.useMipmap=!!(oe&&oe.useMipmap),Gt.bindTexture(Gt.TEXTURE_2D,this.texture),kt.pixelStoreUnpackFlipY.set(!1),kt.pixelStoreUnpack.set(1),kt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Gt.RGBA&&(!oe||oe.premultiply!==!1)),gt)this.size=[ke,Be],P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,this.format,Gt.UNSIGNED_BYTE,P):Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,ke,Be,0,this.format,Gt.UNSIGNED_BYTE,P.data);else{const{x:cr,y:Tr}=Se||{x:0,y:0};P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Gt.texSubImage2D(Gt.TEXTURE_2D,0,cr,Tr,Gt.RGBA,Gt.UNSIGNED_BYTE,P):Gt.texSubImage2D(Gt.TEXTURE_2D,0,cr,Tr,ke,Be,Gt.RGBA,Gt.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Gt.generateMipmap(Gt.TEXTURE_2D)}bind(P,oe,Se){const{context:ke}=this,{gl:Be}=ke;Be.bindTexture(Be.TEXTURE_2D,this.texture),Se!==Be.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Se=Be.LINEAR),P!==this.filter&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,P),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Se||P),this.filter=P),oe!==this.wrap&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,oe),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,oe),this.wrap=oe)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:P}=this.context;P.deleteTexture(this.texture),this.texture=null}}function v(Ue){const{userImage:P}=Ue;return!!(P&&P.render&&P.render())&&(Ue.data.replace(new Uint8Array(P.data.buffer)),!0)}class y 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(P){if(this.loaded!==P&&(this.loaded=P,P)){for(const{ids:oe,promiseResolve:Se}of this.requestors)Se(this._getImagesForIds(oe));this.requestors=[]}}getImage(P){const oe=this.images[P];if(oe&&!oe.data&&oe.spriteData){const Se=oe.spriteData;oe.data=new t.R({width:Se.width,height:Se.height},Se.context.getImageData(Se.x,Se.y,Se.width,Se.height).data),oe.spriteData=null}return oe}addImage(P,oe){if(this.images[P])throw new Error(`Image id ${P} already exist, use updateImage instead`);this._validate(P,oe)&&(this.images[P]=oe)}_validate(P,oe){let Se=!0;const ke=oe.data||oe.spriteData;return this._validateStretch(oe.stretchX,ke&&ke.width)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchX" value`))),Se=!1),this._validateStretch(oe.stretchY,ke&&ke.height)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchY" value`))),Se=!1),this._validateContent(oe.content,oe)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "content" value`))),Se=!1),Se}_validateStretch(P,oe){if(!P)return!0;let Se=0;for(const ke of P){if(ke[0]{let ke=!0;if(!this.isLoaded())for(const Be of P)this.images[Be]||(ke=!1);this.isLoaded()||ke?oe(this._getImagesForIds(P)):this.requestors.push({ids:P,promiseResolve:oe})})}_getImagesForIds(P){const oe={};for(const Se of P){let ke=this.getImage(Se);ke||(this.fire(new t.k("styleimagemissing",{id:Se})),ke=this.getImage(Se)),ke?oe[Se]={data:ke.data.clone(),pixelRatio:ke.pixelRatio,sdf:ke.sdf,version:ke.version,stretchX:ke.stretchX,stretchY:ke.stretchY,content:ke.content,textFitWidth:ke.textFitWidth,textFitHeight:ke.textFitHeight,hasRenderCallback:!!(ke.userImage&&ke.userImage.render)}:t.w(`Image "${Se}" 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 oe}getPixelSize(){const{width:P,height:oe}=this.atlasImage;return{width:P,height:oe}}getPattern(P){const oe=this.patterns[P],Se=this.getImage(P);if(!Se)return null;if(oe&&oe.position.version===Se.version)return oe.position;if(oe)oe.position.version=Se.version;else{const ke={w:Se.data.width+2,h:Se.data.height+2,x:0,y:0},Be=new t.I(ke,Se);this.patterns[P]={bin:ke,position:Be}}return this._updatePatternAtlas(),this.patterns[P].position}bind(P){const oe=P.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(P,this.atlasImage,oe.RGBA),this.atlasTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE)}_updatePatternAtlas(){const P=[];for(const Be in this.patterns)P.push(this.patterns[Be].bin);const{w:oe,h:Se}=t.p(P),ke=this.atlasImage;ke.resize({width:oe||1,height:Se||1});for(const Be in this.patterns){const{bin:gt}=this.patterns[Be],kt=gt.x+1,Gt=gt.y+1,cr=this.getImage(Be).data,Tr=cr.width,kr=cr.height;t.R.copy(cr,ke,{x:0,y:0},{x:kt,y:Gt},{width:Tr,height:kr}),t.R.copy(cr,ke,{x:0,y:kr-1},{x:kt,y:Gt-1},{width:Tr,height:1}),t.R.copy(cr,ke,{x:0,y:0},{x:kt,y:Gt+kr},{width:Tr,height:1}),t.R.copy(cr,ke,{x:Tr-1,y:0},{x:kt-1,y:Gt},{width:1,height:kr}),t.R.copy(cr,ke,{x:0,y:0},{x:kt+Tr,y:Gt},{width:1,height:kr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(P){for(const oe of P){if(this.callbackDispatchedThisFrame[oe])continue;this.callbackDispatchedThisFrame[oe]=!0;const Se=this.getImage(oe);Se||t.w(`Image with ID: "${oe}" was not found`),v(Se)&&this.updateImage(oe,Se)}}}const I=1e20;function L(Ue,P,oe,Se,ke,Be,gt,kt,Gt){for(let cr=P;cr-1);Gt++,Be[Gt]=kt,gt[Gt]=cr,gt[Gt+1]=I}for(let kt=0,Gt=0;kt65535)throw new Error("glyphs > 65535 not supported");if(Se.ranges[Be])return{stack:P,id:oe,glyph:ke};if(!this.url)throw new Error("glyphsUrl is not set");if(!Se.requests[Be]){const kt=F.loadGlyphRange(P,Be,this.url,this.requestManager);Se.requests[Be]=kt}const gt=yield Se.requests[Be];for(const kt in gt)this._doesCharSupportLocalGlyph(+kt)||(Se.glyphs[+kt]=gt[+kt]);return Se.ranges[Be]=!0,{stack:P,id:oe,glyph:gt[oe]||null}})}_doesCharSupportLocalGlyph(P){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(P))}_tinySDF(P,oe,Se){const ke=this.localIdeographFontFamily;if(!ke||!this._doesCharSupportLocalGlyph(Se))return;let Be=P.tinySDF;if(!Be){let kt="400";/bold/i.test(oe)?kt="900":/medium/i.test(oe)?kt="500":/light/i.test(oe)&&(kt="200"),Be=P.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:ke,fontWeight:kt})}const gt=Be.draw(String.fromCharCode(Se));return{id:Se,bitmap:new t.o({width:gt.width||60,height:gt.height||60},gt.data),metrics:{width:gt.glyphWidth/2||24,height:gt.glyphHeight/2||24,left:gt.glyphLeft/2+.5||0,top:gt.glyphTop/2-27.5||-8,advance:gt.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(Ue,P,oe,Se){return t._(this,void 0,void 0,function*(){const ke=256*P,Be=ke+255,gt=Se.transformRequest(oe.replace("{fontstack}",Ue).replace("{range}",`${ke}-${Be}`),"Glyphs"),kt=yield t.l(gt,new AbortController);if(!kt||!kt.data)throw new Error(`Could not load glyph range. range: ${P}, ${ke}-${Be}`);const Gt={};for(const cr of t.n(kt.data))Gt[cr.id]=cr;return Gt})},F.TinySDF=class{constructor({fontSize:Ue=24,buffer:P=3,radius:oe=8,cutoff:Se=.25,fontFamily:ke="sans-serif",fontWeight:Be="normal",fontStyle:gt="normal"}={}){this.buffer=P,this.cutoff=Se,this.radius=oe;const kt=this.size=Ue+4*P,Gt=this._createCanvas(kt),cr=this.ctx=Gt.getContext("2d",{willReadFrequently:!0});cr.font=`${gt} ${Be} ${Ue}px ${ke}`,cr.textBaseline="alphabetic",cr.textAlign="left",cr.fillStyle="black",this.gridOuter=new Float64Array(kt*kt),this.gridInner=new Float64Array(kt*kt),this.f=new Float64Array(kt),this.z=new Float64Array(kt+1),this.v=new Uint16Array(kt)}_createCanvas(Ue){const P=document.createElement("canvas");return P.width=P.height=Ue,P}draw(Ue){const{width:P,actualBoundingBoxAscent:oe,actualBoundingBoxDescent:Se,actualBoundingBoxLeft:ke,actualBoundingBoxRight:Be}=this.ctx.measureText(Ue),gt=Math.ceil(oe),kt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Be-ke))),Gt=Math.min(this.size-this.buffer,gt+Math.ceil(Se)),cr=kt+2*this.buffer,Tr=Gt+2*this.buffer,kr=Math.max(cr*Tr,0),Qr=new Uint8ClampedArray(kr),yn={data:Qr,width:cr,height:Tr,glyphWidth:kt,glyphHeight:Gt,glyphTop:gt,glyphLeft:0,glyphAdvance:P};if(kt===0||Gt===0)return yn;const{ctx:Ze,buffer:et,gridInner:ft,gridOuter:_t}=this;Ze.clearRect(et,et,kt,Gt),Ze.fillText(Ue,et,et+gt);const zt=Ze.getImageData(et,et,kt,Gt);_t.fill(I,0,kr),ft.fill(0,0,kr);for(let Et=0;Et0?Lr*Lr:0,ft[wr]=Lr<0?Lr*Lr:0}}L(_t,0,0,cr,Tr,cr,this.f,this.v,this.z),L(ft,et,et,kt,Gt,cr,this.f,this.v,this.z);for(let Et=0;Et1&&(Gt=P[++kt]);const Tr=Math.abs(cr-Gt.left),kr=Math.abs(cr-Gt.right),Qr=Math.min(Tr,kr);let yn;const Ze=Be/Se*(ke+1);if(Gt.isDash){const et=ke-Math.abs(Ze);yn=Math.sqrt(Qr*Qr+et*et)}else yn=ke-Math.sqrt(Qr*Qr+Ze*Ze);this.data[gt+cr]=Math.max(0,Math.min(255,yn+128))}}}addRegularDash(P){for(let kt=P.length-1;kt>=0;--kt){const Gt=P[kt],cr=P[kt+1];Gt.zeroLength?P.splice(kt,1):cr&&cr.isDash===Gt.isDash&&(cr.left=Gt.left,P.splice(kt,1))}const oe=P[0],Se=P[P.length-1];oe.isDash===Se.isDash&&(oe.left=Se.left-this.width,Se.right=oe.right+this.width);const ke=this.width*this.nextRow;let Be=0,gt=P[Be];for(let kt=0;kt1&&(gt=P[++Be]);const Gt=Math.abs(kt-gt.left),cr=Math.abs(kt-gt.right),Tr=Math.min(Gt,cr);this.data[ke+kt]=Math.max(0,Math.min(255,(gt.isDash?Tr:-Tr)+128))}}addDash(P,oe){const Se=oe?7:0,ke=2*Se+1;if(this.nextRow+ke>this.height)return t.w("LineAtlas out of space"),null;let Be=0;for(let kt=0;kt{oe.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[re]}numActive(){return Object.keys(this.active).length}}const le=Math.floor(i.hardwareConcurrency/2);let ce,V;function ee(){return ce||(ce=new fe),ce}fe.workerCount=t.C(globalThis)?Math.max(Math.min(le,3),1):1;class ne{constructor(P,oe){this.workerPool=P,this.actors=[],this.currentActor=0,this.id=oe;const Se=this.workerPool.acquire(oe);for(let ke=0;ke{oe.remove()}),this.actors=[],P&&this.workerPool.release(this.id)}registerMessageHandler(P,oe){for(const Se of this.actors)Se.registerMessageHandler(P,oe)}}function K(){return V||(V=new ne(ee(),t.G),V.registerMessageHandler("GR",(Ue,P,oe)=>t.m(P,oe))),V}function ue(Ue,P){const oe=t.H();return t.J(oe,oe,[1,1,0]),t.K(oe,oe,[.5*Ue.width,.5*Ue.height,1]),t.L(oe,oe,Ue.calculatePosMatrix(P.toUnwrapped()))}function te(Ue,P,oe,Se,ke,Be){const gt=(function(kr,Qr,yn){if(kr)for(const Ze of kr){const et=Qr[Ze];if(et&&et.source===yn&&et.type==="fill-extrusion")return!0}else for(const Ze in Qr){const et=Qr[Ze];if(et.source===yn&&et.type==="fill-extrusion")return!0}return!1})(ke&&ke.layers,P,Ue.id),kt=Be.maxPitchScaleFactor(),Gt=Ue.tilesIn(Se,kt,gt);Gt.sort(H);const cr=[];for(const kr of Gt)cr.push({wrappedTileID:kr.tileID.wrapped().key,queryResults:kr.tile.queryRenderedFeatures(P,oe,Ue._state,kr.queryGeometry,kr.cameraQueryGeometry,kr.scale,ke,Be,kt,ue(Ue.transform,kr.tileID))});const Tr=(function(kr){const Qr={},yn={};for(const Ze of kr){const et=Ze.queryResults,ft=Ze.wrappedTileID,_t=yn[ft]=yn[ft]||{};for(const zt in et){const Et=et[zt],Ut=_t[zt]=_t[zt]||{},mr=Qr[zt]=Qr[zt]||[];for(const wr of Et)Ut[wr.featureIndex]||(Ut[wr.featureIndex]=!0,mr.push(wr))}}return Qr})(cr);for(const kr in Tr)Tr[kr].forEach(Qr=>{const yn=Qr.feature,Ze=Ue.getFeatureState(yn.layer["source-layer"],yn.id);yn.source=yn.layer.source,yn.layer["source-layer"]&&(yn.sourceLayer=yn.layer["source-layer"]),yn.state=Ze});return Tr}function H(Ue,P){const oe=Ue.tileID,Se=P.tileID;return oe.overscaledZ-Se.overscaledZ||oe.canonical.y-Se.canonical.y||oe.wrap-Se.wrap||oe.canonical.x-Se.canonical.x}function ae(Ue,P,oe){return t._(this,void 0,void 0,function*(){let Se=Ue;if(Ue.url?Se=(yield t.h(P.transformRequest(Ue.url,"Source"),oe)).data:yield i.frameAsync(oe),!Se)return null;const ke=t.M(t.e(Se,Ue),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Se&&Se.vector_layers&&(ke.vectorLayerIds=Se.vector_layers.map(Be=>Be.id)),ke})}class ie{constructor(P,oe){P&&(oe?this.setSouthWest(P).setNorthEast(oe):Array.isArray(P)&&(P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1])))}setNorthEast(P){return this._ne=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}setSouthWest(P){return this._sw=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}extend(P){const oe=this._sw,Se=this._ne;let ke,Be;if(P instanceof t.N)ke=P,Be=P;else{if(!(P instanceof ie))return Array.isArray(P)?P.length===4||P.every(Array.isArray)?this.extend(ie.convert(P)):this.extend(t.N.convert(P)):P&&("lng"in P||"lon"in P)&&"lat"in P?this.extend(t.N.convert(P)):this;if(ke=P._sw,Be=P._ne,!ke||!Be)return this}return oe||Se?(oe.lng=Math.min(ke.lng,oe.lng),oe.lat=Math.min(ke.lat,oe.lat),Se.lng=Math.max(Be.lng,Se.lng),Se.lat=Math.max(Be.lat,Se.lat)):(this._sw=new t.N(ke.lng,ke.lat),this._ne=new t.N(Be.lng,Be.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(P){const{lng:oe,lat:Se}=t.N.convert(P);let ke=this._sw.lng<=oe&&oe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(ke=this._sw.lng>=oe&&oe>=this._ne.lng),this._sw.lat<=Se&&Se<=this._ne.lat&&ke}static convert(P){return P instanceof ie?P:P&&new ie(P)}static fromLngLat(P,oe=0){const Se=360*oe/40075017,ke=Se/Math.cos(Math.PI/180*P.lat);return new ie(new t.N(P.lng-ke,P.lat-Se),new t.N(P.lng+ke,P.lat+Se))}adjustAntiMeridian(){const P=new t.N(this._sw.lng,this._sw.lat),oe=new t.N(this._ne.lng,this._ne.lat);return new ie(P,P.lng>oe.lng?new t.N(oe.lng+360,oe.lat):oe)}}class ve{constructor(P,oe,Se){this.bounds=ie.convert(this.validateBounds(P)),this.minzoom=oe||0,this.maxzoom=Se||24}validateBounds(P){return Array.isArray(P)&&P.length===4?[Math.max(-180,P[0]),Math.max(-90,P[1]),Math.min(180,P[2]),Math.min(90,P[3])]:[-180,-90,180,90]}contains(P){const oe=Math.pow(2,P.z),Se=Math.floor(t.O(this.bounds.getWest())*oe),ke=Math.floor(t.Q(this.bounds.getNorth())*oe),Be=Math.ceil(t.O(this.bounds.getEast())*oe),gt=Math.ceil(t.Q(this.bounds.getSouth())*oe);return P.x>=Se&&P.x=ke&&P.y{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Se={request:this.map._requestManager.transformRequest(oe,"Tile"),uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,tileSize:this.tileSize*P.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Se.request.collectResourceTiming=this._collectResourceTiming;let ke="RT";if(P.actor&&P.state!=="expired"){if(P.state==="loading")return new Promise((Be,gt)=>{P.reloadPromise={resolve:Be,reject:gt}})}else P.actor=this.dispatcher.getActor(),ke="LT";P.abortController=new AbortController;try{const Be=yield P.actor.sendAsync({type:ke,data:Se},P.abortController);if(delete P.abortController,P.aborted)return;this._afterTileLoadWorkerResponse(P,Be)}catch(Be){if(delete P.abortController,P.aborted)return;if(Be&&Be.status!==404)throw Be;this._afterTileLoadWorkerResponse(P,null)}})}_afterTileLoadWorkerResponse(P,oe){if(oe&&oe.resourceTiming&&(P.resourceTiming=oe.resourceTiming),oe&&this.map._refreshExpiredTiles&&P.setExpiryData(oe),P.loadVectorData(oe,this.map.painter),P.reloadPromise){const Se=P.reloadPromise;P.reloadPromise=null,this.loadTile(P).then(Se.resolve).catch(Se.reject)}}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.actor&&(yield P.actor.sendAsync({type:"AT",data:{uid:P.uid,type:this.type,source:this.id}}))})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),P.actor&&(yield P.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ce extends t.E{constructor(P,oe,Se,ke){super(),this.id=P,this.dispatcher=Se,this.setEventedParent(ke),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"},oe),t.e(this,t.M(oe,["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{const P=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,P&&(t.e(this,P),P.bounds&&(this.tileBounds=new ve(P.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(P){this._tileJSONRequest=null,this.fire(new t.j(P))}})}loaded(){return this._loaded}onAdd(P){this.map=P,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(P){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}serialize(){return t.e({},this._options)}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);P.abortController=new AbortController;try{const Se=yield l.getImage(this.map._requestManager.transformRequest(oe,"Tile"),P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(Se&&Se.data){this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&P.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});const ke=this.map.painter.context,Be=ke.gl,gt=Se.data;P.texture=this.map.painter.getTileTexture(gt.width),P.texture?P.texture.update(gt,{useMipmap:!0}):(P.texture=new u(ke,gt,Be.RGBA,{useMipmap:!0}),P.texture.bind(Be.LINEAR,Be.CLAMP_TO_EDGE,Be.LINEAR_MIPMAP_NEAREST)),P.state="loaded"}}catch(Se){if(delete P.abortController,P.aborted)P.state="unloaded";else if(Se)throw P.state="errored",Se}})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController)})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.texture&&this.map.painter.saveTileTexture(P.texture)})}hasTransition(){return!1}}class Fe extends Ce{constructor(P,oe,Se,ke){super(P,oe,Se,ke),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},oe),this.encoding=oe.encoding||"mapbox",this.redFactor=oe.redFactor,this.greenFactor=oe.greenFactor,this.blueFactor=oe.blueFactor,this.baseShift=oe.baseShift}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Se=this.map._requestManager.transformRequest(oe,"Tile");P.neighboringTiles=this._getNeighboringTiles(P.tileID),P.abortController=new AbortController;try{const ke=yield l.getImage(Se,P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(ke&&ke.data){const Be=ke.data;this.map._refreshExpiredTiles&&ke.cacheControl&&ke.expires&&P.setExpiryData({cacheControl:ke.cacheControl,expires:ke.expires});const gt=t.b(Be)&&t.U()?Be:yield this.readImageNow(Be),kt={type:this.type,uid:P.uid,source:this.id,rawImageData:gt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!P.actor||P.state==="expired"){P.actor=this.dispatcher.getActor();const Gt=yield P.actor.sendAsync({type:"LDT",data:kt});P.dem=Gt,P.needsHillshadePrepare=!0,P.needsTerrainPrepare=!0,P.state="loaded"}}}catch(ke){if(delete P.abortController,P.aborted)P.state="unloaded";else if(ke)throw P.state="errored",ke}})}readImageNow(P){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const oe=P.width+2,Se=P.height+2;try{return new t.R({width:oe,height:Se},yield t.W(P,-1,-1,oe,Se))}catch{}}return i.getImageData(P,1)})}_getNeighboringTiles(P){const oe=P.canonical,Se=Math.pow(2,oe.z),ke=(oe.x-1+Se)%Se,Be=oe.x===0?P.wrap-1:P.wrap,gt=(oe.x+1+Se)%Se,kt=oe.x+1===Se?P.wrap+1:P.wrap,Gt={};return Gt[new t.S(P.overscaledZ,Be,oe.z,ke,oe.y).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,gt,oe.y).key]={backfilled:!1},oe.y>0&&(Gt[new t.S(P.overscaledZ,Be,oe.z,ke,oe.y-1).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,P.wrap,oe.z,oe.x,oe.y-1).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,gt,oe.y-1).key]={backfilled:!1}),oe.y+10&&t.e(Be,{resourceTiming:ke}),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"content"})))}catch(Se){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Se))}})}loaded(){return this._pendingLoads===0}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.actor?"RT":"LT";P.actor=this.actor;const Se={type:this.type,uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};P.abortController=new AbortController;const ke=yield this.actor.sendAsync({type:oe,data:Se},P.abortController);delete P.abortController,P.unloadVectorData(),P.aborted||P.loadVectorData(ke,this.map.painter,oe==="RT")})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.aborted=!0})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:P.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 Ye=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class it extends t.E{constructor(P,oe,Se,ke){super(),this.id=P,this.dispatcher=Se,this.coordinates=oe.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(ke),this.options=oe}load(P){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{const oe=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,oe&&oe.data&&(this.image=oe.data,P&&(this.coordinates=P),this._finishLoading())}catch(oe){this._request=null,this._loaded=!0,this.fire(new t.j(oe))}})}loaded(){return this._loaded}updateImage(P){return P.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=P.url,this.load(P.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(P){this.map=P,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(P){this.coordinates=P;const oe=P.map(t.Z.fromLngLat);this.tileID=(function(ke){let Be=1/0,gt=1/0,kt=-1/0,Gt=-1/0;for(const Qr of ke)Be=Math.min(Be,Qr.x),gt=Math.min(gt,Qr.y),kt=Math.max(kt,Qr.x),Gt=Math.max(Gt,Qr.y);const cr=Math.max(kt-Be,Gt-gt),Tr=Math.max(0,Math.floor(-Math.log(cr)/Math.LN2)),kr=Math.pow(2,Tr);return new t.a1(Tr,Math.floor((Be+kt)/2*kr),Math.floor((gt+Gt)/2*kr))})(oe),this.minzoom=this.maxzoom=this.tileID.z;const Se=oe.map(ke=>this.tileID.getTilePoint(ke)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Se[0].x,Se[0].y,0,0),this._boundsArray.emplaceBack(Se[1].x,Se[1].y,t.X,0),this._boundsArray.emplaceBack(Se[3].x,Se[3].y,0,t.X),this._boundsArray.emplaceBack(Se[2].x,Se[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;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(P,this.image,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Se=!1;for(const ke in this.tiles){const Be=this.tiles[ke];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(P){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(P.tileID.canonical)?(this.tiles[String(P.tileID.wrap)]=P,P.buckets={}):P.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class st extends it{constructor(P,oe,Se,ke){super(P,oe,Se,ke),this.roundZoom=!0,this.type="video",this.options=oe}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const P=this.options;this.urls=[];for(const oe of P.urls)this.urls.push(this.map._requestManager.transformRequest(oe,"Source").url);try{const oe=yield t.a3(this.urls);if(this._loaded=!0,!oe)return;this.video=oe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(oe){this.fire(new t.j(oe))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(P){if(this.video){const oe=this.video.seekable;Poe.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${oe.start(0)} and ${oe.end(0)}-second mark.`))):this.video.currentTime=P}}getVideo(){return this.video}onAdd(P){this.map||(this.map=P,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),oe.texSubImage2D(oe.TEXTURE_2D,0,0,0,oe.RGBA,oe.UNSIGNED_BYTE,this.video)):(this.texture=new u(P,this.video,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Se=!1;for(const ke in this.tiles){const Be=this.tiles[ke];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Se=!0)}Se&&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 nt extends it{constructor(P,oe,Se,ke){super(P,oe,Se,ke),oe.coordinates?Array.isArray(oe.coordinates)&&oe.coordinates.length===4&&!oe.coordinates.some(Be=>!Array.isArray(Be)||Be.length!==2||Be.some(gt=>typeof gt!="number"))||this.fire(new t.j(new t.a2(`sources.${P}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${P}`,null,'missing required property "coordinates"'))),oe.animate&&typeof oe.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${P}`,null,'optional "animate" property must be a boolean value'))),oe.canvas?typeof oe.canvas=="string"||oe.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${P}`,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.${P}`,null,'missing required property "canvas"'))),this.options=oe,this.animate=oe.animate===void 0||oe.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(P){this.map=P,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let P=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,P=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,P=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const oe=this.map.painter.context,Se=oe.gl;this.boundsBuffer||(this.boundsBuffer=oe.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(P||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(oe,this.canvas,Se.RGBA,{premultiply:!0});let ke=!1;for(const Be in this.tiles){const gt=this.tiles[Be];gt.state!=="loaded"&&(gt.state="loaded",gt.texture=this.texture,ke=!0)}ke&&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(const P of[this.canvas.width,this.canvas.height])if(isNaN(P)||P<=0)return!0;return!1}}const Qe={},Le=Ue=>{switch(Ue){case"geojson":return ze;case"image":return it;case"raster":return Ce;case"raster-dem":return Fe;case"vector":return Ae;case"video":return st;case"canvas":return nt}return Qe[Ue]},Te="RTLPluginLoaded";class pe extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=K()}_syncState(P){return this.status=P,this.dispatcher.broadcast("SRPS",{pluginStatus:P,pluginURL:this.url}).catch(oe=>{throw this.status="error",oe})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(P){return t._(this,arguments,void 0,function*(oe,Se=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(oe),!this.url)throw new Error(`requested url ${oe} is invalid`);if(this.status==="unavailable"){if(!Se)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(Te))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ne=null;function ot(){return Ne||(Ne=new pe),Ne}class ct{constructor(P,oe){this.timeAdded=0,this.fadeEndTime=0,this.tileID=P,this.uid=t.a4(),this.uses=0,this.tileSize=oe,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(P){const oe=P+this.timeAdded;oeBe.getLayer(cr)).filter(Boolean);if(Gt.length!==0){kt.layers=Gt,kt.stateDependentLayerIds&&(kt.stateDependentLayers=kt.stateDependentLayerIds.map(cr=>Gt.filter(Tr=>Tr.id===cr)[0]));for(const cr of Gt)gt[cr.id]=kt}}return gt})(P.buckets,oe.style),this.hasSymbolBuckets=!1;for(const ke in this.buckets){const Be=this.buckets[ke];if(Be instanceof t.a6){if(this.hasSymbolBuckets=!0,!Se)break;Be.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const ke in this.buckets){const Be=this.buckets[ke];if(Be instanceof t.a6&&Be.hasRTLText){this.hasRTLText=!0,ot().lazyLoad();break}}this.queryPadding=0;for(const ke in this.buckets){const Be=this.buckets[ke];this.queryPadding=Math.max(this.queryPadding,oe.style.getLayer(ke).queryRadius(Be))}P.imageAtlas&&(this.imageAtlas=P.imageAtlas),P.glyphAtlasImage&&(this.glyphAtlasImage=P.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const P in this.buckets)this.buckets[P].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(P){return this.buckets[P.id]}upload(P){for(const Se in this.buckets){const ke=this.buckets[Se];ke.uploadPending()&&ke.upload(P)}const oe=P.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(P,this.imageAtlas.image,oe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(P,this.glyphAtlasImage,oe.ALPHA),this.glyphAtlasImage=null)}prepare(P){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(P,this.imageAtlasTexture)}queryRenderedFeatures(P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:ke,cameraQueryGeometry:Be,scale:gt,tileSize:this.tileSize,pixelPosMatrix:Tr,transform:Gt,params:kt,queryPadding:this.queryPadding*cr},P,oe,Se):{}}querySourceFeatures(P,oe){const Se=this.latestFeatureIndex;if(!Se||!Se.rawTileData)return;const ke=Se.loadVTLayers(),Be=oe&&oe.sourceLayer?oe.sourceLayer:"",gt=ke._geojsonTileLayer||ke[Be];if(!gt)return;const kt=t.a7(oe&&oe.filter),{z:Gt,x:cr,y:Tr}=this.tileID.canonical,kr={z:Gt,x:cr,y:Tr};for(let Qr=0;QrSe)ke=!1;else if(oe)if(this.expirationTime{this.remove(P,Be)},Se)),this.data[ke].push(Be),this.order.push(ke),this.order.length>this.max){const gt=this._getAndRemoveByKey(this.order[0]);gt&&this.onRemove(gt)}return this}has(P){return P.wrapped().key in this.data}getAndRemove(P){return this.has(P)?this._getAndRemoveByKey(P.wrapped().key):null}_getAndRemoveByKey(P){const oe=this.data[P].shift();return oe.timeout&&clearTimeout(oe.timeout),this.data[P].length===0&&delete this.data[P],this.order.splice(this.order.indexOf(P),1),oe.value}getByKey(P){const oe=this.data[P];return oe?oe[0].value:null}get(P){return this.has(P)?this.data[P.wrapped().key][0].value:null}remove(P,oe){if(!this.has(P))return this;const Se=P.wrapped().key,ke=oe===void 0?0:this.data[Se].indexOf(oe),Be=this.data[Se][ke];return this.data[Se].splice(ke,1),Be.timeout&&clearTimeout(Be.timeout),this.data[Se].length===0&&delete this.data[Se],this.onRemove(Be.value),this.order.splice(this.order.indexOf(Se),1),this}setMaxSize(P){for(this.max=P;this.order.length>this.max;){const oe=this._getAndRemoveByKey(this.order[0]);oe&&this.onRemove(oe)}return this}filter(P){const oe=[];for(const Se in this.data)for(const ke of this.data[Se])P(ke.value)||oe.push(ke);for(const Se of oe)this.remove(Se.value.tileID,Se)}}class Ft{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(P,oe,Se){const ke=String(oe);if(this.stateChanges[P]=this.stateChanges[P]||{},this.stateChanges[P][ke]=this.stateChanges[P][ke]||{},t.e(this.stateChanges[P][ke],Se),this.deletedStates[P]===null){this.deletedStates[P]={};for(const Be in this.state[P])Be!==ke&&(this.deletedStates[P][Be]=null)}else if(this.deletedStates[P]&&this.deletedStates[P][ke]===null){this.deletedStates[P][ke]={};for(const Be in this.state[P][ke])Se[Be]||(this.deletedStates[P][ke][Be]=null)}else for(const Be in Se)this.deletedStates[P]&&this.deletedStates[P][ke]&&this.deletedStates[P][ke][Be]===null&&delete this.deletedStates[P][ke][Be]}removeFeatureState(P,oe,Se){if(this.deletedStates[P]===null)return;const ke=String(oe);if(this.deletedStates[P]=this.deletedStates[P]||{},Se&&oe!==void 0)this.deletedStates[P][ke]!==null&&(this.deletedStates[P][ke]=this.deletedStates[P][ke]||{},this.deletedStates[P][ke][Se]=null);else if(oe!==void 0)if(this.stateChanges[P]&&this.stateChanges[P][ke])for(Se in this.deletedStates[P][ke]={},this.stateChanges[P][ke])this.deletedStates[P][ke][Se]=null;else this.deletedStates[P][ke]=null;else this.deletedStates[P]=null}getState(P,oe){const Se=String(oe),ke=t.e({},(this.state[P]||{})[Se],(this.stateChanges[P]||{})[Se]);if(this.deletedStates[P]===null)return{};if(this.deletedStates[P]){const Be=this.deletedStates[P][oe];if(Be===null)return{};for(const gt in Be)delete ke[gt]}return ke}initializeTileState(P,oe){P.setFeatureState(this.state,oe)}coalesceChanges(P,oe){const Se={};for(const ke in this.stateChanges){this.state[ke]=this.state[ke]||{};const Be={};for(const gt in this.stateChanges[ke])this.state[ke][gt]||(this.state[ke][gt]={}),t.e(this.state[ke][gt],this.stateChanges[ke][gt]),Be[gt]=this.state[ke][gt];Se[ke]=Be}for(const ke in this.deletedStates){this.state[ke]=this.state[ke]||{};const Be={};if(this.deletedStates[ke]===null)for(const gt in this.state[ke])Be[gt]={},this.state[ke][gt]={};else for(const gt in this.deletedStates[ke]){if(this.deletedStates[ke][gt]===null)this.state[ke][gt]={};else for(const kt of Object.keys(this.deletedStates[ke][gt]))delete this.state[ke][gt][kt];Be[gt]=this.state[ke][gt]}Se[ke]=Se[ke]||{},t.e(Se[ke],Be)}if(this.stateChanges={},this.deletedStates={},Object.keys(Se).length!==0)for(const ke in P)P[ke].setFeatureState(Se,oe)}}class Nt extends t.E{constructor(P,oe,Se){super(),this.id=P,this.dispatcher=Se,this.on("data",ke=>this._dataHandler(ke)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((ke,Be,gt,kt)=>{const Gt=new(Le(Be.type))(ke,Be,gt,kt);if(Gt.id!==ke)throw new Error(`Expected Source id to be ${ke} instead of ${Gt.id}`);return Gt})(P,oe,Se,this),this._tiles={},this._cache=new rt(0,ke=>this._unloadTile(ke)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ft,this._didEmitContent=!1,this._updated=!1}onAdd(P){this.map=P,this._maxTileCacheSize=P?P._maxTileCacheSize:null,this._maxTileCacheZoomLevels=P?P._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(P)}onRemove(P){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(P)}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(const P in this._tiles){const oe=this._tiles[P];if(oe.state!=="loaded"&&oe.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const P=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,P&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(P,oe,Se){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(P),this._tileLoaded(P,oe,Se)}catch(ke){P.state="errored",ke.status!==404?this._source.fire(new t.j(ke,{tile:P})):this.update(this.transform,this.terrain)}})}_unloadTile(P){this._source.unloadTile&&this._source.unloadTile(P)}_abortTile(P){this._source.abortTile&&this._source.abortTile(P),this._source.fire(new t.k("dataabort",{tile:P,coord:P.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(P){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const oe in this._tiles){const Se=this._tiles[oe];Se.upload(P),Se.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(P=>P.tileID).sort($t).map(P=>P.key)}getRenderableIds(P){const oe=[];for(const Se in this._tiles)this._isIdRenderable(Se,P)&&oe.push(this._tiles[Se]);return P?oe.sort((Se,ke)=>{const Be=Se.tileID,gt=ke.tileID,kt=new t.P(Be.canonical.x,Be.canonical.y)._rotate(this.transform.angle),Gt=new t.P(gt.canonical.x,gt.canonical.y)._rotate(this.transform.angle);return Be.overscaledZ-gt.overscaledZ||Gt.y-kt.y||Gt.x-kt.x}).map(Se=>Se.tileID.key):oe.map(Se=>Se.tileID).sort($t).map(Se=>Se.key)}hasRenderableParent(P){const oe=this.findLoadedParent(P,0);return!!oe&&this._isIdRenderable(oe.tileID.key)}_isIdRenderable(P,oe){return this._tiles[P]&&this._tiles[P].hasData()&&!this._coveredTiles[P]&&(oe||!this._tiles[P].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const P in this._tiles)this._tiles[P].state!=="errored"&&this._reloadTile(P,"reloading")}}_reloadTile(P,oe){return t._(this,void 0,void 0,function*(){const Se=this._tiles[P];Se&&(Se.state!=="loading"&&(Se.state=oe),yield this._loadTile(Se,P,oe))})}_tileLoaded(P,oe,Se){P.timeAdded=i.now(),Se==="expired"&&(P.refreshedUponExpiration=!0),this._setTileReloadTimer(oe,P),this.getSource().type==="raster-dem"&&P.dem&&this._backfillDEM(P),this._state.initializeTileState(P,this.map?this.map.painter:null),P.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:P,coord:P.tileID}))}_backfillDEM(P){const oe=this.getRenderableIds();for(let ke=0;ke1||(Math.abs(gt)>1&&(Math.abs(gt+Gt)===1?gt+=Gt:Math.abs(gt-Gt)===1&&(gt-=Gt)),Be.dem&&ke.dem&&(ke.dem.backfillBorder(Be.dem,gt,kt),ke.neighboringTiles&&ke.neighboringTiles[cr]&&(ke.neighboringTiles[cr].backfilled=!0)))}}getTile(P){return this.getTileByID(P.key)}getTileByID(P){return this._tiles[P]}_retainLoadedChildren(P,oe,Se,ke){for(const Be in this._tiles){let gt=this._tiles[Be];if(ke[Be]||!gt.hasData()||gt.tileID.overscaledZ<=oe||gt.tileID.overscaledZ>Se)continue;let kt=gt.tileID;for(;gt&>.tileID.overscaledZ>oe+1;){const cr=gt.tileID.scaledTo(gt.tileID.overscaledZ-1);gt=this._tiles[cr.key],gt&>.hasData()&&(kt=cr)}let Gt=kt;for(;Gt.overscaledZ>oe;)if(Gt=Gt.scaledTo(Gt.overscaledZ-1),P[Gt.key]){ke[kt.key]=kt;break}}}findLoadedParent(P,oe){if(P.key in this._loadedParentTiles){const Se=this._loadedParentTiles[P.key];return Se&&Se.tileID.overscaledZ>=oe?Se:null}for(let Se=P.overscaledZ-1;Se>=oe;Se--){const ke=P.scaledTo(Se),Be=this._getLoadedTile(ke);if(Be)return Be}}findLoadedSibling(P){return this._getLoadedTile(P)}_getLoadedTile(P){const oe=this._tiles[P.key];return oe&&oe.hasData()?oe:this._cache.getByKey(P.wrapped().key)}updateCacheSize(P){const oe=Math.ceil(P.width/this._source.tileSize)+1,Se=Math.ceil(P.height/this._source.tileSize)+1,ke=Math.floor(oe*Se*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Be=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,ke):ke;this._cache.setMaxSize(Be)}handleWrapJump(P){const oe=Math.round((P-(this._prevLng===void 0?P:this._prevLng))/360);if(this._prevLng=P,oe){const Se={};for(const ke in this._tiles){const Be=this._tiles[ke];Be.tileID=Be.tileID.unwrapTo(Be.tileID.wrap+oe),Se[Be.tileID.key]=Be}this._tiles=Se;for(const ke in this._timers)clearTimeout(this._timers[ke]),delete this._timers[ke];for(const ke in this._tiles)this._setTileReloadTimer(ke,this._tiles[ke])}}_updateCoveredAndRetainedTiles(P,oe,Se,ke,Be,gt){const kt={},Gt={},cr=Object.keys(P),Tr=i.now();for(const kr of cr){const Qr=P[kr],yn=this._tiles[kr];if(!yn||yn.fadeEndTime!==0&&yn.fadeEndTime<=Tr)continue;const Ze=this.findLoadedParent(Qr,oe),et=this.findLoadedSibling(Qr),ft=Ze||et||null;ft&&(this._addTile(ft.tileID),kt[ft.tileID.key]=ft.tileID),Gt[kr]=Qr}this._retainLoadedChildren(Gt,ke,Se,P);for(const kr in kt)P[kr]||(this._coveredTiles[kr]=!0,P[kr]=kt[kr]);if(gt){const kr={},Qr={};for(const yn of Be)this._tiles[yn.key].hasData()?kr[yn.key]=yn:Qr[yn.key]=yn;for(const yn in Qr){const Ze=Qr[yn].children(this._source.maxzoom);this._tiles[Ze[0].key]&&this._tiles[Ze[1].key]&&this._tiles[Ze[2].key]&&this._tiles[Ze[3].key]&&(kr[Ze[0].key]=P[Ze[0].key]=Ze[0],kr[Ze[1].key]=P[Ze[1].key]=Ze[1],kr[Ze[2].key]=P[Ze[2].key]=Ze[2],kr[Ze[3].key]=P[Ze[3].key]=Ze[3],delete Qr[yn])}for(const yn in Qr){const Ze=Qr[yn],et=this.findLoadedParent(Ze,this._source.minzoom),ft=this.findLoadedSibling(Ze),_t=et||ft||null;if(_t){kr[_t.tileID.key]=P[_t.tileID.key]=_t.tileID;for(const zt in kr)kr[zt].isChildOf(_t.tileID)&&delete kr[zt]}}for(const yn in this._tiles)kr[yn]||(this._coveredTiles[yn]=!0)}}update(P,oe){if(!this._sourceLoaded||this._paused)return;let Se;this.transform=P,this.terrain=oe,this.updateCacheSize(P),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Se=P.getVisibleUnwrappedCoordinates(this._source.tileID).map(Tr=>new t.S(Tr.canonical.z,Tr.wrap,Tr.canonical.z,Tr.canonical.x,Tr.canonical.y)):(Se=P.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:oe}),this._source.hasTile&&(Se=Se.filter(Tr=>this._source.hasTile(Tr)))):Se=[];const ke=P.coveringZoomLevel(this._source),Be=Math.max(ke-Nt.maxOverzooming,this._source.minzoom),gt=Math.max(ke+Nt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Tr={};for(const kr of Se)if(kr.canonical.z>this._source.minzoom){const Qr=kr.scaledTo(kr.canonical.z-1);Tr[Qr.key]=Qr;const yn=kr.scaledTo(Math.max(this._source.minzoom,Math.min(kr.canonical.z,5)));Tr[yn.key]=yn}Se=Se.concat(Object.values(Tr))}const kt=Se.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,kt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Gt=this._updateRetainedTiles(Se,ke);rr(this._source.type)&&this._updateCoveredAndRetainedTiles(Gt,Be,gt,ke,Se,oe);for(const Tr in Gt)this._tiles[Tr].clearFadeHold();const cr=t.ab(this._tiles,Gt);for(const Tr of cr){const kr=this._tiles[Tr];kr.hasSymbolBuckets&&!kr.holdingForFade()?kr.setHoldDuration(this.map._fadeDuration):kr.hasSymbolBuckets&&!kr.symbolFadeFinished()||this._removeTile(Tr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const P in this._tiles)this._tiles[P].holdingForFade()&&this._removeTile(P)}_updateRetainedTiles(P,oe){var Se;const ke={},Be={},gt=Math.max(oe-Nt.maxOverzooming,this._source.minzoom),kt=Math.max(oe+Nt.maxUnderzooming,this._source.minzoom),Gt={};for(const cr of P){const Tr=this._addTile(cr);ke[cr.key]=cr,Tr.hasData()||oethis._source.maxzoom){const Qr=cr.children(this._source.maxzoom)[0],yn=this.getTile(Qr);if(yn&&yn.hasData()){ke[Qr.key]=Qr;continue}}else{const Qr=cr.children(this._source.maxzoom);if(ke[Qr[0].key]&&ke[Qr[1].key]&&ke[Qr[2].key]&&ke[Qr[3].key])continue}let kr=Tr.wasRequested();for(let Qr=cr.overscaledZ-1;Qr>=gt;--Qr){const yn=cr.scaledTo(Qr);if(Be[yn.key])break;if(Be[yn.key]=!0,Tr=this.getTile(yn),!Tr&&kr&&(Tr=this._addTile(yn)),Tr){const Ze=Tr.hasData();if((Ze||!(!((Se=this.map)===null||Se===void 0)&&Se.cancelPendingTileRequestsWhileZooming)||kr)&&(ke[yn.key]=yn),kr=Tr.wasRequested(),Ze)break}}}return ke}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const P in this._tiles){const oe=[];let Se,ke=this._tiles[P].tileID;for(;ke.overscaledZ>0;){if(ke.key in this._loadedParentTiles){Se=this._loadedParentTiles[ke.key];break}oe.push(ke.key);const Be=ke.scaledTo(ke.overscaledZ-1);if(Se=this._getLoadedTile(Be),Se)break;ke=Be}for(const Be of oe)this._loadedParentTiles[Be]=Se}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const P in this._tiles){const oe=this._tiles[P].tileID,Se=this._getLoadedTile(oe);this._loadedSiblingTiles[oe.key]=Se}}_addTile(P){let oe=this._tiles[P.key];if(oe)return oe;oe=this._cache.getAndRemove(P),oe&&(this._setTileReloadTimer(P.key,oe),oe.tileID=P,this._state.initializeTileState(oe,this.map?this.map.painter:null),this._cacheTimers[P.key]&&(clearTimeout(this._cacheTimers[P.key]),delete this._cacheTimers[P.key],this._setTileReloadTimer(P.key,oe)));const Se=oe;return oe||(oe=new ct(P,this._source.tileSize*P.overscaleFactor()),this._loadTile(oe,P.key,oe.state)),oe.uses++,this._tiles[P.key]=oe,Se||this._source.fire(new t.k("dataloading",{tile:oe,coord:oe.tileID,dataType:"source"})),oe}_setTileReloadTimer(P,oe){P in this._timers&&(clearTimeout(this._timers[P]),delete this._timers[P]);const Se=oe.getExpiryTimeout();Se&&(this._timers[P]=setTimeout(()=>{this._reloadTile(P,"expired"),delete this._timers[P]},Se))}_removeTile(P){const oe=this._tiles[P];oe&&(oe.uses--,delete this._tiles[P],this._timers[P]&&(clearTimeout(this._timers[P]),delete this._timers[P]),oe.uses>0||(oe.hasData()&&oe.state!=="reloading"?this._cache.add(oe.tileID,oe,oe.getExpiryTimeout()):(oe.aborted=!0,this._abortTile(oe),this._unloadTile(oe))))}_dataHandler(P){const oe=P.sourceDataType;P.dataType==="source"&&oe==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&P.dataType==="source"&&oe==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const P in this._tiles)this._removeTile(P);this._cache.reset()}tilesIn(P,oe,Se){const ke=[],Be=this.transform;if(!Be)return ke;const gt=Se?Be.getCameraQueryGeometry(P):P,kt=P.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),Gt=gt.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),cr=this.getIds();let Tr=1/0,kr=1/0,Qr=-1/0,yn=-1/0;for(const Ze of Gt)Tr=Math.min(Tr,Ze.x),kr=Math.min(kr,Ze.y),Qr=Math.max(Qr,Ze.x),yn=Math.max(yn,Ze.y);for(let Ze=0;Ze=0&&Et[1].y+zt>=0){const Ut=kt.map(wr=>ft.getTilePoint(wr)),mr=Gt.map(wr=>ft.getTilePoint(wr));ke.push({tile:et,tileID:ft,queryGeometry:Ut,cameraQueryGeometry:mr,scale:_t})}}return ke}getVisibleCoordinates(P){const oe=this.getRenderableIds(P).map(Se=>this._tiles[Se].tileID);for(const Se of oe)Se.posMatrix=this.transform.calculatePosMatrix(Se.toUnwrapped());return oe}hasTransition(){if(this._source.hasTransition())return!0;if(rr(this._source.type)){const P=i.now();for(const oe in this._tiles)if(this._tiles[oe].fadeEndTime>=P)return!0}return!1}setFeatureState(P,oe,Se){this._state.updateState(P=P||"_geojsonTileLayer",oe,Se)}removeFeatureState(P,oe,Se){this._state.removeFeatureState(P=P||"_geojsonTileLayer",oe,Se)}getFeatureState(P,oe){return this._state.getState(P=P||"_geojsonTileLayer",oe)}setDependencies(P,oe,Se){const ke=this._tiles[P];ke&&ke.setDependencies(oe,Se)}reloadTilesForDependencies(P,oe){for(const Se in this._tiles)this._tiles[Se].hasDependency(P,oe)&&this._reloadTile(Se,"reloading");this._cache.filter(Se=>!Se.hasDependency(P,oe))}}function $t(Ue,P){const oe=Math.abs(2*Ue.wrap)-+(Ue.wrap<0),Se=Math.abs(2*P.wrap)-+(P.wrap<0);return Ue.overscaledZ-P.overscaledZ||Se-oe||P.canonical.y-Ue.canonical.y||P.canonical.x-Ue.canonical.x}function rr(Ue){return Ue==="raster"||Ue==="image"||Ue==="video"}Nt.maxOverzooming=10,Nt.maxUnderzooming=3;class Mr{constructor(P,oe){this.reset(P,oe)}reset(P,oe){this.points=P||[],this._distances=[0];for(let Se=1;Se0?(ke-gt)/kt:0;return this.points[Be].mult(1-Gt).add(this.points[oe].mult(Gt))}}function Sr(Ue,P){let oe=!0;return Ue==="always"||Ue!=="never"&&P!=="never"||(oe=!1),oe}class Zr{constructor(P,oe,Se){const ke=this.boxCells=[],Be=this.circleCells=[];this.xCellCount=Math.ceil(P/Se),this.yCellCount=Math.ceil(oe/Se);for(let gt=0;gtthis.width||ke<0||oe>this.height)return[];const Gt=[];if(P<=0&&oe<=0&&this.width<=Se&&this.height<=ke){if(Be)return[{key:null,x1:P,y1:oe,x2:Se,y2:ke}];for(let cr=0;cr0}hitTestCircle(P,oe,Se,ke,Be){const gt=P-Se,kt=P+Se,Gt=oe-Se,cr=oe+Se;if(kt<0||gt>this.width||cr<0||Gt>this.height)return!1;const Tr=[];return this._forEachCell(gt,Gt,kt,cr,this._queryCellCircle,Tr,{hitTest:!0,overlapMode:ke,circle:{x:P,y:oe,radius:Se},seenUids:{box:{},circle:{}}},Be),Tr.length>0}_queryCell(P,oe,Se,ke,Be,gt,kt,Gt){const{seenUids:cr,hitTest:Tr,overlapMode:kr}=kt,Qr=this.boxCells[Be];if(Qr!==null){const Ze=this.bboxes;for(const et of Qr)if(!cr.box[et]){cr.box[et]=!0;const ft=4*et,_t=this.boxKeys[et];if(P<=Ze[ft+2]&&oe<=Ze[ft+3]&&Se>=Ze[ft+0]&&ke>=Ze[ft+1]&&(!Gt||Gt(_t))&&(!Tr||!Sr(kr,_t.overlapMode))&&(gt.push({key:_t,x1:Ze[ft],y1:Ze[ft+1],x2:Ze[ft+2],y2:Ze[ft+3]}),Tr))return!0}}const yn=this.circleCells[Be];if(yn!==null){const Ze=this.circles;for(const et of yn)if(!cr.circle[et]){cr.circle[et]=!0;const ft=3*et,_t=this.circleKeys[et];if(this._circleAndRectCollide(Ze[ft],Ze[ft+1],Ze[ft+2],P,oe,Se,ke)&&(!Gt||Gt(_t))&&(!Tr||!Sr(kr,_t.overlapMode))){const zt=Ze[ft],Et=Ze[ft+1],Ut=Ze[ft+2];if(gt.push({key:_t,x1:zt-Ut,y1:Et-Ut,x2:zt+Ut,y2:Et+Ut}),Tr)return!0}}}return!1}_queryCellCircle(P,oe,Se,ke,Be,gt,kt,Gt){const{circle:cr,seenUids:Tr,overlapMode:kr}=kt,Qr=this.boxCells[Be];if(Qr!==null){const Ze=this.bboxes;for(const et of Qr)if(!Tr.box[et]){Tr.box[et]=!0;const ft=4*et,_t=this.boxKeys[et];if(this._circleAndRectCollide(cr.x,cr.y,cr.radius,Ze[ft+0],Ze[ft+1],Ze[ft+2],Ze[ft+3])&&(!Gt||Gt(_t))&&!Sr(kr,_t.overlapMode))return gt.push(!0),!0}}const yn=this.circleCells[Be];if(yn!==null){const Ze=this.circles;for(const et of yn)if(!Tr.circle[et]){Tr.circle[et]=!0;const ft=3*et,_t=this.circleKeys[et];if(this._circlesCollide(Ze[ft],Ze[ft+1],Ze[ft+2],cr.x,cr.y,cr.radius)&&(!Gt||Gt(_t))&&!Sr(kr,_t.overlapMode))return gt.push(!0),!0}}}_forEachCell(P,oe,Se,ke,Be,gt,kt,Gt){const cr=this._convertToXCellCoord(P),Tr=this._convertToYCellCoord(oe),kr=this._convertToXCellCoord(Se),Qr=this._convertToYCellCoord(ke);for(let yn=cr;yn<=kr;yn++)for(let Ze=Tr;Ze<=Qr;Ze++)if(Be.call(this,P,oe,Se,ke,this.xCellCount*Ze+yn,gt,kt,Gt))return}_convertToXCellCoord(P){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(P*this.xScale)))}_convertToYCellCoord(P){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(P*this.yScale)))}_circlesCollide(P,oe,Se,ke,Be,gt){const kt=ke-P,Gt=Be-oe,cr=Se+gt;return cr*cr>kt*kt+Gt*Gt}_circleAndRectCollide(P,oe,Se,ke,Be,gt,kt){const Gt=(gt-ke)/2,cr=Math.abs(P-(ke+Gt));if(cr>Gt+Se)return!1;const Tr=(kt-Be)/2,kr=Math.abs(oe-(Be+Tr));if(kr>Tr+Se)return!1;if(cr<=Gt||kr<=Tr)return!0;const Qr=cr-Gt,yn=kr-Tr;return Qr*Qr+yn*yn<=Se*Se}}function Ar(Ue,P,oe,Se,ke){const Be=t.H();return P?(t.K(Be,Be,[1/ke,1/ke,1]),oe||t.ad(Be,Be,Se.angle)):t.L(Be,Se.labelPlaneMatrix,Ue),Be}function Br(Ue,P,oe,Se,ke){if(P){const Be=t.ae(Ue);return t.K(Be,Be,[ke,ke,1]),oe||t.ad(Be,Be,-Se.angle),Be}return Se.glCoordMatrix}function Mt(Ue,P,oe,Se){let ke;Se?(ke=[Ue,P,Se(Ue,P),1],t.af(ke,ke,oe)):(ke=[Ue,P,0,1],hr(ke,ke,oe));const Be=ke[3];return{point:new t.P(ke[0]/Be,ke[1]/Be),signedDistanceFromCamera:Be,isOccluded:!1}}function je(Ue,P){return .5+Ue/P*.5}function $e(Ue,P){return Ue.x>=-P[0]&&Ue.x<=P[0]&&Ue.y>=-P[1]&&Ue.y<=P[1]}function Ee(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn,Ze){const et=Se?Ue.textSizeData:Ue.iconSizeData,ft=t.ag(et,oe.transform.zoom),_t=[256/oe.width*2+1,256/oe.height*2+1],zt=Se?Ue.text.dynamicLayoutVertexArray:Ue.icon.dynamicLayoutVertexArray;zt.clear();const Et=Ue.lineVertexArray,Ut=Se?Ue.text.placedSymbolArray:Ue.icon.placedSymbolArray,mr=oe.transform.width/oe.transform.height;let wr=!1;for(let Lr=0;LrMath.abs(oe.x-P.x)*Se?{useVertical:!0}:(Ue===t.ah.vertical?P.yoe.x)?{needsFlipping:!0}:null}function Me(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr){const kr=oe/24,Qr=P.lineOffsetX*kr,yn=P.lineOffsetY*kr;let Ze;if(P.numGlyphs>1){const et=P.glyphStartIndex+P.numGlyphs,ft=P.lineStartIndex,_t=P.lineStartIndex+P.lineLength,zt=xe(kr,kt,Qr,yn,Se,P,Tr,Ue);if(!zt)return{notEnoughRoom:!0};const Et=Mt(zt.first.point.x,zt.first.point.y,gt,Ue.getElevation).point,Ut=Mt(zt.last.point.x,zt.last.point.y,gt,Ue.getElevation).point;if(ke&&!Se){const mr=ye(P.writingMode,Et,Ut,cr);if(mr)return mr}Ze=[zt.first];for(let mr=P.glyphStartIndex+1;mr0?Et.point:(function(wr,Lr,Gr,an,Mn,Ln){return Xe(wr,Lr,Gr,1,Mn,Ln)})(Ue.tileAnchorPoint,zt,ft,0,Be,Ue),mr=ye(P.writingMode,ft,Ut,cr);if(mr)return mr}const et=Wt(kr*kt.getoffsetX(P.glyphStartIndex),Qr,yn,Se,P.segment,P.lineStartIndex,P.lineStartIndex+P.lineLength,Ue,Tr);if(!et||Ue.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Ze=[et]}for(const et of Ze)t.aj(Gt,et.point,et.angle);return{}}function Xe(Ue,P,oe,Se,ke,Be){const gt=Ue.add(Ue.sub(P)._unit()),kt=ke!==void 0?Mt(gt.x,gt.y,ke,Be.getElevation).point:Lt(gt.x,gt.y,Be).point,Gt=oe.sub(kt);return oe.add(Gt._mult(Se/Gt.mag()))}function Je(Ue,P,oe){const Se=P.projectionCache;if(Se.projections[Ue])return Se.projections[Ue];const ke=new t.P(P.lineVertexArray.getx(Ue),P.lineVertexArray.gety(Ue)),Be=Lt(ke.x,ke.y,P);if(Be.signedDistanceFromCamera>0)return Se.projections[Ue]=Be.point,Se.anyProjectionOccluded=Se.anyProjectionOccluded||Be.isOccluded,Be.point;const gt=Ue-oe.direction;return(function(kt,Gt,cr,Tr,kr){return Xe(kt,Gt,cr,Tr,void 0,kr)})(oe.distanceFromAnchor===0?P.tileAnchorPoint:new t.P(P.lineVertexArray.getx(gt),P.lineVertexArray.gety(gt)),ke,oe.previousVertex,oe.absOffsetX-oe.distanceFromAnchor+1,P)}function Lt(Ue,P,oe){const Se=Ue+oe.translation[0],ke=P+oe.translation[1];let Be;return!oe.pitchWithMap&&oe.projection.useSpecialProjectionForSymbols?(Be=oe.projection.projectTileCoordinates(Se,ke,oe.unwrappedTileID,oe.getElevation),Be.point.x=(.5*Be.point.x+.5)*oe.width,Be.point.y=(.5*-Be.point.y+.5)*oe.height):(Be=Mt(Se,ke,oe.labelPlaneMatrix,oe.getElevation),Be.isOccluded=!1),Be}function Ct(Ue,P,oe){return Ue._unit()._perp()._mult(P*oe)}function Ot(Ue,P,oe,Se,ke,Be,gt,kt,Gt){if(kt.projectionCache.offsets[Ue])return kt.projectionCache.offsets[Ue];const cr=oe.add(P);if(Ue+Gt.direction=ke)return kt.projectionCache.offsets[Ue]=cr,cr;const Tr=Je(Ue+Gt.direction,kt,Gt),kr=Ct(Tr.sub(oe),gt,Gt.direction),Qr=oe.add(kr),yn=Tr.add(kr);return kt.projectionCache.offsets[Ue]=t.ak(Be,cr,Qr,yn)||cr,kt.projectionCache.offsets[Ue]}function Wt(Ue,P,oe,Se,ke,Be,gt,kt,Gt){const cr=Se?Ue-P:Ue+P;let Tr=cr>0?1:-1,kr=0;Se&&(Tr*=-1,kr=Math.PI),Tr<0&&(kr+=Math.PI);let Qr,yn=Tr>0?Be+ke:Be+ke+1;kt.projectionCache.cachedAnchorPoint?Qr=kt.projectionCache.cachedAnchorPoint:(Qr=Lt(kt.tileAnchorPoint.x,kt.tileAnchorPoint.y,kt).point,kt.projectionCache.cachedAnchorPoint=Qr);let Ze,et,ft=Qr,_t=Qr,zt=0,Et=0;const Ut=Math.abs(cr),mr=[];let wr;for(;zt+Et<=Ut;){if(yn+=Tr,yn=gt)return null;zt+=Et,_t=ft,et=Ze;const an={absOffsetX:Ut,direction:Tr,distanceFromAnchor:zt,previousVertex:_t};if(ft=Je(yn,kt,an),oe===0)mr.push(_t),wr=ft.sub(_t);else{let Mn;const Ln=ft.sub(_t);Mn=Ln.mag()===0?Ct(Je(yn+Tr,kt,an).sub(ft),oe,Tr):Ct(Ln,oe,Tr),et||(et=_t.add(Mn)),Ze=Ot(yn,Mn,ft,Be,gt,et,oe,kt,an),mr.push(et),wr=Ze.sub(et)}Et=wr.mag()}const Lr=wr._mult((Ut-zt)/Et)._add(et||_t),Gr=kr+Math.atan2(ft.y-_t.y,ft.x-_t.x);return mr.push(Lr),{point:Lr,angle:Gt?Gr:0,path:mr}}const _r=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pr(Ue,P){for(let oe=0;oe=1;co--)ri.push(ti.path[co]);for(let co=1;coWo.signedDistanceFromCamera<=0)?[]:co.map(Wo=>Wo.point)}let yo=[];if(ri.length>0){const co=ri[0].clone(),Wo=ri[0].clone();for(let Ks=1;Ks=Ln.x&&Wo.x<=Gn.x&&co.y>=Ln.y&&Wo.y<=Gn.y?[ri]:Wo.xGn.x||Wo.yGn.y?[]:t.al([ri],Ln.x,Ln.y,Gn.x,Gn.y)}for(const co of yo){ba.reset(co,.25*Mn);let Wo=0;Wo=ba.length<=.5*Mn?1:Math.ceil(ba.paddedLength/Zi)+1;for(let Ks=0;KsMt(ke.x,ke.y,Se,oe.getElevation))}queryRenderedSymbols(P){if(P.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const oe=[];let Se=1/0,ke=1/0,Be=-1/0,gt=-1/0;for(const Tr of P){const kr=new t.P(Tr.x+Fr,Tr.y+Fr);Se=Math.min(Se,kr.x),ke=Math.min(ke,kr.y),Be=Math.max(Be,kr.x),gt=Math.max(gt,kr.y),oe.push(kr)}const kt=this.grid.query(Se,ke,Be,gt).concat(this.ignoredGrid.query(Se,ke,Be,gt)),Gt={},cr={};for(const Tr of kt){const kr=Tr.key;if(Gt[kr.bucketInstanceId]===void 0&&(Gt[kr.bucketInstanceId]={}),Gt[kr.bucketInstanceId][kr.featureIndex])continue;const Qr=[new t.P(Tr.x1,Tr.y1),new t.P(Tr.x2,Tr.y1),new t.P(Tr.x2,Tr.y2),new t.P(Tr.x1,Tr.y2)];t.am(oe,Qr)&&(Gt[kr.bucketInstanceId][kr.featureIndex]=!0,cr[kr.bucketInstanceId]===void 0&&(cr[kr.bucketInstanceId]=[]),cr[kr.bucketInstanceId].push(kr.featureIndex))}return cr}insertCollisionBox(P,oe,Se,ke,Be,gt){(Se?this.ignoredGrid:this.grid).insert({bucketInstanceId:ke,featureIndex:Be,collisionGroupID:gt,overlapMode:oe},P[0],P[1],P[2],P[3])}insertCollisionCircles(P,oe,Se,ke,Be,gt){const kt=Se?this.ignoredGrid:this.grid,Gt={bucketInstanceId:ke,featureIndex:Be,collisionGroupID:gt,overlapMode:oe};for(let cr=0;cr=this.screenRightBoundary||kethis.screenBottomBoundary}isInsideGrid(P,oe,Se,ke){return Se>=0&&P=0&&oethis.projectAndGetPerspectiveRatio(Se,Mn.x,Mn.y,ke,cr));Gr=an.some(Mn=>!Mn.isOccluded),Lr=an.map(Mn=>Mn.point)}else Gr=!0;return{box:t.ao(Lr),allPointsOccluded:!Gr}}}function Zn(Ue,P,oe){return P*(t.X/(Ue.tileSize*Math.pow(2,oe-Ue.tileID.overscaledZ)))}class qn{constructor(P,oe,Se,ke){this.opacity=P?Math.max(0,Math.min(1,P.opacity+(P.placed?oe:-oe))):ke&&Se?1:0,this.placed=Se}isHidden(){return this.opacity===0&&!this.placed}}class ta{constructor(P,oe,Se,ke,Be){this.text=new qn(P?P.text:null,oe,Se,Be),this.icon=new qn(P?P.icon:null,oe,ke,Be)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ra{constructor(P,oe,Se){this.text=P,this.icon=oe,this.skipFade=Se}}class Nn{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class Ea{constructor(P,oe,Se,ke,Be){this.bucketInstanceId=P,this.featureIndex=oe,this.sourceLayerIndex=Se,this.bucketIndex=ke,this.tileID=Be}}class ja{constructor(P){this.crossSourceCollisions=P,this.maxGroupID=0,this.collisionGroups={}}get(P){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[P]){const oe=++this.maxGroupID;this.collisionGroups[P]={ID:oe,predicate:Se=>Se.collisionGroupID===oe}}return this.collisionGroups[P]}}function ir(Ue,P,oe,Se,ke){const{horizontalAlign:Be,verticalAlign:gt}=t.au(Ue);return new t.P(-(Be-.5)*P+Se[0]*ke,-(gt-.5)*oe+Se[1]*ke)}class qt{constructor(P,oe,Se,ke,Be,gt){this.transform=P.clone(),this.terrain=Se,this.collisionIndex=new En(this.transform,oe),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=ke,this.retainedQueryData={},this.collisionGroups=new ja(Be),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=gt,gt&&(gt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(P){const oe=this.terrain;return oe?(Se,ke)=>oe.getElevation(P,Se,ke):null}getBucketParts(P,oe,Se,ke){const Be=Se.getBucket(oe),gt=Se.latestFeatureIndex;if(!Be||!gt||oe.id!==Be.layerIds[0])return;const kt=Se.collisionBoxArray,Gt=Be.layers[0].layout,cr=Be.layers[0].paint,Tr=Math.pow(2,this.transform.zoom-Se.tileID.overscaledZ),kr=Se.tileSize/t.X,Qr=Se.tileID.toUnwrapped(),yn=this.transform.calculatePosMatrix(Qr),Ze=Gt.get("text-pitch-alignment")==="map",et=Gt.get("text-rotation-alignment")==="map",ft=Zn(Se,1,this.transform.zoom),_t=this.collisionIndex.mapProjection.translatePosition(this.transform,Se,cr.get("text-translate"),cr.get("text-translate-anchor")),zt=this.collisionIndex.mapProjection.translatePosition(this.transform,Se,cr.get("icon-translate"),cr.get("icon-translate-anchor")),Et=Ar(yn,Ze,et,this.transform,ft);let Ut=null;if(Ze){const wr=Br(yn,Ze,et,this.transform,ft);Ut=t.L([],this.transform.labelPlaneMatrix,wr)}this.retainedQueryData[Be.bucketInstanceId]=new Ea(Be.bucketInstanceId,gt,Be.sourceLayerIndex,Be.index,Se.tileID);const mr={bucket:Be,layout:Gt,translationText:_t,translationIcon:zt,posMatrix:yn,unwrappedTileID:Qr,textLabelPlaneMatrix:Et,labelToScreenMatrix:Ut,scale:Tr,textPixelRatio:kr,holdingForFade:Se.holdingForFade(),collisionBoxArray:kt,partiallyEvaluatedTextSize:t.ag(Be.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Be.sourceID)};if(ke)for(const wr of Be.sortKeyRanges){const{sortKey:Lr,symbolInstanceStart:Gr,symbolInstanceEnd:an}=wr;P.push({sortKey:Lr,symbolInstanceStart:Gr,symbolInstanceEnd:an,parameters:mr})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Be.symbolInstances.length,parameters:mr})}attemptAnchorPlacement(P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn,Ze,et,ft,_t,zt,Et){const Ut=t.aq[P.textAnchor],mr=[P.textOffset0,P.textOffset1],wr=ir(Ut,Se,ke,mr,Be),Lr=this.collisionIndex.placeCollisionBox(oe,Qr,Gt,cr,Tr,kt,gt,ft,kr.predicate,Et,wr);if((!zt||this.collisionIndex.placeCollisionBox(zt,Qr,Gt,cr,Tr,kt,gt,_t,kr.predicate,Et,wr).placeable)&&Lr.placeable){let Gr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[yn.crossTileID]&&this.prevPlacement.placements[yn.crossTileID]&&this.prevPlacement.placements[yn.crossTileID].text&&(Gr=this.prevPlacement.variableOffsets[yn.crossTileID].anchor),yn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[yn.crossTileID]={textOffset:mr,width:Se,height:ke,anchor:Ut,textBoxScale:Be,prevAnchor:Gr},this.markUsedJustification(Ze,Ut,yn,et),Ze.allowVerticalPlacement&&(this.markUsedOrientation(Ze,et,yn),this.placedOrientations[yn.crossTileID]=et),{shift:wr,placedGlyphBoxes:Lr}}}placeLayerBucketPart(P,oe,Se){const{bucket:ke,layout:Be,translationText:gt,translationIcon:kt,posMatrix:Gt,unwrappedTileID:cr,textLabelPlaneMatrix:Tr,labelToScreenMatrix:kr,textPixelRatio:Qr,holdingForFade:yn,collisionBoxArray:Ze,partiallyEvaluatedTextSize:et,collisionGroup:ft}=P.parameters,_t=Be.get("text-optional"),zt=Be.get("icon-optional"),Et=t.ar(Be,"text-overlap","text-allow-overlap"),Ut=Et==="always",mr=t.ar(Be,"icon-overlap","icon-allow-overlap"),wr=mr==="always",Lr=Be.get("text-rotation-alignment")==="map",Gr=Be.get("text-pitch-alignment")==="map",an=Be.get("icon-text-fit")!=="none",Mn=Be.get("symbol-z-order")==="viewport-y",Ln=Ut&&(wr||!ke.hasIconData()||zt),Gn=wr&&(Ut||!ke.hasTextData()||_t);!ke.collisionArrays&&Ze&&ke.deserializeCollisionBoxes(Ze);const ba=this._getTerrainElevationFunc(this.retainedQueryData[ke.bucketInstanceId].tileID),ti=(Za,ri,Zi)=>{var yo,co;if(oe[Za.crossTileID])return;if(yn)return void(this.placements[Za.crossTileID]=new ra(!1,!1,!1));let Wo=!1,Ks=!1,$s=!0,ks=null,nl={box:null,placeable:!1,offscreen:null},hu={placeable:!1},eu=null,Cs=null,Ls=null,ku=0,ac=0,zc=0;ri.textFeatureIndex?ku=ri.textFeatureIndex:Za.useRuntimeCollisionCircles&&(ku=Za.featureIndex),ri.verticalTextFeatureIndex&&(ac=ri.verticalTextFeatureIndex);const ge=ri.textBox;if(ge){const At=yr=>{let Xr=t.ah.horizontal;if(ke.allowVerticalPlacement&&!yr&&this.prevPlacement){const Hr=this.prevPlacement.placedOrientations[Za.crossTileID];Hr&&(this.placedOrientations[Za.crossTileID]=Hr,Xr=Hr,this.markUsedOrientation(ke,Xr,Za))}return Xr},It=(yr,Xr)=>{if(ke.allowVerticalPlacement&&Za.numVerticalGlyphVertices>0&&ri.verticalTextBox){for(const Hr of ke.writingModes)if(Hr===t.ah.vertical?(nl=Xr(),hu=nl):nl=yr(),nl&&nl.placeable)break}else nl=yr()},Qt=Za.textAnchorOffsetStartIndex,Jt=Za.textAnchorOffsetEndIndex;if(Jt===Qt){const yr=(Xr,Hr)=>{const fn=this.collisionIndex.placeCollisionBox(Xr,Et,Qr,Gt,cr,Gr,Lr,gt,ft.predicate,ba);return fn&&fn.placeable&&(this.markUsedOrientation(ke,Hr,Za),this.placedOrientations[Za.crossTileID]=Hr),fn};It(()=>yr(ge,t.ah.horizontal),()=>{const Xr=ri.verticalTextBox;return ke.allowVerticalPlacement&&Za.numVerticalGlyphVertices>0&&Xr?yr(Xr,t.ah.vertical):{box:null,offscreen:null}}),At(nl&&nl.placeable)}else{let yr=t.aq[(co=(yo=this.prevPlacement)===null||yo===void 0?void 0:yo.variableOffsets[Za.crossTileID])===null||co===void 0?void 0:co.anchor];const Xr=(fn,Sn,kn)=>{const Ca=fn.x2-fn.x1,Dn=fn.y2-fn.y1,Jn=Za.textBoxScale,oa=an&&mr==="never"?Sn:null;let Aa=null,Pa=Et==="never"?1:2,ia="never";yr&&Pa++;for(let ni=0;niXr(ge,ri.iconBox,t.ah.horizontal),()=>{const fn=ri.verticalTextBox;return ke.allowVerticalPlacement&&(!nl||!nl.placeable)&&Za.numVerticalGlyphVertices>0&&fn?Xr(fn,ri.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),nl&&(Wo=nl.placeable,$s=nl.offscreen);const Hr=At(nl&&nl.placeable);if(!Wo&&this.prevPlacement){const fn=this.prevPlacement.variableOffsets[Za.crossTileID];fn&&(this.variableOffsets[Za.crossTileID]=fn,this.markUsedJustification(ke,fn.anchor,Za,Hr))}}}if(eu=nl,Wo=eu&&eu.placeable,$s=eu&&eu.offscreen,Za.useRuntimeCollisionCircles){const At=ke.text.placedSymbolArray.get(Za.centerJustifiedTextSymbolIndex),It=t.ai(ke.textSizeData,et,At),Qt=Be.get("text-padding");Cs=this.collisionIndex.placeCollisionCircles(Et,At,ke.lineVertexArray,ke.glyphOffsetArray,It,Gt,cr,Tr,kr,Se,Gr,ft.predicate,Za.collisionCircleDiameter,Qt,gt,ba),Cs.circles.length&&Cs.collisionDetected&&!Se&&t.w("Collisions detected, but collision boxes are not shown"),Wo=Ut||Cs.circles.length>0&&!Cs.collisionDetected,$s=$s&&Cs.offscreen}if(ri.iconFeatureIndex&&(zc=ri.iconFeatureIndex),ri.iconBox){const At=It=>this.collisionIndex.placeCollisionBox(It,mr,Qr,Gt,cr,Gr,Lr,kt,ft.predicate,ba,an&&ks?ks:void 0);hu&&hu.placeable&&ri.verticalIconBox?(Ls=At(ri.verticalIconBox),Ks=Ls.placeable):(Ls=At(ri.iconBox),Ks=Ls.placeable),$s=$s&&Ls.offscreen}const Oe=_t||Za.numHorizontalGlyphVertices===0&&Za.numVerticalGlyphVertices===0,tt=zt||Za.numIconVertices===0;Oe||tt?tt?Oe||(Ks=Ks&&Wo):Wo=Ks&&Wo:Ks=Wo=Ks&&Wo;const xt=Ks&&Ls.placeable;if(Wo&&eu.placeable&&this.collisionIndex.insertCollisionBox(eu.box,Et,Be.get("text-ignore-placement"),ke.bucketInstanceId,hu&&hu.placeable&&ac?ac:ku,ft.ID),xt&&this.collisionIndex.insertCollisionBox(Ls.box,mr,Be.get("icon-ignore-placement"),ke.bucketInstanceId,zc,ft.ID),Cs&&Wo&&this.collisionIndex.insertCollisionCircles(Cs.circles,Et,Be.get("text-ignore-placement"),ke.bucketInstanceId,ku,ft.ID),Se&&this.storeCollisionData(ke.bucketInstanceId,Zi,ri,eu,Ls,Cs),Za.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(ke.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Za.crossTileID]=new ra(Wo||Ln,Ks||Gn,$s||ke.justReloaded),oe[Za.crossTileID]=!0};if(Mn){if(P.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Za=ke.getSortedSymbolIndexes(this.transform.angle);for(let ri=Za.length-1;ri>=0;--ri){const Zi=Za[ri];ti(ke.symbolInstances.get(Zi),ke.collisionArrays[Zi],Zi)}}else for(let Za=P.symbolInstanceStart;Za=0&&(P.text.placedSymbolArray.get(kt).crossTileID=Be>=0&&kt!==Be?0:Se.crossTileID)}markUsedOrientation(P,oe,Se){const ke=oe===t.ah.horizontal||oe===t.ah.horizontalOnly?oe:0,Be=oe===t.ah.vertical?oe:0,gt=[Se.leftJustifiedTextSymbolIndex,Se.centerJustifiedTextSymbolIndex,Se.rightJustifiedTextSymbolIndex];for(const kt of gt)P.text.placedSymbolArray.get(kt).placedOrientation=ke;Se.verticalPlacedTextSymbolIndex&&(P.text.placedSymbolArray.get(Se.verticalPlacedTextSymbolIndex).placedOrientation=Be)}commit(P){this.commitTime=P,this.zoomAtLastRecencyCheck=this.transform.zoom;const oe=this.prevPlacement;let Se=!1;this.prevZoomAdjustment=oe?oe.zoomAdjustment(this.transform.zoom):0;const ke=oe?oe.symbolFadeChange(P):1,Be=oe?oe.opacities:{},gt=oe?oe.variableOffsets:{},kt=oe?oe.placedOrientations:{};for(const Gt in this.placements){const cr=this.placements[Gt],Tr=Be[Gt];Tr?(this.opacities[Gt]=new ta(Tr,ke,cr.text,cr.icon),Se=Se||cr.text!==Tr.text.placed||cr.icon!==Tr.icon.placed):(this.opacities[Gt]=new ta(null,ke,cr.text,cr.icon,cr.skipFade),Se=Se||cr.text||cr.icon)}for(const Gt in Be){const cr=Be[Gt];if(!this.opacities[Gt]){const Tr=new ta(cr,ke,!1,!1);Tr.isHidden()||(this.opacities[Gt]=Tr,Se=Se||cr.text.placed||cr.icon.placed)}}for(const Gt in gt)this.variableOffsets[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.variableOffsets[Gt]=gt[Gt]);for(const Gt in kt)this.placedOrientations[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.placedOrientations[Gt]=kt[Gt]);if(oe&&oe.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Se?this.lastPlacementChangeTime=P:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=oe?oe.lastPlacementChangeTime:P)}updateLayerOpacities(P,oe){const Se={};for(const ke of oe){const Be=ke.getBucket(P);Be&&ke.latestFeatureIndex&&P.id===Be.layerIds[0]&&this.updateBucketOpacities(Be,ke.tileID,Se,ke.collisionBoxArray)}}updateBucketOpacities(P,oe,Se,ke){P.hasTextData()&&(P.text.opacityVertexArray.clear(),P.text.hasVisibleVertices=!1),P.hasIconData()&&(P.icon.opacityVertexArray.clear(),P.icon.hasVisibleVertices=!1),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexArray.clear(),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexArray.clear();const Be=P.layers[0],gt=Be.layout,kt=new ta(null,0,!1,!1,!0),Gt=gt.get("text-allow-overlap"),cr=gt.get("icon-allow-overlap"),Tr=Be._unevaluatedLayout.hasValue("text-variable-anchor")||Be._unevaluatedLayout.hasValue("text-variable-anchor-offset"),kr=gt.get("text-rotation-alignment")==="map",Qr=gt.get("text-pitch-alignment")==="map",yn=gt.get("icon-text-fit")!=="none",Ze=new ta(null,0,Gt&&(cr||!P.hasIconData()||gt.get("icon-optional")),cr&&(Gt||!P.hasTextData()||gt.get("text-optional")),!0);!P.collisionArrays&&ke&&(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData())&&P.deserializeCollisionBoxes(ke);const et=(_t,zt,Et)=>{for(let Ut=0;Ut0,Gr=this.placedOrientations[zt.crossTileID],an=Gr===t.ah.vertical,Mn=Gr===t.ah.horizontal||Gr===t.ah.horizontalOnly;if(Et>0||Ut>0){const Gn=fa(wr.text);et(P.text,Et,an?ga:Gn),et(P.text,Ut,Mn?ga:Gn);const ba=wr.text.isHidden();[zt.rightJustifiedTextSymbolIndex,zt.centerJustifiedTextSymbolIndex,zt.leftJustifiedTextSymbolIndex].forEach(ri=>{ri>=0&&(P.text.placedSymbolArray.get(ri).hidden=ba||an?1:0)}),zt.verticalPlacedTextSymbolIndex>=0&&(P.text.placedSymbolArray.get(zt.verticalPlacedTextSymbolIndex).hidden=ba||Mn?1:0);const ti=this.variableOffsets[zt.crossTileID];ti&&this.markUsedJustification(P,ti.anchor,zt,Gr);const Za=this.placedOrientations[zt.crossTileID];Za&&(this.markUsedJustification(P,"left",zt,Za),this.markUsedOrientation(P,Za,zt))}if(Lr){const Gn=fa(wr.icon),ba=!(yn&&zt.verticalPlacedIconSymbolIndex&&an);zt.placedIconSymbolIndex>=0&&(et(P.icon,zt.numIconVertices,ba?Gn:ga),P.icon.placedSymbolArray.get(zt.placedIconSymbolIndex).hidden=wr.icon.isHidden()),zt.verticalPlacedIconSymbolIndex>=0&&(et(P.icon,zt.numVerticalIconVertices,ba?ga:Gn),P.icon.placedSymbolArray.get(zt.verticalPlacedIconSymbolIndex).hidden=wr.icon.isHidden())}const Ln=ft&&ft.has(_t)?ft.get(_t):{text:null,icon:null};if(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData()){const Gn=P.collisionArrays[_t];if(Gn){let ba=new t.P(0,0);if(Gn.textBox||Gn.verticalTextBox){let ti=!0;if(Tr){const Za=this.variableOffsets[mr];Za?(ba=ir(Za.anchor,Za.width,Za.height,Za.textOffset,Za.textBoxScale),kr&&ba._rotate(Qr?this.transform.angle:-this.transform.angle)):ti=!1}if(Gn.textBox||Gn.verticalTextBox){let Za;Gn.textBox&&(Za=an),Gn.verticalTextBox&&(Za=Mn),ar(P.textCollisionBox.collisionVertexArray,wr.text.placed,!ti||Za,Ln.text,ba.x,ba.y)}}if(Gn.iconBox||Gn.verticalIconBox){const ti=!!(!Mn&&Gn.verticalIconBox);let Za;Gn.iconBox&&(Za=ti),Gn.verticalIconBox&&(Za=!ti),ar(P.iconCollisionBox.collisionVertexArray,wr.icon.placed,Za,Ln.icon,yn?ba.x:0,yn?ba.y:0)}}}}if(P.sortFeatures(this.transform.angle),this.retainedQueryData[P.bucketInstanceId]&&(this.retainedQueryData[P.bucketInstanceId].featureSortOrder=P.featureSortOrder),P.hasTextData()&&P.text.opacityVertexBuffer&&P.text.opacityVertexBuffer.updateData(P.text.opacityVertexArray),P.hasIconData()&&P.icon.opacityVertexBuffer&&P.icon.opacityVertexBuffer.updateData(P.icon.opacityVertexArray),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexBuffer&&P.iconCollisionBox.collisionVertexBuffer.updateData(P.iconCollisionBox.collisionVertexArray),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexBuffer&&P.textCollisionBox.collisionVertexBuffer.updateData(P.textCollisionBox.collisionVertexArray),P.text.opacityVertexArray.length!==P.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${P.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${P.text.layoutVertexArray.length}) / 4`);if(P.icon.opacityVertexArray.length!==P.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${P.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${P.icon.layoutVertexArray.length}) / 4`);if(P.bucketInstanceId in this.collisionCircleArrays){const _t=this.collisionCircleArrays[P.bucketInstanceId];P.placementInvProjMatrix=_t.invProjMatrix,P.placementViewportMatrix=_t.viewportMatrix,P.collisionCircleArray=_t.circles,delete this.collisionCircleArrays[P.bucketInstanceId]}}symbolFadeChange(P){return this.fadeDuration===0?1:(P-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(P){return Math.max(0,(this.transform.zoom-P)/1.5)}hasTransitions(P){return this.stale||P-this.lastPlacementChangeTimeP}setStale(){this.stale=!0}}function ar(Ue,P,oe,Se,ke,Be){Se&&Se.length!==0||(Se=[0,0,0,0]);const gt=Se[0]-Fr,kt=Se[1]-Fr,Gt=Se[2]-Fr,cr=Se[3]-Fr;Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,Gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,Gt,cr),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,gt,cr)}const sr=Math.pow(2,25),Vr=Math.pow(2,24),on=Math.pow(2,17),pn=Math.pow(2,16),wn=Math.pow(2,9),Kn=Math.pow(2,8),da=Math.pow(2,1);function fa(Ue){if(Ue.opacity===0&&!Ue.placed)return 0;if(Ue.opacity===1&&Ue.placed)return 4294967295;const P=Ue.placed?1:0,oe=Math.floor(127*Ue.opacity);return oe*sr+P*Vr+oe*on+P*pn+oe*wn+P*Kn+oe*da+P}const ga=0;function ka(){return{isOccluded:(Ue,P,oe)=>!1,getPitchedTextCorrection:(Ue,P,oe)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ue,P,oe,Se){throw new Error("Not implemented.")},translatePosition:(Ue,P,oe,Se)=>(function(ke,Be,gt,kt,Gt=!1){if(!gt[0]&&!gt[1])return[0,0];const cr=Gt?kt==="map"?ke.angle:0:kt==="viewport"?-ke.angle:0;if(cr){const Tr=Math.sin(cr),kr=Math.cos(cr);gt=[gt[0]*kr-gt[1]*Tr,gt[0]*Tr+gt[1]*kr]}return[Gt?gt[0]:Zn(Be,gt[0],ke.zoom),Gt?gt[1]:Zn(Be,gt[1],ke.zoom)]})(Ue,P,oe,Se),getCircleRadiusCorrection:Ue=>1}}class Vn{constructor(P){this._sortAcrossTiles=P.layout.get("symbol-z-order")!=="viewport-y"&&!P.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(P,oe,Se,ke,Be){const gt=this._bucketParts;for(;this._currentTileIndexkt.sortKey-Gt.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-ke>2;for(;this._currentPlacementIndex>=0;){const gt=oe[P[this._currentPlacementIndex]],kt=this.placement.collisionIndex.transform.zoom;if(gt.type==="symbol"&&(!gt.minzoom||gt.minzoom<=kt)&&(!gt.maxzoom||gt.maxzoom>kt)){if(this._inProgressLayer||(this._inProgressLayer=new Vn(gt)),this._inProgressLayer.continuePlacement(Se[gt.source],this.placement,this._showCollisionBoxes,gt,Be))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(P){return this.placement.commit(P),this.placement}}const Ti=512/t.X/2;class Dt{constructor(P,oe,Se){this.tileID=P,this.bucketInstanceId=Se,this._symbolsByKey={};const ke=new Map;for(let Be=0;Be({x:Math.floor(Gt.anchorX*Ti),y:Math.floor(Gt.anchorY*Ti)})),crossTileIDs:gt.map(Gt=>Gt.crossTileID)};if(kt.positions.length>128){const Gt=new t.av(kt.positions.length,16,Uint16Array);for(const{x:cr,y:Tr}of kt.positions)Gt.add(cr,Tr);Gt.finish(),delete kt.positions,kt.index=Gt}this._symbolsByKey[Be]=kt}}getScaledCoordinates(P,oe){const{x:Se,y:ke,z:Be}=this.tileID.canonical,{x:gt,y:kt,z:Gt}=oe.canonical,cr=Ti/Math.pow(2,Gt-Be),Tr=(kt*t.X+P.anchorY)*cr,kr=ke*t.X*Ti;return{x:Math.floor((gt*t.X+P.anchorX)*cr-Se*t.X*Ti),y:Math.floor(Tr-kr)}}findMatches(P,oe,Se){const ke=this.tileID.canonical.zP)}}class yt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Er{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(P){const oe=Math.round((P-this.lng)/360);if(oe!==0)for(const Se in this.indexes){const ke=this.indexes[Se],Be={};for(const gt in ke){const kt=ke[gt];kt.tileID=kt.tileID.unwrapTo(kt.tileID.wrap+oe),Be[kt.tileID.key]=kt}this.indexes[Se]=Be}this.lng=P}addBucket(P,oe,Se){if(this.indexes[P.overscaledZ]&&this.indexes[P.overscaledZ][P.key]){if(this.indexes[P.overscaledZ][P.key].bucketInstanceId===oe.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(P.overscaledZ,this.indexes[P.overscaledZ][P.key])}for(let Be=0;BeP.overscaledZ)for(const kt in gt){const Gt=gt[kt];Gt.tileID.isChildOf(P)&&Gt.findMatches(oe.symbolInstances,P,ke)}else{const kt=gt[P.scaledTo(Number(Be)).key];kt&&kt.findMatches(oe.symbolInstances,P,ke)}}for(let Be=0;Be{oe[Se]=!0});for(const Se in this.layerIndexes)oe[Se]||delete this.layerIndexes[Se]}}const jr=(Ue,P)=>t.t(Ue,P&&P.filter(oe=>oe.identifier!=="source.canvas")),Ir=t.aw();class Ur extends t.E{constructor(P,oe={}){super(),this._rtlPluginLoaded=()=>{for(const Se in this.sourceCaches){const ke=this.sourceCaches[Se].getSource().type;ke!=="vector"&&ke!=="geojson"||this.sourceCaches[Se].reload()}},this.map=P,this.dispatcher=new ne(ee(),P._getMapId()),this.dispatcher.registerMessageHandler("GG",(Se,ke)=>this.getGlyphs(Se,ke)),this.dispatcher.registerMessageHandler("GI",(Se,ke)=>this.getImages(Se,ke)),this.imageManager=new y,this.imageManager.setEventedParent(this),this.glyphManager=new F(P._requestManager,oe.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new Nr,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()),ot().on(Te,this._rtlPluginLoaded),this.on("data",Se=>{if(Se.dataType!=="source"||Se.sourceDataType!=="metadata")return;const ke=this.sourceCaches[Se.sourceId];if(!ke)return;const Be=ke.getSource();if(Be&&Be.vectorLayerIds)for(const gt in this._layers){const kt=this._layers[gt];kt.source===Be.id&&this._validateLayer(kt)}})}loadURL(P,oe={},Se){this.fire(new t.k("dataloading",{dataType:"style"})),oe.validate=typeof oe.validate!="boolean"||oe.validate;const ke=this.map._requestManager.transformRequest(P,"Style");this._loadStyleRequest=new AbortController;const Be=this._loadStyleRequest;t.h(ke,this._loadStyleRequest).then(gt=>{this._loadStyleRequest=null,this._load(gt.data,oe,Se)}).catch(gt=>{this._loadStyleRequest=null,gt&&!Be.signal.aborted&&this.fire(new t.j(gt))})}loadJSON(P,oe={},Se){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,oe.validate=oe.validate!==!1,this._load(P,oe,Se)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Ir,{validate:!1})}_load(P,oe,Se){var ke;const Be=oe.transformStyle?oe.transformStyle(Se,P):P;if(!oe.validate||!jr(this,t.u(Be))){this._loaded=!0,this.stylesheet=Be;for(const gt in Be.sources)this.addSource(gt,Be.sources[gt],{validate:!1});Be.sprite?this._loadSprite(Be.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Be.glyphs),this._createLayers(),this.light=new R(this.stylesheet.light),this.sky=new j(this.stylesheet.sky),this.map.setTerrain((ke=this.stylesheet.terrain)!==null&&ke!==void 0?ke:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const P=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",P),this._order=P.map(oe=>oe.id),this._layers={},this._serializedLayers=null;for(const oe of P){const Se=t.aA(oe);Se.setEventedParent(this,{layer:{id:oe.id}}),this._layers[oe.id]=Se}}_loadSprite(P,oe=!1,Se=void 0){let ke;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Be,gt,kt,Gt){return t._(this,void 0,void 0,function*(){const cr=w(Be),Tr=kt>1?"@2x":"",kr={},Qr={};for(const{id:yn,url:Ze}of cr){const et=gt.transformRequest(m(Ze,Tr,".json"),"SpriteJSON");kr[yn]=t.h(et,Gt);const ft=gt.transformRequest(m(Ze,Tr,".png"),"SpriteImage");Qr[yn]=l.getImage(ft,Gt)}return yield Promise.all([...Object.values(kr),...Object.values(Qr)]),(function(yn,Ze){return t._(this,void 0,void 0,function*(){const et={};for(const ft in yn){et[ft]={};const _t=i.getImageCanvasContext((yield Ze[ft]).data),zt=(yield yn[ft]).data;for(const Et in zt){const{width:Ut,height:mr,x:wr,y:Lr,sdf:Gr,pixelRatio:an,stretchX:Mn,stretchY:Ln,content:Gn,textFitWidth:ba,textFitHeight:ti}=zt[Et];et[ft][Et]={data:null,pixelRatio:an,sdf:Gr,stretchX:Mn,stretchY:Ln,content:Gn,textFitWidth:ba,textFitHeight:ti,spriteData:{width:Ut,height:mr,x:wr,y:Lr,context:_t}}}}return et})})(kr,Qr)})})(P,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Be=>{if(this._spriteRequest=null,Be)for(const gt in Be){this._spritesImagesIds[gt]=[];const kt=this._spritesImagesIds[gt]?this._spritesImagesIds[gt].filter(Gt=>!(Gt in Be)):[];for(const Gt of kt)this.imageManager.removeImage(Gt),this._changedImages[Gt]=!0;for(const Gt in Be[gt]){const cr=gt==="default"?Gt:`${gt}:${Gt}`;this._spritesImagesIds[gt].push(cr),cr in this.imageManager.images?this.imageManager.updateImage(cr,Be[gt][Gt],!1):this.imageManager.addImage(cr,Be[gt][Gt]),oe&&(this._changedImages[cr]=!0)}}}).catch(Be=>{this._spriteRequest=null,ke=Be,this.fire(new t.j(ke))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),oe&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Se&&Se(ke)})}_unloadSprite(){for(const P of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(P),this._changedImages[P]=!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(P){const oe=this.sourceCaches[P.source];if(!oe)return;const Se=P.sourceLayer;if(!Se)return;const ke=oe.getSource();(ke.type==="geojson"||ke.vectorLayerIds&&ke.vectorLayerIds.indexOf(Se)===-1)&&this.fire(new t.j(new Error(`Source layer "${Se}" does not exist on source "${ke.id}" as specified by style layer "${P.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const P in this.sourceCaches)if(!this.sourceCaches[P].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(P,oe=!1){const Se=this._serializedAllLayers();if(!P||P.length===0)return Object.values(oe?t.aB(Se):Se);const ke=[];for(const Be of P)if(Se[Be]){const gt=oe?t.aB(Se[Be]):Se[Be];ke.push(gt)}return ke}_serializedAllLayers(){let P=this._serializedLayers;if(P)return P;P=this._serializedLayers={};const oe=Object.keys(this._layers);for(const Se of oe){const ke=this._layers[Se];ke.type!=="custom"&&(P[Se]=ke.serialize())}return P}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const P in this.sourceCaches)if(this.sourceCaches[P].hasTransition())return!0;for(const P in this._layers)if(this._layers[P].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(P){if(!this._loaded)return;const oe=this._changed;if(oe){const ke=Object.keys(this._updatedLayers),Be=Object.keys(this._removedLayers);(ke.length||Be.length)&&this._updateWorkerLayers(ke,Be);for(const gt in this._updatedSources){const kt=this._updatedSources[gt];if(kt==="reload")this._reloadSource(gt);else{if(kt!=="clear")throw new Error(`Invalid action ${kt}`);this._clearSource(gt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const gt in this._updatedPaintProps)this._layers[gt].updateTransitions(P);this.light.updateTransitions(P),this.sky.updateTransitions(P),this._resetUpdates()}const Se={};for(const ke in this.sourceCaches){const Be=this.sourceCaches[ke];Se[ke]=Be.used,Be.used=!1}for(const ke of this._order){const Be=this._layers[ke];Be.recalculate(P,this._availableImages),!Be.isHidden(P.zoom)&&Be.source&&(this.sourceCaches[Be.source].used=!0)}for(const ke in Se){const Be=this.sourceCaches[ke];!!Se[ke]!=!!Be.used&&Be.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:ke}))}this.light.recalculate(P),this.sky.recalculate(P),this.z=P.zoom,oe&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const P=Object.keys(this._changedImages);if(P.length){for(const oe in this.sourceCaches)this.sourceCaches[oe].reloadTilesForDependencies(["icons","patterns"],P);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const P in this.sourceCaches)this.sourceCaches[P].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(P,oe){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(P,!1),removedIds:oe})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(P,oe={}){var Se;this._checkLoaded();const ke=this.serialize();if(P=oe.transformStyle?oe.transformStyle(ke,P):P,((Se=oe.validate)===null||Se===void 0||Se)&&jr(this,t.u(P)))return!1;(P=t.aB(P)).layers=t.az(P.layers);const Be=t.aC(ke,P),gt=this._getOperationsToPerform(Be);if(gt.unimplemented.length>0)throw new Error(`Unimplemented: ${gt.unimplemented.join(", ")}.`);if(gt.operations.length===0)return!1;for(const kt of gt.operations)kt();return this.stylesheet=P,this._serializedLayers=null,!0}_getOperationsToPerform(P){const oe=[],Se=[];for(const ke of P)switch(ke.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":oe.push(()=>this.addLayer.apply(this,ke.args));break;case"removeLayer":oe.push(()=>this.removeLayer.apply(this,ke.args));break;case"setPaintProperty":oe.push(()=>this.setPaintProperty.apply(this,ke.args));break;case"setLayoutProperty":oe.push(()=>this.setLayoutProperty.apply(this,ke.args));break;case"setFilter":oe.push(()=>this.setFilter.apply(this,ke.args));break;case"addSource":oe.push(()=>this.addSource.apply(this,ke.args));break;case"removeSource":oe.push(()=>this.removeSource.apply(this,ke.args));break;case"setLayerZoomRange":oe.push(()=>this.setLayerZoomRange.apply(this,ke.args));break;case"setLight":oe.push(()=>this.setLight.apply(this,ke.args));break;case"setGeoJSONSourceData":oe.push(()=>this.setGeoJSONSourceData.apply(this,ke.args));break;case"setGlyphs":oe.push(()=>this.setGlyphs.apply(this,ke.args));break;case"setSprite":oe.push(()=>this.setSprite.apply(this,ke.args));break;case"setSky":oe.push(()=>this.setSky.apply(this,ke.args));break;case"setTerrain":oe.push(()=>this.map.setTerrain.apply(this,ke.args));break;case"setTransition":oe.push(()=>{});break;default:Se.push(ke.command)}return{operations:oe,unimplemented:Se}}addImage(P,oe){if(this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" already exists.`)));this.imageManager.addImage(P,oe),this._afterImageUpdated(P)}updateImage(P,oe){this.imageManager.updateImage(P,oe)}getImage(P){return this.imageManager.getImage(P)}removeImage(P){if(!this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" does not exist.`)));this.imageManager.removeImage(P),this._afterImageUpdated(P)}_afterImageUpdated(P){this._availableImages=this.imageManager.listImages(),this._changedImages[P]=!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(P,oe,Se={}){if(this._checkLoaded(),this.sourceCaches[P]!==void 0)throw new Error(`Source "${P}" already exists.`);if(!oe.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(oe).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(oe.type)>=0&&this._validate(t.u.source,`sources.${P}`,oe,null,Se))return;this.map&&this.map._collectResourceTiming&&(oe.collectResourceTiming=!0);const ke=this.sourceCaches[P]=new Nt(P,oe,this.dispatcher);ke.style=this,ke.setEventedParent(this,()=>({isSourceLoaded:ke.loaded(),source:ke.serialize(),sourceId:P})),ke.onAdd(this.map),this._changed=!0}removeSource(P){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error("There is no source with this ID");for(const Se in this._layers)if(this._layers[Se].source===P)return this.fire(new t.j(new Error(`Source "${P}" cannot be removed while layer "${Se}" is using it.`)));const oe=this.sourceCaches[P];delete this.sourceCaches[P],delete this._updatedSources[P],oe.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:P})),oe.setEventedParent(null),oe.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(P,oe){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error(`There is no source with this ID=${P}`);const Se=this.sourceCaches[P].getSource();if(Se.type!=="geojson")throw new Error(`geojsonSource.type is ${Se.type}, which is !== 'geojson`);Se.setData(oe),this._changed=!0}getSource(P){return this.sourceCaches[P]&&this.sourceCaches[P].getSource()}addLayer(P,oe,Se={}){this._checkLoaded();const ke=P.id;if(this.getLayer(ke))return void this.fire(new t.j(new Error(`Layer "${ke}" already exists on this map.`)));let Be;if(P.type==="custom"){if(jr(this,t.aD(P)))return;Be=t.aA(P)}else{if("source"in P&&typeof P.source=="object"&&(this.addSource(ke,P.source),P=t.aB(P),P=t.e(P,{source:ke})),this._validate(t.u.layer,`layers.${ke}`,P,{arrayIndex:-1},Se))return;Be=t.aA(P),this._validateLayer(Be),Be.setEventedParent(this,{layer:{id:ke}})}const gt=oe?this._order.indexOf(oe):this._order.length;if(oe&>===-1)this.fire(new t.j(new Error(`Cannot add layer "${ke}" before non-existing layer "${oe}".`)));else{if(this._order.splice(gt,0,ke),this._layerOrderChanged=!0,this._layers[ke]=Be,this._removedLayers[ke]&&Be.source&&Be.type!=="custom"){const kt=this._removedLayers[ke];delete this._removedLayers[ke],kt.type!==Be.type?this._updatedSources[Be.source]="clear":(this._updatedSources[Be.source]="reload",this.sourceCaches[Be.source].pause())}this._updateLayer(Be),Be.onAdd&&Be.onAdd(this.map)}}moveLayer(P,oe){if(this._checkLoaded(),this._changed=!0,!this._layers[P])return void this.fire(new t.j(new Error(`The layer '${P}' does not exist in the map's style and cannot be moved.`)));if(P===oe)return;const Se=this._order.indexOf(P);this._order.splice(Se,1);const ke=oe?this._order.indexOf(oe):this._order.length;oe&&ke===-1?this.fire(new t.j(new Error(`Cannot move layer "${P}" before non-existing layer "${oe}".`))):(this._order.splice(ke,0,P),this._layerOrderChanged=!0)}removeLayer(P){this._checkLoaded();const oe=this._layers[P];if(!oe)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${P}".`)));oe.setEventedParent(null);const Se=this._order.indexOf(P);this._order.splice(Se,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[P]=oe,delete this._layers[P],this._serializedLayers&&delete this._serializedLayers[P],delete this._updatedLayers[P],delete this._updatedPaintProps[P],oe.onRemove&&oe.onRemove(this.map)}getLayer(P){return this._layers[P]}getLayersOrder(){return[...this._order]}hasLayer(P){return P in this._layers}setLayerZoomRange(P,oe,Se){this._checkLoaded();const ke=this.getLayer(P);ke?ke.minzoom===oe&&ke.maxzoom===Se||(oe!=null&&(ke.minzoom=oe),Se!=null&&(ke.maxzoom=Se),this._updateLayer(ke)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${P}".`)))}setFilter(P,oe,Se={}){this._checkLoaded();const ke=this.getLayer(P);if(ke){if(!t.aE(ke.filter,oe))return oe==null?(ke.filter=void 0,void this._updateLayer(ke)):void(this._validate(t.u.filter,`layers.${ke.id}.filter`,oe,null,Se)||(ke.filter=t.aB(oe),this._updateLayer(ke)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${P}".`)))}getFilter(P){return t.aB(this.getLayer(P).filter)}setLayoutProperty(P,oe,Se,ke={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getLayoutProperty(oe),Se)||(Be.setLayoutProperty(oe,Se,ke),this._updateLayer(Be)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getLayoutProperty(P,oe){const Se=this.getLayer(P);if(Se)return Se.getLayoutProperty(oe);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${P}".`)))}setPaintProperty(P,oe,Se,ke={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getPaintProperty(oe),Se)||(Be.setPaintProperty(oe,Se,ke)&&this._updateLayer(Be),this._changed=!0,this._updatedPaintProps[P]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getPaintProperty(P,oe){return this.getLayer(P).getPaintProperty(oe)}setFeatureState(P,oe){this._checkLoaded();const Se=P.source,ke=P.sourceLayer,Be=this.sourceCaches[Se];if(Be===void 0)return void this.fire(new t.j(new Error(`The source '${Se}' does not exist in the map's style.`)));const gt=Be.getSource().type;gt==="geojson"&&ke?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):gt!=="vector"||ke?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Be.setFeatureState(ke,P.id,oe)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(P,oe){this._checkLoaded();const Se=P.source,ke=this.sourceCaches[Se];if(ke===void 0)return void this.fire(new t.j(new Error(`The source '${Se}' does not exist in the map's style.`)));const Be=ke.getSource().type,gt=Be==="vector"?P.sourceLayer:void 0;Be!=="vector"||gt?oe&&typeof P.id!="string"&&typeof P.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):ke.removeFeatureState(gt,P.id,oe):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(P){this._checkLoaded();const oe=P.source,Se=P.sourceLayer,ke=this.sourceCaches[oe];if(ke!==void 0)return ke.getSource().type!=="vector"||Se?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),ke.getFeatureState(Se,P.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 '${oe}' 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;const P=t.aF(this.sourceCaches,Be=>Be.serialize()),oe=this._serializeByIds(this._order,!0),Se=this.map.getTerrain()||void 0,ke=this.stylesheet;return t.aG({version:ke.version,name:ke.name,metadata:ke.metadata,light:ke.light,sky:ke.sky,center:ke.center,zoom:ke.zoom,bearing:ke.bearing,pitch:ke.pitch,sprite:ke.sprite,glyphs:ke.glyphs,transition:ke.transition,sources:P,layers:oe,terrain:Se},Be=>Be!==void 0)}_updateLayer(P){this._updatedLayers[P.id]=!0,P.source&&!this._updatedSources[P.source]&&this.sourceCaches[P.source].getSource().type!=="raster"&&(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(P){const oe=gt=>this._layers[gt].type==="fill-extrusion",Se={},ke=[];for(let gt=this._order.length-1;gt>=0;gt--){const kt=this._order[gt];if(oe(kt)){Se[kt]=gt;for(const Gt of P){const cr=Gt[kt];if(cr)for(const Tr of cr)ke.push(Tr)}}}ke.sort((gt,kt)=>kt.intersectionZ-gt.intersectionZ);const Be=[];for(let gt=this._order.length-1;gt>=0;gt--){const kt=this._order[gt];if(oe(kt))for(let Gt=ke.length-1;Gt>=0;Gt--){const cr=ke[Gt].feature;if(Se[cr.layer.id]{const Gr=_t.featureSortOrder;if(Gr){const an=Gr.indexOf(wr.featureIndex);return Gr.indexOf(Lr.featureIndex)-an}return Lr.featureIndex-wr.featureIndex});for(const wr of mr)Ut.push(wr)}}for(const _t in Ze)Ze[_t].forEach(zt=>{const Et=zt.feature,Ut=cr[kt[_t].source].getFeatureState(Et.layer["source-layer"],Et.id);Et.source=Et.layer.source,Et.layer["source-layer"]&&(Et.sourceLayer=Et.layer["source-layer"]),Et.state=Ut});return Ze})(this._layers,gt,this.sourceCaches,P,oe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Be)}querySourceFeatures(P,oe){oe&&oe.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",oe.filter,null,oe);const Se=this.sourceCaches[P];return Se?(function(ke,Be){const gt=ke.getRenderableIds().map(cr=>ke.getTileByID(cr)),kt=[],Gt={};for(let cr=0;crQr.getTileByID(yn)).sort((yn,Ze)=>Ze.tileID.overscaledZ-yn.tileID.overscaledZ||(yn.tileID.isLessThan(Ze.tileID)?-1:1))}const kr=this.crossTileSymbolIndex.addLayer(Tr,Gt[Tr.source],P.center.lng);gt=gt||kr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Be=Be||this._layerOrderChanged||Se===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),P.zoom))&&(this.pauseablePlacement=new hi(P,this.map.terrain,this._order,Be,oe,Se,ke,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Gt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),kt=!0),gt&&this.pauseablePlacement.placement.setStale()),kt||gt)for(const cr of this._order){const Tr=this._layers[cr];Tr.type==="symbol"&&this.placement.updateLayerOpacities(Tr,Gt[Tr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const P in this.sourceCaches)this.sourceCaches[P].releaseSymbolFadeTiles()}getImages(P,oe){return t._(this,void 0,void 0,function*(){const Se=yield this.imageManager.getImages(oe.icons);this._updateTilesForChangedImages();const ke=this.sourceCaches[oe.source];return ke&&ke.setDependencies(oe.tileID.key,oe.type,oe.icons),Se})}getGlyphs(P,oe){return t._(this,void 0,void 0,function*(){const Se=yield this.glyphManager.getGlyphs(oe.stacks),ke=this.sourceCaches[oe.source];return ke&&ke.setDependencies(oe.tileID.key,oe.type,[""]),Se})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(P,oe={}){this._checkLoaded(),P&&this._validate(t.u.glyphs,"glyphs",P,null,oe)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=P,this.glyphManager.entries={},this.glyphManager.setURL(P))}addSprite(P,oe,Se={},ke){this._checkLoaded();const Be=[{id:P,url:oe}],gt=[...w(this.stylesheet.sprite),...Be];this._validate(t.u.sprite,"sprite",gt,null,Se)||(this.stylesheet.sprite=gt,this._loadSprite(Be,!0,ke))}removeSprite(P){this._checkLoaded();const oe=w(this.stylesheet.sprite);if(oe.find(Se=>Se.id===P)){if(this._spritesImagesIds[P])for(const Se of this._spritesImagesIds[P])this.imageManager.removeImage(Se),this._changedImages[Se]=!0;oe.splice(oe.findIndex(Se=>Se.id===P),1),this.stylesheet.sprite=oe.length>0?oe:void 0,delete this._spritesImagesIds[P],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 "${P}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(P,oe={},Se){this._checkLoaded(),P&&this._validate(t.u.sprite,"sprite",P,null,oe)||(this.stylesheet.sprite=P,P?this._loadSprite(P,!0,Se):(this._unloadSprite(),Se&&Se(null)))}}var sn=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Kr={prelude:Tt(`#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:Tt(`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:Tt(`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:Tt(`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:Tt("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:Tt(`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:Tt(`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:Tt("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:Tt("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:Tt("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:Tt(`#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:Tt(`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:Tt(`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:Tt(`#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:Tt(`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:Tt(`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:Tt(`#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:Tt(`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:Tt(`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:Tt(`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:Tt(`#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:Tt(`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:Tt(`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:Tt(`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:Tt(`#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:Tt(`#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:Tt("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:Tt("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:Tt("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:Tt("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 Tt(Ue,P){const oe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Se=P.match(/attribute ([\w]+) ([\w]+)/g),ke=Ue.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Be=P.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),gt=Be?Be.concat(ke):ke,kt={};return{fragmentSource:Ue=Ue.replace(oe,(Gt,cr,Tr,kr,Qr)=>(kt[Qr]=!0,cr==="define"?` +#ifndef HAS_UNIFORM_u_${Qr} +varying ${Tr} ${kr} ${Qr}; +#else +uniform ${Tr} ${kr} u_${Qr}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Qr} + ${Tr} ${kr} ${Qr} = u_${Qr}; +#endif +`)),vertexSource:P=P.replace(oe,(Gt,cr,Tr,kr,Qr)=>{const yn=kr==="float"?"vec2":"vec4",Ze=Qr.match(/color/)?"color":yn;return kt[Qr]?cr==="define"?` +#ifndef HAS_UNIFORM_u_${Qr} +uniform lowp float u_${Qr}_t; +attribute ${Tr} ${yn} a_${Qr}; +varying ${Tr} ${kr} ${Qr}; +#else +uniform ${Tr} ${kr} u_${Qr}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${Qr} + ${Qr} = a_${Qr}; +#else + ${Tr} ${kr} ${Qr} = u_${Qr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Qr} + ${Qr} = unpack_mix_${Ze}(a_${Qr}, u_${Qr}_t); +#else + ${Tr} ${kr} ${Qr} = u_${Qr}; +#endif +`:cr==="define"?` +#ifndef HAS_UNIFORM_u_${Qr} +uniform lowp float u_${Qr}_t; +attribute ${Tr} ${yn} a_${Qr}; +#else +uniform ${Tr} ${kr} u_${Qr}; +#endif +`:Ze==="vec4"?` +#ifndef HAS_UNIFORM_u_${Qr} + ${Tr} ${kr} ${Qr} = a_${Qr}; +#else + ${Tr} ${kr} ${Qr} = u_${Qr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Qr} + ${Tr} ${kr} ${Qr} = unpack_mix_${Ze}(a_${Qr}, u_${Qr}_t); +#else + ${Tr} ${kr} ${Qr} = u_${Qr}; +#endif +`}),staticAttributes:Se,staticUniforms:gt}}class or{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(P,oe,Se,ke,Be,gt,kt,Gt,cr){this.context=P;let Tr=this.boundPaintVertexBuffers.length!==ke.length;for(let kr=0;!Tr&&kr({u_matrix:Ue,u_texture:0,u_ele_delta:P,u_fog_matrix:oe,u_fog_color:Se?Se.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Se?Se.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Se?Se.calculateFogBlendOpacity(ke):0,u_horizon_color:Se?Se.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Se?Se.properties.get("horizon-fog-blend"):1});function ln(Ue){const P=[];for(let oe=0;oe({u_depth:new t.aH(wr,Lr.u_depth),u_terrain:new t.aH(wr,Lr.u_terrain),u_terrain_dim:new t.aI(wr,Lr.u_terrain_dim),u_terrain_matrix:new t.aJ(wr,Lr.u_terrain_matrix),u_terrain_unpack:new t.aK(wr,Lr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(wr,Lr.u_terrain_exaggeration)}))(P,mr),this.binderUniforms=Se?Se.getUniforms(P,mr):[]}draw(P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn,Ze,et,ft,_t,zt){const Et=P.gl;if(this.failedToCreate)return;if(P.program.set(this.program),P.setDepthMode(Se),P.setStencilMode(ke),P.setColorMode(Be),P.setCullFace(gt),Gt){P.activeTexture.set(Et.TEXTURE2),Et.bindTexture(Et.TEXTURE_2D,Gt.depthTexture),P.activeTexture.set(Et.TEXTURE3),Et.bindTexture(Et.TEXTURE_2D,Gt.texture);for(const mr in this.terrainUniforms)this.terrainUniforms[mr].set(Gt[mr])}for(const mr in this.fixedUniforms)this.fixedUniforms[mr].set(kt[mr]);et&&et.setUniforms(P,this.binderUniforms,yn,{zoom:Ze});let Ut=0;switch(oe){case Et.LINES:Ut=2;break;case Et.TRIANGLES:Ut=3;break;case Et.LINE_STRIP:Ut=1}for(const mr of Qr.get()){const wr=mr.vaos||(mr.vaos={});(wr[cr]||(wr[cr]=new or)).bind(P,this,Tr,et?et.getPaintVertexBuffers():[],kr,mr.vertexOffset,ft,_t,zt),Et.drawElements(oe,mr.primitiveLength*Ut,Et.UNSIGNED_SHORT,mr.primitiveOffset*Ut*2)}}}function jn(Ue,P,oe){const Se=1/Zn(oe,1,P.transform.tileZoom),ke=Math.pow(2,oe.tileID.overscaledZ),Be=oe.tileSize*Math.pow(2,P.transform.tileZoom)/ke,gt=Be*(oe.tileID.canonical.x+oe.tileID.wrap*ke),kt=Be*oe.tileID.canonical.y;return{u_image:0,u_texsize:oe.imageAtlasTexture.size,u_scale:[Se,Ue.fromScale,Ue.toScale],u_fade:Ue.t,u_pixel_coord_upper:[gt>>16,kt>>16],u_pixel_coord_lower:[65535>,65535&kt]}}const Un=(Ue,P,oe,Se)=>{const ke=P.style.light,Be=ke.properties.get("position"),gt=[Be.x,Be.y,Be.z],kt=(function(){var cr=new t.A(9);return t.A!=Float32Array&&(cr[1]=0,cr[2]=0,cr[3]=0,cr[5]=0,cr[6]=0,cr[7]=0),cr[0]=1,cr[4]=1,cr[8]=1,cr})();ke.properties.get("anchor")==="viewport"&&(function(cr,Tr){var kr=Math.sin(Tr),Qr=Math.cos(Tr);cr[0]=Qr,cr[1]=kr,cr[2]=0,cr[3]=-kr,cr[4]=Qr,cr[5]=0,cr[6]=0,cr[7]=0,cr[8]=1})(kt,-P.transform.angle),(function(cr,Tr,kr){var Qr=Tr[0],yn=Tr[1],Ze=Tr[2];cr[0]=Qr*kr[0]+yn*kr[3]+Ze*kr[6],cr[1]=Qr*kr[1]+yn*kr[4]+Ze*kr[7],cr[2]=Qr*kr[2]+yn*kr[5]+Ze*kr[8]})(gt,gt,kt);const Gt=ke.properties.get("color");return{u_matrix:Ue,u_lightpos:gt,u_lightintensity:ke.properties.get("intensity"),u_lightcolor:[Gt.r,Gt.g,Gt.b],u_vertical_gradient:+oe,u_opacity:Se}},un=(Ue,P,oe,Se,ke,Be,gt)=>t.e(Un(Ue,P,oe,Se),jn(Be,P,gt),{u_height_factor:-Math.pow(2,ke.overscaledZ)/gt.tileSize/8}),Rn=Ue=>({u_matrix:Ue}),di=(Ue,P,oe,Se)=>t.e(Rn(Ue),jn(oe,P,Se)),Ma=(Ue,P)=>({u_matrix:Ue,u_world:P}),Ei=(Ue,P,oe,Se,ke)=>t.e(di(Ue,P,oe,Se),{u_world:ke}),Hi=(Ue,P,oe,Se)=>{const ke=Ue.transform;let Be,gt;if(Se.paint.get("circle-pitch-alignment")==="map"){const kt=Zn(oe,1,ke.zoom);Be=!0,gt=[kt,kt]}else Be=!1,gt=ke.pixelsToGLUnits;return{u_camera_to_center_distance:ke.cameraToCenterDistance,u_scale_with_map:+(Se.paint.get("circle-pitch-scale")==="map"),u_matrix:Ue.translatePosMatrix(P.posMatrix,oe,Se.paint.get("circle-translate"),Se.paint.get("circle-translate-anchor")),u_pitch_with_map:+Be,u_device_pixel_ratio:Ue.pixelRatio,u_extrude_scale:gt}},io=(Ue,P,oe)=>({u_matrix:Ue,u_inv_matrix:P,u_camera_to_center_distance:oe.cameraToCenterDistance,u_viewport_size:[oe.width,oe.height]}),no=(Ue,P,oe=1)=>({u_matrix:Ue,u_color:P,u_overlay:0,u_overlay_scale:oe}),bo=Ue=>({u_matrix:Ue}),li=(Ue,P,oe,Se)=>({u_matrix:Ue,u_extrude_scale:Zn(P,1,oe),u_intensity:Se}),ts=(Ue,P,oe,Se)=>{const ke=t.H();t.aP(ke,0,Ue.width,Ue.height,0,0,1);const Be=Ue.context.gl;return{u_matrix:ke,u_world:[Be.drawingBufferWidth,Be.drawingBufferHeight],u_image:oe,u_color_ramp:Se,u_opacity:P.paint.get("heatmap-opacity")}};function Ho(Ue,P){const oe=Math.pow(2,P.canonical.z),Se=P.canonical.y;return[new t.Z(0,Se/oe).toLngLat().lat,new t.Z(0,(Se+1)/oe).toLngLat().lat]}const Gs=(Ue,P,oe,Se)=>{const ke=Ue.transform;return{u_matrix:js(Ue,P,oe,Se),u_ratio:1/Zn(P,1,ke.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_units_to_pixels:[1/ke.pixelsToGLUnits[0],1/ke.pixelsToGLUnits[1]]}},cs=(Ue,P,oe,Se,ke)=>t.e(Gs(Ue,P,oe,ke),{u_image:0,u_image_height:Se}),Jo=(Ue,P,oe,Se,ke)=>{const Be=Ue.transform,gt=Xs(P,Be);return{u_matrix:js(Ue,P,oe,ke),u_texsize:P.imageAtlasTexture.size,u_ratio:1/Zn(P,1,Be.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_image:0,u_scale:[gt,Se.fromScale,Se.toScale],u_fade:Se.t,u_units_to_pixels:[1/Be.pixelsToGLUnits[0],1/Be.pixelsToGLUnits[1]]}},Uo=(Ue,P,oe,Se,ke,Be)=>{const gt=Ue.lineAtlas,kt=Xs(P,Ue.transform),Gt=oe.layout.get("line-cap")==="round",cr=gt.getDash(Se.from,Gt),Tr=gt.getDash(Se.to,Gt),kr=cr.width*ke.fromScale,Qr=Tr.width*ke.toScale;return t.e(Gs(Ue,P,oe,Be),{u_patternscale_a:[kt/kr,-cr.height/2],u_patternscale_b:[kt/Qr,-Tr.height/2],u_sdfgamma:gt.width/(256*Math.min(kr,Qr)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:cr.y,u_tex_y_b:Tr.y,u_mix:ke.t})};function Xs(Ue,P){return 1/Zn(Ue,1,P.tileZoom)}function js(Ue,P,oe,Se){return Ue.translatePosMatrix(Se?Se.posMatrix:P.tileID.posMatrix,P,oe.paint.get("line-translate"),oe.paint.get("line-translate-anchor"))}const ol=(Ue,P,oe,Se,ke)=>{return{u_matrix:Ue,u_tl_parent:P,u_scale_parent:oe,u_buffer_scale:1,u_fade_t:Se.mix,u_opacity:Se.opacity*ke.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:ke.paint.get("raster-brightness-min"),u_brightness_high:ke.paint.get("raster-brightness-max"),u_saturation_factor:(gt=ke.paint.get("raster-saturation"),gt>0?1-1/(1.001-gt):-gt),u_contrast_factor:(Be=ke.paint.get("raster-contrast"),Be>0?1/(1-Be):1+Be),u_spin_weights:fs(ke.paint.get("raster-hue-rotate"))};var Be,gt};function fs(Ue){Ue*=Math.PI/180;const P=Math.sin(Ue),oe=Math.cos(Ue);return[(2*oe+1)/3,(-Math.sqrt(3)*P-oe+1)/3,(Math.sqrt(3)*P-oe+1)/3]}const Zo=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn)=>{const Ze=gt.transform;return{u_is_size_zoom_constant:+(Ue==="constant"||Ue==="source"),u_is_size_feature_constant:+(Ue==="constant"||Ue==="camera"),u_size_t:P?P.uSizeT:0,u_size:P?P.uSize:0,u_camera_to_center_distance:Ze.cameraToCenterDistance,u_pitch:Ze.pitch/360*2*Math.PI,u_rotate_symbol:+oe,u_aspect_ratio:Ze.width/Ze.height,u_fade_change:gt.options.fadeDuration?gt.symbolFadeChange:1,u_matrix:kt,u_label_plane_matrix:Gt,u_coord_matrix:cr,u_is_text:+kr,u_pitch_with_map:+Se,u_is_along_line:ke,u_is_variable_anchor:Be,u_texsize:Qr,u_texture:0,u_translation:Tr,u_pitched_scale:yn}},ho=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn,Ze)=>{const et=gt.transform;return t.e(Zo(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,Ze),{u_gamma_scale:Se?Math.cos(et._pitch)*et.cameraToCenterDistance:1,u_device_pixel_ratio:gt.pixelRatio,u_is_halo:1})},hs=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,kr,Qr,yn)=>t.e(ho(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Tr,!0,kr,!0,yn),{u_texsize_icon:Qr,u_texture_icon:1}),sl=(Ue,P,oe)=>({u_matrix:Ue,u_opacity:P,u_color:oe}),El=(Ue,P,oe,Se,ke,Be)=>t.e((function(gt,kt,Gt,cr){const Tr=Gt.imageManager.getPattern(gt.from.toString()),kr=Gt.imageManager.getPattern(gt.to.toString()),{width:Qr,height:yn}=Gt.imageManager.getPixelSize(),Ze=Math.pow(2,cr.tileID.overscaledZ),et=cr.tileSize*Math.pow(2,Gt.transform.tileZoom)/Ze,ft=et*(cr.tileID.canonical.x+cr.tileID.wrap*Ze),_t=et*cr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Tr.tl,u_pattern_br_a:Tr.br,u_pattern_tl_b:kr.tl,u_pattern_br_b:kr.br,u_texsize:[Qr,yn],u_mix:kt.t,u_pattern_size_a:Tr.displaySize,u_pattern_size_b:kr.displaySize,u_scale_a:kt.fromScale,u_scale_b:kt.toScale,u_tile_units_to_pixels:1/Zn(cr,1,Gt.transform.tileZoom),u_pixel_coord_upper:[ft>>16,_t>>16],u_pixel_coord_lower:[65535&ft,65535&_t]}})(Se,Be,oe,ke),{u_matrix:Ue,u_opacity:P}),Ll={fillExtrusion:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_opacity:new t.aI(Ue,P.u_opacity)}),fillExtrusionPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_height_factor:new t.aI(Ue,P.u_height_factor),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade),u_opacity:new t.aI(Ue,P.u_opacity)}),fill:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),fillPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),fillOutline:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world)}),fillOutlinePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),circle:(Ue,P)=>({u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_scale_with_map:new t.aH(Ue,P.u_scale_with_map),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_extrude_scale:new t.aO(Ue,P.u_extrude_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_matrix:new t.aJ(Ue,P.u_matrix)}),collisionBox:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_pixel_extrude_scale:new t.aO(Ue,P.u_pixel_extrude_scale)}),collisionCircle:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_inv_matrix:new t.aJ(Ue,P.u_inv_matrix),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_viewport_size:new t.aO(Ue,P.u_viewport_size)}),debug:(Ue,P)=>({u_color:new t.aL(Ue,P.u_color),u_matrix:new t.aJ(Ue,P.u_matrix),u_overlay:new t.aH(Ue,P.u_overlay),u_overlay_scale:new t.aI(Ue,P.u_overlay_scale)}),clippingMask:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmap:(Ue,P)=>({u_extrude_scale:new t.aI(Ue,P.u_extrude_scale),u_intensity:new t.aI(Ue,P.u_intensity),u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmapTexture:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_color_ramp:new t.aH(Ue,P.u_color_ramp),u_opacity:new t.aI(Ue,P.u_opacity)}),hillshade:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_latrange:new t.aO(Ue,P.u_latrange),u_light:new t.aO(Ue,P.u_light),u_shadow:new t.aL(Ue,P.u_shadow),u_highlight:new t.aL(Ue,P.u_highlight),u_accent:new t.aL(Ue,P.u_accent)}),hillshadePrepare:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_dimension:new t.aO(Ue,P.u_dimension),u_zoom:new t.aI(Ue,P.u_zoom),u_unpack:new t.aK(Ue,P.u_unpack)}),line:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels)}),lineGradient:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_image:new t.aH(Ue,P.u_image),u_image_height:new t.aI(Ue,P.u_image_height)}),linePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texsize:new t.aO(Ue,P.u_texsize),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_image:new t.aH(Ue,P.u_image),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),lineSDF:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_patternscale_a:new t.aO(Ue,P.u_patternscale_a),u_patternscale_b:new t.aO(Ue,P.u_patternscale_b),u_sdfgamma:new t.aI(Ue,P.u_sdfgamma),u_image:new t.aH(Ue,P.u_image),u_tex_y_a:new t.aI(Ue,P.u_tex_y_a),u_tex_y_b:new t.aI(Ue,P.u_tex_y_b),u_mix:new t.aI(Ue,P.u_mix)}),raster:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_tl_parent:new t.aO(Ue,P.u_tl_parent),u_scale_parent:new t.aI(Ue,P.u_scale_parent),u_buffer_scale:new t.aI(Ue,P.u_buffer_scale),u_fade_t:new t.aI(Ue,P.u_fade_t),u_opacity:new t.aI(Ue,P.u_opacity),u_image0:new t.aH(Ue,P.u_image0),u_image1:new t.aH(Ue,P.u_image1),u_brightness_low:new t.aI(Ue,P.u_brightness_low),u_brightness_high:new t.aI(Ue,P.u_brightness_high),u_saturation_factor:new t.aI(Ue,P.u_saturation_factor),u_contrast_factor:new t.aI(Ue,P.u_contrast_factor),u_spin_weights:new t.aN(Ue,P.u_spin_weights)}),symbolIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolSDF:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolTextAndIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texsize_icon:new t.aO(Ue,P.u_texsize_icon),u_texture:new t.aH(Ue,P.u_texture),u_texture_icon:new t.aH(Ue,P.u_texture_icon),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),background:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_color:new t.aL(Ue,P.u_color)}),backgroundPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_image:new t.aH(Ue,P.u_image),u_pattern_tl_a:new t.aO(Ue,P.u_pattern_tl_a),u_pattern_br_a:new t.aO(Ue,P.u_pattern_br_a),u_pattern_tl_b:new t.aO(Ue,P.u_pattern_tl_b),u_pattern_br_b:new t.aO(Ue,P.u_pattern_br_b),u_texsize:new t.aO(Ue,P.u_texsize),u_mix:new t.aI(Ue,P.u_mix),u_pattern_size_a:new t.aO(Ue,P.u_pattern_size_a),u_pattern_size_b:new t.aO(Ue,P.u_pattern_size_b),u_scale_a:new t.aI(Ue,P.u_scale_a),u_scale_b:new t.aI(Ue,P.u_scale_b),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Ue,P.u_tile_units_to_pixels)}),terrain:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_ele_delta:new t.aI(Ue,P.u_ele_delta),u_fog_matrix:new t.aJ(Ue,P.u_fog_matrix),u_fog_color:new t.aL(Ue,P.u_fog_color),u_fog_ground_blend:new t.aI(Ue,P.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Ue,P.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon_fog_blend:new t.aI(Ue,P.u_horizon_fog_blend)}),terrainDepth:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),terrainCoords:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_terrain_coords_id:new t.aI(Ue,P.u_terrain_coords_id),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),sky:(Ue,P)=>({u_sky_color:new t.aL(Ue,P.u_sky_color),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon:new t.aI(Ue,P.u_horizon),u_sky_horizon_blend:new t.aI(Ue,P.u_sky_horizon_blend)})};class Es{constructor(P,oe,Se){this.context=P;const ke=P.gl;this.buffer=ke.createBuffer(),this.dynamicDraw=!!Se,this.context.unbindVAO(),P.bindElementBuffer.set(this.buffer),ke.bufferData(ke.ELEMENT_ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?ke.DYNAMIC_DRAW:ke.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(P){const oe=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),oe.bufferSubData(oe.ELEMENT_ARRAY_BUFFER,0,P.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ci={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ji{constructor(P,oe,Se,ke){this.length=oe.length,this.attributes=Se,this.itemSize=oe.bytesPerElement,this.dynamicDraw=ke,this.context=P;const Be=P.gl;this.buffer=Be.createBuffer(),P.bindVertexBuffer.set(this.buffer),Be.bufferData(Be.ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?Be.DYNAMIC_DRAW:Be.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(P){if(P.length!==this.length)throw new Error(`Length of new data is ${P.length}, which doesn't match current length of ${this.length}`);const oe=this.context.gl;this.bind(),oe.bufferSubData(oe.ARRAY_BUFFER,0,P.arrayBuffer)}enableAttributes(P,oe){for(let Se=0;Se0){const wr=t.H();t.aQ(wr,Et.placementInvProjMatrix,Ue.transform.glCoordMatrix),t.aQ(wr,wr,Et.placementViewportMatrix),Gt.push({circleArray:mr,circleOffset:Tr,transform:zt.posMatrix,invTransform:wr,coord:zt}),cr+=mr.length/4,Tr=cr}Ut&&kt.draw(Be,gt.LINES,Os.disabled,vl.disabled,Ue.colorModeForRenderPass(),Do.disabled,{u_matrix:zt.posMatrix,u_pixel_extrude_scale:[1/(kr=Ue.transform).width,1/kr.height]},Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt),oe.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,Ue.transform.zoom,null,null,Ut.collisionVertexBuffer)}var kr;if(!ke||!Gt.length)return;const Qr=Ue.useProgram("collisionCircle"),yn=new t.aR;yn.resize(4*cr),yn._trim();let Ze=0;for(const _t of Gt)for(let zt=0;zt<_t.circleArray.length/4;zt++){const Et=4*zt,Ut=_t.circleArray[Et+0],mr=_t.circleArray[Et+1],wr=_t.circleArray[Et+2],Lr=_t.circleArray[Et+3];yn.emplace(Ze++,Ut,mr,wr,Lr,0),yn.emplace(Ze++,Ut,mr,wr,Lr,1),yn.emplace(Ze++,Ut,mr,wr,Lr,2),yn.emplace(Ze++,Ut,mr,wr,Lr,3)}(!Wf||Wf.length<2*cr)&&(Wf=(function(_t){const zt=2*_t,Et=new t.aT;Et.resize(zt),Et._trim();for(let Ut=0;Ut=0&&(_t[Et.associatedIconIndex]={shiftedAnchor:Zi,angle:yo})}else pr(Et.numGlyphs,et)}if(cr){ft.clear();const zt=Ue.icon.placedSymbolArray;for(let Et=0;EtUe.style.map.terrain.getElevation(Ln,kn,Ca):null,Sn=oe.layout.get("text-rotation-alignment")==="map";Ee(ba,Ln.posMatrix,Ue,ke,ac,ge,_t,cr,Sn,et,Ln.toUnwrapped(),Ze.width,Ze.height,Oe,fn)}const At=Ln.posMatrix,It=ke&&Gr||xt,Qt=zt||It?Ru:ac,Jt=zc,yr=ri&&oe.paint.get(ke?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Xr;Xr=ri?ba.iconsInText?hs(Zi.kind,Wo,Et,_t,zt,It,Ue,At,Qt,Jt,Oe,$s,eu,Mn):ho(Zi.kind,Wo,Et,_t,zt,It,Ue,At,Qt,Jt,Oe,ke,$s,!0,Mn):Zo(Zi.kind,Wo,Et,_t,zt,It,Ue,At,Qt,Jt,Oe,ke,$s,Mn);const Hr={program:co,buffers:ti,uniformValues:Xr,atlasTexture:ks,atlasTextureIcon:Cs,atlasInterpolation:nl,atlasInterpolationIcon:hu,isSDF:ri,hasHalo:yr};if(mr&&ba.canOverlap){wr=!0;const fn=ti.segments.get();for(const Sn of fn)an.push({segments:new t.a0([Sn]),sortKey:Sn.sortKey,state:Hr,terrainData:Ks})}else an.push({segments:ti.segments,sortKey:0,state:Hr,terrainData:Ks})}wr&&an.sort((Ln,Gn)=>Ln.sortKey-Gn.sortKey);for(const Ln of an){const Gn=Ln.state;if(Qr.activeTexture.set(yn.TEXTURE0),Gn.atlasTexture.bind(Gn.atlasInterpolation,yn.CLAMP_TO_EDGE),Gn.atlasTextureIcon&&(Qr.activeTexture.set(yn.TEXTURE1),Gn.atlasTextureIcon&&Gn.atlasTextureIcon.bind(Gn.atlasInterpolationIcon,yn.CLAMP_TO_EDGE)),Gn.isSDF){const ba=Gn.uniformValues;Gn.hasHalo&&(ba.u_is_halo=1,Nh(Gn.buffers,Ln.segments,oe,Ue,Gn.program,Lr,Tr,kr,ba,Ln.terrainData)),ba.u_is_halo=0}Nh(Gn.buffers,Ln.segments,oe,Ue,Gn.program,Lr,Tr,kr,Gn.uniformValues,Ln.terrainData)}}function Nh(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr){const Tr=Se.context;ke.draw(Tr,Tr.gl.TRIANGLES,Be,gt,kt,Do.disabled,Gt,cr,oe.id,Ue.layoutVertexBuffer,Ue.indexBuffer,P,oe.paint,Se.transform.zoom,Ue.programConfigurations.get(oe.id),Ue.dynamicLayoutVertexBuffer,Ue.opacityVertexBuffer)}function ih(Ue,P,oe,Se){const ke=Ue.context,Be=ke.gl,gt=vl.disabled,kt=new su([Be.ONE,Be.ONE],t.aM.transparent,[!0,!0,!0,!0]),Gt=P.getBucket(oe);if(!Gt)return;const cr=Se.key;let Tr=oe.heatmapFbos.get(cr);Tr||(Tr=Rh(ke,P.tileSize,P.tileSize),oe.heatmapFbos.set(cr,Tr)),ke.bindFramebuffer.set(Tr.framebuffer),ke.viewport.set([0,0,P.tileSize,P.tileSize]),ke.clear({color:t.aM.transparent});const kr=Gt.programConfigurations.get(oe.id),Qr=Ue.useProgram("heatmap",kr),yn=Ue.style.map.terrain.getTerrainData(Se);Qr.draw(ke,Be.TRIANGLES,Os.disabled,gt,kt,Do.disabled,li(Se.posMatrix,P,Ue.transform.zoom,oe.paint.get("heatmap-intensity")),yn,oe.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.segments,oe.paint,Ue.transform.zoom,kr)}function Df(Ue,P,oe){const Se=Ue.context,ke=Se.gl;Se.setColorMode(Ue.colorModeForRenderPass());const Be=Ih(Se,P),gt=oe.key,kt=P.heatmapFbos.get(gt);kt&&(Se.activeTexture.set(ke.TEXTURE0),ke.bindTexture(ke.TEXTURE_2D,kt.colorAttachment.get()),Se.activeTexture.set(ke.TEXTURE1),Be.bind(ke.LINEAR,ke.CLAMP_TO_EDGE),Ue.useProgram("heatmapTexture").draw(Se,ke.TRIANGLES,Os.disabled,vl.disabled,Ue.colorModeForRenderPass(),Do.disabled,ts(Ue,P,0,1),null,P.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments,P.paint,Ue.transform.zoom),kt.destroy(),P.heatmapFbos.delete(gt))}function Rh(Ue,P,oe){var Se,ke;const Be=Ue.gl,gt=Be.createTexture();Be.bindTexture(Be.TEXTURE_2D,gt),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Be.LINEAR),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,Be.LINEAR);const kt=(Se=Ue.HALF_FLOAT)!==null&&Se!==void 0?Se:Be.UNSIGNED_BYTE,Gt=(ke=Ue.RGBA16F)!==null&&ke!==void 0?ke:Be.RGBA;Be.texImage2D(Be.TEXTURE_2D,0,Gt,P,oe,0,Be.RGBA,kt,null);const cr=Ue.createFramebuffer(P,oe,!1,!1);return cr.colorAttachment.set(gt),cr}function Ih(Ue,P){return P.colorRampTexture||(P.colorRampTexture=new u(Ue,P.colorRamp,Ue.gl.RGBA)),P.colorRampTexture}function ef(Ue,P,oe,Se,ke){if(!oe||!Se||!Se.imageAtlas)return;const Be=Se.imageAtlas.patternPositions;let gt=Be[oe.to.toString()],kt=Be[oe.from.toString()];if(!gt&&kt&&(gt=kt),!kt&>&&(kt=gt),!gt||!kt){const Gt=ke.getPaintProperty(P);gt=Be[Gt],kt=Be[Gt]}gt&&kt&&Ue.setConstantPatternPositions(gt,kt)}function Uh(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context.gl,Gt="fill-pattern",cr=oe.paint.get(Gt),Tr=cr&&cr.constantOr(1),kr=oe.getCrossfadeParameters();let Qr,yn,Ze,et,ft;gt?(yn=Tr&&!oe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Qr=kt.LINES):(yn=Tr?"fillPattern":"fill",Qr=kt.TRIANGLES);const _t=cr.constantOr(null);for(const zt of Se){const Et=P.getTile(zt);if(Tr&&!Et.patternsLoaded())continue;const Ut=Et.getBucket(oe);if(!Ut)continue;const mr=Ut.programConfigurations.get(oe.id),wr=Ue.useProgram(yn,mr),Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt);Tr&&(Ue.context.activeTexture.set(kt.TEXTURE0),Et.imageAtlasTexture.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),mr.updatePaintBuffers(kr)),ef(mr,Gt,_t,Et,oe);const Gr=Lr?zt:null,an=Ue.translatePosMatrix(Gr?Gr.posMatrix:zt.posMatrix,Et,oe.paint.get("fill-translate"),oe.paint.get("fill-translate-anchor"));if(gt){et=Ut.indexBuffer2,ft=Ut.segments2;const Mn=[kt.drawingBufferWidth,kt.drawingBufferHeight];Ze=yn==="fillOutlinePattern"&&Tr?Ei(an,Ue,kr,Et,Mn):Ma(an,Mn)}else et=Ut.indexBuffer,ft=Ut.segments,Ze=Tr?di(an,Ue,kr,Et):Rn(an);wr.draw(Ue.context,Qr,ke,Ue.stencilModeForClipping(zt),Be,Do.disabled,Ze,Lr,oe.id,Ut.layoutVertexBuffer,et,ft,oe.paint,Ue.transform.zoom,mr)}}function bf(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context,Gt=kt.gl,cr="fill-extrusion-pattern",Tr=oe.paint.get(cr),kr=Tr.constantOr(1),Qr=oe.getCrossfadeParameters(),yn=oe.paint.get("fill-extrusion-opacity"),Ze=Tr.constantOr(null);for(const et of Se){const ft=P.getTile(et),_t=ft.getBucket(oe);if(!_t)continue;const zt=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(et),Et=_t.programConfigurations.get(oe.id),Ut=Ue.useProgram(kr?"fillExtrusionPattern":"fillExtrusion",Et);kr&&(Ue.context.activeTexture.set(Gt.TEXTURE0),ft.imageAtlasTexture.bind(Gt.LINEAR,Gt.CLAMP_TO_EDGE),Et.updatePaintBuffers(Qr)),ef(Et,cr,Ze,ft,oe);const mr=Ue.translatePosMatrix(et.posMatrix,ft,oe.paint.get("fill-extrusion-translate"),oe.paint.get("fill-extrusion-translate-anchor")),wr=oe.paint.get("fill-extrusion-vertical-gradient"),Lr=kr?un(mr,Ue,wr,yn,et,Qr,ft):Un(mr,Ue,wr,yn);Ut.draw(kt,kt.gl.TRIANGLES,ke,Be,gt,Do.backCCW,Lr,zt,oe.id,_t.layoutVertexBuffer,_t.indexBuffer,_t.segments,oe.paint,Ue.transform.zoom,Et,Ue.style.map.terrain&&_t.centroidVertexBuffer)}}function lf(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context,Gt=kt.gl,cr=oe.fbo;if(!cr)return;const Tr=Ue.useProgram("hillshade"),kr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,cr.colorAttachment.get()),Tr.draw(kt,Gt.TRIANGLES,ke,Be,gt,Do.disabled,((Qr,yn,Ze,et)=>{const ft=Ze.paint.get("hillshade-shadow-color"),_t=Ze.paint.get("hillshade-highlight-color"),zt=Ze.paint.get("hillshade-accent-color");let Et=Ze.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ze.paint.get("hillshade-illumination-anchor")==="viewport"&&(Et-=Qr.transform.angle);const Ut=!Qr.options.moving;return{u_matrix:et?et.posMatrix:Qr.transform.calculatePosMatrix(yn.tileID.toUnwrapped(),Ut),u_image:0,u_latrange:Ho(0,yn.tileID),u_light:[Ze.paint.get("hillshade-exaggeration"),Et],u_shadow:ft,u_highlight:_t,u_accent:zt}})(Ue,oe,Se,kr?P:null),kr,Se.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments)}function Yu(Ue,P,oe,Se,ke,Be){const gt=Ue.context,kt=gt.gl,Gt=P.dem;if(Gt&&Gt.data){const cr=Gt.dim,Tr=Gt.stride,kr=Gt.getPixels();if(gt.activeTexture.set(kt.TEXTURE1),gt.pixelStoreUnpackPremultiplyAlpha.set(!1),P.demTexture=P.demTexture||Ue.getTileTexture(Tr),P.demTexture){const yn=P.demTexture;yn.update(kr,{premultiply:!1}),yn.bind(kt.NEAREST,kt.CLAMP_TO_EDGE)}else P.demTexture=new u(gt,kr,kt.RGBA,{premultiply:!1}),P.demTexture.bind(kt.NEAREST,kt.CLAMP_TO_EDGE);gt.activeTexture.set(kt.TEXTURE0);let Qr=P.fbo;if(!Qr){const yn=new u(gt,{width:cr,height:cr,data:null},kt.RGBA);yn.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),Qr=P.fbo=gt.createFramebuffer(cr,cr,!0,!1),Qr.colorAttachment.set(yn.texture)}gt.bindFramebuffer.set(Qr.framebuffer),gt.viewport.set([0,0,cr,cr]),Ue.useProgram("hillshadePrepare").draw(gt,kt.TRIANGLES,Se,ke,Be,Do.disabled,((yn,Ze)=>{const et=Ze.stride,ft=t.H();return t.aP(ft,0,t.X,-t.X,0,0,1),t.J(ft,ft,[0,-t.X,0]),{u_matrix:ft,u_image:1,u_dimension:[et,et],u_zoom:yn.overscaledZ,u_unpack:Ze.getUnpackVector()}})(P.tileID,Gt),null,oe.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments),P.needsHillshadePrepare=!1}}function Vf(Ue,P,oe,Se,ke,Be){const gt=Se.paint.get("raster-fade-duration");if(!Be&>>0){const kt=i.now(),Gt=(kt-Ue.timeAdded)/gt,cr=P?(kt-P.timeAdded)/gt:-1,Tr=oe.getSource(),kr=ke.coveringZoomLevel({tileSize:Tr.tileSize,roundZoom:Tr.roundZoom}),Qr=!P||Math.abs(P.tileID.overscaledZ-kr)>Math.abs(Ue.tileID.overscaledZ-kr),yn=Qr&&Ue.refreshedUponExpiration?1:t.ac(Qr?Gt:1-cr,0,1);return Ue.refreshedUponExpiration&&Gt>=1&&(Ue.refreshedUponExpiration=!1),P?{opacity:1,mix:1-yn}:{opacity:yn,mix:0}}return{opacity:1,mix:0}}const Dh=new t.aM(1,0,0,1),Fl=new t.aM(0,1,0,1),yh=new t.aM(0,0,1,1),bv=new t.aM(1,0,1,1),jh=new t.aM(0,1,1,1);function oh(Ue,P,oe,Se){Lc(Ue,0,P+oe/2,Ue.transform.width,oe,Se)}function qh(Ue,P,oe,Se){Lc(Ue,P-oe/2,0,oe,Ue.transform.height,Se)}function Lc(Ue,P,oe,Se,ke,Be){const gt=Ue.context,kt=gt.gl;kt.enable(kt.SCISSOR_TEST),kt.scissor(P*Ue.pixelRatio,oe*Ue.pixelRatio,Se*Ue.pixelRatio,ke*Ue.pixelRatio),gt.clear({color:Be}),kt.disable(kt.SCISSOR_TEST)}function Vh(Ue,P,oe){const Se=Ue.context,ke=Se.gl,Be=oe.posMatrix,gt=Ue.useProgram("debug"),kt=Os.disabled,Gt=vl.disabled,cr=Ue.colorModeForRenderPass(),Tr="$debug",kr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(oe);Se.activeTexture.set(ke.TEXTURE0);const Qr=P.getTileByID(oe.key).latestRawTileData,yn=Math.floor((Qr&&Qr.byteLength||0)/1024),Ze=P.getTile(oe).tileSize,et=512/Math.min(Ze,512)*(oe.overscaledZ/Ue.transform.zoom)*.5;let ft=oe.canonical.toString();oe.overscaledZ!==oe.canonical.z&&(ft+=` => ${oe.overscaledZ}`),(function(_t,zt){_t.initDebugOverlayCanvas();const Et=_t.debugOverlayCanvas,Ut=_t.context.gl,mr=_t.debugOverlayCanvas.getContext("2d");mr.clearRect(0,0,Et.width,Et.height),mr.shadowColor="white",mr.shadowBlur=2,mr.lineWidth=1.5,mr.strokeStyle="white",mr.textBaseline="top",mr.font="bold 36px Open Sans, sans-serif",mr.fillText(zt,5,5),mr.strokeText(zt,5,5),_t.debugOverlayTexture.update(Et),_t.debugOverlayTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE)})(Ue,`${ft} ${yn}kB`),gt.draw(Se,ke.TRIANGLES,kt,Gt,su.alphaBlended,Do.disabled,no(Be,t.aM.transparent,et),null,Tr,Ue.debugBuffer,Ue.quadTriangleIndexBuffer,Ue.debugSegments),gt.draw(Se,ke.LINE_STRIP,kt,Gt,cr,Do.disabled,no(Be,t.aM.red),kr,Tr,Ue.debugBuffer,Ue.tileBorderIndexBuffer,Ue.debugSegments)}function gu(Ue,P,oe){const Se=Ue.context,ke=Se.gl,Be=Ue.colorModeForRenderPass(),gt=new Os(ke.LEQUAL,Os.ReadWrite,Ue.depthRangeFor3D),kt=Ue.useProgram("terrain"),Gt=P.getTerrainMesh();Se.bindFramebuffer.set(null),Se.viewport.set([0,0,Ue.width,Ue.height]);for(const cr of oe){const Tr=Ue.renderToTexture.getTexture(cr),kr=P.getTerrainData(cr.tileID);Se.activeTexture.set(ke.TEXTURE0),ke.bindTexture(ke.TEXTURE_2D,Tr.texture);const Qr=Ue.transform.calculatePosMatrix(cr.tileID.toUnwrapped()),yn=P.getMeshFrameDelta(Ue.transform.zoom),Ze=Ue.transform.calculateFogMatrix(cr.tileID.toUnwrapped()),et=Dr(Qr,yn,Ze,Ue.style.sky,Ue.transform.pitch);kt.draw(Se,ke.TRIANGLES,gt,vl.disabled,Be,Do.backCCW,et,kr,"terrain",Gt.vertexBuffer,Gt.indexBuffer,Gt.segments)}}class Pc{constructor(P,oe,Se){this.vertexBuffer=P,this.indexBuffer=oe,this.segments=Se}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class zf{constructor(P,oe){this.context=new xv(P),this.transform=oe,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Nt.maxUnderzooming+Nt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Nr}resize(P,oe,Se){if(this.width=Math.floor(P*Se),this.height=Math.floor(oe*Se),this.pixelRatio=Se,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const ke of this.style._order)this.style._layers[ke].resize()}setup(){const P=this.context,oe=new t.aX;oe.emplaceBack(0,0),oe.emplaceBack(t.X,0),oe.emplaceBack(0,t.X),oe.emplaceBack(t.X,t.X),this.tileExtentBuffer=P.createVertexBuffer(oe,sn.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Se=new t.aX;Se.emplaceBack(0,0),Se.emplaceBack(t.X,0),Se.emplaceBack(0,t.X),Se.emplaceBack(t.X,t.X),this.debugBuffer=P.createVertexBuffer(Se,sn.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const ke=new t.$;ke.emplaceBack(0,0,0,0),ke.emplaceBack(t.X,0,t.X,0),ke.emplaceBack(0,t.X,0,t.X),ke.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=P.createVertexBuffer(ke,Ye.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Be=new t.aX;Be.emplaceBack(0,0),Be.emplaceBack(1,0),Be.emplaceBack(0,1),Be.emplaceBack(1,1),this.viewportBuffer=P.createVertexBuffer(Be,sn.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const gt=new t.aZ;gt.emplaceBack(0),gt.emplaceBack(1),gt.emplaceBack(3),gt.emplaceBack(2),gt.emplaceBack(0),this.tileBorderIndexBuffer=P.createIndexBuffer(gt);const kt=new t.aY;kt.emplaceBack(0,1,2),kt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=P.createIndexBuffer(kt);const Gt=this.context.gl;this.stencilClearMode=new vl({func:Gt.ALWAYS,mask:0},0,255,Gt.ZERO,Gt.ZERO,Gt.ZERO)}clearStencil(){const P=this.context,oe=P.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Se=t.H();t.aP(Se,0,this.width,this.height,0,0,1),t.K(Se,Se,[oe.drawingBufferWidth,oe.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(P,oe.TRIANGLES,Os.disabled,this.stencilClearMode,su.disabled,Do.disabled,bo(Se),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(P,oe){if(this.currentStencilSource===P.source||!P.isTileClipped()||!oe||!oe.length)return;this.currentStencilSource=P.source;const Se=this.context,ke=Se.gl;this.nextStencilID+oe.length>256&&this.clearStencil(),Se.setColorMode(su.disabled),Se.setDepthMode(Os.disabled);const Be=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const gt of oe){const kt=this._tileClippingMaskIDs[gt.key]=this.nextStencilID++,Gt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(gt);Be.draw(Se,ke.TRIANGLES,Os.disabled,new vl({func:ke.ALWAYS,mask:0},kt,255,ke.KEEP,ke.KEEP,ke.REPLACE),su.disabled,Do.disabled,bo(gt.posMatrix),Gt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const P=this.nextStencilID++,oe=this.context.gl;return new vl({func:oe.NOTEQUAL,mask:255},P,255,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilModeForClipping(P){const oe=this.context.gl;return new vl({func:oe.EQUAL,mask:255},this._tileClippingMaskIDs[P.key],0,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilConfigForOverlap(P){const oe=this.context.gl,Se=P.sort((gt,kt)=>kt.overscaledZ-gt.overscaledZ),ke=Se[Se.length-1].overscaledZ,Be=Se[0].overscaledZ-ke+1;if(Be>1){this.currentStencilSource=void 0,this.nextStencilID+Be>256&&this.clearStencil();const gt={};for(let kt=0;kt({u_sky_color:_t.properties.get("sky-color"),u_horizon_color:_t.properties.get("horizon-color"),u_horizon:(zt.height/2+zt.getHorizon())*Et,u_sky_horizon_blend:_t.properties.get("sky-horizon-blend")*zt.height/2*Et}))(cr,Gt.style.map.transform,Gt.pixelRatio),yn=new Os(kr.LEQUAL,Os.ReadWrite,[0,1]),Ze=vl.disabled,et=Gt.colorModeForRenderPass(),ft=Gt.useProgram("sky");if(!cr.mesh){const _t=new t.aX;_t.emplaceBack(-1,-1),_t.emplaceBack(1,-1),_t.emplaceBack(1,1),_t.emplaceBack(-1,1);const zt=new t.aY;zt.emplaceBack(0,1,2),zt.emplaceBack(0,2,3),cr.mesh=new Pc(Tr.createVertexBuffer(_t,sn.members),Tr.createIndexBuffer(zt),t.a0.simpleSegment(0,0,_t.length,zt.length))}ft.draw(Tr,kr.TRIANGLES,yn,Ze,et,Do.disabled,Qr,void 0,"sky",cr.mesh.vertexBuffer,cr.mesh.indexBuffer,cr.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=oe.showOverdrawInspector,this.depthRangeFor3D=[0,1-(P._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Se.length-1;this.currentLayer>=0;this.currentLayer--){const Gt=this.style._layers[Se[this.currentLayer]],cr=ke[Gt.source],Tr=Be[Gt.source];this._renderTileClippingMasks(Gt,Tr),this.renderLayer(this,cr,Gt,Tr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerft.source&&!ft.isHidden(Tr)?[cr.sourceCaches[ft.source]]:[]),yn=Qr.filter(ft=>ft.getSource().type==="vector"),Ze=Qr.filter(ft=>ft.getSource().type!=="vector"),et=ft=>{(!kr||kr.getSource().maxzoomet(ft)),kr||Ze.forEach(ft=>et(ft)),kr})(this.style,this.transform.zoom);Gt&&(function(cr,Tr,kr){for(let Qr=0;Qr0),ke&&(t.b0(oe,Se),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Be,gt){const kt=Be.context,Gt=kt.gl,cr=su.unblended,Tr=new Os(Gt.LEQUAL,Os.ReadWrite,[0,1]),kr=gt.getTerrainMesh(),Qr=gt.sourceCache.getRenderableTiles(),yn=Be.useProgram("terrainDepth");kt.bindFramebuffer.set(gt.getFramebuffer("depth").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1});for(const Ze of Qr){const et=gt.getTerrainData(Ze.tileID),ft={u_matrix:Be.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_ele_delta:gt.getMeshFrameDelta(Be.transform.zoom)};yn.draw(kt,Gt.TRIANGLES,Tr,vl.disabled,cr,Do.backCCW,ft,et,"terrain",kr.vertexBuffer,kr.indexBuffer,kr.segments)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain),(function(Be,gt){const kt=Be.context,Gt=kt.gl,cr=su.unblended,Tr=new Os(Gt.LEQUAL,Os.ReadWrite,[0,1]),kr=gt.getTerrainMesh(),Qr=gt.getCoordsTexture(),yn=gt.sourceCache.getRenderableTiles(),Ze=Be.useProgram("terrainCoords");kt.bindFramebuffer.set(gt.getFramebuffer("coords").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1}),gt.coordsIndex=[];for(const et of yn){const ft=gt.getTerrainData(et.tileID);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,Qr.texture);const _t={u_matrix:Be.transform.calculatePosMatrix(et.tileID.toUnwrapped()),u_terrain_coords_id:(255-gt.coordsIndex.length)/255,u_texture:0,u_ele_delta:gt.getMeshFrameDelta(Be.transform.zoom)};Ze.draw(kt,Gt.TRIANGLES,Tr,vl.disabled,cr,Do.backCCW,_t,ft,"terrain",kr.vertexBuffer,kr.indexBuffer,kr.segments),gt.coordsIndex.push(et.tileID.key)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain))}renderLayer(P,oe,Se,ke){if(!Se.isHidden(this.transform.zoom)&&(Se.type==="background"||Se.type==="custom"||(ke||[]).length))switch(this.id=Se.id,Se.type){case"symbol":(function(Be,gt,kt,Gt,cr){if(Be.renderPass!=="translucent")return;const Tr=vl.disabled,kr=Be.colorModeForRenderPass();(kt._unevaluatedLayout.hasValue("text-variable-anchor")||kt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Qr,yn,Ze,et,ft,_t,zt,Et,Ut){const mr=yn.transform,wr=ka(),Lr=ft==="map",Gr=_t==="map";for(const an of Qr){const Mn=et.getTile(an),Ln=Mn.getBucket(Ze);if(!Ln||!Ln.text||!Ln.text.segments.get().length)continue;const Gn=t.ag(Ln.textSizeData,mr.zoom),ba=Zn(Mn,1,yn.transform.zoom),ti=Ar(an.posMatrix,Gr,Lr,yn.transform,ba),Za=Ze.layout.get("icon-text-fit")!=="none"&&Ln.hasIconData();if(Gn){const ri=Math.pow(2,mr.zoom-Mn.tileID.overscaledZ),Zi=yn.style.map.terrain?(co,Wo)=>yn.style.map.terrain.getElevation(an,co,Wo):null,yo=wr.translatePosition(mr,Mn,zt,Et);ah(Ln,Lr,Gr,Ut,mr,ti,an.posMatrix,ri,Gn,Za,wr,yo,an.toUnwrapped(),Zi)}}})(Gt,Be,kt,gt,kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),cr),kt.paint.get("icon-opacity").constantOr(1)!==0&&ov(Be,gt,kt,Gt,!1,kt.paint.get("icon-translate"),kt.paint.get("icon-translate-anchor"),kt.layout.get("icon-rotation-alignment"),kt.layout.get("icon-pitch-alignment"),kt.layout.get("icon-keep-upright"),Tr,kr),kt.paint.get("text-opacity").constantOr(1)!==0&&ov(Be,gt,kt,Gt,!0,kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.layout.get("text-keep-upright"),Tr,kr),gt.map.showCollisionBoxes&&(Qc(Be,gt,kt,Gt,!0),Qc(Be,gt,kt,Gt,!1))})(P,oe,Se,ke,this.style.placement.variableOffsets);break;case"circle":(function(Be,gt,kt,Gt){if(Be.renderPass!=="translucent")return;const cr=kt.paint.get("circle-opacity"),Tr=kt.paint.get("circle-stroke-width"),kr=kt.paint.get("circle-stroke-opacity"),Qr=!kt.layout.get("circle-sort-key").isConstant();if(cr.constantOr(1)===0&&(Tr.constantOr(1)===0||kr.constantOr(1)===0))return;const yn=Be.context,Ze=yn.gl,et=Be.depthModeForSublayer(0,Os.ReadOnly),ft=vl.disabled,_t=Be.colorModeForRenderPass(),zt=[];for(let Et=0;EtEt.sortKey-Ut.sortKey);for(const Et of zt){const{programConfiguration:Ut,program:mr,layoutVertexBuffer:wr,indexBuffer:Lr,uniformValues:Gr,terrainData:an}=Et.state;mr.draw(yn,Ze.TRIANGLES,et,ft,_t,Do.disabled,Gr,an,kt.id,wr,Lr,Et.segments,kt.paint,Be.transform.zoom,Ut)}})(P,oe,Se,ke);break;case"heatmap":(function(Be,gt,kt,Gt){if(kt.paint.get("heatmap-opacity")===0)return;const cr=Be.context;if(Be.style.map.terrain){for(const Tr of Gt){const kr=gt.getTile(Tr);gt.hasRenderableParent(Tr)||(Be.renderPass==="offscreen"?ih(Be,kr,kt,Tr):Be.renderPass==="translucent"&&Df(Be,kt,Tr))}cr.viewport.set([0,0,Be.width,Be.height])}else Be.renderPass==="offscreen"?(function(Tr,kr,Qr,yn){const Ze=Tr.context,et=Ze.gl,ft=vl.disabled,_t=new su([et.ONE,et.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(zt,Et,Ut){const mr=zt.gl;zt.activeTexture.set(mr.TEXTURE1),zt.viewport.set([0,0,Et.width/4,Et.height/4]);let wr=Ut.heatmapFbos.get(t.aU);wr?(mr.bindTexture(mr.TEXTURE_2D,wr.colorAttachment.get()),zt.bindFramebuffer.set(wr.framebuffer)):(wr=Rh(zt,Et.width/4,Et.height/4),Ut.heatmapFbos.set(t.aU,wr))})(Ze,Tr,Qr),Ze.clear({color:t.aM.transparent});for(let zt=0;zt20&&Tr.texParameterf(Tr.TEXTURE_2D,cr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,cr.extTextureFilterAnisotropicMax);const Ln=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(zt),Gn=Ln?zt:null,ba=Gn?Gn.posMatrix:Be.transform.calculatePosMatrix(zt.toUnwrapped(),_t),ti=ol(ba,an||[0,0],Gr||1,Lr,kt);kr instanceof it?Qr.draw(cr,Tr.TRIANGLES,Et,vl.disabled,yn,Do.disabled,ti,Ln,kt.id,kr.boundsBuffer,Be.quadTriangleIndexBuffer,kr.boundsSegments):Qr.draw(cr,Tr.TRIANGLES,Et,Ze[zt.overscaledZ],yn,Do.disabled,ti,Ln,kt.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments)}})(P,oe,Se,ke);break;case"background":(function(Be,gt,kt,Gt){const cr=kt.paint.get("background-color"),Tr=kt.paint.get("background-opacity");if(Tr===0)return;const kr=Be.context,Qr=kr.gl,yn=Be.transform,Ze=yn.tileSize,et=kt.paint.get("background-pattern");if(Be.isPatternMissing(et))return;const ft=!et&&cr.a===1&&Tr===1&&Be.opaquePassEnabledForLayer()?"opaque":"translucent";if(Be.renderPass!==ft)return;const _t=vl.disabled,zt=Be.depthModeForSublayer(0,ft==="opaque"?Os.ReadWrite:Os.ReadOnly),Et=Be.colorModeForRenderPass(),Ut=Be.useProgram(et?"backgroundPattern":"background"),mr=Gt||yn.coveringTiles({tileSize:Ze,terrain:Be.style.map.terrain});et&&(kr.activeTexture.set(Qr.TEXTURE0),Be.imageManager.bind(Be.context));const wr=kt.getCrossfadeParameters();for(const Lr of mr){const Gr=Gt?Lr.posMatrix:Be.transform.calculatePosMatrix(Lr.toUnwrapped()),an=et?El(Gr,Tr,Be,et,{tileID:Lr,tileSize:Ze},wr):sl(Gr,Tr,cr),Mn=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Lr);Ut.draw(kr,Qr.TRIANGLES,zt,_t,Et,Do.disabled,an,Mn,kt.id,Be.tileExtentBuffer,Be.quadTriangleIndexBuffer,Be.tileExtentSegments)}})(P,0,Se,ke);break;case"custom":(function(Be,gt,kt){const Gt=Be.context,cr=kt.implementation;if(Be.renderPass==="offscreen"){const Tr=cr.prerender;Tr&&(Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Tr.call(cr,Gt.gl,Be.transform.customLayerMatrix()),Gt.setDirty(),Be.setBaseState())}else if(Be.renderPass==="translucent"){Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Gt.setStencilMode(vl.disabled);const Tr=cr.renderingMode==="3d"?new Os(Be.context.gl.LEQUAL,Os.ReadWrite,Be.depthRangeFor3D):Be.depthModeForSublayer(0,Os.ReadOnly);Gt.setDepthMode(Tr),cr.render(Gt.gl,Be.transform.customLayerMatrix(),{farZ:Be.transform.farZ,nearZ:Be.transform.nearZ,fov:Be.transform._fov,modelViewProjectionMatrix:Be.transform.modelViewProjectionMatrix,projectionMatrix:Be.transform.projectionMatrix}),Gt.setDirty(),Be.setBaseState(),Gt.bindFramebuffer.set(null)}})(P,0,Se)}}translatePosMatrix(P,oe,Se,ke,Be){if(!Se[0]&&!Se[1])return P;const gt=Be?ke==="map"?this.transform.angle:0:ke==="viewport"?-this.transform.angle:0;if(gt){const cr=Math.sin(gt),Tr=Math.cos(gt);Se=[Se[0]*Tr-Se[1]*cr,Se[0]*cr+Se[1]*Tr]}const kt=[Be?Se[0]:Zn(oe,Se[0],this.transform.zoom),Be?Se[1]:Zn(oe,Se[1],this.transform.zoom),0],Gt=new Float32Array(16);return t.J(Gt,P,kt),Gt}saveTileTexture(P){const oe=this._tileTextures[P.size[0]];oe?oe.push(P):this._tileTextures[P.size[0]]=[P]}getTileTexture(P){const oe=this._tileTextures[P];return oe&&oe.length>0?oe.pop():null}isPatternMissing(P){if(!P)return!1;if(!P.from||!P.to)return!0;const oe=this.imageManager.getPattern(P.from.toString()),Se=this.imageManager.getPattern(P.to.toString());return!oe||!Se}useProgram(P,oe){this.cache=this.cache||{};const Se=P+(oe?oe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Se]||(this.cache[Se]=new Pn(this.context,Kr[P],oe,Ll[P],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Se]}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(){const P=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(P.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(){const{drawingBufferWidth:P,drawingBufferHeight:oe}=this.context.gl;return this.width!==P||this.height!==oe}}class Wl{constructor(P,oe){this.points=P,this.planes=oe}static fromInvProjectionMatrix(P,oe,Se){const ke=Math.pow(2,Se),Be=[[-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(kt=>{const Gt=1/(kt=t.af([],kt,P))[3]/oe*ke;return t.b1(kt,kt,[Gt,Gt,1/kt[3],Gt])}),gt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(kt=>{const Gt=(function(Qr,yn){var Ze=yn[0],et=yn[1],ft=yn[2],_t=Ze*Ze+et*et+ft*ft;return _t>0&&(_t=1/Math.sqrt(_t)),Qr[0]=yn[0]*_t,Qr[1]=yn[1]*_t,Qr[2]=yn[2]*_t,Qr})([],(function(Qr,yn,Ze){var et=yn[0],ft=yn[1],_t=yn[2],zt=Ze[0],Et=Ze[1],Ut=Ze[2];return Qr[0]=ft*Ut-_t*Et,Qr[1]=_t*zt-et*Ut,Qr[2]=et*Et-ft*zt,Qr})([],M([],Be[kt[0]],Be[kt[1]]),M([],Be[kt[2]],Be[kt[1]]))),cr=-((Tr=Gt)[0]*(kr=Be[kt[1]])[0]+Tr[1]*kr[1]+Tr[2]*kr[2]);var Tr,kr;return Gt.concat(cr)});return new Wl(Be,gt)}}class wf{constructor(P,oe){this.min=P,this.max=oe,this.center=(function(Se,ke,Be){return Se[0]=.5*ke[0],Se[1]=.5*ke[1],Se[2]=.5*ke[2],Se})([],(function(Se,ke,Be){return Se[0]=ke[0]+Be[0],Se[1]=ke[1]+Be[1],Se[2]=ke[2]+Be[2],Se})([],this.min,this.max))}quadrant(P){const oe=[P%2==0,P<2],Se=x(this.min),ke=x(this.max);for(let Be=0;Be=0&>++;if(gt===0)return 0;gt!==oe.length&&(Se=!1)}if(Se)return 2;for(let ke=0;ke<3;ke++){let Be=Number.MAX_VALUE,gt=-Number.MAX_VALUE;for(let kt=0;ktthis.max[ke]-this.min[ke])return 0}return 1}}class hc{constructor(P=0,oe=0,Se=0,ke=0){if(isNaN(P)||P<0||isNaN(oe)||oe<0||isNaN(Se)||Se<0||isNaN(ke)||ke<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=P,this.bottom=oe,this.left=Se,this.right=ke}interpolate(P,oe,Se){return oe.top!=null&&P.top!=null&&(this.top=t.y.number(P.top,oe.top,Se)),oe.bottom!=null&&P.bottom!=null&&(this.bottom=t.y.number(P.bottom,oe.bottom,Se)),oe.left!=null&&P.left!=null&&(this.left=t.y.number(P.left,oe.left,Se)),oe.right!=null&&P.right!=null&&(this.right=t.y.number(P.right,oe.right,Se)),this}getCenter(P,oe){const Se=t.ac((this.left+P-this.right)/2,0,P),ke=t.ac((this.top+oe-this.bottom)/2,0,oe);return new t.P(Se,ke)}equals(P){return this.top===P.top&&this.bottom===P.bottom&&this.left===P.left&&this.right===P.right}clone(){return new hc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Rc=85.051129;class lu{constructor(P,oe,Se,ke,Be){this.tileSize=512,this._renderWorldCopies=Be===void 0||!!Be,this._minZoom=P||0,this._maxZoom=oe||22,this._minPitch=Se??0,this._maxPitch=ke??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 hc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const P=new lu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return P.apply(this),P}apply(P){this.tileSize=P.tileSize,this.latRange=P.latRange,this.lngRange=P.lngRange,this.width=P.width,this.height=P.height,this._center=P._center,this._elevation=P._elevation,this.minElevationForCurrentTile=P.minElevationForCurrentTile,this.zoom=P.zoom,this.angle=P.angle,this._fov=P._fov,this._pitch=P._pitch,this._unmodified=P._unmodified,this._edgeInsets=P._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(P){this._minZoom!==P&&(this._minZoom=P,this.zoom=Math.max(this.zoom,P))}get maxZoom(){return this._maxZoom}set maxZoom(P){this._maxZoom!==P&&(this._maxZoom=P,this.zoom=Math.min(this.zoom,P))}get minPitch(){return this._minPitch}set minPitch(P){this._minPitch!==P&&(this._minPitch=P,this.pitch=Math.max(this.pitch,P))}get maxPitch(){return this._maxPitch}set maxPitch(P){this._maxPitch!==P&&(this._maxPitch=P,this.pitch=Math.min(this.pitch,P))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(P){P===void 0?P=!0:P===null&&(P=!1),this._renderWorldCopies=P}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(P){const oe=-t.b3(P,-180,180)*Math.PI/180;this.angle!==oe&&(this._unmodified=!1,this.angle=oe,this._calcMatrices(),this.rotationMatrix=(function(){var Se=new t.A(4);return t.A!=Float32Array&&(Se[1]=0,Se[2]=0),Se[0]=1,Se[3]=1,Se})(),(function(Se,ke,Be){var gt=ke[0],kt=ke[1],Gt=ke[2],cr=ke[3],Tr=Math.sin(Be),kr=Math.cos(Be);Se[0]=gt*kr+Gt*Tr,Se[1]=kt*kr+cr*Tr,Se[2]=gt*-Tr+Gt*kr,Se[3]=kt*-Tr+cr*kr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(P){const oe=t.ac(P,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==oe&&(this._unmodified=!1,this._pitch=oe,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(P){P=Math.max(.01,Math.min(60,P)),this._fov!==P&&(this._unmodified=!1,this._fov=P/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(P){const oe=Math.min(Math.max(P,this.minZoom),this.maxZoom);this._zoom!==oe&&(this._unmodified=!1,this._zoom=oe,this.tileZoom=Math.max(0,Math.floor(oe)),this.scale=this.zoomScale(oe),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(P){P.lat===this._center.lat&&P.lng===this._center.lng||(this._unmodified=!1,this._center=P,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(P){P!==this._elevation&&(this._elevation=P,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(P){this._edgeInsets.equals(P)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,P,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(P){return this._edgeInsets.equals(P)}interpolatePadding(P,oe,Se){this._unmodified=!1,this._edgeInsets.interpolate(P,oe,Se),this._constrain(),this._calcMatrices()}coveringZoomLevel(P){const oe=(P.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/P.tileSize));return Math.max(0,oe)}getVisibleUnwrappedCoordinates(P){const oe=[new t.b4(0,P)];if(this._renderWorldCopies){const Se=this.pointCoordinate(new t.P(0,0)),ke=this.pointCoordinate(new t.P(this.width,0)),Be=this.pointCoordinate(new t.P(this.width,this.height)),gt=this.pointCoordinate(new t.P(0,this.height)),kt=Math.floor(Math.min(Se.x,ke.x,Be.x,gt.x)),Gt=Math.floor(Math.max(Se.x,ke.x,Be.x,gt.x)),cr=1;for(let Tr=kt-cr;Tr<=Gt+cr;Tr++)Tr!==0&&oe.push(new t.b4(Tr,P))}return oe}coveringTiles(P){var oe,Se;let ke=this.coveringZoomLevel(P);const Be=ke;if(P.minzoom!==void 0&&keP.maxzoom&&(ke=P.maxzoom);const gt=this.pointCoordinate(this.getCameraPoint()),kt=t.Z.fromLngLat(this.center),Gt=Math.pow(2,ke),cr=[Gt*gt.x,Gt*gt.y,0],Tr=[Gt*kt.x,Gt*kt.y,0],kr=Wl.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,ke);let Qr=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Qr=ke);const yn=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ze=Et=>({aabb:new wf([Et*Gt,0,0],[(Et+1)*Gt,Gt,0]),zoom:0,x:0,y:0,wrap:Et,fullyVisible:!1}),et=[],ft=[],_t=ke,zt=P.reparseOverscaled?Be:ke;if(this._renderWorldCopies)for(let Et=1;Et<=3;Et++)et.push(Ze(-Et)),et.push(Ze(Et));for(et.push(Ze(0));et.length>0;){const Et=et.pop(),Ut=Et.x,mr=Et.y;let wr=Et.fullyVisible;if(!wr){const Ln=Et.aabb.intersects(kr);if(Ln===0)continue;wr=Ln===2}const Lr=P.terrain?cr:Tr,Gr=Et.aabb.distanceX(Lr),an=Et.aabb.distanceY(Lr),Mn=Math.max(Math.abs(Gr),Math.abs(an));if(Et.zoom===_t||Mn>yn+(1<<_t-Et.zoom)-2&&Et.zoom>=Qr){const Ln=_t-Et.zoom,Gn=cr[0]-.5-(Ut<>1),ti=Et.zoom+1;let Za=Et.aabb.quadrant(Ln);if(P.terrain){const ri=new t.S(ti,Et.wrap,ti,Gn,ba),Zi=P.terrain.getMinMaxElevation(ri),yo=(oe=Zi.minElevation)!==null&&oe!==void 0?oe:this.elevation,co=(Se=Zi.maxElevation)!==null&&Se!==void 0?Se:this.elevation;Za=new wf([Za.min[0],Za.min[1],yo],[Za.max[0],Za.max[1],co])}et.push({aabb:Za,zoom:ti,x:Gn,y:ba,wrap:Et.wrap,fullyVisible:wr})}}return ft.sort((Et,Ut)=>Et.distanceSq-Ut.distanceSq).map(Et=>Et.tileID)}resize(P,oe){this.width=P,this.height=oe,this.pixelsToGLUnits=[2/P,-2/oe],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(P){return Math.pow(2,P)}scaleZoom(P){return Math.log(P)/Math.LN2}project(P){const oe=t.ac(P.lat,-85.051129,Rc);return new t.P(t.O(P.lng)*this.worldSize,t.Q(oe)*this.worldSize)}unproject(P){return new t.Z(P.x/this.worldSize,P.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(P){const oe=this.elevation,Se=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,ke=this.pointLocation(this.centerPoint,P),Be=P.getElevationForLngLatZoom(ke,this.tileZoom);if(!(this.elevation-Be))return;const gt=Se+oe-Be,kt=Math.cos(this._pitch)*this.cameraToCenterDistance/gt/t.b5(1,ke.lat),Gt=this.scaleZoom(kt/this.tileSize);this._elevation=Be,this._center=ke,this.zoom=Gt}setLocationAtPoint(P,oe){const Se=this.pointCoordinate(oe),ke=this.pointCoordinate(this.centerPoint),Be=this.locationCoordinate(P),gt=new t.Z(Be.x-(Se.x-ke.x),Be.y-(Se.y-ke.y));this.center=this.coordinateLocation(gt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(P,oe){return oe?this.coordinatePoint(this.locationCoordinate(P),oe.getElevationForLngLatZoom(P,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(P))}pointLocation(P,oe){return this.coordinateLocation(this.pointCoordinate(P,oe))}locationCoordinate(P){return t.Z.fromLngLat(P)}coordinateLocation(P){return P&&P.toLngLat()}pointCoordinate(P,oe){if(oe){const Qr=oe.pointCoordinate(P);if(Qr!=null)return Qr}const Se=[P.x,P.y,0,1],ke=[P.x,P.y,1,1];t.af(Se,Se,this.pixelMatrixInverse),t.af(ke,ke,this.pixelMatrixInverse);const Be=Se[3],gt=ke[3],kt=Se[1]/Be,Gt=ke[1]/gt,cr=Se[2]/Be,Tr=ke[2]/gt,kr=cr===Tr?0:(0-cr)/(Tr-cr);return new t.Z(t.y.number(Se[0]/Be,ke[0]/gt,kr)/this.worldSize,t.y.number(kt,Gt,kr)/this.worldSize)}coordinatePoint(P,oe=0,Se=this.pixelMatrix){const ke=[P.x*this.worldSize,P.y*this.worldSize,oe,1];return t.af(ke,ke,Se),new t.P(ke[0]/ke[3],ke[1]/ke[3])}getBounds(){const P=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,P))).extend(this.pointLocation(new t.P(this.width,P))).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 ie([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(P){P?(this.lngRange=[P.getWest(),P.getEast()],this.latRange=[P.getSouth(),P.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Rc])}calculateTileMatrix(P){const oe=P.canonical,Se=this.worldSize/this.zoomScale(oe.z),ke=oe.x+Math.pow(2,oe.z)*P.wrap,Be=t.an(new Float64Array(16));return t.J(Be,Be,[ke*Se,oe.y*Se,0]),t.K(Be,Be,[Se/t.X,Se/t.X,1]),Be}calculatePosMatrix(P,oe=!1){const Se=P.key,ke=oe?this._alignedPosMatrixCache:this._posMatrixCache;if(ke[Se])return ke[Se];const Be=this.calculateTileMatrix(P);return t.L(Be,oe?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Be),ke[Se]=new Float32Array(Be),ke[Se]}calculateFogMatrix(P){const oe=P.key,Se=this._fogMatrixCache;if(Se[oe])return Se[oe];const ke=this.calculateTileMatrix(P);return t.L(ke,this.fogMatrix,ke),Se[oe]=new Float32Array(ke),Se[oe]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(P,oe){oe=t.ac(+oe,this.minZoom,this.maxZoom);const Se={center:new t.N(P.lng,P.lat),zoom:oe};let ke=this.lngRange;if(!this._renderWorldCopies&&ke===null){const Et=179.9999999999;ke=[-Et,Et]}const Be=this.tileSize*this.zoomScale(Se.zoom);let gt=0,kt=Be,Gt=0,cr=Be,Tr=0,kr=0;const{x:Qr,y:yn}=this.size;if(this.latRange){const Et=this.latRange;gt=t.Q(Et[1])*Be,kt=t.Q(Et[0])*Be,kt-gtkt&&(_t=kt-Et)}if(ke){const Et=(Gt+cr)/2;let Ut=Ze;this._renderWorldCopies&&(Ut=t.b3(Ze,Et-Be/2,Et+Be/2));const mr=Qr/2;Ut-mrcr&&(ft=cr-mr)}if(ft!==void 0||_t!==void 0){const Et=new t.P(ft??Ze,_t??et);Se.center=this.unproject.call({worldSize:Be},Et).wrap()}return Se}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const P=this._unmodified,{center:oe,zoom:Se}=this.getConstrained(this.center,this.zoom);this.center=oe,this.zoom=Se,this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;const P=this.centerOffset,oe=this.point.x,Se=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let ke=t.an(new Float64Array(16));t.K(ke,ke,[this.width/2,-this.height/2,1]),t.J(ke,ke,[1,-1,0]),this.labelPlaneMatrix=ke,ke=t.an(new Float64Array(16)),t.K(ke,ke,[1,-1,1]),t.J(ke,ke,[-1,-1,0]),t.K(ke,ke,[2/this.width,2/this.height,1]),this.glCoordMatrix=ke;const Be=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),gt=Math.min(this.elevation,this.minElevationForCurrentTile),kt=Be-gt*this._pixelPerMeter/Math.cos(this._pitch),Gt=gt<0?kt:Be,cr=Math.PI/2+this._pitch,Tr=this._fov*(.5+P.y/this.height),kr=Math.sin(Tr)*Gt/Math.sin(t.ac(Math.PI-cr-Tr,.01,Math.PI-.01)),Qr=this.getHorizon(),yn=2*Math.atan(Qr/this.cameraToCenterDistance)*(.5+P.y/(2*Qr)),Ze=Math.sin(yn)*Gt/Math.sin(t.ac(Math.PI-cr-yn,.01,Math.PI-.01)),et=Math.min(kr,Ze);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*et+Gt),this.nearZ=this.height/50,ke=new Float64Array(16),t.b6(ke,this._fov,this.width/this.height,this.nearZ,this.farZ),ke[8]=2*-P.x/this.width,ke[9]=2*P.y/this.height,this.projectionMatrix=t.ae(ke),t.K(ke,ke,[1,-1,1]),t.J(ke,ke,[0,0,-this.cameraToCenterDistance]),t.b7(ke,ke,this._pitch),t.ad(ke,ke,this.angle),t.J(ke,ke,[-oe,-Se,0]),this.mercatorMatrix=t.K([],ke,[this.worldSize,this.worldSize,this.worldSize]),t.K(ke,ke,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,ke),t.J(ke,ke,[0,0,-this.elevation]),this.modelViewProjectionMatrix=ke,this.invModelViewProjectionMatrix=t.as([],ke),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Be,this.farZ),this.fogMatrix[8]=2*-P.x/this.width,this.fogMatrix[9]=2*P.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,[-oe,-Se,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,ke);const ft=this.width%2/2,_t=this.height%2/2,zt=Math.cos(this.angle),Et=Math.sin(this.angle),Ut=oe-Math.round(oe)+zt*ft+Et*_t,mr=Se-Math.round(Se)+zt*_t+Et*ft,wr=new Float64Array(ke);if(t.J(wr,wr,[Ut>.5?Ut-1:Ut,mr>.5?mr-1:mr,0]),this.alignedModelViewProjectionMatrix=wr,ke=t.as(new Float64Array(16),this.pixelMatrix),!ke)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ke,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const P=this.pointCoordinate(new t.P(0,0)),oe=[P.x*this.worldSize,P.y*this.worldSize,0,1];return t.af(oe,oe,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const P=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,P))}getCameraQueryGeometry(P){const oe=this.getCameraPoint();if(P.length===1)return[P[0],oe];{let Se=oe.x,ke=oe.y,Be=oe.x,gt=oe.y;for(const kt of P)Se=Math.min(Se,kt.x),ke=Math.min(ke,kt.y),Be=Math.max(Be,kt.x),gt=Math.max(gt,kt.y);return[new t.P(Se,ke),new t.P(Be,ke),new t.P(Be,gt),new t.P(Se,gt),new t.P(Se,ke)]}}lngLatToCameraDepth(P,oe){const Se=this.locationCoordinate(P),ke=[Se.x*this.worldSize,Se.y*this.worldSize,oe,1];return t.af(ke,ke,this.modelViewProjectionMatrix),ke[2]/ke[3]}}function Kf(Ue,P){let oe,Se=!1,ke=null,Be=null;const gt=()=>{ke=null,Se&&(Ue.apply(Be,oe),ke=setTimeout(gt,P),Se=!1)};return(...kt)=>(Se=!0,Be=this,oe=kt,ke||gt(),ke)}class uf{constructor(P){this._getCurrentHash=()=>{const oe=window.location.hash.replace("#","");if(this._hashName){let Se;return oe.split("&").map(ke=>ke.split("=")).forEach(ke=>{ke[0]===this._hashName&&(Se=ke)}),(Se&&Se[1]||"").split("/")}return oe.split("/")},this._onHashChange=()=>{const oe=this._getCurrentHash();if(oe.length>=3&&!oe.some(Se=>isNaN(Se))){const Se=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(oe[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+oe[2],+oe[1]],zoom:+oe[0],bearing:Se,pitch:+(oe[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const oe=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,oe)},this._removeHash=()=>{const oe=this._getCurrentHash();if(oe.length===0)return;const Se=oe.join("/");let ke=Se;ke.split("&").length>0&&(ke=ke.split("&")[0]),this._hashName&&(ke=`${this._hashName}=${Se}`);let Be=window.location.hash.replace(ke,"");Be.startsWith("#&")?Be=Be.slice(0,1)+Be.slice(2):Be==="#"&&(Be="");let gt=window.location.href.replace(/(#.+)?$/,Be);gt=gt.replace("&&","&"),window.history.replaceState(window.history.state,null,gt)},this._updateHash=Kf(this._updateHashUnthrottled,300),this._hashName=P&&encodeURIComponent(P)}addTo(P){return this._map=P,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(P){const oe=this._map.getCenter(),Se=Math.round(100*this._map.getZoom())/100,ke=Math.ceil((Se*Math.LN2+Math.log(512/360/.5))/Math.LN10),Be=Math.pow(10,ke),gt=Math.round(oe.lng*Be)/Be,kt=Math.round(oe.lat*Be)/Be,Gt=this._map.getBearing(),cr=this._map.getPitch();let Tr="";if(Tr+=P?`/${gt}/${kt}/${Se}`:`${Se}/${kt}/${gt}`,(Gt||cr)&&(Tr+="/"+Math.round(10*Gt)/10),cr&&(Tr+=`/${Math.round(cr)}`),this._hashName){const kr=this._hashName;let Qr=!1;const yn=window.location.hash.slice(1).split("&").map(Ze=>{const et=Ze.split("=")[0];return et===kr?(Qr=!0,`${et}=${Tr}`):Ze}).filter(Ze=>Ze);return Qr||yn.push(`${kr}=${Tr}`),`#${yn.join("&")}`}return`#${Tr}`}}const Of={linearity:.3,easing:t.b8(0,0,.3,1)},_h=t.e({deceleration:2500,maxSpeed:1400},Of),wv=t.e({deceleration:20,maxSpeed:1400},Of),Yv=t.e({deceleration:1e3,maxSpeed:360},Of),$f=t.e({deceleration:1e3,maxSpeed:90},Of);class xh{constructor(P){this._map=P,this.clear()}clear(){this._inertiaBuffer=[]}record(P){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:P})}_drainInertiaBuffer(){const P=this._inertiaBuffer,oe=i.now();for(;P.length>0&&oe-P[0].time>160;)P.shift()}_onMoveEnd(P){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const oe={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Be}of this._inertiaBuffer)oe.zoom+=Be.zoomDelta||0,oe.bearing+=Be.bearingDelta||0,oe.pitch+=Be.pitchDelta||0,Be.panDelta&&oe.pan._add(Be.panDelta),Be.around&&(oe.around=Be.around),Be.pinchAround&&(oe.pinchAround=Be.pinchAround);const Se=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,ke={};if(oe.pan.mag()){const Be=bh(oe.pan.mag(),Se,t.e({},_h,P||{}));ke.offset=oe.pan.mult(Be.amount/oe.pan.mag()),ke.center=this._map.transform.center,qc(ke,Be)}if(oe.zoom){const Be=bh(oe.zoom,Se,wv);ke.zoom=this._map.transform.zoom+Be.amount,qc(ke,Be)}if(oe.bearing){const Be=bh(oe.bearing,Se,Yv);ke.bearing=this._map.transform.bearing+t.ac(Be.amount,-179,179),qc(ke,Be)}if(oe.pitch){const Be=bh(oe.pitch,Se,$f);ke.pitch=this._map.transform.pitch+Be.amount,qc(ke,Be)}if(ke.zoom||ke.bearing){const Be=oe.pinchAround===void 0?oe.around:oe.pinchAround;ke.around=Be?this._map.unproject(Be):this._map.getCenter()}return this.clear(),t.e(ke,{noMoveStart:!0})}}function qc(Ue,P){(!Ue.duration||Ue.durationoe.unproject(Gt)),kt=Be.reduce((Gt,cr,Tr,kr)=>Gt.add(cr.div(kr.length)),new t.P(0,0));super(P,{points:Be,point:kt,lngLats:gt,lngLat:oe.unproject(kt),originalEvent:Se}),this._defaultPrevented=!1}}class Hh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,oe,Se){super(P,{originalEvent:Se}),this._defaultPrevented=!1}}class Qf{constructor(P,oe){this._map=P,this._clickTolerance=oe.clickTolerance}reset(){delete this._mousedownPos}wheel(P){return this._firePreventable(new Hh(P.type,this._map,P))}mousedown(P,oe){return this._mousedownPos=oe,this._firePreventable(new nc(P.type,this._map,P))}mouseup(P){this._map.fire(new nc(P.type,this._map,P))}click(P,oe){this._mousedownPos&&this._mousedownPos.dist(oe)>=this._clickTolerance||this._map.fire(new nc(P.type,this._map,P))}dblclick(P){return this._firePreventable(new nc(P.type,this._map,P))}mouseover(P){this._map.fire(new nc(P.type,this._map,P))}mouseout(P){this._map.fire(new nc(P.type,this._map,P))}touchstart(P){return this._firePreventable(new Jf(P.type,this._map,P))}touchmove(P){this._map.fire(new Jf(P.type,this._map,P))}touchend(P){this._map.fire(new Jf(P.type,this._map,P))}touchcancel(P){this._map.fire(new Jf(P.type,this._map,P))}_firePreventable(P){if(this._map.fire(P),P.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ql{constructor(P){this._map=P}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(P){this._map.fire(new nc(P.type,this._map,P))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new nc("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(P){this._delayContextMenu?this._contextMenuEvent=P:this._ignoreContextMenu||this._map.fire(new nc(P.type,this._map,P)),this._map.listens("contextmenu")&&P.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(P){this._map=P}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(P){return this.transform.pointLocation(t.P.convert(P),this._map.terrain)}}class tf{constructor(P,oe){this._map=P,this._tr=new Ic(P),this._el=P.getCanvasContainer(),this._container=P.getContainer(),this._clickTolerance=oe.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(P,oe){this.isEnabled()&&P.shiftKey&&P.button===0&&(a.disableDrag(),this._startPos=this._lastPos=oe,this._active=!0)}mousemoveWindow(P,oe){if(!this._active)return;const Se=oe;if(this._lastPos.equals(Se)||!this._box&&Se.dist(this._startPos)Be.fitScreenCoordinates(Se,ke,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",P)}keydown(P){this._active&&P.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",P))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(P,oe){return this._map.fire(new t.k(P,{originalEvent:oe}))}}function zh(Ue,P){if(Ue.length!==P.length)throw new Error(`The number of touches and points are not equal - touches ${Ue.length}, points ${P.length}`);const oe={};for(let Se=0;Sethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=P.timeStamp),Se.length===this.numTouches&&(this.centroid=(function(ke){const Be=new t.P(0,0);for(const gt of ke)Be._add(gt);return Be.div(ke.length)})(oe),this.touches=zh(Se,oe)))}touchmove(P,oe,Se){if(this.aborted||!this.centroid)return;const ke=zh(Se,oe);for(const Be in this.touches){const gt=ke[Be];(!gt||gt.dist(this.touches[Be])>30)&&(this.aborted=!0)}}touchend(P,oe,Se){if((!this.centroid||P.timeStamp-this.startTime>500)&&(this.aborted=!0),Se.length===0){const ke=!this.aborted&&this.centroid;if(this.reset(),ke)return ke}}}class sh{constructor(P){this.singleTap=new au(P),this.numTaps=P.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(P,oe,Se){this.singleTap.touchstart(P,oe,Se)}touchmove(P,oe,Se){this.singleTap.touchmove(P,oe,Se)}touchend(P,oe,Se){const ke=this.singleTap.touchend(P,oe,Se);if(ke){const Be=P.timeStamp-this.lastTime<500,gt=!this.lastTap||this.lastTap.dist(ke)<30;if(Be&>||this.reset(),this.count++,this.lastTime=P.timeStamp,this.lastTap=ke,this.count===this.numTaps)return this.reset(),ke}}}class Ff{constructor(P){this._tr=new Ic(P),this._zoomIn=new sh({numTouches:1,numTaps:2}),this._zoomOut=new sh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(P,oe,Se){this._zoomIn.touchstart(P,oe,Se),this._zoomOut.touchstart(P,oe,Se)}touchmove(P,oe,Se){this._zoomIn.touchmove(P,oe,Se),this._zoomOut.touchmove(P,oe,Se)}touchend(P,oe,Se){const ke=this._zoomIn.touchend(P,oe,Se),Be=this._zoomOut.touchend(P,oe,Se),gt=this._tr;return ke?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:gt.zoom+1,around:gt.unproject(ke)},{originalEvent:P})}):Be?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:gt.zoom-1,around:gt.unproject(Be)},{originalEvent:P})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Vc{constructor(P){this._enabled=!!P.enable,this._moveStateManager=P.moveStateManager,this._clickTolerance=P.clickTolerance||1,this._moveFunction=P.move,this._activateOnStart=!!P.activateOnStart,P.assignEvents(this),this.reset()}reset(P){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(P)}_move(...P){const oe=this._moveFunction(...P);if(oe.bearingDelta||oe.pitchDelta||oe.around||oe.panDelta)return this._active=!0,oe}dragStart(P,oe){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(P)&&(this._moveStateManager.startMove(P),this._lastPoint=oe.length?oe[0]:oe,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(P,oe){if(!this.isEnabled())return;const Se=this._lastPoint;if(!Se)return;if(P.preventDefault(),!this._moveStateManager.isValidMoveEvent(P))return void this.reset(P);const ke=oe.length?oe[0]:oe;return!this._moved&&ke.dist(Se){Ue.mousedown=Ue.dragStart,Ue.mousemoveWindow=Ue.dragMove,Ue.mouseup=Ue.dragEnd,Ue.contextmenu=P=>{P.preventDefault()}},oc=({enable:Ue,clickTolerance:P,bearingDegreesPerPixelMoved:oe=.8})=>{const Se=new cf({checkCorrectEvent:ke=>a.mouseButton(ke)===0&&ke.ctrlKey||a.mouseButton(ke)===2});return new Vc({clickTolerance:P,move:(ke,Be)=>({bearingDelta:(Be.x-ke.x)*oe}),moveStateManager:Se,enable:Ue,assignEvents:Tv})},Gh=({enable:Ue,clickTolerance:P,pitchDegreesPerPixelMoved:oe=-.5})=>{const Se=new cf({checkCorrectEvent:ke=>a.mouseButton(ke)===0&&ke.ctrlKey||a.mouseButton(ke)===2});return new Vc({clickTolerance:P,move:(ke,Be)=>({pitchDelta:(Be.y-ke.y)*oe}),moveStateManager:Se,enable:Ue,assignEvents:Tv})};class Hc{constructor(P,oe){this._clickTolerance=P.clickTolerance||1,this._map=oe,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(P){return P<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(P,oe,Se){return this._calculateTransform(P,oe,Se)}touchmove(P,oe,Se){if(this._active){if(!this._shouldBePrevented(Se.length))return P.preventDefault(),this._calculateTransform(P,oe,Se);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",P)}}touchend(P,oe,Se){this._calculateTransform(P,oe,Se),this._active&&this._shouldBePrevented(Se.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(P,oe,Se){Se.length>0&&(this._active=!0);const ke=zh(Se,oe),Be=new t.P(0,0),gt=new t.P(0,0);let kt=0;for(const cr in ke){const Tr=ke[cr],kr=this._touches[cr];kr&&(Be._add(Tr),gt._add(Tr.sub(kr)),kt++,ke[cr]=Tr)}if(this._touches=ke,this._shouldBePrevented(kt)||!gt.mag())return;const Gt=gt.div(kt);return this._sum._add(Gt),this._sum.mag()Math.abs(Ue.x)}class Oh extends Tf{constructor(P){super(),this._currentTouchCount=0,this._map=P}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(P,oe,Se){super.touchstart(P,oe,Se),this._currentTouchCount=Se.length}_start(P){this._lastPoints=P,hf(P[0].sub(P[1]))&&(this._valid=!1)}_move(P,oe,Se){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const ke=P[0].sub(this._lastPoints[0]),Be=P[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(ke,Be,Se.timeStamp),this._valid?(this._lastPoints=P,this._active=!0,{pitchDelta:(ke.y+Be.y)/2*-.5}):void 0}gestureBeginsVertically(P,oe,Se){if(this._valid!==void 0)return this._valid;const ke=P.mag()>=2,Be=oe.mag()>=2;if(!ke&&!Be)return;if(!ke||!Be)return this._firstMove===void 0&&(this._firstMove=Se),Se-this._firstMove<100&&void 0;const gt=P.y>0==oe.y>0;return hf(P)&&hf(oe)&>}}const ur={panStep:100,bearingStep:15,pitchStep:10};class Pr{constructor(P){this._tr=new Ic(P);const oe=ur;this._panStep=oe.panStep,this._bearingStep=oe.bearingStep,this._pitchStep=oe.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(P){if(P.altKey||P.ctrlKey||P.metaKey)return;let oe=0,Se=0,ke=0,Be=0,gt=0;switch(P.keyCode){case 61:case 107:case 171:case 187:oe=1;break;case 189:case 109:case 173:oe=-1;break;case 37:P.shiftKey?Se=-1:(P.preventDefault(),Be=-1);break;case 39:P.shiftKey?Se=1:(P.preventDefault(),Be=1);break;case 38:P.shiftKey?ke=1:(P.preventDefault(),gt=-1);break;case 40:P.shiftKey?ke=-1:(P.preventDefault(),gt=1);break;default:return}return this._rotationDisabled&&(Se=0,ke=0),{cameraAnimation:kt=>{const Gt=this._tr;kt.easeTo({duration:300,easeId:"keyboardHandler",easing:vn,zoom:oe?Math.round(Gt.zoom)+oe*(P.shiftKey?2:1):Gt.zoom,bearing:Gt.bearing+Se*this._bearingStep,pitch:Gt.pitch+ke*this._pitchStep,offset:[-Be*this._panStep,-gt*this._panStep],center:Gt.center},{originalEvent:P})}}}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 vn(Ue){return Ue*(2-Ue)}const rn=4.000244140625;class On{constructor(P,oe){this._onTimeout=Se=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Se)},this._map=P,this._tr=new Ic(P),this._triggerRenderFrame=oe,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(P){this._defaultZoomRate=P}setWheelZoomRate(P){this._wheelZoomRate=P}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(P){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!P&&P.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(P){return!!this._map.cooperativeGestures.isEnabled()&&!(P.ctrlKey||this._map.cooperativeGestures.isBypassed(P))}wheel(P){if(!this.isEnabled())return;if(this._shouldBePrevented(P))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",P);let oe=P.deltaMode===WheelEvent.DOM_DELTA_LINE?40*P.deltaY:P.deltaY;const Se=i.now(),ke=Se-(this._lastWheelEventTime||0);this._lastWheelEventTime=Se,oe!==0&&oe%rn==0?this._type="wheel":oe!==0&&Math.abs(oe)<4?this._type="trackpad":ke>400?(this._type=null,this._lastValue=oe,this._timeout=setTimeout(this._onTimeout,40,P)):this._type||(this._type=Math.abs(ke*oe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,oe+=this._lastValue)),P.shiftKey&&oe&&(oe/=4),this._type&&(this._lastWheelEvent=P,this._delta-=oe,this._active||this._start(P)),P.preventDefault()}_start(P){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);const oe=a.mousePos(this._map.getCanvas(),P),Se=this._tr;this._around=oe.y>Se.transform.height/2-Se.transform.getHorizon()?t.N.convert(this._aroundCenter?Se.center:Se.unproject(oe)):t.N.convert(Se.center),this._aroundPoint=Se.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const P=this._tr.transform;if(this._delta!==0){const Gt=this._type==="wheel"&&Math.abs(this._delta)>rn?this._wheelZoomRate:this._defaultZoomRate;let cr=2/(1+Math.exp(-Math.abs(this._delta*Gt)));this._delta<0&&cr!==0&&(cr=1/cr);const Tr=typeof this._targetZoom=="number"?P.zoomScale(this._targetZoom):P.scale;this._targetZoom=Math.min(P.maxZoom,Math.max(P.minZoom,P.scaleZoom(Tr*cr))),this._type==="wheel"&&(this._startZoom=P.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const oe=typeof this._targetZoom=="number"?this._targetZoom:P.zoom,Se=this._startZoom,ke=this._easing;let Be,gt=!1;const kt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Se&&ke&&kt){const Gt=Math.min(kt/200,1),cr=ke(Gt);Be=t.y.number(Se,oe,cr),Gt<1?this._frameId||(this._frameId=!0):gt=!0}else Be=oe,gt=!0;return this._active=!0,gt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!gt,zoomDelta:Be-P.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(P){let oe=t.b9;if(this._prevEase){const Se=this._prevEase,ke=(i.now()-Se.start)/Se.duration,Be=Se.easing(ke+.01)-Se.easing(ke),gt=.27/Math.sqrt(Be*Be+1e-4)*.01,kt=Math.sqrt(.0729-gt*gt);oe=t.b8(gt,kt,.25,1)}return this._prevEase={start:i.now(),duration:P,easing:oe},oe}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ta{constructor(P,oe){this._clickZoom=P,this._tapZoom=oe}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 ya{constructor(P){this._tr=new Ic(P),this.reset()}reset(){this._active=!1}dblclick(P,oe){return P.preventDefault(),{cameraAnimation:Se=>{Se.easeTo({duration:300,zoom:this._tr.zoom+(P.shiftKey?-1:1),around:this._tr.unproject(oe)},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ei{constructor(){this._tap=new sh({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(P,oe,Se){if(!this._swipePoint)if(this._tapTime){const ke=oe[0],Be=P.timeStamp-this._tapTime<500,gt=this._tapPoint.dist(ke)<30;Be&>?Se.length>0&&(this._swipePoint=ke,this._swipeTouch=Se[0].identifier):this.reset()}else this._tap.touchstart(P,oe,Se)}touchmove(P,oe,Se){if(this._tapTime){if(this._swipePoint){if(Se[0].identifier!==this._swipeTouch)return;const ke=oe[0],Be=ke.y-this._swipePoint.y;return this._swipePoint=ke,P.preventDefault(),this._active=!0,{zoomDelta:Be/128}}}else this._tap.touchmove(P,oe,Se)}touchend(P,oe,Se){if(this._tapTime)this._swipePoint&&Se.length===0&&this.reset();else{const ke=this._tap.touchend(P,oe,Se);ke&&(this._tapTime=P.timeStamp,this._tapPoint=ke)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class si{constructor(P,oe,Se){this._el=P,this._mousePan=oe,this._touchPan=Se}enable(P){this._inertiaOptions=P||{},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 Bi{constructor(P,oe,Se){this._pitchWithRotate=P.pitchWithRotate,this._mouseRotate=oe,this._mousePitch=Se}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 Va{constructor(P,oe,Se,ke){this._el=P,this._touchZoom=oe,this._touchRotate=Se,this._tapDragZoom=ke,this._rotationDisabled=!1,this._enabled=!0}enable(P){this._touchZoom.enable(P),this._rotationDisabled||this._touchRotate.enable(P),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 _i{constructor(P,oe){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=P,this._options=oe,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const P=this._map.getCanvasContainer();P.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",P);let oe=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(oe=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Se=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),ke=document.createElement("div");ke.className="maplibregl-desktop-message",ke.textContent=oe,this._container.appendChild(ke);const Be=document.createElement("div");Be.className="maplibregl-mobile-message",Be.textContent=Se,this._container.appendChild(Be),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.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(P){return P[this._bypassKey]}notifyGestureBlocked(P,oe){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:P,originalEvent:oe})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Ja=Ue=>Ue.zoom||Ue.drag||Ue.pitch||Ue.rotate;class Ba extends t.k{}function Gi(Ue){return Ue.panDelta&&Ue.panDelta.mag()||Ue.zoomDelta||Ue.bearingDelta||Ue.pitchDelta}class No{constructor(P,oe){this.handleWindowEvent=ke=>{this.handleEvent(ke,`${ke.type}Window`)},this.handleEvent=(ke,Be)=>{if(ke.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const gt=ke.type==="renderFrame"?void 0:ke,kt={needsRenderFrame:!1},Gt={},cr={},Tr=ke.touches,kr=Tr?this._getMapTouches(Tr):void 0,Qr=kr?a.touchPos(this._map.getCanvas(),kr):a.mousePos(this._map.getCanvas(),ke);for(const{handlerName:et,handler:ft,allowed:_t}of this._handlers){if(!ft.isEnabled())continue;let zt;this._blockedByActive(cr,_t,et)?ft.reset():ft[Be||ke.type]&&(zt=ft[Be||ke.type](ke,Qr,kr),this.mergeHandlerResult(kt,Gt,zt,et,gt),zt&&zt.needsRenderFrame&&this._triggerRenderFrame()),(zt||ft.isActive())&&(cr[et]=ft)}const yn={};for(const et in this._previousActiveHandlers)cr[et]||(yn[et]=gt);this._previousActiveHandlers=cr,(Object.keys(yn).length||Gi(kt))&&(this._changes.push([kt,Gt,yn]),this._triggerRenderFrame()),(Object.keys(cr).length||Gi(kt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:Ze}=kt;Ze&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Ze(this._map))},this._map=P,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new xh(P),this._bearingSnap=oe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(oe);const Se=this._el;this._listeners=[[Se,"touchstart",{passive:!0}],[Se,"touchmove",{passive:!1}],[Se,"touchend",void 0],[Se,"touchcancel",void 0],[Se,"mousedown",void 0],[Se,"mousemove",void 0],[Se,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Se,"mouseover",void 0],[Se,"mouseout",void 0],[Se,"dblclick",void 0],[Se,"click",void 0],[Se,"keydown",{capture:!1}],[Se,"keyup",void 0],[Se,"wheel",{passive:!1}],[Se,"contextmenu",void 0],[window,"blur",void 0]];for(const[ke,Be,gt]of this._listeners)a.addEventListener(ke,Be,ke===document?this.handleWindowEvent:this.handleEvent,gt)}destroy(){for(const[P,oe,Se]of this._listeners)a.removeEventListener(P,oe,P===document?this.handleWindowEvent:this.handleEvent,Se)}_addDefaultHandlers(P){const oe=this._map,Se=oe.getCanvasContainer();this._add("mapEvent",new Qf(oe,P));const ke=oe.boxZoom=new tf(oe,P);this._add("boxZoom",ke),P.interactive&&P.boxZoom&&ke.enable();const Be=oe.cooperativeGestures=new _i(oe,P.cooperativeGestures);this._add("cooperativeGestures",Be),P.cooperativeGestures&&Be.enable();const gt=new Ff(oe),kt=new ya(oe);oe.doubleClickZoom=new Ta(kt,gt),this._add("tapZoom",gt),this._add("clickZoom",kt),P.interactive&&P.doubleClickZoom&&oe.doubleClickZoom.enable();const Gt=new ei;this._add("tapDragZoom",Gt);const cr=oe.touchPitch=new Oh(oe);this._add("touchPitch",cr),P.interactive&&P.touchPitch&&oe.touchPitch.enable(P.touchPitch);const Tr=oc(P),kr=Gh(P);oe.dragRotate=new Bi(P,Tr,kr),this._add("mouseRotate",Tr,["mousePitch"]),this._add("mousePitch",kr,["mouseRotate"]),P.interactive&&P.dragRotate&&oe.dragRotate.enable();const Qr=(({enable:zt,clickTolerance:Et})=>{const Ut=new cf({checkCorrectEvent:mr=>a.mouseButton(mr)===0&&!mr.ctrlKey});return new Vc({clickTolerance:Et,move:(mr,wr)=>({around:wr,panDelta:wr.sub(mr)}),activateOnStart:!0,moveStateManager:Ut,enable:zt,assignEvents:Tv})})(P),yn=new Hc(P,oe);oe.dragPan=new si(Se,Qr,yn),this._add("mousePan",Qr),this._add("touchPan",yn,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&oe.dragPan.enable(P.dragPan);const Ze=new Bf,et=new yc;oe.touchZoomRotate=new Va(Se,et,Ze,Gt),this._add("touchRotate",Ze,["touchPan","touchZoom"]),this._add("touchZoom",et,["touchPan","touchRotate"]),P.interactive&&P.touchZoomRotate&&oe.touchZoomRotate.enable(P.touchZoomRotate);const ft=oe.scrollZoom=new On(oe,()=>this._triggerRenderFrame());this._add("scrollZoom",ft,["mousePan"]),P.interactive&&P.scrollZoom&&oe.scrollZoom.enable(P.scrollZoom);const _t=oe.keyboard=new Pr(oe);this._add("keyboard",_t),P.interactive&&P.keyboard&&oe.keyboard.enable(),this._add("blockableMapEvent",new Ql(oe))}_add(P,oe,Se){this._handlers.push({handlerName:P,handler:oe,allowed:Se}),this._handlersById[P]=oe}stop(P){if(!this._updatingCamera){for(const{handler:oe}of this._handlers)oe.reset();this._inertia.clear(),this._fireEvents({},{},P),this._changes=[]}}isActive(){for(const{handler:P}of this._handlers)if(P.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ja(this._eventsInProgress)||this.isZooming()}_blockedByActive(P,oe,Se){for(const ke in P)if(ke!==Se&&(!oe||oe.indexOf(ke)<0))return!0;return!1}_getMapTouches(P){const oe=[];for(const Se of P)this._el.contains(Se.target)&&oe.push(Se);return oe}mergeHandlerResult(P,oe,Se,ke,Be){if(!Se)return;t.e(P,Se);const gt={handlerName:ke,originalEvent:Se.originalEvent||Be};Se.zoomDelta!==void 0&&(oe.zoom=gt),Se.panDelta!==void 0&&(oe.drag=gt),Se.pitchDelta!==void 0&&(oe.pitch=gt),Se.bearingDelta!==void 0&&(oe.rotate=gt)}_applyChanges(){const P={},oe={},Se={};for(const[ke,Be,gt]of this._changes)ke.panDelta&&(P.panDelta=(P.panDelta||new t.P(0,0))._add(ke.panDelta)),ke.zoomDelta&&(P.zoomDelta=(P.zoomDelta||0)+ke.zoomDelta),ke.bearingDelta&&(P.bearingDelta=(P.bearingDelta||0)+ke.bearingDelta),ke.pitchDelta&&(P.pitchDelta=(P.pitchDelta||0)+ke.pitchDelta),ke.around!==void 0&&(P.around=ke.around),ke.pinchAround!==void 0&&(P.pinchAround=ke.pinchAround),ke.noInertia&&(P.noInertia=ke.noInertia),t.e(oe,Be),t.e(Se,gt);this._updateMapTransform(P,oe,Se),this._changes=[]}_updateMapTransform(P,oe,Se){const ke=this._map,Be=ke._getTransformForUpdate(),gt=ke.terrain;if(!(Gi(P)||gt&&this._terrainMovement))return this._fireEvents(oe,Se,!0);let{panDelta:kt,zoomDelta:Gt,bearingDelta:cr,pitchDelta:Tr,around:kr,pinchAround:Qr}=P;Qr!==void 0&&(kr=Qr),ke._stop(!0),kr=kr||ke.transform.centerPoint;const yn=Be.pointLocation(kt?kr.sub(kt):kr);cr&&(Be.bearing+=cr),Tr&&(Be.pitch+=Tr),Gt&&(Be.zoom+=Gt),gt?this._terrainMovement||!oe.drag&&!oe.zoom?oe.drag&&this._terrainMovement?Be.center=Be.pointLocation(Be.centerPoint.sub(kt)):Be.setLocationAtPoint(yn,kr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Be.setLocationAtPoint(yn,kr)):Be.setLocationAtPoint(yn,kr),ke._applyUpdatedTransform(Be),this._map._update(),P.noInertia||this._inertia.record(P),this._fireEvents(oe,Se,!0)}_fireEvents(P,oe,Se){const ke=Ja(this._eventsInProgress),Be=Ja(P),gt={};for(const kr in P){const{originalEvent:Qr}=P[kr];this._eventsInProgress[kr]||(gt[`${kr}start`]=Qr),this._eventsInProgress[kr]=P[kr]}!ke&&Be&&this._fireEvent("movestart",Be.originalEvent);for(const kr in gt)this._fireEvent(kr,gt[kr]);Be&&this._fireEvent("move",Be.originalEvent);for(const kr in P){const{originalEvent:Qr}=P[kr];this._fireEvent(kr,Qr)}const kt={};let Gt;for(const kr in this._eventsInProgress){const{handlerName:Qr,originalEvent:yn}=this._eventsInProgress[kr];this._handlersById[Qr].isActive()||(delete this._eventsInProgress[kr],Gt=oe[Qr]||yn,kt[`${kr}end`]=Gt)}for(const kr in kt)this._fireEvent(kr,kt[kr]);const cr=Ja(this._eventsInProgress),Tr=(ke||Be)&&!cr;if(Tr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const kr=this._map._getTransformForUpdate();kr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(kr)}if(Se&&Tr){this._updatingCamera=!0;const kr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Qr=yn=>yn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Ba("renderFrame",{timeStamp:P})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Ro extends t.E{constructor(P,oe){super(),this._renderFrameCallback=()=>{const Se=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Se)),Se<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=P,this._bearingSnap=oe.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(P,oe){return this.jumpTo({center:P},oe)}panBy(P,oe,Se){return P=t.P.convert(P).mult(-1),this.panTo(this.transform.center,t.e({offset:P},oe),Se)}panTo(P,oe,Se){return this.easeTo(t.e({center:P},oe),Se)}getZoom(){return this.transform.zoom}setZoom(P,oe){return this.jumpTo({zoom:P},oe),this}zoomTo(P,oe,Se){return this.easeTo(t.e({zoom:P},oe),Se)}zoomIn(P,oe){return this.zoomTo(this.getZoom()+1,P,oe),this}zoomOut(P,oe){return this.zoomTo(this.getZoom()-1,P,oe),this}getBearing(){return this.transform.bearing}setBearing(P,oe){return this.jumpTo({bearing:P},oe),this}getPadding(){return this.transform.padding}setPadding(P,oe){return this.jumpTo({padding:P},oe),this}rotateTo(P,oe,Se){return this.easeTo(t.e({bearing:P},oe),Se)}resetNorth(P,oe){return this.rotateTo(0,t.e({duration:1e3},P),oe),this}resetNorthPitch(P,oe){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},P),oe),this}snapToNorth(P,oe){return Math.abs(this.getBearing()){if(this._zooming&&(ke.zoom=t.y.number(Be,ft,Lr)),this._rotating&&(ke.bearing=t.y.number(gt,cr,Lr)),this._pitching&&(ke.pitch=t.y.number(kt,Tr,Lr)),this._padding&&(ke.interpolatePadding(Gt,kr,Lr),yn=ke.centerPoint.add(Qr)),this.terrain&&!P.freezeElevation&&this._updateElevation(Lr),Ut)ke.setLocationAtPoint(Ut,mr);else{const Gr=ke.zoomScale(ke.zoom-Be),an=ft>Be?Math.min(2,Et):Math.max(.5,Et),Mn=Math.pow(an,1-Lr),Ln=ke.unproject(_t.add(zt.mult(Lr*Mn)).mult(Gr));ke.setLocationAtPoint(ke.renderWorldCopies?Ln.wrap():Ln,yn)}this._applyUpdatedTransform(ke),this._fireMoveEvents(oe)},Lr=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe,Lr)},P),this}_prepareEase(P,oe,Se={}){this._moving=!0,oe||Se.moving||this.fire(new t.k("movestart",P)),this._zooming&&!Se.zooming&&this.fire(new t.k("zoomstart",P)),this._rotating&&!Se.rotating&&this.fire(new t.k("rotatestart",P)),this._pitching&&!Se.pitching&&this.fire(new t.k("pitchstart",P))}_prepareElevation(P){this._elevationCenter=P,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(P,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(P){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const oe=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(P<1&&oe!==this._elevationTarget){const Se=this._elevationTarget-this._elevationStart;this._elevationStart+=P*(Se-(oe-(Se*P+this._elevationStart))/(1-P)),this._elevationTarget=oe}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,P)}_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(P){const oe=P.getCameraPosition(),Se=this.terrain.getElevationForLngLatZoom(oe.lngLat,P.zoom);if(oe.altitudethis._elevateCameraIfInsideTerrain(ke)),this.transformCameraUpdate&&oe.push(ke=>this.transformCameraUpdate(ke)),!oe.length)return;const Se=P.clone();for(const ke of oe){const Be=Se.clone(),{center:gt,zoom:kt,pitch:Gt,bearing:cr,elevation:Tr}=ke(Be);gt&&(Be.center=gt),kt!==void 0&&(Be.zoom=kt),Gt!==void 0&&(Be.pitch=Gt),cr!==void 0&&(Be.bearing=cr),Tr!==void 0&&(Be.elevation=Tr),Se.apply(Be)}this.transform.apply(Se)}_fireMoveEvents(P){this.fire(new t.k("move",P)),this._zooming&&this.fire(new t.k("zoom",P)),this._rotating&&this.fire(new t.k("rotate",P)),this._pitching&&this.fire(new t.k("pitch",P))}_afterEase(P,oe){if(this._easeId&&oe&&this._easeId===oe)return;delete this._easeId;const Se=this._zooming,ke=this._rotating,Be=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Se&&this.fire(new t.k("zoomend",P)),ke&&this.fire(new t.k("rotateend",P)),Be&&this.fire(new t.k("pitchend",P)),this.fire(new t.k("moveend",P))}flyTo(P,oe){var Se;if(!P.essential&&i.prefersReducedMotion){const ri=t.M(P,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ri,oe)}this.stop(),P=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},P);const ke=this._getTransformForUpdate(),Be=ke.zoom,gt=ke.bearing,kt=ke.pitch,Gt=ke.padding,cr="bearing"in P?this._normalizeBearing(P.bearing,gt):gt,Tr="pitch"in P?+P.pitch:kt,kr="padding"in P?P.padding:ke.padding,Qr=t.P.convert(P.offset);let yn=ke.centerPoint.add(Qr);const Ze=ke.pointLocation(yn),{center:et,zoom:ft}=ke.getConstrained(t.N.convert(P.center||Ze),(Se=P.zoom)!==null&&Se!==void 0?Se:Be);this._normalizeCenter(et,ke);const _t=ke.zoomScale(ft-Be),zt=ke.project(Ze),Et=ke.project(et).sub(zt);let Ut=P.curve;const mr=Math.max(ke.width,ke.height),wr=mr/_t,Lr=Et.mag();if("minZoom"in P){const ri=t.ac(Math.min(P.minZoom,Be,ft),ke.minZoom,ke.maxZoom),Zi=mr/ke.zoomScale(ri-Be);Ut=Math.sqrt(Zi/Lr*2)}const Gr=Ut*Ut;function an(ri){const Zi=(wr*wr-mr*mr+(ri?-1:1)*Gr*Gr*Lr*Lr)/(2*(ri?wr:mr)*Gr*Lr);return Math.log(Math.sqrt(Zi*Zi+1)-Zi)}function Mn(ri){return(Math.exp(ri)-Math.exp(-ri))/2}function Ln(ri){return(Math.exp(ri)+Math.exp(-ri))/2}const Gn=an(!1);let ba=function(ri){return Ln(Gn)/Ln(Gn+Ut*ri)},ti=function(ri){return mr*((Ln(Gn)*(Mn(Zi=Gn+Ut*ri)/Ln(Zi))-Mn(Gn))/Gr)/Lr;var Zi},Za=(an(!0)-Gn)/Ut;if(Math.abs(Lr)<1e-6||!isFinite(Za)){if(Math.abs(mr-wr)<1e-6)return this.easeTo(P,oe);const ri=wr0,ba=Zi=>Math.exp(ri*Ut*Zi)}return P.duration="duration"in P?+P.duration:1e3*Za/("screenSpeed"in P?+P.screenSpeed/Ut:+P.speed),P.maxDuration&&P.duration>P.maxDuration&&(P.duration=0),this._zooming=!0,this._rotating=gt!==cr,this._pitching=Tr!==kt,this._padding=!ke.isPaddingEqual(kr),this._prepareEase(oe,!1),this.terrain&&this._prepareElevation(et),this._ease(ri=>{const Zi=ri*Za,yo=1/ba(Zi);ke.zoom=ri===1?ft:Be+ke.scaleZoom(yo),this._rotating&&(ke.bearing=t.y.number(gt,cr,ri)),this._pitching&&(ke.pitch=t.y.number(kt,Tr,ri)),this._padding&&(ke.interpolatePadding(Gt,kr,ri),yn=ke.centerPoint.add(Qr)),this.terrain&&!P.freezeElevation&&this._updateElevation(ri);const co=ri===1?et:ke.unproject(zt.add(Et.mult(ti(Zi))).mult(yo));ke.setLocationAtPoint(ke.renderWorldCopies?co.wrap():co,yn),this._applyUpdatedTransform(ke),this._fireMoveEvents(oe)},()=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe)},P),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(P,oe){var Se;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const ke=this._onEaseEnd;delete this._onEaseEnd,ke.call(this,oe)}return P||(Se=this.handlers)===null||Se===void 0||Se.stop(!1),this}_ease(P,oe,Se){Se.animate===!1||Se.duration===0?(P(1),oe()):(this._easeStart=i.now(),this._easeOptions=Se,this._onEaseFrame=P,this._onEaseEnd=oe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(P,oe){P=t.b3(P,-180,180);const Se=Math.abs(P-oe);return Math.abs(P-360-oe)180?-360:Se<-180?360:0}queryTerrainElevation(P){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(P),this.transform.tileZoom)-this.transform.elevation:null}}const Go={compact:!0,customAttribution:'MapLibre'};class jo{constructor(P=Go){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=oe=>{!oe||oe.sourceDataType!=="metadata"&&oe.sourceDataType!=="visibility"&&oe.dataType!=="style"&&oe.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=P}getDefaultPosition(){return"bottom-right"}onAdd(P){return this._map=P,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.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(){a.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(P,oe){const Se=this._map._getUIString(`AttributionControl.${oe}`);P.title=Se,P.setAttribute("aria-label",Se)}_updateAttributions(){if(!this._map.style)return;let P=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?P=P.concat(this.options.customAttribution.map(ke=>typeof ke!="string"?"":ke)):typeof this.options.customAttribution=="string"&&P.push(this.options.customAttribution)),this._map.style.stylesheet){const ke=this._map.style.stylesheet;this.styleOwner=ke.owner,this.styleId=ke.id}const oe=this._map.style.sourceCaches;for(const ke in oe){const Be=oe[ke];if(Be.used||Be.usedForTerrain){const gt=Be.getSource();gt.attribution&&P.indexOf(gt.attribution)<0&&P.push(gt.attribution)}}P=P.filter(ke=>String(ke).trim()),P.sort((ke,Be)=>ke.length-Be.length),P=P.filter((ke,Be)=>{for(let gt=Be+1;gt=0)return!1;return!0});const Se=P.join(" | ");Se!==this._attribHTML&&(this._attribHTML=Se,P.length?(this._innerContainer.innerHTML=Se,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Yi{constructor(P={}){this._updateCompact=()=>{const oe=this._container.children;if(oe.length){const Se=oe[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Se.classList.add("maplibregl-compact"):Se.classList.remove("maplibregl-compact")}},this.options=P}getDefaultPosition(){return"bottom-left"}onAdd(P){this._map=P,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const oe=a.create("a","maplibregl-ctrl-logo");return oe.target="_blank",oe.rel="noopener nofollow",oe.href="https://maplibre.org/",oe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),oe.setAttribute("rel","noopener nofollow"),this._container.appendChild(oe),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ki{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(P){const oe=++this._id;return this._queue.push({callback:P,id:oe,cancelled:!1}),oe}remove(P){const oe=this._currentlyRunning,Se=oe?this._queue.concat(oe):this._queue;for(const ke of Se)if(ke.id===P)return void(ke.cancelled=!0)}run(P=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const oe=this._currentlyRunning=this._queue;this._queue=[];for(const Se of oe)if(!Se.cancelled&&(Se.callback(P),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ns=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Fs extends t.E{constructor(P){super(),this.sourceCache=P,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,P.usedForTerrain=!0,P.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(P,oe){this.sourceCache.update(P,oe),this._renderableTilesKeys=[];const Se={};for(const ke of P.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:oe}))Se[ke.key]=!0,this._renderableTilesKeys.push(ke.key),this._tiles[ke.key]||(ke.posMatrix=new Float64Array(16),t.aP(ke.posMatrix,0,t.X,0,t.X,0,1),this._tiles[ke.key]=new ct(ke,this.tileSize));for(const ke in this._tiles)Se[ke]||delete this._tiles[ke]}freeRtt(P){for(const oe in this._tiles){const Se=this._tiles[oe];(!P||Se.tileID.equals(P)||Se.tileID.isChildOf(P)||P.isChildOf(Se.tileID))&&(Se.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(P=>this.getTileByID(P))}getTileByID(P){return this._tiles[P]}getTerrainCoords(P){const oe={};for(const Se of this._renderableTilesKeys){const ke=this._tiles[Se].tileID;if(ke.canonical.equals(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16),t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),oe[Se]=Be}else if(ke.canonical.isChildOf(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const gt=ke.canonical.z-P.canonical.z,kt=ke.canonical.x-(ke.canonical.x>>gt<>gt<>gt;t.aP(Be.posMatrix,0,cr,0,cr,0,1),t.J(Be.posMatrix,Be.posMatrix,[-kt*cr,-Gt*cr,0]),oe[Se]=Be}else if(P.canonical.isChildOf(ke.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const gt=P.canonical.z-ke.canonical.z,kt=P.canonical.x-(P.canonical.x>>gt<>gt<>gt;t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),t.J(Be.posMatrix,Be.posMatrix,[kt*cr,Gt*cr,0]),t.K(Be.posMatrix,Be.posMatrix,[1/2**gt,1/2**gt,0]),oe[Se]=Be}}return oe}getSourceTile(P,oe){const Se=this.sourceCache._source;let ke=P.overscaledZ-this.deltaZoom;if(ke>Se.maxzoom&&(ke=Se.maxzoom),ke=Se.minzoom&&(!Be||!Be.dem);)Be=this.sourceCache.getTileByID(P.scaledTo(ke--).key);return Be}tilesAfterTime(P=Date.now()){return Object.values(this._tiles).filter(oe=>oe.timeAdded>=P)}}class wl{constructor(P,oe,Se){this.painter=P,this.sourceCache=new Fs(oe),this.options=Se,this.exaggeration=typeof Se.exaggeration=="number"?Se.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(P,oe,Se,ke=t.X){var Be;if(!(oe>=0&&oe=0&&SeP.canonical.z&&(P.canonical.z>=ke?Be=P.canonical.z-ke:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const gt=P.canonical.x-(P.canonical.x>>Be<>Be<>8<<4|Be>>8,oe[gt+3]=0;const Se=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(oe.buffer)),ke=new u(P,Se,P.gl.RGBA,{premultiply:!1});return ke.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._coordsTexture=ke,ke}pointCoordinate(P){this.painter.maybeDrawDepthAndCoords(!0);const oe=new Uint8Array(4),Se=this.painter.context,ke=Se.gl,Be=Math.round(P.x*this.painter.pixelRatio/devicePixelRatio),gt=Math.round(P.y*this.painter.pixelRatio/devicePixelRatio),kt=Math.round(this.painter.height/devicePixelRatio);Se.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),ke.readPixels(Be,kt-gt-1,1,1,ke.RGBA,ke.UNSIGNED_BYTE,oe),Se.bindFramebuffer.set(null);const Gt=oe[0]+(oe[2]>>4<<8),cr=oe[1]+((15&oe[2])<<8),Tr=this.coordsIndex[255-oe[3]],kr=Tr&&this.sourceCache.getTileByID(Tr);if(!kr)return null;const Qr=this._coordsTextureSize,yn=(1<P.id!==oe),this._recentlyUsed.push(P.id)}stampObject(P){P.stamp=++this._stamp}getOrCreateFreeObject(){for(const oe of this._recentlyUsed)if(!this._objects[oe].inUse)return this._objects[oe];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const P=this._createObject(this._objects.length);return this._objects.push(P),P}freeObject(P){P.inUse=!1}freeAllObjects(){for(const P of this._objects)this.freeObject(P)}isFull(){return!(this._objects.length!P.inUse)===!1}}const Sl={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Gl{constructor(P,oe){this.painter=P,this.terrain=oe,this.pool=new Hl(P.context,30,oe.sourceCache.tileSize*oe.qualityFactor)}destruct(){this.pool.destruct()}getTexture(P){return this.pool.getObjectForId(P.rtt[this._stacks.length-1].id).texture}prepareForRender(P,oe){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=P._order.filter(Se=>!P._layers[Se].isHidden(oe)),this._coordsDescendingInv={};for(const Se in P.sourceCaches){this._coordsDescendingInv[Se]={};const ke=P.sourceCaches[Se].getVisibleCoordinates();for(const Be of ke){const gt=this.terrain.sourceCache.getTerrainCoords(Be);for(const kt in gt)this._coordsDescendingInv[Se][kt]||(this._coordsDescendingInv[Se][kt]=[]),this._coordsDescendingInv[Se][kt].push(gt[kt])}}this._coordsDescendingInvStr={};for(const Se of P._order){const ke=P._layers[Se],Be=ke.source;if(Sl[ke.type]&&!this._coordsDescendingInvStr[Be]){this._coordsDescendingInvStr[Be]={};for(const gt in this._coordsDescendingInv[Be])this._coordsDescendingInvStr[Be][gt]=this._coordsDescendingInv[Be][gt].map(kt=>kt.key).sort().join()}}for(const Se of this._renderableTiles)for(const ke in this._coordsDescendingInvStr){const Be=this._coordsDescendingInvStr[ke][Se.tileID.key];Be&&Be!==Se.rttCoords[ke]&&(Se.rtt=[])}}renderLayer(P){if(P.isHidden(this.painter.transform.zoom))return!1;const oe=P.type,Se=this.painter,ke=this._renderableLayerIds[this._renderableLayerIds.length-1]===P.id;if(Sl[oe]&&(this._prevType&&Sl[this._prevType]||this._stacks.push([]),this._prevType=oe,this._stacks[this._stacks.length-1].push(P.id),!ke))return!0;if(Sl[this._prevType]||Sl[oe]&&ke){this._prevType=oe;const Be=this._stacks.length-1,gt=this._stacks[Be]||[];for(const kt of this._renderableTiles){if(this.pool.isFull()&&(gu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(kt),kt.rtt[Be]){const cr=this.pool.getObjectForId(kt.rtt[Be].id);if(cr.stamp===kt.rtt[Be].stamp){this.pool.useObject(cr);continue}}const Gt=this.pool.getOrCreateFreeObject();this.pool.useObject(Gt),this.pool.stampObject(Gt),kt.rtt[Be]={id:Gt.id,stamp:Gt.stamp},Se.context.bindFramebuffer.set(Gt.fbo.framebuffer),Se.context.clear({color:t.aM.transparent,stencil:0}),Se.currentStencilSource=void 0;for(let cr=0;cr{Ue.touchstart=Ue.dragStart,Ue.touchmoveWindow=Ue.dragMove,Ue.touchend=Ue.dragEnd},po={showCompass:!0,showZoom:!0,visualizePitch:!1};class gs{constructor(P,oe,Se=!1){this.mousedown=gt=>{this.startMouse(t.e({},gt,{ctrlKey:!0,preventDefault:()=>gt.preventDefault()}),a.mousePos(this.element,gt)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=gt=>{this.moveMouse(gt,a.mousePos(this.element,gt))},this.mouseup=gt=>{this.mouseRotate.dragEnd(gt),this.mousePitch&&this.mousePitch.dragEnd(gt),this.offTemp()},this.touchstart=gt=>{gt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,gt.targetTouches)[0],this.startTouch(gt,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=gt=>{gt.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,gt.targetTouches)[0],this.moveTouch(gt,this._lastPos))},this.touchend=gt=>{gt.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const ke=P.dragRotate._mouseRotate.getClickTolerance(),Be=P.dragRotate._mousePitch.getClickTolerance();this.element=oe,this.mouseRotate=oc({clickTolerance:ke,enable:!0}),this.touchRotate=(({enable:gt,clickTolerance:kt,bearingDegreesPerPixelMoved:Gt=.8})=>{const cr=new uh;return new Vc({clickTolerance:kt,move:(Tr,kr)=>({bearingDelta:(kr.x-Tr.x)*Gt}),moveStateManager:cr,enable:gt,assignEvents:Ul})})({clickTolerance:ke,enable:!0}),this.map=P,Se&&(this.mousePitch=Gh({clickTolerance:Be,enable:!0}),this.touchPitch=(({enable:gt,clickTolerance:kt,pitchDegreesPerPixelMoved:Gt=-.5})=>{const cr=new uh;return new Vc({clickTolerance:kt,move:(Tr,kr)=>({pitchDelta:(kr.y-Tr.y)*Gt}),moveStateManager:cr,enable:gt,assignEvents:Ul})})({clickTolerance:Be,enable:!0})),a.addEventListener(oe,"mousedown",this.mousedown),a.addEventListener(oe,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(oe,"touchcancel",this.reset)}startMouse(P,oe){this.mouseRotate.dragStart(P,oe),this.mousePitch&&this.mousePitch.dragStart(P,oe),a.disableDrag()}startTouch(P,oe){this.touchRotate.dragStart(P,oe),this.touchPitch&&this.touchPitch.dragStart(P,oe),a.disableDrag()}moveMouse(P,oe){const Se=this.map,{bearingDelta:ke}=this.mouseRotate.dragMove(P,oe)||{};if(ke&&Se.setBearing(Se.getBearing()+ke),this.mousePitch){const{pitchDelta:Be}=this.mousePitch.dragMove(P,oe)||{};Be&&Se.setPitch(Se.getPitch()+Be)}}moveTouch(P,oe){const Se=this.map,{bearingDelta:ke}=this.touchRotate.dragMove(P,oe)||{};if(ke&&Se.setBearing(Se.getBearing()+ke),this.touchPitch){const{pitchDelta:Be}=this.touchPitch.dragMove(P,oe)||{};Be&&Se.setPitch(Se.getPitch()+Be)}}off(){const P=this.element;a.removeEventListener(P,"mousedown",this.mousedown),a.removeEventListener(P,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(P,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let Il;function dl(Ue,P,oe){const Se=new t.N(Ue.lng,Ue.lat);if(Ue=new t.N(Ue.lng,Ue.lat),P){const ke=new t.N(Ue.lng-360,Ue.lat),Be=new t.N(Ue.lng+360,Ue.lat),gt=oe.locationPoint(Ue).distSqr(P);oe.locationPoint(ke).distSqr(P)180;){const ke=oe.locationPoint(Ue);if(ke.x>=0&&ke.y>=0&&ke.x<=oe.width&&ke.y<=oe.height)break;Ue.lng>oe.center.lng?Ue.lng-=360:Ue.lng+=360}return Ue.lng!==Se.lng&&oe.locationPoint(Ue).y>oe.height/2-oe.getHorizon()?Ue:Se}const vc={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 dc(Ue,P,oe){const Se=Ue.classList;for(const ke in vc)Se.remove(`maplibregl-${oe}-anchor-${ke}`);Se.add(`maplibregl-${oe}-anchor-${P}`)}class _c extends t.E{constructor(P){if(super(),this._onKeyPress=oe=>{const Se=oe.code,ke=oe.charCode||oe.keyCode;Se!=="Space"&&Se!=="Enter"&&ke!==32&&ke!==13||this.togglePopup()},this._onMapClick=oe=>{const Se=oe.originalEvent.target,ke=this._element;this._popup&&(Se===ke||ke.contains(Se))&&this.togglePopup()},this._update=oe=>{var Se;if(!this._map)return;const ke=this._map.loaded()&&!this._map.isMoving();(oe?.type==="terrain"||oe?.type==="render"&&!ke)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?dl(this._lngLat,this._flatPos,this._map.transform):(Se=this._lngLat)===null||Se===void 0?void 0:Se.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 Be="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Be=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Be=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let gt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?gt="rotateX(0deg)":this._pitchAlignment==="map"&&(gt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||oe&&oe.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${vc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${gt} ${Be}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(oe&&oe.type==="moveend")}).catch(()=>{})},this._onMove=oe=>{if(!this._isDragging){const Se=this._clickTolerance||this._map._clickTolerance;this._isDragging=oe.point.dist(this._pointerdownPos)>=Se}this._isDragging&&(this._pos=oe.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=oe=>{this._element.contains(oe.originalEvent.target)&&(oe.preventDefault(),this._positionDelta=oe.point.sub(this._pos).add(this._offset),this._pointerdownPos=oe.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=P&&P.anchor||"center",this._color=P&&P.color||"#3FB1CE",this._scale=P&&P.scale||1,this._draggable=P&&P.draggable||!1,this._clickTolerance=P&&P.clickTolerance||0,this._subpixelPositioning=P&&P.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=P&&P.rotation||0,this._rotationAlignment=P&&P.rotationAlignment||"auto",this._pitchAlignment=P&&P.pitchAlignment&&P.pitchAlignment!=="auto"?P.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(P?.opacity,P?.opacityWhenCovered),P&&P.element)this._element=P.element,this._offset=t.P.convert(P&&P.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const oe=a.createNS("http://www.w3.org/2000/svg","svg"),Se=41,ke=27;oe.setAttributeNS(null,"display","block"),oe.setAttributeNS(null,"height",`${Se}px`),oe.setAttributeNS(null,"width",`${ke}px`),oe.setAttributeNS(null,"viewBox",`0 0 ${ke} ${Se}`);const Be=a.createNS("http://www.w3.org/2000/svg","g");Be.setAttributeNS(null,"stroke","none"),Be.setAttributeNS(null,"stroke-width","1"),Be.setAttributeNS(null,"fill","none"),Be.setAttributeNS(null,"fill-rule","evenodd");const gt=a.createNS("http://www.w3.org/2000/svg","g");gt.setAttributeNS(null,"fill-rule","nonzero");const kt=a.createNS("http://www.w3.org/2000/svg","g");kt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),kt.setAttributeNS(null,"fill","#000000");const Gt=[{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(const _t of Gt){const zt=a.createNS("http://www.w3.org/2000/svg","ellipse");zt.setAttributeNS(null,"opacity","0.04"),zt.setAttributeNS(null,"cx","10.5"),zt.setAttributeNS(null,"cy","5.80029008"),zt.setAttributeNS(null,"rx",_t.rx),zt.setAttributeNS(null,"ry",_t.ry),kt.appendChild(zt)}const cr=a.createNS("http://www.w3.org/2000/svg","g");cr.setAttributeNS(null,"fill",this._color);const Tr=a.createNS("http://www.w3.org/2000/svg","path");Tr.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"),cr.appendChild(Tr);const kr=a.createNS("http://www.w3.org/2000/svg","g");kr.setAttributeNS(null,"opacity","0.25"),kr.setAttributeNS(null,"fill","#000000");const Qr=a.createNS("http://www.w3.org/2000/svg","path");Qr.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"),kr.appendChild(Qr);const yn=a.createNS("http://www.w3.org/2000/svg","g");yn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),yn.setAttributeNS(null,"fill","#FFFFFF");const Ze=a.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"transform","translate(8.0, 8.0)");const et=a.createNS("http://www.w3.org/2000/svg","circle");et.setAttributeNS(null,"fill","#000000"),et.setAttributeNS(null,"opacity","0.25"),et.setAttributeNS(null,"cx","5.5"),et.setAttributeNS(null,"cy","5.5"),et.setAttributeNS(null,"r","5.4999962");const ft=a.createNS("http://www.w3.org/2000/svg","circle");ft.setAttributeNS(null,"fill","#FFFFFF"),ft.setAttributeNS(null,"cx","5.5"),ft.setAttributeNS(null,"cy","5.5"),ft.setAttributeNS(null,"r","5.4999962"),Ze.appendChild(et),Ze.appendChild(ft),gt.appendChild(kt),gt.appendChild(cr),gt.appendChild(kr),gt.appendChild(yn),gt.appendChild(Ze),oe.appendChild(gt),oe.setAttributeNS(null,"height",Se*this._scale+"px"),oe.setAttributeNS(null,"width",ke*this._scale+"px"),this._element.appendChild(oe),this._offset=t.P.convert(P&&P.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",oe=>{oe.preventDefault()}),this._element.addEventListener("mousedown",oe=>{oe.preventDefault()}),dc(this._element,this._anchor,"marker"),P&&P.className)for(const oe of P.className.split(" "))this._element.classList.add(oe);this._popup=null}addTo(P){return this.remove(),this._map=P,this._element.setAttribute("aria-label",P._getUIString("Marker.Title")),P.getCanvasContainer().appendChild(this._element),P.on("move",this._update),P.on("moveend",this._update),P.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),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(P){return this._lngLat=t.N.convert(P),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(P){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),P){if(!("offset"in P.options)){const ke=Math.abs(13.5)/Math.SQRT2;P.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[ke,-1*(38.1-13.5+ke)],"bottom-right":[-ke,-1*(38.1-13.5+ke)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=P,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(P){return this._subpixelPositioning=P,this}getPopup(){return this._popup}togglePopup(){const P=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:P?(P.isOpen()?P.remove():(P.setLngLat(this._lngLat),P.addTo(this._map)),this):this}_updateOpacity(P=!1){var oe,Se;if(!(!((oe=this._map)===null||oe===void 0)&&oe.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(P)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const ke=this._map,Be=ke.terrain.depthAtPoint(this._pos),gt=ke.terrain.getElevationForLngLatZoom(this._lngLat,ke.transform.tileZoom);if(ke.transform.lngLatToCameraDepth(this._lngLat,gt)-Be<.006)return void(this._element.style.opacity=this._opacity);const kt=-this._offset.y/ke.transform._pixelPerMeter,Gt=Math.sin(ke.getPitch()*Math.PI/180)*kt,cr=ke.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Tr=ke.transform.lngLatToCameraDepth(this._lngLat,gt+Gt)-cr>.006;!((Se=this._popup)===null||Se===void 0)&&Se.isOpen()&&Tr&&this._popup.remove(),this._element.style.opacity=Tr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(P){return this._offset=t.P.convert(P),this._update(),this}addClassName(P){this._element.classList.add(P)}removeClassName(P){this._element.classList.remove(P)}toggleClassName(P){return this._element.classList.toggle(P)}setDraggable(P){return this._draggable=!!P,this._map&&(P?(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(P){return this._rotation=P||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(P){return this._rotationAlignment=P||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(P){return this._pitchAlignment=P&&P!=="auto"?P:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(P,oe){return P===void 0&&oe===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),P!==void 0&&(this._opacity=P),oe!==void 0&&(this._opacityWhenCovered=oe),this._map&&this._updateOpacity(!0),this}}const Hf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let pc=0,Af=!1;const Mu={maxWidth:100,unit:"metric"};function Sf(Ue,P,oe){const Se=oe&&oe.maxWidth||100,ke=Ue._container.clientHeight/2,Be=Ue.unproject([0,ke]),gt=Ue.unproject([Se,ke]),kt=Be.distanceTo(gt);if(oe&&oe.unit==="imperial"){const Gt=3.2808*kt;Gt>5280?Xo(P,Se,Gt/5280,Ue._getUIString("ScaleControl.Miles")):Xo(P,Se,Gt,Ue._getUIString("ScaleControl.Feet"))}else oe&&oe.unit==="nautical"?Xo(P,Se,kt/1852,Ue._getUIString("ScaleControl.NauticalMiles")):kt>=1e3?Xo(P,Se,kt/1e3,Ue._getUIString("ScaleControl.Kilometers")):Xo(P,Se,kt,Ue._getUIString("ScaleControl.Meters"))}function Xo(Ue,P,oe,Se){const ke=(function(Be){const gt=Math.pow(10,`${Math.floor(Be)}`.length-1);let kt=Be/gt;return kt=kt>=10?10:kt>=5?5:kt>=3?3:kt>=2?2:kt>=1?1:(function(Gt){const cr=Math.pow(10,Math.ceil(-Math.log(Gt)/Math.LN10));return Math.round(Gt*cr)/cr})(kt),gt*kt})(oe);Ue.style.width=P*(ke/oe)+"px",Ue.innerHTML=`${ke} ${Se}`}const as={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Mf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Gc(Ue){if(Ue){if(typeof Ue=="number"){const P=Math.round(Math.abs(Ue)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Ue),"top-left":new t.P(P,P),"top-right":new t.P(-P,P),bottom:new t.P(0,-Ue),"bottom-left":new t.P(P,-P),"bottom-right":new t.P(-P,-P),left:new t.P(Ue,0),right:new t.P(-Ue,0)}}if(Ue instanceof t.P||Array.isArray(Ue)){const P=t.P.convert(Ue);return{center:P,top:P,"top-left":P,"top-right":P,bottom:P,"bottom-left":P,"bottom-right":P,left:P,right:P}}return{center:t.P.convert(Ue.center||[0,0]),top:t.P.convert(Ue.top||[0,0]),"top-left":t.P.convert(Ue["top-left"]||[0,0]),"top-right":t.P.convert(Ue["top-right"]||[0,0]),bottom:t.P.convert(Ue.bottom||[0,0]),"bottom-left":t.P.convert(Ue["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Ue["bottom-right"]||[0,0]),left:t.P.convert(Ue.left||[0,0]),right:t.P.convert(Ue.right||[0,0])}}return Gc(new t.P(0,0))}const Dc=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=jo,e.BoxZoomHandler=tf,e.CanvasSource=nt,e.CooperativeGesturesHandler=_i,e.DoubleClickZoomHandler=Ta,e.DragPanHandler=si,e.DragRotateHandler=Bi,e.EdgeInsets=hc,e.FullscreenControl=class extends t.E{constructor(Ue={}){super(),this._onFullscreenChange=()=>{var P;let oe=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((P=oe?.shadowRoot)===null||P===void 0)&&P.fullscreenElement;)oe=oe.shadowRoot.fullscreenElement;oe===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ue&&Ue.container&&(Ue.container instanceof HTMLElement?this._container=Ue.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(Ue){return this._map=Ue,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const Ue=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Ue).setAttribute("aria-hidden","true"),Ue.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const Ue=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ue),this._fullscreenButton.title=Ue}_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=ze,e.GeolocateControl=class extends t.E{constructor(Ue){super(),this._onSuccess=P=>{if(this._map){if(this._isOutOfMapMaxBounds(P))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",P)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=P,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(P),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(P),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",P)),this._finish()}},this._updateCamera=P=>{const oe=new t.N(P.coords.longitude,P.coords.latitude),Se=P.coords.accuracy,ke=this._map.getBearing(),Be=t.e({bearing:ke},this.options.fitBoundsOptions),gt=ie.fromLngLat(oe,Se);this._map.fitBounds(gt,Be,{geolocateSource:!0})},this._updateMarker=P=>{if(P){const oe=new t.N(P.coords.longitude,P.coords.latitude);this._accuracyCircleMarker.setLngLat(oe).addTo(this._map),this._userLocationDotMarker.setLngLat(oe).addTo(this._map),this._accuracy=P.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=P=>{if(this._map){if(this.options.trackUserLocation)if(P.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;const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(P.code===3&&Af)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",P)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",P=>P.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=P=>{if(this._map){if(P===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}else{const oe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new _c({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new _c({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",oe=>{oe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||oe.originalEvent&&oe.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({},Hf,Ue)}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return t._(this,arguments,void 0,function*(P=!1){if(Il!==void 0&&!P)return Il;if(window.navigator.permissions===void 0)return Il=!!window.navigator.geolocation,Il;try{Il=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Il=!!window.navigator.geolocation}return Il})})().then(P=>this._finishSetupUI(P)),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(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,pc=0,Af=!1}_isOutOfMapMaxBounds(Ue){const P=this._map.getMaxBounds(),oe=Ue.coords;return P&&(oe.longitudeP.getEast()||oe.latitudeP.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(){const Ue=this._map.getBounds(),P=Ue.getSouthEast(),oe=Ue.getNorthEast(),Se=P.distanceTo(oe),ke=Math.ceil(this._accuracy/(Se/this._map._container.clientHeight)*2);this._circleElement.style.width=`${ke}px`,this._circleElement.style.height=`${ke}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":pc--,Af=!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 Ue;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),pc++,pc>1?(Ue={maximumAge:6e5,timeout:0},Af=!0):(Ue=this.options.positionOptions,Af=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ue)}}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=uf,e.ImageSource=it,e.KeyboardHandler=Pr,e.LngLatBounds=ie,e.LogoControl=Yi,e.Map=class extends Ro{constructor(Ue){t.bf.mark(t.bg.create);const P=Object.assign(Object.assign({},bu),Ue);if(P.minZoom!=null&&P.maxZoom!=null&&P.minZoom>P.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(P.minPitch!=null&&P.maxPitch!=null&&P.minPitch>P.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(P.minPitch!=null&&P.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(P.maxPitch!=null&&P.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new lu(P.minZoom,P.maxZoom,P.minPitch,P.maxPitch,P.renderWorldCopies),{bearingSnap:P.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ki,this._controls=[],this._mapId=t.a4(),this._contextLost=oe=>{oe.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:oe}))},this._contextRestored=oe=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:oe}))},this._onMapScroll=oe=>{if(oe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=P.interactive,this._maxTileCacheSize=P.maxTileCacheSize,this._maxTileCacheZoomLevels=P.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=P.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=P.preserveDrawingBuffer===!0,this._antialias=P.antialias===!0,this._trackResize=P.trackResize===!0,this._bearingSnap=P.bearingSnap,this._refreshExpiredTiles=P.refreshExpiredTiles===!0,this._fadeDuration=P.fadeDuration,this._crossSourceCollisions=P.crossSourceCollisions===!0,this._collectResourceTiming=P.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},el),P.locale),this._clickTolerance=P.clickTolerance,this._overridePixelRatio=P.pixelRatio,this._maxCanvasSize=P.maxCanvasSize,this.transformCameraUpdate=P.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=P.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new g(P.transformRequest),typeof P.container=="string"){if(this._container=document.getElementById(P.container),!this._container)throw new Error(`Container '${P.container}' not found.`)}else{if(!(P.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=P.container}if(P.maxBounds&&this.setMaxBounds(P.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 oe=!1;const Se=Kf(ke=>{this._trackResize&&!this._removed&&(this.resize(ke),this.redraw())},50);this._resizeObserver=new ResizeObserver(ke=>{oe?Se(ke):oe=!0}),this._resizeObserver.observe(this._container)}this.handlers=new No(this,P),this._hash=P.hash&&new uf(typeof P.hash=="string"&&P.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:P.center,zoom:P.zoom,bearing:P.bearing,pitch:P.pitch}),P.bounds&&(this.resize(),this.fitBounds(P.bounds,t.e({},P.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=P.localIdeographFontFamily,this._validateStyle=P.validateStyle,P.style&&this.setStyle(P.style,{localIdeographFontFamily:P.localIdeographFontFamily}),P.attributionControl&&this.addControl(new jo(typeof P.attributionControl=="boolean"?void 0:P.attributionControl)),P.maplibreLogo&&this.addControl(new Yi,P.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",oe=>{this._update(oe.dataType==="style"),this.fire(new t.k(`${oe.dataType}data`,oe))}),this.on("dataloading",oe=>{this.fire(new t.k(`${oe.dataType}dataloading`,oe))}),this.on("dataabort",oe=>{this.fire(new t.k("sourcedataabort",oe))})}_getMapId(){return this._mapId}addControl(Ue,P){if(P===void 0&&(P=Ue.getDefaultPosition?Ue.getDefaultPosition():"top-right"),!Ue||!Ue.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const oe=Ue.onAdd(this);this._controls.push(Ue);const Se=this._controlPositions[P];return P.indexOf("bottom")!==-1?Se.insertBefore(oe,Se.firstChild):Se.appendChild(oe),this}removeControl(Ue){if(!Ue||!Ue.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const P=this._controls.indexOf(Ue);return P>-1&&this._controls.splice(P,1),Ue.onRemove(this),this}hasControl(Ue){return this._controls.indexOf(Ue)>-1}calculateCameraOptionsFromTo(Ue,P,oe,Se){return Se==null&&this.terrain&&(Se=this.terrain.getElevationForLngLatZoom(oe,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ue,P,oe,Se)}resize(Ue){var P;const oe=this._containerDimensions(),Se=oe[0],ke=oe[1],Be=this._getClampedPixelRatio(Se,ke);if(this._resizeCanvas(Se,ke,Be),this.painter.resize(Se,ke,Be),this.painter.overLimit()){const kt=this.painter.context.gl;this._maxCanvasSize=[kt.drawingBufferWidth,kt.drawingBufferHeight];const Gt=this._getClampedPixelRatio(Se,ke);this._resizeCanvas(Se,ke,Gt),this.painter.resize(Se,ke,Gt)}this.transform.resize(Se,ke),(P=this._requestedCameraState)===null||P===void 0||P.resize(Se,ke);const gt=!this._moving;return gt&&(this.stop(),this.fire(new t.k("movestart",Ue)).fire(new t.k("move",Ue))),this.fire(new t.k("resize",Ue)),gt&&this.fire(new t.k("moveend",Ue)),this}_getClampedPixelRatio(Ue,P){const{0:oe,1:Se}=this._maxCanvasSize,ke=this.getPixelRatio(),Be=Ue*ke,gt=P*ke;return Math.min(Be>oe?oe/Be:1,gt>Se?Se/gt:1)*ke}getPixelRatio(){var Ue;return(Ue=this._overridePixelRatio)!==null&&Ue!==void 0?Ue:devicePixelRatio}setPixelRatio(Ue){this._overridePixelRatio=Ue,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ue){return this.transform.setMaxBounds(ie.convert(Ue)),this._update()}setMinZoom(Ue){if((Ue=Ue??-2)>=-2&&Ue<=this.transform.maxZoom)return this.transform.minZoom=Ue,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ue,this._update(),this.getZoom()>Ue&&this.setZoom(Ue),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ue){if((Ue=Ue??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ue>=0&&Ue<=this.transform.maxPitch)return this.transform.minPitch=Ue,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ue>=this.transform.minPitch)return this.transform.maxPitch=Ue,this._update(),this.getPitch()>Ue&&this.setPitch(Ue),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ue){return this.transform.renderWorldCopies=Ue,this._update()}project(Ue){return this.transform.locationPoint(t.N.convert(Ue),this.style&&this.terrain)}unproject(Ue){return this.transform.pointLocation(t.P.convert(Ue),this.terrain)}isMoving(){var Ue;return this._moving||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isMoving())}isZooming(){var Ue;return this._zooming||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isZooming())}isRotating(){var Ue;return this._rotating||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isRotating())}_createDelegatedListener(Ue,P,oe){if(Ue==="mouseenter"||Ue==="mouseover"){let Se=!1;return{layers:P,listener:oe,delegates:{mousemove:Be=>{const gt=P.filter(Gt=>this.getLayer(Gt)),kt=gt.length!==0?this.queryRenderedFeatures(Be.point,{layers:gt}):[];kt.length?Se||(Se=!0,oe.call(this,new nc(Ue,this,Be.originalEvent,{features:kt}))):Se=!1},mouseout:()=>{Se=!1}}}}if(Ue==="mouseleave"||Ue==="mouseout"){let Se=!1;return{layers:P,listener:oe,delegates:{mousemove:gt=>{const kt=P.filter(Gt=>this.getLayer(Gt));(kt.length!==0?this.queryRenderedFeatures(gt.point,{layers:kt}):[]).length?Se=!0:Se&&(Se=!1,oe.call(this,new nc(Ue,this,gt.originalEvent)))},mouseout:gt=>{Se&&(Se=!1,oe.call(this,new nc(Ue,this,gt.originalEvent)))}}}}{const Se=ke=>{const Be=P.filter(kt=>this.getLayer(kt)),gt=Be.length!==0?this.queryRenderedFeatures(ke.point,{layers:Be}):[];gt.length&&(ke.features=gt,oe.call(this,ke),delete ke.features)};return{layers:P,listener:oe,delegates:{[Ue]:Se}}}}_saveDelegatedListener(Ue,P){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ue]=this._delegatedListeners[Ue]||[],this._delegatedListeners[Ue].push(P)}_removeDelegatedListener(Ue,P,oe){if(!this._delegatedListeners||!this._delegatedListeners[Ue])return;const Se=this._delegatedListeners[Ue];for(let ke=0;keP.includes(gt))){for(const gt in Be.delegates)this.off(gt,Be.delegates[gt]);return void Se.splice(ke,1)}}}on(Ue,P,oe){if(oe===void 0)return super.on(Ue,P);const Se=this._createDelegatedListener(Ue,typeof P=="string"?[P]:P,oe);this._saveDelegatedListener(Ue,Se);for(const ke in Se.delegates)this.on(ke,Se.delegates[ke]);return this}once(Ue,P,oe){if(oe===void 0)return super.once(Ue,P);const Se=typeof P=="string"?[P]:P,ke=this._createDelegatedListener(Ue,Se,oe);for(const Be in ke.delegates){const gt=ke.delegates[Be];ke.delegates[Be]=(...kt)=>{this._removeDelegatedListener(Ue,Se,oe),gt(...kt)}}this._saveDelegatedListener(Ue,ke);for(const Be in ke.delegates)this.once(Be,ke.delegates[Be]);return this}off(Ue,P,oe){return oe===void 0?super.off(Ue,P):(this._removeDelegatedListener(Ue,typeof P=="string"?[P]:P,oe),this)}queryRenderedFeatures(Ue,P){if(!this.style)return[];let oe;const Se=Ue instanceof t.P||Array.isArray(Ue),ke=Se?Ue:[[0,0],[this.transform.width,this.transform.height]];if(P=P||(Se?{}:Ue)||{},ke instanceof t.P||typeof ke[0]=="number")oe=[t.P.convert(ke)];else{const Be=t.P.convert(ke[0]),gt=t.P.convert(ke[1]);oe=[Be,new t.P(gt.x,Be.y),gt,new t.P(Be.x,gt.y),Be]}return this.style.queryRenderedFeatures(oe,P,this.transform)}querySourceFeatures(Ue,P){return this.style.querySourceFeatures(Ue,P)}setStyle(Ue,P){return(P=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},P)).diff!==!1&&P.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ue?(this._diffStyle(Ue,P),this):(this._localIdeographFontFamily=P.localIdeographFontFamily,this._updateStyle(Ue,P))}setTransformRequest(Ue){return this._requestManager.setTransformRequest(Ue),this}_getUIString(Ue){const P=this._locale[Ue];if(P==null)throw new Error(`Missing UI string '${Ue}'`);return P}_updateStyle(Ue,P){if(P.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ue,P));const oe=this.style&&P.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ue)),Ue?(this.style=new Ur(this,P||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ue=="string"?this.style.loadURL(Ue,P,oe):this.style.loadJSON(Ue,P,oe),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ur(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ue,P){if(typeof Ue=="string"){const oe=this._requestManager.transformRequest(Ue,"Style");t.h(oe,new AbortController).then(Se=>{this._updateDiff(Se.data,P)}).catch(Se=>{Se&&this.fire(new t.j(Se))})}else typeof Ue=="object"&&this._updateDiff(Ue,P)}_updateDiff(Ue,P){try{this.style.setState(Ue,P)&&this._update(!0)}catch(oe){t.w(`Unable to perform style diff: ${oe.message||oe.error||oe}. Rebuilding the style from scratch.`),this._updateStyle(Ue,P)}}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(Ue,P){return this._lazyInitEmptyStyle(),this.style.addSource(Ue,P),this._update(!0)}isSourceLoaded(Ue){const P=this.style&&this.style.sourceCaches[Ue];if(P!==void 0)return P.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Ue}'`)))}setTerrain(Ue){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ue){const P=this.style.sourceCaches[Ue.source];if(!P)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ue.source}`);this.terrain===null&&P.reload();for(const oe in this.style._layers){const Se=this.style._layers[oe];Se.type==="hillshade"&&Se.source===Ue.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 wl(this.painter,P,Ue),this.painter.renderToTexture=new Gl(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=oe=>{oe.dataType==="style"?this.terrain.sourceCache.freeRtt():oe.dataType==="source"&&oe.tile&&(oe.sourceId!==Ue.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(oe.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:Ue})),this}getTerrain(){var Ue,P;return(P=(Ue=this.terrain)===null||Ue===void 0?void 0:Ue.options)!==null&&P!==void 0?P:null}areTilesLoaded(){const Ue=this.style&&this.style.sourceCaches;for(const P in Ue){const oe=Ue[P]._tiles;for(const Se in oe){const ke=oe[Se];if(ke.state!=="loaded"&&ke.state!=="errored")return!1}}return!0}removeSource(Ue){return this.style.removeSource(Ue),this._update(!0)}getSource(Ue){return this.style.getSource(Ue)}addImage(Ue,P,oe={}){const{pixelRatio:Se=1,sdf:ke=!1,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr}=oe;if(this._lazyInitEmptyStyle(),!(P instanceof HTMLImageElement||t.b(P))){if(P.width===void 0||P.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`")));{const{width:Tr,height:kr,data:Qr}=P,yn=P;return this.style.addImage(Ue,{data:new t.R({width:Tr,height:kr},new Uint8Array(Qr)),pixelRatio:Se,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr,sdf:ke,version:0,userImage:yn}),yn.onAdd&&yn.onAdd(this,Ue),this}}{const{width:Tr,height:kr,data:Qr}=i.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Tr,height:kr},Qr),pixelRatio:Se,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr,sdf:ke,version:0})}}updateImage(Ue,P){const oe=this.style.getImage(Ue);if(!oe)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.")));const Se=P instanceof HTMLImageElement||t.b(P)?i.getImageData(P):P,{width:ke,height:Be,data:gt}=Se;if(ke===void 0||Be===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(ke!==oe.data.width||Be!==oe.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")));const kt=!(P instanceof HTMLImageElement||t.b(P));return oe.data.replace(gt,kt),this.style.updateImage(Ue,oe),this}getImage(Ue){return this.style.getImage(Ue)}hasImage(Ue){return Ue?!!this.style.getImage(Ue):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Ue){this.style.removeImage(Ue)}loadImage(Ue){return l.getImage(this._requestManager.transformRequest(Ue,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ue,P){return this._lazyInitEmptyStyle(),this.style.addLayer(Ue,P),this._update(!0)}moveLayer(Ue,P){return this.style.moveLayer(Ue,P),this._update(!0)}removeLayer(Ue){return this.style.removeLayer(Ue),this._update(!0)}getLayer(Ue){return this.style.getLayer(Ue)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ue,P,oe){return this.style.setLayerZoomRange(Ue,P,oe),this._update(!0)}setFilter(Ue,P,oe={}){return this.style.setFilter(Ue,P,oe),this._update(!0)}getFilter(Ue){return this.style.getFilter(Ue)}setPaintProperty(Ue,P,oe,Se={}){return this.style.setPaintProperty(Ue,P,oe,Se),this._update(!0)}getPaintProperty(Ue,P){return this.style.getPaintProperty(Ue,P)}setLayoutProperty(Ue,P,oe,Se={}){return this.style.setLayoutProperty(Ue,P,oe,Se),this._update(!0)}getLayoutProperty(Ue,P){return this.style.getLayoutProperty(Ue,P)}setGlyphs(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ue,P),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ue,P,oe={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ue,P,oe,Se=>{Se||this._update(!0)}),this}removeSprite(Ue){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ue),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ue,P,oe=>{oe||this._update(!0)}),this}setLight(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ue,P),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ue){return this._lazyInitEmptyStyle(),this.style.setSky(Ue),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ue,P){return this.style.setFeatureState(Ue,P),this._update()}removeFeatureState(Ue,P){return this.style.removeFeatureState(Ue,P),this._update()}getFeatureState(Ue){return this.style.getFeatureState(Ue)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ue=0,P=0;return this._container&&(Ue=this._container.clientWidth||400,P=this._container.clientHeight||300),[Ue,P]}_setupContainer(){const Ue=this._container;Ue.classList.add("maplibregl-map");const P=this._canvasContainer=a.create("div","maplibregl-canvas-container",Ue);this._interactive&&P.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",P),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");const oe=this._containerDimensions(),Se=this._getClampedPixelRatio(oe[0],oe[1]);this._resizeCanvas(oe[0],oe[1],Se);const ke=this._controlContainer=a.create("div","maplibregl-control-container",Ue),Be=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(gt=>{Be[gt]=a.create("div",`maplibregl-ctrl-${gt} `,ke)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ue,P,oe){this._canvas.width=Math.floor(oe*Ue),this._canvas.height=Math.floor(oe*P),this._canvas.style.width=`${Ue}px`,this._canvas.style.height=`${P}px`}_setupPainter(){const Ue={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let P=null;this._canvas.addEventListener("webglcontextcreationerror",Se=>{P={requestedAttributes:Ue},Se&&(P.statusMessage=Se.statusMessage,P.type=Se.type)},{once:!0});const oe=this._canvas.getContext("webgl2",Ue)||this._canvas.getContext("webgl",Ue);if(!oe){const Se="Failed to initialize WebGL";throw P?(P.message=Se,new Error(JSON.stringify(P))):new Error(Se)}this.painter=new zf(oe,this.transform),s.testSupport(oe)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ue){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ue,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ue){return this._update(),this._renderTaskQueue.add(Ue)}_cancelRenderFrame(Ue){this._renderTaskQueue.remove(Ue)}_render(Ue){const P=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ue),this._removed)return;let oe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const ke=this.transform.zoom,Be=i.now();this.style.zoomHistory.update(ke,Be);const gt=new t.z(ke,{now:Be,fadeDuration:P,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),kt=gt.crossFadingFactor();kt===1&&kt===this._crossFadingFactor||(oe=!0,this._crossFadingFactor=kt),this.style.update(gt)}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,P,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:P,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()||oe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Se=this._sourcesDirty||this._styleDirty||this._placementDirty;return Se||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Se||(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 Ue;this._hash&&this._hash.remove();for(const oe of this._controls)oe.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),(Ue=this._resizeObserver)===null||Ue===void 0||Ue.disconnect();const P=this.painter.context.gl.getExtension("WEBGL_lose_context");P?.loseContext&&P.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(Ue=>{t.bf.frame(Ue),this._frameRequest=null,this._render(Ue)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ue){this._showTileBoundaries!==Ue&&(this._showTileBoundaries=Ue,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ue){this._showPadding!==Ue&&(this._showPadding=Ue,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ue){this._showCollisionBoxes!==Ue&&(this._showCollisionBoxes=Ue,Ue?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ue){this._showOverdrawInspector!==Ue&&(this._showOverdrawInspector=Ue,this._update())}get repaint(){return!!this._repaint}set repaint(Ue){this._repaint!==Ue&&(this._repaint=Ue,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ue){this._vertices=Ue,this._update()}get version(){return Su}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=nc,e.MapTouchEvent=Jf,e.MapWheelEvent=Hh,e.Marker=_c,e.NavigationControl=class{constructor(Ue){this._updateZoomButtons=()=>{const P=this._map.getZoom(),oe=P===this._map.getMaxZoom(),Se=P===this._map.getMinZoom();this._zoomInButton.disabled=oe,this._zoomOutButton.disabled=Se,this._zoomInButton.setAttribute("aria-disabled",oe.toString()),this._zoomOutButton.setAttribute("aria-disabled",Se.toString())},this._rotateCompassArrow=()=>{const P=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=P},this._setButtonTitle=(P,oe)=>{const Se=this._map._getUIString(`NavigationControl.${oe}`);P.title=Se,P.setAttribute("aria-label",Se)},this.options=t.e({},po,Ue),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",P=>P.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",P=>this._map.zoomIn({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",P=>this._map.zoomOut({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",P=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:P}):this._map.resetNorth({},{originalEvent:P})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ue){return this._map=Ue,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 gs(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.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(Ue,P){const oe=a.create("button",Ue,this._container);return oe.type="button",oe.addEventListener("click",P),oe}},e.Popup=class extends t.E{constructor(Ue){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.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=P=>{this._update(P.point)},this._onMouseMove=P=>{this._update(P.point)},this._onDrag=P=>{this._update(P.point)},this._update=P=>{var oe;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const kt of this.options.className.split(" "))this._container.classList.add(kt);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?dl(this._lngLat,this._flatPos,this._map.transform):(oe=this._lngLat)===null||oe===void 0?void 0:oe.wrap(),this._trackPointer&&!P)return;const Se=this._flatPos=this._pos=this._trackPointer&&P?P:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&P?P:this._map.transform.locationPoint(this._lngLat));let ke=this.options.anchor;const Be=Gc(this.options.offset);if(!ke){const kt=this._container.offsetWidth,Gt=this._container.offsetHeight;let cr;cr=Se.y+Be.bottom.ythis._map.transform.height-Gt?["bottom"]:[],Se.xthis._map.transform.width-kt/2&&cr.push("right"),ke=cr.length===0?"bottom":cr.join("-")}let gt=Se.add(Be[ke]);this.options.subpixelPositioning||(gt=gt.round()),a.setTransform(this._container,`${vc[ke]} translate(${gt.x}px,${gt.y}px)`),dc(this._container,ke,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(as),Ue)}addTo(Ue){return this._map&&this.remove(),this._map=Ue,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(Ue){return this._lngLat=t.N.convert(Ue),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(Ue){return this.setDOMContent(document.createTextNode(Ue))}setHTML(Ue){const P=document.createDocumentFragment(),oe=document.createElement("body");let Se;for(oe.innerHTML=Ue;Se=oe.firstChild,Se;)P.appendChild(Se);return this.setDOMContent(P)}getMaxWidth(){var Ue;return(Ue=this._container)===null||Ue===void 0?void 0:Ue.style.maxWidth}setMaxWidth(Ue){return this.options.maxWidth=Ue,this._update(),this}setDOMContent(Ue){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ue),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ue){return this._container&&this._container.classList.add(Ue),this}removeClassName(Ue){return this._container&&this._container.classList.remove(Ue),this}setOffset(Ue){return this.options.offset=Ue,this._update(),this}toggleClassName(Ue){if(this._container)return this._container.classList.toggle(Ue)}setSubpixelPositioning(Ue){this.options.subpixelPositioning=Ue}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.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;const Ue=this._container.querySelector(Mf);Ue&&Ue.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Ce,e.ScaleControl=class{constructor(Ue){this._onMove=()=>{Sf(this._map,this._container,this.options)},this.setUnit=P=>{this.options.unit=P,Sf(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Mu),Ue)}getDefaultPosition(){return"bottom-left"}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ue.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=On,e.Style=Ur,e.TerrainControl=class{constructor(Ue){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=Ue}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.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(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Oh,e.TwoFingersTouchRotateHandler=Bf,e.TwoFingersTouchZoomHandler=yc,e.TwoFingersTouchZoomRotateHandler=Va,e.VectorTileSource=Ae,e.VideoSource=st,e.addSourceType=(Ue,P)=>t._(void 0,void 0,void 0,function*(){if(Le(Ue))throw new Error(`A source type called "${Ue}" already exists.`);((oe,Se)=>{Qe[oe]=Se})(Ue,P)}),e.clearPrewarmedResources=function(){const Ue=ce;Ue&&(Ue.isPreloaded()&&Ue.numActive()===1?(Ue.release(re),ce=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 ot().getRTLTextPluginStatus()},e.getVersion=function(){return Dc},e.getWorkerCount=function(){return fe.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Ue){return K().broadcast("IS",Ue)},e.prewarm=function(){ee().acquire(re)},e.setMaxParallelImageRequests=function(Ue){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Ue},e.setRTLTextPlugin=function(Ue,P){return ot().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){fe.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=h;return E})}}),az=Ge({"src/plots/map/layers.js"($,G){var h=gn(),b=Ju().sanitizeHTML,S=KC(),E=B_();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.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(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),iz=Ge({"src/plots/map/map.js"($,G){var h=nz(),b=gn(),S=D_(),E=Lo(),e=ws(),t=rd(),r=jf(),o=zp(),n=o.drawMode,i=o.selectMode,a=Yf().prepSelect,s=Yf().clearOutline,f=Yf().clearSelectionsCache,c=Yf().selectOnClick,p=B_(),d=az();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),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(_,w,m){var u=this,v;u.map?v=new Promise(function(y,I){u.updateMap(_,w,y,I)}):v=new Promise(function(y,I){u.createMap(_,w,y,I)}),m.push(v)},l.createMap=function(_,w,m,u){var v=this,y=w[v.id],I=v.styleObj=x(y.style),L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=v.map=new h.Map({container:v.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!v.isStatic,preserveDrawingBuffer:v.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0})),N={};F.on("styleimagemissing",function(R){var U=R.id;if(!N[U]&&U.includes("-15")){N[U]=!0;var j=new Image(15,15);j.onload=function(){F.addImage(U,j)},j.crossOrigin="Anonymous",j.src="https://unpkg.com/maki@2.1.0/icons/"+U+".svg"}}),F.setTransformRequest(function(R){return R=R.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:R}}),F._canvas.style.left="0px",F._canvas.style.top="0px",v.rejectOnError(u),v.isStatic||v.initFx(_,w);var B=[];B.push(new Promise(function(R){F.once("load",R)})),B=B.concat(S.fetchTraceGeoData(_)),Promise.all(B).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var v=this,y=v.map,I=w[this.id];v.rejectOnError(u);var L=[],z=x(I.style);JSON.stringify(v.styleObj)!==JSON.stringify(z)&&(v.styleObj=z,y.setStyle(z.style),v.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,v,y,I=this.belowLookup={},L=!1;for(v=0;v<_.length;v++){var z=_[v][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(v=0;v1)for(v=0;v-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function v(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[v([F.xmin,F.ymin]),v([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(v)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,v;if(m.length!==u.length){for(v=0;vm/2){var u=A.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",h(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var v=1;w.width+6>m&&(v=m/(w.width+6));var y=[f.l+f.w*d.x[1],f.t+f.h*(1-d.y[0])];M.attr("transform",h(y[0],y[1])+b(v))}},$.updateFx=function(i){for(var a=i._fullLayout,s=a._subplots[n],f=0;f=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),fz=Ge({"src/traces/choroplethmap/index.js"($,G){G.exports={attributes:$C(),supplyDefaults:uz(),colorbar:bm(),calc:vE(),plot:cz(),hoverPoints:pE(),eventData:mE(),selectPoints:gE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+d[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),v=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),gz=Ge({"src/traces/densitymap/hover.js"($,G){var h=ws(),b=IE().hoverPoints,S=IE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),yz=Ge({"src/traces/densitymap/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),_z=Ge({"src/traces/densitymap/index.js"($,G){G.exports={attributes:QC(),supplyDefaults:vz(),colorbar:bm(),formatLabels:WC(),calc:dz(),plot:mz(),hoverPoints:gz(),eventData:yz(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;E0;){l=x[x.length-1];var A=b[l];if(r[l]=0&&n[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],m=[],u=0,M=g.length-1;M>=0;--M){var v=g[M];if(t[v]=!1,w.push(v),m.push(n[v]),u+=n[v].length,o[v]=s.length,v===l){g.length=M;break}}s.push(w);for(var y=new Array(u),M=0;M_&&(_=a.source[g]),a.target[g]>_&&(_=a.target[g]);var w=_+1;n.node._count=w;var m,u=n.node.groups,v={};for(g=0;g0&&e(N,w)&&e(B,w)&&!(v.hasOwnProperty(N)&&v.hasOwnProperty(B)&&v[N]===v[B])){v.hasOwnProperty(B)&&(B=v[B]),v.hasOwnProperty(N)&&(N=v[N]),N=+N,B=+B,d[N]=d[B]=!0;var R="";a.label&&a.label[g]&&(R=a.label[g]);var U=null;R&&T.hasOwnProperty(R)&&(U=T[R]),s.push({pointNumber:g,label:R,color:f?a.color[g]:a.color,hovercolor:c?a.hovercolor[g]:a.hovercolor,customdata:p?a.customdata[g]:a.customdata,concentrationscale:U,source:N,target:B,value:+F}),z.source.push(N),z.target.push(B)}}var j=w+u.length,Z=E(i.color),re=E(i.customdata),fe=[];for(g=0;gw-1,childrenNodes:[],pointNumber:g,label:le,color:Z?i.color[g]:i.color,customdata:re?i.customdata[g]:i.customdata})}var ce=!1;return o(j,z.source,z.target)&&(ce=!0),{circular:ce,links:s,nodes:fe,groups:u,groupLookup:v}}function o(n,i,a){for(var s=b.init2dArray(n,0),f=0;f1})}G.exports=function(i,a){var s=r(a);return S({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),Tz=Ge({"node_modules/d3-quadtree/dist/d3-quadtree.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=h||self,b(h.d3=h.d3||{}))})($,function(h){function b(w){var m=+this._x.call(null,w),u=+this._y.call(null,w);return S(this.cover(m,u),m,u,w)}function S(w,m,u,v){if(isNaN(m)||isNaN(u))return w;var y,I=w._root,L={data:v},z=w._x0,F=w._y0,N=w._x1,B=w._y1,R,U,j,Z,re,fe,le,ce;if(!I)return w._root=L,w;for(;I.length;)if((re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U,y=I,!(I=I[le=fe<<1|re]))return y[le]=L,w;if(j=+w._x.call(null,I.data),Z=+w._y.call(null,I.data),m===j&&u===Z)return L.next=I,y?y[le]=L:w._root=L,w;do y=y?y[le]=new Array(4):w._root=new Array(4),(re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U;while((le=fe<<1|re)===(ce=(Z>=U)<<1|j>=R));return y[ce]=I,y[le]=L,w}function E(w){var m,u,v=w.length,y,I,L=new Array(v),z=new Array(v),F=1/0,N=1/0,B=-1/0,R=-1/0;for(u=0;uB&&(B=y),IR&&(R=I));if(F>B||N>R)return this;for(this.cover(F,N).cover(B,R),u=0;uw||w>=y||v>m||m>=I;)switch(N=(mB||(z=Z.y0)>R||(F=Z.x1)=le)<<1|w>=fe)&&(Z=U[U.length-1],U[U.length-1]=U[U.length-1-re],U[U.length-1-re]=Z)}else{var ce=w-+this._x.call(null,j.data),V=m-+this._y.call(null,j.data),ee=ce*ce+V*V;if(ee=(U=(L+F)/2))?L=U:F=U,(re=R>=(j=(z+N)/2))?z=j:N=j,m=u,!(u=u[fe=re<<1|Z]))return this;if(!u.length)break;(m[fe+1&3]||m[fe+2&3]||m[fe+3&3])&&(v=m,le=fe)}for(;u.data!==w;)if(y=u,!(u=u.next))return this;return(I=u.next)&&delete u.next,y?(I?y.next=I:delete y.next,this):m?(I?m[fe]=I:delete m[fe],(u=m[0]||m[1]||m[2]||m[3])&&u===(m[3]||m[2]||m[1]||m[0])&&!u.length&&(v?v[le]=u:this._root=u),this):(this._root=I,this)}function a(w){for(var m=0,u=w.length;m=d.length)return l!=null&&_.sort(l),g!=null?g(_):_;for(var v=-1,y=_.length,I=d[w++],L,z,F=E(),N,B=m();++vd.length)return _;var m,u=T[w-1];return g!=null&&w>=d.length?m=_.entries():(m=[],_.each(function(v,y){m.push({key:y,values:M(v,w)})})),u!=null?m.sort(function(v,y){return u(v.key,y.key)}):m}return x={object:function(_){return A(_,0,t,r)},map:function(_){return A(_,0,o,n)},entries:function(_){return M(A(_,0,o,n),0)},key:function(_){return d.push(_),x},sortKeys:function(_){return T[d.length-1]=_,x},sortValues:function(_){return l=_,x},rollup:function(_){return g=_,x}}}function t(){return{}}function r(d,T,l){d[T]=l}function o(){return E()}function n(d,T,l){d.set(T,l)}function i(){}var a=E.prototype;i.prototype=s.prototype={constructor:i,has:a.has,add:function(d){return d+="",this[b+d]=d,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(d,T){var l=new i;if(d instanceof i)d.each(function(A){l.add(A)});else if(d){var g=-1,x=d.length;if(T==null)for(;++g=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}E.prototype=S.prototype={constructor:E,on:function(o,n){var i=this._,a=e(o+"",i),s,f=-1,c=a.length;if(arguments.length<2){for(;++f0)for(var i=new Array(s),a=0,s,f;a=0&&w._call.call(null,m),w=w._next;--b}function l(){n=(o=a.now())+i,b=S=0;try{T()}finally{b=0,x(),n=0}}function g(){var w=a.now(),m=w-o;m>e&&(i-=m,o=w)}function x(){for(var w,m=t,u,v=1/0;m;)m._call?(v>m._time&&(v=m._time),w=m,m=m._next):(u=m._next,m._next=null,m=w?w._next=u:t=u);r=w,A(v)}function A(w){if(!b){S&&(S=clearTimeout(S));var m=w-n;m>24?(w<1/0&&(S=setTimeout(l,w-a.now()-i)),E&&(E=clearInterval(E))):(E||(o=a.now(),E=setInterval(g,e)),b=1,s(l))}}function M(w,m,u){var v=new p;return m=m==null?0:+m,v.restart(function(y){v.stop(),w(y+m)},m,u),v}function _(w,m,u){var v=new p,y=m;return m==null?(v.restart(w,m,u),v):(m=+m,u=u==null?f():+u,v.restart(function I(L){L+=y,v.restart(I,y+=m,u),w(L)},m,u),v)}h.interval=_,h.now=f,h.timeout=M,h.timer=d,h.timerFlush=T,Object.defineProperty(h,"__esModule",{value:!0})})}}),Mz=Ge({"node_modules/d3-force/dist/d3-force.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,Tz(),zE(),Az(),Sz()):b(h.d3=h.d3||{},h.d3,h.d3,h.d3,h.d3)})($,function(h,b,S,E,e){function t(w,m){var u;w==null&&(w=0),m==null&&(m=0);function v(){var y,I=u.length,L,z=0,F=0;for(y=0;yR.index){var ae=U-ue.x-ue.vx,ie=j-ue.y-ue.vy,ve=ae*ae+ie*ie;veU+H||nej+H||KF.r&&(F.r=F[N].r)}function z(){if(m){var F,N=m.length,B;for(u=new Array(N),F=0;F1?(re==null?z.remove(Z):z.set(Z,j(re)),m):z.get(Z)},find:function(Z,re,fe){var le=0,ce=w.length,V,ee,ne,K,ue;for(fe==null?fe=1/0:fe*=fe,le=0;le1?(N.on(Z,re),m):N.on(Z)}}}function x(){var w,m,u,v=r(-30),y,I=1,L=1/0,z=.81;function F(U){var j,Z=w.length,re=b.quadtree(w,p,d).visitAfter(B);for(u=U,j=0;j=L)return;(U.data!==m||U.next)&&(fe===0&&(fe=o(),V+=fe*fe),le===0&&(le=o(),V+=le*le),VE)if(!(Math.abs(l*p-d*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=n);else{var x=i-f,A=a-c,M=p*p+d*d,_=x*x+A*A,w=Math.sqrt(M),m=Math.sqrt(g),u=s*Math.tan((b-Math.acos((M+g-_)/(2*w*m)))/2),v=u/m,y=u/w;Math.abs(v-1)>E&&(this._+="L"+(o+v*T)+","+(n+v*l)),this._+="A"+s+","+s+",0,0,"+ +(l*x>T*A)+","+(this._x1=o+y*p)+","+(this._y1=n+y*d)}},arc:function(o,n,i,a,s,f){o=+o,n=+n,i=+i,f=!!f;var c=i*Math.cos(a),p=i*Math.sin(a),d=o+c,T=n+p,l=1^f,g=f?a-s:s-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+d+","+T:(Math.abs(this._x1-d)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+d+","+T),i&&(g<0&&(g=g%S+S),g>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-c)+","+(n-p)+"A"+i+","+i+",0,1,"+l+","+(this._x1=d)+","+(this._y1=T):g>E&&(this._+="A"+i+","+i+",0,"+ +(g>=b)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=n+i*Math.sin(s))))},rect:function(o,n,i,a){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}},h.path=r,Object.defineProperty(h,"__esModule",{value:!0})})}}),rL=Ge({"node_modules/d3-shape/dist/d3-shape.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,Ez()):(h=h||self,b(h.d3=h.d3||{},h.d3))})($,function(h,b){function S(Tt){return function(){return Tt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,n=Math.sin,i=Math.sqrt,a=1e-12,s=Math.PI,f=s/2,c=2*s;function p(Tt){return Tt>1?0:Tt<-1?s:Math.acos(Tt)}function d(Tt){return Tt>=1?f:Tt<=-1?-f:Math.asin(Tt)}function T(Tt){return Tt.innerRadius}function l(Tt){return Tt.outerRadius}function g(Tt){return Tt.startAngle}function x(Tt){return Tt.endAngle}function A(Tt){return Tt&&Tt.padAngle}function M(Tt,or,Dr,ln,Pn,jn,Un,un){var Rn=Dr-Tt,di=ln-or,Ma=Un-Pn,Ei=un-jn,Hi=Ei*Rn-Ma*di;if(!(Hi*Hisl*sl+El*El&&(js=fs,ol=Zo),{cx:js,cy:ol,x01:-Ma,y01:-Ei,x11:js*(Pn/Jo-1),y11:ol*(Pn/Jo-1)}}function w(){var Tt=T,or=l,Dr=S(0),ln=null,Pn=g,jn=x,Un=A,un=null;function Rn(){var di,Ma,Ei=+Tt.apply(this,arguments),Hi=+or.apply(this,arguments),io=Pn.apply(this,arguments)-f,no=jn.apply(this,arguments)-f,bo=E(no-io),li=no>io;if(un||(un=di=b.path()),Hia))un.moveTo(0,0);else if(bo>c-a)un.moveTo(Hi*t(io),Hi*n(io)),un.arc(0,0,Hi,io,no,!li),Ei>a&&(un.moveTo(Ei*t(no),Ei*n(no)),un.arc(0,0,Ei,no,io,li));else{var ts=io,Ho=no,Gs=io,cs=no,Jo=bo,Uo=bo,Xs=Un.apply(this,arguments)/2,js=Xs>a&&(ln?+ln.apply(this,arguments):i(Ei*Ei+Hi*Hi)),ol=o(E(Hi-Ei)/2,+Dr.apply(this,arguments)),fs=ol,Zo=ol,ho,hs;if(js>a){var sl=d(js/Ei*n(Xs)),El=d(js/Hi*n(Xs));(Jo-=sl*2)>a?(sl*=li?1:-1,Gs+=sl,cs-=sl):(Jo=0,Gs=cs=(io+no)/2),(Uo-=El*2)>a?(El*=li?1:-1,ts+=El,Ho-=El):(Uo=0,ts=Ho=(io+no)/2)}var Ll=Hi*t(ts),Es=Hi*n(ts),ci=Ei*t(cs),Ji=Ei*n(cs);if(ol>a){var kl=Hi*t(Ho),Rs=Hi*n(Ho),zo=Ei*t(Gs),Pl=Ei*n(Gs),Ys;if(boa?Zo>a?(ho=_(zo,Pl,Ll,Es,Hi,Zo,li),hs=_(kl,Rs,ci,Ji,Hi,Zo,li),un.moveTo(ho.cx+ho.x01,ho.cy+ho.y01),Zoa)||!(Jo>a)?un.lineTo(ci,Ji):fs>a?(ho=_(ci,Ji,kl,Rs,Ei,-fs,li),hs=_(Ll,Es,zo,Pl,Ei,-fs,li),un.lineTo(ho.cx+ho.x01,ho.cy+ho.y01),fs=Hi;--io)un.point(Ho[io],Gs[io]);un.lineEnd(),un.areaEnd()}li&&(Ho[Ei]=+Tt(bo,Ei,Ma),Gs[Ei]=+Dr(bo,Ei,Ma),un.point(or?+or(bo,Ei,Ma):Ho[Ei],ln?+ln(bo,Ei,Ma):Gs[Ei]))}if(ts)return un=null,ts+""||null}function di(){return I().defined(Pn).curve(Un).context(jn)}return Rn.x=function(Ma){return arguments.length?(Tt=typeof Ma=="function"?Ma:S(+Ma),or=null,Rn):Tt},Rn.x0=function(Ma){return arguments.length?(Tt=typeof Ma=="function"?Ma:S(+Ma),Rn):Tt},Rn.x1=function(Ma){return arguments.length?(or=Ma==null?null:typeof Ma=="function"?Ma:S(+Ma),Rn):or},Rn.y=function(Ma){return arguments.length?(Dr=typeof Ma=="function"?Ma:S(+Ma),ln=null,Rn):Dr},Rn.y0=function(Ma){return arguments.length?(Dr=typeof Ma=="function"?Ma:S(+Ma),Rn):Dr},Rn.y1=function(Ma){return arguments.length?(ln=Ma==null?null:typeof Ma=="function"?Ma:S(+Ma),Rn):ln},Rn.lineX0=Rn.lineY0=function(){return di().x(Tt).y(Dr)},Rn.lineY1=function(){return di().x(Tt).y(ln)},Rn.lineX1=function(){return di().x(or).y(Dr)},Rn.defined=function(Ma){return arguments.length?(Pn=typeof Ma=="function"?Ma:S(!!Ma),Rn):Pn},Rn.curve=function(Ma){return arguments.length?(Un=Ma,jn!=null&&(un=Un(jn)),Rn):Un},Rn.context=function(Ma){return arguments.length?(Ma==null?jn=un=null:un=Un(jn=Ma),Rn):jn},Rn}function z(Tt,or){return orTt?1:or>=Tt?0:NaN}function F(Tt){return Tt}function N(){var Tt=F,or=z,Dr=null,ln=S(0),Pn=S(c),jn=S(0);function Un(un){var Rn,di=un.length,Ma,Ei,Hi=0,io=new Array(di),no=new Array(di),bo=+ln.apply(this,arguments),li=Math.min(c,Math.max(-c,Pn.apply(this,arguments)-bo)),ts,Ho=Math.min(Math.abs(li)/di,jn.apply(this,arguments)),Gs=Ho*(li<0?-1:1),cs;for(Rn=0;Rn0&&(Hi+=cs);for(or!=null?io.sort(function(Jo,Uo){return or(no[Jo],no[Uo])}):Dr!=null&&io.sort(function(Jo,Uo){return Dr(un[Jo],un[Uo])}),Rn=0,Ei=Hi?(li-di*Gs)/Hi:0;Rn0?cs*Ei:0)+Gs,no[Ma]={data:un[Ma],index:Rn,value:cs,startAngle:bo,endAngle:ts,padAngle:Ho};return no}return Un.value=function(un){return arguments.length?(Tt=typeof un=="function"?un:S(+un),Un):Tt},Un.sortValues=function(un){return arguments.length?(or=un,Dr=null,Un):or},Un.sort=function(un){return arguments.length?(Dr=un,or=null,Un):Dr},Un.startAngle=function(un){return arguments.length?(ln=typeof un=="function"?un:S(+un),Un):ln},Un.endAngle=function(un){return arguments.length?(Pn=typeof un=="function"?un:S(+un),Un):Pn},Un.padAngle=function(un){return arguments.length?(jn=typeof un=="function"?un:S(+un),Un):jn},Un}var B=U(u);function R(Tt){this._curve=Tt}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Tt,or){this._curve.point(or*Math.sin(Tt),or*-Math.cos(Tt))}};function U(Tt){function or(Dr){return new R(Tt(Dr))}return or._curve=Tt,or}function j(Tt){var or=Tt.curve;return Tt.angle=Tt.x,delete Tt.x,Tt.radius=Tt.y,delete Tt.y,Tt.curve=function(Dr){return arguments.length?or(U(Dr)):or()._curve},Tt}function Z(){return j(I().curve(B))}function re(){var Tt=L().curve(B),or=Tt.curve,Dr=Tt.lineX0,ln=Tt.lineX1,Pn=Tt.lineY0,jn=Tt.lineY1;return Tt.angle=Tt.x,delete Tt.x,Tt.startAngle=Tt.x0,delete Tt.x0,Tt.endAngle=Tt.x1,delete Tt.x1,Tt.radius=Tt.y,delete Tt.y,Tt.innerRadius=Tt.y0,delete Tt.y0,Tt.outerRadius=Tt.y1,delete Tt.y1,Tt.lineStartAngle=function(){return j(Dr())},delete Tt.lineX0,Tt.lineEndAngle=function(){return j(ln())},delete Tt.lineX1,Tt.lineInnerRadius=function(){return j(Pn())},delete Tt.lineY0,Tt.lineOuterRadius=function(){return j(jn())},delete Tt.lineY1,Tt.curve=function(Un){return arguments.length?or(U(Un)):or()._curve},Tt}function fe(Tt,or){return[(or=+or)*Math.cos(Tt-=Math.PI/2),or*Math.sin(Tt)]}var le=Array.prototype.slice;function ce(Tt){return Tt.source}function V(Tt){return Tt.target}function ee(Tt){var or=ce,Dr=V,ln=v,Pn=y,jn=null;function Un(){var un,Rn=le.call(arguments),di=or.apply(this,Rn),Ma=Dr.apply(this,Rn);if(jn||(jn=un=b.path()),Tt(jn,+ln.apply(this,(Rn[0]=di,Rn)),+Pn.apply(this,Rn),+ln.apply(this,(Rn[0]=Ma,Rn)),+Pn.apply(this,Rn)),un)return jn=null,un+""||null}return Un.source=function(un){return arguments.length?(or=un,Un):or},Un.target=function(un){return arguments.length?(Dr=un,Un):Dr},Un.x=function(un){return arguments.length?(ln=typeof un=="function"?un:S(+un),Un):ln},Un.y=function(un){return arguments.length?(Pn=typeof un=="function"?un:S(+un),Un):Pn},Un.context=function(un){return arguments.length?(jn=un??null,Un):jn},Un}function ne(Tt,or,Dr,ln,Pn){Tt.moveTo(or,Dr),Tt.bezierCurveTo(or=(or+ln)/2,Dr,or,Pn,ln,Pn)}function K(Tt,or,Dr,ln,Pn){Tt.moveTo(or,Dr),Tt.bezierCurveTo(or,Dr=(Dr+Pn)/2,ln,Dr,ln,Pn)}function ue(Tt,or,Dr,ln,Pn){var jn=fe(or,Dr),Un=fe(or,Dr=(Dr+Pn)/2),un=fe(ln,Dr),Rn=fe(ln,Pn);Tt.moveTo(jn[0],jn[1]),Tt.bezierCurveTo(Un[0],Un[1],un[0],un[1],Rn[0],Rn[1])}function te(){return ee(ne)}function H(){return ee(K)}function ae(){var Tt=ee(ue);return Tt.angle=Tt.x,delete Tt.x,Tt.radius=Tt.y,delete Tt.y,Tt}var ie={draw:function(Tt,or){var Dr=Math.sqrt(or/s);Tt.moveTo(Dr,0),Tt.arc(0,0,Dr,0,c)}},ve={draw:function(Tt,or){var Dr=Math.sqrt(or/5)/2;Tt.moveTo(-3*Dr,-Dr),Tt.lineTo(-Dr,-Dr),Tt.lineTo(-Dr,-3*Dr),Tt.lineTo(Dr,-3*Dr),Tt.lineTo(Dr,-Dr),Tt.lineTo(3*Dr,-Dr),Tt.lineTo(3*Dr,Dr),Tt.lineTo(Dr,Dr),Tt.lineTo(Dr,3*Dr),Tt.lineTo(-Dr,3*Dr),Tt.lineTo(-Dr,Dr),Tt.lineTo(-3*Dr,Dr),Tt.closePath()}},Ae=Math.sqrt(1/3),Ce=Ae*2,Fe={draw:function(Tt,or){var Dr=Math.sqrt(or/Ce),ln=Dr*Ae;Tt.moveTo(0,-Dr),Tt.lineTo(ln,0),Tt.lineTo(0,Dr),Tt.lineTo(-ln,0),Tt.closePath()}},ze=.8908130915292852,Ye=Math.sin(s/10)/Math.sin(7*s/10),it=Math.sin(c/10)*Ye,st=-Math.cos(c/10)*Ye,nt={draw:function(Tt,or){var Dr=Math.sqrt(or*ze),ln=it*Dr,Pn=st*Dr;Tt.moveTo(0,-Dr),Tt.lineTo(ln,Pn);for(var jn=1;jn<5;++jn){var Un=c*jn/5,un=Math.cos(Un),Rn=Math.sin(Un);Tt.lineTo(Rn*Dr,-un*Dr),Tt.lineTo(un*ln-Rn*Pn,Rn*ln+un*Pn)}Tt.closePath()}},Qe={draw:function(Tt,or){var Dr=Math.sqrt(or),ln=-Dr/2;Tt.rect(ln,ln,Dr,Dr)}},Le=Math.sqrt(3),Te={draw:function(Tt,or){var Dr=-Math.sqrt(or/(Le*3));Tt.moveTo(0,Dr*2),Tt.lineTo(-Le*Dr,-Dr),Tt.lineTo(Le*Dr,-Dr),Tt.closePath()}},pe=-.5,Ne=Math.sqrt(3)/2,ot=1/Math.sqrt(12),ct=(ot/2+1)*3,rt={draw:function(Tt,or){var Dr=Math.sqrt(or/ct),ln=Dr/2,Pn=Dr*ot,jn=ln,Un=Dr*ot+Dr,un=-jn,Rn=Un;Tt.moveTo(ln,Pn),Tt.lineTo(jn,Un),Tt.lineTo(un,Rn),Tt.lineTo(pe*ln-Ne*Pn,Ne*ln+pe*Pn),Tt.lineTo(pe*jn-Ne*Un,Ne*jn+pe*Un),Tt.lineTo(pe*un-Ne*Rn,Ne*un+pe*Rn),Tt.lineTo(pe*ln+Ne*Pn,pe*Pn-Ne*ln),Tt.lineTo(pe*jn+Ne*Un,pe*Un-Ne*jn),Tt.lineTo(pe*un+Ne*Rn,pe*Rn-Ne*un),Tt.closePath()}},Ft=[ie,ve,Fe,Qe,nt,Te,rt];function Nt(){var Tt=S(ie),or=S(64),Dr=null;function ln(){var Pn;if(Dr||(Dr=Pn=b.path()),Tt.apply(this,arguments).draw(Dr,+or.apply(this,arguments)),Pn)return Dr=null,Pn+""||null}return ln.type=function(Pn){return arguments.length?(Tt=typeof Pn=="function"?Pn:S(Pn),ln):Tt},ln.size=function(Pn){return arguments.length?(or=typeof Pn=="function"?Pn:S(+Pn),ln):or},ln.context=function(Pn){return arguments.length?(Dr=Pn??null,ln):Dr},ln}function $t(){}function rr(Tt,or,Dr){Tt._context.bezierCurveTo((2*Tt._x0+Tt._x1)/3,(2*Tt._y0+Tt._y1)/3,(Tt._x0+2*Tt._x1)/3,(Tt._y0+2*Tt._y1)/3,(Tt._x0+4*Tt._x1+or)/6,(Tt._y0+4*Tt._y1+Dr)/6)}function Mr(Tt){this._context=Tt}Mr.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:rr(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(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(Tt,or):this._context.moveTo(Tt,or);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:rr(this,Tt,or);break}this._x0=this._x1,this._x1=Tt,this._y0=this._y1,this._y1=or}};function Sr(Tt){return new Mr(Tt)}function Zr(Tt){this._context=Tt}Zr.prototype={areaStart:$t,areaEnd:$t,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(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1,this._x2=Tt,this._y2=or;break;case 1:this._point=2,this._x3=Tt,this._y3=or;break;case 2:this._point=3,this._x4=Tt,this._y4=or,this._context.moveTo((this._x0+4*this._x1+Tt)/6,(this._y0+4*this._y1+or)/6);break;default:rr(this,Tt,or);break}this._x0=this._x1,this._x1=Tt,this._y0=this._y1,this._y1=or}};function Ar(Tt){return new Zr(Tt)}function Br(Tt){this._context=Tt}Br.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(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Dr=(this._x0+4*this._x1+Tt)/6,ln=(this._y0+4*this._y1+or)/6;this._line?this._context.lineTo(Dr,ln):this._context.moveTo(Dr,ln);break;case 3:this._point=4;default:rr(this,Tt,or);break}this._x0=this._x1,this._x1=Tt,this._y0=this._y1,this._y1=or}};function Mt(Tt){return new Br(Tt)}function je(Tt,or){this._basis=new Mr(Tt),this._beta=or}je.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Tt=this._x,or=this._y,Dr=Tt.length-1;if(Dr>0)for(var ln=Tt[0],Pn=or[0],jn=Tt[Dr]-ln,Un=or[Dr]-Pn,un=-1,Rn;++un<=Dr;)Rn=un/Dr,this._basis.point(this._beta*Tt[un]+(1-this._beta)*(ln+Rn*jn),this._beta*or[un]+(1-this._beta)*(Pn+Rn*Un));this._x=this._y=null,this._basis.lineEnd()},point:function(Tt,or){this._x.push(+Tt),this._y.push(+or)}};var $e=(function Tt(or){function Dr(ln){return or===1?new Mr(ln):new je(ln,or)}return Dr.beta=function(ln){return Tt(+ln)},Dr})(.85);function Ee(Tt,or,Dr){Tt._context.bezierCurveTo(Tt._x1+Tt._k*(Tt._x2-Tt._x0),Tt._y1+Tt._k*(Tt._y2-Tt._y0),Tt._x2+Tt._k*(Tt._x1-or),Tt._y2+Tt._k*(Tt._y1-Dr),Tt._x2,Tt._y2)}function xe(Tt,or){this._context=Tt,this._k=(1-or)/6}xe.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:Ee(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(Tt,or):this._context.moveTo(Tt,or);break;case 1:this._point=2,this._x1=Tt,this._y1=or;break;case 2:this._point=3;default:Ee(this,Tt,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var ye=(function Tt(or){function Dr(ln){return new xe(ln,or)}return Dr.tension=function(ln){return Tt(+ln)},Dr})(0);function Me(Tt,or){this._context=Tt,this._k=(1-or)/6}Me.prototype={areaStart:$t,areaEnd:$t,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(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1,this._x3=Tt,this._y3=or;break;case 1:this._point=2,this._context.moveTo(this._x4=Tt,this._y4=or);break;case 2:this._point=3,this._x5=Tt,this._y5=or;break;default:Ee(this,Tt,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Xe=(function Tt(or){function Dr(ln){return new Me(ln,or)}return Dr.tension=function(ln){return Tt(+ln)},Dr})(0);function Je(Tt,or){this._context=Tt,this._k=(1-or)/6}Je.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(Tt,or){switch(Tt=+Tt,or=+or,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:Ee(this,Tt,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Lt=(function Tt(or){function Dr(ln){return new Je(ln,or)}return Dr.tension=function(ln){return Tt(+ln)},Dr})(0);function Ct(Tt,or,Dr){var ln=Tt._x1,Pn=Tt._y1,jn=Tt._x2,Un=Tt._y2;if(Tt._l01_a>a){var un=2*Tt._l01_2a+3*Tt._l01_a*Tt._l12_a+Tt._l12_2a,Rn=3*Tt._l01_a*(Tt._l01_a+Tt._l12_a);ln=(ln*un-Tt._x0*Tt._l12_2a+Tt._x2*Tt._l01_2a)/Rn,Pn=(Pn*un-Tt._y0*Tt._l12_2a+Tt._y2*Tt._l01_2a)/Rn}if(Tt._l23_a>a){var di=2*Tt._l23_2a+3*Tt._l23_a*Tt._l12_a+Tt._l12_2a,Ma=3*Tt._l23_a*(Tt._l23_a+Tt._l12_a);jn=(jn*di+Tt._x1*Tt._l23_2a-or*Tt._l12_2a)/Ma,Un=(Un*di+Tt._y1*Tt._l23_2a-Dr*Tt._l12_2a)/Ma}Tt._context.bezierCurveTo(ln,Pn,jn,Un,Tt._x2,Tt._y2)}function Ot(Tt,or){this._context=Tt,this._alpha=or}Ot.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(Tt,or){if(Tt=+Tt,or=+or,this._point){var Dr=this._x2-Tt,ln=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+ln*ln,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Tt,or):this._context.moveTo(Tt,or);break;case 1:this._point=2;break;case 2:this._point=3;default:Ct(this,Tt,or);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=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Wt=(function Tt(or){function Dr(ln){return or?new Ot(ln,or):new xe(ln,0)}return Dr.alpha=function(ln){return Tt(+ln)},Dr})(.5);function _r(Tt,or){this._context=Tt,this._alpha=or}_r.prototype={areaStart:$t,areaEnd:$t,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(Tt,or){if(Tt=+Tt,or=+or,this._point){var Dr=this._x2-Tt,ln=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+ln*ln,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Tt,this._y3=or;break;case 1:this._point=2,this._context.moveTo(this._x4=Tt,this._y4=or);break;case 2:this._point=3,this._x5=Tt,this._y5=or;break;default:Ct(this,Tt,or);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=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var pr=(function Tt(or){function Dr(ln){return or?new _r(ln,or):new Me(ln,0)}return Dr.alpha=function(ln){return Tt(+ln)},Dr})(.5);function hr(Tt,or){this._context=Tt,this._alpha=or}hr.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(Tt,or){if(Tt=+Tt,or=+or,this._point){var Dr=this._x2-Tt,ln=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+ln*ln,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:Ct(this,Tt,or);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=Tt,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Fr=(function Tt(or){function Dr(ln){return or?new hr(ln,or):new Je(ln,0)}return Dr.alpha=function(ln){return Tt(+ln)},Dr})(.5);function En(Tt){this._context=Tt}En.prototype={areaStart:$t,areaEnd:$t,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(Tt,or){Tt=+Tt,or=+or,this._point?this._context.lineTo(Tt,or):(this._point=1,this._context.moveTo(Tt,or))}};function Zn(Tt){return new En(Tt)}function qn(Tt){return Tt<0?-1:1}function ta(Tt,or,Dr){var ln=Tt._x1-Tt._x0,Pn=or-Tt._x1,jn=(Tt._y1-Tt._y0)/(ln||Pn<0&&-0),Un=(Dr-Tt._y1)/(Pn||ln<0&&-0),un=(jn*Pn+Un*ln)/(ln+Pn);return(qn(jn)+qn(Un))*Math.min(Math.abs(jn),Math.abs(Un),.5*Math.abs(un))||0}function ra(Tt,or){var Dr=Tt._x1-Tt._x0;return Dr?(3*(Tt._y1-Tt._y0)/Dr-or)/2:or}function Nn(Tt,or,Dr){var ln=Tt._x0,Pn=Tt._y0,jn=Tt._x1,Un=Tt._y1,un=(jn-ln)/3;Tt._context.bezierCurveTo(ln+un,Pn+un*or,jn-un,Un-un*Dr,jn,Un)}function Ea(Tt){this._context=Tt}Ea.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:Nn(this,this._t0,ra(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Tt,or){var Dr=NaN;if(Tt=+Tt,or=+or,!(Tt===this._x1&&or===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Tt,or):this._context.moveTo(Tt,or);break;case 1:this._point=2;break;case 2:this._point=3,Nn(this,ra(this,Dr=ta(this,Tt,or)),Dr);break;default:Nn(this,this._t0,Dr=ta(this,Tt,or));break}this._x0=this._x1,this._x1=Tt,this._y0=this._y1,this._y1=or,this._t0=Dr}}};function ja(Tt){this._context=new ir(Tt)}(ja.prototype=Object.create(Ea.prototype)).point=function(Tt,or){Ea.prototype.point.call(this,or,Tt)};function ir(Tt){this._context=Tt}ir.prototype={moveTo:function(Tt,or){this._context.moveTo(or,Tt)},closePath:function(){this._context.closePath()},lineTo:function(Tt,or){this._context.lineTo(or,Tt)},bezierCurveTo:function(Tt,or,Dr,ln,Pn,jn){this._context.bezierCurveTo(or,Tt,ln,Dr,jn,Pn)}};function qt(Tt){return new Ea(Tt)}function ar(Tt){return new ja(Tt)}function sr(Tt){this._context=Tt}sr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var Tt=this._x,or=this._y,Dr=Tt.length;if(Dr)if(this._line?this._context.lineTo(Tt[0],or[0]):this._context.moveTo(Tt[0],or[0]),Dr===2)this._context.lineTo(Tt[1],or[1]);else for(var ln=Vr(Tt),Pn=Vr(or),jn=0,Un=1;Un=0;--or)Pn[or]=(Un[or]-Pn[or+1])/jn[or];for(jn[Dr-1]=(Tt[Dr]+Pn[Dr-1])/2,or=0;or=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(Tt,or){switch(Tt=+Tt,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(Tt,or):this._context.moveTo(Tt,or);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,or),this._context.lineTo(Tt,or);else{var Dr=this._x*(1-this._t)+Tt*this._t;this._context.lineTo(Dr,this._y),this._context.lineTo(Dr,or)}break}}this._x=Tt,this._y=or}};function wn(Tt){return new pn(Tt,.5)}function Kn(Tt){return new pn(Tt,0)}function da(Tt){return new pn(Tt,1)}function fa(Tt,or){if((Un=Tt.length)>1)for(var Dr=1,ln,Pn,jn=Tt[or[0]],Un,un=jn.length;Dr=0;)Dr[or]=or;return Dr}function ka(Tt,or){return Tt[or]}function Vn(){var Tt=S([]),or=ga,Dr=fa,ln=ka;function Pn(jn){var Un=Tt.apply(this,arguments),un,Rn=jn.length,di=Un.length,Ma=new Array(di),Ei;for(un=0;un0){for(var Dr,ln,Pn=0,jn=Tt[0].length,Un;Pn0)for(var Dr,ln=0,Pn,jn,Un,un,Rn,di=Tt[or[0]].length;ln0?(Pn[0]=Un,Pn[1]=Un+=jn):jn<0?(Pn[1]=un,Pn[0]=un+=jn):(Pn[0]=0,Pn[1]=jn)}function Dt(Tt,or){if((Pn=Tt.length)>0){for(var Dr=0,ln=Tt[or[0]],Pn,jn=ln.length;Dr0)||!((jn=(Pn=Tt[or[0]]).length)>0))){for(var Dr=0,ln=1,Pn,jn,Un;lnjn&&(jn=Pn,Dr=or);return Dr}function jr(Tt){var or=Tt.map(Ir);return ga(Tt).sort(function(Dr,ln){return or[Dr]-or[ln]})}function Ir(Tt){for(var or=0,Dr=-1,ln=Tt.length,Pn;++Dr0;--ue)ae(K*=.99),ie(),H(K),ie();function te(){var ve=b.max(ne,function(Fe){return Fe.length}),Ae=j*(I-v)/(ve-1);z>Ae&&(z=Ae);var Ce=b.min(ne,function(Fe){return(I-v-(Fe.length-1)*z)/b.sum(Fe,c)});ne.forEach(function(Fe){Fe.forEach(function(ze,Ye){ze.y1=(ze.y0=Ye)+ze.value*Ce})}),ee.links.forEach(function(Fe){Fe.width=Fe.value*Ce})}function H(ve){ne.forEach(function(Ae){Ae.forEach(function(Ce){if(Ce.targetLinks.length){var Fe=(b.sum(Ce.targetLinks,d)/b.sum(Ce.targetLinks,c)-p(Ce))*ve;Ce.y0+=Fe,Ce.y1+=Fe}})})}function ae(ve){ne.slice().reverse().forEach(function(Ae){Ae.forEach(function(Ce){if(Ce.sourceLinks.length){var Fe=(b.sum(Ce.sourceLinks,T)/b.sum(Ce.sourceLinks,c)-p(Ce))*ve;Ce.y0+=Fe,Ce.y1+=Fe}})})}function ie(){ne.forEach(function(ve){var Ae,Ce,Fe=v,ze=ve.length,Ye;for(ve.sort(f),Ye=0;Ye0&&(Ae.y0+=Ce,Ae.y1+=Ce),Fe=Ae.y1+z;if(Ce=Fe-z-I,Ce>0)for(Fe=Ae.y0-=Ce,Ae.y1-=Ce,Ye=ze-2;Ye>=0;--Ye)Ae=ve[Ye],Ce=Ae.y1+z-Fe,Ce>0&&(Ae.y0-=Ce,Ae.y1-=Ce),Fe=Ae.y0})}}function V(ee){ee.nodes.forEach(function(ne){ne.sourceLinks.sort(s),ne.targetLinks.sort(a)}),ee.nodes.forEach(function(ne){var K=ne.y0,ue=K;ne.sourceLinks.forEach(function(te){te.y0=K+te.width/2,K+=te.width}),ne.targetLinks.forEach(function(te){te.y1=ue+te.width/2,ue+=te.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var m=function(){return E.linkHorizontal().source(_).target(w)};h.sankey=M,h.sankeyCenter=n,h.sankeyLeft=t,h.sankeyRight=r,h.sankeyJustify=o,h.sankeyLinkHorizontal=m,Object.defineProperty(h,"__esModule",{value:!0})})}}),Cz=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"($,G){var h=tL();G.exports=function(S,E){var e=[],t=[],r=[],o={},n=[],i;function a(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(M){delete o[A][M],r[M]&&a(M)})}function s(A){var M=!1;t.push(A),r[A]=!0;var _,w;for(_=0;_=A})}function p(A){c(A);for(var M=S,_=h(M),w=_.components.filter(function(z){return z.length>1}),m=1/0,u,v=0;v"u"?"undefined":s(xe))!=="object"&&(xe=$e.source=_(je,xe)),(typeof ye>"u"?"undefined":s(ye))!=="object"&&(ye=$e.target=_(je,ye)),xe.sourceLinks.push($e),ye.targetLinks.push($e)}),Mt}function rr(Mt){Mt.nodes.forEach(function(je){je.partOfCycle=!1,je.value=Math.max(b.sum(je.sourceLinks,d),b.sum(je.targetLinks,d)),je.sourceLinks.forEach(function($e){$e.circular&&(je.partOfCycle=!0,je.circularLinkType=$e.circularLinkType)}),je.targetLinks.forEach(function($e){$e.circular&&(je.partOfCycle=!0,je.circularLinkType=$e.circularLinkType)})})}function Mr(Mt){var je=0,$e=0,Ee=0,xe=0,ye=b.max(Mt.nodes,function(Me){return Me.column});return Mt.links.forEach(function(Me){Me.circular&&(Me.circularLinkType=="top"?je=je+Me.width:$e=$e+Me.width,Me.target.column==0&&(xe=xe+Me.width),Me.source.column==ye&&(Ee=Ee+Me.width))}),je=je>0?je+m+u:je,$e=$e>0?$e+m+u:$e,Ee=Ee>0?Ee+m+u:Ee,xe=xe>0?xe+m+u:xe,{top:je,bottom:$e,left:xe,right:Ee}}function Sr(Mt,je){var $e=b.max(Mt.nodes,function(Lt){return Lt.column}),Ee=it-ze,xe=st-Ye,ye=Ee+je.right+je.left,Me=xe+je.top+je.bottom,Xe=Ee/ye,Je=xe/Me;return ze=ze*Xe+je.left,it=je.right==0?it:it*Xe,Ye=Ye*Je+je.top,st=st*Je,Mt.nodes.forEach(function(Lt){Lt.x0=ze+Lt.column*((it-ze-nt)/$e),Lt.x1=Lt.x0+nt}),Je}function Zr(Mt){var je,$e,Ee;for(je=Mt.nodes,$e=[],Ee=0;je.length;++Ee,je=$e,$e=[])je.forEach(function(xe){xe.depth=Ee,xe.sourceLinks.forEach(function(ye){$e.indexOf(ye.target)<0&&!ye.circular&&$e.push(ye.target)})});for(je=Mt.nodes,$e=[],Ee=0;je.length;++Ee,je=$e,$e=[])je.forEach(function(xe){xe.height=Ee,xe.targetLinks.forEach(function(ye){$e.indexOf(ye.source)<0&&!ye.circular&&$e.push(ye.source)})});Mt.nodes.forEach(function(xe){xe.column=Math.floor(Te.call(null,xe,Ee))})}function Ar(Mt,je,$e){var Ee=S.nest().key(function(Lt){return Lt.column}).sortKeys(b.ascending).entries(Mt.nodes).map(function(Lt){return Lt.values});Me($e),Je();for(var xe=1,ye=je;ye>0;--ye)Xe(xe*=.99,$e),Je();function Me(Lt){if(rt){var Ct=1/0;Ee.forEach(function(pr){var hr=st*rt/(pr.length+1);Ct=hr0))if(pr==0&&_r==1)Fr=hr.y1-hr.y0,hr.y0=st/2-Fr/2,hr.y1=st/2+Fr/2;else if(pr==Ot-1&&_r==1)Fr=hr.y1-hr.y0,hr.y0=st/2-Fr/2,hr.y1=st/2+Fr/2;else{var En=0,Zn=b.mean(hr.sourceLinks,g),qn=b.mean(hr.targetLinks,l);Zn&&qn?En=(Zn+qn)/2:En=Zn||qn;var ta=(En-T(hr))*Lt;hr.y0+=ta,hr.y1+=ta}})})}function Je(){Ee.forEach(function(Lt){var Ct,Ot,Wt=Ye,_r=Lt.length,pr;for(Lt.sort(p),pr=0;pr<_r;++pr)Ct=Lt[pr],Ot=Wt-Ct.y0,Ot>0&&(Ct.y0+=Ot,Ct.y1+=Ot),Wt=Ct.y1+Qe;if(Ot=Wt-Qe-st,Ot>0)for(Wt=Ct.y0-=Ot,Ct.y1-=Ot,pr=_r-2;pr>=0;--pr)Ct=Lt[pr],Ot=Ct.y1+Qe-Wt,Ot>0&&(Ct.y0-=Ot,Ct.y1-=Ot),Wt=Ct.y0})}}function Br(Mt){Mt.nodes.forEach(function(je){je.sourceLinks.sort(c),je.targetLinks.sort(f)}),Mt.nodes.forEach(function(je){var $e=je.y0,Ee=$e,xe=je.y1,ye=xe;je.sourceLinks.forEach(function(Me){Me.circular?(Me.y0=xe-Me.width/2,xe=xe-Me.width):(Me.y0=$e+Me.width/2,$e+=Me.width)}),je.targetLinks.forEach(function(Me){Me.circular?(Me.y1=ye-Me.width/2,ye=ye-Me.width):(Me.y1=Ee+Me.width/2,Ee+=Me.width)})})}return Nt}function I(ze,Ye,it){var st=0;if(it===null){for(var nt=[],Qe=0;QeYe.source.column)}function N(ze,Ye){var it=0;ze.sourceLinks.forEach(function(nt){it=nt.circular&&!Ce(nt,Ye)?it+1:it});var st=0;return ze.targetLinks.forEach(function(nt){st=nt.circular&&!Ce(nt,Ye)?st+1:st}),it+st}function B(ze){var Ye=ze.source.sourceLinks,it=0;Ye.forEach(function(Qe){it=Qe.circular?it+1:it});var st=ze.target.targetLinks,nt=0;return st.forEach(function(Qe){nt=Qe.circular?nt+1:nt}),!(it>1||nt>1)}function R(ze,Ye,it){return ze.sort(Z),ze.forEach(function(st,nt){var Qe=0;if(Ce(st,it)&&B(st))st.circularPathData.verticalBuffer=Qe+st.width/2;else{var Le=0;for(Le;LeQe?Te:Qe}st.circularPathData.verticalBuffer=Qe+st.width/2}}),ze}function U(ze,Ye,it,st){var nt=5,Qe=b.min(ze.links,function(pe){return pe.source.y0});ze.links.forEach(function(pe){pe.circular&&(pe.circularPathData={})});var Le=ze.links.filter(function(pe){return pe.circularLinkType=="top"});R(Le,Ye,st);var Te=ze.links.filter(function(pe){return pe.circularLinkType=="bottom"});R(Te,Ye,st),ze.links.forEach(function(pe){if(pe.circular){if(pe.circularPathData.arcRadius=pe.width+u,pe.circularPathData.leftNodeBuffer=nt,pe.circularPathData.rightNodeBuffer=nt,pe.circularPathData.sourceWidth=pe.source.x1-pe.source.x0,pe.circularPathData.sourceX=pe.source.x0+pe.circularPathData.sourceWidth,pe.circularPathData.targetX=pe.target.x0,pe.circularPathData.sourceY=pe.y0,pe.circularPathData.targetY=pe.y1,Ce(pe,st)&&B(pe))pe.circularPathData.leftSmallArcRadius=u+pe.width/2,pe.circularPathData.leftLargeArcRadius=u+pe.width/2,pe.circularPathData.rightSmallArcRadius=u+pe.width/2,pe.circularPathData.rightLargeArcRadius=u+pe.width/2,pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=pe.source.y1+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=pe.source.y0-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius);else{var Ne=pe.source.column,ot=pe.circularLinkType,ct=ze.links.filter(function(Nt){return Nt.source.column==Ne&&Nt.circularLinkType==ot});pe.circularLinkType=="bottom"?ct.sort(fe):ct.sort(re);var rt=0;ct.forEach(function(Nt,$t){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.leftSmallArcRadius=u+pe.width/2+rt,pe.circularPathData.leftLargeArcRadius=u+pe.width/2+$t*Ye+rt),rt=rt+Nt.width}),Ne=pe.target.column,ct=ze.links.filter(function(Nt){return Nt.target.column==Ne&&Nt.circularLinkType==ot}),pe.circularLinkType=="bottom"?ct.sort(ce):ct.sort(le),rt=0,ct.forEach(function(Nt,$t){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.rightSmallArcRadius=u+pe.width/2+rt,pe.circularPathData.rightLargeArcRadius=u+pe.width/2+$t*Ye+rt),rt=rt+Nt.width}),pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=Math.max(it,pe.source.y1,pe.target.y1)+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=Qe-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius)}pe.circularPathData.leftInnerExtent=pe.circularPathData.sourceX+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightInnerExtent=pe.circularPathData.targetX-pe.circularPathData.rightNodeBuffer,pe.circularPathData.leftFullExtent=pe.circularPathData.sourceX+pe.circularPathData.leftLargeArcRadius+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightFullExtent=pe.circularPathData.targetX-pe.circularPathData.rightLargeArcRadius-pe.circularPathData.rightNodeBuffer}if(pe.circular)pe.path=j(pe);else{var Ft=E.linkHorizontal().source(function(Nt){var $t=Nt.source.x0+(Nt.source.x1-Nt.source.x0),rr=Nt.y0;return[$t,rr]}).target(function(Nt){var $t=Nt.target.x0,rr=Nt.y1;return[$t,rr]});pe.path=Ft(pe)}})}function j(ze){var Ye="";return ze.circularLinkType=="top"?Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 0 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY-ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 0 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 0 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY-ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 0 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY:Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 1 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY+ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 1 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 1 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY+ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 1 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY,Ye}function Z(ze,Ye){return V(ze)==V(Ye)?ze.circularLinkType=="bottom"?fe(ze,Ye):re(ze,Ye):V(Ye)-V(ze)}function re(ze,Ye){return ze.y0-Ye.y0}function fe(ze,Ye){return Ye.y0-ze.y0}function le(ze,Ye){return ze.y1-Ye.y1}function ce(ze,Ye){return Ye.y1-ze.y1}function V(ze){return ze.target.column-ze.source.column}function ee(ze){return ze.target.x0-ze.source.x1}function ne(ze,Ye){var it=z(ze),st=ee(Ye)/Math.tan(it),nt=Ae(ze)=="up"?ze.y1+st:ze.y1-st;return nt}function K(ze,Ye){var it=z(ze),st=ee(Ye)/Math.tan(it),nt=Ae(ze)=="up"?ze.y1-st:ze.y1+st;return nt}function ue(ze,Ye,it,st){ze.links.forEach(function(nt){if(!nt.circular&&nt.target.column-nt.source.column>1){var Qe=nt.source.column+1,Le=nt.target.column-1,Te=1,pe=Le-Qe+1;for(Te=1;Qe<=Le;Qe++,Te++)ze.nodes.forEach(function(Ne){if(Ne.column==Qe){var ot=Te/(pe+1),ct=Math.pow(1-ot,3),rt=3*ot*Math.pow(1-ot,2),Ft=3*Math.pow(ot,2)*(1-ot),Nt=Math.pow(ot,3),$t=ct*nt.y0+rt*nt.y0+Ft*nt.y1+Nt*nt.y1,rr=$t-nt.width/2,Mr=$t+nt.width/2,Sr;rr>Ne.y0&&rrNe.y0&&MrNe.y1&&H(Zr,Sr,Ye,it)})):rrNe.y1&&(Sr=Mr-Ne.y0+10,Ne=H(Ne,Sr,Ye,it),ze.nodes.forEach(function(Zr){w(Zr,st)==w(Ne,st)||Zr.column!=Ne.column||Zr.y0Ne.y1&&H(Zr,Sr,Ye,it)}))}})}})}function te(ze,Ye){return ze.y0>Ye.y0&&ze.y0Ye.y0&&ze.y1Ye.y1}function H(ze,Ye,it,st){return ze.y0+Ye>=it&&ze.y1+Ye<=st&&(ze.y0=ze.y0+Ye,ze.y1=ze.y1+Ye,ze.targetLinks.forEach(function(nt){nt.y1=nt.y1+Ye}),ze.sourceLinks.forEach(function(nt){nt.y0=nt.y0+Ye})),ze}function ae(ze,Ye,it,st){ze.nodes.forEach(function(nt){st&&nt.y+(nt.y1-nt.y0)>Ye&&(nt.y=nt.y-(nt.y+(nt.y1-nt.y0)-Ye));var Qe=ze.links.filter(function(pe){return w(pe.source,it)==w(nt,it)}),Le=Qe.length;Le>1&&Qe.sort(function(pe,Ne){if(!pe.circular&&!Ne.circular){if(pe.target.column==Ne.target.column)return pe.y1-Ne.y1;if(ve(pe,Ne)){if(pe.target.column>Ne.target.column){var ot=K(Ne,pe);return pe.y1-ot}if(Ne.target.column>pe.target.column){var ct=K(pe,Ne);return ct-Ne.y1}}else return pe.y1-Ne.y1}if(pe.circular&&!Ne.circular)return pe.circularLinkType=="top"?-1:1;if(Ne.circular&&!pe.circular)return Ne.circularLinkType=="top"?1:-1;if(pe.circular&&Ne.circular)return pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="top"?pe.target.column===Ne.target.column?pe.target.y1-Ne.target.y1:Ne.target.column-pe.target.column:pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="bottom"?pe.target.column===Ne.target.column?Ne.target.y1-pe.target.y1:pe.target.column-Ne.target.column:pe.circularLinkType=="top"?-1:1});var Te=nt.y0;Qe.forEach(function(pe){pe.y0=Te+pe.width/2,Te=Te+pe.width}),Qe.forEach(function(pe,Ne){if(pe.circularLinkType=="bottom"){var ot=Ne+1,ct=0;for(ot;ot1&&nt.sort(function(Te,pe){if(!Te.circular&&!pe.circular){if(Te.source.column==pe.source.column)return Te.y0-pe.y0;if(ve(Te,pe)){if(pe.source.column0?"up":"down"}function Ce(ze,Ye){return w(ze.source,Ye)==w(ze.target,Ye)}function Fe(ze,Ye,it){var st=ze.nodes,nt=ze.links,Qe=!1,Le=!1;if(nt.forEach(function(rt){rt.circularLinkType=="top"?Qe=!0:rt.circularLinkType=="bottom"&&(Le=!0)}),Qe==!1||Le==!1){var Te=b.min(st,function(rt){return rt.y0}),pe=b.max(st,function(rt){return rt.y1}),Ne=pe-Te,ot=it-Ye,ct=ot/Ne;st.forEach(function(rt){var Ft=(rt.y1-rt.y0)*ct;rt.y0=(rt.y0-Te)*ct,rt.y1=rt.y0+Ft}),nt.forEach(function(rt){rt.y0=(rt.y0-Te)*ct,rt.y1=(rt.y1-Te)*ct,rt.width=rt.width*ct})}}h.sankeyCircular=y,h.sankeyCenter=i,h.sankeyLeft=r,h.sankeyRight=o,h.sankeyJustify=n,Object.defineProperty(h,"__esModule",{value:!0})})}}),nL=Ge({"src/traces/sankey/constants.js"($,G){G.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"}}}}),Pz=Ge({"src/traces/sankey/render.js"($,G){var h=Mz(),b=(to(),yi(gi)).interpolateNumber,S=Mi(),E=kz(),e=Lz(),t=nL(),r=Bs(),o=_o(),n=Ss(),i=gn(),a=i.strTranslate,s=i.strRotate,f=zg(),c=f.keyFun,p=f.repeat,d=f.unwrap,T=Ju(),l=Lo(),g=Qh(),x=g.CAP_SHIFT,A=g.LINE_SPACING,M=3;function _(ne,K,ue){var te=d(K),H=te.trace,ae=H.domain,ie=H.orientation==="h",ve=H.node.pad,Ae=H.node.thickness,Ce={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[H.node.align],Fe=ne.width*(ae.x[1]-ae.x[0]),ze=ne.height*(ae.y[1]-ae.y[0]),Ye=te._nodes,it=te._links,st=te.circular,nt;st?nt=e.sankeyCircular().circularLinkGap(0):nt=E.sankey(),nt.iterations(t.sankeyIterations).size(ie?[Fe,ze]:[ze,Fe]).nodeWidth(Ae).nodePadding(ve).nodeId(function(Zr){return Zr.pointNumber}).nodeAlign(Ce).nodes(Ye).links(it);var Qe=nt();nt.nodePadding()=je||(Mt=je-Br.y0,Mt>1e-6&&(Br.y0+=Mt,Br.y1+=Mt)),je=Br.y1+ve})}function $t(Zr){var Ar=Zr.map(function(ye,Me){return{x0:ye.x0,index:Me}}).sort(function(ye,Me){return ye.x0-Me.x0}),Br=[],Mt=-1,je,$e=-1/0,Ee;for(Le=0;Le$e+Ae&&(Mt+=1,je=xe.x0),$e=xe.x0,Br[Mt]||(Br[Mt]=[]),Br[Mt].push(xe),Ee=je-xe.x0,xe.x0+=Ee,xe.x1+=Ee}return Br}if(H.node.x.length&&H.node.y.length){for(Le=0;Le0?" L "+H.targetX+" "+H.targetY:"")+"Z"):(ue="M "+(H.targetX-K)+" "+(H.targetY-te)+" L "+(H.rightInnerExtent-K)+" "+(H.targetY-te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightSmallArcRadius+te)+" 0 0 0 "+(H.rightFullExtent-te-K)+" "+(H.targetY+H.rightSmallArcRadius)+" L "+(H.rightFullExtent-te-K)+" "+H.verticalRightInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-te-K)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent+te-K-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent-K-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.leftFullExtent+te+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-K)+" "+(H.verticalFullExtent+te)+" L "+H.leftInnerExtent+" "+(H.verticalFullExtent+te)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent,ue+=" L "+(H.leftFullExtent+te)+" "+(H.sourceY+H.leftSmallArcRadius)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftSmallArcRadius+te)+" 0 0 0 "+H.leftInnerExtent+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY+te)+" L "+H.leftInnerExtent+" "+(H.sourceY+te)+" A "+(H.leftLargeArcRadius-te)+" "+(H.leftSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te)+" "+(H.sourceY+H.leftSmallArcRadius)+" L "+(H.leftFullExtent-te)+" "+H.verticalLeftInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.rightFullExtent+te-K+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent-K-te)+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent:ue+=" A "+(H.leftLargeArcRadius-te)+" "+(H.leftLargeArcRadius-te)+" 0 0 1 "+H.leftInnerExtent+" "+(H.verticalFullExtent-te)+" L "+(H.rightInnerExtent-K)+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightLargeArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent,ue+=" L "+(H.rightFullExtent+te-K)+" "+(H.targetY+H.rightSmallArcRadius)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightInnerExtent-K)+" "+(H.targetY+te)+" L "+(H.targetX-K)+" "+(H.targetY+te)+(K>0?" L "+H.targetX+" "+H.targetY:"")+"Z"),ue}function u(){var ne=.5;function K(ue){var te=ue.linkArrowLength;if(ue.link.circular)return m(ue.link,te);var H=Math.abs((ue.link.target.x0-ue.link.source.x1)/2);te>H&&(te=H);var ae=ue.link.source.x1,ie=ue.link.target.x0-te,ve=b(ae,ie),Ae=ve(ne),Ce=ve(1-ne),Fe=ue.link.y0-ue.link.width/2,ze=ue.link.y0+ue.link.width/2,Ye=ue.link.y1-ue.link.width/2,it=ue.link.y1+ue.link.width/2,st="M"+ae+","+Fe,nt="C"+Ae+","+Fe+" "+Ce+","+Ye+" "+ie+","+Ye,Qe="C"+Ce+","+it+" "+Ae+","+ze+" "+ae+","+ze,Le=te>0?"L"+(ie+te)+","+(Ye+ue.link.width/2):"";return Le+="L"+ie+","+it,st+nt+Le+Qe+"Z"}return K}function v(ne,K){var ue=r(K.color),te=t.nodePadAcross,H=ne.nodePad/2;K.dx=K.x1-K.x0,K.dy=K.y1-K.y0;var ae=K.dx,ie=Math.max(.5,K.dy),ve="node_"+K.pointNumber;return K.group&&(ve=i.randstr()),K.trace=ne.trace,K.curveNumber=ne.trace.index,{index:K.pointNumber,key:ve,partOfGroup:K.partOfGroup||!1,group:K.group,traceId:ne.key,trace:ne.trace,node:K,nodePad:ne.nodePad,nodeLineColor:ne.nodeLineColor,nodeLineWidth:ne.nodeLineWidth,textFont:ne.textFont,size:ne.horizontal?ne.height:ne.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-te,zoneY:-H,zoneWidth:ae+2*te,zoneHeight:ie+2*H,labelY:ne.horizontal?K.dy/2+1:K.dx/2+1,left:K.originalLayer===1,sizeAcross:ne.width,forceLayouts:ne.forceLayouts,horizontal:ne.horizontal,darkBackground:ue.getBrightness()<=128,tinyColorHue:o.tinyRGB(ue),tinyColorAlpha:ue.getAlpha(),valueFormat:ne.valueFormat,valueSuffix:ne.valueSuffix,sankey:ne.sankey,graph:ne.graph,arrangement:ne.arrangement,uniqueNodeLabelPathId:[ne.guid,ne.key,ve].join("_"),interactionState:ne.interactionState,figure:ne}}function y(ne){ne.attr("transform",function(K){return a(K.node.x0.toFixed(3),K.node.y0.toFixed(3))})}function I(ne){ne.call(y)}function L(ne,K){ne.call(I),K.attr("d",u())}function z(ne){ne.attr("width",function(K){return K.node.x1-K.node.x0}).attr("height",function(K){return K.visibleHeight})}function F(ne){return ne.link.width>1||ne.linkLineWidth>0}function N(ne){var K=a(ne.translateX,ne.translateY);return K+(ne.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(ne,K,ue){ne.on(".basic",null).on("mouseover.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.hover(this,te,K),te.interactionState.hovered=[this,te])}).on("mousemove.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.follow(this,te),te.interactionState.hovered=[this,te])}).on("mouseout.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.unhover(this,te,K),te.interactionState.hovered=!1)}).on("click.basic",function(te){te.interactionState.hovered&&(ue.unhover(this,te,K),te.interactionState.hovered=!1),!te.interactionState.dragInProgress&&!te.partOfGroup&&ue.select(this,te,K)})}function R(ne,K,ue,te){var H=S.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(te._fullLayout._infolayer,"g","dragcover",function(ve){te._fullLayout._dragCover=ve}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,le(ae.node),ae.interactionState.hovered&&(ue.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):U(ne,ie,ae),j(ne,K,ae,ie,te)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=S.event.x,ve=S.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=ve-ae.visibleHeight/2,ae.node.y1=ve+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),ve=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,ve)),ae.node.y0=ve-ae.visibleHeight/2,ae.node.y1=ve+ae.visibleHeight/2),le(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),L(ne.filter(ce(ae)),K))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var Ae=ue.node.originalX;ue.node.x0=Ae-ue.visibleWidth/2,ue.node.x1=Ae+ue.visibleWidth/2,re(ue,H)}})}function Z(ne,K,ue,te){return function(){for(var ae=0,ie=0;ie0&&te.forceLayouts[K].alpha(0)}}function re(ne,K){for(var ue=[],te=[],H=0;H"),color:g(V,"bgcolor")||t.addOpacity(te.color,1),borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:h.event.x"),color:g(V,"bgcolor")||ce.tinyColorHue,borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:"left",hovertemplate:V.hovertemplate,hovertemplateLabels:ae,eventData:[ce.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:A});a(Ae,.85),s(Ae)}}},fe=function(le,ce,V){A._fullLayout.hovermode!==!1&&(h.select(le).call(d,ce,V),ce.node.trace.node.hoverinfo!=="skip"&&(ce.node.fullData=ce.node.trace,A.emit("plotly_unhover",{event:h.event,points:[ce.node]})),e.loneUnhover(_._hoverlayer.node()))};E(A,w,M,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{linkEvents:{hover:I,follow:R,unhover:U,select:y},nodeEvents:{hover:Z,follow:re,unhover:fe,select:j}})}}}),Rz=Ge({"src/traces/sankey/base_plot.js"($){var G=Nc().overrideAll,h=Rv().getModuleCalcData,b=aL(),S=cc(),E=Dp(),e=rd(),t=Yf().prepSelect,r=gn(),o=Lo(),n="sankey";$.name=n,$.baseLayoutAttrOverrides=G({hoverlabel:S.hoverlabel},"plot","nested"),$.plot=function(a){var s=h(a.calcdata,n)[0];b(a,s),$.updateFx(a)},$.clean=function(a,s,f,c){var p=c._has&&c._has(n),d=s._has&&s._has(n);p&&!d&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},$.updateFx=function(a){for(var s=0;s0}G.exports=function(F,N,B,R){var U=F._fullLayout,j;x(B)&&R&&(j=R()),E.makeTraceGroups(U._indicatorlayer,N,"trace").each(function(Z){var re=Z[0],fe=re.trace,le=h.select(this),ce=fe._hasGauge,V=fe._isAngular,ee=fe._isBullet,ne=fe.domain,K={w:U._size.w*(ne.x[1]-ne.x[0]),h:U._size.h*(ne.y[1]-ne.y[0]),l:U._size.l+U._size.w*ne.x[0],r:U._size.r+U._size.w*(1-ne.x[1]),t:U._size.t+U._size.h*(1-ne.y[1]),b:U._size.b+U._size.h*ne.y[0]},ue=K.l+K.w/2,te=K.t+K.h/2,H=Math.min(K.w/2,K.h),ae=i.innerRadius*H,ie,ve,Ae,Ce=fe.align||"center";if(ve=te,!ce)ie=K.l+l[Ce]*K.w,Ae=function(pe){return v(pe,K.w,K.h)};else if(V&&(ie=ue,ve=te+H/2,Ae=function(pe){return y(pe,.9*ae)}),ee){var Fe=i.bulletPadding,ze=1-i.bulletNumberDomainSize+Fe;ie=K.l+(ze+(1-ze)*l[Ce])*K.w,Ae=function(pe){return v(pe,(i.bulletNumberDomainSize-Fe)*K.w,K.h)}}_(F,le,Z,{numbersX:ie,numbersY:ve,numbersScaler:Ae,transitionOpts:B,onComplete:j});var Ye,it;ce&&(Ye={range:fe.gauge.axis.range,color:fe.gauge.bgcolor,line:{color:fe.gauge.bordercolor,width:0},thickness:1},it={range:fe.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:fe.gauge.bordercolor,width:fe.gauge.borderwidth},thickness:1});var st=le.selectAll("g.angular").data(V?Z:[]);st.exit().remove();var nt=le.selectAll("g.angularaxis").data(V?Z:[]);nt.exit().remove(),V&&M(F,le,Z,{radius:H,innerRadius:ae,gauge:st,layer:nt,size:K,gaugeBg:Ye,gaugeOutline:it,transitionOpts:B,onComplete:j});var Qe=le.selectAll("g.bullet").data(ee?Z:[]);Qe.exit().remove();var Le=le.selectAll("g.bulletaxis").data(ee?Z:[]);Le.exit().remove(),ee&&A(F,le,Z,{gauge:Qe,layer:Le,size:K,gaugeBg:Ye,gaugeOutline:it,transitionOpts:B,onComplete:j});var Te=le.selectAll("text.title").data(Z);Te.exit().remove(),Te.enter().append("text").classed("title",!0),Te.attr("text-anchor",function(){return ee?T.right:T[fe.title.align]}).text(fe.title.text).call(n.font,fe.title.font).call(a.convertToTspans,F),Te.attr("transform",function(){var pe=K.l+K.w*l[fe.title.align],Ne,ot=i.titlePadding,ct=n.bBox(Te.node());if(ce){if(V)if(fe.gauge.axis.visible){var rt=n.bBox(nt.node());Ne=rt.top-ot-ct.bottom}else Ne=K.t+K.h/2-H/2-ct.bottom-ot;ee&&(Ne=ve-(ct.top+ct.bottom)/2,pe=K.l-i.bulletPadding*K.w)}else Ne=fe._numbersTop-ot-ct.bottom;return t(pe,Ne)})})};function A(z,F,N,B){var R=N[0].trace,U=B.gauge,j=B.layer,Z=B.gaugeBg,re=B.gaugeOutline,fe=B.size,le=R.domain,ce=B.transitionOpts,V=B.onComplete,ee,ne,K,ue,te;U.enter().append("g").classed("bullet",!0),U.attr("transform",t(fe.l,fe.t)),j.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),j.selectAll("g.xbulletaxistick,path,text").remove();var H=fe.h,ae=R.gauge.bar.thickness*H,ie=le.x[0],ve=le.x[0]+(le.x[1]-le.x[0])*(R._hasNumber||R._hasDelta?1-i.bulletNumberDomainSize:1);ee=u(z,R.gauge.axis),ee._id="xbulletaxis",ee.domain=[ie,ve],ee.setScale(),ne=s.calcTicks(ee),K=s.makeTransTickFn(ee),ue=s.getTickSigns(ee)[2],te=fe.t+fe.h,ee.visible&&(s.drawTicks(z,ee,{vals:ee.ticks==="inside"?s.clipEnds(ee,ne):ne,layer:j,path:s.makeTickPath(ee,te,ue),transFn:K}),s.drawLabels(z,ee,{vals:ne,layer:j,transFn:K,labelFns:s.makeLabelFns(ee,te)}));function Ae(nt){nt.attr("width",function(Qe){return Math.max(0,ee.c2p(Qe.range[1])-ee.c2p(Qe.range[0]))}).attr("x",function(Qe){return ee.c2p(Qe.range[0])}).attr("y",function(Qe){return .5*(1-Qe.thickness)*H}).attr("height",function(Qe){return Qe.thickness*H})}var Ce=[Z].concat(R.gauge.steps),Fe=U.selectAll("g.bg-bullet").data(Ce);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(Ae).call(w),Fe.exit().remove();var ze=U.selectAll("g.value-bullet").data([R.gauge.bar]);ze.enter().append("g").classed("value-bullet",!0).append("rect"),ze.select("rect").attr("height",ae).attr("y",(H-ae)/2).call(w),x(ce)?ze.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){V&&V()}).each("interrupt",function(){V&&V()}).attr("width",Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y)))):ze.select("rect").attr("width",typeof N[0].y=="number"?Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y))):0),ze.exit().remove();var Ye=N.filter(function(){return R.gauge.threshold.value||R.gauge.threshold.value===0}),it=U.selectAll("g.threshold-bullet").data(Ye);it.enter().append("g").classed("threshold-bullet",!0).append("line"),it.select("line").attr("x1",ee.c2p(R.gauge.threshold.value)).attr("x2",ee.c2p(R.gauge.threshold.value)).attr("y1",(1-R.gauge.threshold.thickness)/2*H).attr("y2",(1-(1-R.gauge.threshold.thickness)/2)*H).call(d.stroke,R.gauge.threshold.line.color).style("stroke-width",R.gauge.threshold.line.width),it.exit().remove();var st=U.selectAll("g.gauge-outline").data([re]);st.enter().append("g").classed("gauge-outline",!0).append("rect"),st.select("rect").call(Ae).call(w),st.exit().remove()}function M(z,F,N,B){var R=N[0].trace,U=B.size,j=B.radius,Z=B.innerRadius,re=B.gaugeBg,fe=B.gaugeOutline,le=[U.l+U.w/2,U.t+U.h/2+j/2],ce=B.gauge,V=B.layer,ee=B.transitionOpts,ne=B.onComplete,K=Math.PI/2;function ue(Ft){var Nt=R.gauge.axis.range[0],$t=R.gauge.axis.range[1],rr=(Ft-Nt)/($t-Nt)*Math.PI-K;return rr<-K?-K:rr>K?K:rr}function te(Ft){return h.svg.arc().innerRadius((Z+j)/2-Ft/2*(j-Z)).outerRadius((Z+j)/2+Ft/2*(j-Z)).startAngle(-K)}function H(Ft){Ft.attr("d",function(Nt){return te(Nt.thickness).startAngle(ue(Nt.range[0])).endAngle(ue(Nt.range[1]))()})}var ae,ie,ve,Ae;ce.enter().append("g").classed("angular",!0),ce.attr("transform",t(le[0],le[1])),V.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),V.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,R.gauge.axis),ae.type="linear",ae.range=R.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Ce=function(Ft){return(ae.range[0]-Ft.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},ze=s.makeLabelFns(ae,0),Ye=ze.labelStandoff;Fe.xFn=function(Ft){var Nt=Ce(Ft);return Math.cos(Nt)*Ye},Fe.yFn=function(Ft){var Nt=Ce(Ft),$t=Math.sin(Nt)>0?.2:1;return-Math.sin(Nt)*(Ye+Ft.fontSize*$t)+Math.abs(Math.cos(Nt))*(Ft.fontSize*o)},Fe.anchorFn=function(Ft){var Nt=Ce(Ft),$t=Math.cos(Nt);return Math.abs($t)<.1?"middle":$t>0?"start":"end"},Fe.heightFn=function(Ft,Nt,$t){var rr=Ce(Ft);return-.5*(1+Math.sin(rr))*$t};var it=function(Ft){return t(le[0]+j*Math.cos(Ft),le[1]-j*Math.sin(Ft))};ve=function(Ft){return it(Ce(Ft))};var st=function(Ft){var Nt=Ce(Ft);return it(Nt)+"rotate("+-r(Nt)+")"};if(ie=s.calcTicks(ae),Ae=s.getTickSigns(ae)[2],ae.visible){Ae=ae.ticks==="inside"?-1:1;var nt=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:V,path:"M"+Ae*nt+",0h"+Ae*ae.ticklen,transFn:st}),s.drawLabels(z,ae,{vals:ie,layer:V,transFn:ve,labelFns:Fe})}var Qe=[re].concat(R.gauge.steps),Le=ce.selectAll("g.bg-arc").data(Qe);Le.enter().append("g").classed("bg-arc",!0).append("path"),Le.select("path").call(H).call(w),Le.exit().remove();var Te=te(R.gauge.bar.thickness),pe=ce.selectAll("g.value-arc").data([R.gauge.bar]);pe.enter().append("g").classed("value-arc",!0).append("path");var Ne=pe.select("path");x(ee)?(Ne.transition().duration(ee.duration).ease(ee.easing).each("end",function(){ne&&ne()}).each("interrupt",function(){ne&&ne()}).attrTween("d",m(Te,ue(N[0].lastY),ue(N[0].y))),R._lastValue=N[0].y):Ne.attr("d",typeof N[0].y=="number"?Te.endAngle(ue(N[0].y)):"M0,0Z"),Ne.call(w),pe.exit().remove(),Qe=[];var ot=R.gauge.threshold.value;(ot||ot===0)&&Qe.push({range:[ot,ot],color:R.gauge.threshold.color,line:{color:R.gauge.threshold.line.color,width:R.gauge.threshold.line.width},thickness:R.gauge.threshold.thickness});var ct=ce.selectAll("g.threshold-arc").data(Qe);ct.enter().append("g").classed("threshold-arc",!0).append("path"),ct.select("path").call(H).call(w),ct.exit().remove();var rt=ce.selectAll("g.gauge-outline").data([fe]);rt.enter().append("g").classed("gauge-outline",!0).append("path"),rt.select("path").call(H).call(w),rt.exit().remove()}function _(z,F,N,B){var R=N[0].trace,U=B.numbersX,j=B.numbersY,Z=R.align||"center",re=T[Z],fe=B.transitionOpts,le=B.onComplete,ce=E.ensureSingle(F,"g","numbers"),V,ee,ne,K=[];R._hasNumber&&K.push("number"),R._hasDelta&&(K.push("delta"),R.delta.position==="left"&&K.reverse());var ue=ce.selectAll("text").data(K);ue.enter().append("text"),ue.attr("text-anchor",function(){return re}).attr("class",function(it){return it}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ue.exit().remove();function te(it,st,nt,Qe){if(it.match("s")&&nt>=0!=Qe>=0&&!st(nt).slice(-1).match(g)&&!st(Qe).slice(-1).match(g)){var Le=it.slice().replace("s","f").replace(/\d+/,function(pe){return parseInt(pe)-1}),Te=u(z,{tickformat:Le});return function(pe){return Math.abs(pe)<1?s.tickText(Te,pe).text:st(pe)}}else return st}function H(){var it=u(z,{tickformat:R.number.valueformat},R._range);it.setScale(),s.prepTicks(it);var st=function(pe){return s.tickText(it,pe).text},nt=R.number.suffix,Qe=R.number.prefix,Le=ce.select("text.number");function Te(){var pe=typeof N[0].y=="number"?Qe+st(N[0].y)+nt:"-";Le.text(pe).call(n.font,R.number.font).call(a.convertToTspans,z)}return x(fe)?Le.transition().duration(fe.duration).ease(fe.easing).each("end",function(){Te(),le&&le()}).each("interrupt",function(){Te(),le&&le()}).attrTween("text",function(){var pe=h.select(this),Ne=S(N[0].lastY,N[0].y);R._lastValue=N[0].y;var ot=te(R.number.valueformat,st,N[0].lastY,N[0].y);return function(ct){pe.text(Qe+ot(Ne(ct))+nt)}}):Te(),V=I(Qe+st(N[0].y)+nt,R.number.font,re,z),Le}function ae(){var it=u(z,{tickformat:R.delta.valueformat},R._range);it.setScale(),s.prepTicks(it);var st=function(ct){return s.tickText(it,ct).text},nt=R.delta.suffix,Qe=R.delta.prefix,Le=function(ct){var rt=R.delta.relative?ct.relativeDelta:ct.delta;return rt},Te=function(ct,rt){return ct===0||typeof ct!="number"||isNaN(ct)?"-":(ct>0?R.delta.increasing.symbol:R.delta.decreasing.symbol)+Qe+rt(ct)+nt},pe=function(ct){return ct.delta>=0?R.delta.increasing.color:R.delta.decreasing.color};R._deltaLastValue===void 0&&(R._deltaLastValue=Le(N[0]));var Ne=ce.select("text.delta");Ne.call(n.font,R.delta.font).call(d.fill,pe({delta:R._deltaLastValue}));function ot(){Ne.text(Te(Le(N[0]),st)).call(d.fill,pe(N[0])).call(a.convertToTspans,z)}return x(fe)?Ne.transition().duration(fe.duration).ease(fe.easing).tween("text",function(){var ct=h.select(this),rt=Le(N[0]),Ft=R._deltaLastValue,Nt=te(R.delta.valueformat,st,Ft,rt),$t=S(Ft,rt);return R._deltaLastValue=rt,function(rr){ct.text(Te($t(rr),Nt)),ct.call(d.fill,pe({delta:$t(rr)}))}}).each("end",function(){ot(),le&&le()}).each("interrupt",function(){ot(),le&&le()}):ot(),ee=I(Te(Le(N[0]),st),R.delta.font,re,z),Ne}var ie=R.mode+R.align,ve;if(R._hasDelta&&(ve=ae(),ie+=R.delta.position+R.delta.font.size+R.delta.font.family+R.delta.valueformat,ie+=R.delta.increasing.symbol+R.delta.decreasing.symbol,ne=ee),R._hasNumber&&(H(),ie+=R.number.font.size+R.number.font.family+R.number.valueformat+R.number.suffix+R.number.prefix,ne=V),R._hasDelta&&R._hasNumber){var Ae=[(V.left+V.right)/2,(V.top+V.bottom)/2],Ce=[(ee.left+ee.right)/2,(ee.top+ee.bottom)/2],Fe,ze,Ye=.75*R.delta.font.size;R.delta.position==="left"&&(Fe=L(R,"deltaPos",0,-1*(V.width*l[R.align]+ee.width*(1-l[R.align])+Ye),ie,Math.min),ze=Ae[1]-Ce[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:ee.left+Fe,right:V.right,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="right"&&(Fe=L(R,"deltaPos",0,V.width*(1-l[R.align])+ee.width*l[R.align]+Ye,ie,Math.max),ze=Ae[1]-Ce[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:V.left,right:ee.right+Fe,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="bottom"&&(Fe=null,ze=ee.height,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height,bottom:V.bottom+ee.height}),R.delta.position==="top"&&(Fe=null,ze=V.top,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height-ee.height,bottom:V.bottom}),ve.attr({dx:Fe,dy:ze})}(R._hasNumber||R._hasDelta)&&ce.attr("transform",function(){var it=B.numbersScaler(ne);ie+=it[2];var st=L(R,"numbersScale",1,it[0],ie,Math.min),nt;R._scaleNumbers||(st=1),R._isAngular?nt=j-st*ne.bottom:nt=j-st*(ne.top+ne.bottom)/2,R._numbersTop=st*ne.top+nt;var Qe=ne[Z];Z==="center"&&(Qe=(ne.left+ne.right)/2);var Le=U-st*Qe;return Le=L(R,"numbersTranslate",0,Le,ie,Math.max),t(Le,nt)+e(st)})}function w(z){z.each(function(F){d.stroke(h.select(this),F.line.color)}).each(function(F){d.fill(h.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function m(z,F,N){return function(){var B=b(F,N);return function(R){return z.endAngle(B(R))()}}}function u(z,F,N){var B=z._fullLayout,R=E.extendFlat({type:"linear",ticks:"outside",range:N,showline:!0},F),U={type:"linear",_id:"x"+F._id},j={letter:"x",font:B.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(re,fe){return E.coerce(R,U,p,re,fe)}return f(R,U,Z,j,B),c(R,U,Z,j),U}function v(z,F,N){var B=Math.min(F/z.width,N/z.height);return[B,z,F+"x"+N]}function y(z,F){var N=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),B=F/N;return[B,z,F]}function I(z,F,N,B){var R=document.createElementNS("http://www.w3.org/2000/svg","text"),U=h.select(R);return U.text(z).attr("x",0).attr("y",0).attr("text-anchor",N).attr("data-unformatted",z).call(a.convertToTspans,B).call(n.font,F),n.bBox(U.node())}function L(z,F,N,B,R,U){var j="_cache"+F;z[j]&&z[j].key===R||(z[j]={key:R,value:N});var Z=E.aggNums(U,null,[z[j].value,B],2);return z[j].value=Z,Z}}}),Uz=Ge({"src/traces/indicator/index.js"($,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:Oz(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:iL(),supplyDefaults:Fz().supplyDefaults,calc:Bz().calc,plot:Nz(),meta:{}}}}),jz=Ge({"lib/indicator.js"($,G){G.exports=Uz()}}),sL=Ge({"src/traces/table/attributes.js"($,G){var h=um(),b=Qi().extendFlat,S=Nc().overrideAll,E=Hs(),e=Ac().attributes,t=fc().descriptionOnlyNumbers;G.exports=S({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:b({},h.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:b({},E({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:b({},h.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:b({},E({arrayOk:!0}))}},"calc","from-root")}}),qz=Ge({"src/traces/table/defaults.js"($,G){var h=gn(),b=sL(),S=Ac().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,n=r.slice(0,o),i=n.slice().sort(function(f,c){return f-c}),a=n.map(function(f){return i.indexOf(f)}),s=a.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),Hz=Ge({"src/traces/table/data_preparation_helper.js"($,G){var h=lL(),b=Qi().extendFlat,S=Pi(),E=As().isTypedArray,e=As().isArrayOrTypedArray;G.exports=function(p,d){var T=o(d.cells.values),l=function(re){return re.slice(d.header.values.length,re.length)},g=o(d.header.values);g.length&&!g[0].length&&(g[0]=[""],g=o(g));var x=g.concat(l(T).map(function(){return n((g[0]||[""]).length)})),A=d.domain,M=Math.floor(p._fullLayout._size.w*(A.x[1]-A.x[0])),_=Math.floor(p._fullLayout._size.h*(A.y[1]-A.y[0])),w=d.header.values.length?x[0].map(function(){return d.header.height}):[h.emptyHeaderHeight],m=T.length?T[0].map(function(){return d.cells.height}):[],u=w.reduce(r,0),v=_-u,y=v+h.uplift,I=s(m,y),L=s(w,u),z=a(L,[]),F=a(I,z),N={},B=d._fullInput.columnorder;e(B)&&(B=Array.from(B)),B=B.concat(l(T.map(function(re,fe){return fe})));var R=x.map(function(re,fe){var le=e(d.columnwidth)?d.columnwidth[Math.min(fe,d.columnwidth.length-1)]:d.columnwidth;return S(le)?Number(le):1}),U=R.reduce(r,0);R=R.map(function(re){return re/U*M});var j=Math.max(t(d.header.line.width),t(d.cells.line.width)),Z={key:d.uid+p._context.staticPlot,translateX:A.x[0]*p._fullLayout._size.w,translateY:p._fullLayout._size.h*(1-A.y[1]),size:p._fullLayout._size,width:M,maxLineWidth:j,height:_,columnOrder:B,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:b({},d.cells,{values:T}),headerCells:b({},d.header,{values:x}),gdColumns:x.map(function(re){return re[0]}),gdColumnsOriginalOrder:x.map(function(re){return re[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:x.map(function(re,fe){var le=N[re];N[re]=(le||0)+1;var ce=re+"__"+N[re];return{key:ce,label:re,specIndex:fe,xIndex:B[fe],xScale:i,x:void 0,calcdata:void 0,columnWidth:R[fe]}})};return Z.columns.forEach(function(re){re.calcdata=Z,re.x=i(re)}),Z};function t(c){if(e(c)){for(var p=0,d=0;d=p||_===c.length-1)&&(d[l]=x,x.key=M++,x.firstRowIndex=A,x.lastRowIndex=_,x=f(),l+=g,A=_+1,g=0);return d}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),Gz=Ge({"src/traces/table/data_split_helpers.js"($){var G=Qi().extendFlat;$.splitToPanels=function(b){var S=[0,0],E=G({},b,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:b.calcdata.headerCells.values[b.specIndex],rowBlocks:b.calcdata.headerRowBlocks,calcdata:G({},b.calcdata,{cells:b.calcdata.headerCells})}),e=G({},b,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks}),t=G({},b,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks});return[e,t,E]},$.splitToCells=function(b){var S=h(b);return(b.values||[]).slice(S[0],S[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:b,calcdata:b.calcdata,page:b.page,rowBlocks:b.rowBlocks,value:E}})};function h(b){var S=b.rowBlocks[b.page],E=S?S.rows[0].rowIndex:0,e=S?E+S.rows.length:0;return[E,e]}}}),uL=Ge({"src/traces/table/plot.js"($,G){var h=lL(),b=Mi(),S=gn(),E=S.numberFormat,e=zg(),t=Ss(),r=Ju(),o=gn().raiseToTop,n=gn().strTranslate,i=gn().cancelTransition,a=Hz(),s=Gz(),f=_o();G.exports=function(ie,ve){var Ae=!ie._context.staticPlot,Ce=ie._fullLayout._paper.selectAll("."+h.cn.table).data(ve.map(function(rt){var Ft=e.unwrap(rt),Nt=Ft.trace;return a(ie,Nt)}),e.keyFun);Ce.exit().remove(),Ce.enter().append("g").classed(h.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"),Ce.attr("width",function(rt){return rt.width+rt.size.l+rt.size.r}).attr("height",function(rt){return rt.height+rt.size.t+rt.size.b}).attr("transform",function(rt){return n(rt.translateX,rt.translateY)});var Fe=Ce.selectAll("."+h.cn.tableControlView).data(e.repeat,e.keyFun),ze=Fe.enter().append("g").classed(h.cn.tableControlView,!0).style("box-sizing","content-box");if(Ae){var Ye="onwheel"in document?"wheel":"mousewheel";ze.on("mousemove",function(rt){Fe.filter(function(Ft){return rt===Ft}).call(l,ie)}).on(Ye,function(rt){if(!rt.scrollbarState.wheeling){rt.scrollbarState.wheeling=!0;var Ft=rt.scrollY+b.event.deltaY,Nt=re(ie,Fe,null,Ft)(rt);Nt||(b.event.stopPropagation(),b.event.preventDefault()),rt.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(rt){return n(rt.size.l,rt.size.t)});var it=Fe.selectAll("."+h.cn.scrollBackground).data(e.repeat,e.keyFun);it.enter().append("rect").classed(h.cn.scrollBackground,!0).attr("fill","none"),it.attr("width",function(rt){return rt.width}).attr("height",function(rt){return rt.height}),Fe.each(function(rt){t.setClipUrl(b.select(this),p(ie,rt),ie)});var st=Fe.selectAll("."+h.cn.yColumn).data(function(rt){return rt.columns},e.keyFun);st.enter().append("g").classed(h.cn.yColumn,!0),st.exit().remove(),st.attr("transform",function(rt){return n(rt.x,0)}),Ae&&st.call(b.behavior.drag().origin(function(rt){var Ft=b.select(this);return N(Ft,rt,-h.uplift),o(this),rt.calcdata.columnDragInProgress=!0,l(Fe.filter(function(Nt){return rt.calcdata.key===Nt.key}),ie),rt}).on("drag",function(rt){var Ft=b.select(this),Nt=function(Mr){return(rt===Mr?b.event.x:Mr.x)+Mr.columnWidth/2};rt.x=Math.max(-h.overdrag,Math.min(rt.calcdata.width+h.overdrag-rt.columnWidth,b.event.x));var $t=T(st).filter(function(Mr){return Mr.calcdata.key===rt.calcdata.key}),rr=$t.sort(function(Mr,Sr){return Nt(Mr)-Nt(Sr)});rr.forEach(function(Mr,Sr){Mr.xIndex=Sr,Mr.x=rt===Mr?Mr.x:Mr.xScale(Mr)}),st.filter(function(Mr){return rt!==Mr}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(Mr){return n(Mr.x,0)}),Ft.call(i).attr("transform",n(rt.x,-h.uplift))}).on("dragend",function(rt){var Ft=b.select(this),Nt=rt.calcdata;rt.x=rt.xScale(rt),rt.calcdata.columnDragInProgress=!1,N(Ft,rt,0),z(ie,Nt,Nt.columns.map(function($t){return $t.xIndex}))})),st.each(function(rt){t.setClipUrl(b.select(this),d(ie,rt),ie)});var nt=st.selectAll("."+h.cn.columnBlock).data(s.splitToPanels,e.keyFun);nt.enter().append("g").classed(h.cn.columnBlock,!0).attr("id",function(rt){return rt.key}),nt.style("cursor",function(rt){return rt.dragHandle?"ew-resize":rt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Qe=nt.filter(R),Le=nt.filter(B);Ae&&Le.call(b.behavior.drag().origin(function(rt){return b.event.stopPropagation(),rt}).on("drag",re(ie,Fe,-1)).on("dragend",function(){})),g(ie,Fe,Qe,nt),g(ie,Fe,Le,nt);var Te=Fe.selectAll("."+h.cn.scrollAreaClip).data(e.repeat,e.keyFun);Te.enter().append("clipPath").classed(h.cn.scrollAreaClip,!0).attr("id",function(rt){return p(ie,rt)});var pe=Te.selectAll("."+h.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);pe.enter().append("rect").classed(h.cn.scrollAreaClipRect,!0).attr("x",-h.overdrag).attr("y",-h.uplift).attr("fill","none"),pe.attr("width",function(rt){return rt.width+2*h.overdrag}).attr("height",function(rt){return rt.height+h.uplift});var Ne=st.selectAll("."+h.cn.columnBoundary).data(e.repeat,e.keyFun);Ne.enter().append("g").classed(h.cn.columnBoundary,!0);var ot=st.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);ot.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),ot.attr("id",function(rt){return d(ie,rt)});var ct=ot.selectAll("."+h.cn.columnBoundaryRect).data(e.repeat,e.keyFun);ct.enter().append("rect").classed(h.cn.columnBoundaryRect,!0).attr("fill","none"),ct.attr("width",function(rt){return rt.columnWidth+2*c(rt)}).attr("height",function(rt){return rt.calcdata.height+2*c(rt)+h.uplift}).attr("x",function(rt){return-c(rt)}).attr("y",function(rt){return-c(rt)}),Z(null,Le,Fe)};function c(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function p(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function d(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,ve){function Ae(st){var nt=st.rowBlocks;return ne(nt,nt.length-1)+(nt.length?K(nt[nt.length-1],1/0):1)}var Ce=ae.selectAll("."+h.cn.scrollbarKit).data(e.repeat,e.keyFun);Ce.enter().append("g").classed(h.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ce.each(function(st){var nt=st.scrollbarState;nt.totalHeight=Ae(st),nt.scrollableAreaHeight=st.groupHeight-U(st),nt.currentlyVisibleHeight=Math.min(nt.totalHeight,nt.scrollableAreaHeight),nt.ratio=nt.currentlyVisibleHeight/nt.totalHeight,nt.barLength=Math.max(nt.ratio*nt.currentlyVisibleHeight,h.goldenRatio*h.scrollbarWidth),nt.barWiggleRoom=nt.currentlyVisibleHeight-nt.barLength,nt.wiggleRoom=Math.max(0,nt.totalHeight-nt.scrollableAreaHeight),nt.topY=nt.barWiggleRoom===0?0:st.scrollY/nt.wiggleRoom*nt.barWiggleRoom,nt.bottomY=nt.topY+nt.barLength,nt.dragMultiplier=nt.wiggleRoom/nt.barWiggleRoom}).attr("transform",function(st){var nt=st.width+h.scrollbarWidth/2+h.scrollbarOffset;return n(nt,U(st))});var Fe=Ce.selectAll("."+h.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(h.cn.scrollbar,!0);var ze=Fe.selectAll("."+h.cn.scrollbarSlider).data(e.repeat,e.keyFun);ze.enter().append("g").classed(h.cn.scrollbarSlider,!0),ze.attr("transform",function(st){return n(0,st.scrollbarState.topY||0)});var Ye=ze.selectAll("."+h.cn.scrollbarGlyph).data(e.repeat,e.keyFun);Ye.enter().append("line").classed(h.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",h.scrollbarWidth).attr("stroke-linecap","round").attr("y1",h.scrollbarWidth/2),Ye.attr("y2",function(st){return st.scrollbarState.barLength-h.scrollbarWidth/2}).attr("stroke-opacity",function(st){return st.columnDragInProgress||!st.scrollbarState.barWiggleRoom||ve?0:.4}),Ye.transition().delay(0).duration(0),Ye.transition().delay(h.scrollbarHideDelay).duration(h.scrollbarHideDuration).attr("stroke-opacity",0);var it=Fe.selectAll("."+h.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);it.enter().append("line").classed(h.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",h.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(st){var nt=b.event.y,Qe=this.getBoundingClientRect(),Le=st.scrollbarState,Te=nt-Qe.top,pe=b.scale.linear().domain([0,Le.scrollableAreaHeight]).range([0,Le.totalHeight]).clamp(!0);Le.topY<=Te&&Te<=Le.bottomY||re(ie,ae,null,pe(Te-Le.barLength/2))(st)}).call(b.behavior.drag().origin(function(st){return b.event.stopPropagation(),st.scrollbarState.scrollbarScrollInProgress=!0,st}).on("drag",re(ie,ae)).on("dragend",function(){})),it.attr("y2",function(st){return st.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(Ye.remove(),it.remove())}function g(ae,ie,ve,Ae){var Ce=x(ve),Fe=A(Ce);m(Fe);var ze=M(Fe);v(ze);var Ye=w(Fe),it=_(Ye);u(it),y(it,ie,Ae,ae),ee(Fe)}function x(ae){var ie=ae.selectAll("."+h.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(h.cn.columnCells,!0),ie.exit().remove(),ie}function A(ae){var ie=ae.selectAll("."+h.cn.columnCell).data(s.splitToCells,function(ve){return ve.keyWithinBlock});return ie.enter().append("g").classed(h.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+h.cn.cellRect).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("rect").classed(h.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+h.cn.cellText).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("text").classed(h.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){b.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+h.cn.cellTextHolder).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("g").classed(h.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function m(ae){ae.each(function(ie,ve){var Ae=ie.calcdata.cells.font,Ce=ie.column.specIndex,Fe={size:F(Ae.size,Ce,ve),color:F(Ae.color,Ce,ve),family:F(Ae.family,Ce,ve),weight:F(Ae.weight,Ce,ve),style:F(Ae.style,Ce,ve),variant:F(Ae.variant,Ce,ve),textcase:F(Ae.textcase,Ce,ve),lineposition:F(Ae.lineposition,Ce,ve),shadow:F(Ae.shadow,Ce,ve)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Ce,ve),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Ce,ve),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(b.select(this),ie.font)})}function v(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var ve=b.select(this);f.stroke(ve,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),f.fill(ve,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function y(ae,ie,ve,Ae){ae.text(function(Ce){var Fe=Ce.column.specIndex,ze=Ce.rowNumber,Ye=Ce.value,it=typeof Ye=="string",st=it&&Ye.match(/
/i),nt=!it||st;Ce.mayHaveMarkup=it&&Ye.match(/[<&>]/);var Qe=I(Ye);Ce.latex=Qe;var Le=Qe?"":F(Ce.calcdata.cells.prefix,Fe,ze)||"",Te=Qe?"":F(Ce.calcdata.cells.suffix,Fe,ze)||"",pe=Qe?null:F(Ce.calcdata.cells.format,Fe,ze)||null,Ne=Le+(pe?E(pe)(Ce.value):Ce.value)+Te,ot;Ce.wrappingNeeded=!Ce.wrapped&&!nt&&!Qe&&(ot=L(Ne)),Ce.cellHeightMayIncrease=st||Qe||Ce.mayHaveMarkup||(ot===void 0?L(Ne):ot),Ce.needsConvertToTspans=Ce.mayHaveMarkup||Ce.wrappingNeeded||Ce.latex;var ct;if(Ce.wrappingNeeded){var rt=h.wrapSplitCharacter===" "?Ne.replace(/Ce&&Ae.push(Fe),Ce+=it}return Ae}function Z(ae,ie,ve){var Ae=T(ie)[0];if(Ae!==void 0){var Ce=Ae.rowBlocks,Fe=Ae.calcdata,ze=ne(Ce,Ce.length),Ye=Ae.calcdata.groupHeight-U(Ae),it=Fe.scrollY=Math.max(0,Math.min(ze-Ye,Fe.scrollY)),st=j(Ce,it,Ye);st.length===1&&(st[0]===Ce.length-1?st.unshift(st[0]-1):st.push(st[0]+1)),st[0]%2&&st.reverse(),ie.each(function(nt,Qe){nt.page=st[Qe],nt.scrollY=it}),ie.attr("transform",function(nt){var Qe=ne(nt.rowBlocks,nt.page)-nt.scrollY;return n(0,Qe)}),ae&&(fe(ae,ve,ie,st,Ae.prevPages,Ae,0),fe(ae,ve,ie,st,Ae.prevPages,Ae,1),l(ve,ae))}}function re(ae,ie,ve,Ae){return function(Fe){var ze=Fe.calcdata?Fe.calcdata:Fe,Ye=ie.filter(function(Qe){return ze.key===Qe.key}),it=ve||ze.scrollbarState.dragMultiplier,st=ze.scrollY;ze.scrollY=Ae===void 0?ze.scrollY+it*b.event.dy:Ae;var nt=Ye.selectAll("."+h.cn.yColumn).selectAll("."+h.cn.columnBlock).filter(B);return Z(ae,nt,Ye),ze.scrollY===st}}function fe(ae,ie,ve,Ae,Ce,Fe,ze){var Ye=Ae[ze]!==Ce[ze];Ye&&(clearTimeout(Fe.currentRepaint[ze]),Fe.currentRepaint[ze]=setTimeout(function(){var it=ve.filter(function(st,nt){return nt===ze&&Ae[nt]!==Ce[nt]});g(ae,ie,it,ve),Ce[ze]=Ae[ze]}))}function le(ae,ie,ve,Ae){return function(){var Fe=b.select(ie.parentNode);Fe.each(function(ze){var Ye=ze.fragments;Fe.selectAll("tspan.line").each(function(Ne,ot){Ye[ot].width=this.getComputedTextLength()});var it=Ye[Ye.length-1].width,st=Ye.slice(0,-1),nt=[],Qe,Le,Te=0,pe=ze.column.columnWidth-2*h.cellPad;for(ze.value="";st.length;)Qe=st.shift(),Le=Qe.width+it,Te+Le>pe&&(ze.value+=nt.join(h.wrapSpacer)+h.lineBreaker,nt=[],Te=0),nt.push(Qe.text),Te+=Le;Te&&(ze.value+=nt.join(h.wrapSpacer)),ze.wrapped=!0}),Fe.selectAll("tspan.line").remove(),y(Fe.select("."+h.cn.cellText),ve,ae,Ae),b.select(ie.parentNode.parentNode).call(ee)}}function ce(ae,ie,ve,Ae,Ce){return function(){if(!Ce.settledY){var ze=b.select(ie.parentNode),Ye=te(Ce),it=Ce.key-Ye.firstRowIndex,st=Ye.rows[it].rowHeight,nt=Ce.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*h.cellPad:st,Qe=Math.max(nt,st),Le=Qe-Ye.rows[it].rowHeight;Le&&(Ye.rows[it].rowHeight=Qe,ae.selectAll("."+h.cn.columnCell).call(ee),Z(null,ae.filter(B),0),l(ve,Ae,!0)),ze.attr("transform",function(){var Te=this,pe=Te.parentNode,Ne=pe.getBoundingClientRect(),ot=b.select(Te.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),ct=Te.transform.baseVal.consolidate(),rt=ot.top-Ne.top+(ct?ct.matrix.f:h.cellPad);return n(V(Ce,b.select(Te.parentNode).select("."+h.cn.cellTextHolder).node().getBoundingClientRect().width),rt)}),Ce.settledY=!0}}}function V(ae,ie){switch(ae.align){case"left":return h.cellPad;case"right":return ae.column.columnWidth-(ie||0)-h.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return h.cellPad}}function ee(ae){ae.attr("transform",function(ie){var ve=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(ze,Ye){return ze+K(Ye,1/0)},0),Ae=te(ie),Ce=K(Ae,ie.key),Fe=Ce+ve;return n(0,Fe)}).selectAll("."+h.cn.cellRect).attr("height",function(ie){return H(te(ie),ie.key).rowHeight})}function ne(ae,ie){for(var ve=0,Ae=ie-1;Ae>=0;Ae--)ve+=ue(ae[Ae]);return ve}function K(ae,ie){for(var ve=0,Ae=0;AeE.length&&(S=S.slice(0,E.length)):S=[],t=0;t90&&(p-=180,i=-i),{angle:p,flip:i,p:b.c2p(e,S,E),offsetMultplier:a}}}}),t7=Ge({"src/traces/carpet/plot.js"($,G){var h=Mi(),b=Ss(),S=cL(),E=fL(),e=e7(),t=Ju(),r=gn(),o=r.strRotate,n=r.strTranslate,i=Qh();G.exports=function(g,x,A,M){var _=g._context.staticPlot,w=x.xaxis,m=x.yaxis,u=g._fullLayout,v=u._clips;r.makeTraceGroups(M,A,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace,F=z.aaxis,N=z.baxis,B=r.ensureSingle(I,"g","minorlayer"),R=r.ensureSingle(I,"g","majorlayer"),U=r.ensureSingle(I,"g","boundarylayer"),j=r.ensureSingle(I,"g","labellayer");I.style("opacity",z.opacity),s(w,m,R,F,"a",F._gridlines,!0),s(w,m,R,N,"b",N._gridlines,!0),s(w,m,B,F,"a",F._minorgridlines,!0),s(w,m,B,N,"b",N._minorgridlines,!0),s(w,m,U,F,"a-boundary",F._boundarylines,_),s(w,m,U,N,"b-boundary",N._boundarylines,_);var Z=f(g,w,m,z,L,j,F._labels,"a-label"),re=f(g,w,m,z,L,j,N._labels,"b-label");c(g,j,z,L,w,m,Z,re),a(z,L,v,w,m)})};function a(l,g,x,A,M){var _,w,m,u,v=x.select("#"+l._clipPathId);v.size()||(v=x.append("clipPath").classed("carpetclip",!0));var y=r.ensureSingle(v,"path","carpetboundary"),I=g.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(b.font,I.font).text(I.text).call(t.convertToTspans,l),R=b.bBox(this);B.attr("transform",n(z.p[0],z.p[1])+o(z.angle)+n(I.axis.labelpadding*N,R.height*.3)),v=Math.max(v,R.width+I.axis.labelpadding)}),u.exit().remove(),y.maxExtent=v,y}function c(l,g,x,A,M,_,w,m){var u,v,y,I,L=r.aggNums(Math.min,null,x.a),z=r.aggNums(Math.max,null,x.a),F=r.aggNums(Math.min,null,x.b),N=r.aggNums(Math.max,null,x.b);u=.5*(L+z),v=F,y=x.ab2xy(u,v,!0),I=x.dxyda_rough(u,v),w.angle===void 0&&r.extendFlat(w,e(x,M,_,y,x.dxydb_rough(u,v))),T(l,g,x,A,y,I,x.aaxis,M,_,w,"a-title"),u=L,v=.5*(F+N),y=x.ab2xy(u,v,!0),I=x.dxydb_rough(u,v),m.angle===void 0&&r.extendFlat(m,e(x,M,_,y,x.dxyda_rough(u,v))),T(l,g,x,A,y,I,x.baxis,M,_,m,"b-title")}var p=i.LINE_SPACING,d=(1-i.MID_SHIFT)/p+1;function T(l,g,x,A,M,_,w,m,u,v,y){var I=[];w.title.text&&I.push(w.title.text);var L=g.selectAll("text."+y).data(I),z=v.maxExtent;L.enter().append("text").classed(y,!0),L.each(function(){var F=e(x,m,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var N=w.title.font.size;z+=N+w.title.offset;var B=v.angle+(v.flip<0?180:0),R=(B-F.angle+450)%360,U=R>90&&R<270,j=h.select(this);j.text(w.title.text).call(t.convertToTspans,l),U&&(z=(-t.lineCount(j)+d)*p*N-z),j.attr("transform",n(F.p[0],F.p[1])+o(F.angle)+n(0,z)).attr("text-anchor","middle").call(b.font,w.title.font)}),L.exit().remove()}}}),r7=Ge({"src/traces/carpet/cheater_basis.js"($,G){var h=gn().isArrayOrTypedArray;G.exports=function(b,S,E){var e,t,r,o,n,i,a=[],s=h(b)?b.length:b,f=h(S)?S.length:S,c=h(b)?b:null,p=h(S)?S:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(f-1));var d,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=S.length,o=0;o0&&(K=E.dxydi([],Z-1,fe,0,le),ae.push(ce[0]+K[0]/3),ie.push(ce[1]+K[1]/3),ue=E.dxydi([],Z-1,fe,1,le),ae.push(ne[0]-ue[0]/3),ie.push(ne[1]-ue[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;else for(Z=E.a2i(j),V=Math.floor(Math.max(0,Math.min(F-2,Z))),ee=Z-V,ve.length=F,ve.crossLength=N,ve.xy=function(Ae){return E.evalxy([],Z,Ae)},ve.dxy=function(Ae,Ce){return E.dxydj([],V,Ae,ee,Ce)},re=0;re0&&(te=E.dxydj([],V,re-1,ee,0),ae.push(ce[0]+te[0]/3),ie.push(ce[1]+te[1]/3),H=E.dxydj([],V,re-1,ee,1),ae.push(ne[0]-H[0]/3),ie.push(ne[1]-H[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;return ve.axisLetter=e,ve.axis=M,ve.crossAxis=v,ve.value=j,ve.constvar=t,ve.index=c,ve.x=ae,ve.y=ie,ve.smoothing=v.smoothing,ve}function U(j){var Z,re,fe,le,ce,V=[],ee=[],ne={};if(ne.length=A.length,ne.crossLength=u.length,e==="b")for(fe=Math.max(0,Math.min(N-2,j)),ce=Math.min(1,Math.max(0,j-fe)),ne.xy=function(K){return E.evalxy([],K,j)},ne.dxy=function(K,ue){return E.dxydi([],K,fe,ue,ce)},Z=0;ZA.length-1)&&_.push(b(U(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s;cA.length-1)&&!(T<0||T>A.length-1))for(l=A[n],g=A[T],r=0;rA[A.length-1])&&w.push(b(R(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&m.push(b(U(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(U(A.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,a=[Math.floor((A[A.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((A[0]-M.tick0)/M.dtick/(1+i))].sort(function(j,Z){return j-Z}),s=a[0],f=a[1],c=s;c<=f;c++)p=M.tick0+M.dtick*c,_.push(b(R(p),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s-1;cA[A.length-1])&&w.push(b(R(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&m.push(b(R(A[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(R(A[A.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),i7=Ge({"src/traces/carpet/calc_labels.js"($,G){var h=ws(),b=Qi().extendFlat;G.exports=function(E,e){var t,r,o,n,i,a=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=b[f][t],o[s-t]=S[f][t];for(n.push({x:r,y:o,bicubic:i}),t=f,r=[],o=[];t>=0;t--)r[f-t]=b[t][0],o[f-t]=S[t][0];return n.push({x:r,y:o,bicubic:a}),n}}}),s7=Ge({"src/traces/carpet/smooth_fill_2d_array.js"($,G){var h=gn();G.exports=function(S,E,e){var t,r,o,n=[],i=[],a=S[0].length,s=S.length;function f(re,fe){var le=0,ce,V=0;return re>0&&(ce=S[fe][re-1])!==void 0&&(V++,le+=ce),re0&&(ce=S[fe-1][re])!==void 0&&(V++,le+=ce),fe0&&r0&&tu);return h.log("Smoother converged to",v,"after",I,"iterations"),S}}}),l7=Ge({"src/traces/carpet/constants.js"($,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),u7=Ge({"src/traces/carpet/catmull_rom.js"($,G){var h=.5;G.exports=function(S,E,e,t){var r=S[0]-E[0],o=S[1]-E[1],n=e[0]-E[0],i=e[1]-E[1],a=Math.pow(r*r+o*o,h/2),s=Math.pow(n*n+i*i,h/2),f=(s*s*r-a*a*n)*t,c=(s*s*o-a*a*i)*t,p=s*(a+s)*3,d=a*(a+s)*3;return[[E[0]+(p&&f/p),E[1]+(p&&c/p)],[E[0]-(d&&f/d),E[1]-(d&&c/d)]]}}}),c7=Ge({"src/traces/carpet/compute_control_points.js"($,G){var h=u7(),b=gn().ensureArray;function S(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,n,i){var a,s,f,c,p,d,T,l,g,x,A=r[0].length,M=r.length,_=n?3*A-2:A,w=i?3*M-2:M;for(e=b(e,w),t=b(t,w),f=0;fp&&_T&&wd||wl},o.setScale=function(){var _=o._x,w=o._y,m=S(o._xctrl,o._yctrl,_,w,f.smoothing,c.smoothing);o._xctrl=m[0],o._yctrl=m[1],o.evalxy=E([o._xctrl,o._yctrl],a,s,f.smoothing,c.smoothing),o.dxydi=e([o._xctrl,o._yctrl],f.smoothing,c.smoothing),o.dxydj=t([o._xctrl,o._yctrl],f.smoothing,c.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),a-2),m=_[0]-w;return(1-m)*n[w]+m*n[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),a-2),m=_[1]-w;return(1-m)*i[w]+m*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(b(_,n),a-2)),m=n[w],u=n[w+1];return Math.max(0,Math.min(a-1,w+(_-m)/(u-m)))},o.b2j=function(_){var w=Math.max(0,Math.min(b(_,i),s-2)),m=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-m)/(u-m)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,m){if(!m&&(_n[a-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),v=o.b2j(w),y=o.evalxy([],u,v);if(m){var I=0,L=0,z=[],F,N,B,R;_n[a-1]?(F=a-2,N=1,I=(_-n[a-1])/(n[a-1]-n[a-2])):(F=Math.max(0,Math.min(a-2,Math.floor(u))),N=u-F),wi[s-1]?(B=s-2,R=1,L=(w-i[s-1])/(i[s-1]-i[s-2])):(B=Math.max(0,Math.min(s-2,Math.floor(v))),R=v-B),I&&(o.dxydi(z,F,B,N,R),y[0]+=z[0]*I,y[1]+=z[1]*I),L&&(o.dxydj(z,F,B,N,R),y[0]+=z[0]*L,y[1]+=z[1]*L)}return y},o.c2p=function(_,w,m){return[w.c2p(_[0]),m.c2p(_[1])]},o.p2x=function(_,w,m){return[w.p2c(_[0]),m.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(n.length-2,_));return n[w+1]-n[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,m,u){var v=o.dxydi(null,_,w,m,u),y=o.dadi(_,m);return[v[0]/y,v[1]/y]},o.dxydb=function(_,w,m,u){var v=o.dxydj(null,_,w,m,u),y=o.dbdj(w,u);return[v[0]/y,v[1]/y]},o.dxyda_rough=function(_,w,m){var u=g*(m||.1),v=o.ab2xy(_+u,w,!0),y=o.ab2xy(_-u,w,!0);return[(v[0]-y[0])*.5/u,(v[1]-y[1])*.5/u]},o.dxydb_rough=function(_,w,m){var u=x*(m||.1),v=o.ab2xy(_,w+u,!0),y=o.ab2xy(_,w-u,!0);return[(v[0]-y[0])*.5/u,(v[1]-y[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),p7=Ge({"src/traces/carpet/calc.js"($,G){var h=ws(),b=gn().isArray1D,S=r7(),E=n7(),e=a7(),t=i7(),r=o7(),o=Fx(),n=s7(),i=Ox(),a=d7();G.exports=function(f,c){var p=h.getFromId(f,c.xaxis),d=h.getFromId(f,c.yaxis),T=c.aaxis,l=c.baxis,g=c.x,x=c.y,A=[];g&&b(g)&&A.push("x"),x&&b(x)&&A.push("y"),A.length&&i(c,T,l,"a","b",A);var M=c._a=c._a||c.a,_=c._b=c._b||c.b;g=c._x||c.x,x=c._y||c.y;var w={};if(c._cheater){var m=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;g=S(m,u,c.cheaterslope)}c._x=g=o(g),c._y=x=o(x),n(g,M,_),n(x,M,_),a(c),c.setScale();var v=E(g),y=E(x),I=.5*(v[1]-v[0]),L=.5*(v[1]+v[0]),z=.5*(y[1]-y[0]),F=.5*(y[1]+y[0]),N=1.3;return v=[L-I*N,L+I*N],y=[F-z*N,F+z*N],c._extremes[p._id]=h.findExtremes(p,v,{padded:!0}),c._extremes[d._id]=h.findExtremes(d,y,{padded:!0}),e(c,"a","b"),e(c,"b","a"),t(c,T),t(c,l),w.clipsegments=r(c._xctrl,c._yctrl,T,l),w.x=g,w.y=x,w.a=M,w.b=_,[w]}}}),m7=Ge({"src/traces/carpet/index.js"($,G){G.exports={attributes:OE(),supplyDefaults:Qz(),plot:t7(),calc:p7(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:dh(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),g7=Ge({"lib/carpet.js"($,G){G.exports=m7()}}),hL=Ge({"src/traces/scattercarpet/attributes.js"($,G){var h=nd(),b=Uc(),S=ru(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Al(),r=Pu(),o=Qi().extendFlat,n=b.marker,i=b.line,a=n.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},b.mode,{dflt:"markers"}),text:o({},b.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},b.hovertext,{}),line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:b.connectgaps,fill:o({},b.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:h(),marker:o({symbol:n.symbol,opacity:n.opacity,maxdisplayed:n.maxdisplayed,angle:n.angle,angleref:n.angleref,standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:o({width:a.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:b.textfont,textposition:b.textposition,selected:b.selected,unselected:b.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:b.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:b.zorder}}}),y7=Ge({"src/traces/scattercarpet/defaults.js"($,G){var h=gn(),b=o0(),S=iu(),E=Hv(),e=Bp(),t=Gv(),r=ep(),o=Iv(),n=hL();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}p("carpet"),s.xaxis="x",s.yaxis="y";var d=p("a"),T=p("b"),l=Math.min(d.length,T.length);if(!l){s.visible=!1;return}s._length=l,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext");var g=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!p.hovertemplate){var x=c.hi||p.hoverinfo,A=x.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&g(d.aaxis,c.a),A.indexOf("b")!==-1&&g(d.baxis,c.b),l.push("y: "+n.yLabel),A.indexOf("text")!==-1&&b(c,p,l),n.extraText=l.join("
")}return o}}}),T7=Ge({"src/traces/scattercarpet/event_data.js"($,G){G.exports=function(b,S,E,e,t){var r=e[t];return b.a=r.a,b.b=r.b,b.y=r.y,b}}}),A7=Ge({"src/traces/scattercarpet/index.js"($,G){G.exports={attributes:hL(),supplyDefaults:y7(),colorbar:qf(),formatLabels:_7(),calc:x7(),plot:b7(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:w7(),selectPoints:sg(),eventData:T7(),moduleType:"trace",name:"scattercarpet",basePlotModule:dh(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),S7=Ge({"lib/scattercarpet.js"($,G){G.exports=A7()}}),vL=Ge({"src/traces/contourcarpet/attributes.js"($,G){var h=mv(),b=G1(),S=Pu(),E=Qi().extendFlat,e=b.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:h.z,a:h.x,a0:h.x0,da:h.dx,b:h.y,b0:h.y0,db:h.dy,text:h.text,hovertext:h.hovertext,transpose:h.transpose,atype:h.xtype,btype:h.ytype,fillcolor:b.fillcolor,autocontour:b.autocontour,ncontours:b.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:b.line.color,width:b.line.width,dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},zorder:b.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),dL=Ge({"src/traces/contourcarpet/defaults.js"($,G){var h=gn(),b=mh(),S=vL(),E=I2(),e=$x(),t=X1();G.exports=function(o,n,i,a){function s(d,T){return h.coerce(o,n,S,d,T)}function f(d){return h.coerce2(o,n,S,d)}if(s("carpet"),o.a&&o.b){var c=b(o,n,s,a,"a","b");if(!c){n.visible=!1;return}s("text");var p=s("contours.type")==="constraint";p?E(o,n,s,a,i,{hasHover:!1}):(e(o,n,s,f),t(o,n,s,a,{hasHover:!1}))}else n._defaultColor=i,n._length=null;s("zorder")}}}),M7=Ge({"src/traces/contourcarpet/calc.js"($,G){var h=dv(),b=gn(),S=Ox(),E=Fx(),e=Bx(),t=Nx(),r=S2(),o=dL(),n=FE(),i=C2();G.exports=function(f,c){var p=c._carpetTrace=n(f,c);if(!(!p||!p.visible||p.visible==="legendonly")){if(!c.a||!c.b){var d=f.data[p.index],T=f.data[c.index];T.a||(T.a=d.a),T.b||(T.b=d.b),o(T,c,c._defaultColor,f._fullLayout)}var l=a(f,c);return i(c,c._z),l}};function a(s,f){var c=f._carpetTrace,p=c.aaxis,d=c.baxis,T,l,g,x,A,M,_;p._minDtick=0,d._minDtick=0,b.isArray1D(f.z)&&S(f,p,d,"a","b",["z"]),T=f._a=f._a||f.a,x=f._b=f._b||f.b,T=T?p.makeCalcdata(f,"_a"):[],x=x?d.makeCalcdata(f,"_b"):[],l=f.a0||0,g=f.da||1,A=f.b0||0,M=f.db||1,_=f._z=E(f._z||f.z,f.transpose),f._emptypoints=t(_),e(_,f._emptypoints);var w=b.maxRowLength(_),m=f.xtype==="scaled"?"":T,u=r(f,m,l,g,w,p),v=f.ytype==="scaled"?"":x,y=r(f,v,A,M,_.length,d),I={a:u,b:y,z:_};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&h(s,f,{vals:_,containerStr:"",cLetter:"z"}),[I]}}}),E7=Ge({"src/traces/carpet/axis_aligned_line.js"($,G){var h=gn().isArrayOrTypedArray;G.exports=function(b,S,E,e){var t,r,o,n,i,a,s,f,c,p,d,T,l,g=h(E)?"a":"b",x=g==="a"?b.aaxis:b.baxis,A=x.smoothing,M=g==="a"?b.a2i:b.b2j,_=g==="a"?E:e,w=g==="a"?e:E,m=g==="a"?S.a.length:S.b.length,u=g==="a"?S.b.length:S.a.length,v=Math.floor(g==="a"?b.b2j(w):b.a2i(w)),y=g==="a"?function(fe){return b.evalxy([],fe,v)}:function(fe){return b.evalxy([],v,fe)};A&&(o=Math.max(0,Math.min(u-2,v)),n=v-o,r=g==="a"?function(fe,le){return b.dxydi([],fe,o,le,n)}:function(fe,le){return b.dxydj([],o,fe,n,le)});var I=M(_[0]),L=M(_[1]),z=I0?Math.floor:Math.ceil,B=z>0?Math.ceil:Math.floor,R=z>0?Math.min:Math.max,U=z>0?Math.max:Math.min,j=N(I+F),Z=B(L-F);s=y(I);var re=[[s]];for(t=j;t*z=0;ve--)H=U.clipsegments[ve],ae=b([],H.x,I.c2p),ie=b([],H.y,L.c2p),ae.reverse(),ie.reverse(),Ae.push(S(ae,ie,H.bicubic));var Ce="M"+Ae.join("L")+"Z";A(F,U.clipsegments,I,L,le,V),M(B,F,I,L,te,ne,ee,R,U,V,Ce),d(F,fe,m,N,re,u,R),E.setClipUrl(F,R._clipPathId,m)})};function p(w,m){var u,v,y,I,L,z,F,N,B;for(u=0;ufe&&(v.max=fe),v.len=v.max-v.min}function l(w,m,u){var v=w.getPointAtLength(m),y=w.getPointAtLength(u),I=y.x-v.x,L=y.y-v.y,z=Math.sqrt(I*I+L*L);return[I/z,L/z]}function g(w){var m=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/m,w[1]/m]}function x(w,m){var u=Math.abs(w[0]*m[0]+w[1]*m[1]),v=Math.sqrt(1-u*u);return v/u}function A(w,m,u,v,y,I){var L,z,F,N,B=e.ensureSingle(w,"g","contourbg"),R=B.selectAll("path").data(I==="fill"&&!y?[0]:[]);R.enter().append("path"),R.exit().remove();var U=[];for(N=0;N=0&&(j=ae,re=fe):Math.abs(U[1]-j[1])=0&&(j=ae,re=fe):e.log("endpt to newendpt is not vert. or horz.",U,j,ae)}if(re>=0)break;N+=te(U,j),U=j}if(re===m.edgepaths.length){e.log("unclosed perimeter path");break}F=re,R=B.indexOf(F)===-1,R&&(F=B[0],N+=te(U,j)+"Z",U=null)}for(F=0;F_):M=z>y,_=z;var F=p(y,I,L,z);F.pos=v,F.yc=(y+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,I],w&&(F.orig_p=s[u]),x&&(F.tx=a.text[u]),A&&(F.htx=a.hovertext[u]),m.push(F)}else m.push({pos:v,empty:!0})}return a._extremes[c._id]=S.findExtremes(c,h.concat(l,T),{padded:!0}),m.length&&(m[0].t={labels:{open:b(i,"open:")+" ",high:b(i,"high:")+" ",low:b(i,"low:")+" ",close:b(i,"close:")+" "}}),m}function n(i,a,s){var f=s._minDiff;if(!f){var c=i._fullData,p=[];f=1/0;var d;for(d=0;d"+g.labels[v]+h.hoverLabelText(T,y,l.yhoverformat)):(L=b.extendFlat({},A),L.y0=L.y1=I,L.yLabelVal=y,L.yLabel=g.labels[v]+h.hoverLabelText(T,y,l.yhoverformat),L.name="",x.push(L),m[y]=L)}return x}function a(s,f,c,p){var d=s.cd,T=s.ya,l=d[0].trace,g=d[0].t,x=n(s,f,c,p);if(!x)return[];var A=x.index,M=d[A],_=x.index=M.i,w=M.dir;function m(F){return g.labels[F]+h.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",v=u.split("+"),y=u==="all",I=y||v.indexOf("y")!==-1,L=y||v.indexOf("text")!==-1,z=I?[m("open"),m("high"),m("low"),m("close")+" "+r[w]]:[];return L&&e(M,l,z),x.extraText=z.join("
"),x.y0=x.y1=T.c2p(M.yc,!0),[x]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:a}}}),yL=Ge({"src/traces/ohlc/select.js"($,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n=E[0].t.bPos||0;if(S===!1)for(o=0;of?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var g=n.c2l(l)-s;return(T(g)?g:0)+d},n.g2c=function(l){return n.l2c(l+s-d)},n.g2p=function(l){return l*p},n.c2p=function(l){return n.g2p(n.c2g(l))}}}function t(n,i){return i==="degrees"?S(n):n}function r(n,i){return i==="degrees"?E(n):n}function o(n,i){var a=n.type;if(a==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(c,p){return t(s(c),p)},n.c2d=function(c,p){return f(r(c,p))}}n.makeCalcdata=function(c,p){var d=c[p],T=c._length,l,g,x=function(m){return n.d2c(m,c.thetaunit)};if(d)for(l=new Array(T),g=0;g0?m:1/0},M=S(x,A),_=h.mod(M+1,x.length);return[x[M],x[_]]}function p(g){return Math.abs(g)>1e-10?g:0}function d(g,x,A){x=x||0,A=A||0;for(var M=g.length,_=new Array(M),w=0;w0?1:0}function b(r){var o=r[0],n=r[1];if(!isFinite(o)||!isFinite(n))return[1,0];var i=(o+1)*(o+1)+n*n;return[(o*o+n*n-1)/i,2*n/i]}function S(r,o){var n=o[0],i=o[1];return[n*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,n,i){var a=S(r,b([n,o])),s=a[0],f=a[1],c=S(r,b([i,o])),p=c[0],d=c[1];if(o===0)return["M"+s+","+f,"L"+p+","+d].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+f,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+p+","+d].join(" ")}function t(r,o,n,i){var a=E(r,1/(o+1)),s=S(r,b([o,n])),f=s[0],c=s[1],p=S(r,b([o,i])),d=p[0],T=p[1];if(h(n)!==h(i)){var l=S(r,b([o,0])),g=l[0],x=l[1];return["M"+f+","+c,"A"+a+","+a+" 0 0,"+(0it?(st=ie,nt=ie*it,Te=(ve-nt)/K.h/2,Qe=[H[0],H[1]],Le=[ae[0]+Te,ae[1]-Te]):(st=ve/it,nt=ve,Te=(ie-st)/K.w/2,Qe=[H[0]+Te,H[1]-Te],Le=[ae[0],ae[1]]),ee.xLength2=st,ee.yLength2=nt,ee.xDomain2=Qe,ee.yDomain2=Le;var pe=ee.xOffset2=K.l+K.w*Qe[0],Ne=ee.yOffset2=K.t+K.h*(1-Le[1]),ot=ee.radius=st/Fe,ct=ee.innerRadius=ee.getHole(V)*ot,rt=ee.cx=pe-ot*Ce[0],Ft=ee.cy=Ne+ot*Ce[3],Nt=ee.cxx=rt-pe,$t=ee.cyy=Ft-Ne,rr=ue.side,Mr;rr==="counterclockwise"?(Mr=rr,rr="top"):rr==="clockwise"&&(Mr=rr,rr="bottom"),ee.radialAxis=ee.mockAxis(ce,V,ue,{_id:"x",side:rr,_trueSide:Mr,domain:[ct/K.w,ot/K.w]}),ee.angularAxis=ee.mockAxis(ce,V,te,{side:"right",domain:[0,Math.PI],autorange:!1}),ee.doAutoRange(ce,V),ee.updateAngularAxis(ce,V),ee.updateRadialAxis(ce,V),ee.updateRadialAxisTitle(ce,V),ee.xaxis=ee.mockCartesianAxis(ce,V,{_id:"x",domain:Qe}),ee.yaxis=ee.mockCartesianAxis(ce,V,{_id:"y",domain:Le});var Sr=ee.pathSubplot();ee.clipPaths.forTraces.select("path").attr("d",Sr).attr("transform",t(Nt,$t)),ne.frontplot.attr("transform",t(pe,Ne)).call(o.setClipUrl,ee._hasClipOnAxisFalse?null:ee.clipIds.forTraces,ee.gd),ne.bg.attr("d",Sr).attr("transform",t(rt,Ft)).call(r.fill,V.bgcolor)},j.mockAxis=function(ce,V,ee,ne){var K=E.extendFlat({},ee,ne);return s(K,V,ce),K},j.mockCartesianAxis=function(ce,V,ee){var ne=this,K=ne.isSmith,ue=ee._id,te=E.extendFlat({type:"linear"},ee);a(te,ce);var H={x:[0,2],y:[1,3]};return te.setRange=function(){var ae=ne.sectorBBox,ie=H[ue],ve=ne.radialAxis._rl,Ae=(ve[1]-ve[0])/(1-ne.getHole(V));te.range=[ae[ie[0]]*Ae,ae[ie[1]]*Ae]},te.isPtWithinRange=ue==="x"&&!K?function(ae){return ne.isPtInside(ae)}:function(){return!0},te.setRange(),te.setScale(),te},j.doAutoRange=function(ce,V){var ee=this,ne=ee.gd,K=ee.radialAxis,ue=ee.getRadial(V);f(ne,K);var te=K.range;if(ue.range=te.slice(),ue._input.range=te.slice(),K._rl=[K.r2l(te[0],null,"gregorian"),K.r2l(te[1],null,"gregorian")],K.minallowed!==void 0){var H=K.r2l(K.minallowed);K._rl[0]>K._rl[1]?K._rl[1]=Math.max(K._rl[1],H):K._rl[0]=Math.max(K._rl[0],H)}if(K.maxallowed!==void 0){var ae=K.r2l(K.maxallowed);K._rl[0]90&&ve<=270&&(Ae.tickangle=180);var ze=Fe?function(ot){var ct=z(ee,y([ot.x,0]));return t(ct[0]-H,ct[1]-ae)}:function(ot){return t(Ae.l2p(ot.x)+te,0)},Ye=Fe?function(ot){return L(ee,ot.x,-1/0,1/0)}:function(ot){return ee.pathArc(Ae.r2p(ot.x)+te)},it=Z(ie);if(ee.radialTickLayout!==it&&(K["radial-axis"].selectAll(".xtick").remove(),ee.radialTickLayout=it),Ce){Ae.setScale();var st=0,nt=Fe?(Ae.tickvals||[]).filter(function(ot){return ot>=0}).map(function(ot){return i.tickText(Ae,ot,!0,!1)}):i.calcTicks(Ae),Qe=Fe?nt:i.clipEnds(Ae,nt),Le=i.getTickSigns(Ae)[2];Fe&&((Ae.ticks==="top"&&Ae.side==="bottom"||Ae.ticks==="bottom"&&Ae.side==="top")&&(Le=-Le),Ae.ticks==="top"&&Ae.side==="top"&&(st=-Ae.ticklen),Ae.ticks==="bottom"&&Ae.side==="bottom"&&(st=Ae.ticklen)),i.drawTicks(ne,Ae,{vals:nt,layer:K["radial-axis"],path:i.makeTickPath(Ae,0,Le),transFn:ze,crisp:!1}),i.drawGrid(ne,Ae,{vals:Qe,layer:K["radial-grid"],path:Ye,transFn:E.noop,crisp:!1}),i.drawLabels(ne,Ae,{vals:nt,layer:K["radial-axis"],transFn:ze,labelFns:i.makeLabelFns(Ae,st)})}var Te=ee.radialAxisAngle=ee.vangles?R(fe(B(ie.angle),ee.vangles)):ie.angle,pe=t(H,ae),Ne=pe+e(-Te);le(K["radial-axis"],Ce&&(ie.showticklabels||ie.ticks),{transform:Ne}),le(K["radial-grid"],Ce&&ie.showgrid,{transform:Fe?"":pe}),le(K["radial-line"].select("line"),Ce&&ie.showline,{x1:Fe?-ue:te,y1:0,x2:ue,y2:0,transform:Ne}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateRadialAxisTitle=function(ce,V,ee){if(!this.isSmith){var ne=this,K=ne.gd,ue=ne.radius,te=ne.cx,H=ne.cy,ae=ne.getRadial(V),ie=ne.id+"title",ve=0;if(ae.title){var Ae=o.bBox(ne.layers["radial-axis"].node()).height,Ce=ae.title.font.size,Fe=ae.side;ve=Fe==="top"?Ce:Fe==="counterclockwise"?-(Ae+Ce*.4):Ae+Ce*.8}var ze=ee!==void 0?ee:ne.radialAxisAngle,Ye=B(ze),it=Math.cos(Ye),st=Math.sin(Ye),nt=te+ue/2*it+ve*st,Qe=H-ue/2*st+ve*it;ne.layers["radial-axis-title"]=T.draw(K,ie,{propContainer:ae,propName:ne.id+".radialaxis.title.text",placeholder:F(K,"Click to enter radial axis title"),attributes:{x:nt,y:Qe,"text-anchor":"middle"},transform:{rotate:-ze}})}},j.updateAngularAxis=function(ce,V){var ee=this,ne=ee.gd,K=ee.layers,ue=ee.radius,te=ee.innerRadius,H=ee.cx,ae=ee.cy,ie=ee.getAngular(V),ve=ee.angularAxis,Ae=ee.isSmith;Ae||(ee.fillViewInitialKey("angularaxis.rotation",ie.rotation),ve.setGeometry(),ve.setScale());var Ce=Ae?function(ct){var rt=z(ee,y([0,ct.x]));return Math.atan2(rt[0]-H,rt[1]-ae)-Math.PI/2}:function(ct){return ve.t2g(ct.x)};ve.type==="linear"&&ve.thetaunit==="radians"&&(ve.tick0=R(ve.tick0),ve.dtick=R(ve.dtick));var Fe=function(ct){return t(H+ue*Math.cos(ct),ae-ue*Math.sin(ct))},ze=Ae?function(ct){var rt=z(ee,y([0,ct.x]));return t(rt[0],rt[1])}:function(ct){return Fe(Ce(ct))},Ye=Ae?function(ct){var rt=z(ee,y([0,ct.x])),Ft=Math.atan2(rt[0]-H,rt[1]-ae)-Math.PI/2;return t(rt[0],rt[1])+e(-R(Ft))}:function(ct){var rt=Ce(ct);return Fe(rt)+e(-R(rt))},it=Ae?function(ct){return I(ee,ct.x,0,1/0)}:function(ct){var rt=Ce(ct),Ft=Math.cos(rt),Nt=Math.sin(rt);return"M"+[H+te*Ft,ae-te*Nt]+"L"+[H+ue*Ft,ae-ue*Nt]},st=i.makeLabelFns(ve,0),nt=st.labelStandoff,Qe={};Qe.xFn=function(ct){var rt=Ce(ct);return Math.cos(rt)*nt},Qe.yFn=function(ct){var rt=Ce(ct),Ft=Math.sin(rt)>0?.2:1;return-Math.sin(rt)*(nt+ct.fontSize*Ft)+Math.abs(Math.cos(rt))*(ct.fontSize*w)},Qe.anchorFn=function(ct){var rt=Ce(ct),Ft=Math.cos(rt);return Math.abs(Ft)<.1?"middle":Ft>0?"start":"end"},Qe.heightFn=function(ct,rt,Ft){var Nt=Ce(ct);return-.5*(1+Math.sin(Nt))*Ft};var Le=Z(ie);ee.angularTickLayout!==Le&&(K["angular-axis"].selectAll("."+ve._id+"tick").remove(),ee.angularTickLayout=Le);var Te=Ae?[1/0].concat(ve.tickvals||[]).map(function(ct){return i.tickText(ve,ct,!0,!1)}):i.calcTicks(ve);Ae&&(Te[0].text="∞",Te[0].fontSize*=1.75);var pe;if(V.gridshape==="linear"?(pe=Te.map(Ce),E.angleDelta(pe[0],pe[1])<0&&(pe=pe.slice().reverse())):pe=null,ee.vangles=pe,ve.type==="category"&&(Te=Te.filter(function(ct){return E.isAngleInsideSector(Ce(ct),ee.sectorInRad)})),ve.visible){var Ne=ve.ticks==="inside"?-1:1,ot=(ve.linewidth||1)/2;i.drawTicks(ne,ve,{vals:Te,layer:K["angular-axis"],path:"M"+Ne*ot+",0h"+Ne*ve.ticklen,transFn:Ye,crisp:!1}),i.drawGrid(ne,ve,{vals:Te,layer:K["angular-grid"],path:it,transFn:E.noop,crisp:!1}),i.drawLabels(ne,ve,{vals:Te,layer:K["angular-axis"],repositionOnUpdate:!0,transFn:ze,labelFns:Qe})}le(K["angular-line"].select("path"),ie.showline,{d:ee.pathSubplot(),transform:t(H,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateFx=function(ce,V){if(!this.gd._context.staticPlot){var ee=!this.isSmith;ee&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,V,0),this.updateRadialDrag(ce,V,1)),this.updateHoverAndMainDrag(ce)}},j.updateHoverAndMainDrag=function(ce){var V=this,ee=V.isSmith,ne=V.gd,K=V.layers,ue=ce._zoomlayer,te=m.MINZOOM,H=m.OFFEDGE,ae=V.radius,ie=V.innerRadius,ve=V.cx,Ae=V.cy,Ce=V.cxx,Fe=V.cyy,ze=V.sectorInRad,Ye=V.vangles,it=V.radialAxis,st=u.clampTiny,nt=u.findXYatLength,Qe=u.findEnclosingVertexAngles,Le=m.cornerHalfWidth,Te=m.cornerLen/2,pe,Ne,ot=c.makeDragger(K,"path","maindrag",ce.dragmode===!1?"none":"crosshair");h.select(ot).attr("d",V.pathSubplot()).attr("transform",t(ve,Ae)),ot.onmousemove=function(pr){d.hover(ne,pr,V.id),ne._fullLayout._lasthover=ot,ne._fullLayout._hoversubplot=V.id},ot.onmouseout=function(pr){ne._dragging||p.unhover(ne,pr)};var ct={element:ot,gd:ne,subplot:V.id,plotinfo:{id:V.id,xaxis:V.xaxis,yaxis:V.yaxis},xaxes:[V.xaxis],yaxes:[V.yaxis]},rt,Ft,Nt,$t,rr,Mr,Sr,Zr,Ar;function Br(pr,hr){return Math.sqrt(pr*pr+hr*hr)}function Mt(pr,hr){return Br(pr-Ce,hr-Fe)}function je(pr,hr){return Math.atan2(Fe-hr,pr-Ce)}function $e(pr,hr){return[pr*Math.cos(hr),pr*Math.sin(-hr)]}function Ee(pr,hr){if(pr===0)return V.pathSector(2*Le);var Fr=Te/pr,En=hr-Fr,Zn=hr+Fr,qn=Math.max(0,Math.min(pr,ae)),ta=qn-Le,ra=qn+Le;return"M"+$e(ta,En)+"A"+[ta,ta]+" 0,0,0 "+$e(ta,Zn)+"L"+$e(ra,Zn)+"A"+[ra,ra]+" 0,0,1 "+$e(ra,En)+"Z"}function xe(pr,hr,Fr){if(pr===0)return V.pathSector(2*Le);var En=$e(pr,hr),Zn=$e(pr,Fr),qn=st((En[0]+Zn[0])/2),ta=st((En[1]+Zn[1])/2),ra,Nn;if(qn&&ta){var Ea=ta/qn,ja=-1/Ea,ir=nt(Le,Ea,qn,ta);ra=nt(Te,ja,ir[0][0],ir[0][1]),Nn=nt(Te,ja,ir[1][0],ir[1][1])}else{var qt,ar;ta?(qt=Te,ar=Le):(qt=Le,ar=Te),ra=[[qn-qt,ta-ar],[qn+qt,ta-ar]],Nn=[[qn-qt,ta+ar],[qn+qt,ta+ar]]}return"M"+ra.join("L")+"L"+Nn.reverse().join("L")+"Z"}function ye(){Nt=null,$t=null,rr=V.pathSubplot(),Mr=!1;var pr=ne._fullLayout[V.id];Sr=b(pr.bgcolor).getLuminance(),Zr=c.makeZoombox(ue,Sr,ve,Ae,rr),Zr.attr("fill-rule","evenodd"),Ar=c.makeCorners(ue,ve,Ae),x(ne)}function Me(pr,hr){return hr=Math.max(Math.min(hr,ae),ie),prte?(pr-1&&pr===1&&g(hr,ne,[V.xaxis],[V.yaxis],V.id,ct),Fr.indexOf("event")>-1&&d.click(ne,hr,V.id)}ct.prepFn=function(pr,hr,Fr){var En=ne._fullLayout.dragmode,Zn=ot.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var qn=ne._fullLayout._invTransform;pe=ne._fullLayout._invScaleX,Ne=ne._fullLayout._invScaleY;var ta=E.apply3DTransform(qn)(hr-Zn.left,Fr-Zn.top);if(rt=ta[0],Ft=ta[1],Ye){var ra=u.findPolygonOffset(ae,ze[0],ze[1],Ye);rt+=Ce+ra[0],Ft+=Fe+ra[1]}switch(En){case"zoom":ct.clickFn=_r,ee||(Ye?ct.moveFn=Ct:ct.moveFn=Je,ct.doneFn=Ot,ye());break;case"select":case"lasso":l(pr,hr,Fr,ct,En);break}},p.init(ct)},j.updateRadialDrag=function(ce,V,ee){var ne=this,K=ne.gd,ue=ne.layers,te=ne.radius,H=ne.innerRadius,ae=ne.cx,ie=ne.cy,ve=ne.radialAxis,Ae=m.radialDragBoxSize,Ce=Ae/2;if(!ve.visible)return;var Fe=B(ne.radialAxisAngle),ze=ve._rl,Ye=ze[0],it=ze[1],st=ze[ee],nt=.75*(ze[1]-ze[0])/(1-ne.getHole(V))/te,Qe,Le,Te;ee?(Qe=ae+(te+Ce)*Math.cos(Fe),Le=ie-(te+Ce)*Math.sin(Fe),Te="radialdrag"):(Qe=ae+(H-Ce)*Math.cos(Fe),Le=ie-(H-Ce)*Math.sin(Fe),Te="radialdrag-inner");var pe=c.makeRectDragger(ue,Te,"crosshair",-Ce,-Ce,Ae,Ae),Ne={element:pe,gd:K};ce.dragmode===!1&&(Ne.dragmode=!1),le(h.select(pe),ve.visible&&H0!=(ee?rt>Ye:rt=90||K>90&&ue>=450?Fe=1:H<=0&&ie<=0?Fe=0:Fe=Math.max(H,ie),K<=180&&ue>=180||K>180&&ue>=540?ve=-1:te>=0&&ae>=0?ve=0:ve=Math.min(te,ae),K<=270&&ue>=270||K>270&&ue>=630?Ae=-1:H>=0&&ie>=0?Ae=0:Ae=Math.min(H,ie),ue>=360?Ce=1:te<=0&&ae<=0?Ce=0:Ce=Math.max(te,ae),[ve,Ae,Ce,Fe]}function fe(ce,V){var ee=function(K){return E.angleDist(ce,K)},ne=E.findIndexOfMin(V,ee);return V[ne]}function le(ce,V,ee){return V?(ce.attr("display",null),ce.attr(ee)):ce&&ce.attr("display","none"),ce}}}),TL=Ge({"src/plots/polar/layout_attributes.js"($,G){var h=th(),b=ev(),S=Ac().attributes,E=gn().extendFlat,e=Nc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,ticklabelstep:b.ticklabelstep,showticklabels:b.showticklabels,labelalias:b.labelalias,minorloglabels:b.minorloglabels,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickfont:b.tickfont,tickangle:b.tickangle,tickformat:b.tickformat,tickformatstops:b.tickformatstops,layer:b.layer},"plot","from-root"),o={visible:E({},b.visible,{dflt:!0}),type:E({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},autorange:E({},b.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},b.minallowed,{editType:"plot"}),maxallowed:E({},b.maxallowed,{editType:"plot"}),range:E({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:b.categoryorder,categoryarray:b.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:b.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},b.title.text,{editType:"plot",dflt:""}),font:E({},b.title.font,{editType:"plot"}),editType:"plot"},hoverformat:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var n={visible:E({},b.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:b.autotypenumbers,categoryorder:b.categoryorder,categoryarray:b.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:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(n,t,r),G.exports={domain:S({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:h.background},radialaxis:o,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),U7=Ge({"src/plots/polar/layout_defaults.js"($,G){var h=gn(),b=_o(),S=pu(),E=N0(),e=Rv().getSubplotData,t=eg(),r=R0(),o=Pp(),n=Sd(),i=Lf(),a=Nu(),s=jT(),f=om(),c=TL(),p=xL(),d=NE(),T=d.axisNames;function l(x,A,M,_){var w=M("bgcolor");_.bgColor=b.combine(w,_.paper_bgcolor);var m=M("sector");M("hole");var u=e(_.fullData,d.name,_.id),v=_.layoutOut,y;function I(Ae,Ce){return M(y+"."+Ae,Ce)}for(var L=0;L")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),V7=Ge({"src/traces/scatterpolar/index.js"($,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:jE(),categories:["polar","symbols","showLegend","scatter-like"],attributes:nS(),supplyDefaults:qE().supplyDefaults,colorbar:qf(),formatLabels:VE(),calc:j7(),plot:q7(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:HE().hoverPoints,selectPoints:sg(),meta:{}}}}),H7=Ge({"lib/scatterpolar.js"($,G){G.exports=V7()}}),AL=Ge({"src/traces/scatterpolargl/attributes.js"($,G){var h=nS(),{cliponaxis:b,hoveron:S}=h,E=Io(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=ZA();G.exports=So(fo({},E),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),G7=Ge({"src/traces/scatterpolargl/defaults.js"($,G){var h=gn(),b=iu(),S=qE().handleRThetaDefaults,E=Hv(),e=Bp(),t=ep(),r=Iv(),o=o0().PTS_LINESONLY,n=AL();G.exports=function(a,s,f,c){function p(T,l){return h.coerce(a,s,n,T,l)}var d=S(a,s,c,p);if(!d){s.visible=!1;return}p("thetaunit"),p("mode",d=r&&(_.marker.cluster=g.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=v),_.line&&v.length>1&&t.extendFlat(_.line,e.linePositions(i,l,v)),_.text&&(t.extendFlat(_.text,{positions:v},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:v},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:v},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!p.fill2d&&(p.fill2d=!0),_.marker&&!p.scatter2d&&(p.scatter2d=!0),_.line&&!p.line2d&&(p.line2d=!0),_.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(_.line),p.fillOptions.push(_.fill),p.markerOptions.push(_.marker),p.markerSelectedOptions.push(_.markerSel),p.markerUnselectedOptions.push(_.markerUnsel),p.textOptions.push(_.text),p.textSelectedOptions.push(_.textSel),p.textUnselectedOptions.push(_.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),g.x=y,g.y=I,g.rawx=y,g.rawy=I,g.r=A,g.theta=M,g.positions=v,g._scene=p,g.index=p.count,p.count++}}),S(i,a,s)}},G.exports.reglPrecompiled=o}}),$7=Ge({"src/traces/scatterpolargl/index.js"($,G){var h=W7();h.plot=K7(),G.exports=h}}),J7=Ge({"lib/scatterpolargl.js"($,G){G.exports=$7()}}),SL=Ge({"src/traces/barpolar/attributes.js"($,G){var{hovertemplateAttrs:h,templatefallbackAttrs:b}=Al(),S=Qi().extendFlat,E=nS(),e=Fh();G.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:h(),hovertemplatefallback:b(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),ML=Ge({"src/traces/barpolar/layout_attributes.js"($,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Q7=Ge({"src/traces/barpolar/defaults.js"($,G){var h=gn(),b=qE().handleRThetaDefaults,S=u0(),E=SL();G.exports=function(t,r,o,n){function i(s,f){return h.coerce(t,r,E,s,f)}var a=b(t,r,n,i);if(!a){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),S(t,r,i,o,n),h.coerceSelectionMarkerOpacity(r,i)}}}),e9=Ge({"src/traces/barpolar/layout_defaults.js"($,G){var h=gn(),b=ML();G.exports=function(S,E,e){var t={},r;function o(a,s){return h.coerce(S[r]||{},E[r],b,a,s)}for(var n=0;n0?(c=s,p=f):(c=f,p=s);var d=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(p,r.vangles)[1],l=[d,(c+p)/2,T];return e.pathPolygonAnnulus(i,a,c,p,l,o,n)}:function(i,a,s,f){return S.pathAnnulus(i,a,s,f,o,n)}}}}),r9=Ge({"src/traces/barpolar/hover.js"($,G){var h=jf(),b=gn(),S=Sc().getTraceColor,E=b.fillText,e=HE().makeHoverPointText,t=UE().isPtInsidePolygon;G.exports=function(o,n,i){var a=o.cd,s=a[0].trace,f=o.subplot,c=f.radialAxis,p=f.angularAxis,d=f.vangles,T=d?t:b.isPtInsideSector,l=o.maxHoverDistance,g=p._period||2*Math.PI,x=Math.abs(c.g2p(Math.sqrt(n*n+i*i))),A=Math.atan2(i,n);c.range[0]>c.range[1]&&(A+=Math.PI);var M=function(u){return T(x,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],d)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/g)-1+(u.rp1-x)/(u.rp1-u.rp0)-1:1/0};if(h.getClosest(a,M,o),o.index!==!1){var _=o.index,w=a[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var m=b.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(m,s,f,o),o.hovertemplate=s.hovertemplate,o.color=S(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),n9=Ge({"src/traces/barpolar/index.js"($,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:jE(),categories:["polar","bar","showLegend"],attributes:SL(),layoutAttributes:ML(),supplyDefaults:Q7(),supplyLayoutDefaults:e9(),calc:EL().calc,crossTraceCalc:EL().crossTraceCalc,plot:t9(),colorbar:qf(),formatLabels:VE(),style:pv().style,styleOnSelect:pv().styleOnSelect,hoverPoints:r9(),selectPoints:_m(),meta:{}}}}),a9=Ge({"lib/barpolar.js"($,G){G.exports=n9()}}),kL=Ge({"src/plots/smith/constants.js"($,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),CL=Ge({"src/plots/smith/layout_attributes.js"($,G){var h=th(),b=ev(),S=Ac().attributes,E=gn().extendFlat,e=Nc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({ticklen:b.ticklen,tickwidth:E({},b.tickwidth,{dflt:2}),tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,tickfont:b.tickfont,tickformat:b.tickformat,hoverformat:b.hoverformat,layer:b.layer},"plot","from-root"),o=E({visible:E({},b.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},b.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),n=E({visible:E({},b.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:b.ticks,editType:"calc"},t,r);G.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:h.background},realaxis:o,imaginaryaxis:n,editType:"calc"}}}),i9=Ge({"src/plots/smith/layout_defaults.js"($,G){var h=gn(),b=_o(),S=pu(),E=N0(),e=Rv().getSubplotData,t=Sd(),r=Pp(),o=Nu(),n=Kd(),i=CL(),a=kL(),s=a.axisNames,f=p(function(d){return h.isTypedArray(d)&&(d=Array.from(d)),d.slice().reverse().map(function(T){return-T}).concat([0]).concat(d)},String);function c(d,T,l,g){var x=l("bgcolor");g.bgColor=b.combine(x,g.paper_bgcolor);var A=e(g.fullData,a.name,g.id),M=g.layoutOut,_;function w(j,Z){return l(_+"."+j,Z)}for(var m=0;m")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),h9=Ge({"src/traces/scattersmith/index.js"($,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:o9(),categories:["smith","symbols","showLegend","scatter-like"],attributes:LL(),supplyDefaults:s9(),colorbar:qf(),formatLabels:l9(),calc:u9(),plot:c9(),style:Mh().style,styleOnSelect:Mh().styleOnSelect,hoverPoints:f9().hoverPoints,selectPoints:sg(),meta:{}}}}),v9=Ge({"lib/scattersmith.js"($,G){G.exports=h9()}}),Fd=Ge({"node_modules/world-calendars/dist/main.js"($,G){var h=_v();function b(){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={}}h(b.prototype,{instance:function(o,n){o=(o||"gregorian").toLowerCase(),n=n||"";var i=this._localCals[o+"-"+n];if(!i&&this.calendars[o]&&(i=new this.calendars[o](n),this._localCals[o+"-"+n]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,n,i,a,s){return a=(o!=null&&o.year?o.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(o,n,i)},substituteDigits:function(o){return function(n){return(n+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,n){return function(i){for(var a="",s=0;i>0;){var f=i%10;a=(f===0?"":o[f]+n[s])+a,s++,i=Math.floor(i/10)}return a.indexOf(o[1]+n[1])===0&&(a=a.substr(1)),a||o[0]}}});function S(o,n,i,a){if(this._calendar=o,this._year=n,this._month=i,this._day=a,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 E(o,n){return o=""+o,"000000".substring(0,n-o.length)+o}h(S.prototype,{newDate:function(o,n,i){return this._calendar.newDate(o??this,n,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,n,i){if(!this._calendar.isValid(o,n,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=n,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,n){return this._calendar.add(this,o,n)},set:function(o,n){return this._calendar.set(this,o,n)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var n=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}h(e.prototype,{_validateLevel:0,newDate:function(o,n,i){return o==null?this.today():(o.year&&(this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),n=o.month(),o=o.year()),new S(this,o,n,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+E(Math.abs(n.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,n){var i=this._validate(o,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,n){var i=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(o,n,i){return this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,n,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,n,i),n,i)},_add:function(o,n,i){if(this._validateLevel++,i==="d"||i==="w"){var a=o.toJD()+n*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var f=o.year()+(i==="y"?n:0),c=o.monthOfYear()+(i==="m"?n:0),s=o.day(),p=function(l){for(;cg-1+l.minMonth;)f++,c-=g,g=l.monthsInYear(f)};i==="y"?(o.month()!==this.fromMonthOfYear(f,c)&&(c=this.newDate(f,o.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c)))):i==="m"&&(p(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c))));var d=[f,this.fromMonthOfYear(f,c),s];return this._validateLevel--,d}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,n,i,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(n[0]===0||o.year()>0!=n[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"]}[a],f=i<0?-1:1;n=this._add(o,i*s[0]+f*s[1],s[2])}return o.date(n[0],n[1],n[2])},set:function(o,n,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=i==="y"?n:o.year(),s=i==="m"?n:o.month(),f=i==="d"?n:o.day();return(i==="y"||i==="m")&&(f=Math.min(f,this.daysInMonth(a,s))),o.date(a,s,f)},isValid:function(o,n,i){this._validateLevel++;var a=this.hasYearZero||o!==0;if(a){var s=this.newDate(o,n,this.minDay);a=n>=this.minMonth&&n-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(d>2.5?4716:4715);return T<=0&&T--,this.newDate(T,d,p)},toJSDate:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new b;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),d9=Ge({"node_modules/world-calendars/dist/plus.js"(){var $=_v(),G=Fd();$(G.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"}),G.local=G.regionalOptions[""],$(G.cdate.prototype,{formatDate:function(h,b){return typeof h!="string"&&(b=h,h=""),this._calendar.formatDate(h||"",this,b)}}),$(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:1440*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(h,b,S){if(typeof h!="string"&&(S=b,b=h,h=""),!b)return"";if(b.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;h=h||this.local.dateFormat,S=S||{};var E=S.dayNamesShort||this.local.dayNamesShort,e=S.dayNames||this.local.dayNames,t=S.monthNumbers||this.local.monthNumbers,r=S.monthNamesShort||this.local.monthNamesShort,o=S.monthNames||this.local.monthNames;S.calculateWeek||this.local.calculateWeek;for(var n=function(x,A){for(var M=1;g+M1},i=function(x,A,M,_){var w=""+A;if(n(x,_))for(;w.length1},g=function(I,L){var z=l(I,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(I)+1],N=new RegExp("^-?\\d{1,"+F+"}"),B=b.substring(m).match(N);if(!B)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,m);return m+=B[0].length,parseInt(B[0],10)},x=this,A=function(){if(typeof o=="function"){l("m");var I=o.call(x,b.substring(m));return m+=I.length,I}return g("m")},M=function(I,L,z,F){for(var N=l(I,F)?z:L,B=0;B-1){f=1,c=p;for(var y=this.daysInMonth(s,f);c>y;y=this.daysInMonth(s,f))f++,c-=y}return a>-1?this.fromJD(a):this.newDate(s,f,c)},determineDate:function(h,b,S,E,e){S&&typeof S!="object"&&(e=E,E=S,S=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var n=(o.match(/^c/)&&S?S.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=i.exec(o);a;)n.add(parseInt(a[1],10),a[2]||"d"),a=i.exec(o);return n};return b=b?b.newDate():null,h=h==null?b:typeof h=="string"?r(h):typeof h=="number"?isNaN(h)||h===1/0||h===-1/0?b:t.today().add(h,"d"):t.newDate(h),h}})}}),p9=Ge({"node_modules/world-calendars/dist/calendars/chinese.js"(){var $=Fd(),G=_v(),h=$.instance();function b(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var f=a.match(E);return f?f[0]:""}var c=this._validateYear(a),p=a.month(),d=""+this.toChineseMonth(c,p);return s&&d.length<2&&(d="0"+d),this.isIntercalaryMonth(c,p)&&(d+="i"),d},monthNames:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),d=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][p-1];return this.isIntercalaryMonth(f,c)&&(d="闰"+d),d},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),d=["一","二","三","四","五","六","七","八","九","十","十一","十二"][p-1];return this.isIntercalaryMonth(f,c)&&(d="闰"+d),d},parseMonth:function(a,s){a=this._validateYear(a);var f=parseInt(s),c;if(isNaN(f))s[0]==="闰"&&(c=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var p=s[s.length-1];c=p==="i"||p==="I"}var d=this.toMonthIndex(a,f,c);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(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,f){var c=this.intercalaryMonth(a),p=f&&s!==c;if(p||s<1||s>12)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var d;return c?!f&&s<=c?d=s-1:d=s:d=s-1,d},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a),c=f?12:11;if(s<0||s>c)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return f?s>13;return f},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a);return!!f&&f===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,f){var c=this._validateYear(a,$.local.invalidyear),p=o[c-o[0]],d=p>>9&4095,T=p>>5&15,l=p&31,g;g=h.newDate(d,T,l),g.add(4-(g.dayOfWeek()||7),"d");var x=this.toJD(a,s,f)-g.toJD();return 1+Math.floor(x/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var f=r[a-r[0]],c=f>>13,p=c?12:11;if(s>p)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var d=f&1<<12-s?30:29;return d},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var c=this._validate(a,d,f,$.local.invalidDate);a=this._validateYear(c.year()),s=c.month(),f=c.day();var p=this.isIntercalaryMonth(a,s),d=this.toChineseMonth(a,s),T=i(a,d,f,p);return h.toJD(T.year,T.month,T.day)},fromJD:function(a){var s=h.fromJD(a),f=n(s.year(),s.month(),s.day()),c=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,c,f.day)},fromString:function(a){var s=a.match(S),f=this._validateYear(+s[1]),c=+s[2],p=!!s[3],d=this.toMonthIndex(f,c,p),T=+s[4];return this.newDate(f,d,T)},add:function(a,s,f){var c=a.year(),p=a.month(),d=this.isIntercalaryMonth(c,p),T=this.toChineseMonth(c,p),l=Object.getPrototypeOf(b.prototype).add.call(this,a,s,f);if(f==="y"){var g=l.year(),x=l.month(),A=this.isIntercalaryMonth(g,T),M=d&&A?this.toMonthIndex(g,T,!0):this.toMonthIndex(g,T,!1);M!==x&&l.month(M)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;$.calendars.chinese=b;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,f,c){var p,d;if(typeof a=="object")p=a,d=s||{};else{var T=typeof a=="number"&&a>=1888&&a<=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 g=typeof f=="number"&&f>=1&&f<=31;if(!g)throw new Error("Solar day outside range 1 - 31");p={year:a,month:s,day:f},d={}}var x=o[p.year-o[0]],A=p.year<<9|p.month<<5|p.day;d.year=A>=x?p.year:p.year-1,x=o[d.year-o[0]];var M=x>>9&4095,_=x>>5&15,w=x&31,m,u=new Date(M,_-1,w),v=new Date(p.year,p.month-1,p.day);m=Math.round((v-u)/(24*3600*1e3));var y=r[d.year-r[0]],I;for(I=0;I<13;I++){var L=y&1<<12-I?30:29;if(m>13;return!z||I=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var g=typeof s=="number"&&s>=1&&s<=12;if(!g)throw new Error("Lunar month outside range 1 - 12");var x=typeof f=="number"&&f>=1&&f<=30;if(!x)throw new Error("Lunar day outside range 1 - 30");var A;typeof c=="object"?(A=!1,d=c):(A=!!c,d={}),T={year:a,month:s,day:f,isIntercalary:A}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,m;w&&(T.month>w||T.isIntercalary)?m=T.month:m=T.month-1;for(var u=0;u>9&4095,L=y>>5&15,z=y&31,F=new Date(I,L-1,z+M);return d.year=F.getFullYear(),d.month=1+F.getMonth(),d.day=F.getDate(),d}}}),m9=Ge({"node_modules/world-calendars/dist/calendars/coptic.js"(){var $=Fd(),G=_v();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),$.calendars.coptic=h}}),g9=Ge({"node_modules/world-calendars/dist/calendars/discworld.js"(){var $=Fd(),G=_v();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),400},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,E,e){var t=this.dayOfWeek(S,E,e);return t>=2&&t<=6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return{century:b[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return S=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(S/400)+1;S-=(E-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var b={20:"Fruitbat",21:"Anchovy"};$.calendars.discworld=h}}),y9=Ge({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var $=Fd(),G=_v();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),$.calendars.ethiopian=h}}),_9=Ge({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var $=Fd(),G=_v();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(S){return S=S<0?S+1:S,b(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return S=E.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,E){return S.year&&(E=S.month(),S=S.year()),this._validate(S,E,this.minDay,$.local.invalidMonth),E===12&&this.leapYear(S)||E===8&&b(this.daysInYear(S),10)===5?30:E===9&&b(this.daysInYear(S),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var n=7;n<=this.monthsInYear(S);n++)o+=this.daysInMonth(S,n);for(var n=1;n=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Sthis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=S-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function b(S,E){return S-E*Math.floor(S/E)}$.calendars.hebrew=h}}),x9=Ge({"node_modules/world-calendars/dist/calendars/islamic.js"(){var $=Fd(),G=_v();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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īs","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(b){var S=this._validate(b,this.minMonth,this.minDay,$.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){return this.leapYear(b)?355:354},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==5},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b=b<=0?b+1:b,E+Math.ceil(29.5*(S-1))+(b-1)*354+Math.floor((3+11*b)/30)+this.jdEpoch-1},fromJD:function(b){b=Math.floor(b)+.5;var S=Math.floor((30*(b-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var E=Math.min(12,Math.ceil((b-29-this.toJD(S,1,1))/29.5)+1),e=b-this.toJD(S,E,1)+1;return this.newDate(S,E,e)}}),$.calendars.islamic=h}}),b9=Ge({"node_modules/world-calendars/dist/calendars/julian.js"(){var $=Fd(),G=_v();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()<0?S.year()+1:S.year();return E%4===0},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b<0&&b++,S<=2&&(b--,S+=12),Math.floor(365.25*(b+4716))+Math.floor(30.6001*(S+1))+E-1524.5},fromJD:function(b){var S=Math.floor(b+.5),E=S+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),n=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,o,i)}}),$.calendars.julian=h}}),w9=Ge({"node_modules/world-calendars/dist/calendars/mayan.js"(){var $=Fd(),G=_v();function h(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,$.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,$.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,$.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate),o=r.toJD(),n=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[n[0]-1],haabMonth:n[0],haabDay:n[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=b(E+8+340,365);return[Math.floor(e/20)+1,b(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[S(E+20,20),S(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function b(E,e){return E-e*Math.floor(E/e)}function S(E,e){return b(E-1,e)+1}$.calendars.mayan=h}}),T9=Ge({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var $=Fd(),G=_v();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar;var b=$.instance("gregorian");G(h.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(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear);return b.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),n=1;n=this.toJD(E+1,1,1);)E++;for(var e=S-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),$.calendars.nanakshahi=h}}),A9=Ge({"node_modules/world-calendars/dist/calendars/nepali.js"(){var $=Fd(),G=_v();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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(b){return this.daysInYear(b)!==this.daysPerYear},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){var S=this._validate(b,this.minMonth,this.minDay,$.local.invalidYear);if(b=S.year(),typeof this.NEPALI_CALENDAR_DATA[b]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[b][e];return E},daysInMonth:function(b,S){return b.year&&(S=b.month(),b=b.year()),this._validate(b,S,this.minDay,$.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[b]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[b][S]},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);b=e.year(),S=e.month(),E=e.day();var t=$.instance(),r=0,o=S,n=b;this._createMissingCalendarData(b);var i=b-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(S!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][o],o--;return S===9?(r+=E-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(b){var S=$.instance(),E=S.fromJD(b),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,n=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-n+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var a=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,a)},_createMissingCalendarData:function(b){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var E=b-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=S)},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]}}),$.calendars.nepali=h}}),S9=Ge({"node_modules/world-calendars/dist/calendars/persian.js"(){var $=Fd(),G=_v();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function b(S){var E=S-475;S<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),n=r-Math.floor(r);return o>n}h.prototype=new $.baseCalendar,G(h.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ārshanbeh","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(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return b(E.year())},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=0;if(S>0)for(var o=1;o0?S-1:S)*365+r+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var E=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,S>this.toJD(e,12,b(e)?30:29)&&(e++,e===0&&e++);var t=S-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=S-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),$.calendars.persian=h,$.calendars.jalali=h}}),M9=Ge({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var $=Fd(),G=_v(),h=$.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.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 E=this._validate(e,this.minMonth,this.minDay,$.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,$.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)},_g2tYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)}}),$.calendars.taiwan=b}}),E9=Ge({"node_modules/world-calendars/dist/calendars/thai.js"(){var $=Fd(),G=_v(),h=$.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.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 E=this._validate(e,this.minMonth,this.minDay,$.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,$.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)},_g2tYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)}}),$.calendars.thai=b}}),k9=Ge({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var $=Fd(),G=_v();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(S,e);return E},daysInMonth:function(S,E){for(var e=this._validate(S,E,this.minDay,$.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return b[r]-b[r-1];r++}return 30},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+b[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var E=S-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),n=o+1,i=r-12*o,a=E-b[e-1]+1;return this.newDate(n,i,a)},isValid:function(S,E,e){var t=$.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,E,e,t){var r=$.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),$.calendars.ummalqura=h;var b=[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]}}),C9=Ge({"src/components/calendars/calendars.js"($,G){G.exports=Fd(),d9(),p9(),m9(),g9(),y9(),_9(),x9(),b9(),w9(),T9(),A9(),S9(),M9(),E9(),k9()}}),L9=Ge({"src/components/calendars/index.js"($,G){var h=C9(),b=gn(),S=zi(),E=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:b.sortObjectKeys(h.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,m,u){var v={};return v[m]=t,b.coerce(_,w,v,m,u)},o=function(_,w,m,u){for(var v=0;vlr(vr.target.value),className:"p-2 rounded bg-white border border-gray-300",children:[ht.map(vr=>Fo.jsx("option",{value:vr,children:vr},vr)),St.map(vr=>Fo.jsx("optgroup",{label:vr.label,children:vr.options.map(Cr=>Fo.jsx("option",{value:Cr,children:Cr},Cr))},vr.label))]})]})}function pd({label:Ie,value:ht,onChange:St,readonly:wt=!1,rows:lr}){const vr="p-2 rounded border border-gray-300 w-full",Cr=wt?"bg-gray-100":"bg-white";return Fo.jsxs("div",{className:"flex flex-col gap-1",children:[Fo.jsx("label",{className:"text-gray-700 text-sm",children:Ie}),lr&&lr>1?Fo.jsx("textarea",{value:ht,rows:lr,readOnly:wt,onChange:nn=>St&&St(nn.target.value),className:`${vr} ${Cr} resize-none`}):Fo.jsx("input",{type:"text",value:ht,readOnly:wt,onChange:nn=>St&&St(nn.target.value),className:`${vr} ${Cr}`})]})}function IO({label:Ie,options:ht,activeOption:St,onChange:wt}){return Fo.jsxs("div",{className:"flex flex-col gap-1",children:[Ie&&Fo.jsx("label",{className:"text-gray-700 text-sm",children:Ie}),Fo.jsx("div",{className:"flex gap-4",children:ht.map(lr=>Fo.jsxs("label",{className:"flex items-center gap-1",children:[Fo.jsx("input",{type:"radio",value:lr,checked:St===lr,onChange:()=>wt(lr)}),lr]},lr))})]})}function DO({tabs:Ie,activeTab:ht,onChange:St}){return Fo.jsx("div",{className:"flex mb-4 border-b border-gray-200",children:Ie.map(wt=>Fo.jsx("button",{onClick:()=>St(wt),className:`px-5 py-1 cursor-pointer rounded ${ht===wt?"text-orange-400 border-b-2 border-orange-400":"text-gray-950 hover:bg-gray-200"}`,children:wt},wt))})}function zO({data:Ie,xlim:ht,ylim:St,setAxisLimits:wt}){let lr=Ie.functionValues?Ie.functionValues.x:[],vr=Ie.functionValues?Ie.functionValues.y:[],Cr=Ie.functionValues&&Ie.functionValues.z?Ie.functionValues.z:[],nn=Ie.trajectoryValues?Ie.trajectoryValues.x:[],bn=Ie.trajectoryValues?Ie.trajectoryValues.y:[],Jr=Ie.trajectoryValues&&Ie.trajectoryValues.z?Ie.trajectoryValues.z:[];const[Tn,zn]=up.useState(null),_a=up.useRef(null);up.useEffect(()=>{if(Cr){if(!Cr||Cr.length===0){_a.current=null;return}let Io=1/0,bi=-1/0;for(let ko=0;kobi&&(bi=Mo))}const Ge=(bi-Io)*.1;_a.current=[Io-Ge,bi+Ge],Tn===null&&zn(_a.current)}},[Cr]);function Qn(){_a.current&&(zn(_a.current),_a.current=null)}const fo=up.useRef(null),So=up.useRef({dragmode:"pan",showlegend:!1,xaxis:{title:{text:"x"},range:ht},yaxis:{title:{text:"y"},range:St},margin:{t:40,r:40,b:40,l:40}});return Cr.length===0?Fo.jsx(J6,{className:"min-h-[320px]",children:Fo.jsx(p8,{ref:fo,onRelayout:Io=>{const bi=Io["xaxis.range[0]"],Ge=Io["xaxis.range[1]"],ko=Io["yaxis.range[0]"],Tl=Io["yaxis.range[1]"];typeof bi=="number"&&typeof Ge=="number"&&typeof ko=="number"&&typeof Tl=="number"&&wt([bi,Ge],[ko,Tl])},data:[{x:lr,y:vr,type:"scatter",mode:"lines",line:{color:"#1f77b4",width:2},hoverinfo:"skip"},{x:nn,y:bn,type:"scatter",mode:"lines+markers",line:{color:"#d97871",width:2},marker:{color:"#d97871",size:10},hoverinfo:"skip"},{x:nn.length>0?[nn.at(-1)]:[],y:bn.length>0?[bn.at(-1)]:[],type:"scatter",mode:"markers",marker:{color:"red",size:12},hoverinfo:"skip"}],layout:So.current,style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,scrollZoom:!0}})}):Fo.jsxs(J6,{className:"flex flex-col min-h-[420px]",children:[Fo.jsx(p8,{ref:fo,onRelayout:Io=>{const bi=Io["xaxis.range[0]"],Ge=Io["xaxis.range[1]"],ko=Io["yaxis.range[0]"],Tl=Io["yaxis.range[1]"];typeof bi=="number"&&typeof Ge=="number"&&typeof ko=="number"&&typeof Tl=="number"&&wt([bi,Ge],[ko,Tl])},data:[{x:lr,y:vr,z:Cr,zmin:Tn?.[0],zmax:Tn?.[1],type:"contour",colorscale:"Viridis",hoverinfo:"skip",contours:{coloring:"heatmap",showlines:!1}},{x:nn,y:bn,z:Jr,type:"scatter",mode:"lines+markers",line:{color:"#d97871",width:2},marker:{color:"#d97871",size:10},hoverinfo:"skip"},{x:nn.length>0?[nn.at(-1)]:[],y:bn.length>0?[bn.at(-1)]:[],z:Jr.length>0?[Jr.at(-1)]:[],type:"scatter",mode:"markers",marker:{color:"red",size:12},hoverinfo:"skip"}],layout:So.current,className:"w-full flex-1",config:{responsive:!0,displayModeBar:!1,scrollZoom:!0}}),Fo.jsx("div",{className:"mt-2 flex justify-end",children:Fo.jsx(ST,{label:"Update Color Scale",onClick:Qn})})]})}function OO(Ie,ht){const St={};return(Ie[Ie.length-1]===""?[...Ie,""]:Ie).join((St.padRight?" ":"")+","+(St.padLeft===!1?"":" ")).trim()}const FO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,BO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NO={};function g8(Ie,ht){return(NO.jsx?BO:FO).test(Ie)}const UO=/[ \t\n\f\r]/g;function jO(Ie){return typeof Ie=="object"?Ie.type==="text"?y8(Ie.value):!1:y8(Ie)}function y8(Ie){return Ie.replace(UO,"")===""}class LT{constructor(ht,St,wt){this.normal=St,this.property=ht,wt&&(this.space=wt)}}LT.prototype.normal={};LT.prototype.property={};LT.prototype.space=void 0;function r4(Ie,ht){const St={},wt={};for(const lr of Ie)Object.assign(St,lr.property),Object.assign(wt,lr.normal);return new LT(St,wt,ht)}function Q6(Ie){return Ie.toLowerCase()}class kp{constructor(ht,St){this.attribute=St,this.property=ht}}kp.prototype.attribute="";kp.prototype.booleanish=!1;kp.prototype.boolean=!1;kp.prototype.commaOrSpaceSeparated=!1;kp.prototype.commaSeparated=!1;kp.prototype.defined=!1;kp.prototype.mustUseProperty=!1;kp.prototype.number=!1;kp.prototype.overloadedBoolean=!1;kp.prototype.property="";kp.prototype.spaceSeparated=!1;kp.prototype.space=void 0;let qO=0;const Bu=$_(),qv=$_(),ek=$_(),Vo=$_(),fh=$_(),Lw=$_(),t0=$_();function $_(){return 2**++qO}const tk=Object.freeze(Object.defineProperty({__proto__:null,boolean:Bu,booleanish:qv,commaOrSpaceSeparated:t0,commaSeparated:Lw,number:Vo,overloadedBoolean:ek,spaceSeparated:fh},Symbol.toStringTag,{value:"Module"})),F6=Object.keys(tk);class ck extends kp{constructor(ht,St,wt,lr){let vr=-1;if(super(ht,St),_8(this,"space",lr),typeof wt=="number")for(;++vr4&&St.slice(0,4)==="data"&&YO.test(ht)){if(ht.charAt(4)==="-"){const vr=ht.slice(5).replace(x8,KO);wt="data"+vr.charAt(0).toUpperCase()+vr.slice(1)}else{const vr=ht.slice(4);if(!x8.test(vr)){let Cr=vr.replace(XO,WO);Cr.charAt(0)!=="-"&&(Cr="-"+Cr),ht="data"+Cr}}lr=ck}return new lr(wt,ht)}function WO(Ie){return"-"+Ie.toLowerCase()}function KO(Ie){return Ie.charAt(1).toUpperCase()}const $O=r4([n4,VO,o4,s4,l4],"html"),fk=r4([n4,HO,o4,s4,l4],"svg");function JO(Ie){return Ie.join(" ").trim()}var kw={},B6,b8;function QO(){if(b8)return B6;b8=1;var Ie=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ht=/\n/g,St=/^\s*/,wt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lr=/^:\s*/,vr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Cr=/^[;\s]*/,nn=/^\s+|\s+$/g,bn=` +`,Jr="/",Tn="*",zn="",_a="comment",Qn="declaration";function fo(Io,bi){if(typeof Io!="string")throw new TypeError("First argument must be a string");if(!Io)return[];bi=bi||{};var Ge=1,ko=1;function Tl(Pi){var zi=Pi.match(ht);zi&&(Ge+=zi.length);var Si=Pi.lastIndexOf(bn);ko=~Si?Pi.length-Si:ko+Pi.length}function Mo(){var Pi={line:Ge,column:ko};return function(zi){return zi.position=new yi(Pi),Mi(),zi}}function yi(Pi){this.start=Pi,this.end={line:Ge,column:ko},this.source=bi.source}yi.prototype.content=Io;function Fi(Pi){var zi=new Error(bi.source+":"+Ge+":"+ko+": "+Pi);if(zi.reason=Pi,zi.filename=bi.source,zi.line=Ge,zi.column=ko,zi.source=Io,!bi.silent)throw zi}function Ts(Pi){var zi=Pi.exec(Io);if(zi){var Si=zi[0];return Tl(Si),Io=Io.slice(Si.length),zi}}function Mi(){Ts(St)}function rl(Pi){var zi;for(Pi=Pi||[];zi=ji();)zi!==!1&&Pi.push(zi);return Pi}function ji(){var Pi=Mo();if(!(Jr!=Io.charAt(0)||Tn!=Io.charAt(1))){for(var zi=2;zn!=Io.charAt(zi)&&(Tn!=Io.charAt(zi)||Jr!=Io.charAt(zi+1));)++zi;if(zi+=2,zn===Io.charAt(zi-1))return Fi("End of comment missing");var Si=Io.slice(2,zi-2);return ko+=2,Tl(Si),Io=Io.slice(zi),ko+=2,Pi({type:_a,comment:Si})}}function Bo(){var Pi=Mo(),zi=Ts(wt);if(zi){if(ji(),!Ts(lr))return Fi("property missing ':'");var Si=Ts(vr),wo=Pi({type:Qn,property:So(zi[0].replace(Ie,zn)),value:Si?So(Si[0].replace(Ie,zn)):zn});return Ts(Cr),wo}}function tu(){var Pi=[];rl(Pi);for(var zi;zi=Bo();)zi!==!1&&(Pi.push(zi),rl(Pi));return Pi}return Mi(),tu()}function So(Io){return Io?Io.replace(nn,zn):zn}return B6=fo,B6}var w8;function eF(){if(w8)return kw;w8=1;var Ie=kw&&kw.__importDefault||function(wt){return wt&&wt.__esModule?wt:{default:wt}};Object.defineProperty(kw,"__esModule",{value:!0}),kw.default=St;const ht=Ie(QO());function St(wt,lr){let vr=null;if(!wt||typeof wt!="string")return vr;const Cr=(0,ht.default)(wt),nn=typeof lr=="function";return Cr.forEach(bn=>{if(bn.type!=="declaration")return;const{property:Jr,value:Tn}=bn;nn?lr(Jr,Tn,bn):Tn&&(vr=vr||{},vr[Jr]=Tn)}),vr}return kw}var bT={},T8;function tF(){if(T8)return bT;T8=1,Object.defineProperty(bT,"__esModule",{value:!0}),bT.camelCase=void 0;var Ie=/^--[a-zA-Z0-9_-]+$/,ht=/-([a-z])/g,St=/^[^-]+$/,wt=/^-(webkit|moz|ms|o|khtml)-/,lr=/^-(ms)-/,vr=function(Jr){return!Jr||St.test(Jr)||Ie.test(Jr)},Cr=function(Jr,Tn){return Tn.toUpperCase()},nn=function(Jr,Tn){return"".concat(Tn,"-")},bn=function(Jr,Tn){return Tn===void 0&&(Tn={}),vr(Jr)?Jr:(Jr=Jr.toLowerCase(),Tn.reactCompat?Jr=Jr.replace(lr,nn):Jr=Jr.replace(wt,nn),Jr.replace(ht,Cr))};return bT.camelCase=bn,bT}var wT,A8;function rF(){if(A8)return wT;A8=1;var Ie=wT&&wT.__importDefault||function(lr){return lr&&lr.__esModule?lr:{default:lr}},ht=Ie(eF()),St=tF();function wt(lr,vr){var Cr={};return!lr||typeof lr!="string"||(0,ht.default)(lr,function(nn,bn){nn&&bn&&(Cr[(0,St.camelCase)(nn,vr)]=bn)}),Cr}return wt.default=wt,wT=wt,wT}var nF=rF();const aF=uk(nF),u4=c4("end"),hk=c4("start");function c4(Ie){return ht;function ht(St){const wt=St&&St.position&&St.position[Ie]||{};if(typeof wt.line=="number"&&wt.line>0&&typeof wt.column=="number"&&wt.column>0)return{line:wt.line,column:wt.column,offset:typeof wt.offset=="number"&&wt.offset>-1?wt.offset:void 0}}}function iF(Ie){const ht=hk(Ie),St=u4(Ie);if(ht&&St)return{start:ht,end:St}}function MT(Ie){return!Ie||typeof Ie!="object"?"":"position"in Ie||"type"in Ie?S8(Ie.position):"start"in Ie||"end"in Ie?S8(Ie):"line"in Ie||"column"in Ie?rk(Ie):""}function rk(Ie){return M8(Ie&&Ie.line)+":"+M8(Ie&&Ie.column)}function S8(Ie){return rk(Ie&&Ie.start)+"-"+rk(Ie&&Ie.end)}function M8(Ie){return Ie&&typeof Ie=="number"?Ie:1}class Zd extends Error{constructor(ht,St,wt){super(),typeof St=="string"&&(wt=St,St=void 0);let lr="",vr={},Cr=!1;if(St&&("line"in St&&"column"in St?vr={place:St}:"start"in St&&"end"in St?vr={place:St}:"type"in St?vr={ancestors:[St],place:St.position}:vr={...St}),typeof ht=="string"?lr=ht:!vr.cause&&ht&&(Cr=!0,lr=ht.message,vr.cause=ht),!vr.ruleId&&!vr.source&&typeof wt=="string"){const bn=wt.indexOf(":");bn===-1?vr.ruleId=wt:(vr.source=wt.slice(0,bn),vr.ruleId=wt.slice(bn+1))}if(!vr.place&&vr.ancestors&&vr.ancestors){const bn=vr.ancestors[vr.ancestors.length-1];bn&&(vr.place=bn.position)}const nn=vr.place&&"start"in vr.place?vr.place.start:vr.place;this.ancestors=vr.ancestors||void 0,this.cause=vr.cause||void 0,this.column=nn?nn.column:void 0,this.fatal=void 0,this.file="",this.message=lr,this.line=nn?nn.line:void 0,this.name=MT(vr.place)||"1:1",this.place=vr.place||void 0,this.reason=this.message,this.ruleId=vr.ruleId||void 0,this.source=vr.source||void 0,this.stack=Cr&&vr.cause&&typeof vr.cause.stack=="string"?vr.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zd.prototype.file="";Zd.prototype.name="";Zd.prototype.reason="";Zd.prototype.message="";Zd.prototype.stack="";Zd.prototype.column=void 0;Zd.prototype.line=void 0;Zd.prototype.ancestors=void 0;Zd.prototype.cause=void 0;Zd.prototype.fatal=void 0;Zd.prototype.place=void 0;Zd.prototype.ruleId=void 0;Zd.prototype.source=void 0;const vk={}.hasOwnProperty,oF=new Map,sF=/[A-Z]/g,lF=new Set(["table","tbody","thead","tfoot","tr"]),uF=new Set(["td","th"]),f4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cF(Ie,ht){if(!ht||ht.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const St=ht.filePath||void 0;let wt;if(ht.development){if(typeof ht.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");wt=yF(St,ht.jsxDEV)}else{if(typeof ht.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof ht.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");wt=gF(St,ht.jsx,ht.jsxs)}const lr={Fragment:ht.Fragment,ancestors:[],components:ht.components||{},create:wt,elementAttributeNameCase:ht.elementAttributeNameCase||"react",evaluater:ht.createEvaluater?ht.createEvaluater():void 0,filePath:St,ignoreInvalidStyle:ht.ignoreInvalidStyle||!1,passKeys:ht.passKeys!==!1,passNode:ht.passNode||!1,schema:ht.space==="svg"?fk:$O,stylePropertyNameCase:ht.stylePropertyNameCase||"dom",tableCellAlignToStyle:ht.tableCellAlignToStyle!==!1},vr=h4(lr,Ie,void 0);return vr&&typeof vr!="string"?vr:lr.create(Ie,lr.Fragment,{children:vr||void 0},void 0)}function h4(Ie,ht,St){if(ht.type==="element")return fF(Ie,ht,St);if(ht.type==="mdxFlowExpression"||ht.type==="mdxTextExpression")return hF(Ie,ht);if(ht.type==="mdxJsxFlowElement"||ht.type==="mdxJsxTextElement")return dF(Ie,ht,St);if(ht.type==="mdxjsEsm")return vF(Ie,ht);if(ht.type==="root")return pF(Ie,ht,St);if(ht.type==="text")return mF(Ie,ht)}function fF(Ie,ht,St){const wt=Ie.schema;let lr=wt;ht.tagName.toLowerCase()==="svg"&&wt.space==="html"&&(lr=fk,Ie.schema=lr),Ie.ancestors.push(ht);const vr=d4(Ie,ht.tagName,!1),Cr=_F(Ie,ht);let nn=pk(Ie,ht);return lF.has(ht.tagName)&&(nn=nn.filter(function(bn){return typeof bn=="string"?!jO(bn):!0})),v4(Ie,Cr,vr,ht),dk(Cr,nn),Ie.ancestors.pop(),Ie.schema=wt,Ie.create(ht,vr,Cr,St)}function hF(Ie,ht){if(ht.data&&ht.data.estree&&Ie.evaluater){const wt=ht.data.estree.body[0];return wt.type,Ie.evaluater.evaluateExpression(wt.expression)}CT(Ie,ht.position)}function vF(Ie,ht){if(ht.data&&ht.data.estree&&Ie.evaluater)return Ie.evaluater.evaluateProgram(ht.data.estree);CT(Ie,ht.position)}function dF(Ie,ht,St){const wt=Ie.schema;let lr=wt;ht.name==="svg"&&wt.space==="html"&&(lr=fk,Ie.schema=lr),Ie.ancestors.push(ht);const vr=ht.name===null?Ie.Fragment:d4(Ie,ht.name,!0),Cr=xF(Ie,ht),nn=pk(Ie,ht);return v4(Ie,Cr,vr,ht),dk(Cr,nn),Ie.ancestors.pop(),Ie.schema=wt,Ie.create(ht,vr,Cr,St)}function pF(Ie,ht,St){const wt={};return dk(wt,pk(Ie,ht)),Ie.create(ht,Ie.Fragment,wt,St)}function mF(Ie,ht){return ht.value}function v4(Ie,ht,St,wt){typeof St!="string"&&St!==Ie.Fragment&&Ie.passNode&&(ht.node=wt)}function dk(Ie,ht){if(ht.length>0){const St=ht.length>1?ht:ht[0];St&&(Ie.children=St)}}function gF(Ie,ht,St){return wt;function wt(lr,vr,Cr,nn){const Jr=Array.isArray(Cr.children)?St:ht;return nn?Jr(vr,Cr,nn):Jr(vr,Cr)}}function yF(Ie,ht){return St;function St(wt,lr,vr,Cr){const nn=Array.isArray(vr.children),bn=hk(wt);return ht(lr,vr,Cr,nn,{columnNumber:bn?bn.column-1:void 0,fileName:Ie,lineNumber:bn?bn.line:void 0},void 0)}}function _F(Ie,ht){const St={};let wt,lr;for(lr in ht.properties)if(lr!=="children"&&vk.call(ht.properties,lr)){const vr=bF(Ie,lr,ht.properties[lr]);if(vr){const[Cr,nn]=vr;Ie.tableCellAlignToStyle&&Cr==="align"&&typeof nn=="string"&&uF.has(ht.tagName)?wt=nn:St[Cr]=nn}}if(wt){const vr=St.style||(St.style={});vr[Ie.stylePropertyNameCase==="css"?"text-align":"textAlign"]=wt}return St}function xF(Ie,ht){const St={};for(const wt of ht.attributes)if(wt.type==="mdxJsxExpressionAttribute")if(wt.data&&wt.data.estree&&Ie.evaluater){const vr=wt.data.estree.body[0];vr.type;const Cr=vr.expression;Cr.type;const nn=Cr.properties[0];nn.type,Object.assign(St,Ie.evaluater.evaluateExpression(nn.argument))}else CT(Ie,ht.position);else{const lr=wt.name;let vr;if(wt.value&&typeof wt.value=="object")if(wt.value.data&&wt.value.data.estree&&Ie.evaluater){const nn=wt.value.data.estree.body[0];nn.type,vr=Ie.evaluater.evaluateExpression(nn.expression)}else CT(Ie,ht.position);else vr=wt.value===null?!0:wt.value;St[lr]=vr}return St}function pk(Ie,ht){const St=[];let wt=-1;const lr=Ie.passKeys?new Map:oF;for(;++wtlr?0:lr+ht:ht=ht>lr?lr:ht,St=St>0?St:0,wt.length<1e4)Cr=Array.from(wt),Cr.unshift(ht,St),Ie.splice(...Cr);else for(St&&Ie.splice(ht,St);vr0?(Wm(Ie,Ie.length,0,ht),Ie):ht}const C8={}.hasOwnProperty;function CF(Ie){const ht={};let St=-1;for(;++St13&&St<32||St>126&&St<160||St>55295&&St<57344||St>64975&&St<65008||(St&65535)===65535||(St&65535)===65534||St>1114111?"�":String.fromCodePoint(St)}function Pw(Ie){return Ie.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zm=m1(/[A-Za-z]/),r0=m1(/[\dA-Za-z]/),RF=m1(/[#-'*+\--9=?A-Z^-~]/);function nk(Ie){return Ie!==null&&(Ie<32||Ie===127)}const ak=m1(/\d/),IF=m1(/[\dA-Fa-f]/),DF=m1(/[!-/:-@[-`{-~]/);function du(Ie){return Ie!==null&&Ie<-2}function Ep(Ie){return Ie!==null&&(Ie<0||Ie===32)}function yf(Ie){return Ie===-2||Ie===-1||Ie===32}const zF=m1(new RegExp("\\p{P}|\\p{S}","u")),OF=m1(/\s/);function m1(Ie){return ht;function ht(St){return St!==null&&St>-1&&Ie.test(String.fromCharCode(St))}}function Iw(Ie){const ht=[];let St=-1,wt=0,lr=0;for(;++St55295&&vr<57344){const nn=Ie.charCodeAt(St+1);vr<56320&&nn>56319&&nn<57344?(Cr=String.fromCharCode(vr,nn),lr=1):Cr="�"}else Cr=String.fromCharCode(vr);Cr&&(ht.push(Ie.slice(wt,St),encodeURIComponent(Cr)),wt=St+lr+1,Cr=""),lr&&(St+=lr,lr=0)}return ht.join("")+Ie.slice(wt)}function hh(Ie,ht,St,wt){const lr=wt?wt-1:Number.POSITIVE_INFINITY;let vr=0;return Cr;function Cr(bn){return yf(bn)?(Ie.enter(St),nn(bn)):ht(bn)}function nn(bn){return yf(bn)&&vr++Cr))return;const Fi=ht.events.length;let Ts=Fi,Mi,rl;for(;Ts--;)if(ht.events[Ts][0]==="exit"&&ht.events[Ts][1].type==="chunkFlow"){if(Mi){rl=ht.events[Ts][1].end;break}Mi=!0}for(bi(wt),yi=Fi;yiko;){const Mo=St[Tl];ht.containerState=Mo[1],Mo[0].exit.call(ht,Ie)}St.length=ko}function Ge(){lr.write([null]),vr=void 0,lr=void 0,ht.containerState._closeFlow=void 0}}function jF(Ie,ht,St){return hh(Ie,Ie.attempt(this.parser.constructs.document,ht,St),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function P8(Ie){if(Ie===null||Ep(Ie)||OF(Ie))return 1;if(zF(Ie))return 2}function gk(Ie,ht,St){const wt=[];let lr=-1;for(;++lr1&&Ie[St][1].end.offset-Ie[St][1].start.offset>1?2:1;const zn={...Ie[wt][1].end},_a={...Ie[St][1].start};R8(zn,-bn),R8(_a,bn),Cr={type:bn>1?"strongSequence":"emphasisSequence",start:zn,end:{...Ie[wt][1].end}},nn={type:bn>1?"strongSequence":"emphasisSequence",start:{...Ie[St][1].start},end:_a},vr={type:bn>1?"strongText":"emphasisText",start:{...Ie[wt][1].end},end:{...Ie[St][1].start}},lr={type:bn>1?"strong":"emphasis",start:{...Cr.start},end:{...nn.end}},Ie[wt][1].end={...Cr.start},Ie[St][1].start={...nn.end},Jr=[],Ie[wt][1].end.offset-Ie[wt][1].start.offset&&(Jr=A0(Jr,[["enter",Ie[wt][1],ht],["exit",Ie[wt][1],ht]])),Jr=A0(Jr,[["enter",lr,ht],["enter",Cr,ht],["exit",Cr,ht],["enter",vr,ht]]),Jr=A0(Jr,gk(ht.parser.constructs.insideSpan.null,Ie.slice(wt+1,St),ht)),Jr=A0(Jr,[["exit",vr,ht],["enter",nn,ht],["exit",nn,ht],["exit",lr,ht]]),Ie[St][1].end.offset-Ie[St][1].start.offset?(Tn=2,Jr=A0(Jr,[["enter",Ie[St][1],ht],["exit",Ie[St][1],ht]])):Tn=0,Wm(Ie,wt-1,St-wt+3,Jr),St=wt+Jr.length-Tn-2;break}}for(St=-1;++St0&&yf(yi)?hh(Ie,Ge,"linePrefix",vr+1)(yi):Ge(yi)}function Ge(yi){return yi===null||du(yi)?Ie.check(I8,So,Tl)(yi):(Ie.enter("codeFlowValue"),ko(yi))}function ko(yi){return yi===null||du(yi)?(Ie.exit("codeFlowValue"),Ge(yi)):(Ie.consume(yi),ko)}function Tl(yi){return Ie.exit("codeFenced"),ht(yi)}function Mo(yi,Fi,Ts){let Mi=0;return rl;function rl(zi){return yi.enter("lineEnding"),yi.consume(zi),yi.exit("lineEnding"),ji}function ji(zi){return yi.enter("codeFencedFence"),yf(zi)?hh(yi,Bo,"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(zi):Bo(zi)}function Bo(zi){return zi===nn?(yi.enter("codeFencedFenceSequence"),tu(zi)):Ts(zi)}function tu(zi){return zi===nn?(Mi++,yi.consume(zi),tu):Mi>=Cr?(yi.exit("codeFencedFenceSequence"),yf(zi)?hh(yi,Pi,"whitespace")(zi):Pi(zi)):Ts(zi)}function Pi(zi){return zi===null||du(zi)?(yi.exit("codeFencedFence"),Fi(zi)):Ts(zi)}}}function QF(Ie,ht,St){const wt=this;return lr;function lr(Cr){return Cr===null?St(Cr):(Ie.enter("lineEnding"),Ie.consume(Cr),Ie.exit("lineEnding"),vr)}function vr(Cr){return wt.parser.lazy[wt.now().line]?St(Cr):ht(Cr)}}const U6={name:"codeIndented",tokenize:tB},eB={partial:!0,tokenize:rB};function tB(Ie,ht,St){const wt=this;return lr;function lr(Jr){return Ie.enter("codeIndented"),hh(Ie,vr,"linePrefix",5)(Jr)}function vr(Jr){const Tn=wt.events[wt.events.length-1];return Tn&&Tn[1].type==="linePrefix"&&Tn[2].sliceSerialize(Tn[1],!0).length>=4?Cr(Jr):St(Jr)}function Cr(Jr){return Jr===null?bn(Jr):du(Jr)?Ie.attempt(eB,Cr,bn)(Jr):(Ie.enter("codeFlowValue"),nn(Jr))}function nn(Jr){return Jr===null||du(Jr)?(Ie.exit("codeFlowValue"),Cr(Jr)):(Ie.consume(Jr),nn)}function bn(Jr){return Ie.exit("codeIndented"),ht(Jr)}}function rB(Ie,ht,St){const wt=this;return lr;function lr(Cr){return wt.parser.lazy[wt.now().line]?St(Cr):du(Cr)?(Ie.enter("lineEnding"),Ie.consume(Cr),Ie.exit("lineEnding"),lr):hh(Ie,vr,"linePrefix",5)(Cr)}function vr(Cr){const nn=wt.events[wt.events.length-1];return nn&&nn[1].type==="linePrefix"&&nn[2].sliceSerialize(nn[1],!0).length>=4?ht(Cr):du(Cr)?lr(Cr):St(Cr)}}const nB={name:"codeText",previous:iB,resolve:aB,tokenize:oB};function aB(Ie){let ht=Ie.length-4,St=3,wt,lr;if((Ie[St][1].type==="lineEnding"||Ie[St][1].type==="space")&&(Ie[ht][1].type==="lineEnding"||Ie[ht][1].type==="space")){for(wt=St;++wt=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+ht+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return htthis.left.length?this.right.slice(this.right.length-wt+this.left.length,this.right.length-ht+this.left.length).reverse():this.left.slice(ht).concat(this.right.slice(this.right.length-wt+this.left.length).reverse())}splice(ht,St,wt){const lr=St||0;this.setCursor(Math.trunc(ht));const vr=this.right.splice(this.right.length-lr,Number.POSITIVE_INFINITY);return wt&&TT(this.left,wt),vr.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(ht){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(ht)}pushMany(ht){this.setCursor(Number.POSITIVE_INFINITY),TT(this.left,ht)}unshift(ht){this.setCursor(0),this.right.push(ht)}unshiftMany(ht){this.setCursor(0),TT(this.right,ht.reverse())}setCursor(ht){if(!(ht===this.left.length||ht>this.left.length&&this.right.length===0||ht<0&&this.left.length===0))if(ht=4?ht(Cr):Ie.interrupt(wt.parser.constructs.flow,St,ht)(Cr)}}function b4(Ie,ht,St,wt,lr,vr,Cr,nn,bn){const Jr=bn||Number.POSITIVE_INFINITY;let Tn=0;return zn;function zn(bi){return bi===60?(Ie.enter(wt),Ie.enter(lr),Ie.enter(vr),Ie.consume(bi),Ie.exit(vr),_a):bi===null||bi===32||bi===41||nk(bi)?St(bi):(Ie.enter(wt),Ie.enter(Cr),Ie.enter(nn),Ie.enter("chunkString",{contentType:"string"}),So(bi))}function _a(bi){return bi===62?(Ie.enter(vr),Ie.consume(bi),Ie.exit(vr),Ie.exit(lr),Ie.exit(wt),ht):(Ie.enter(nn),Ie.enter("chunkString",{contentType:"string"}),Qn(bi))}function Qn(bi){return bi===62?(Ie.exit("chunkString"),Ie.exit(nn),_a(bi)):bi===null||bi===60||du(bi)?St(bi):(Ie.consume(bi),bi===92?fo:Qn)}function fo(bi){return bi===60||bi===62||bi===92?(Ie.consume(bi),Qn):Qn(bi)}function So(bi){return!Tn&&(bi===null||bi===41||Ep(bi))?(Ie.exit("chunkString"),Ie.exit(nn),Ie.exit(Cr),Ie.exit(wt),ht(bi)):Tn999||Qn===null||Qn===91||Qn===93&&!bn||Qn===94&&!nn&&"_hiddenFootnoteSupport"in Cr.parser.constructs?St(Qn):Qn===93?(Ie.exit(vr),Ie.enter(lr),Ie.consume(Qn),Ie.exit(lr),Ie.exit(wt),ht):du(Qn)?(Ie.enter("lineEnding"),Ie.consume(Qn),Ie.exit("lineEnding"),Tn):(Ie.enter("chunkString",{contentType:"string"}),zn(Qn))}function zn(Qn){return Qn===null||Qn===91||Qn===93||du(Qn)||nn++>999?(Ie.exit("chunkString"),Tn(Qn)):(Ie.consume(Qn),bn||(bn=!yf(Qn)),Qn===92?_a:zn)}function _a(Qn){return Qn===91||Qn===92||Qn===93?(Ie.consume(Qn),nn++,zn):zn(Qn)}}function T4(Ie,ht,St,wt,lr,vr){let Cr;return nn;function nn(_a){return _a===34||_a===39||_a===40?(Ie.enter(wt),Ie.enter(lr),Ie.consume(_a),Ie.exit(lr),Cr=_a===40?41:_a,bn):St(_a)}function bn(_a){return _a===Cr?(Ie.enter(lr),Ie.consume(_a),Ie.exit(lr),Ie.exit(wt),ht):(Ie.enter(vr),Jr(_a))}function Jr(_a){return _a===Cr?(Ie.exit(vr),bn(Cr)):_a===null?St(_a):du(_a)?(Ie.enter("lineEnding"),Ie.consume(_a),Ie.exit("lineEnding"),hh(Ie,Jr,"linePrefix")):(Ie.enter("chunkString",{contentType:"string"}),Tn(_a))}function Tn(_a){return _a===Cr||_a===null||du(_a)?(Ie.exit("chunkString"),Jr(_a)):(Ie.consume(_a),_a===92?zn:Tn)}function zn(_a){return _a===Cr||_a===92?(Ie.consume(_a),Tn):Tn(_a)}}function ET(Ie,ht){let St;return wt;function wt(lr){return du(lr)?(Ie.enter("lineEnding"),Ie.consume(lr),Ie.exit("lineEnding"),St=!0,wt):yf(lr)?hh(Ie,wt,St?"linePrefix":"lineSuffix")(lr):ht(lr)}}const dB={name:"definition",tokenize:mB},pB={partial:!0,tokenize:gB};function mB(Ie,ht,St){const wt=this;let lr;return vr;function vr(Qn){return Ie.enter("definition"),Cr(Qn)}function Cr(Qn){return w4.call(wt,Ie,nn,St,"definitionLabel","definitionLabelMarker","definitionLabelString")(Qn)}function nn(Qn){return lr=Pw(wt.sliceSerialize(wt.events[wt.events.length-1][1]).slice(1,-1)),Qn===58?(Ie.enter("definitionMarker"),Ie.consume(Qn),Ie.exit("definitionMarker"),bn):St(Qn)}function bn(Qn){return Ep(Qn)?ET(Ie,Jr)(Qn):Jr(Qn)}function Jr(Qn){return b4(Ie,Tn,St,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Qn)}function Tn(Qn){return Ie.attempt(pB,zn,zn)(Qn)}function zn(Qn){return yf(Qn)?hh(Ie,_a,"whitespace")(Qn):_a(Qn)}function _a(Qn){return Qn===null||du(Qn)?(Ie.exit("definition"),wt.parser.defined.push(lr),ht(Qn)):St(Qn)}}function gB(Ie,ht,St){return wt;function wt(nn){return Ep(nn)?ET(Ie,lr)(nn):St(nn)}function lr(nn){return T4(Ie,vr,St,"definitionTitle","definitionTitleMarker","definitionTitleString")(nn)}function vr(nn){return yf(nn)?hh(Ie,Cr,"whitespace")(nn):Cr(nn)}function Cr(nn){return nn===null||du(nn)?ht(nn):St(nn)}}const yB={name:"hardBreakEscape",tokenize:_B};function _B(Ie,ht,St){return wt;function wt(vr){return Ie.enter("hardBreakEscape"),Ie.consume(vr),lr}function lr(vr){return du(vr)?(Ie.exit("hardBreakEscape"),ht(vr)):St(vr)}}const xB={name:"headingAtx",resolve:bB,tokenize:wB};function bB(Ie,ht){let St=Ie.length-2,wt=3,lr,vr;return Ie[wt][1].type==="whitespace"&&(wt+=2),St-2>wt&&Ie[St][1].type==="whitespace"&&(St-=2),Ie[St][1].type==="atxHeadingSequence"&&(wt===St-1||St-4>wt&&Ie[St-2][1].type==="whitespace")&&(St-=wt+1===St?2:4),St>wt&&(lr={type:"atxHeadingText",start:Ie[wt][1].start,end:Ie[St][1].end},vr={type:"chunkText",start:Ie[wt][1].start,end:Ie[St][1].end,contentType:"text"},Wm(Ie,wt,St-wt+1,[["enter",lr,ht],["enter",vr,ht],["exit",vr,ht],["exit",lr,ht]])),Ie}function wB(Ie,ht,St){let wt=0;return lr;function lr(Tn){return Ie.enter("atxHeading"),vr(Tn)}function vr(Tn){return Ie.enter("atxHeadingSequence"),Cr(Tn)}function Cr(Tn){return Tn===35&&wt++<6?(Ie.consume(Tn),Cr):Tn===null||Ep(Tn)?(Ie.exit("atxHeadingSequence"),nn(Tn)):St(Tn)}function nn(Tn){return Tn===35?(Ie.enter("atxHeadingSequence"),bn(Tn)):Tn===null||du(Tn)?(Ie.exit("atxHeading"),ht(Tn)):yf(Tn)?hh(Ie,nn,"whitespace")(Tn):(Ie.enter("atxHeadingText"),Jr(Tn))}function bn(Tn){return Tn===35?(Ie.consume(Tn),bn):(Ie.exit("atxHeadingSequence"),nn(Tn))}function Jr(Tn){return Tn===null||Tn===35||Ep(Tn)?(Ie.exit("atxHeadingText"),nn(Tn)):(Ie.consume(Tn),Jr)}}const TB=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],z8=["pre","script","style","textarea"],AB={concrete:!0,name:"htmlFlow",resolveTo:EB,tokenize:kB},SB={partial:!0,tokenize:LB},MB={partial:!0,tokenize:CB};function EB(Ie){let ht=Ie.length;for(;ht--&&!(Ie[ht][0]==="enter"&&Ie[ht][1].type==="htmlFlow"););return ht>1&&Ie[ht-2][1].type==="linePrefix"&&(Ie[ht][1].start=Ie[ht-2][1].start,Ie[ht+1][1].start=Ie[ht-2][1].start,Ie.splice(ht-2,2)),Ie}function kB(Ie,ht,St){const wt=this;let lr,vr,Cr,nn,bn;return Jr;function Jr($n){return Tn($n)}function Tn($n){return Ie.enter("htmlFlow"),Ie.enter("htmlFlowData"),Ie.consume($n),zn}function zn($n){return $n===33?(Ie.consume($n),_a):$n===47?(Ie.consume($n),vr=!0,So):$n===63?(Ie.consume($n),lr=3,wt.interrupt?ht:wa):Zm($n)?(Ie.consume($n),Cr=String.fromCharCode($n),Io):St($n)}function _a($n){return $n===45?(Ie.consume($n),lr=2,Qn):$n===91?(Ie.consume($n),lr=5,nn=0,fo):Zm($n)?(Ie.consume($n),lr=4,wt.interrupt?ht:wa):St($n)}function Qn($n){return $n===45?(Ie.consume($n),wt.interrupt?ht:wa):St($n)}function fo($n){const xs="CDATA[";return $n===xs.charCodeAt(nn++)?(Ie.consume($n),nn===xs.length?wt.interrupt?ht:Bo:fo):St($n)}function So($n){return Zm($n)?(Ie.consume($n),Cr=String.fromCharCode($n),Io):St($n)}function Io($n){if($n===null||$n===47||$n===62||Ep($n)){const xs=$n===47,Bs=Cr.toLowerCase();return!xs&&!vr&&z8.includes(Bs)?(lr=1,wt.interrupt?ht($n):Bo($n)):TB.includes(Cr.toLowerCase())?(lr=6,xs?(Ie.consume($n),bi):wt.interrupt?ht($n):Bo($n)):(lr=7,wt.interrupt&&!wt.parser.lazy[wt.now().line]?St($n):vr?Ge($n):ko($n))}return $n===45||r0($n)?(Ie.consume($n),Cr+=String.fromCharCode($n),Io):St($n)}function bi($n){return $n===62?(Ie.consume($n),wt.interrupt?ht:Bo):St($n)}function Ge($n){return yf($n)?(Ie.consume($n),Ge):rl($n)}function ko($n){return $n===47?(Ie.consume($n),rl):$n===58||$n===95||Zm($n)?(Ie.consume($n),Tl):yf($n)?(Ie.consume($n),ko):rl($n)}function Tl($n){return $n===45||$n===46||$n===58||$n===95||r0($n)?(Ie.consume($n),Tl):Mo($n)}function Mo($n){return $n===61?(Ie.consume($n),yi):yf($n)?(Ie.consume($n),Mo):ko($n)}function yi($n){return $n===null||$n===60||$n===61||$n===62||$n===96?St($n):$n===34||$n===39?(Ie.consume($n),bn=$n,Fi):yf($n)?(Ie.consume($n),yi):Ts($n)}function Fi($n){return $n===bn?(Ie.consume($n),bn=null,Mi):$n===null||du($n)?St($n):(Ie.consume($n),Fi)}function Ts($n){return $n===null||$n===34||$n===39||$n===47||$n===60||$n===61||$n===62||$n===96||Ep($n)?Mo($n):(Ie.consume($n),Ts)}function Mi($n){return $n===47||$n===62||yf($n)?ko($n):St($n)}function rl($n){return $n===62?(Ie.consume($n),ji):St($n)}function ji($n){return $n===null||du($n)?Bo($n):yf($n)?(Ie.consume($n),ji):St($n)}function Bo($n){return $n===45&&lr===2?(Ie.consume($n),Si):$n===60&&lr===1?(Ie.consume($n),wo):$n===62&&lr===4?(Ie.consume($n),qa):$n===63&&lr===3?(Ie.consume($n),wa):$n===93&&lr===5?(Ie.consume($n),Au):du($n)&&(lr===6||lr===7)?(Ie.exit("htmlFlowData"),Ie.check(SB,ro,tu)($n)):$n===null||du($n)?(Ie.exit("htmlFlowData"),tu($n)):(Ie.consume($n),Bo)}function tu($n){return Ie.check(MB,Pi,ro)($n)}function Pi($n){return Ie.enter("lineEnding"),Ie.consume($n),Ie.exit("lineEnding"),zi}function zi($n){return $n===null||du($n)?tu($n):(Ie.enter("htmlFlowData"),Bo($n))}function Si($n){return $n===45?(Ie.consume($n),wa):Bo($n)}function wo($n){return $n===47?(Ie.consume($n),Cr="",As):Bo($n)}function As($n){if($n===62){const xs=Cr.toLowerCase();return z8.includes(xs)?(Ie.consume($n),qa):Bo($n)}return Zm($n)&&Cr.length<8?(Ie.consume($n),Cr+=String.fromCharCode($n),As):Bo($n)}function Au($n){return $n===93?(Ie.consume($n),wa):Bo($n)}function wa($n){return $n===62?(Ie.consume($n),qa):$n===45&&lr===2?(Ie.consume($n),wa):Bo($n)}function qa($n){return $n===null||du($n)?(Ie.exit("htmlFlowData"),ro($n)):(Ie.consume($n),qa)}function ro($n){return Ie.exit("htmlFlow"),ht($n)}}function CB(Ie,ht,St){const wt=this;return lr;function lr(Cr){return du(Cr)?(Ie.enter("lineEnding"),Ie.consume(Cr),Ie.exit("lineEnding"),vr):St(Cr)}function vr(Cr){return wt.parser.lazy[wt.now().line]?St(Cr):ht(Cr)}}function LB(Ie,ht,St){return wt;function wt(lr){return Ie.enter("lineEnding"),Ie.consume(lr),Ie.exit("lineEnding"),Ie.attempt(aM,ht,St)}}const PB={name:"htmlText",tokenize:RB};function RB(Ie,ht,St){const wt=this;let lr,vr,Cr;return nn;function nn(wa){return Ie.enter("htmlText"),Ie.enter("htmlTextData"),Ie.consume(wa),bn}function bn(wa){return wa===33?(Ie.consume(wa),Jr):wa===47?(Ie.consume(wa),Mo):wa===63?(Ie.consume(wa),ko):Zm(wa)?(Ie.consume(wa),Ts):St(wa)}function Jr(wa){return wa===45?(Ie.consume(wa),Tn):wa===91?(Ie.consume(wa),vr=0,fo):Zm(wa)?(Ie.consume(wa),Ge):St(wa)}function Tn(wa){return wa===45?(Ie.consume(wa),Qn):St(wa)}function zn(wa){return wa===null?St(wa):wa===45?(Ie.consume(wa),_a):du(wa)?(Cr=zn,wo(wa)):(Ie.consume(wa),zn)}function _a(wa){return wa===45?(Ie.consume(wa),Qn):zn(wa)}function Qn(wa){return wa===62?Si(wa):wa===45?_a(wa):zn(wa)}function fo(wa){const qa="CDATA[";return wa===qa.charCodeAt(vr++)?(Ie.consume(wa),vr===qa.length?So:fo):St(wa)}function So(wa){return wa===null?St(wa):wa===93?(Ie.consume(wa),Io):du(wa)?(Cr=So,wo(wa)):(Ie.consume(wa),So)}function Io(wa){return wa===93?(Ie.consume(wa),bi):So(wa)}function bi(wa){return wa===62?Si(wa):wa===93?(Ie.consume(wa),bi):So(wa)}function Ge(wa){return wa===null||wa===62?Si(wa):du(wa)?(Cr=Ge,wo(wa)):(Ie.consume(wa),Ge)}function ko(wa){return wa===null?St(wa):wa===63?(Ie.consume(wa),Tl):du(wa)?(Cr=ko,wo(wa)):(Ie.consume(wa),ko)}function Tl(wa){return wa===62?Si(wa):ko(wa)}function Mo(wa){return Zm(wa)?(Ie.consume(wa),yi):St(wa)}function yi(wa){return wa===45||r0(wa)?(Ie.consume(wa),yi):Fi(wa)}function Fi(wa){return du(wa)?(Cr=Fi,wo(wa)):yf(wa)?(Ie.consume(wa),Fi):Si(wa)}function Ts(wa){return wa===45||r0(wa)?(Ie.consume(wa),Ts):wa===47||wa===62||Ep(wa)?Mi(wa):St(wa)}function Mi(wa){return wa===47?(Ie.consume(wa),Si):wa===58||wa===95||Zm(wa)?(Ie.consume(wa),rl):du(wa)?(Cr=Mi,wo(wa)):yf(wa)?(Ie.consume(wa),Mi):Si(wa)}function rl(wa){return wa===45||wa===46||wa===58||wa===95||r0(wa)?(Ie.consume(wa),rl):ji(wa)}function ji(wa){return wa===61?(Ie.consume(wa),Bo):du(wa)?(Cr=ji,wo(wa)):yf(wa)?(Ie.consume(wa),ji):Mi(wa)}function Bo(wa){return wa===null||wa===60||wa===61||wa===62||wa===96?St(wa):wa===34||wa===39?(Ie.consume(wa),lr=wa,tu):du(wa)?(Cr=Bo,wo(wa)):yf(wa)?(Ie.consume(wa),Bo):(Ie.consume(wa),Pi)}function tu(wa){return wa===lr?(Ie.consume(wa),lr=void 0,zi):wa===null?St(wa):du(wa)?(Cr=tu,wo(wa)):(Ie.consume(wa),tu)}function Pi(wa){return wa===null||wa===34||wa===39||wa===60||wa===61||wa===96?St(wa):wa===47||wa===62||Ep(wa)?Mi(wa):(Ie.consume(wa),Pi)}function zi(wa){return wa===47||wa===62||Ep(wa)?Mi(wa):St(wa)}function Si(wa){return wa===62?(Ie.consume(wa),Ie.exit("htmlTextData"),Ie.exit("htmlText"),ht):St(wa)}function wo(wa){return Ie.exit("htmlTextData"),Ie.enter("lineEnding"),Ie.consume(wa),Ie.exit("lineEnding"),As}function As(wa){return yf(wa)?hh(Ie,Au,"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(wa):Au(wa)}function Au(wa){return Ie.enter("htmlTextData"),Cr(wa)}}const yk={name:"labelEnd",resolveAll:OB,resolveTo:FB,tokenize:BB},IB={tokenize:NB},DB={tokenize:UB},zB={tokenize:jB};function OB(Ie){let ht=-1;const St=[];for(;++ht=3&&(Jr===null||du(Jr))?(Ie.exit("thematicBreak"),ht(Jr)):St(Jr)}function bn(Jr){return Jr===lr?(Ie.consume(Jr),wt++,bn):(Ie.exit("thematicBreakSequence"),yf(Jr)?hh(Ie,nn,"whitespace")(Jr):nn(Jr))}}const Mp={continuation:{tokenize:$B},exit:QB,name:"list",tokenize:KB},ZB={partial:!0,tokenize:eN},WB={partial:!0,tokenize:JB};function KB(Ie,ht,St){const wt=this,lr=wt.events[wt.events.length-1];let vr=lr&&lr[1].type==="linePrefix"?lr[2].sliceSerialize(lr[1],!0).length:0,Cr=0;return nn;function nn(Qn){const fo=wt.containerState.type||(Qn===42||Qn===43||Qn===45?"listUnordered":"listOrdered");if(fo==="listUnordered"?!wt.containerState.marker||Qn===wt.containerState.marker:ak(Qn)){if(wt.containerState.type||(wt.containerState.type=fo,Ie.enter(fo,{_container:!0})),fo==="listUnordered")return Ie.enter("listItemPrefix"),Qn===42||Qn===45?Ie.check(eM,St,Jr)(Qn):Jr(Qn);if(!wt.interrupt||Qn===49)return Ie.enter("listItemPrefix"),Ie.enter("listItemValue"),bn(Qn)}return St(Qn)}function bn(Qn){return ak(Qn)&&++Cr<10?(Ie.consume(Qn),bn):(!wt.interrupt||Cr<2)&&(wt.containerState.marker?Qn===wt.containerState.marker:Qn===41||Qn===46)?(Ie.exit("listItemValue"),Jr(Qn)):St(Qn)}function Jr(Qn){return Ie.enter("listItemMarker"),Ie.consume(Qn),Ie.exit("listItemMarker"),wt.containerState.marker=wt.containerState.marker||Qn,Ie.check(aM,wt.interrupt?St:Tn,Ie.attempt(ZB,_a,zn))}function Tn(Qn){return wt.containerState.initialBlankLine=!0,vr++,_a(Qn)}function zn(Qn){return yf(Qn)?(Ie.enter("listItemPrefixWhitespace"),Ie.consume(Qn),Ie.exit("listItemPrefixWhitespace"),_a):St(Qn)}function _a(Qn){return wt.containerState.size=vr+wt.sliceSerialize(Ie.exit("listItemPrefix"),!0).length,ht(Qn)}}function $B(Ie,ht,St){const wt=this;return wt.containerState._closeFlow=void 0,Ie.check(aM,lr,vr);function lr(nn){return wt.containerState.furtherBlankLines=wt.containerState.furtherBlankLines||wt.containerState.initialBlankLine,hh(Ie,ht,"listItemIndent",wt.containerState.size+1)(nn)}function vr(nn){return wt.containerState.furtherBlankLines||!yf(nn)?(wt.containerState.furtherBlankLines=void 0,wt.containerState.initialBlankLine=void 0,Cr(nn)):(wt.containerState.furtherBlankLines=void 0,wt.containerState.initialBlankLine=void 0,Ie.attempt(WB,ht,Cr)(nn))}function Cr(nn){return wt.containerState._closeFlow=!0,wt.interrupt=void 0,hh(Ie,Ie.attempt(Mp,ht,St),"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(nn)}}function JB(Ie,ht,St){const wt=this;return hh(Ie,lr,"listItemIndent",wt.containerState.size+1);function lr(vr){const Cr=wt.events[wt.events.length-1];return Cr&&Cr[1].type==="listItemIndent"&&Cr[2].sliceSerialize(Cr[1],!0).length===wt.containerState.size?ht(vr):St(vr)}}function QB(Ie){Ie.exit(this.containerState.type)}function eN(Ie,ht,St){const wt=this;return hh(Ie,lr,"listItemPrefixWhitespace",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function lr(vr){const Cr=wt.events[wt.events.length-1];return!yf(vr)&&Cr&&Cr[1].type==="listItemPrefixWhitespace"?ht(vr):St(vr)}}const O8={name:"setextUnderline",resolveTo:tN,tokenize:rN};function tN(Ie,ht){let St=Ie.length,wt,lr,vr;for(;St--;)if(Ie[St][0]==="enter"){if(Ie[St][1].type==="content"){wt=St;break}Ie[St][1].type==="paragraph"&&(lr=St)}else Ie[St][1].type==="content"&&Ie.splice(St,1),!vr&&Ie[St][1].type==="definition"&&(vr=St);const Cr={type:"setextHeading",start:{...Ie[wt][1].start},end:{...Ie[Ie.length-1][1].end}};return Ie[lr][1].type="setextHeadingText",vr?(Ie.splice(lr,0,["enter",Cr,ht]),Ie.splice(vr+1,0,["exit",Ie[wt][1],ht]),Ie[wt][1].end={...Ie[vr][1].end}):Ie[wt][1]=Cr,Ie.push(["exit",Cr,ht]),Ie}function rN(Ie,ht,St){const wt=this;let lr;return vr;function vr(Jr){let Tn=wt.events.length,zn;for(;Tn--;)if(wt.events[Tn][1].type!=="lineEnding"&&wt.events[Tn][1].type!=="linePrefix"&&wt.events[Tn][1].type!=="content"){zn=wt.events[Tn][1].type==="paragraph";break}return!wt.parser.lazy[wt.now().line]&&(wt.interrupt||zn)?(Ie.enter("setextHeadingLine"),lr=Jr,Cr(Jr)):St(Jr)}function Cr(Jr){return Ie.enter("setextHeadingLineSequence"),nn(Jr)}function nn(Jr){return Jr===lr?(Ie.consume(Jr),nn):(Ie.exit("setextHeadingLineSequence"),yf(Jr)?hh(Ie,bn,"lineSuffix")(Jr):bn(Jr))}function bn(Jr){return Jr===null||du(Jr)?(Ie.exit("setextHeadingLine"),ht(Jr)):St(Jr)}}const nN={tokenize:aN};function aN(Ie){const ht=this,St=Ie.attempt(aM,wt,Ie.attempt(this.parser.constructs.flowInitial,lr,hh(Ie,Ie.attempt(this.parser.constructs.flow,lr,Ie.attempt(uB,lr)),"linePrefix")));return St;function wt(vr){if(vr===null){Ie.consume(vr);return}return Ie.enter("lineEndingBlank"),Ie.consume(vr),Ie.exit("lineEndingBlank"),ht.currentConstruct=void 0,St}function lr(vr){if(vr===null){Ie.consume(vr);return}return Ie.enter("lineEnding"),Ie.consume(vr),Ie.exit("lineEnding"),ht.currentConstruct=void 0,St}}const iN={resolveAll:S4()},oN=A4("string"),sN=A4("text");function A4(Ie){return{resolveAll:S4(Ie==="text"?lN:void 0),tokenize:ht};function ht(St){const wt=this,lr=this.parser.constructs[Ie],vr=St.attempt(lr,Cr,nn);return Cr;function Cr(Tn){return Jr(Tn)?vr(Tn):nn(Tn)}function nn(Tn){if(Tn===null){St.consume(Tn);return}return St.enter("data"),St.consume(Tn),bn}function bn(Tn){return Jr(Tn)?(St.exit("data"),vr(Tn)):(St.consume(Tn),bn)}function Jr(Tn){if(Tn===null)return!0;const zn=lr[Tn];let _a=-1;if(zn)for(;++_a-1){const nn=Cr[0];typeof nn=="string"?Cr[0]=nn.slice(wt):Cr.shift()}vr>0&&Cr.push(Ie[lr].slice(0,vr))}return Cr}function bN(Ie,ht){let St=-1;const wt=[];let lr;for(;++St0){const Wd=Jl.tokenStack[Jl.tokenStack.length-1];(Wd[1]||B8).call(Jl,void 0,Wd[0])}for(us.position={start:p1(ao.length>0?ao[0][1].start:{line:1,column:1,offset:0}),end:p1(ao.length>0?ao[ao.length-2][1].end:{line:1,column:1,offset:0})},Zc=-1;++Zc0&&(wt.className=["language-"+lr[0]]);let vr={type:"element",tagName:"code",properties:wt,children:[{type:"text",value:St}]};return ht.meta&&(vr.data={meta:ht.meta}),Ie.patch(ht,vr),vr=Ie.applyData(ht,vr),vr={type:"element",tagName:"pre",properties:{},children:[vr]},Ie.patch(ht,vr),vr}function zN(Ie,ht){const St={type:"element",tagName:"del",properties:{},children:Ie.all(ht)};return Ie.patch(ht,St),Ie.applyData(ht,St)}function ON(Ie,ht){const St={type:"element",tagName:"em",properties:{},children:Ie.all(ht)};return Ie.patch(ht,St),Ie.applyData(ht,St)}function FN(Ie,ht){const St=typeof Ie.options.clobberPrefix=="string"?Ie.options.clobberPrefix:"user-content-",wt=String(ht.identifier).toUpperCase(),lr=Iw(wt.toLowerCase()),vr=Ie.footnoteOrder.indexOf(wt);let Cr,nn=Ie.footnoteCounts.get(wt);nn===void 0?(nn=0,Ie.footnoteOrder.push(wt),Cr=Ie.footnoteOrder.length):Cr=vr+1,nn+=1,Ie.footnoteCounts.set(wt,nn);const bn={type:"element",tagName:"a",properties:{href:"#"+St+"fn-"+lr,id:St+"fnref-"+lr+(nn>1?"-"+nn:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(Cr)}]};Ie.patch(ht,bn);const Jr={type:"element",tagName:"sup",properties:{},children:[bn]};return Ie.patch(ht,Jr),Ie.applyData(ht,Jr)}function BN(Ie,ht){const St={type:"element",tagName:"h"+ht.depth,properties:{},children:Ie.all(ht)};return Ie.patch(ht,St),Ie.applyData(ht,St)}function NN(Ie,ht){if(Ie.options.allowDangerousHtml){const St={type:"raw",value:ht.value};return Ie.patch(ht,St),Ie.applyData(ht,St)}}function k4(Ie,ht){const St=ht.referenceType;let wt="]";if(St==="collapsed"?wt+="[]":St==="full"&&(wt+="["+(ht.label||ht.identifier)+"]"),ht.type==="imageReference")return[{type:"text",value:"!["+ht.alt+wt}];const lr=Ie.all(ht),vr=lr[0];vr&&vr.type==="text"?vr.value="["+vr.value:lr.unshift({type:"text",value:"["});const Cr=lr[lr.length-1];return Cr&&Cr.type==="text"?Cr.value+=wt:lr.push({type:"text",value:wt}),lr}function UN(Ie,ht){const St=String(ht.identifier).toUpperCase(),wt=Ie.definitionById.get(St);if(!wt)return k4(Ie,ht);const lr={src:Iw(wt.url||""),alt:ht.alt};wt.title!==null&&wt.title!==void 0&&(lr.title=wt.title);const vr={type:"element",tagName:"img",properties:lr,children:[]};return Ie.patch(ht,vr),Ie.applyData(ht,vr)}function jN(Ie,ht){const St={src:Iw(ht.url)};ht.alt!==null&&ht.alt!==void 0&&(St.alt=ht.alt),ht.title!==null&&ht.title!==void 0&&(St.title=ht.title);const wt={type:"element",tagName:"img",properties:St,children:[]};return Ie.patch(ht,wt),Ie.applyData(ht,wt)}function qN(Ie,ht){const St={type:"text",value:ht.value.replace(/\r?\n|\r/g," ")};Ie.patch(ht,St);const wt={type:"element",tagName:"code",properties:{},children:[St]};return Ie.patch(ht,wt),Ie.applyData(ht,wt)}function VN(Ie,ht){const St=String(ht.identifier).toUpperCase(),wt=Ie.definitionById.get(St);if(!wt)return k4(Ie,ht);const lr={href:Iw(wt.url||"")};wt.title!==null&&wt.title!==void 0&&(lr.title=wt.title);const vr={type:"element",tagName:"a",properties:lr,children:Ie.all(ht)};return Ie.patch(ht,vr),Ie.applyData(ht,vr)}function HN(Ie,ht){const St={href:Iw(ht.url)};ht.title!==null&&ht.title!==void 0&&(St.title=ht.title);const wt={type:"element",tagName:"a",properties:St,children:Ie.all(ht)};return Ie.patch(ht,wt),Ie.applyData(ht,wt)}function GN(Ie,ht,St){const wt=Ie.all(ht),lr=St?XN(St):C4(ht),vr={},Cr=[];if(typeof ht.checked=="boolean"){const Tn=wt[0];let zn;Tn&&Tn.type==="element"&&Tn.tagName==="p"?zn=Tn:(zn={type:"element",tagName:"p",properties:{},children:[]},wt.unshift(zn)),zn.children.length>0&&zn.children.unshift({type:"text",value:" "}),zn.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:ht.checked,disabled:!0},children:[]}),vr.className=["task-list-item"]}let nn=-1;for(;++nn1}function YN(Ie,ht){const St={},wt=Ie.all(ht);let lr=-1;for(typeof ht.start=="number"&&ht.start!==1&&(St.start=ht.start);++lr0){const Cr={type:"element",tagName:"tbody",properties:{},children:Ie.wrap(St,!0)},nn=hk(ht.children[1]),bn=u4(ht.children[ht.children.length-1]);nn&&bn&&(Cr.position={start:nn,end:bn}),lr.push(Cr)}const vr={type:"element",tagName:"table",properties:{},children:Ie.wrap(lr,!0)};return Ie.patch(ht,vr),Ie.applyData(ht,vr)}function JN(Ie,ht,St){const wt=St?St.children:void 0,vr=(wt?wt.indexOf(ht):1)===0?"th":"td",Cr=St&&St.type==="table"?St.align:void 0,nn=Cr?Cr.length:ht.children.length;let bn=-1;const Jr=[];for(;++bn0,!0),wt[0]),lr=wt.index+wt[0].length,wt=St.exec(ht);return vr.push(j8(ht.slice(lr),lr>0,!1)),vr.join("")}function j8(Ie,ht,St){let wt=0,lr=Ie.length;if(ht){let vr=Ie.codePointAt(wt);for(;vr===N8||vr===U8;)wt++,vr=Ie.codePointAt(wt)}if(St){let vr=Ie.codePointAt(lr-1);for(;vr===N8||vr===U8;)lr--,vr=Ie.codePointAt(lr-1)}return lr>wt?Ie.slice(wt,lr):""}function tU(Ie,ht){const St={type:"text",value:eU(String(ht.value))};return Ie.patch(ht,St),Ie.applyData(ht,St)}function rU(Ie,ht){const St={type:"element",tagName:"hr",properties:{},children:[]};return Ie.patch(ht,St),Ie.applyData(ht,St)}const nU={blockquote:RN,break:IN,code:DN,delete:zN,emphasis:ON,footnoteReference:FN,heading:BN,html:NN,imageReference:UN,image:jN,inlineCode:qN,linkReference:VN,link:HN,listItem:GN,list:YN,paragraph:ZN,root:WN,strong:KN,table:$N,tableCell:QN,tableRow:JN,text:tU,thematicBreak:rU,toml:KS,yaml:KS,definition:KS,footnoteDefinition:KS};function KS(){}const L4=-1,iM=0,kT=1,tM=2,_k=3,xk=4,bk=5,wk=6,P4=7,R4=8,q8=typeof self=="object"?self:globalThis,aU=(Ie,ht)=>{const St=(lr,vr)=>(Ie.set(vr,lr),lr),wt=lr=>{if(Ie.has(lr))return Ie.get(lr);const[vr,Cr]=ht[lr];switch(vr){case iM:case L4:return St(Cr,lr);case kT:{const nn=St([],lr);for(const bn of Cr)nn.push(wt(bn));return nn}case tM:{const nn=St({},lr);for(const[bn,Jr]of Cr)nn[wt(bn)]=wt(Jr);return nn}case _k:return St(new Date(Cr),lr);case xk:{const{source:nn,flags:bn}=Cr;return St(new RegExp(nn,bn),lr)}case bk:{const nn=St(new Map,lr);for(const[bn,Jr]of Cr)nn.set(wt(bn),wt(Jr));return nn}case wk:{const nn=St(new Set,lr);for(const bn of Cr)nn.add(wt(bn));return nn}case P4:{const{name:nn,message:bn}=Cr;return St(new q8[nn](bn),lr)}case R4:return St(BigInt(Cr),lr);case"BigInt":return St(Object(BigInt(Cr)),lr);case"ArrayBuffer":return St(new Uint8Array(Cr).buffer,Cr);case"DataView":{const{buffer:nn}=new Uint8Array(Cr);return St(new DataView(nn),Cr)}}return St(new q8[vr](Cr),lr)};return wt},V8=Ie=>aU(new Map,Ie)(0),Cw="",{toString:iU}={},{keys:oU}=Object,AT=Ie=>{const ht=typeof Ie;if(ht!=="object"||!Ie)return[iM,ht];const St=iU.call(Ie).slice(8,-1);switch(St){case"Array":return[kT,Cw];case"Object":return[tM,Cw];case"Date":return[_k,Cw];case"RegExp":return[xk,Cw];case"Map":return[bk,Cw];case"Set":return[wk,Cw];case"DataView":return[kT,St]}return St.includes("Array")?[kT,St]:St.includes("Error")?[P4,St]:[tM,St]},$S=([Ie,ht])=>Ie===iM&&(ht==="function"||ht==="symbol"),sU=(Ie,ht,St,wt)=>{const lr=(Cr,nn)=>{const bn=wt.push(Cr)-1;return St.set(nn,bn),bn},vr=Cr=>{if(St.has(Cr))return St.get(Cr);let[nn,bn]=AT(Cr);switch(nn){case iM:{let Tn=Cr;switch(bn){case"bigint":nn=R4,Tn=Cr.toString();break;case"function":case"symbol":if(Ie)throw new TypeError("unable to serialize "+bn);Tn=null;break;case"undefined":return lr([L4],Cr)}return lr([nn,Tn],Cr)}case kT:{if(bn){let _a=Cr;return bn==="DataView"?_a=new Uint8Array(Cr.buffer):bn==="ArrayBuffer"&&(_a=new Uint8Array(Cr)),lr([bn,[..._a]],Cr)}const Tn=[],zn=lr([nn,Tn],Cr);for(const _a of Cr)Tn.push(vr(_a));return zn}case tM:{if(bn)switch(bn){case"BigInt":return lr([bn,Cr.toString()],Cr);case"Boolean":case"Number":case"String":return lr([bn,Cr.valueOf()],Cr)}if(ht&&"toJSON"in Cr)return vr(Cr.toJSON());const Tn=[],zn=lr([nn,Tn],Cr);for(const _a of oU(Cr))(Ie||!$S(AT(Cr[_a])))&&Tn.push([vr(_a),vr(Cr[_a])]);return zn}case _k:return lr([nn,Cr.toISOString()],Cr);case xk:{const{source:Tn,flags:zn}=Cr;return lr([nn,{source:Tn,flags:zn}],Cr)}case bk:{const Tn=[],zn=lr([nn,Tn],Cr);for(const[_a,Qn]of Cr)(Ie||!($S(AT(_a))||$S(AT(Qn))))&&Tn.push([vr(_a),vr(Qn)]);return zn}case wk:{const Tn=[],zn=lr([nn,Tn],Cr);for(const _a of Cr)(Ie||!$S(AT(_a)))&&Tn.push(vr(_a));return zn}}const{message:Jr}=Cr;return lr([nn,{name:bn,message:Jr}],Cr)};return vr},H8=(Ie,{json:ht,lossy:St}={})=>{const wt=[];return sU(!(ht||St),!!ht,new Map,wt)(Ie),wt},rM=typeof structuredClone=="function"?(Ie,ht)=>ht&&("json"in ht||"lossy"in ht)?V8(H8(Ie,ht)):structuredClone(Ie):(Ie,ht)=>V8(H8(Ie,ht));function lU(Ie,ht){const St=[{type:"text",value:"↩"}];return ht>1&&St.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(ht)}]}),St}function uU(Ie,ht){return"Back to reference "+(Ie+1)+(ht>1?"-"+ht:"")}function cU(Ie){const ht=typeof Ie.options.clobberPrefix=="string"?Ie.options.clobberPrefix:"user-content-",St=Ie.options.footnoteBackContent||lU,wt=Ie.options.footnoteBackLabel||uU,lr=Ie.options.footnoteLabel||"Footnotes",vr=Ie.options.footnoteLabelTagName||"h2",Cr=Ie.options.footnoteLabelProperties||{className:["sr-only"]},nn=[];let bn=-1;for(;++bn0&&fo.push({type:"text",value:" "});let Ge=typeof St=="string"?St:St(bn,Qn);typeof Ge=="string"&&(Ge={type:"text",value:Ge}),fo.push({type:"element",tagName:"a",properties:{href:"#"+ht+"fnref-"+_a+(Qn>1?"-"+Qn:""),dataFootnoteBackref:"",ariaLabel:typeof wt=="string"?wt:wt(bn,Qn),className:["data-footnote-backref"]},children:Array.isArray(Ge)?Ge:[Ge]})}const Io=Tn[Tn.length-1];if(Io&&Io.type==="element"&&Io.tagName==="p"){const Ge=Io.children[Io.children.length-1];Ge&&Ge.type==="text"?Ge.value+=" ":Io.children.push({type:"text",value:" "}),Io.children.push(...fo)}else Tn.push(...fo);const bi={type:"element",tagName:"li",properties:{id:ht+"fn-"+_a},children:Ie.wrap(Tn,!0)};Ie.patch(Jr,bi),nn.push(bi)}if(nn.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:vr,properties:{...rM(Cr),id:"footnote-label"},children:[{type:"text",value:lr}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:Ie.wrap(nn,!0)},{type:"text",value:` +`}]}}const I4=(function(Ie){if(Ie==null)return dU;if(typeof Ie=="function")return oM(Ie);if(typeof Ie=="object")return Array.isArray(Ie)?fU(Ie):hU(Ie);if(typeof Ie=="string")return vU(Ie);throw new Error("Expected function, string, or object as test")});function fU(Ie){const ht=[];let St=-1;for(;++St":""))+")"})}return _a;function _a(){let Qn=D4,fo,So,Io;if((!ht||vr(bn,Jr,Tn[Tn.length-1]||void 0))&&(Qn=_U(St(bn,Tn)),Qn[0]===G8))return Qn;if("children"in bn&&bn.children){const bi=bn;if(bi.children&&Qn[0]!==gU)for(So=(wt?bi.children.length:-1)+Cr,Io=Tn.concat(bi);So>-1&&So0&&St.push({type:"text",value:` +`}),St}function X8(Ie){let ht=0,St=Ie.charCodeAt(ht);for(;St===9||St===32;)ht++,St=Ie.charCodeAt(ht);return Ie.slice(ht)}function Y8(Ie,ht){const St=bU(Ie,ht),wt=St.one(Ie,void 0),lr=cU(St),vr=Array.isArray(wt)?{type:"root",children:wt}:wt||{type:"root",children:[]};return lr&&vr.children.push({type:"text",value:` +`},lr),vr}function MU(Ie,ht){return Ie&&"run"in Ie?async function(St,wt){const lr=Y8(St,{file:wt,...ht});await Ie.run(lr,wt)}:function(St,wt){return Y8(St,{file:wt,...Ie||ht})}}function Z8(Ie){if(Ie)throw Ie}var q6,W8;function EU(){if(W8)return q6;W8=1;var Ie=Object.prototype.hasOwnProperty,ht=Object.prototype.toString,St=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,lr=function(Jr){return typeof Array.isArray=="function"?Array.isArray(Jr):ht.call(Jr)==="[object Array]"},vr=function(Jr){if(!Jr||ht.call(Jr)!=="[object Object]")return!1;var Tn=Ie.call(Jr,"constructor"),zn=Jr.constructor&&Jr.constructor.prototype&&Ie.call(Jr.constructor.prototype,"isPrototypeOf");if(Jr.constructor&&!Tn&&!zn)return!1;var _a;for(_a in Jr);return typeof _a>"u"||Ie.call(Jr,_a)},Cr=function(Jr,Tn){St&&Tn.name==="__proto__"?St(Jr,Tn.name,{enumerable:!0,configurable:!0,value:Tn.newValue,writable:!0}):Jr[Tn.name]=Tn.newValue},nn=function(Jr,Tn){if(Tn==="__proto__")if(Ie.call(Jr,Tn)){if(wt)return wt(Jr,Tn).value}else return;return Jr[Tn]};return q6=function bn(){var Jr,Tn,zn,_a,Qn,fo,So=arguments[0],Io=1,bi=arguments.length,Ge=!1;for(typeof So=="boolean"&&(Ge=So,So=arguments[1]||{},Io=2),(So==null||typeof So!="object"&&typeof So!="function")&&(So={});IoCr.length;let bn;nn&&Cr.push(lr);try{bn=Ie.apply(this,Cr)}catch(Jr){const Tn=Jr;if(nn&&St)throw Tn;return lr(Tn)}nn||(bn&&bn.then&&typeof bn.then=="function"?bn.then(vr,lr):bn instanceof Error?lr(bn):vr(bn))}function lr(Cr,...nn){St||(St=!0,ht(Cr,...nn))}function vr(Cr){lr(null,Cr)}}const Ym={basename:PU,dirname:RU,extname:IU,join:DU,sep:"/"};function PU(Ie,ht){if(ht!==void 0&&typeof ht!="string")throw new TypeError('"ext" argument must be a string');PT(Ie);let St=0,wt=-1,lr=Ie.length,vr;if(ht===void 0||ht.length===0||ht.length>Ie.length){for(;lr--;)if(Ie.codePointAt(lr)===47){if(vr){St=lr+1;break}}else wt<0&&(vr=!0,wt=lr+1);return wt<0?"":Ie.slice(St,wt)}if(ht===Ie)return"";let Cr=-1,nn=ht.length-1;for(;lr--;)if(Ie.codePointAt(lr)===47){if(vr){St=lr+1;break}}else Cr<0&&(vr=!0,Cr=lr+1),nn>-1&&(Ie.codePointAt(lr)===ht.codePointAt(nn--)?nn<0&&(wt=lr):(nn=-1,wt=Cr));return St===wt?wt=Cr:wt<0&&(wt=Ie.length),Ie.slice(St,wt)}function RU(Ie){if(PT(Ie),Ie.length===0)return".";let ht=-1,St=Ie.length,wt;for(;--St;)if(Ie.codePointAt(St)===47){if(wt){ht=St;break}}else wt||(wt=!0);return ht<0?Ie.codePointAt(0)===47?"/":".":ht===1&&Ie.codePointAt(0)===47?"//":Ie.slice(0,ht)}function IU(Ie){PT(Ie);let ht=Ie.length,St=-1,wt=0,lr=-1,vr=0,Cr;for(;ht--;){const nn=Ie.codePointAt(ht);if(nn===47){if(Cr){wt=ht+1;break}continue}St<0&&(Cr=!0,St=ht+1),nn===46?lr<0?lr=ht:vr!==1&&(vr=1):lr>-1&&(vr=-1)}return lr<0||St<0||vr===0||vr===1&&lr===St-1&&lr===wt+1?"":Ie.slice(lr,St)}function DU(...Ie){let ht=-1,St;for(;++ht0&&Ie.codePointAt(Ie.length-1)===47&&(St+="/"),ht?"/"+St:St}function OU(Ie,ht){let St="",wt=0,lr=-1,vr=0,Cr=-1,nn,bn;for(;++Cr<=Ie.length;){if(Cr2){if(bn=St.lastIndexOf("/"),bn!==St.length-1){bn<0?(St="",wt=0):(St=St.slice(0,bn),wt=St.length-1-St.lastIndexOf("/")),lr=Cr,vr=0;continue}}else if(St.length>0){St="",wt=0,lr=Cr,vr=0;continue}}ht&&(St=St.length>0?St+"/..":"..",wt=2)}else St.length>0?St+="/"+Ie.slice(lr+1,Cr):St=Ie.slice(lr+1,Cr),wt=Cr-lr-1;lr=Cr,vr=0}else nn===46&&vr>-1?vr++:vr=-1}return St}function PT(Ie){if(typeof Ie!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(Ie))}const FU={cwd:BU};function BU(){return"/"}function lk(Ie){return!!(Ie!==null&&typeof Ie=="object"&&"href"in Ie&&Ie.href&&"protocol"in Ie&&Ie.protocol&&Ie.auth===void 0)}function NU(Ie){if(typeof Ie=="string")Ie=new URL(Ie);else if(!lk(Ie)){const ht=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+Ie+"`");throw ht.code="ERR_INVALID_ARG_TYPE",ht}if(Ie.protocol!=="file:"){const ht=new TypeError("The URL must be of scheme file");throw ht.code="ERR_INVALID_URL_SCHEME",ht}return UU(Ie)}function UU(Ie){if(Ie.hostname!==""){const wt=new TypeError('File URL host must be "localhost" or empty on darwin');throw wt.code="ERR_INVALID_FILE_URL_HOST",wt}const ht=Ie.pathname;let St=-1;for(;++St0){let[Qn,...fo]=Tn;const So=wt[_a][1];sk(So)&&sk(Qn)&&(Qn=V6(!0,So,Qn)),wt[_a]=[Jr,Qn,...fo]}}}}const HU=new Tk().freeze();function Y6(Ie,ht){if(typeof ht!="function")throw new TypeError("Cannot `"+Ie+"` without `parser`")}function Z6(Ie,ht){if(typeof ht!="function")throw new TypeError("Cannot `"+Ie+"` without `compiler`")}function W6(Ie,ht){if(ht)throw new Error("Cannot call `"+Ie+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $8(Ie){if(!sk(Ie)||typeof Ie.type!="string")throw new TypeError("Expected node, got `"+Ie+"`")}function J8(Ie,ht,St){if(!St)throw new Error("`"+Ie+"` finished async. Use `"+ht+"` instead")}function JS(Ie){return GU(Ie)?Ie:new O4(Ie)}function GU(Ie){return!!(Ie&&typeof Ie=="object"&&"message"in Ie&&"messages"in Ie)}function XU(Ie){return typeof Ie=="string"||YU(Ie)}function YU(Ie){return!!(Ie&&typeof Ie=="object"&&"byteLength"in Ie&&"byteOffset"in Ie)}const ZU="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Q8=[],e4={allowDangerousHtml:!0},WU=/^(https?|ircs?|mailto|xmpp)$/i,KU=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $U(Ie){const ht=JU(Ie),St=QU(Ie);return ej(ht.runSync(ht.parse(St),St),Ie)}function JU(Ie){const ht=Ie.rehypePlugins||Q8,St=Ie.remarkPlugins||Q8,wt=Ie.remarkRehypeOptions?{...Ie.remarkRehypeOptions,...e4}:e4;return HU().use(PN).use(St).use(MU,wt).use(ht)}function QU(Ie){const ht=Ie.children||"",St=new O4;return typeof ht=="string"&&(St.value=ht),St}function ej(Ie,ht){const St=ht.allowedElements,wt=ht.allowElement,lr=ht.components,vr=ht.disallowedElements,Cr=ht.skipHtml,nn=ht.unwrapDisallowed,bn=ht.urlTransform||tj;for(const Tn of KU)Object.hasOwn(ht,Tn.from)&&(""+Tn.from+(Tn.to?"use `"+Tn.to+"` instead":"remove it")+ZU+Tn.id,void 0);return z4(Ie,Jr),cF(Ie,{Fragment:Fo.Fragment,components:lr,ignoreInvalidStyle:!0,jsx:Fo.jsx,jsxs:Fo.jsxs,passKeys:!0,passNode:!0});function Jr(Tn,zn,_a){if(Tn.type==="raw"&&_a&&typeof zn=="number")return Cr?_a.children.splice(zn,1):_a.children[zn]={type:"text",value:Tn.value},zn;if(Tn.type==="element"){let Qn;for(Qn in N6)if(Object.hasOwn(N6,Qn)&&Object.hasOwn(Tn.properties,Qn)){const fo=Tn.properties[Qn],So=N6[Qn];(So===null||So.includes(Tn.tagName))&&(Tn.properties[Qn]=bn(String(fo||""),Qn,Tn))}}if(Tn.type==="element"){let Qn=St?!St.includes(Tn.tagName):vr?vr.includes(Tn.tagName):!1;if(!Qn&&wt&&typeof zn=="number"&&(Qn=!wt(Tn,zn,_a)),Qn&&_a&&typeof zn=="number")return nn&&Tn.children?_a.children.splice(zn,1,...Tn.children):_a.children.splice(zn,1),zn}}}function tj(Ie){const ht=Ie.indexOf(":"),St=Ie.indexOf("?"),wt=Ie.indexOf("#"),lr=Ie.indexOf("/");return ht===-1||lr!==-1&&ht>lr||St!==-1&&ht>St||wt!==-1&&ht>wt||WU.test(Ie.slice(0,ht))?Ie:""}const rj=["Univariate","Bivariate"],nj=["Gradient Descent","Nesterov","Newton","Adam","Adagrad","RMSProp","Adadelta"],aj=`# Usage + +This visualizer allows you to define a function and minimize it using one of several iterative optimization algorithms. + +--- + +## Settings + +In this tab, you can: + +- Select a preset function to optimize +- Or choose **--Custom--** to define your own function + +When entering a custom function: + +- Use **\`x\`** for univariate functions +- Use **\`x\`** and **\`y\`** for bivariate functions + +--- + +## Optimize + +In this tab, you can: + +- Step through the optimization process +- See the optimizer’s trajectory + +--- + +## Plot Screen + +The plot is interactive: + +- Click and drag to pan +- Scroll to zoom +- In bivariate mode, click **Update color scale** to rescale the heatmap so that the currently visible minimum and maximum values define the color range +`,ij={"Gradient Descent":{learningRate:"0.1",momentum:"0.0"},Nesterov:{learningRate:"0.1",momentum:"0.0"},Adam:{learningRate:"0.1",beta1:"0.9",beta2:"0.999",epsilon:"1e-8"},Adagrad:{learningRate:"0.1",epsilon:"1e-8"},RMSProp:{learningRate:"0.1",beta:"0.9",epsilon:"1e-8"},Adadelta:{beta:"0.9",epsilon:"1e-8"},Newton:{}},K6={"--Custom--":"x^2",Quadratic:"x^2",Cubic:"x^3 - 3x^2 + 2x",Quartic:"x^4 - 4x^3 + 6x^2 - 4x + 1",Sine:"sin(x)",Exponential:"exp(x)"},$6={"--Custom--":"x^2 + 3y^2",Quadratic:"x^2 + y^2",Ackley:"-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20",Rasteringin:"20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))",Rosenbrock:"(1 - x)^2 + 100(y - x^2)^2"};function oj({settings:Ie,setSettings:ht,onRandomInitialPoint:St,trajectoryValues:wt,onReset:lr,onNextStep:vr,onPrevStep:Cr}){const nn=["Settings","Optimize","Usage"],[bn,Jr]=up.useState("Settings");function Tn(Fi,Ts){if(Fi==="algorithm"){const Mi=ij[Ts];ht({...Ie,algorithm:Ts,...Mi})}else ht({...Ie,[Fi]:Ts})}const[zn,_a]=up.useState("--Custom--");function Qn(Fi){_a(Fi);const Ts=Ie.mode==="Bivariate"?$6[Fi]:K6[Fi];Tn("functionExpr",Ts)}function fo(Fi){const Ts="--Custom--",Mi=Fi==="Bivariate"?$6[Ts]:K6[Ts];ht({...Ie,mode:Fi,functionExpr:Mi}),_a(Ts)}function So(Fi){return Fi&&Fi.length>0?Fi[Fi.length-1]:null}const Io=So(wt?.x),bi=So(wt?.y),Ge=So(wt?.derivative),ko=So(wt?.secondDerivative),Tl=So(wt?.z),Mo=So(wt?.gradient),yi=So(wt?.hessian);return Fo.jsxs(J6,{className:"flex flex-col h-full p-4 gap-2 min-w-0 min-h-0 overflow-auto",children:[Fo.jsx(DO,{tabs:nn,activeTab:bn,onChange:Jr}),Fo.jsxs("div",{className:"flex flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[bn==="Settings"&&Fo.jsxs(Fo.Fragment,{children:[Fo.jsx(IO,{label:"Problem Type",options:rj,activeOption:Ie.mode,onChange:fo}),Fo.jsx(m8,{label:"Function",options:Ie.mode==="Bivariate"?Object.keys($6):Object.keys(K6),activeOption:zn,onChange:Qn}),Fo.jsx(pd,{label:"Function Expression",value:Ie.functionExpr,onChange:Fi=>Tn("functionExpr",Fi),readonly:zn!=="--Custom--",rows:3}),Fo.jsx(m8,{label:"Algorithm",options:nj,activeOption:Ie.algorithm,onChange:Fi=>Tn("algorithm",Fi)}),Fo.jsxs("div",{className:`${Ie.mode==="Bivariate"?"grid grid-cols-2 gap-2":""}`,children:[Fo.jsx(pd,{label:"Initial X",value:Ie.x0,onChange:Fi=>Tn("x0",Fi)}),Ie.mode==="Bivariate"&&Fo.jsx(pd,{label:"Initial Y",value:Ie.y0||"",onChange:Fi=>Tn("y0",Fi)})]}),Fo.jsx(ST,{label:"Random Initial Point",onClick:St}),Fo.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[["Gradient Descent","Nesterov","Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Fo.jsx(Fo.Fragment,{children:Fo.jsx(pd,{label:"Learning Rate",value:Ie.learningRate,onChange:Fi=>Tn("learningRate",Fi)})}),["Gradient Descent","Nesterov"].includes(Ie.algorithm)&&Fo.jsx(Fo.Fragment,{children:Fo.jsx(pd,{label:"Momentum",value:Ie.momentum,onChange:Fi=>Tn("momentum",Fi)})}),Ie.algorithm==="Adam"&&Fo.jsxs(Fo.Fragment,{children:[Fo.jsx(pd,{label:"Beta 1",value:Ie.beta1,onChange:Fi=>Tn("beta1",Fi)}),Fo.jsx(pd,{label:"Beta 2",value:Ie.beta2,onChange:Fi=>Tn("beta2",Fi)})]}),["RMSProp","Adadelta"].includes(Ie.algorithm)&&Fo.jsx(Fo.Fragment,{children:Fo.jsx(pd,{label:"Beta",value:Ie.beta,onChange:Fi=>Tn("beta",Fi)})}),["Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Fo.jsx(Fo.Fragment,{children:Fo.jsx(pd,{label:"Epsilon",value:Ie.epsilon,onChange:Fi=>Tn("epsilon",Fi)})})]})]}),bn==="Optimize"&&Fo.jsxs(Fo.Fragment,{children:[Ie.mode==="Univariate"&&Fo.jsxs(Fo.Fragment,{children:[Fo.jsx(pd,{label:"Current X",value:Io!==null?Io.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Y",value:bi!==null?bi.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Derivative",value:Ge!==null?Ge.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Second Derivative",value:ko!==null?ko.toFixed(4):"",readonly:!0})]}),Ie.mode==="Bivariate"&&Fo.jsxs(Fo.Fragment,{children:[Fo.jsx(pd,{label:"Current X",value:Io!==null?Io.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Y",value:bi!==null?bi.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Z",value:Tl!==null?Tl.toFixed(4):"",readonly:!0}),Fo.jsx(pd,{label:"Current Gradient",value:Mo!==null?`[${Mo.map(Fi=>Fi.toFixed(4)).join(", ")}]`:"",readonly:!0}),Fo.jsx(pd,{label:"Current Hessian",value:yi!==null?`[${yi.map(Fi=>`[${Fi.map(Ts=>Ts.toFixed(4)).join(", ")}]`).join(", ")}]`:"",readonly:!0})]}),Fo.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[Fo.jsx(ST,{label:"Next Step",onClick:vr}),Fo.jsx(ST,{label:"Previous Step",onClick:Cr})]}),Fo.jsx(ST,{label:"Reset",onClick:lr})]}),bn==="Usage"&&Fo.jsx($U,{components:{h1:({children:Fi})=>Fo.jsx("h1",{className:"text-2xl font-bold mt-4 mb-2",children:Fi}),h2:({children:Fi})=>Fo.jsx("h2",{className:"text-xl font-semibold mt-4 mb-2",children:Fi}),h3:({children:Fi})=>Fo.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2",children:Fi}),p:({children:Fi})=>Fo.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:Fi}),ul:({children:Fi})=>Fo.jsx("ul",{className:"list-disc pl-5 mb-3",children:Fi}),ol:({children:Fi})=>Fo.jsx("ol",{className:"list-decimal pl-5 mb-3",children:Fi}),li:({children:Fi})=>Fo.jsx("li",{className:"mb-1",children:Fi})},children:aj})]})]})}function sj(Ie){return new Worker("/assets/pyodide.worker-CqQKSeoe.js",{name:Ie?.name})}function lj(Ie){const[ht,St]=up.useState({}),[wt,lr]=up.useState(!0),vr=up.useRef(null);function Cr(Tn){vr.current&&vr.current.postMessage({type:"INIT",settings:Tn})}function nn(){vr.current&&vr.current.postMessage({type:"NEXT_STEP"})}function bn(){vr.current&&vr.current.postMessage({type:"PREV_STEP"})}function Jr(){vr.current&&vr.current.postMessage({type:"RESET"})}return up.useEffect(()=>{const Tn=new sj;return vr.current=Tn,Tn.onmessage=zn=>{const _a=zn.data;_a.type==="READY"?(console.log("Pyodide is ready"),lr(!1),Cr(Ie)):_a.type==="RESULT"&&St(Qn=>({functionValues:_a.data.functionValues||Qn.functionValues,trajectoryValues:_a.data.trajectoryValues||Qn.trajectoryValues}))},()=>{Tn.terminate()}},[]),{isLoading:wt,plotData:ht,sendInit:Cr,sendReset:Jr,sendNextStep:nn,sendPrevStep:bn}}const uj={mode:"Univariate",functionExpr:"x^2",algorithm:"Gradient Descent",x0:"0.5",y0:"0.5",learningRate:"0.1",momentum:"0.0"},cj=[-1,1],fj=[-1,1];function hj(){const[Ie,ht]=up.useState(uj),St=up.useRef(cj),wt=up.useRef(fj),lr={...Ie,xlim:St.current,ylim:wt.current};function vr(Jr){ht(Jr),bn.sendInit({...Jr,xlim:St.current,ylim:wt.current})}function Cr(Jr,Tn){St.current=Jr,wt.current=Tn,bn.sendInit({...Ie,xlim:Jr,ylim:Tn})}function nn(){const Jr=St.current[1]-St.current[0],Tn=wt.current[1]-wt.current[0],zn=(St.current[0]+Math.random()*Jr*.95).toFixed(2),_a=(wt.current[0]+Math.random()*Tn*.95).toFixed(2),Qn={...Ie,x0:zn,y0:_a};vr(Qn)}const bn=lj(lr);return Fo.jsxs("div",{className:"grid grid-cols-[1fr_12fr_1fr] lg:h-dvh bg-stone-50",children:[Fo.jsx("div",{}),Fo.jsxs("div",{className:"flex flex-col gap-6 p-6 min-h-0",children:[Fo.jsx("div",{className:"title",children:"Optimization Trajectory Visualizer"}),Fo.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-12 flex-1 min-h-0 overflow-auto",children:[Fo.jsx(zO,{data:bn.plotData,xlim:St.current,ylim:wt.current,setAxisLimits:Cr}),Fo.jsx(oj,{settings:Ie,setSettings:vr,onRandomInitialPoint:nn,trajectoryValues:bn.plotData.trajectoryValues,onReset:()=>bn.sendReset(),onNextStep:()=>bn.sendNextStep(),onPrevStep:()=>bn.sendPrevStep()})]})]}),Fo.jsx("div",{})]})}AO.createRoot(document.getElementById("root")).render(Fo.jsx(up.StrictMode,{children:Fo.jsx(hj,{})}));